1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[doc = " Error codes for MetricEventLogger operations.\n"]
8 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9 #[repr(i32)]
10 pub enum Error {
11 InvalidArguments = 1,
12 EventTooBig = 2,
13 BufferFull = 3,
14 ShutDown = 4,
15 InternalError = -1,
16 }
17 impl ::core::convert::TryFrom<i32> for Error {
18 type Error = ::fidl_next::UnknownStrictEnumMemberError;
19 fn try_from(
20 value: i32,
21 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
22 match value {
23 1 => Ok(Self::InvalidArguments),
24 2 => Ok(Self::EventTooBig),
25 3 => Ok(Self::BufferFull),
26 4 => Ok(Self::ShutDown),
27 -1 => Ok(Self::InternalError),
28
29 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
30 }
31 }
32 }
33
34 impl ::std::convert::From<Error> for i32 {
35 fn from(value: Error) -> Self {
36 match value {
37 Error::InvalidArguments => 1,
38 Error::EventTooBig => 2,
39 Error::BufferFull => 3,
40 Error::ShutDown => 4,
41 Error::InternalError => -1,
42 }
43 }
44 }
45
46 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Error, ___E> for Error
47 where
48 ___E: ?Sized,
49 {
50 #[inline]
51 fn encode(
52 self,
53 encoder: &mut ___E,
54 out: &mut ::core::mem::MaybeUninit<crate::wire::Error>,
55 _: (),
56 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
57 ::fidl_next::Encode::encode(&self, encoder, out, ())
58 }
59 }
60
61 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Error, ___E> for &'a Error
62 where
63 ___E: ?Sized,
64 {
65 #[inline]
66 fn encode(
67 self,
68 encoder: &mut ___E,
69 out: &mut ::core::mem::MaybeUninit<crate::wire::Error>,
70 _: (),
71 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
72 ::fidl_next::munge!(let crate::wire::Error { value } = out);
73 let _ = value.write(::fidl_next::wire::Int32::from(match *self {
74 Error::InvalidArguments => 1,
75
76 Error::EventTooBig => 2,
77
78 Error::BufferFull => 3,
79
80 Error::ShutDown => 4,
81
82 Error::InternalError => -1,
83 }));
84
85 Ok(())
86 }
87 }
88
89 impl ::core::convert::From<crate::wire::Error> for Error {
90 fn from(wire: crate::wire::Error) -> Self {
91 match i32::from(wire.value) {
92 1 => Self::InvalidArguments,
93
94 2 => Self::EventTooBig,
95
96 3 => Self::BufferFull,
97
98 4 => Self::ShutDown,
99
100 -1 => Self::InternalError,
101
102 _ => unsafe { ::core::hint::unreachable_unchecked() },
103 }
104 }
105 }
106
107 impl ::fidl_next::FromWire<crate::wire::Error> for Error {
108 #[inline]
109 fn from_wire(wire: crate::wire::Error) -> Self {
110 Self::from(wire)
111 }
112 }
113
114 impl ::fidl_next::FromWireRef<crate::wire::Error> for Error {
115 #[inline]
116 fn from_wire_ref(wire: &crate::wire::Error) -> Self {
117 Self::from(*wire)
118 }
119 }
120
121 #[doc = " A vector of event codes. When used in one of the Log*() calls below,\n there must be one event code for each dimension of the metric whose\n metric_id is supplied, or else the call will return INVALID_ARGUMENTS.\n"]
122 pub type EventVector = ::std::vec::Vec<u32>;
123
124 #[doc = " One bucket of a histogram, used by the method LogIntegerHistogram.\n"]
125 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
126 pub struct HistogramBucket {
127 pub index: u32,
128
129 pub count: u64,
130 }
131
132 unsafe impl<___E> ::fidl_next::Encode<crate::wire::HistogramBucket, ___E> for HistogramBucket
133 where
134 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
135 {
136 #[inline]
137 fn encode(
138 self,
139 encoder_: &mut ___E,
140 out_: &mut ::core::mem::MaybeUninit<crate::wire::HistogramBucket>,
141 _: (),
142 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
143 ::fidl_next::munge! {
144 let crate::wire::HistogramBucket {
145 index,
146 count,
147
148 } = out_;
149 }
150
151 ::fidl_next::Encode::encode(self.index, encoder_, index, ())?;
152
153 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(index.as_mut_ptr()) };
154
155 ::fidl_next::Encode::encode(self.count, encoder_, count, ())?;
156
157 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(count.as_mut_ptr()) };
158
159 Ok(())
160 }
161 }
162
163 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::HistogramBucket, ___E>
164 for &'a HistogramBucket
165 where
166 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
167 {
168 #[inline]
169 fn encode(
170 self,
171 encoder_: &mut ___E,
172 out_: &mut ::core::mem::MaybeUninit<crate::wire::HistogramBucket>,
173 _: (),
174 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
175 ::fidl_next::munge! {
176 let crate::wire::HistogramBucket {
177 index,
178 count,
179
180 } = out_;
181 }
182
183 ::fidl_next::Encode::encode(&self.index, encoder_, index, ())?;
184
185 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(index.as_mut_ptr()) };
186
187 ::fidl_next::Encode::encode(&self.count, encoder_, count, ())?;
188
189 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(count.as_mut_ptr()) };
190
191 Ok(())
192 }
193 }
194
195 unsafe impl<___E>
196 ::fidl_next::EncodeOption<
197 ::fidl_next::wire::Box<'static, crate::wire::HistogramBucket>,
198 ___E,
199 > for HistogramBucket
200 where
201 ___E: ::fidl_next::Encoder + ?Sized,
202 HistogramBucket: ::fidl_next::Encode<crate::wire::HistogramBucket, ___E>,
203 {
204 #[inline]
205 fn encode_option(
206 this: ::core::option::Option<Self>,
207 encoder: &mut ___E,
208 out: &mut ::core::mem::MaybeUninit<
209 ::fidl_next::wire::Box<'static, crate::wire::HistogramBucket>,
210 >,
211 _: (),
212 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
213 if let Some(inner) = this {
214 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
215 ::fidl_next::wire::Box::encode_present(out);
216 } else {
217 ::fidl_next::wire::Box::encode_absent(out);
218 }
219
220 Ok(())
221 }
222 }
223
224 unsafe impl<'a, ___E>
225 ::fidl_next::EncodeOption<
226 ::fidl_next::wire::Box<'static, crate::wire::HistogramBucket>,
227 ___E,
228 > for &'a HistogramBucket
229 where
230 ___E: ::fidl_next::Encoder + ?Sized,
231 &'a HistogramBucket: ::fidl_next::Encode<crate::wire::HistogramBucket, ___E>,
232 {
233 #[inline]
234 fn encode_option(
235 this: ::core::option::Option<Self>,
236 encoder: &mut ___E,
237 out: &mut ::core::mem::MaybeUninit<
238 ::fidl_next::wire::Box<'static, crate::wire::HistogramBucket>,
239 >,
240 _: (),
241 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
242 if let Some(inner) = this {
243 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
244 ::fidl_next::wire::Box::encode_present(out);
245 } else {
246 ::fidl_next::wire::Box::encode_absent(out);
247 }
248
249 Ok(())
250 }
251 }
252
253 impl ::fidl_next::FromWire<crate::wire::HistogramBucket> for HistogramBucket {
254 #[inline]
255 fn from_wire(wire: crate::wire::HistogramBucket) -> Self {
256 Self {
257 index: ::fidl_next::FromWire::from_wire(wire.index),
258
259 count: ::fidl_next::FromWire::from_wire(wire.count),
260 }
261 }
262 }
263
264 impl ::fidl_next::FromWireRef<crate::wire::HistogramBucket> for HistogramBucket {
265 #[inline]
266 fn from_wire_ref(wire: &crate::wire::HistogramBucket) -> Self {
267 Self {
268 index: ::fidl_next::FromWireRef::from_wire_ref(&wire.index),
269
270 count: ::fidl_next::FromWireRef::from_wire_ref(&wire.count),
271 }
272 }
273 }
274
275 #[doc = " A histogram that assigns a count to each of several integer ranges.\n To save space/memory/bandwidth, each bucket index should only be included\n once, and empty buckets should not be included. The order of the vector\n is immaterial.\n"]
276 pub type IntegerHistogram = ::std::vec::Vec<crate::natural::HistogramBucket>;
277
278 #[doc = " The variadic part of a MetricEvent.\n"]
279 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
280 pub enum MetricEventPayload {
281 Count(u64),
282
283 IntegerValue(i64),
284
285 Histogram(::std::vec::Vec<crate::natural::HistogramBucket>),
286
287 StringValue(::std::string::String),
288
289 UnknownOrdinal_(u64),
290 }
291
292 impl MetricEventPayload {
293 pub fn is_unknown(&self) -> bool {
294 #[allow(unreachable_patterns)]
295 match self {
296 Self::UnknownOrdinal_(_) => true,
297 _ => false,
298 }
299 }
300 }
301
302 unsafe impl<___E> ::fidl_next::Encode<crate::wire::MetricEventPayload<'static>, ___E>
303 for MetricEventPayload
304 where
305 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
306 ___E: ::fidl_next::Encoder,
307 {
308 #[inline]
309 fn encode(
310 self,
311 encoder: &mut ___E,
312 out: &mut ::core::mem::MaybeUninit<crate::wire::MetricEventPayload<'static>>,
313 _: (),
314 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
315 ::fidl_next::munge!(let crate::wire::MetricEventPayload { raw, _phantom: _ } = out);
316
317 match self {
318 Self::Count(value) => ::fidl_next::wire::Union::encode_as::<
319 ___E,
320 ::fidl_next::wire::Uint64,
321 >(value, 1, encoder, raw, ())?,
322
323 Self::IntegerValue(value) => ::fidl_next::wire::Union::encode_as::<
324 ___E,
325 ::fidl_next::wire::Int64,
326 >(value, 2, encoder, raw, ())?,
327
328 Self::Histogram(value) => ::fidl_next::wire::Union::encode_as::<
329 ___E,
330 ::fidl_next::wire::Vector<'static, crate::wire::HistogramBucket>,
331 >(value, 3, encoder, raw, (500, ()))?,
332
333 Self::StringValue(value) => ::fidl_next::wire::Union::encode_as::<
334 ___E,
335 ::fidl_next::wire::String<'static>,
336 >(value, 4, encoder, raw, 256)?,
337
338 Self::UnknownOrdinal_(ordinal) => {
339 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
340 }
341 }
342
343 Ok(())
344 }
345 }
346
347 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::MetricEventPayload<'static>, ___E>
348 for &'a MetricEventPayload
349 where
350 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
351 ___E: ::fidl_next::Encoder,
352 {
353 #[inline]
354 fn encode(
355 self,
356 encoder: &mut ___E,
357 out: &mut ::core::mem::MaybeUninit<crate::wire::MetricEventPayload<'static>>,
358 _: (),
359 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
360 ::fidl_next::munge!(let crate::wire::MetricEventPayload { raw, _phantom: _ } = out);
361
362 match self {
363 MetricEventPayload::Count(value) => ::fidl_next::wire::Union::encode_as::<
364 ___E,
365 ::fidl_next::wire::Uint64,
366 >(value, 1, encoder, raw, ())?,
367
368 MetricEventPayload::IntegerValue(value) => ::fidl_next::wire::Union::encode_as::<
369 ___E,
370 ::fidl_next::wire::Int64,
371 >(
372 value, 2, encoder, raw, ()
373 )?,
374
375 MetricEventPayload::Histogram(value) => {
376 ::fidl_next::wire::Union::encode_as::<
377 ___E,
378 ::fidl_next::wire::Vector<'static, crate::wire::HistogramBucket>,
379 >(value, 3, encoder, raw, (500, ()))?
380 }
381
382 MetricEventPayload::StringValue(value) => {
383 ::fidl_next::wire::Union::encode_as::<___E, ::fidl_next::wire::String<'static>>(
384 value, 4, encoder, raw, 256,
385 )?
386 }
387
388 MetricEventPayload::UnknownOrdinal_(ordinal) => {
389 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
390 }
391 }
392
393 Ok(())
394 }
395 }
396
397 unsafe impl<___E>
398 ::fidl_next::EncodeOption<crate::wire_optional::MetricEventPayload<'static>, ___E>
399 for MetricEventPayload
400 where
401 ___E: ?Sized,
402 MetricEventPayload: ::fidl_next::Encode<crate::wire::MetricEventPayload<'static>, ___E>,
403 {
404 #[inline]
405 fn encode_option(
406 this: ::core::option::Option<Self>,
407 encoder: &mut ___E,
408 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::MetricEventPayload<'static>>,
409 _: (),
410 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
411 ::fidl_next::munge!(let crate::wire_optional::MetricEventPayload { raw, _phantom: _ } = &mut *out);
412
413 if let Some(inner) = this {
414 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
415 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
416 } else {
417 ::fidl_next::wire::Union::encode_absent(raw);
418 }
419
420 Ok(())
421 }
422 }
423
424 unsafe impl<'a, ___E>
425 ::fidl_next::EncodeOption<crate::wire_optional::MetricEventPayload<'static>, ___E>
426 for &'a MetricEventPayload
427 where
428 ___E: ?Sized,
429 &'a MetricEventPayload: ::fidl_next::Encode<crate::wire::MetricEventPayload<'static>, ___E>,
430 {
431 #[inline]
432 fn encode_option(
433 this: ::core::option::Option<Self>,
434 encoder: &mut ___E,
435 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::MetricEventPayload<'static>>,
436 _: (),
437 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
438 ::fidl_next::munge!(let crate::wire_optional::MetricEventPayload { raw, _phantom: _ } = &mut *out);
439
440 if let Some(inner) = this {
441 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
442 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
443 } else {
444 ::fidl_next::wire::Union::encode_absent(raw);
445 }
446
447 Ok(())
448 }
449 }
450
451 impl<'de> ::fidl_next::FromWire<crate::wire::MetricEventPayload<'de>> for MetricEventPayload {
452 #[inline]
453 fn from_wire(wire: crate::wire::MetricEventPayload<'de>) -> Self {
454 let wire = ::core::mem::ManuallyDrop::new(wire);
455 match wire.raw.ordinal() {
456 1 => Self::Count(::fidl_next::FromWire::from_wire(unsafe {
457 wire.raw.get().read_unchecked::<::fidl_next::wire::Uint64>()
458 })),
459
460 2 => Self::IntegerValue(::fidl_next::FromWire::from_wire(unsafe {
461 wire.raw.get().read_unchecked::<::fidl_next::wire::Int64>()
462 })),
463
464 3 => Self::Histogram(::fidl_next::FromWire::from_wire(unsafe {
465 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::HistogramBucket>>()
466 })),
467
468 4 => Self::StringValue(::fidl_next::FromWire::from_wire(unsafe {
469 wire.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
470 })),
471
472 ord => return Self::UnknownOrdinal_(ord as u64),
473 }
474 }
475 }
476
477 impl<'de> ::fidl_next::FromWireRef<crate::wire::MetricEventPayload<'de>> for MetricEventPayload {
478 #[inline]
479 fn from_wire_ref(wire: &crate::wire::MetricEventPayload<'de>) -> Self {
480 match wire.raw.ordinal() {
481 1 => Self::Count(::fidl_next::FromWireRef::from_wire_ref(unsafe {
482 wire.raw.get().deref_unchecked::<::fidl_next::wire::Uint64>()
483 })),
484
485 2 => Self::IntegerValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
486 wire.raw.get().deref_unchecked::<::fidl_next::wire::Int64>()
487 })),
488
489 3 => Self::Histogram(::fidl_next::FromWireRef::from_wire_ref(unsafe {
490 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::HistogramBucket>>()
491 })),
492
493 4 => Self::StringValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
494 wire.raw.get().deref_unchecked::<::fidl_next::wire::String<'de>>()
495 })),
496
497 ord => return Self::UnknownOrdinal_(ord as u64),
498 }
499 }
500 }
501
502 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::MetricEventPayload<'de>>
503 for MetricEventPayload
504 {
505 #[inline]
506 fn from_wire_option(
507 wire: crate::wire_optional::MetricEventPayload<'de>,
508 ) -> ::core::option::Option<Self> {
509 if let Some(inner) = wire.into_option() {
510 Some(::fidl_next::FromWire::from_wire(inner))
511 } else {
512 None
513 }
514 }
515 }
516
517 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::MetricEventPayload<'de>>
518 for Box<MetricEventPayload>
519 {
520 #[inline]
521 fn from_wire_option(
522 wire: crate::wire_optional::MetricEventPayload<'de>,
523 ) -> ::core::option::Option<Self> {
524 <MetricEventPayload as ::fidl_next::FromWireOption<
525 crate::wire_optional::MetricEventPayload<'de>,
526 >>::from_wire_option(wire)
527 .map(Box::new)
528 }
529 }
530
531 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::MetricEventPayload<'de>>
532 for Box<MetricEventPayload>
533 {
534 #[inline]
535 fn from_wire_option_ref(
536 wire: &crate::wire_optional::MetricEventPayload<'de>,
537 ) -> ::core::option::Option<Self> {
538 if let Some(inner) = wire.as_ref() {
539 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
540 } else {
541 None
542 }
543 }
544 }
545
546 #[doc = " A specification of an event that occurred to be passed to LogMetricEvents().\n"]
547 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
548 pub struct MetricEvent {
549 pub metric_id: u32,
550
551 pub event_codes: ::std::vec::Vec<u32>,
552
553 pub payload: crate::natural::MetricEventPayload,
554 }
555
556 unsafe impl<___E> ::fidl_next::Encode<crate::wire::MetricEvent<'static>, ___E> for MetricEvent
557 where
558 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
559 ___E: ::fidl_next::Encoder,
560 {
561 #[inline]
562 fn encode(
563 self,
564 encoder_: &mut ___E,
565 out_: &mut ::core::mem::MaybeUninit<crate::wire::MetricEvent<'static>>,
566 _: (),
567 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
568 ::fidl_next::munge! {
569 let crate::wire::MetricEvent {
570 metric_id,
571 event_codes,
572 payload,
573
574 } = out_;
575 }
576
577 ::fidl_next::Encode::encode(self.metric_id, encoder_, metric_id, ())?;
578
579 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(metric_id.as_mut_ptr()) };
580
581 ::fidl_next::Encode::encode(self.event_codes, encoder_, event_codes, (10, ()))?;
582
583 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(event_codes.as_mut_ptr()) };
584 ::fidl_next::Constrained::validate(_field, (10, ()))?;
585
586 ::fidl_next::Encode::encode(self.payload, encoder_, payload, ())?;
587
588 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(payload.as_mut_ptr()) };
589
590 Ok(())
591 }
592 }
593
594 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::MetricEvent<'static>, ___E>
595 for &'a MetricEvent
596 where
597 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
598 ___E: ::fidl_next::Encoder,
599 {
600 #[inline]
601 fn encode(
602 self,
603 encoder_: &mut ___E,
604 out_: &mut ::core::mem::MaybeUninit<crate::wire::MetricEvent<'static>>,
605 _: (),
606 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
607 ::fidl_next::munge! {
608 let crate::wire::MetricEvent {
609 metric_id,
610 event_codes,
611 payload,
612
613 } = out_;
614 }
615
616 ::fidl_next::Encode::encode(&self.metric_id, encoder_, metric_id, ())?;
617
618 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(metric_id.as_mut_ptr()) };
619
620 ::fidl_next::Encode::encode(&self.event_codes, encoder_, event_codes, (10, ()))?;
621
622 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(event_codes.as_mut_ptr()) };
623 ::fidl_next::Constrained::validate(_field, (10, ()))?;
624
625 ::fidl_next::Encode::encode(&self.payload, encoder_, payload, ())?;
626
627 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(payload.as_mut_ptr()) };
628
629 Ok(())
630 }
631 }
632
633 unsafe impl<___E>
634 ::fidl_next::EncodeOption<
635 ::fidl_next::wire::Box<'static, crate::wire::MetricEvent<'static>>,
636 ___E,
637 > for MetricEvent
638 where
639 ___E: ::fidl_next::Encoder + ?Sized,
640 MetricEvent: ::fidl_next::Encode<crate::wire::MetricEvent<'static>, ___E>,
641 {
642 #[inline]
643 fn encode_option(
644 this: ::core::option::Option<Self>,
645 encoder: &mut ___E,
646 out: &mut ::core::mem::MaybeUninit<
647 ::fidl_next::wire::Box<'static, crate::wire::MetricEvent<'static>>,
648 >,
649 _: (),
650 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
651 if let Some(inner) = this {
652 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
653 ::fidl_next::wire::Box::encode_present(out);
654 } else {
655 ::fidl_next::wire::Box::encode_absent(out);
656 }
657
658 Ok(())
659 }
660 }
661
662 unsafe impl<'a, ___E>
663 ::fidl_next::EncodeOption<
664 ::fidl_next::wire::Box<'static, crate::wire::MetricEvent<'static>>,
665 ___E,
666 > for &'a MetricEvent
667 where
668 ___E: ::fidl_next::Encoder + ?Sized,
669 &'a MetricEvent: ::fidl_next::Encode<crate::wire::MetricEvent<'static>, ___E>,
670 {
671 #[inline]
672 fn encode_option(
673 this: ::core::option::Option<Self>,
674 encoder: &mut ___E,
675 out: &mut ::core::mem::MaybeUninit<
676 ::fidl_next::wire::Box<'static, crate::wire::MetricEvent<'static>>,
677 >,
678 _: (),
679 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
680 if let Some(inner) = this {
681 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
682 ::fidl_next::wire::Box::encode_present(out);
683 } else {
684 ::fidl_next::wire::Box::encode_absent(out);
685 }
686
687 Ok(())
688 }
689 }
690
691 impl<'de> ::fidl_next::FromWire<crate::wire::MetricEvent<'de>> for MetricEvent {
692 #[inline]
693 fn from_wire(wire: crate::wire::MetricEvent<'de>) -> Self {
694 Self {
695 metric_id: ::fidl_next::FromWire::from_wire(wire.metric_id),
696
697 event_codes: ::fidl_next::FromWire::from_wire(wire.event_codes),
698
699 payload: ::fidl_next::FromWire::from_wire(wire.payload),
700 }
701 }
702 }
703
704 impl<'de> ::fidl_next::FromWireRef<crate::wire::MetricEvent<'de>> for MetricEvent {
705 #[inline]
706 fn from_wire_ref(wire: &crate::wire::MetricEvent<'de>) -> Self {
707 Self {
708 metric_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.metric_id),
709
710 event_codes: ::fidl_next::FromWireRef::from_wire_ref(&wire.event_codes),
711
712 payload: ::fidl_next::FromWireRef::from_wire_ref(&wire.payload),
713 }
714 }
715 }
716
717 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
718 pub struct MetricEventLoggerLogOccurrenceRequest {
719 pub metric_id: u32,
720
721 pub count: u64,
722
723 pub event_codes: ::std::vec::Vec<u32>,
724 }
725
726 unsafe impl<___E>
727 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>, ___E>
728 for MetricEventLoggerLogOccurrenceRequest
729 where
730 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
731 ___E: ::fidl_next::Encoder,
732 {
733 #[inline]
734 fn encode(
735 self,
736 encoder_: &mut ___E,
737 out_: &mut ::core::mem::MaybeUninit<
738 crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>,
739 >,
740 _: (),
741 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
742 ::fidl_next::munge! {
743 let crate::wire::MetricEventLoggerLogOccurrenceRequest {
744 metric_id,
745 count,
746 event_codes,
747
748 } = out_;
749 }
750
751 ::fidl_next::Encode::encode(self.metric_id, encoder_, metric_id, ())?;
752
753 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(metric_id.as_mut_ptr()) };
754
755 ::fidl_next::Encode::encode(self.count, encoder_, count, ())?;
756
757 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(count.as_mut_ptr()) };
758
759 ::fidl_next::Encode::encode(self.event_codes, encoder_, event_codes, (10, ()))?;
760
761 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(event_codes.as_mut_ptr()) };
762 ::fidl_next::Constrained::validate(_field, (10, ()))?;
763
764 Ok(())
765 }
766 }
767
768 unsafe impl<'a, ___E>
769 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>, ___E>
770 for &'a MetricEventLoggerLogOccurrenceRequest
771 where
772 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
773 ___E: ::fidl_next::Encoder,
774 {
775 #[inline]
776 fn encode(
777 self,
778 encoder_: &mut ___E,
779 out_: &mut ::core::mem::MaybeUninit<
780 crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>,
781 >,
782 _: (),
783 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
784 ::fidl_next::munge! {
785 let crate::wire::MetricEventLoggerLogOccurrenceRequest {
786 metric_id,
787 count,
788 event_codes,
789
790 } = out_;
791 }
792
793 ::fidl_next::Encode::encode(&self.metric_id, encoder_, metric_id, ())?;
794
795 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(metric_id.as_mut_ptr()) };
796
797 ::fidl_next::Encode::encode(&self.count, encoder_, count, ())?;
798
799 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(count.as_mut_ptr()) };
800
801 ::fidl_next::Encode::encode(&self.event_codes, encoder_, event_codes, (10, ()))?;
802
803 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(event_codes.as_mut_ptr()) };
804 ::fidl_next::Constrained::validate(_field, (10, ()))?;
805
806 Ok(())
807 }
808 }
809
810 unsafe impl<___E>
811 ::fidl_next::EncodeOption<
812 ::fidl_next::wire::Box<
813 'static,
814 crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>,
815 >,
816 ___E,
817 > for MetricEventLoggerLogOccurrenceRequest
818 where
819 ___E: ::fidl_next::Encoder + ?Sized,
820 MetricEventLoggerLogOccurrenceRequest:
821 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>, ___E>,
822 {
823 #[inline]
824 fn encode_option(
825 this: ::core::option::Option<Self>,
826 encoder: &mut ___E,
827 out: &mut ::core::mem::MaybeUninit<
828 ::fidl_next::wire::Box<
829 'static,
830 crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>,
831 >,
832 >,
833 _: (),
834 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
835 if let Some(inner) = this {
836 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
837 ::fidl_next::wire::Box::encode_present(out);
838 } else {
839 ::fidl_next::wire::Box::encode_absent(out);
840 }
841
842 Ok(())
843 }
844 }
845
846 unsafe impl<'a, ___E>
847 ::fidl_next::EncodeOption<
848 ::fidl_next::wire::Box<
849 'static,
850 crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>,
851 >,
852 ___E,
853 > for &'a MetricEventLoggerLogOccurrenceRequest
854 where
855 ___E: ::fidl_next::Encoder + ?Sized,
856 &'a MetricEventLoggerLogOccurrenceRequest:
857 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>, ___E>,
858 {
859 #[inline]
860 fn encode_option(
861 this: ::core::option::Option<Self>,
862 encoder: &mut ___E,
863 out: &mut ::core::mem::MaybeUninit<
864 ::fidl_next::wire::Box<
865 'static,
866 crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>,
867 >,
868 >,
869 _: (),
870 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
871 if let Some(inner) = this {
872 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
873 ::fidl_next::wire::Box::encode_present(out);
874 } else {
875 ::fidl_next::wire::Box::encode_absent(out);
876 }
877
878 Ok(())
879 }
880 }
881
882 impl<'de> ::fidl_next::FromWire<crate::wire::MetricEventLoggerLogOccurrenceRequest<'de>>
883 for MetricEventLoggerLogOccurrenceRequest
884 {
885 #[inline]
886 fn from_wire(wire: crate::wire::MetricEventLoggerLogOccurrenceRequest<'de>) -> Self {
887 Self {
888 metric_id: ::fidl_next::FromWire::from_wire(wire.metric_id),
889
890 count: ::fidl_next::FromWire::from_wire(wire.count),
891
892 event_codes: ::fidl_next::FromWire::from_wire(wire.event_codes),
893 }
894 }
895 }
896
897 impl<'de> ::fidl_next::FromWireRef<crate::wire::MetricEventLoggerLogOccurrenceRequest<'de>>
898 for MetricEventLoggerLogOccurrenceRequest
899 {
900 #[inline]
901 fn from_wire_ref(wire: &crate::wire::MetricEventLoggerLogOccurrenceRequest<'de>) -> Self {
902 Self {
903 metric_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.metric_id),
904
905 count: ::fidl_next::FromWireRef::from_wire_ref(&wire.count),
906
907 event_codes: ::fidl_next::FromWireRef::from_wire_ref(&wire.event_codes),
908 }
909 }
910 }
911
912 pub type MetricEventLoggerLogOccurrenceResponse = ();
913
914 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
915 pub struct MetricEventLoggerLogIntegerRequest {
916 pub metric_id: u32,
917
918 pub value: i64,
919
920 pub event_codes: ::std::vec::Vec<u32>,
921 }
922
923 unsafe impl<___E>
924 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogIntegerRequest<'static>, ___E>
925 for MetricEventLoggerLogIntegerRequest
926 where
927 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
928 ___E: ::fidl_next::Encoder,
929 {
930 #[inline]
931 fn encode(
932 self,
933 encoder_: &mut ___E,
934 out_: &mut ::core::mem::MaybeUninit<
935 crate::wire::MetricEventLoggerLogIntegerRequest<'static>,
936 >,
937 _: (),
938 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
939 ::fidl_next::munge! {
940 let crate::wire::MetricEventLoggerLogIntegerRequest {
941 metric_id,
942 value,
943 event_codes,
944
945 } = out_;
946 }
947
948 ::fidl_next::Encode::encode(self.metric_id, encoder_, metric_id, ())?;
949
950 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(metric_id.as_mut_ptr()) };
951
952 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
953
954 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
955
956 ::fidl_next::Encode::encode(self.event_codes, encoder_, event_codes, (10, ()))?;
957
958 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(event_codes.as_mut_ptr()) };
959 ::fidl_next::Constrained::validate(_field, (10, ()))?;
960
961 Ok(())
962 }
963 }
964
965 unsafe impl<'a, ___E>
966 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogIntegerRequest<'static>, ___E>
967 for &'a MetricEventLoggerLogIntegerRequest
968 where
969 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
970 ___E: ::fidl_next::Encoder,
971 {
972 #[inline]
973 fn encode(
974 self,
975 encoder_: &mut ___E,
976 out_: &mut ::core::mem::MaybeUninit<
977 crate::wire::MetricEventLoggerLogIntegerRequest<'static>,
978 >,
979 _: (),
980 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
981 ::fidl_next::munge! {
982 let crate::wire::MetricEventLoggerLogIntegerRequest {
983 metric_id,
984 value,
985 event_codes,
986
987 } = out_;
988 }
989
990 ::fidl_next::Encode::encode(&self.metric_id, encoder_, metric_id, ())?;
991
992 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(metric_id.as_mut_ptr()) };
993
994 ::fidl_next::Encode::encode(&self.value, encoder_, value, ())?;
995
996 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
997
998 ::fidl_next::Encode::encode(&self.event_codes, encoder_, event_codes, (10, ()))?;
999
1000 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(event_codes.as_mut_ptr()) };
1001 ::fidl_next::Constrained::validate(_field, (10, ()))?;
1002
1003 Ok(())
1004 }
1005 }
1006
1007 unsafe impl<___E>
1008 ::fidl_next::EncodeOption<
1009 ::fidl_next::wire::Box<
1010 'static,
1011 crate::wire::MetricEventLoggerLogIntegerRequest<'static>,
1012 >,
1013 ___E,
1014 > for MetricEventLoggerLogIntegerRequest
1015 where
1016 ___E: ::fidl_next::Encoder + ?Sized,
1017 MetricEventLoggerLogIntegerRequest:
1018 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogIntegerRequest<'static>, ___E>,
1019 {
1020 #[inline]
1021 fn encode_option(
1022 this: ::core::option::Option<Self>,
1023 encoder: &mut ___E,
1024 out: &mut ::core::mem::MaybeUninit<
1025 ::fidl_next::wire::Box<
1026 'static,
1027 crate::wire::MetricEventLoggerLogIntegerRequest<'static>,
1028 >,
1029 >,
1030 _: (),
1031 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1032 if let Some(inner) = this {
1033 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1034 ::fidl_next::wire::Box::encode_present(out);
1035 } else {
1036 ::fidl_next::wire::Box::encode_absent(out);
1037 }
1038
1039 Ok(())
1040 }
1041 }
1042
1043 unsafe impl<'a, ___E>
1044 ::fidl_next::EncodeOption<
1045 ::fidl_next::wire::Box<
1046 'static,
1047 crate::wire::MetricEventLoggerLogIntegerRequest<'static>,
1048 >,
1049 ___E,
1050 > for &'a MetricEventLoggerLogIntegerRequest
1051 where
1052 ___E: ::fidl_next::Encoder + ?Sized,
1053 &'a MetricEventLoggerLogIntegerRequest:
1054 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogIntegerRequest<'static>, ___E>,
1055 {
1056 #[inline]
1057 fn encode_option(
1058 this: ::core::option::Option<Self>,
1059 encoder: &mut ___E,
1060 out: &mut ::core::mem::MaybeUninit<
1061 ::fidl_next::wire::Box<
1062 'static,
1063 crate::wire::MetricEventLoggerLogIntegerRequest<'static>,
1064 >,
1065 >,
1066 _: (),
1067 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1068 if let Some(inner) = this {
1069 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1070 ::fidl_next::wire::Box::encode_present(out);
1071 } else {
1072 ::fidl_next::wire::Box::encode_absent(out);
1073 }
1074
1075 Ok(())
1076 }
1077 }
1078
1079 impl<'de> ::fidl_next::FromWire<crate::wire::MetricEventLoggerLogIntegerRequest<'de>>
1080 for MetricEventLoggerLogIntegerRequest
1081 {
1082 #[inline]
1083 fn from_wire(wire: crate::wire::MetricEventLoggerLogIntegerRequest<'de>) -> Self {
1084 Self {
1085 metric_id: ::fidl_next::FromWire::from_wire(wire.metric_id),
1086
1087 value: ::fidl_next::FromWire::from_wire(wire.value),
1088
1089 event_codes: ::fidl_next::FromWire::from_wire(wire.event_codes),
1090 }
1091 }
1092 }
1093
1094 impl<'de> ::fidl_next::FromWireRef<crate::wire::MetricEventLoggerLogIntegerRequest<'de>>
1095 for MetricEventLoggerLogIntegerRequest
1096 {
1097 #[inline]
1098 fn from_wire_ref(wire: &crate::wire::MetricEventLoggerLogIntegerRequest<'de>) -> Self {
1099 Self {
1100 metric_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.metric_id),
1101
1102 value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value),
1103
1104 event_codes: ::fidl_next::FromWireRef::from_wire_ref(&wire.event_codes),
1105 }
1106 }
1107 }
1108
1109 pub type MetricEventLoggerLogIntegerResponse = ();
1110
1111 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1112 pub struct MetricEventLoggerLogIntegerHistogramRequest {
1113 pub metric_id: u32,
1114
1115 pub histogram: ::std::vec::Vec<crate::natural::HistogramBucket>,
1116
1117 pub event_codes: ::std::vec::Vec<u32>,
1118 }
1119
1120 unsafe impl<___E>
1121 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>, ___E>
1122 for MetricEventLoggerLogIntegerHistogramRequest
1123 where
1124 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1125 ___E: ::fidl_next::Encoder,
1126 {
1127 #[inline]
1128 fn encode(
1129 self,
1130 encoder_: &mut ___E,
1131 out_: &mut ::core::mem::MaybeUninit<
1132 crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>,
1133 >,
1134 _: (),
1135 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1136 ::fidl_next::munge! {
1137 let crate::wire::MetricEventLoggerLogIntegerHistogramRequest {
1138 metric_id,
1139 histogram,
1140 event_codes,
1141
1142 } = out_;
1143 }
1144
1145 ::fidl_next::Encode::encode(self.metric_id, encoder_, metric_id, ())?;
1146
1147 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(metric_id.as_mut_ptr()) };
1148
1149 ::fidl_next::Encode::encode(self.histogram, encoder_, histogram, (500, ()))?;
1150
1151 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(histogram.as_mut_ptr()) };
1152 ::fidl_next::Constrained::validate(_field, (500, ()))?;
1153
1154 ::fidl_next::Encode::encode(self.event_codes, encoder_, event_codes, (10, ()))?;
1155
1156 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(event_codes.as_mut_ptr()) };
1157 ::fidl_next::Constrained::validate(_field, (10, ()))?;
1158
1159 Ok(())
1160 }
1161 }
1162
1163 unsafe impl<'a, ___E>
1164 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>, ___E>
1165 for &'a MetricEventLoggerLogIntegerHistogramRequest
1166 where
1167 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1168 ___E: ::fidl_next::Encoder,
1169 {
1170 #[inline]
1171 fn encode(
1172 self,
1173 encoder_: &mut ___E,
1174 out_: &mut ::core::mem::MaybeUninit<
1175 crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>,
1176 >,
1177 _: (),
1178 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1179 ::fidl_next::munge! {
1180 let crate::wire::MetricEventLoggerLogIntegerHistogramRequest {
1181 metric_id,
1182 histogram,
1183 event_codes,
1184
1185 } = out_;
1186 }
1187
1188 ::fidl_next::Encode::encode(&self.metric_id, encoder_, metric_id, ())?;
1189
1190 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(metric_id.as_mut_ptr()) };
1191
1192 ::fidl_next::Encode::encode(&self.histogram, encoder_, histogram, (500, ()))?;
1193
1194 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(histogram.as_mut_ptr()) };
1195 ::fidl_next::Constrained::validate(_field, (500, ()))?;
1196
1197 ::fidl_next::Encode::encode(&self.event_codes, encoder_, event_codes, (10, ()))?;
1198
1199 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(event_codes.as_mut_ptr()) };
1200 ::fidl_next::Constrained::validate(_field, (10, ()))?;
1201
1202 Ok(())
1203 }
1204 }
1205
1206 unsafe impl<___E>
1207 ::fidl_next::EncodeOption<
1208 ::fidl_next::wire::Box<
1209 'static,
1210 crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>,
1211 >,
1212 ___E,
1213 > for MetricEventLoggerLogIntegerHistogramRequest
1214 where
1215 ___E: ::fidl_next::Encoder + ?Sized,
1216 MetricEventLoggerLogIntegerHistogramRequest: ::fidl_next::Encode<
1217 crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>,
1218 ___E,
1219 >,
1220 {
1221 #[inline]
1222 fn encode_option(
1223 this: ::core::option::Option<Self>,
1224 encoder: &mut ___E,
1225 out: &mut ::core::mem::MaybeUninit<
1226 ::fidl_next::wire::Box<
1227 'static,
1228 crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>,
1229 >,
1230 >,
1231 _: (),
1232 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1233 if let Some(inner) = this {
1234 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1235 ::fidl_next::wire::Box::encode_present(out);
1236 } else {
1237 ::fidl_next::wire::Box::encode_absent(out);
1238 }
1239
1240 Ok(())
1241 }
1242 }
1243
1244 unsafe impl<'a, ___E>
1245 ::fidl_next::EncodeOption<
1246 ::fidl_next::wire::Box<
1247 'static,
1248 crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>,
1249 >,
1250 ___E,
1251 > for &'a MetricEventLoggerLogIntegerHistogramRequest
1252 where
1253 ___E: ::fidl_next::Encoder + ?Sized,
1254 &'a MetricEventLoggerLogIntegerHistogramRequest: ::fidl_next::Encode<
1255 crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>,
1256 ___E,
1257 >,
1258 {
1259 #[inline]
1260 fn encode_option(
1261 this: ::core::option::Option<Self>,
1262 encoder: &mut ___E,
1263 out: &mut ::core::mem::MaybeUninit<
1264 ::fidl_next::wire::Box<
1265 'static,
1266 crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>,
1267 >,
1268 >,
1269 _: (),
1270 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1271 if let Some(inner) = this {
1272 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1273 ::fidl_next::wire::Box::encode_present(out);
1274 } else {
1275 ::fidl_next::wire::Box::encode_absent(out);
1276 }
1277
1278 Ok(())
1279 }
1280 }
1281
1282 impl<'de> ::fidl_next::FromWire<crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'de>>
1283 for MetricEventLoggerLogIntegerHistogramRequest
1284 {
1285 #[inline]
1286 fn from_wire(wire: crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'de>) -> Self {
1287 Self {
1288 metric_id: ::fidl_next::FromWire::from_wire(wire.metric_id),
1289
1290 histogram: ::fidl_next::FromWire::from_wire(wire.histogram),
1291
1292 event_codes: ::fidl_next::FromWire::from_wire(wire.event_codes),
1293 }
1294 }
1295 }
1296
1297 impl<'de>
1298 ::fidl_next::FromWireRef<crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'de>>
1299 for MetricEventLoggerLogIntegerHistogramRequest
1300 {
1301 #[inline]
1302 fn from_wire_ref(
1303 wire: &crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'de>,
1304 ) -> Self {
1305 Self {
1306 metric_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.metric_id),
1307
1308 histogram: ::fidl_next::FromWireRef::from_wire_ref(&wire.histogram),
1309
1310 event_codes: ::fidl_next::FromWireRef::from_wire_ref(&wire.event_codes),
1311 }
1312 }
1313 }
1314
1315 pub type MetricEventLoggerLogIntegerHistogramResponse = ();
1316
1317 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1318 pub struct MetricEventLoggerLogStringRequest {
1319 pub metric_id: u32,
1320
1321 pub string_value: ::std::string::String,
1322
1323 pub event_codes: ::std::vec::Vec<u32>,
1324 }
1325
1326 unsafe impl<___E>
1327 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogStringRequest<'static>, ___E>
1328 for MetricEventLoggerLogStringRequest
1329 where
1330 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1331 ___E: ::fidl_next::Encoder,
1332 {
1333 #[inline]
1334 fn encode(
1335 self,
1336 encoder_: &mut ___E,
1337 out_: &mut ::core::mem::MaybeUninit<
1338 crate::wire::MetricEventLoggerLogStringRequest<'static>,
1339 >,
1340 _: (),
1341 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1342 ::fidl_next::munge! {
1343 let crate::wire::MetricEventLoggerLogStringRequest {
1344 metric_id,
1345 string_value,
1346 event_codes,
1347
1348 } = out_;
1349 }
1350
1351 ::fidl_next::Encode::encode(self.metric_id, encoder_, metric_id, ())?;
1352
1353 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(metric_id.as_mut_ptr()) };
1354
1355 ::fidl_next::Encode::encode(self.string_value, encoder_, string_value, 256)?;
1356
1357 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(string_value.as_mut_ptr()) };
1358 ::fidl_next::Constrained::validate(_field, 256)?;
1359
1360 ::fidl_next::Encode::encode(self.event_codes, encoder_, event_codes, (10, ()))?;
1361
1362 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(event_codes.as_mut_ptr()) };
1363 ::fidl_next::Constrained::validate(_field, (10, ()))?;
1364
1365 Ok(())
1366 }
1367 }
1368
1369 unsafe impl<'a, ___E>
1370 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogStringRequest<'static>, ___E>
1371 for &'a MetricEventLoggerLogStringRequest
1372 where
1373 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1374 ___E: ::fidl_next::Encoder,
1375 {
1376 #[inline]
1377 fn encode(
1378 self,
1379 encoder_: &mut ___E,
1380 out_: &mut ::core::mem::MaybeUninit<
1381 crate::wire::MetricEventLoggerLogStringRequest<'static>,
1382 >,
1383 _: (),
1384 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1385 ::fidl_next::munge! {
1386 let crate::wire::MetricEventLoggerLogStringRequest {
1387 metric_id,
1388 string_value,
1389 event_codes,
1390
1391 } = out_;
1392 }
1393
1394 ::fidl_next::Encode::encode(&self.metric_id, encoder_, metric_id, ())?;
1395
1396 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(metric_id.as_mut_ptr()) };
1397
1398 ::fidl_next::Encode::encode(&self.string_value, encoder_, string_value, 256)?;
1399
1400 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(string_value.as_mut_ptr()) };
1401 ::fidl_next::Constrained::validate(_field, 256)?;
1402
1403 ::fidl_next::Encode::encode(&self.event_codes, encoder_, event_codes, (10, ()))?;
1404
1405 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(event_codes.as_mut_ptr()) };
1406 ::fidl_next::Constrained::validate(_field, (10, ()))?;
1407
1408 Ok(())
1409 }
1410 }
1411
1412 unsafe impl<___E>
1413 ::fidl_next::EncodeOption<
1414 ::fidl_next::wire::Box<
1415 'static,
1416 crate::wire::MetricEventLoggerLogStringRequest<'static>,
1417 >,
1418 ___E,
1419 > for MetricEventLoggerLogStringRequest
1420 where
1421 ___E: ::fidl_next::Encoder + ?Sized,
1422 MetricEventLoggerLogStringRequest:
1423 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogStringRequest<'static>, ___E>,
1424 {
1425 #[inline]
1426 fn encode_option(
1427 this: ::core::option::Option<Self>,
1428 encoder: &mut ___E,
1429 out: &mut ::core::mem::MaybeUninit<
1430 ::fidl_next::wire::Box<
1431 'static,
1432 crate::wire::MetricEventLoggerLogStringRequest<'static>,
1433 >,
1434 >,
1435 _: (),
1436 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1437 if let Some(inner) = this {
1438 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1439 ::fidl_next::wire::Box::encode_present(out);
1440 } else {
1441 ::fidl_next::wire::Box::encode_absent(out);
1442 }
1443
1444 Ok(())
1445 }
1446 }
1447
1448 unsafe impl<'a, ___E>
1449 ::fidl_next::EncodeOption<
1450 ::fidl_next::wire::Box<
1451 'static,
1452 crate::wire::MetricEventLoggerLogStringRequest<'static>,
1453 >,
1454 ___E,
1455 > for &'a MetricEventLoggerLogStringRequest
1456 where
1457 ___E: ::fidl_next::Encoder + ?Sized,
1458 &'a MetricEventLoggerLogStringRequest:
1459 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogStringRequest<'static>, ___E>,
1460 {
1461 #[inline]
1462 fn encode_option(
1463 this: ::core::option::Option<Self>,
1464 encoder: &mut ___E,
1465 out: &mut ::core::mem::MaybeUninit<
1466 ::fidl_next::wire::Box<
1467 'static,
1468 crate::wire::MetricEventLoggerLogStringRequest<'static>,
1469 >,
1470 >,
1471 _: (),
1472 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1473 if let Some(inner) = this {
1474 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1475 ::fidl_next::wire::Box::encode_present(out);
1476 } else {
1477 ::fidl_next::wire::Box::encode_absent(out);
1478 }
1479
1480 Ok(())
1481 }
1482 }
1483
1484 impl<'de> ::fidl_next::FromWire<crate::wire::MetricEventLoggerLogStringRequest<'de>>
1485 for MetricEventLoggerLogStringRequest
1486 {
1487 #[inline]
1488 fn from_wire(wire: crate::wire::MetricEventLoggerLogStringRequest<'de>) -> Self {
1489 Self {
1490 metric_id: ::fidl_next::FromWire::from_wire(wire.metric_id),
1491
1492 string_value: ::fidl_next::FromWire::from_wire(wire.string_value),
1493
1494 event_codes: ::fidl_next::FromWire::from_wire(wire.event_codes),
1495 }
1496 }
1497 }
1498
1499 impl<'de> ::fidl_next::FromWireRef<crate::wire::MetricEventLoggerLogStringRequest<'de>>
1500 for MetricEventLoggerLogStringRequest
1501 {
1502 #[inline]
1503 fn from_wire_ref(wire: &crate::wire::MetricEventLoggerLogStringRequest<'de>) -> Self {
1504 Self {
1505 metric_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.metric_id),
1506
1507 string_value: ::fidl_next::FromWireRef::from_wire_ref(&wire.string_value),
1508
1509 event_codes: ::fidl_next::FromWireRef::from_wire_ref(&wire.event_codes),
1510 }
1511 }
1512 }
1513
1514 pub type MetricEventLoggerLogStringResponse = ();
1515
1516 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1517 pub struct MetricEventLoggerLogMetricEventsRequest {
1518 pub events: ::std::vec::Vec<crate::natural::MetricEvent>,
1519 }
1520
1521 unsafe impl<___E>
1522 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>, ___E>
1523 for MetricEventLoggerLogMetricEventsRequest
1524 where
1525 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1526 ___E: ::fidl_next::Encoder,
1527 {
1528 #[inline]
1529 fn encode(
1530 self,
1531 encoder_: &mut ___E,
1532 out_: &mut ::core::mem::MaybeUninit<
1533 crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>,
1534 >,
1535 _: (),
1536 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1537 ::fidl_next::munge! {
1538 let crate::wire::MetricEventLoggerLogMetricEventsRequest {
1539 events,
1540
1541 } = out_;
1542 }
1543
1544 ::fidl_next::Encode::encode(self.events, encoder_, events, (500, ()))?;
1545
1546 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(events.as_mut_ptr()) };
1547 ::fidl_next::Constrained::validate(_field, (500, ()))?;
1548
1549 Ok(())
1550 }
1551 }
1552
1553 unsafe impl<'a, ___E>
1554 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>, ___E>
1555 for &'a MetricEventLoggerLogMetricEventsRequest
1556 where
1557 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1558 ___E: ::fidl_next::Encoder,
1559 {
1560 #[inline]
1561 fn encode(
1562 self,
1563 encoder_: &mut ___E,
1564 out_: &mut ::core::mem::MaybeUninit<
1565 crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>,
1566 >,
1567 _: (),
1568 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1569 ::fidl_next::munge! {
1570 let crate::wire::MetricEventLoggerLogMetricEventsRequest {
1571 events,
1572
1573 } = out_;
1574 }
1575
1576 ::fidl_next::Encode::encode(&self.events, encoder_, events, (500, ()))?;
1577
1578 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(events.as_mut_ptr()) };
1579 ::fidl_next::Constrained::validate(_field, (500, ()))?;
1580
1581 Ok(())
1582 }
1583 }
1584
1585 unsafe impl<___E>
1586 ::fidl_next::EncodeOption<
1587 ::fidl_next::wire::Box<
1588 'static,
1589 crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>,
1590 >,
1591 ___E,
1592 > for MetricEventLoggerLogMetricEventsRequest
1593 where
1594 ___E: ::fidl_next::Encoder + ?Sized,
1595 MetricEventLoggerLogMetricEventsRequest: ::fidl_next::Encode<crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>, ___E>,
1596 {
1597 #[inline]
1598 fn encode_option(
1599 this: ::core::option::Option<Self>,
1600 encoder: &mut ___E,
1601 out: &mut ::core::mem::MaybeUninit<
1602 ::fidl_next::wire::Box<
1603 'static,
1604 crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>,
1605 >,
1606 >,
1607 _: (),
1608 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1609 if let Some(inner) = this {
1610 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1611 ::fidl_next::wire::Box::encode_present(out);
1612 } else {
1613 ::fidl_next::wire::Box::encode_absent(out);
1614 }
1615
1616 Ok(())
1617 }
1618 }
1619
1620 unsafe impl<'a, ___E>
1621 ::fidl_next::EncodeOption<
1622 ::fidl_next::wire::Box<
1623 'static,
1624 crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>,
1625 >,
1626 ___E,
1627 > for &'a MetricEventLoggerLogMetricEventsRequest
1628 where
1629 ___E: ::fidl_next::Encoder + ?Sized,
1630 &'a MetricEventLoggerLogMetricEventsRequest: ::fidl_next::Encode<crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>, ___E>,
1631 {
1632 #[inline]
1633 fn encode_option(
1634 this: ::core::option::Option<Self>,
1635 encoder: &mut ___E,
1636 out: &mut ::core::mem::MaybeUninit<
1637 ::fidl_next::wire::Box<
1638 'static,
1639 crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>,
1640 >,
1641 >,
1642 _: (),
1643 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1644 if let Some(inner) = this {
1645 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1646 ::fidl_next::wire::Box::encode_present(out);
1647 } else {
1648 ::fidl_next::wire::Box::encode_absent(out);
1649 }
1650
1651 Ok(())
1652 }
1653 }
1654
1655 impl<'de> ::fidl_next::FromWire<crate::wire::MetricEventLoggerLogMetricEventsRequest<'de>>
1656 for MetricEventLoggerLogMetricEventsRequest
1657 {
1658 #[inline]
1659 fn from_wire(wire: crate::wire::MetricEventLoggerLogMetricEventsRequest<'de>) -> Self {
1660 Self { events: ::fidl_next::FromWire::from_wire(wire.events) }
1661 }
1662 }
1663
1664 impl<'de> ::fidl_next::FromWireRef<crate::wire::MetricEventLoggerLogMetricEventsRequest<'de>>
1665 for MetricEventLoggerLogMetricEventsRequest
1666 {
1667 #[inline]
1668 fn from_wire_ref(wire: &crate::wire::MetricEventLoggerLogMetricEventsRequest<'de>) -> Self {
1669 Self { events: ::fidl_next::FromWireRef::from_wire_ref(&wire.events) }
1670 }
1671 }
1672
1673 pub type MetricEventLoggerLogMetricEventsResponse = ();
1674
1675 #[doc = " A specification identifying a project to log events for.\n"]
1676 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1677 pub struct ProjectSpec {
1678 pub customer_id: ::core::option::Option<u32>,
1679
1680 pub project_id: ::core::option::Option<u32>,
1681 }
1682
1683 impl ProjectSpec {
1684 fn __max_ordinal(&self) -> usize {
1685 if self.project_id.is_some() {
1686 return 2;
1687 }
1688
1689 if self.customer_id.is_some() {
1690 return 1;
1691 }
1692
1693 0
1694 }
1695 }
1696
1697 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ProjectSpec<'static>, ___E> for ProjectSpec
1698 where
1699 ___E: ::fidl_next::Encoder + ?Sized,
1700 {
1701 #[inline]
1702 fn encode(
1703 mut self,
1704 encoder: &mut ___E,
1705 out: &mut ::core::mem::MaybeUninit<crate::wire::ProjectSpec<'static>>,
1706 _: (),
1707 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1708 ::fidl_next::munge!(let crate::wire::ProjectSpec { table } = out);
1709
1710 let max_ord = self.__max_ordinal();
1711
1712 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1713 ::fidl_next::Wire::zero_padding(&mut out);
1714
1715 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1716 ::fidl_next::wire::Envelope,
1717 >(encoder, max_ord);
1718
1719 for i in 1..=max_ord {
1720 match i {
1721 2 => {
1722 if let Some(value) = self.project_id.take() {
1723 ::fidl_next::wire::Envelope::encode_value::<
1724 ::fidl_next::wire::Uint32,
1725 ___E,
1726 >(
1727 value, preallocated.encoder, &mut out, ()
1728 )?;
1729 } else {
1730 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1731 }
1732 }
1733
1734 1 => {
1735 if let Some(value) = self.customer_id.take() {
1736 ::fidl_next::wire::Envelope::encode_value::<
1737 ::fidl_next::wire::Uint32,
1738 ___E,
1739 >(
1740 value, preallocated.encoder, &mut out, ()
1741 )?;
1742 } else {
1743 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1744 }
1745 }
1746
1747 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1748 }
1749 unsafe {
1750 preallocated.write_next(out.assume_init_ref());
1751 }
1752 }
1753
1754 ::fidl_next::wire::Table::encode_len(table, max_ord);
1755
1756 Ok(())
1757 }
1758 }
1759
1760 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ProjectSpec<'static>, ___E>
1761 for &'a ProjectSpec
1762 where
1763 ___E: ::fidl_next::Encoder + ?Sized,
1764 {
1765 #[inline]
1766 fn encode(
1767 self,
1768 encoder: &mut ___E,
1769 out: &mut ::core::mem::MaybeUninit<crate::wire::ProjectSpec<'static>>,
1770 _: (),
1771 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1772 ::fidl_next::munge!(let crate::wire::ProjectSpec { table } = out);
1773
1774 let max_ord = self.__max_ordinal();
1775
1776 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1777 ::fidl_next::Wire::zero_padding(&mut out);
1778
1779 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1780 ::fidl_next::wire::Envelope,
1781 >(encoder, max_ord);
1782
1783 for i in 1..=max_ord {
1784 match i {
1785 2 => {
1786 if let Some(value) = &self.project_id {
1787 ::fidl_next::wire::Envelope::encode_value::<
1788 ::fidl_next::wire::Uint32,
1789 ___E,
1790 >(
1791 value, preallocated.encoder, &mut out, ()
1792 )?;
1793 } else {
1794 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1795 }
1796 }
1797
1798 1 => {
1799 if let Some(value) = &self.customer_id {
1800 ::fidl_next::wire::Envelope::encode_value::<
1801 ::fidl_next::wire::Uint32,
1802 ___E,
1803 >(
1804 value, preallocated.encoder, &mut out, ()
1805 )?;
1806 } else {
1807 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1808 }
1809 }
1810
1811 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1812 }
1813 unsafe {
1814 preallocated.write_next(out.assume_init_ref());
1815 }
1816 }
1817
1818 ::fidl_next::wire::Table::encode_len(table, max_ord);
1819
1820 Ok(())
1821 }
1822 }
1823
1824 impl<'de> ::fidl_next::FromWire<crate::wire::ProjectSpec<'de>> for ProjectSpec {
1825 #[inline]
1826 fn from_wire(wire_: crate::wire::ProjectSpec<'de>) -> Self {
1827 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1828
1829 let customer_id = wire_.table.get(1);
1830
1831 let project_id = wire_.table.get(2);
1832
1833 Self {
1834 customer_id: customer_id.map(|envelope| {
1835 ::fidl_next::FromWire::from_wire(unsafe {
1836 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
1837 })
1838 }),
1839
1840 project_id: project_id.map(|envelope| {
1841 ::fidl_next::FromWire::from_wire(unsafe {
1842 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
1843 })
1844 }),
1845 }
1846 }
1847 }
1848
1849 impl<'de> ::fidl_next::FromWireRef<crate::wire::ProjectSpec<'de>> for ProjectSpec {
1850 #[inline]
1851 fn from_wire_ref(wire: &crate::wire::ProjectSpec<'de>) -> Self {
1852 Self {
1853 customer_id: wire.table.get(1).map(|envelope| {
1854 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1855 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
1856 })
1857 }),
1858
1859 project_id: wire.table.get(2).map(|envelope| {
1860 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1861 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
1862 })
1863 }),
1864 }
1865 }
1866 }
1867
1868 pub type MetricEventLoggerFactoryCreateMetricEventLoggerResponse = ();
1869
1870 pub type MetricEventLoggerFactoryCreateMetricEventLoggerWithExperimentsResponse = ();
1871}
1872
1873pub mod wire {
1874
1875 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1877 #[repr(transparent)]
1878 pub struct Error {
1879 pub(crate) value: ::fidl_next::wire::Int32,
1880 }
1881
1882 impl ::fidl_next::Constrained for Error {
1883 type Constraint = ();
1884
1885 fn validate(
1886 _: ::fidl_next::Slot<'_, Self>,
1887 _: Self::Constraint,
1888 ) -> Result<(), ::fidl_next::ValidationError> {
1889 Ok(())
1890 }
1891 }
1892
1893 unsafe impl ::fidl_next::Wire for Error {
1894 type Narrowed<'de> = Self;
1895
1896 #[inline]
1897 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1898 }
1900 }
1901
1902 impl Error {
1903 pub const INVALID_ARGUMENTS: Error = Error { value: ::fidl_next::wire::Int32(1) };
1904
1905 pub const EVENT_TOO_BIG: Error = Error { value: ::fidl_next::wire::Int32(2) };
1906
1907 pub const BUFFER_FULL: Error = Error { value: ::fidl_next::wire::Int32(3) };
1908
1909 pub const SHUT_DOWN: Error = Error { value: ::fidl_next::wire::Int32(4) };
1910
1911 pub const INTERNAL_ERROR: Error = Error { value: ::fidl_next::wire::Int32(-1) };
1912 }
1913
1914 unsafe impl<___D> ::fidl_next::Decode<___D> for Error
1915 where
1916 ___D: ?Sized,
1917 {
1918 fn decode(
1919 slot: ::fidl_next::Slot<'_, Self>,
1920 _: &mut ___D,
1921 _: (),
1922 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1923 ::fidl_next::munge!(let Self { value } = slot);
1924
1925 match i32::from(*value) {
1926 1 | 2 | 3 | 4 | -1 => (),
1927 unknown => {
1928 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
1929 }
1930 }
1931
1932 Ok(())
1933 }
1934 }
1935
1936 impl ::core::convert::From<crate::natural::Error> for Error {
1937 fn from(natural: crate::natural::Error) -> Self {
1938 match natural {
1939 crate::natural::Error::InvalidArguments => Error::INVALID_ARGUMENTS,
1940
1941 crate::natural::Error::EventTooBig => Error::EVENT_TOO_BIG,
1942
1943 crate::natural::Error::BufferFull => Error::BUFFER_FULL,
1944
1945 crate::natural::Error::ShutDown => Error::SHUT_DOWN,
1946
1947 crate::natural::Error::InternalError => Error::INTERNAL_ERROR,
1948 }
1949 }
1950 }
1951
1952 impl ::fidl_next::IntoNatural for Error {
1953 type Natural = crate::natural::Error;
1954 }
1955
1956 pub type EventVector<'de> = ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>;
1958
1959 #[derive(Clone, Debug)]
1961 #[repr(C)]
1962 pub struct HistogramBucket {
1963 pub index: ::fidl_next::wire::Uint32,
1964
1965 pub count: ::fidl_next::wire::Uint64,
1966 }
1967
1968 static_assertions::const_assert_eq!(std::mem::size_of::<HistogramBucket>(), 16);
1969 static_assertions::const_assert_eq!(std::mem::align_of::<HistogramBucket>(), 8);
1970
1971 static_assertions::const_assert_eq!(std::mem::offset_of!(HistogramBucket, index), 0);
1972
1973 static_assertions::const_assert_eq!(std::mem::offset_of!(HistogramBucket, count), 8);
1974
1975 impl ::fidl_next::Constrained for HistogramBucket {
1976 type Constraint = ();
1977
1978 fn validate(
1979 _: ::fidl_next::Slot<'_, Self>,
1980 _: Self::Constraint,
1981 ) -> Result<(), ::fidl_next::ValidationError> {
1982 Ok(())
1983 }
1984 }
1985
1986 unsafe impl ::fidl_next::Wire for HistogramBucket {
1987 type Narrowed<'de> = HistogramBucket;
1988
1989 #[inline]
1990 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1991 ::fidl_next::munge! {
1992 let Self {
1993 index,
1994 count,
1995
1996 } = &mut *out_;
1997 }
1998
1999 ::fidl_next::Wire::zero_padding(index);
2000
2001 ::fidl_next::Wire::zero_padding(count);
2002
2003 unsafe {
2004 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2005 }
2006 }
2007 }
2008
2009 unsafe impl<___D> ::fidl_next::Decode<___D> for HistogramBucket
2010 where
2011 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2012 {
2013 fn decode(
2014 slot_: ::fidl_next::Slot<'_, Self>,
2015 decoder_: &mut ___D,
2016 _: (),
2017 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2018 if slot_.as_bytes()[4..8] != [0u8; 4] {
2019 return Err(::fidl_next::DecodeError::InvalidPadding);
2020 }
2021
2022 ::fidl_next::munge! {
2023 let Self {
2024 mut index,
2025 mut count,
2026
2027 } = slot_;
2028 }
2029
2030 let _field = index.as_mut();
2031
2032 ::fidl_next::Decode::decode(index.as_mut(), decoder_, ())?;
2033
2034 let _field = count.as_mut();
2035
2036 ::fidl_next::Decode::decode(count.as_mut(), decoder_, ())?;
2037
2038 Ok(())
2039 }
2040 }
2041
2042 impl ::fidl_next::IntoNatural for HistogramBucket {
2043 type Natural = crate::natural::HistogramBucket;
2044 }
2045
2046 pub type IntegerHistogram<'de> = ::fidl_next::wire::Vector<'de, crate::wire::HistogramBucket>;
2048
2049 #[repr(transparent)]
2051 pub struct MetricEventPayload<'de> {
2052 pub(crate) raw: ::fidl_next::wire::Union,
2053 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
2054 }
2055
2056 impl<'de> Drop for MetricEventPayload<'de> {
2057 fn drop(&mut self) {
2058 match self.raw.ordinal() {
2059 1 => {
2060 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Uint64>() };
2061 }
2062
2063 2 => {
2064 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Int64>() };
2065 }
2066
2067 3 => {
2068 let _ = unsafe {
2069 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::HistogramBucket>>()
2070 };
2071 }
2072
2073 4 => {
2074 let _ = unsafe {
2075 self.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
2076 };
2077 }
2078
2079 _ => (),
2080 }
2081 }
2082 }
2083
2084 impl ::fidl_next::Constrained for MetricEventPayload<'_> {
2085 type Constraint = ();
2086
2087 fn validate(
2088 _: ::fidl_next::Slot<'_, Self>,
2089 _: Self::Constraint,
2090 ) -> Result<(), ::fidl_next::ValidationError> {
2091 Ok(())
2092 }
2093 }
2094
2095 unsafe impl ::fidl_next::Wire for MetricEventPayload<'static> {
2096 type Narrowed<'de> = MetricEventPayload<'de>;
2097
2098 #[inline]
2099 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2100 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
2101 ::fidl_next::wire::Union::zero_padding(raw);
2102 }
2103 }
2104
2105 pub mod metric_event_payload {
2106 pub enum Ref<'de> {
2107 Count(&'de ::fidl_next::wire::Uint64),
2108
2109 IntegerValue(&'de ::fidl_next::wire::Int64),
2110
2111 Histogram(&'de ::fidl_next::wire::Vector<'de, crate::wire::HistogramBucket>),
2112
2113 StringValue(&'de ::fidl_next::wire::String<'de>),
2114
2115 UnknownOrdinal_(u64),
2116 }
2117
2118 pub enum Value<'de> {
2119 Count(::fidl_next::wire::Uint64),
2120
2121 IntegerValue(::fidl_next::wire::Int64),
2122
2123 Histogram(::fidl_next::wire::Vector<'de, crate::wire::HistogramBucket>),
2124
2125 StringValue(::fidl_next::wire::String<'de>),
2126
2127 UnknownOrdinal_(u64),
2128 }
2129 }
2130
2131 impl<'de> MetricEventPayload<'de> {
2132 pub fn as_ref(&self) -> crate::wire::metric_event_payload::Ref<'_> {
2133 match self.raw.ordinal() {
2134 1 => crate::wire::metric_event_payload::Ref::Count(unsafe {
2135 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint64>()
2136 }),
2137
2138 2 => crate::wire::metric_event_payload::Ref::IntegerValue(unsafe {
2139 self.raw.get().deref_unchecked::<::fidl_next::wire::Int64>()
2140 }),
2141
2142 3 => crate::wire::metric_event_payload::Ref::Histogram(unsafe {
2143 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, crate::wire::HistogramBucket>>()
2144 }),
2145
2146 4 => crate::wire::metric_event_payload::Ref::StringValue(unsafe {
2147 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
2148 }),
2149
2150 unknown => crate::wire::metric_event_payload::Ref::UnknownOrdinal_(unknown),
2151 }
2152 }
2153
2154 pub fn into_inner(self) -> crate::wire::metric_event_payload::Value<'de> {
2155 let this = ::core::mem::ManuallyDrop::new(self);
2156
2157 match this.raw.ordinal() {
2158 1 => crate::wire::metric_event_payload::Value::Count(unsafe {
2159 this.raw.get().read_unchecked::<::fidl_next::wire::Uint64>()
2160 }),
2161
2162 2 => crate::wire::metric_event_payload::Value::IntegerValue(unsafe {
2163 this.raw.get().read_unchecked::<::fidl_next::wire::Int64>()
2164 }),
2165
2166 3 => crate::wire::metric_event_payload::Value::Histogram(unsafe {
2167 this.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::HistogramBucket>>()
2168 }),
2169
2170 4 => crate::wire::metric_event_payload::Value::StringValue(unsafe {
2171 this.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
2172 }),
2173
2174 unknown => crate::wire::metric_event_payload::Value::UnknownOrdinal_(unknown),
2175 }
2176 }
2177 }
2178
2179 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MetricEventPayload<'de>
2180 where
2181 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2182 ___D: ::fidl_next::Decoder<'de>,
2183 {
2184 fn decode(
2185 mut slot: ::fidl_next::Slot<'_, Self>,
2186 decoder: &mut ___D,
2187 _: (),
2188 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2189 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
2190 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
2191 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint64>(
2192 raw,
2193 decoder,
2194 (),
2195 )?,
2196
2197 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int64>(
2198 raw,
2199 decoder,
2200 (),
2201 )?,
2202
2203 3 => ::fidl_next::wire::Union::decode_as::<
2204 ___D,
2205 ::fidl_next::wire::Vector<'de, crate::wire::HistogramBucket>,
2206 >(raw, decoder, (500, ()))?,
2207
2208 4 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
2209 raw, decoder, 256,
2210 )?,
2211
2212 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
2213 }
2214
2215 Ok(())
2216 }
2217 }
2218
2219 impl<'de> ::core::fmt::Debug for MetricEventPayload<'de> {
2220 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2221 match self.raw.ordinal() {
2222 1 => unsafe {
2223 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint64>().fmt(f)
2224 },
2225 2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::wire::Int64>().fmt(f) },
2226 3 => unsafe {
2227 self.raw.get().deref_unchecked::<
2228 ::fidl_next::wire::Vector<'_, crate::wire::HistogramBucket>
2229 >().fmt(f)
2230 },
2231 4 => unsafe {
2232 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
2233 },
2234 _ => unsafe { ::core::hint::unreachable_unchecked() },
2235 }
2236 }
2237 }
2238
2239 impl<'de> ::fidl_next::IntoNatural for MetricEventPayload<'de> {
2240 type Natural = crate::natural::MetricEventPayload;
2241 }
2242
2243 #[derive(Debug)]
2245 #[repr(C)]
2246 pub struct MetricEvent<'de> {
2247 pub metric_id: ::fidl_next::wire::Uint32,
2248
2249 pub event_codes: ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>,
2250
2251 pub payload: crate::wire::MetricEventPayload<'de>,
2252 }
2253
2254 static_assertions::const_assert_eq!(std::mem::size_of::<MetricEvent<'_>>(), 40);
2255 static_assertions::const_assert_eq!(std::mem::align_of::<MetricEvent<'_>>(), 8);
2256
2257 static_assertions::const_assert_eq!(std::mem::offset_of!(MetricEvent<'_>, metric_id), 0);
2258
2259 static_assertions::const_assert_eq!(std::mem::offset_of!(MetricEvent<'_>, event_codes), 8);
2260
2261 static_assertions::const_assert_eq!(std::mem::offset_of!(MetricEvent<'_>, payload), 24);
2262
2263 impl ::fidl_next::Constrained for MetricEvent<'_> {
2264 type Constraint = ();
2265
2266 fn validate(
2267 _: ::fidl_next::Slot<'_, Self>,
2268 _: Self::Constraint,
2269 ) -> Result<(), ::fidl_next::ValidationError> {
2270 Ok(())
2271 }
2272 }
2273
2274 unsafe impl ::fidl_next::Wire for MetricEvent<'static> {
2275 type Narrowed<'de> = MetricEvent<'de>;
2276
2277 #[inline]
2278 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2279 ::fidl_next::munge! {
2280 let Self {
2281 metric_id,
2282 event_codes,
2283 payload,
2284
2285 } = &mut *out_;
2286 }
2287
2288 ::fidl_next::Wire::zero_padding(metric_id);
2289
2290 ::fidl_next::Wire::zero_padding(event_codes);
2291
2292 ::fidl_next::Wire::zero_padding(payload);
2293
2294 unsafe {
2295 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2296 }
2297 }
2298 }
2299
2300 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MetricEvent<'de>
2301 where
2302 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2303 ___D: ::fidl_next::Decoder<'de>,
2304 {
2305 fn decode(
2306 slot_: ::fidl_next::Slot<'_, Self>,
2307 decoder_: &mut ___D,
2308 _: (),
2309 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2310 if slot_.as_bytes()[4..8] != [0u8; 4] {
2311 return Err(::fidl_next::DecodeError::InvalidPadding);
2312 }
2313
2314 ::fidl_next::munge! {
2315 let Self {
2316 mut metric_id,
2317 mut event_codes,
2318 mut payload,
2319
2320 } = slot_;
2321 }
2322
2323 let _field = metric_id.as_mut();
2324
2325 ::fidl_next::Decode::decode(metric_id.as_mut(), decoder_, ())?;
2326
2327 let _field = event_codes.as_mut();
2328 ::fidl_next::Constrained::validate(_field, (10, ()))?;
2329 ::fidl_next::Decode::decode(event_codes.as_mut(), decoder_, (10, ()))?;
2330
2331 let event_codes = unsafe { event_codes.deref_unchecked() };
2332
2333 if event_codes.len() > 10 {
2334 return Err(::fidl_next::DecodeError::VectorTooLong {
2335 size: event_codes.len() as u64,
2336 limit: 10,
2337 });
2338 }
2339
2340 let _field = payload.as_mut();
2341
2342 ::fidl_next::Decode::decode(payload.as_mut(), decoder_, ())?;
2343
2344 Ok(())
2345 }
2346 }
2347
2348 impl<'de> ::fidl_next::IntoNatural for MetricEvent<'de> {
2349 type Natural = crate::natural::MetricEvent;
2350 }
2351
2352 #[derive(Debug)]
2354 #[repr(C)]
2355 pub struct MetricEventLoggerLogOccurrenceRequest<'de> {
2356 pub metric_id: ::fidl_next::wire::Uint32,
2357
2358 pub count: ::fidl_next::wire::Uint64,
2359
2360 pub event_codes: ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>,
2361 }
2362
2363 static_assertions::const_assert_eq!(
2364 std::mem::size_of::<MetricEventLoggerLogOccurrenceRequest<'_>>(),
2365 32
2366 );
2367 static_assertions::const_assert_eq!(
2368 std::mem::align_of::<MetricEventLoggerLogOccurrenceRequest<'_>>(),
2369 8
2370 );
2371
2372 static_assertions::const_assert_eq!(
2373 std::mem::offset_of!(MetricEventLoggerLogOccurrenceRequest<'_>, metric_id),
2374 0
2375 );
2376
2377 static_assertions::const_assert_eq!(
2378 std::mem::offset_of!(MetricEventLoggerLogOccurrenceRequest<'_>, count),
2379 8
2380 );
2381
2382 static_assertions::const_assert_eq!(
2383 std::mem::offset_of!(MetricEventLoggerLogOccurrenceRequest<'_>, event_codes),
2384 16
2385 );
2386
2387 impl ::fidl_next::Constrained for MetricEventLoggerLogOccurrenceRequest<'_> {
2388 type Constraint = ();
2389
2390 fn validate(
2391 _: ::fidl_next::Slot<'_, Self>,
2392 _: Self::Constraint,
2393 ) -> Result<(), ::fidl_next::ValidationError> {
2394 Ok(())
2395 }
2396 }
2397
2398 unsafe impl ::fidl_next::Wire for MetricEventLoggerLogOccurrenceRequest<'static> {
2399 type Narrowed<'de> = MetricEventLoggerLogOccurrenceRequest<'de>;
2400
2401 #[inline]
2402 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2403 ::fidl_next::munge! {
2404 let Self {
2405 metric_id,
2406 count,
2407 event_codes,
2408
2409 } = &mut *out_;
2410 }
2411
2412 ::fidl_next::Wire::zero_padding(metric_id);
2413
2414 ::fidl_next::Wire::zero_padding(count);
2415
2416 ::fidl_next::Wire::zero_padding(event_codes);
2417
2418 unsafe {
2419 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2420 }
2421 }
2422 }
2423
2424 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MetricEventLoggerLogOccurrenceRequest<'de>
2425 where
2426 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2427 ___D: ::fidl_next::Decoder<'de>,
2428 {
2429 fn decode(
2430 slot_: ::fidl_next::Slot<'_, Self>,
2431 decoder_: &mut ___D,
2432 _: (),
2433 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2434 if slot_.as_bytes()[4..8] != [0u8; 4] {
2435 return Err(::fidl_next::DecodeError::InvalidPadding);
2436 }
2437
2438 ::fidl_next::munge! {
2439 let Self {
2440 mut metric_id,
2441 mut count,
2442 mut event_codes,
2443
2444 } = slot_;
2445 }
2446
2447 let _field = metric_id.as_mut();
2448
2449 ::fidl_next::Decode::decode(metric_id.as_mut(), decoder_, ())?;
2450
2451 let _field = count.as_mut();
2452
2453 ::fidl_next::Decode::decode(count.as_mut(), decoder_, ())?;
2454
2455 let _field = event_codes.as_mut();
2456 ::fidl_next::Constrained::validate(_field, (10, ()))?;
2457 ::fidl_next::Decode::decode(event_codes.as_mut(), decoder_, (10, ()))?;
2458
2459 let event_codes = unsafe { event_codes.deref_unchecked() };
2460
2461 if event_codes.len() > 10 {
2462 return Err(::fidl_next::DecodeError::VectorTooLong {
2463 size: event_codes.len() as u64,
2464 limit: 10,
2465 });
2466 }
2467
2468 Ok(())
2469 }
2470 }
2471
2472 impl<'de> ::fidl_next::IntoNatural for MetricEventLoggerLogOccurrenceRequest<'de> {
2473 type Natural = crate::natural::MetricEventLoggerLogOccurrenceRequest;
2474 }
2475
2476 pub type MetricEventLoggerLogOccurrenceResponse = ::fidl_next::wire::Unit;
2478
2479 #[derive(Debug)]
2481 #[repr(C)]
2482 pub struct MetricEventLoggerLogIntegerRequest<'de> {
2483 pub metric_id: ::fidl_next::wire::Uint32,
2484
2485 pub value: ::fidl_next::wire::Int64,
2486
2487 pub event_codes: ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>,
2488 }
2489
2490 static_assertions::const_assert_eq!(
2491 std::mem::size_of::<MetricEventLoggerLogIntegerRequest<'_>>(),
2492 32
2493 );
2494 static_assertions::const_assert_eq!(
2495 std::mem::align_of::<MetricEventLoggerLogIntegerRequest<'_>>(),
2496 8
2497 );
2498
2499 static_assertions::const_assert_eq!(
2500 std::mem::offset_of!(MetricEventLoggerLogIntegerRequest<'_>, metric_id),
2501 0
2502 );
2503
2504 static_assertions::const_assert_eq!(
2505 std::mem::offset_of!(MetricEventLoggerLogIntegerRequest<'_>, value),
2506 8
2507 );
2508
2509 static_assertions::const_assert_eq!(
2510 std::mem::offset_of!(MetricEventLoggerLogIntegerRequest<'_>, event_codes),
2511 16
2512 );
2513
2514 impl ::fidl_next::Constrained for MetricEventLoggerLogIntegerRequest<'_> {
2515 type Constraint = ();
2516
2517 fn validate(
2518 _: ::fidl_next::Slot<'_, Self>,
2519 _: Self::Constraint,
2520 ) -> Result<(), ::fidl_next::ValidationError> {
2521 Ok(())
2522 }
2523 }
2524
2525 unsafe impl ::fidl_next::Wire for MetricEventLoggerLogIntegerRequest<'static> {
2526 type Narrowed<'de> = MetricEventLoggerLogIntegerRequest<'de>;
2527
2528 #[inline]
2529 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2530 ::fidl_next::munge! {
2531 let Self {
2532 metric_id,
2533 value,
2534 event_codes,
2535
2536 } = &mut *out_;
2537 }
2538
2539 ::fidl_next::Wire::zero_padding(metric_id);
2540
2541 ::fidl_next::Wire::zero_padding(value);
2542
2543 ::fidl_next::Wire::zero_padding(event_codes);
2544
2545 unsafe {
2546 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2547 }
2548 }
2549 }
2550
2551 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MetricEventLoggerLogIntegerRequest<'de>
2552 where
2553 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2554 ___D: ::fidl_next::Decoder<'de>,
2555 {
2556 fn decode(
2557 slot_: ::fidl_next::Slot<'_, Self>,
2558 decoder_: &mut ___D,
2559 _: (),
2560 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2561 if slot_.as_bytes()[4..8] != [0u8; 4] {
2562 return Err(::fidl_next::DecodeError::InvalidPadding);
2563 }
2564
2565 ::fidl_next::munge! {
2566 let Self {
2567 mut metric_id,
2568 mut value,
2569 mut event_codes,
2570
2571 } = slot_;
2572 }
2573
2574 let _field = metric_id.as_mut();
2575
2576 ::fidl_next::Decode::decode(metric_id.as_mut(), decoder_, ())?;
2577
2578 let _field = value.as_mut();
2579
2580 ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?;
2581
2582 let _field = event_codes.as_mut();
2583 ::fidl_next::Constrained::validate(_field, (10, ()))?;
2584 ::fidl_next::Decode::decode(event_codes.as_mut(), decoder_, (10, ()))?;
2585
2586 let event_codes = unsafe { event_codes.deref_unchecked() };
2587
2588 if event_codes.len() > 10 {
2589 return Err(::fidl_next::DecodeError::VectorTooLong {
2590 size: event_codes.len() as u64,
2591 limit: 10,
2592 });
2593 }
2594
2595 Ok(())
2596 }
2597 }
2598
2599 impl<'de> ::fidl_next::IntoNatural for MetricEventLoggerLogIntegerRequest<'de> {
2600 type Natural = crate::natural::MetricEventLoggerLogIntegerRequest;
2601 }
2602
2603 pub type MetricEventLoggerLogIntegerResponse = ::fidl_next::wire::Unit;
2605
2606 #[derive(Debug)]
2608 #[repr(C)]
2609 pub struct MetricEventLoggerLogIntegerHistogramRequest<'de> {
2610 pub metric_id: ::fidl_next::wire::Uint32,
2611
2612 pub histogram: ::fidl_next::wire::Vector<'de, crate::wire::HistogramBucket>,
2613
2614 pub event_codes: ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>,
2615 }
2616
2617 static_assertions::const_assert_eq!(
2618 std::mem::size_of::<MetricEventLoggerLogIntegerHistogramRequest<'_>>(),
2619 40
2620 );
2621 static_assertions::const_assert_eq!(
2622 std::mem::align_of::<MetricEventLoggerLogIntegerHistogramRequest<'_>>(),
2623 8
2624 );
2625
2626 static_assertions::const_assert_eq!(
2627 std::mem::offset_of!(MetricEventLoggerLogIntegerHistogramRequest<'_>, metric_id),
2628 0
2629 );
2630
2631 static_assertions::const_assert_eq!(
2632 std::mem::offset_of!(MetricEventLoggerLogIntegerHistogramRequest<'_>, histogram),
2633 8
2634 );
2635
2636 static_assertions::const_assert_eq!(
2637 std::mem::offset_of!(MetricEventLoggerLogIntegerHistogramRequest<'_>, event_codes),
2638 24
2639 );
2640
2641 impl ::fidl_next::Constrained for MetricEventLoggerLogIntegerHistogramRequest<'_> {
2642 type Constraint = ();
2643
2644 fn validate(
2645 _: ::fidl_next::Slot<'_, Self>,
2646 _: Self::Constraint,
2647 ) -> Result<(), ::fidl_next::ValidationError> {
2648 Ok(())
2649 }
2650 }
2651
2652 unsafe impl ::fidl_next::Wire for MetricEventLoggerLogIntegerHistogramRequest<'static> {
2653 type Narrowed<'de> = MetricEventLoggerLogIntegerHistogramRequest<'de>;
2654
2655 #[inline]
2656 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2657 ::fidl_next::munge! {
2658 let Self {
2659 metric_id,
2660 histogram,
2661 event_codes,
2662
2663 } = &mut *out_;
2664 }
2665
2666 ::fidl_next::Wire::zero_padding(metric_id);
2667
2668 ::fidl_next::Wire::zero_padding(histogram);
2669
2670 ::fidl_next::Wire::zero_padding(event_codes);
2671
2672 unsafe {
2673 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2674 }
2675 }
2676 }
2677
2678 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
2679 for MetricEventLoggerLogIntegerHistogramRequest<'de>
2680 where
2681 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2682 ___D: ::fidl_next::Decoder<'de>,
2683 {
2684 fn decode(
2685 slot_: ::fidl_next::Slot<'_, Self>,
2686 decoder_: &mut ___D,
2687 _: (),
2688 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2689 if slot_.as_bytes()[4..8] != [0u8; 4] {
2690 return Err(::fidl_next::DecodeError::InvalidPadding);
2691 }
2692
2693 ::fidl_next::munge! {
2694 let Self {
2695 mut metric_id,
2696 mut histogram,
2697 mut event_codes,
2698
2699 } = slot_;
2700 }
2701
2702 let _field = metric_id.as_mut();
2703
2704 ::fidl_next::Decode::decode(metric_id.as_mut(), decoder_, ())?;
2705
2706 let _field = histogram.as_mut();
2707 ::fidl_next::Constrained::validate(_field, (500, ()))?;
2708 ::fidl_next::Decode::decode(histogram.as_mut(), decoder_, (500, ()))?;
2709
2710 let histogram = unsafe { histogram.deref_unchecked() };
2711
2712 if histogram.len() > 500 {
2713 return Err(::fidl_next::DecodeError::VectorTooLong {
2714 size: histogram.len() as u64,
2715 limit: 500,
2716 });
2717 }
2718
2719 let _field = event_codes.as_mut();
2720 ::fidl_next::Constrained::validate(_field, (10, ()))?;
2721 ::fidl_next::Decode::decode(event_codes.as_mut(), decoder_, (10, ()))?;
2722
2723 let event_codes = unsafe { event_codes.deref_unchecked() };
2724
2725 if event_codes.len() > 10 {
2726 return Err(::fidl_next::DecodeError::VectorTooLong {
2727 size: event_codes.len() as u64,
2728 limit: 10,
2729 });
2730 }
2731
2732 Ok(())
2733 }
2734 }
2735
2736 impl<'de> ::fidl_next::IntoNatural for MetricEventLoggerLogIntegerHistogramRequest<'de> {
2737 type Natural = crate::natural::MetricEventLoggerLogIntegerHistogramRequest;
2738 }
2739
2740 pub type MetricEventLoggerLogIntegerHistogramResponse = ::fidl_next::wire::Unit;
2742
2743 #[derive(Debug)]
2745 #[repr(C)]
2746 pub struct MetricEventLoggerLogStringRequest<'de> {
2747 pub metric_id: ::fidl_next::wire::Uint32,
2748
2749 pub string_value: ::fidl_next::wire::String<'de>,
2750
2751 pub event_codes: ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>,
2752 }
2753
2754 static_assertions::const_assert_eq!(
2755 std::mem::size_of::<MetricEventLoggerLogStringRequest<'_>>(),
2756 40
2757 );
2758 static_assertions::const_assert_eq!(
2759 std::mem::align_of::<MetricEventLoggerLogStringRequest<'_>>(),
2760 8
2761 );
2762
2763 static_assertions::const_assert_eq!(
2764 std::mem::offset_of!(MetricEventLoggerLogStringRequest<'_>, metric_id),
2765 0
2766 );
2767
2768 static_assertions::const_assert_eq!(
2769 std::mem::offset_of!(MetricEventLoggerLogStringRequest<'_>, string_value),
2770 8
2771 );
2772
2773 static_assertions::const_assert_eq!(
2774 std::mem::offset_of!(MetricEventLoggerLogStringRequest<'_>, event_codes),
2775 24
2776 );
2777
2778 impl ::fidl_next::Constrained for MetricEventLoggerLogStringRequest<'_> {
2779 type Constraint = ();
2780
2781 fn validate(
2782 _: ::fidl_next::Slot<'_, Self>,
2783 _: Self::Constraint,
2784 ) -> Result<(), ::fidl_next::ValidationError> {
2785 Ok(())
2786 }
2787 }
2788
2789 unsafe impl ::fidl_next::Wire for MetricEventLoggerLogStringRequest<'static> {
2790 type Narrowed<'de> = MetricEventLoggerLogStringRequest<'de>;
2791
2792 #[inline]
2793 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2794 ::fidl_next::munge! {
2795 let Self {
2796 metric_id,
2797 string_value,
2798 event_codes,
2799
2800 } = &mut *out_;
2801 }
2802
2803 ::fidl_next::Wire::zero_padding(metric_id);
2804
2805 ::fidl_next::Wire::zero_padding(string_value);
2806
2807 ::fidl_next::Wire::zero_padding(event_codes);
2808
2809 unsafe {
2810 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2811 }
2812 }
2813 }
2814
2815 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MetricEventLoggerLogStringRequest<'de>
2816 where
2817 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2818 ___D: ::fidl_next::Decoder<'de>,
2819 {
2820 fn decode(
2821 slot_: ::fidl_next::Slot<'_, Self>,
2822 decoder_: &mut ___D,
2823 _: (),
2824 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2825 if slot_.as_bytes()[4..8] != [0u8; 4] {
2826 return Err(::fidl_next::DecodeError::InvalidPadding);
2827 }
2828
2829 ::fidl_next::munge! {
2830 let Self {
2831 mut metric_id,
2832 mut string_value,
2833 mut event_codes,
2834
2835 } = slot_;
2836 }
2837
2838 let _field = metric_id.as_mut();
2839
2840 ::fidl_next::Decode::decode(metric_id.as_mut(), decoder_, ())?;
2841
2842 let _field = string_value.as_mut();
2843 ::fidl_next::Constrained::validate(_field, 256)?;
2844 ::fidl_next::Decode::decode(string_value.as_mut(), decoder_, 256)?;
2845
2846 let string_value = unsafe { string_value.deref_unchecked() };
2847
2848 if string_value.len() > 256 {
2849 return Err(::fidl_next::DecodeError::VectorTooLong {
2850 size: string_value.len() as u64,
2851 limit: 256,
2852 });
2853 }
2854
2855 let _field = event_codes.as_mut();
2856 ::fidl_next::Constrained::validate(_field, (10, ()))?;
2857 ::fidl_next::Decode::decode(event_codes.as_mut(), decoder_, (10, ()))?;
2858
2859 let event_codes = unsafe { event_codes.deref_unchecked() };
2860
2861 if event_codes.len() > 10 {
2862 return Err(::fidl_next::DecodeError::VectorTooLong {
2863 size: event_codes.len() as u64,
2864 limit: 10,
2865 });
2866 }
2867
2868 Ok(())
2869 }
2870 }
2871
2872 impl<'de> ::fidl_next::IntoNatural for MetricEventLoggerLogStringRequest<'de> {
2873 type Natural = crate::natural::MetricEventLoggerLogStringRequest;
2874 }
2875
2876 pub type MetricEventLoggerLogStringResponse = ::fidl_next::wire::Unit;
2878
2879 #[derive(Debug)]
2881 #[repr(C)]
2882 pub struct MetricEventLoggerLogMetricEventsRequest<'de> {
2883 pub events: ::fidl_next::wire::Vector<'de, crate::wire::MetricEvent<'de>>,
2884 }
2885
2886 static_assertions::const_assert_eq!(
2887 std::mem::size_of::<MetricEventLoggerLogMetricEventsRequest<'_>>(),
2888 16
2889 );
2890 static_assertions::const_assert_eq!(
2891 std::mem::align_of::<MetricEventLoggerLogMetricEventsRequest<'_>>(),
2892 8
2893 );
2894
2895 static_assertions::const_assert_eq!(
2896 std::mem::offset_of!(MetricEventLoggerLogMetricEventsRequest<'_>, events),
2897 0
2898 );
2899
2900 impl ::fidl_next::Constrained for MetricEventLoggerLogMetricEventsRequest<'_> {
2901 type Constraint = ();
2902
2903 fn validate(
2904 _: ::fidl_next::Slot<'_, Self>,
2905 _: Self::Constraint,
2906 ) -> Result<(), ::fidl_next::ValidationError> {
2907 Ok(())
2908 }
2909 }
2910
2911 unsafe impl ::fidl_next::Wire for MetricEventLoggerLogMetricEventsRequest<'static> {
2912 type Narrowed<'de> = MetricEventLoggerLogMetricEventsRequest<'de>;
2913
2914 #[inline]
2915 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2916 ::fidl_next::munge! {
2917 let Self {
2918 events,
2919
2920 } = &mut *out_;
2921 }
2922
2923 ::fidl_next::Wire::zero_padding(events);
2924 }
2925 }
2926
2927 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MetricEventLoggerLogMetricEventsRequest<'de>
2928 where
2929 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2930 ___D: ::fidl_next::Decoder<'de>,
2931 {
2932 fn decode(
2933 slot_: ::fidl_next::Slot<'_, Self>,
2934 decoder_: &mut ___D,
2935 _: (),
2936 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2937 ::fidl_next::munge! {
2938 let Self {
2939 mut events,
2940
2941 } = slot_;
2942 }
2943
2944 let _field = events.as_mut();
2945 ::fidl_next::Constrained::validate(_field, (500, ()))?;
2946 ::fidl_next::Decode::decode(events.as_mut(), decoder_, (500, ()))?;
2947
2948 let events = unsafe { events.deref_unchecked() };
2949
2950 if events.len() > 500 {
2951 return Err(::fidl_next::DecodeError::VectorTooLong {
2952 size: events.len() as u64,
2953 limit: 500,
2954 });
2955 }
2956
2957 Ok(())
2958 }
2959 }
2960
2961 impl<'de> ::fidl_next::IntoNatural for MetricEventLoggerLogMetricEventsRequest<'de> {
2962 type Natural = crate::natural::MetricEventLoggerLogMetricEventsRequest;
2963 }
2964
2965 pub type MetricEventLoggerLogMetricEventsResponse = ::fidl_next::wire::Unit;
2967
2968 #[repr(C)]
2970 pub struct ProjectSpec<'de> {
2971 pub(crate) table: ::fidl_next::wire::Table<'de>,
2972 }
2973
2974 impl<'de> Drop for ProjectSpec<'de> {
2975 fn drop(&mut self) {
2976 let _ = self
2977 .table
2978 .get(1)
2979 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
2980
2981 let _ = self
2982 .table
2983 .get(2)
2984 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
2985 }
2986 }
2987
2988 impl ::fidl_next::Constrained for ProjectSpec<'_> {
2989 type Constraint = ();
2990
2991 fn validate(
2992 _: ::fidl_next::Slot<'_, Self>,
2993 _: Self::Constraint,
2994 ) -> Result<(), ::fidl_next::ValidationError> {
2995 Ok(())
2996 }
2997 }
2998
2999 unsafe impl ::fidl_next::Wire for ProjectSpec<'static> {
3000 type Narrowed<'de> = ProjectSpec<'de>;
3001
3002 #[inline]
3003 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3004 ::fidl_next::munge!(let Self { table } = out);
3005 ::fidl_next::wire::Table::zero_padding(table);
3006 }
3007 }
3008
3009 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ProjectSpec<'de>
3010 where
3011 ___D: ::fidl_next::Decoder<'de> + ?Sized,
3012 {
3013 fn decode(
3014 slot: ::fidl_next::Slot<'_, Self>,
3015 decoder: &mut ___D,
3016 _: (),
3017 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3018 ::fidl_next::munge!(let Self { table } = slot);
3019
3020 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3021 match ordinal {
3022 0 => unsafe { ::core::hint::unreachable_unchecked() },
3023
3024 1 => {
3025 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
3026 slot.as_mut(),
3027 decoder,
3028 (),
3029 )?;
3030
3031 Ok(())
3032 }
3033
3034 2 => {
3035 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
3036 slot.as_mut(),
3037 decoder,
3038 (),
3039 )?;
3040
3041 Ok(())
3042 }
3043
3044 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
3045 }
3046 })
3047 }
3048 }
3049
3050 impl<'de> ProjectSpec<'de> {
3051 pub fn customer_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
3052 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3053 }
3054
3055 pub fn take_customer_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
3056 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
3057 }
3058
3059 pub fn project_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
3060 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3061 }
3062
3063 pub fn take_project_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
3064 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
3065 }
3066 }
3067
3068 impl<'de> ::core::fmt::Debug for ProjectSpec<'de> {
3069 fn fmt(
3070 &self,
3071 f: &mut ::core::fmt::Formatter<'_>,
3072 ) -> ::core::result::Result<(), ::core::fmt::Error> {
3073 f.debug_struct("ProjectSpec")
3074 .field("customer_id", &self.customer_id())
3075 .field("project_id", &self.project_id())
3076 .finish()
3077 }
3078 }
3079
3080 impl<'de> ::fidl_next::IntoNatural for ProjectSpec<'de> {
3081 type Natural = crate::natural::ProjectSpec;
3082 }
3083
3084 pub type MetricEventLoggerFactoryCreateMetricEventLoggerResponse = ::fidl_next::wire::Unit;
3086
3087 pub type MetricEventLoggerFactoryCreateMetricEventLoggerWithExperimentsResponse =
3089 ::fidl_next::wire::Unit;
3090}
3091
3092pub mod wire_optional {
3093
3094 #[repr(transparent)]
3095 pub struct MetricEventPayload<'de> {
3096 pub(crate) raw: ::fidl_next::wire::Union,
3097 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
3098 }
3099
3100 impl ::fidl_next::Constrained for MetricEventPayload<'_> {
3101 type Constraint = ();
3102
3103 fn validate(
3104 _: ::fidl_next::Slot<'_, Self>,
3105 _: Self::Constraint,
3106 ) -> Result<(), ::fidl_next::ValidationError> {
3107 Ok(())
3108 }
3109 }
3110
3111 unsafe impl ::fidl_next::Wire for MetricEventPayload<'static> {
3112 type Narrowed<'de> = MetricEventPayload<'de>;
3113
3114 #[inline]
3115 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3116 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
3117 ::fidl_next::wire::Union::zero_padding(raw);
3118 }
3119 }
3120
3121 impl<'de> MetricEventPayload<'de> {
3122 pub fn is_some(&self) -> bool {
3123 self.raw.is_some()
3124 }
3125
3126 pub fn is_none(&self) -> bool {
3127 self.raw.is_none()
3128 }
3129
3130 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::MetricEventPayload<'de>> {
3131 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
3132 }
3133
3134 pub fn into_option(self) -> ::core::option::Option<crate::wire::MetricEventPayload<'de>> {
3135 if self.is_some() {
3136 Some(crate::wire::MetricEventPayload {
3137 raw: self.raw,
3138 _phantom: ::core::marker::PhantomData,
3139 })
3140 } else {
3141 None
3142 }
3143 }
3144 }
3145
3146 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MetricEventPayload<'de>
3147 where
3148 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3149 ___D: ::fidl_next::Decoder<'de>,
3150 {
3151 fn decode(
3152 mut slot: ::fidl_next::Slot<'_, Self>,
3153 decoder: &mut ___D,
3154 _: (),
3155 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3156 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
3157 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
3158 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint64>(
3159 raw,
3160 decoder,
3161 (),
3162 )?,
3163
3164 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int64>(
3165 raw,
3166 decoder,
3167 (),
3168 )?,
3169
3170 3 => ::fidl_next::wire::Union::decode_as::<
3171 ___D,
3172 ::fidl_next::wire::Vector<'de, crate::wire::HistogramBucket>,
3173 >(raw, decoder, (500, ()))?,
3174
3175 4 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
3176 raw, decoder, 256,
3177 )?,
3178
3179 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
3180 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
3181 }
3182
3183 Ok(())
3184 }
3185 }
3186
3187 impl<'de> ::core::fmt::Debug for MetricEventPayload<'de> {
3188 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3189 self.as_ref().fmt(f)
3190 }
3191 }
3192
3193 impl<'de> ::fidl_next::IntoNatural for MetricEventPayload<'de> {
3194 type Natural = ::core::option::Option<crate::natural::MetricEventPayload>;
3195 }
3196}
3197
3198pub mod generic {
3199
3200 pub struct HistogramBucket<T0, T1> {
3202 pub index: T0,
3203
3204 pub count: T1,
3205 }
3206
3207 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::HistogramBucket, ___E>
3208 for HistogramBucket<T0, T1>
3209 where
3210 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3211 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3212 T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
3213 {
3214 #[inline]
3215 fn encode(
3216 self,
3217 encoder_: &mut ___E,
3218 out_: &mut ::core::mem::MaybeUninit<crate::wire::HistogramBucket>,
3219 _: (),
3220 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3221 ::fidl_next::munge! {
3222 let crate::wire::HistogramBucket {
3223 index,
3224 count,
3225
3226 } = out_;
3227 }
3228
3229 ::fidl_next::Encode::encode(self.index, encoder_, index, ())?;
3230
3231 ::fidl_next::Encode::encode(self.count, encoder_, count, ())?;
3232
3233 Ok(())
3234 }
3235 }
3236
3237 unsafe impl<'a, ___E, T0, T1> ::fidl_next::Encode<crate::wire::HistogramBucket, ___E>
3238 for &'a HistogramBucket<T0, T1>
3239 where
3240 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3241 &'a T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3242 &'a T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
3243 {
3244 #[inline]
3245 fn encode(
3246 self,
3247 encoder_: &mut ___E,
3248 out_: &mut ::core::mem::MaybeUninit<crate::wire::HistogramBucket>,
3249 _: (),
3250 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3251 ::fidl_next::munge! {
3252 let crate::wire::HistogramBucket {
3253 index,
3254 count,
3255
3256 } = out_;
3257 }
3258
3259 ::fidl_next::Encode::encode(&self.index, encoder_, index, ())?;
3260
3261 ::fidl_next::Encode::encode(&self.count, encoder_, count, ())?;
3262
3263 Ok(())
3264 }
3265 }
3266
3267 pub struct MetricEvent<T0, T1, T2> {
3269 pub metric_id: T0,
3270
3271 pub event_codes: T1,
3272
3273 pub payload: T2,
3274 }
3275
3276 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<crate::wire::MetricEvent<'static>, ___E>
3277 for MetricEvent<T0, T1, T2>
3278 where
3279 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3280 ___E: ::fidl_next::Encoder,
3281 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3282 T1: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>, ___E>,
3283 T2: ::fidl_next::Encode<crate::wire::MetricEventPayload<'static>, ___E>,
3284 {
3285 #[inline]
3286 fn encode(
3287 self,
3288 encoder_: &mut ___E,
3289 out_: &mut ::core::mem::MaybeUninit<crate::wire::MetricEvent<'static>>,
3290 _: (),
3291 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3292 ::fidl_next::munge! {
3293 let crate::wire::MetricEvent {
3294 metric_id,
3295 event_codes,
3296 payload,
3297
3298 } = out_;
3299 }
3300
3301 ::fidl_next::Encode::encode(self.metric_id, encoder_, metric_id, ())?;
3302
3303 ::fidl_next::Encode::encode(self.event_codes, encoder_, event_codes, (10, ()))?;
3304
3305 ::fidl_next::Encode::encode(self.payload, encoder_, payload, ())?;
3306
3307 Ok(())
3308 }
3309 }
3310
3311 unsafe impl<'a, ___E, T0, T1, T2> ::fidl_next::Encode<crate::wire::MetricEvent<'static>, ___E>
3312 for &'a MetricEvent<T0, T1, T2>
3313 where
3314 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3315 ___E: ::fidl_next::Encoder,
3316 &'a T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3317 &'a T1: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>, ___E>,
3318 &'a T2: ::fidl_next::Encode<crate::wire::MetricEventPayload<'static>, ___E>,
3319 {
3320 #[inline]
3321 fn encode(
3322 self,
3323 encoder_: &mut ___E,
3324 out_: &mut ::core::mem::MaybeUninit<crate::wire::MetricEvent<'static>>,
3325 _: (),
3326 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3327 ::fidl_next::munge! {
3328 let crate::wire::MetricEvent {
3329 metric_id,
3330 event_codes,
3331 payload,
3332
3333 } = out_;
3334 }
3335
3336 ::fidl_next::Encode::encode(&self.metric_id, encoder_, metric_id, ())?;
3337
3338 ::fidl_next::Encode::encode(&self.event_codes, encoder_, event_codes, (10, ()))?;
3339
3340 ::fidl_next::Encode::encode(&self.payload, encoder_, payload, ())?;
3341
3342 Ok(())
3343 }
3344 }
3345
3346 pub struct MetricEventLoggerLogOccurrenceRequest<T0, T1, T2> {
3348 pub metric_id: T0,
3349
3350 pub count: T1,
3351
3352 pub event_codes: T2,
3353 }
3354
3355 unsafe impl<___E, T0, T1, T2>
3356 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>, ___E>
3357 for MetricEventLoggerLogOccurrenceRequest<T0, T1, T2>
3358 where
3359 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3360 ___E: ::fidl_next::Encoder,
3361 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3362 T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
3363 T2: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>, ___E>,
3364 {
3365 #[inline]
3366 fn encode(
3367 self,
3368 encoder_: &mut ___E,
3369 out_: &mut ::core::mem::MaybeUninit<
3370 crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>,
3371 >,
3372 _: (),
3373 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3374 ::fidl_next::munge! {
3375 let crate::wire::MetricEventLoggerLogOccurrenceRequest {
3376 metric_id,
3377 count,
3378 event_codes,
3379
3380 } = out_;
3381 }
3382
3383 ::fidl_next::Encode::encode(self.metric_id, encoder_, metric_id, ())?;
3384
3385 ::fidl_next::Encode::encode(self.count, encoder_, count, ())?;
3386
3387 ::fidl_next::Encode::encode(self.event_codes, encoder_, event_codes, (10, ()))?;
3388
3389 Ok(())
3390 }
3391 }
3392
3393 unsafe impl<'a, ___E, T0, T1, T2>
3394 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>, ___E>
3395 for &'a MetricEventLoggerLogOccurrenceRequest<T0, T1, T2>
3396 where
3397 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3398 ___E: ::fidl_next::Encoder,
3399 &'a T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3400 &'a T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
3401 &'a T2: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>, ___E>,
3402 {
3403 #[inline]
3404 fn encode(
3405 self,
3406 encoder_: &mut ___E,
3407 out_: &mut ::core::mem::MaybeUninit<
3408 crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>,
3409 >,
3410 _: (),
3411 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3412 ::fidl_next::munge! {
3413 let crate::wire::MetricEventLoggerLogOccurrenceRequest {
3414 metric_id,
3415 count,
3416 event_codes,
3417
3418 } = out_;
3419 }
3420
3421 ::fidl_next::Encode::encode(&self.metric_id, encoder_, metric_id, ())?;
3422
3423 ::fidl_next::Encode::encode(&self.count, encoder_, count, ())?;
3424
3425 ::fidl_next::Encode::encode(&self.event_codes, encoder_, event_codes, (10, ()))?;
3426
3427 Ok(())
3428 }
3429 }
3430
3431 pub type MetricEventLoggerLogOccurrenceResponse = ();
3433
3434 pub struct MetricEventLoggerLogIntegerRequest<T0, T1, T2> {
3436 pub metric_id: T0,
3437
3438 pub value: T1,
3439
3440 pub event_codes: T2,
3441 }
3442
3443 unsafe impl<___E, T0, T1, T2>
3444 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogIntegerRequest<'static>, ___E>
3445 for MetricEventLoggerLogIntegerRequest<T0, T1, T2>
3446 where
3447 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3448 ___E: ::fidl_next::Encoder,
3449 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3450 T1: ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>,
3451 T2: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>, ___E>,
3452 {
3453 #[inline]
3454 fn encode(
3455 self,
3456 encoder_: &mut ___E,
3457 out_: &mut ::core::mem::MaybeUninit<
3458 crate::wire::MetricEventLoggerLogIntegerRequest<'static>,
3459 >,
3460 _: (),
3461 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3462 ::fidl_next::munge! {
3463 let crate::wire::MetricEventLoggerLogIntegerRequest {
3464 metric_id,
3465 value,
3466 event_codes,
3467
3468 } = out_;
3469 }
3470
3471 ::fidl_next::Encode::encode(self.metric_id, encoder_, metric_id, ())?;
3472
3473 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
3474
3475 ::fidl_next::Encode::encode(self.event_codes, encoder_, event_codes, (10, ()))?;
3476
3477 Ok(())
3478 }
3479 }
3480
3481 unsafe impl<'a, ___E, T0, T1, T2>
3482 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogIntegerRequest<'static>, ___E>
3483 for &'a MetricEventLoggerLogIntegerRequest<T0, T1, T2>
3484 where
3485 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3486 ___E: ::fidl_next::Encoder,
3487 &'a T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3488 &'a T1: ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>,
3489 &'a T2: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>, ___E>,
3490 {
3491 #[inline]
3492 fn encode(
3493 self,
3494 encoder_: &mut ___E,
3495 out_: &mut ::core::mem::MaybeUninit<
3496 crate::wire::MetricEventLoggerLogIntegerRequest<'static>,
3497 >,
3498 _: (),
3499 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3500 ::fidl_next::munge! {
3501 let crate::wire::MetricEventLoggerLogIntegerRequest {
3502 metric_id,
3503 value,
3504 event_codes,
3505
3506 } = out_;
3507 }
3508
3509 ::fidl_next::Encode::encode(&self.metric_id, encoder_, metric_id, ())?;
3510
3511 ::fidl_next::Encode::encode(&self.value, encoder_, value, ())?;
3512
3513 ::fidl_next::Encode::encode(&self.event_codes, encoder_, event_codes, (10, ()))?;
3514
3515 Ok(())
3516 }
3517 }
3518
3519 pub type MetricEventLoggerLogIntegerResponse = ();
3521
3522 pub struct MetricEventLoggerLogIntegerHistogramRequest<T0, T1, T2> {
3524 pub metric_id: T0,
3525
3526 pub histogram: T1,
3527
3528 pub event_codes: T2,
3529 }
3530
3531 unsafe impl<___E, T0, T1, T2>
3532 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>, ___E>
3533 for MetricEventLoggerLogIntegerHistogramRequest<T0, T1, T2>
3534 where
3535 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3536 ___E: ::fidl_next::Encoder,
3537 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3538 T1: ::fidl_next::Encode<
3539 ::fidl_next::wire::Vector<'static, crate::wire::HistogramBucket>,
3540 ___E,
3541 >,
3542 T2: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>, ___E>,
3543 {
3544 #[inline]
3545 fn encode(
3546 self,
3547 encoder_: &mut ___E,
3548 out_: &mut ::core::mem::MaybeUninit<
3549 crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>,
3550 >,
3551 _: (),
3552 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3553 ::fidl_next::munge! {
3554 let crate::wire::MetricEventLoggerLogIntegerHistogramRequest {
3555 metric_id,
3556 histogram,
3557 event_codes,
3558
3559 } = out_;
3560 }
3561
3562 ::fidl_next::Encode::encode(self.metric_id, encoder_, metric_id, ())?;
3563
3564 ::fidl_next::Encode::encode(self.histogram, encoder_, histogram, (500, ()))?;
3565
3566 ::fidl_next::Encode::encode(self.event_codes, encoder_, event_codes, (10, ()))?;
3567
3568 Ok(())
3569 }
3570 }
3571
3572 unsafe impl<'a, ___E, T0, T1, T2>
3573 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>, ___E>
3574 for &'a MetricEventLoggerLogIntegerHistogramRequest<T0, T1, T2>
3575 where
3576 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3577 ___E: ::fidl_next::Encoder,
3578 &'a T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3579 &'a T1: ::fidl_next::Encode<
3580 ::fidl_next::wire::Vector<'static, crate::wire::HistogramBucket>,
3581 ___E,
3582 >,
3583 &'a T2: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>, ___E>,
3584 {
3585 #[inline]
3586 fn encode(
3587 self,
3588 encoder_: &mut ___E,
3589 out_: &mut ::core::mem::MaybeUninit<
3590 crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>,
3591 >,
3592 _: (),
3593 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3594 ::fidl_next::munge! {
3595 let crate::wire::MetricEventLoggerLogIntegerHistogramRequest {
3596 metric_id,
3597 histogram,
3598 event_codes,
3599
3600 } = out_;
3601 }
3602
3603 ::fidl_next::Encode::encode(&self.metric_id, encoder_, metric_id, ())?;
3604
3605 ::fidl_next::Encode::encode(&self.histogram, encoder_, histogram, (500, ()))?;
3606
3607 ::fidl_next::Encode::encode(&self.event_codes, encoder_, event_codes, (10, ()))?;
3608
3609 Ok(())
3610 }
3611 }
3612
3613 pub type MetricEventLoggerLogIntegerHistogramResponse = ();
3615
3616 pub struct MetricEventLoggerLogStringRequest<T0, T1, T2> {
3618 pub metric_id: T0,
3619
3620 pub string_value: T1,
3621
3622 pub event_codes: T2,
3623 }
3624
3625 unsafe impl<___E, T0, T1, T2>
3626 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogStringRequest<'static>, ___E>
3627 for MetricEventLoggerLogStringRequest<T0, T1, T2>
3628 where
3629 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3630 ___E: ::fidl_next::Encoder,
3631 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3632 T1: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
3633 T2: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>, ___E>,
3634 {
3635 #[inline]
3636 fn encode(
3637 self,
3638 encoder_: &mut ___E,
3639 out_: &mut ::core::mem::MaybeUninit<
3640 crate::wire::MetricEventLoggerLogStringRequest<'static>,
3641 >,
3642 _: (),
3643 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3644 ::fidl_next::munge! {
3645 let crate::wire::MetricEventLoggerLogStringRequest {
3646 metric_id,
3647 string_value,
3648 event_codes,
3649
3650 } = out_;
3651 }
3652
3653 ::fidl_next::Encode::encode(self.metric_id, encoder_, metric_id, ())?;
3654
3655 ::fidl_next::Encode::encode(self.string_value, encoder_, string_value, 256)?;
3656
3657 ::fidl_next::Encode::encode(self.event_codes, encoder_, event_codes, (10, ()))?;
3658
3659 Ok(())
3660 }
3661 }
3662
3663 unsafe impl<'a, ___E, T0, T1, T2>
3664 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogStringRequest<'static>, ___E>
3665 for &'a MetricEventLoggerLogStringRequest<T0, T1, T2>
3666 where
3667 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3668 ___E: ::fidl_next::Encoder,
3669 &'a T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3670 &'a T1: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
3671 &'a T2: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>, ___E>,
3672 {
3673 #[inline]
3674 fn encode(
3675 self,
3676 encoder_: &mut ___E,
3677 out_: &mut ::core::mem::MaybeUninit<
3678 crate::wire::MetricEventLoggerLogStringRequest<'static>,
3679 >,
3680 _: (),
3681 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3682 ::fidl_next::munge! {
3683 let crate::wire::MetricEventLoggerLogStringRequest {
3684 metric_id,
3685 string_value,
3686 event_codes,
3687
3688 } = out_;
3689 }
3690
3691 ::fidl_next::Encode::encode(&self.metric_id, encoder_, metric_id, ())?;
3692
3693 ::fidl_next::Encode::encode(&self.string_value, encoder_, string_value, 256)?;
3694
3695 ::fidl_next::Encode::encode(&self.event_codes, encoder_, event_codes, (10, ()))?;
3696
3697 Ok(())
3698 }
3699 }
3700
3701 pub type MetricEventLoggerLogStringResponse = ();
3703
3704 pub struct MetricEventLoggerLogMetricEventsRequest<T0> {
3706 pub events: T0,
3707 }
3708
3709 unsafe impl<___E, T0>
3710 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>, ___E>
3711 for MetricEventLoggerLogMetricEventsRequest<T0>
3712 where
3713 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3714 ___E: ::fidl_next::Encoder,
3715 T0: ::fidl_next::Encode<
3716 ::fidl_next::wire::Vector<'static, crate::wire::MetricEvent<'static>>,
3717 ___E,
3718 >,
3719 {
3720 #[inline]
3721 fn encode(
3722 self,
3723 encoder_: &mut ___E,
3724 out_: &mut ::core::mem::MaybeUninit<
3725 crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>,
3726 >,
3727 _: (),
3728 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3729 ::fidl_next::munge! {
3730 let crate::wire::MetricEventLoggerLogMetricEventsRequest {
3731 events,
3732
3733 } = out_;
3734 }
3735
3736 ::fidl_next::Encode::encode(self.events, encoder_, events, (500, ()))?;
3737
3738 Ok(())
3739 }
3740 }
3741
3742 unsafe impl<'a, ___E, T0>
3743 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>, ___E>
3744 for &'a MetricEventLoggerLogMetricEventsRequest<T0>
3745 where
3746 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3747 ___E: ::fidl_next::Encoder,
3748 &'a T0: ::fidl_next::Encode<
3749 ::fidl_next::wire::Vector<'static, crate::wire::MetricEvent<'static>>,
3750 ___E,
3751 >,
3752 {
3753 #[inline]
3754 fn encode(
3755 self,
3756 encoder_: &mut ___E,
3757 out_: &mut ::core::mem::MaybeUninit<
3758 crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>,
3759 >,
3760 _: (),
3761 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3762 ::fidl_next::munge! {
3763 let crate::wire::MetricEventLoggerLogMetricEventsRequest {
3764 events,
3765
3766 } = out_;
3767 }
3768
3769 ::fidl_next::Encode::encode(&self.events, encoder_, events, (500, ()))?;
3770
3771 Ok(())
3772 }
3773 }
3774
3775 pub type MetricEventLoggerLogMetricEventsResponse = ();
3777
3778 pub type MetricEventLoggerFactoryCreateMetricEventLoggerResponse = ();
3780
3781 pub type MetricEventLoggerFactoryCreateMetricEventLoggerWithExperimentsResponse = ();
3783}
3784
3785pub use self::natural::*;
3786
3787#[doc = " Maximum number of event codes that can be associated with a single event.\n"]
3788pub const MAX_METRIC_DIMENSIONS: u32 = 10 as u32;
3789
3790#[doc = " This is intended as a reasonable maximum number of histogram buckets per\n event.\n"]
3791pub const MAX_HISTOGRAM_BUCKETS: u32 = 500 as u32;
3792
3793#[doc = " Maximum number of events that may be logged in a single FIDL call.\n"]
3794pub const MAX_BATCHED_EVENTS: u32 = 500 as u32;
3795
3796#[doc = " The maximum size of a single Event is 100 KB.\n"]
3797pub const MAX_BYTES_PER_EVENT: i64 = 102400 as i64;
3798
3799#[doc = " Maximum number of experiment ids that can be provided to a single logger.\n"]
3800pub const MAX_EXPERIMENT_IDS: u32 = 100 as u32;
3801
3802#[doc = " String events should not be longer than this.\n"]
3803pub const MAX_STRING_EVENT_SIZE: u32 = 256 as u32;
3804
3805#[doc = " A logger for events that are associated with one project\'s metrics.\n"]
3807#[derive(PartialEq, Debug)]
3808pub struct MetricEventLogger;
3809
3810#[cfg(target_os = "fuchsia")]
3811impl ::fidl_next::HasTransport for MetricEventLogger {
3812 type Transport = ::fidl_next::fuchsia::zx::Channel;
3813}
3814
3815pub mod metric_event_logger {
3816 pub mod prelude {
3817 pub use crate::{
3818 MetricEventLogger, MetricEventLoggerClientHandler, MetricEventLoggerLocalClientHandler,
3819 MetricEventLoggerLocalServerHandler, MetricEventLoggerServerHandler,
3820 metric_event_logger,
3821 };
3822
3823 pub use crate::natural::Error;
3824
3825 pub use crate::natural::MetricEventLoggerLogIntegerHistogramRequest;
3826
3827 pub use crate::natural::MetricEventLoggerLogIntegerRequest;
3828
3829 pub use crate::natural::MetricEventLoggerLogMetricEventsRequest;
3830
3831 pub use crate::natural::MetricEventLoggerLogOccurrenceRequest;
3832
3833 pub use crate::natural::MetricEventLoggerLogStringRequest;
3834
3835 pub use crate::natural::MetricEventLoggerLogIntegerHistogramResponse;
3836
3837 pub use crate::natural::MetricEventLoggerLogIntegerResponse;
3838
3839 pub use crate::natural::MetricEventLoggerLogMetricEventsResponse;
3840
3841 pub use crate::natural::MetricEventLoggerLogOccurrenceResponse;
3842
3843 pub use crate::natural::MetricEventLoggerLogStringResponse;
3844 }
3845
3846 pub struct LogOccurrence;
3847
3848 impl ::fidl_next::Method for LogOccurrence {
3849 const ORDINAL: u64 = 2751850579569128364;
3850 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3851 ::fidl_next::protocol::Flexibility::Strict;
3852
3853 type Protocol = crate::MetricEventLogger;
3854
3855 type Request = crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>;
3856 }
3857
3858 impl ::fidl_next::TwoWayMethod for LogOccurrence {
3859 type Response = ::fidl_next::wire::Result<
3860 'static,
3861 crate::wire::MetricEventLoggerLogOccurrenceResponse,
3862 crate::wire::Error,
3863 >;
3864 }
3865
3866 impl<___R> ::fidl_next::Respond<___R> for LogOccurrence {
3867 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3868
3869 fn respond(response: ___R) -> Self::Output {
3870 ::core::result::Result::Ok(response)
3871 }
3872 }
3873
3874 impl<___R> ::fidl_next::RespondErr<___R> for LogOccurrence {
3875 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3876
3877 fn respond_err(response: ___R) -> Self::Output {
3878 ::core::result::Result::Err(response)
3879 }
3880 }
3881
3882 pub struct LogInteger;
3883
3884 impl ::fidl_next::Method for LogInteger {
3885 const ORDINAL: u64 = 6720834109725988178;
3886 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3887 ::fidl_next::protocol::Flexibility::Strict;
3888
3889 type Protocol = crate::MetricEventLogger;
3890
3891 type Request = crate::wire::MetricEventLoggerLogIntegerRequest<'static>;
3892 }
3893
3894 impl ::fidl_next::TwoWayMethod for LogInteger {
3895 type Response = ::fidl_next::wire::Result<
3896 'static,
3897 crate::wire::MetricEventLoggerLogIntegerResponse,
3898 crate::wire::Error,
3899 >;
3900 }
3901
3902 impl<___R> ::fidl_next::Respond<___R> for LogInteger {
3903 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3904
3905 fn respond(response: ___R) -> Self::Output {
3906 ::core::result::Result::Ok(response)
3907 }
3908 }
3909
3910 impl<___R> ::fidl_next::RespondErr<___R> for LogInteger {
3911 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3912
3913 fn respond_err(response: ___R) -> Self::Output {
3914 ::core::result::Result::Err(response)
3915 }
3916 }
3917
3918 pub struct LogIntegerHistogram;
3919
3920 impl ::fidl_next::Method for LogIntegerHistogram {
3921 const ORDINAL: u64 = 8767534769977819584;
3922 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3923 ::fidl_next::protocol::Flexibility::Strict;
3924
3925 type Protocol = crate::MetricEventLogger;
3926
3927 type Request = crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>;
3928 }
3929
3930 impl ::fidl_next::TwoWayMethod for LogIntegerHistogram {
3931 type Response = ::fidl_next::wire::Result<
3932 'static,
3933 crate::wire::MetricEventLoggerLogIntegerHistogramResponse,
3934 crate::wire::Error,
3935 >;
3936 }
3937
3938 impl<___R> ::fidl_next::Respond<___R> for LogIntegerHistogram {
3939 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3940
3941 fn respond(response: ___R) -> Self::Output {
3942 ::core::result::Result::Ok(response)
3943 }
3944 }
3945
3946 impl<___R> ::fidl_next::RespondErr<___R> for LogIntegerHistogram {
3947 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3948
3949 fn respond_err(response: ___R) -> Self::Output {
3950 ::core::result::Result::Err(response)
3951 }
3952 }
3953
3954 pub struct LogString;
3955
3956 impl ::fidl_next::Method for LogString {
3957 const ORDINAL: u64 = 1590315742604854016;
3958 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3959 ::fidl_next::protocol::Flexibility::Strict;
3960
3961 type Protocol = crate::MetricEventLogger;
3962
3963 type Request = crate::wire::MetricEventLoggerLogStringRequest<'static>;
3964 }
3965
3966 impl ::fidl_next::TwoWayMethod for LogString {
3967 type Response = ::fidl_next::wire::Result<
3968 'static,
3969 crate::wire::MetricEventLoggerLogStringResponse,
3970 crate::wire::Error,
3971 >;
3972 }
3973
3974 impl<___R> ::fidl_next::Respond<___R> for LogString {
3975 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3976
3977 fn respond(response: ___R) -> Self::Output {
3978 ::core::result::Result::Ok(response)
3979 }
3980 }
3981
3982 impl<___R> ::fidl_next::RespondErr<___R> for LogString {
3983 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3984
3985 fn respond_err(response: ___R) -> Self::Output {
3986 ::core::result::Result::Err(response)
3987 }
3988 }
3989
3990 pub struct LogMetricEvents;
3991
3992 impl ::fidl_next::Method for LogMetricEvents {
3993 const ORDINAL: u64 = 5587883824215362667;
3994 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3995 ::fidl_next::protocol::Flexibility::Strict;
3996
3997 type Protocol = crate::MetricEventLogger;
3998
3999 type Request = crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>;
4000 }
4001
4002 impl ::fidl_next::TwoWayMethod for LogMetricEvents {
4003 type Response = ::fidl_next::wire::Result<
4004 'static,
4005 crate::wire::MetricEventLoggerLogMetricEventsResponse,
4006 crate::wire::Error,
4007 >;
4008 }
4009
4010 impl<___R> ::fidl_next::Respond<___R> for LogMetricEvents {
4011 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
4012
4013 fn respond(response: ___R) -> Self::Output {
4014 ::core::result::Result::Ok(response)
4015 }
4016 }
4017
4018 impl<___R> ::fidl_next::RespondErr<___R> for LogMetricEvents {
4019 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
4020
4021 fn respond_err(response: ___R) -> Self::Output {
4022 ::core::result::Result::Err(response)
4023 }
4024 }
4025
4026 mod ___detail {
4027 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::MetricEventLogger
4028 where
4029 ___T: ::fidl_next::Transport,
4030 {
4031 type Client = MetricEventLoggerClient<___T>;
4032 type Server = MetricEventLoggerServer<___T>;
4033 }
4034
4035 #[repr(transparent)]
4037 pub struct MetricEventLoggerClient<___T: ::fidl_next::Transport> {
4038 #[allow(dead_code)]
4039 client: ::fidl_next::protocol::Client<___T>,
4040 }
4041
4042 impl<___T> MetricEventLoggerClient<___T>
4043 where
4044 ___T: ::fidl_next::Transport,
4045 {
4046 #[doc = " Logs the fact that an event has occurred a number of times.\n\n `metric_id` ID of the metric being logged.\n\n `count` The number of times the event has occurred. The value should\n be positive as a value of 0 is ignored.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Occurrence counts with the same event codes are aggregated\n based on these parameters.\n"]
4047 pub fn log_occurrence(
4048 &self,
4049
4050 metric_id: impl ::fidl_next::Encode<
4051 ::fidl_next::wire::Uint32,
4052 <___T as ::fidl_next::Transport>::SendBuffer,
4053 >,
4054
4055 count: impl ::fidl_next::Encode<
4056 ::fidl_next::wire::Uint64,
4057 <___T as ::fidl_next::Transport>::SendBuffer,
4058 >,
4059
4060 event_codes: impl ::fidl_next::Encode<
4061 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>,
4062 <___T as ::fidl_next::Transport>::SendBuffer,
4063 >,
4064 ) -> ::fidl_next::TwoWayFuture<'_, super::LogOccurrence, ___T>
4065 where
4066 <___T as ::fidl_next::Transport>::SendBuffer:
4067 ::fidl_next::encoder::InternalHandleEncoder,
4068 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4069 {
4070 self.log_occurrence_with(crate::generic::MetricEventLoggerLogOccurrenceRequest {
4071 metric_id,
4072
4073 count,
4074
4075 event_codes,
4076 })
4077 }
4078
4079 #[doc = " Logs the fact that an event has occurred a number of times.\n\n `metric_id` ID of the metric being logged.\n\n `count` The number of times the event has occurred. The value should\n be positive as a value of 0 is ignored.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Occurrence counts with the same event codes are aggregated\n based on these parameters.\n"]
4080 pub fn log_occurrence_with<___R>(
4081 &self,
4082 request: ___R,
4083 ) -> ::fidl_next::TwoWayFuture<'_, super::LogOccurrence, ___T>
4084 where
4085 ___R: ::fidl_next::Encode<
4086 crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>,
4087 <___T as ::fidl_next::Transport>::SendBuffer,
4088 >,
4089 {
4090 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4091 2751850579569128364,
4092 <super::LogOccurrence as ::fidl_next::Method>::FLEXIBILITY,
4093 request,
4094 ))
4095 }
4096
4097 #[doc = " Logs an integer measurement.\n\n `metric_id` ID of the metric being logged.\n\n `value` The integer measurement.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Integer values with the same event codes are aggregated\n based on these parameters.\n"]
4098 pub fn log_integer(
4099 &self,
4100
4101 metric_id: impl ::fidl_next::Encode<
4102 ::fidl_next::wire::Uint32,
4103 <___T as ::fidl_next::Transport>::SendBuffer,
4104 >,
4105
4106 value: impl ::fidl_next::Encode<
4107 ::fidl_next::wire::Int64,
4108 <___T as ::fidl_next::Transport>::SendBuffer,
4109 >,
4110
4111 event_codes: impl ::fidl_next::Encode<
4112 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>,
4113 <___T as ::fidl_next::Transport>::SendBuffer,
4114 >,
4115 ) -> ::fidl_next::TwoWayFuture<'_, super::LogInteger, ___T>
4116 where
4117 <___T as ::fidl_next::Transport>::SendBuffer:
4118 ::fidl_next::encoder::InternalHandleEncoder,
4119 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4120 {
4121 self.log_integer_with(crate::generic::MetricEventLoggerLogIntegerRequest {
4122 metric_id,
4123
4124 value,
4125
4126 event_codes,
4127 })
4128 }
4129
4130 #[doc = " Logs an integer measurement.\n\n `metric_id` ID of the metric being logged.\n\n `value` The integer measurement.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Integer values with the same event codes are aggregated\n based on these parameters.\n"]
4131 pub fn log_integer_with<___R>(
4132 &self,
4133 request: ___R,
4134 ) -> ::fidl_next::TwoWayFuture<'_, super::LogInteger, ___T>
4135 where
4136 ___R: ::fidl_next::Encode<
4137 crate::wire::MetricEventLoggerLogIntegerRequest<'static>,
4138 <___T as ::fidl_next::Transport>::SendBuffer,
4139 >,
4140 {
4141 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4142 6720834109725988178,
4143 <super::LogInteger as ::fidl_next::Method>::FLEXIBILITY,
4144 request,
4145 ))
4146 }
4147
4148 #[doc = " Logs a histogram giving many approximate integer measurements.\n\n `metric_id` ID of the metric being logged.\n\n `histogram` The collection of approximate integer measurements. Buckets\n that have no measurement (empty buckets) should not be sent.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Histograms with the same event codes are aggregated together\n based on these parameters.\n"]
4149 pub fn log_integer_histogram(
4150 &self,
4151
4152 metric_id: impl ::fidl_next::Encode<
4153 ::fidl_next::wire::Uint32,
4154 <___T as ::fidl_next::Transport>::SendBuffer,
4155 >,
4156
4157 histogram: impl ::fidl_next::Encode<
4158 ::fidl_next::wire::Vector<'static, crate::wire::HistogramBucket>,
4159 <___T as ::fidl_next::Transport>::SendBuffer,
4160 >,
4161
4162 event_codes: impl ::fidl_next::Encode<
4163 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>,
4164 <___T as ::fidl_next::Transport>::SendBuffer,
4165 >,
4166 ) -> ::fidl_next::TwoWayFuture<'_, super::LogIntegerHistogram, ___T>
4167 where
4168 <___T as ::fidl_next::Transport>::SendBuffer:
4169 ::fidl_next::encoder::InternalHandleEncoder,
4170 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4171 {
4172 self.log_integer_histogram_with(
4173 crate::generic::MetricEventLoggerLogIntegerHistogramRequest {
4174 metric_id,
4175
4176 histogram,
4177
4178 event_codes,
4179 },
4180 )
4181 }
4182
4183 #[doc = " Logs a histogram giving many approximate integer measurements.\n\n `metric_id` ID of the metric being logged.\n\n `histogram` The collection of approximate integer measurements. Buckets\n that have no measurement (empty buckets) should not be sent.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Histograms with the same event codes are aggregated together\n based on these parameters.\n"]
4184 pub fn log_integer_histogram_with<___R>(
4185 &self,
4186 request: ___R,
4187 ) -> ::fidl_next::TwoWayFuture<'_, super::LogIntegerHistogram, ___T>
4188 where
4189 ___R: ::fidl_next::Encode<
4190 crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>,
4191 <___T as ::fidl_next::Transport>::SendBuffer,
4192 >,
4193 {
4194 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4195 8767534769977819584,
4196 <super::LogIntegerHistogram as ::fidl_next::Method>::FLEXIBILITY,
4197 request,
4198 ))
4199 }
4200
4201 #[doc = " Logs a string value that was observed.\n\n `metric_id` ID of the metric being logged.\n\n `string_value` The string to log.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Counts of logged strings are aggregated separately based on\n these parameters.\n"]
4202 pub fn log_string(
4203 &self,
4204
4205 metric_id: impl ::fidl_next::Encode<
4206 ::fidl_next::wire::Uint32,
4207 <___T as ::fidl_next::Transport>::SendBuffer,
4208 >,
4209
4210 string_value: impl ::fidl_next::Encode<
4211 ::fidl_next::wire::String<'static>,
4212 <___T as ::fidl_next::Transport>::SendBuffer,
4213 >,
4214
4215 event_codes: impl ::fidl_next::Encode<
4216 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>,
4217 <___T as ::fidl_next::Transport>::SendBuffer,
4218 >,
4219 ) -> ::fidl_next::TwoWayFuture<'_, super::LogString, ___T>
4220 where
4221 <___T as ::fidl_next::Transport>::SendBuffer:
4222 ::fidl_next::encoder::InternalHandleEncoder,
4223 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4224 {
4225 self.log_string_with(crate::generic::MetricEventLoggerLogStringRequest {
4226 metric_id,
4227
4228 string_value,
4229
4230 event_codes,
4231 })
4232 }
4233
4234 #[doc = " Logs a string value that was observed.\n\n `metric_id` ID of the metric being logged.\n\n `string_value` The string to log.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Counts of logged strings are aggregated separately based on\n these parameters.\n"]
4235 pub fn log_string_with<___R>(
4236 &self,
4237 request: ___R,
4238 ) -> ::fidl_next::TwoWayFuture<'_, super::LogString, ___T>
4239 where
4240 ___R: ::fidl_next::Encode<
4241 crate::wire::MetricEventLoggerLogStringRequest<'static>,
4242 <___T as ::fidl_next::Transport>::SendBuffer,
4243 >,
4244 {
4245 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4246 1590315742604854016,
4247 <super::LogString as ::fidl_next::Method>::FLEXIBILITY,
4248 request,
4249 ))
4250 }
4251
4252 #[doc = " Bulk logging method, equivalent to making many of the above Log*() calls\n at once.\n"]
4253 pub fn log_metric_events(
4254 &self,
4255
4256 events: impl ::fidl_next::Encode<
4257 ::fidl_next::wire::Vector<'static, crate::wire::MetricEvent<'static>>,
4258 <___T as ::fidl_next::Transport>::SendBuffer,
4259 >,
4260 ) -> ::fidl_next::TwoWayFuture<'_, super::LogMetricEvents, ___T>
4261 where
4262 <___T as ::fidl_next::Transport>::SendBuffer:
4263 ::fidl_next::encoder::InternalHandleEncoder,
4264 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4265 {
4266 self.log_metric_events_with(
4267 crate::generic::MetricEventLoggerLogMetricEventsRequest { events },
4268 )
4269 }
4270
4271 #[doc = " Bulk logging method, equivalent to making many of the above Log*() calls\n at once.\n"]
4272 pub fn log_metric_events_with<___R>(
4273 &self,
4274 request: ___R,
4275 ) -> ::fidl_next::TwoWayFuture<'_, super::LogMetricEvents, ___T>
4276 where
4277 ___R: ::fidl_next::Encode<
4278 crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>,
4279 <___T as ::fidl_next::Transport>::SendBuffer,
4280 >,
4281 {
4282 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4283 5587883824215362667,
4284 <super::LogMetricEvents as ::fidl_next::Method>::FLEXIBILITY,
4285 request,
4286 ))
4287 }
4288 }
4289
4290 #[repr(transparent)]
4292 pub struct MetricEventLoggerServer<___T: ::fidl_next::Transport> {
4293 server: ::fidl_next::protocol::Server<___T>,
4294 }
4295
4296 impl<___T> MetricEventLoggerServer<___T> where ___T: ::fidl_next::Transport {}
4297 }
4298}
4299
4300#[diagnostic::on_unimplemented(
4301 note = "If {Self} implements the non-local MetricEventLoggerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
4302)]
4303
4304pub trait MetricEventLoggerLocalClientHandler<
4308 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4309 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4310>
4311{
4312}
4313
4314impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for MetricEventLogger
4315where
4316 ___H: MetricEventLoggerLocalClientHandler<___T>,
4317 ___T: ::fidl_next::Transport,
4318{
4319 async fn on_event(
4320 handler: &mut ___H,
4321 mut message: ::fidl_next::Message<___T>,
4322 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4323 match *message.header().ordinal {
4324 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4325 }
4326 }
4327}
4328
4329#[diagnostic::on_unimplemented(
4330 note = "If {Self} implements the non-local MetricEventLoggerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
4331)]
4332
4333pub trait MetricEventLoggerLocalServerHandler<
4337 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4338 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4339>
4340{
4341 #[doc = " Logs the fact that an event has occurred a number of times.\n\n `metric_id` ID of the metric being logged.\n\n `count` The number of times the event has occurred. The value should\n be positive as a value of 0 is ignored.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Occurrence counts with the same event codes are aggregated\n based on these parameters.\n"]
4342 fn log_occurrence(
4343 &mut self,
4344
4345 request: ::fidl_next::Request<metric_event_logger::LogOccurrence, ___T>,
4346
4347 responder: ::fidl_next::Responder<metric_event_logger::LogOccurrence, ___T>,
4348 ) -> impl ::core::future::Future<Output = ()>;
4349
4350 #[doc = " Logs an integer measurement.\n\n `metric_id` ID of the metric being logged.\n\n `value` The integer measurement.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Integer values with the same event codes are aggregated\n based on these parameters.\n"]
4351 fn log_integer(
4352 &mut self,
4353
4354 request: ::fidl_next::Request<metric_event_logger::LogInteger, ___T>,
4355
4356 responder: ::fidl_next::Responder<metric_event_logger::LogInteger, ___T>,
4357 ) -> impl ::core::future::Future<Output = ()>;
4358
4359 #[doc = " Logs a histogram giving many approximate integer measurements.\n\n `metric_id` ID of the metric being logged.\n\n `histogram` The collection of approximate integer measurements. Buckets\n that have no measurement (empty buckets) should not be sent.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Histograms with the same event codes are aggregated together\n based on these parameters.\n"]
4360 fn log_integer_histogram(
4361 &mut self,
4362
4363 request: ::fidl_next::Request<metric_event_logger::LogIntegerHistogram, ___T>,
4364
4365 responder: ::fidl_next::Responder<metric_event_logger::LogIntegerHistogram, ___T>,
4366 ) -> impl ::core::future::Future<Output = ()>;
4367
4368 #[doc = " Logs a string value that was observed.\n\n `metric_id` ID of the metric being logged.\n\n `string_value` The string to log.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Counts of logged strings are aggregated separately based on\n these parameters.\n"]
4369 fn log_string(
4370 &mut self,
4371
4372 request: ::fidl_next::Request<metric_event_logger::LogString, ___T>,
4373
4374 responder: ::fidl_next::Responder<metric_event_logger::LogString, ___T>,
4375 ) -> impl ::core::future::Future<Output = ()>;
4376
4377 #[doc = " Bulk logging method, equivalent to making many of the above Log*() calls\n at once.\n"]
4378 fn log_metric_events(
4379 &mut self,
4380
4381 request: ::fidl_next::Request<metric_event_logger::LogMetricEvents, ___T>,
4382
4383 responder: ::fidl_next::Responder<metric_event_logger::LogMetricEvents, ___T>,
4384 ) -> impl ::core::future::Future<Output = ()>;
4385}
4386
4387impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for MetricEventLogger
4388where
4389 ___H: MetricEventLoggerLocalServerHandler<___T>,
4390 ___T: ::fidl_next::Transport,
4391 for<'de> crate::wire::MetricEventLoggerLogOccurrenceRequest<'de>: ::fidl_next::Decode<
4392 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4393 Constraint = (),
4394 >,
4395 for<'de> crate::wire::MetricEventLoggerLogIntegerRequest<'de>: ::fidl_next::Decode<
4396 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4397 Constraint = (),
4398 >,
4399 for<'de> crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'de>: ::fidl_next::Decode<
4400 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4401 Constraint = (),
4402 >,
4403 for<'de> crate::wire::MetricEventLoggerLogStringRequest<'de>: ::fidl_next::Decode<
4404 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4405 Constraint = (),
4406 >,
4407 for<'de> crate::wire::MetricEventLoggerLogMetricEventsRequest<'de>: ::fidl_next::Decode<
4408 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4409 Constraint = (),
4410 >,
4411{
4412 async fn on_one_way(
4413 handler: &mut ___H,
4414 mut message: ::fidl_next::Message<___T>,
4415 ) -> ::core::result::Result<
4416 (),
4417 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4418 > {
4419 match *message.header().ordinal {
4420 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4421 }
4422 }
4423
4424 async fn on_two_way(
4425 handler: &mut ___H,
4426 mut message: ::fidl_next::Message<___T>,
4427 responder: ::fidl_next::protocol::Responder<___T>,
4428 ) -> ::core::result::Result<
4429 (),
4430 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4431 > {
4432 match *message.header().ordinal {
4433 2751850579569128364 => {
4434 let responder = ::fidl_next::Responder::from_untyped(responder);
4435
4436 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4437 Ok(decoded) => {
4438 handler
4439 .log_occurrence(::fidl_next::Request::from_decoded(decoded), responder)
4440 .await;
4441 Ok(())
4442 }
4443 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4444 ordinal: 2751850579569128364,
4445 error,
4446 }),
4447 }
4448 }
4449
4450 6720834109725988178 => {
4451 let responder = ::fidl_next::Responder::from_untyped(responder);
4452
4453 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4454 Ok(decoded) => {
4455 handler
4456 .log_integer(::fidl_next::Request::from_decoded(decoded), responder)
4457 .await;
4458 Ok(())
4459 }
4460 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4461 ordinal: 6720834109725988178,
4462 error,
4463 }),
4464 }
4465 }
4466
4467 8767534769977819584 => {
4468 let responder = ::fidl_next::Responder::from_untyped(responder);
4469
4470 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4471 Ok(decoded) => {
4472 handler
4473 .log_integer_histogram(
4474 ::fidl_next::Request::from_decoded(decoded),
4475 responder,
4476 )
4477 .await;
4478 Ok(())
4479 }
4480 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4481 ordinal: 8767534769977819584,
4482 error,
4483 }),
4484 }
4485 }
4486
4487 1590315742604854016 => {
4488 let responder = ::fidl_next::Responder::from_untyped(responder);
4489
4490 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4491 Ok(decoded) => {
4492 handler
4493 .log_string(::fidl_next::Request::from_decoded(decoded), responder)
4494 .await;
4495 Ok(())
4496 }
4497 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4498 ordinal: 1590315742604854016,
4499 error,
4500 }),
4501 }
4502 }
4503
4504 5587883824215362667 => {
4505 let responder = ::fidl_next::Responder::from_untyped(responder);
4506
4507 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4508 Ok(decoded) => {
4509 handler
4510 .log_metric_events(
4511 ::fidl_next::Request::from_decoded(decoded),
4512 responder,
4513 )
4514 .await;
4515 Ok(())
4516 }
4517 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4518 ordinal: 5587883824215362667,
4519 error,
4520 }),
4521 }
4522 }
4523
4524 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4525 }
4526 }
4527}
4528
4529pub trait MetricEventLoggerClientHandler<
4533 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4534 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4535>
4536{
4537}
4538
4539impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for MetricEventLogger
4540where
4541 ___H: MetricEventLoggerClientHandler<___T> + ::core::marker::Send,
4542 ___T: ::fidl_next::Transport,
4543{
4544 async fn on_event(
4545 handler: &mut ___H,
4546 mut message: ::fidl_next::Message<___T>,
4547 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4548 match *message.header().ordinal {
4549 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4550 }
4551 }
4552}
4553
4554pub trait MetricEventLoggerServerHandler<
4558 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4559 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4560>
4561{
4562 #[doc = " Logs the fact that an event has occurred a number of times.\n\n `metric_id` ID of the metric being logged.\n\n `count` The number of times the event has occurred. The value should\n be positive as a value of 0 is ignored.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Occurrence counts with the same event codes are aggregated\n based on these parameters.\n"]
4563 fn log_occurrence(
4564 &mut self,
4565
4566 request: ::fidl_next::Request<metric_event_logger::LogOccurrence, ___T>,
4567
4568 responder: ::fidl_next::Responder<metric_event_logger::LogOccurrence, ___T>,
4569 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4570
4571 #[doc = " Logs an integer measurement.\n\n `metric_id` ID of the metric being logged.\n\n `value` The integer measurement.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Integer values with the same event codes are aggregated\n based on these parameters.\n"]
4572 fn log_integer(
4573 &mut self,
4574
4575 request: ::fidl_next::Request<metric_event_logger::LogInteger, ___T>,
4576
4577 responder: ::fidl_next::Responder<metric_event_logger::LogInteger, ___T>,
4578 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4579
4580 #[doc = " Logs a histogram giving many approximate integer measurements.\n\n `metric_id` ID of the metric being logged.\n\n `histogram` The collection of approximate integer measurements. Buckets\n that have no measurement (empty buckets) should not be sent.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Histograms with the same event codes are aggregated together\n based on these parameters.\n"]
4581 fn log_integer_histogram(
4582 &mut self,
4583
4584 request: ::fidl_next::Request<metric_event_logger::LogIntegerHistogram, ___T>,
4585
4586 responder: ::fidl_next::Responder<metric_event_logger::LogIntegerHistogram, ___T>,
4587 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4588
4589 #[doc = " Logs a string value that was observed.\n\n `metric_id` ID of the metric being logged.\n\n `string_value` The string to log.\n\n `event_codes` Ordered list of parameters, one for each of the metric\'s\n dimensions. Counts of logged strings are aggregated separately based on\n these parameters.\n"]
4590 fn log_string(
4591 &mut self,
4592
4593 request: ::fidl_next::Request<metric_event_logger::LogString, ___T>,
4594
4595 responder: ::fidl_next::Responder<metric_event_logger::LogString, ___T>,
4596 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4597
4598 #[doc = " Bulk logging method, equivalent to making many of the above Log*() calls\n at once.\n"]
4599 fn log_metric_events(
4600 &mut self,
4601
4602 request: ::fidl_next::Request<metric_event_logger::LogMetricEvents, ___T>,
4603
4604 responder: ::fidl_next::Responder<metric_event_logger::LogMetricEvents, ___T>,
4605 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4606}
4607
4608impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for MetricEventLogger
4609where
4610 ___H: MetricEventLoggerServerHandler<___T> + ::core::marker::Send,
4611 ___T: ::fidl_next::Transport,
4612 for<'de> crate::wire::MetricEventLoggerLogOccurrenceRequest<'de>: ::fidl_next::Decode<
4613 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4614 Constraint = (),
4615 >,
4616 for<'de> crate::wire::MetricEventLoggerLogIntegerRequest<'de>: ::fidl_next::Decode<
4617 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4618 Constraint = (),
4619 >,
4620 for<'de> crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'de>: ::fidl_next::Decode<
4621 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4622 Constraint = (),
4623 >,
4624 for<'de> crate::wire::MetricEventLoggerLogStringRequest<'de>: ::fidl_next::Decode<
4625 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4626 Constraint = (),
4627 >,
4628 for<'de> crate::wire::MetricEventLoggerLogMetricEventsRequest<'de>: ::fidl_next::Decode<
4629 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4630 Constraint = (),
4631 >,
4632{
4633 async fn on_one_way(
4634 handler: &mut ___H,
4635 mut message: ::fidl_next::Message<___T>,
4636 ) -> ::core::result::Result<
4637 (),
4638 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4639 > {
4640 match *message.header().ordinal {
4641 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4642 }
4643 }
4644
4645 async fn on_two_way(
4646 handler: &mut ___H,
4647 mut message: ::fidl_next::Message<___T>,
4648 responder: ::fidl_next::protocol::Responder<___T>,
4649 ) -> ::core::result::Result<
4650 (),
4651 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4652 > {
4653 match *message.header().ordinal {
4654 2751850579569128364 => {
4655 let responder = ::fidl_next::Responder::from_untyped(responder);
4656
4657 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4658 Ok(decoded) => {
4659 handler
4660 .log_occurrence(::fidl_next::Request::from_decoded(decoded), responder)
4661 .await;
4662 Ok(())
4663 }
4664 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4665 ordinal: 2751850579569128364,
4666 error,
4667 }),
4668 }
4669 }
4670
4671 6720834109725988178 => {
4672 let responder = ::fidl_next::Responder::from_untyped(responder);
4673
4674 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4675 Ok(decoded) => {
4676 handler
4677 .log_integer(::fidl_next::Request::from_decoded(decoded), responder)
4678 .await;
4679 Ok(())
4680 }
4681 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4682 ordinal: 6720834109725988178,
4683 error,
4684 }),
4685 }
4686 }
4687
4688 8767534769977819584 => {
4689 let responder = ::fidl_next::Responder::from_untyped(responder);
4690
4691 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4692 Ok(decoded) => {
4693 handler
4694 .log_integer_histogram(
4695 ::fidl_next::Request::from_decoded(decoded),
4696 responder,
4697 )
4698 .await;
4699 Ok(())
4700 }
4701 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4702 ordinal: 8767534769977819584,
4703 error,
4704 }),
4705 }
4706 }
4707
4708 1590315742604854016 => {
4709 let responder = ::fidl_next::Responder::from_untyped(responder);
4710
4711 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4712 Ok(decoded) => {
4713 handler
4714 .log_string(::fidl_next::Request::from_decoded(decoded), responder)
4715 .await;
4716 Ok(())
4717 }
4718 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4719 ordinal: 1590315742604854016,
4720 error,
4721 }),
4722 }
4723 }
4724
4725 5587883824215362667 => {
4726 let responder = ::fidl_next::Responder::from_untyped(responder);
4727
4728 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4729 Ok(decoded) => {
4730 handler
4731 .log_metric_events(
4732 ::fidl_next::Request::from_decoded(decoded),
4733 responder,
4734 )
4735 .await;
4736 Ok(())
4737 }
4738 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4739 ordinal: 5587883824215362667,
4740 error,
4741 }),
4742 }
4743 }
4744
4745 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4746 }
4747 }
4748}
4749
4750impl<___T> MetricEventLoggerClientHandler<___T> for ::fidl_next::IgnoreEvents where
4751 ___T: ::fidl_next::Transport
4752{
4753}
4754
4755impl<___H, ___T> MetricEventLoggerLocalClientHandler<___T> for ::fidl_next::Local<___H>
4756where
4757 ___H: MetricEventLoggerClientHandler<___T>,
4758 ___T: ::fidl_next::Transport,
4759{
4760}
4761
4762impl<___H, ___T> MetricEventLoggerLocalServerHandler<___T> for ::fidl_next::Local<___H>
4763where
4764 ___H: MetricEventLoggerServerHandler<___T>,
4765 ___T: ::fidl_next::Transport,
4766{
4767 async fn log_occurrence(
4768 &mut self,
4769
4770 request: ::fidl_next::Request<metric_event_logger::LogOccurrence, ___T>,
4771
4772 responder: ::fidl_next::Responder<metric_event_logger::LogOccurrence, ___T>,
4773 ) {
4774 ___H::log_occurrence(&mut self.0, request, responder).await
4775 }
4776
4777 async fn log_integer(
4778 &mut self,
4779
4780 request: ::fidl_next::Request<metric_event_logger::LogInteger, ___T>,
4781
4782 responder: ::fidl_next::Responder<metric_event_logger::LogInteger, ___T>,
4783 ) {
4784 ___H::log_integer(&mut self.0, request, responder).await
4785 }
4786
4787 async fn log_integer_histogram(
4788 &mut self,
4789
4790 request: ::fidl_next::Request<metric_event_logger::LogIntegerHistogram, ___T>,
4791
4792 responder: ::fidl_next::Responder<metric_event_logger::LogIntegerHistogram, ___T>,
4793 ) {
4794 ___H::log_integer_histogram(&mut self.0, request, responder).await
4795 }
4796
4797 async fn log_string(
4798 &mut self,
4799
4800 request: ::fidl_next::Request<metric_event_logger::LogString, ___T>,
4801
4802 responder: ::fidl_next::Responder<metric_event_logger::LogString, ___T>,
4803 ) {
4804 ___H::log_string(&mut self.0, request, responder).await
4805 }
4806
4807 async fn log_metric_events(
4808 &mut self,
4809
4810 request: ::fidl_next::Request<metric_event_logger::LogMetricEvents, ___T>,
4811
4812 responder: ::fidl_next::Responder<metric_event_logger::LogMetricEvents, ___T>,
4813 ) {
4814 ___H::log_metric_events(&mut self.0, request, responder).await
4815 }
4816}