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