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 pub enum Value<'de> {
2107 Count(::fidl_next::wire::Uint64),
2108
2109 IntegerValue(::fidl_next::wire::Int64),
2110
2111 Histogram(::fidl_next::wire::Vector<'de, crate::wire::HistogramBucket>),
2112
2113 StringValue(::fidl_next::wire::String<'de>),
2114
2115 UnknownOrdinal_(u64),
2116 }
2117 }
2118
2119 impl<'de> MetricEventPayload<'de> {
2120 pub fn as_ref(&self) -> crate::wire::metric_event_payload::Ref<'_> {
2121 match self.raw.ordinal() {
2122 1 => crate::wire::metric_event_payload::Ref::Count(unsafe {
2123 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint64>()
2124 }),
2125
2126 2 => crate::wire::metric_event_payload::Ref::IntegerValue(unsafe {
2127 self.raw.get().deref_unchecked::<::fidl_next::wire::Int64>()
2128 }),
2129
2130 3 => crate::wire::metric_event_payload::Ref::Histogram(unsafe {
2131 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, crate::wire::HistogramBucket>>()
2132 }),
2133
2134 4 => crate::wire::metric_event_payload::Ref::StringValue(unsafe {
2135 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
2136 }),
2137
2138 unknown => crate::wire::metric_event_payload::Ref::UnknownOrdinal_(unknown),
2139 }
2140 }
2141
2142 pub fn into_inner(self) -> crate::wire::metric_event_payload::Value<'de> {
2143 let this = ::core::mem::ManuallyDrop::new(self);
2144
2145 match this.raw.ordinal() {
2146 1 => crate::wire::metric_event_payload::Value::Count(unsafe {
2147 this.raw.get().read_unchecked::<::fidl_next::wire::Uint64>()
2148 }),
2149
2150 2 => crate::wire::metric_event_payload::Value::IntegerValue(unsafe {
2151 this.raw.get().read_unchecked::<::fidl_next::wire::Int64>()
2152 }),
2153
2154 3 => crate::wire::metric_event_payload::Value::Histogram(unsafe {
2155 this.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::HistogramBucket>>()
2156 }),
2157
2158 4 => crate::wire::metric_event_payload::Value::StringValue(unsafe {
2159 this.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
2160 }),
2161
2162 unknown => crate::wire::metric_event_payload::Value::UnknownOrdinal_(unknown),
2163 }
2164 }
2165 }
2166
2167 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MetricEventPayload<'de>
2168 where
2169 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2170 ___D: ::fidl_next::Decoder<'de>,
2171 {
2172 fn decode(
2173 mut slot: ::fidl_next::Slot<'_, Self>,
2174 decoder: &mut ___D,
2175 _: (),
2176 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2177 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
2178 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
2179 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint64>(
2180 raw,
2181 decoder,
2182 (),
2183 )?,
2184
2185 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int64>(
2186 raw,
2187 decoder,
2188 (),
2189 )?,
2190
2191 3 => ::fidl_next::wire::Union::decode_as::<
2192 ___D,
2193 ::fidl_next::wire::Vector<'de, crate::wire::HistogramBucket>,
2194 >(raw, decoder, (500, ()))?,
2195
2196 4 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
2197 raw, decoder, 256,
2198 )?,
2199
2200 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
2201 }
2202
2203 Ok(())
2204 }
2205 }
2206
2207 impl<'de> ::core::fmt::Debug for MetricEventPayload<'de> {
2208 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2209 match self.raw.ordinal() {
2210 1 => unsafe {
2211 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint64>().fmt(f)
2212 },
2213 2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::wire::Int64>().fmt(f) },
2214 3 => unsafe {
2215 self.raw.get().deref_unchecked::<
2216 ::fidl_next::wire::Vector<'_, crate::wire::HistogramBucket>
2217 >().fmt(f)
2218 },
2219 4 => unsafe {
2220 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
2221 },
2222 _ => unsafe { ::core::hint::unreachable_unchecked() },
2223 }
2224 }
2225 }
2226
2227 impl<'de> ::fidl_next::IntoNatural for MetricEventPayload<'de> {
2228 type Natural = crate::natural::MetricEventPayload;
2229 }
2230
2231 #[derive(Debug)]
2233 #[repr(C)]
2234 pub struct MetricEvent<'de> {
2235 pub metric_id: ::fidl_next::wire::Uint32,
2236
2237 pub event_codes: ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>,
2238
2239 pub payload: crate::wire::MetricEventPayload<'de>,
2240 }
2241
2242 static_assertions::const_assert_eq!(std::mem::size_of::<MetricEvent<'_>>(), 40);
2243 static_assertions::const_assert_eq!(std::mem::align_of::<MetricEvent<'_>>(), 8);
2244
2245 static_assertions::const_assert_eq!(std::mem::offset_of!(MetricEvent<'_>, metric_id), 0);
2246
2247 static_assertions::const_assert_eq!(std::mem::offset_of!(MetricEvent<'_>, event_codes), 8);
2248
2249 static_assertions::const_assert_eq!(std::mem::offset_of!(MetricEvent<'_>, payload), 24);
2250
2251 impl ::fidl_next::Constrained for MetricEvent<'_> {
2252 type Constraint = ();
2253
2254 fn validate(
2255 _: ::fidl_next::Slot<'_, Self>,
2256 _: Self::Constraint,
2257 ) -> Result<(), ::fidl_next::ValidationError> {
2258 Ok(())
2259 }
2260 }
2261
2262 unsafe impl ::fidl_next::Wire for MetricEvent<'static> {
2263 type Narrowed<'de> = MetricEvent<'de>;
2264
2265 #[inline]
2266 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2267 ::fidl_next::munge! {
2268 let Self {
2269 metric_id,
2270 event_codes,
2271 payload,
2272
2273 } = &mut *out_;
2274 }
2275
2276 ::fidl_next::Wire::zero_padding(metric_id);
2277
2278 ::fidl_next::Wire::zero_padding(event_codes);
2279
2280 ::fidl_next::Wire::zero_padding(payload);
2281
2282 unsafe {
2283 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2284 }
2285 }
2286 }
2287
2288 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MetricEvent<'de>
2289 where
2290 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2291 ___D: ::fidl_next::Decoder<'de>,
2292 {
2293 fn decode(
2294 slot_: ::fidl_next::Slot<'_, Self>,
2295 decoder_: &mut ___D,
2296 _: (),
2297 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2298 if slot_.as_bytes()[4..8] != [0u8; 4] {
2299 return Err(::fidl_next::DecodeError::InvalidPadding);
2300 }
2301
2302 ::fidl_next::munge! {
2303 let Self {
2304 mut metric_id,
2305 mut event_codes,
2306 mut payload,
2307
2308 } = slot_;
2309 }
2310
2311 let _field = metric_id.as_mut();
2312
2313 ::fidl_next::Decode::decode(metric_id.as_mut(), decoder_, ())?;
2314
2315 let _field = event_codes.as_mut();
2316 ::fidl_next::Constrained::validate(_field, (10, ()))?;
2317 ::fidl_next::Decode::decode(event_codes.as_mut(), decoder_, (10, ()))?;
2318
2319 let event_codes = unsafe { event_codes.deref_unchecked() };
2320
2321 if event_codes.len() > 10 {
2322 return Err(::fidl_next::DecodeError::VectorTooLong {
2323 size: event_codes.len() as u64,
2324 limit: 10,
2325 });
2326 }
2327
2328 let _field = payload.as_mut();
2329
2330 ::fidl_next::Decode::decode(payload.as_mut(), decoder_, ())?;
2331
2332 Ok(())
2333 }
2334 }
2335
2336 impl<'de> ::fidl_next::IntoNatural for MetricEvent<'de> {
2337 type Natural = crate::natural::MetricEvent;
2338 }
2339
2340 #[derive(Debug)]
2342 #[repr(C)]
2343 pub struct MetricEventLoggerLogOccurrenceRequest<'de> {
2344 pub metric_id: ::fidl_next::wire::Uint32,
2345
2346 pub count: ::fidl_next::wire::Uint64,
2347
2348 pub event_codes: ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>,
2349 }
2350
2351 static_assertions::const_assert_eq!(
2352 std::mem::size_of::<MetricEventLoggerLogOccurrenceRequest<'_>>(),
2353 32
2354 );
2355 static_assertions::const_assert_eq!(
2356 std::mem::align_of::<MetricEventLoggerLogOccurrenceRequest<'_>>(),
2357 8
2358 );
2359
2360 static_assertions::const_assert_eq!(
2361 std::mem::offset_of!(MetricEventLoggerLogOccurrenceRequest<'_>, metric_id),
2362 0
2363 );
2364
2365 static_assertions::const_assert_eq!(
2366 std::mem::offset_of!(MetricEventLoggerLogOccurrenceRequest<'_>, count),
2367 8
2368 );
2369
2370 static_assertions::const_assert_eq!(
2371 std::mem::offset_of!(MetricEventLoggerLogOccurrenceRequest<'_>, event_codes),
2372 16
2373 );
2374
2375 impl ::fidl_next::Constrained for MetricEventLoggerLogOccurrenceRequest<'_> {
2376 type Constraint = ();
2377
2378 fn validate(
2379 _: ::fidl_next::Slot<'_, Self>,
2380 _: Self::Constraint,
2381 ) -> Result<(), ::fidl_next::ValidationError> {
2382 Ok(())
2383 }
2384 }
2385
2386 unsafe impl ::fidl_next::Wire for MetricEventLoggerLogOccurrenceRequest<'static> {
2387 type Narrowed<'de> = MetricEventLoggerLogOccurrenceRequest<'de>;
2388
2389 #[inline]
2390 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2391 ::fidl_next::munge! {
2392 let Self {
2393 metric_id,
2394 count,
2395 event_codes,
2396
2397 } = &mut *out_;
2398 }
2399
2400 ::fidl_next::Wire::zero_padding(metric_id);
2401
2402 ::fidl_next::Wire::zero_padding(count);
2403
2404 ::fidl_next::Wire::zero_padding(event_codes);
2405
2406 unsafe {
2407 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2408 }
2409 }
2410 }
2411
2412 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MetricEventLoggerLogOccurrenceRequest<'de>
2413 where
2414 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2415 ___D: ::fidl_next::Decoder<'de>,
2416 {
2417 fn decode(
2418 slot_: ::fidl_next::Slot<'_, Self>,
2419 decoder_: &mut ___D,
2420 _: (),
2421 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2422 if slot_.as_bytes()[4..8] != [0u8; 4] {
2423 return Err(::fidl_next::DecodeError::InvalidPadding);
2424 }
2425
2426 ::fidl_next::munge! {
2427 let Self {
2428 mut metric_id,
2429 mut count,
2430 mut event_codes,
2431
2432 } = slot_;
2433 }
2434
2435 let _field = metric_id.as_mut();
2436
2437 ::fidl_next::Decode::decode(metric_id.as_mut(), decoder_, ())?;
2438
2439 let _field = count.as_mut();
2440
2441 ::fidl_next::Decode::decode(count.as_mut(), decoder_, ())?;
2442
2443 let _field = event_codes.as_mut();
2444 ::fidl_next::Constrained::validate(_field, (10, ()))?;
2445 ::fidl_next::Decode::decode(event_codes.as_mut(), decoder_, (10, ()))?;
2446
2447 let event_codes = unsafe { event_codes.deref_unchecked() };
2448
2449 if event_codes.len() > 10 {
2450 return Err(::fidl_next::DecodeError::VectorTooLong {
2451 size: event_codes.len() as u64,
2452 limit: 10,
2453 });
2454 }
2455
2456 Ok(())
2457 }
2458 }
2459
2460 impl<'de> ::fidl_next::IntoNatural for MetricEventLoggerLogOccurrenceRequest<'de> {
2461 type Natural = crate::natural::MetricEventLoggerLogOccurrenceRequest;
2462 }
2463
2464 pub type MetricEventLoggerLogOccurrenceResponse = ::fidl_next::wire::Unit;
2466
2467 #[derive(Debug)]
2469 #[repr(C)]
2470 pub struct MetricEventLoggerLogIntegerRequest<'de> {
2471 pub metric_id: ::fidl_next::wire::Uint32,
2472
2473 pub value: ::fidl_next::wire::Int64,
2474
2475 pub event_codes: ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>,
2476 }
2477
2478 static_assertions::const_assert_eq!(
2479 std::mem::size_of::<MetricEventLoggerLogIntegerRequest<'_>>(),
2480 32
2481 );
2482 static_assertions::const_assert_eq!(
2483 std::mem::align_of::<MetricEventLoggerLogIntegerRequest<'_>>(),
2484 8
2485 );
2486
2487 static_assertions::const_assert_eq!(
2488 std::mem::offset_of!(MetricEventLoggerLogIntegerRequest<'_>, metric_id),
2489 0
2490 );
2491
2492 static_assertions::const_assert_eq!(
2493 std::mem::offset_of!(MetricEventLoggerLogIntegerRequest<'_>, value),
2494 8
2495 );
2496
2497 static_assertions::const_assert_eq!(
2498 std::mem::offset_of!(MetricEventLoggerLogIntegerRequest<'_>, event_codes),
2499 16
2500 );
2501
2502 impl ::fidl_next::Constrained for MetricEventLoggerLogIntegerRequest<'_> {
2503 type Constraint = ();
2504
2505 fn validate(
2506 _: ::fidl_next::Slot<'_, Self>,
2507 _: Self::Constraint,
2508 ) -> Result<(), ::fidl_next::ValidationError> {
2509 Ok(())
2510 }
2511 }
2512
2513 unsafe impl ::fidl_next::Wire for MetricEventLoggerLogIntegerRequest<'static> {
2514 type Narrowed<'de> = MetricEventLoggerLogIntegerRequest<'de>;
2515
2516 #[inline]
2517 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2518 ::fidl_next::munge! {
2519 let Self {
2520 metric_id,
2521 value,
2522 event_codes,
2523
2524 } = &mut *out_;
2525 }
2526
2527 ::fidl_next::Wire::zero_padding(metric_id);
2528
2529 ::fidl_next::Wire::zero_padding(value);
2530
2531 ::fidl_next::Wire::zero_padding(event_codes);
2532
2533 unsafe {
2534 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2535 }
2536 }
2537 }
2538
2539 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MetricEventLoggerLogIntegerRequest<'de>
2540 where
2541 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2542 ___D: ::fidl_next::Decoder<'de>,
2543 {
2544 fn decode(
2545 slot_: ::fidl_next::Slot<'_, Self>,
2546 decoder_: &mut ___D,
2547 _: (),
2548 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2549 if slot_.as_bytes()[4..8] != [0u8; 4] {
2550 return Err(::fidl_next::DecodeError::InvalidPadding);
2551 }
2552
2553 ::fidl_next::munge! {
2554 let Self {
2555 mut metric_id,
2556 mut value,
2557 mut event_codes,
2558
2559 } = slot_;
2560 }
2561
2562 let _field = metric_id.as_mut();
2563
2564 ::fidl_next::Decode::decode(metric_id.as_mut(), decoder_, ())?;
2565
2566 let _field = value.as_mut();
2567
2568 ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?;
2569
2570 let _field = event_codes.as_mut();
2571 ::fidl_next::Constrained::validate(_field, (10, ()))?;
2572 ::fidl_next::Decode::decode(event_codes.as_mut(), decoder_, (10, ()))?;
2573
2574 let event_codes = unsafe { event_codes.deref_unchecked() };
2575
2576 if event_codes.len() > 10 {
2577 return Err(::fidl_next::DecodeError::VectorTooLong {
2578 size: event_codes.len() as u64,
2579 limit: 10,
2580 });
2581 }
2582
2583 Ok(())
2584 }
2585 }
2586
2587 impl<'de> ::fidl_next::IntoNatural for MetricEventLoggerLogIntegerRequest<'de> {
2588 type Natural = crate::natural::MetricEventLoggerLogIntegerRequest;
2589 }
2590
2591 pub type MetricEventLoggerLogIntegerResponse = ::fidl_next::wire::Unit;
2593
2594 #[derive(Debug)]
2596 #[repr(C)]
2597 pub struct MetricEventLoggerLogIntegerHistogramRequest<'de> {
2598 pub metric_id: ::fidl_next::wire::Uint32,
2599
2600 pub histogram: ::fidl_next::wire::Vector<'de, crate::wire::HistogramBucket>,
2601
2602 pub event_codes: ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>,
2603 }
2604
2605 static_assertions::const_assert_eq!(
2606 std::mem::size_of::<MetricEventLoggerLogIntegerHistogramRequest<'_>>(),
2607 40
2608 );
2609 static_assertions::const_assert_eq!(
2610 std::mem::align_of::<MetricEventLoggerLogIntegerHistogramRequest<'_>>(),
2611 8
2612 );
2613
2614 static_assertions::const_assert_eq!(
2615 std::mem::offset_of!(MetricEventLoggerLogIntegerHistogramRequest<'_>, metric_id),
2616 0
2617 );
2618
2619 static_assertions::const_assert_eq!(
2620 std::mem::offset_of!(MetricEventLoggerLogIntegerHistogramRequest<'_>, histogram),
2621 8
2622 );
2623
2624 static_assertions::const_assert_eq!(
2625 std::mem::offset_of!(MetricEventLoggerLogIntegerHistogramRequest<'_>, event_codes),
2626 24
2627 );
2628
2629 impl ::fidl_next::Constrained for MetricEventLoggerLogIntegerHistogramRequest<'_> {
2630 type Constraint = ();
2631
2632 fn validate(
2633 _: ::fidl_next::Slot<'_, Self>,
2634 _: Self::Constraint,
2635 ) -> Result<(), ::fidl_next::ValidationError> {
2636 Ok(())
2637 }
2638 }
2639
2640 unsafe impl ::fidl_next::Wire for MetricEventLoggerLogIntegerHistogramRequest<'static> {
2641 type Narrowed<'de> = MetricEventLoggerLogIntegerHistogramRequest<'de>;
2642
2643 #[inline]
2644 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2645 ::fidl_next::munge! {
2646 let Self {
2647 metric_id,
2648 histogram,
2649 event_codes,
2650
2651 } = &mut *out_;
2652 }
2653
2654 ::fidl_next::Wire::zero_padding(metric_id);
2655
2656 ::fidl_next::Wire::zero_padding(histogram);
2657
2658 ::fidl_next::Wire::zero_padding(event_codes);
2659
2660 unsafe {
2661 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2662 }
2663 }
2664 }
2665
2666 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
2667 for MetricEventLoggerLogIntegerHistogramRequest<'de>
2668 where
2669 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2670 ___D: ::fidl_next::Decoder<'de>,
2671 {
2672 fn decode(
2673 slot_: ::fidl_next::Slot<'_, Self>,
2674 decoder_: &mut ___D,
2675 _: (),
2676 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2677 if slot_.as_bytes()[4..8] != [0u8; 4] {
2678 return Err(::fidl_next::DecodeError::InvalidPadding);
2679 }
2680
2681 ::fidl_next::munge! {
2682 let Self {
2683 mut metric_id,
2684 mut histogram,
2685 mut event_codes,
2686
2687 } = slot_;
2688 }
2689
2690 let _field = metric_id.as_mut();
2691
2692 ::fidl_next::Decode::decode(metric_id.as_mut(), decoder_, ())?;
2693
2694 let _field = histogram.as_mut();
2695 ::fidl_next::Constrained::validate(_field, (500, ()))?;
2696 ::fidl_next::Decode::decode(histogram.as_mut(), decoder_, (500, ()))?;
2697
2698 let histogram = unsafe { histogram.deref_unchecked() };
2699
2700 if histogram.len() > 500 {
2701 return Err(::fidl_next::DecodeError::VectorTooLong {
2702 size: histogram.len() as u64,
2703 limit: 500,
2704 });
2705 }
2706
2707 let _field = event_codes.as_mut();
2708 ::fidl_next::Constrained::validate(_field, (10, ()))?;
2709 ::fidl_next::Decode::decode(event_codes.as_mut(), decoder_, (10, ()))?;
2710
2711 let event_codes = unsafe { event_codes.deref_unchecked() };
2712
2713 if event_codes.len() > 10 {
2714 return Err(::fidl_next::DecodeError::VectorTooLong {
2715 size: event_codes.len() as u64,
2716 limit: 10,
2717 });
2718 }
2719
2720 Ok(())
2721 }
2722 }
2723
2724 impl<'de> ::fidl_next::IntoNatural for MetricEventLoggerLogIntegerHistogramRequest<'de> {
2725 type Natural = crate::natural::MetricEventLoggerLogIntegerHistogramRequest;
2726 }
2727
2728 pub type MetricEventLoggerLogIntegerHistogramResponse = ::fidl_next::wire::Unit;
2730
2731 #[derive(Debug)]
2733 #[repr(C)]
2734 pub struct MetricEventLoggerLogStringRequest<'de> {
2735 pub metric_id: ::fidl_next::wire::Uint32,
2736
2737 pub string_value: ::fidl_next::wire::String<'de>,
2738
2739 pub event_codes: ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>,
2740 }
2741
2742 static_assertions::const_assert_eq!(
2743 std::mem::size_of::<MetricEventLoggerLogStringRequest<'_>>(),
2744 40
2745 );
2746 static_assertions::const_assert_eq!(
2747 std::mem::align_of::<MetricEventLoggerLogStringRequest<'_>>(),
2748 8
2749 );
2750
2751 static_assertions::const_assert_eq!(
2752 std::mem::offset_of!(MetricEventLoggerLogStringRequest<'_>, metric_id),
2753 0
2754 );
2755
2756 static_assertions::const_assert_eq!(
2757 std::mem::offset_of!(MetricEventLoggerLogStringRequest<'_>, string_value),
2758 8
2759 );
2760
2761 static_assertions::const_assert_eq!(
2762 std::mem::offset_of!(MetricEventLoggerLogStringRequest<'_>, event_codes),
2763 24
2764 );
2765
2766 impl ::fidl_next::Constrained for MetricEventLoggerLogStringRequest<'_> {
2767 type Constraint = ();
2768
2769 fn validate(
2770 _: ::fidl_next::Slot<'_, Self>,
2771 _: Self::Constraint,
2772 ) -> Result<(), ::fidl_next::ValidationError> {
2773 Ok(())
2774 }
2775 }
2776
2777 unsafe impl ::fidl_next::Wire for MetricEventLoggerLogStringRequest<'static> {
2778 type Narrowed<'de> = MetricEventLoggerLogStringRequest<'de>;
2779
2780 #[inline]
2781 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2782 ::fidl_next::munge! {
2783 let Self {
2784 metric_id,
2785 string_value,
2786 event_codes,
2787
2788 } = &mut *out_;
2789 }
2790
2791 ::fidl_next::Wire::zero_padding(metric_id);
2792
2793 ::fidl_next::Wire::zero_padding(string_value);
2794
2795 ::fidl_next::Wire::zero_padding(event_codes);
2796
2797 unsafe {
2798 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2799 }
2800 }
2801 }
2802
2803 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MetricEventLoggerLogStringRequest<'de>
2804 where
2805 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2806 ___D: ::fidl_next::Decoder<'de>,
2807 {
2808 fn decode(
2809 slot_: ::fidl_next::Slot<'_, Self>,
2810 decoder_: &mut ___D,
2811 _: (),
2812 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2813 if slot_.as_bytes()[4..8] != [0u8; 4] {
2814 return Err(::fidl_next::DecodeError::InvalidPadding);
2815 }
2816
2817 ::fidl_next::munge! {
2818 let Self {
2819 mut metric_id,
2820 mut string_value,
2821 mut event_codes,
2822
2823 } = slot_;
2824 }
2825
2826 let _field = metric_id.as_mut();
2827
2828 ::fidl_next::Decode::decode(metric_id.as_mut(), decoder_, ())?;
2829
2830 let _field = string_value.as_mut();
2831 ::fidl_next::Constrained::validate(_field, 256)?;
2832 ::fidl_next::Decode::decode(string_value.as_mut(), decoder_, 256)?;
2833
2834 let string_value = unsafe { string_value.deref_unchecked() };
2835
2836 if string_value.len() > 256 {
2837 return Err(::fidl_next::DecodeError::VectorTooLong {
2838 size: string_value.len() as u64,
2839 limit: 256,
2840 });
2841 }
2842
2843 let _field = event_codes.as_mut();
2844 ::fidl_next::Constrained::validate(_field, (10, ()))?;
2845 ::fidl_next::Decode::decode(event_codes.as_mut(), decoder_, (10, ()))?;
2846
2847 let event_codes = unsafe { event_codes.deref_unchecked() };
2848
2849 if event_codes.len() > 10 {
2850 return Err(::fidl_next::DecodeError::VectorTooLong {
2851 size: event_codes.len() as u64,
2852 limit: 10,
2853 });
2854 }
2855
2856 Ok(())
2857 }
2858 }
2859
2860 impl<'de> ::fidl_next::IntoNatural for MetricEventLoggerLogStringRequest<'de> {
2861 type Natural = crate::natural::MetricEventLoggerLogStringRequest;
2862 }
2863
2864 pub type MetricEventLoggerLogStringResponse = ::fidl_next::wire::Unit;
2866
2867 #[derive(Debug)]
2869 #[repr(C)]
2870 pub struct MetricEventLoggerLogMetricEventsRequest<'de> {
2871 pub events: ::fidl_next::wire::Vector<'de, crate::wire::MetricEvent<'de>>,
2872 }
2873
2874 static_assertions::const_assert_eq!(
2875 std::mem::size_of::<MetricEventLoggerLogMetricEventsRequest<'_>>(),
2876 16
2877 );
2878 static_assertions::const_assert_eq!(
2879 std::mem::align_of::<MetricEventLoggerLogMetricEventsRequest<'_>>(),
2880 8
2881 );
2882
2883 static_assertions::const_assert_eq!(
2884 std::mem::offset_of!(MetricEventLoggerLogMetricEventsRequest<'_>, events),
2885 0
2886 );
2887
2888 impl ::fidl_next::Constrained for MetricEventLoggerLogMetricEventsRequest<'_> {
2889 type Constraint = ();
2890
2891 fn validate(
2892 _: ::fidl_next::Slot<'_, Self>,
2893 _: Self::Constraint,
2894 ) -> Result<(), ::fidl_next::ValidationError> {
2895 Ok(())
2896 }
2897 }
2898
2899 unsafe impl ::fidl_next::Wire for MetricEventLoggerLogMetricEventsRequest<'static> {
2900 type Narrowed<'de> = MetricEventLoggerLogMetricEventsRequest<'de>;
2901
2902 #[inline]
2903 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2904 ::fidl_next::munge! {
2905 let Self {
2906 events,
2907
2908 } = &mut *out_;
2909 }
2910
2911 ::fidl_next::Wire::zero_padding(events);
2912 }
2913 }
2914
2915 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MetricEventLoggerLogMetricEventsRequest<'de>
2916 where
2917 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2918 ___D: ::fidl_next::Decoder<'de>,
2919 {
2920 fn decode(
2921 slot_: ::fidl_next::Slot<'_, Self>,
2922 decoder_: &mut ___D,
2923 _: (),
2924 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2925 ::fidl_next::munge! {
2926 let Self {
2927 mut events,
2928
2929 } = slot_;
2930 }
2931
2932 let _field = events.as_mut();
2933 ::fidl_next::Constrained::validate(_field, (500, ()))?;
2934 ::fidl_next::Decode::decode(events.as_mut(), decoder_, (500, ()))?;
2935
2936 let events = unsafe { events.deref_unchecked() };
2937
2938 if events.len() > 500 {
2939 return Err(::fidl_next::DecodeError::VectorTooLong {
2940 size: events.len() as u64,
2941 limit: 500,
2942 });
2943 }
2944
2945 Ok(())
2946 }
2947 }
2948
2949 impl<'de> ::fidl_next::IntoNatural for MetricEventLoggerLogMetricEventsRequest<'de> {
2950 type Natural = crate::natural::MetricEventLoggerLogMetricEventsRequest;
2951 }
2952
2953 pub type MetricEventLoggerLogMetricEventsResponse = ::fidl_next::wire::Unit;
2955
2956 #[repr(C)]
2958 pub struct ProjectSpec<'de> {
2959 pub(crate) table: ::fidl_next::wire::Table<'de>,
2960 }
2961
2962 impl<'de> Drop for ProjectSpec<'de> {
2963 fn drop(&mut self) {
2964 let _ = self
2965 .table
2966 .get(1)
2967 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
2968
2969 let _ = self
2970 .table
2971 .get(2)
2972 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
2973 }
2974 }
2975
2976 impl ::fidl_next::Constrained for ProjectSpec<'_> {
2977 type Constraint = ();
2978
2979 fn validate(
2980 _: ::fidl_next::Slot<'_, Self>,
2981 _: Self::Constraint,
2982 ) -> Result<(), ::fidl_next::ValidationError> {
2983 Ok(())
2984 }
2985 }
2986
2987 unsafe impl ::fidl_next::Wire for ProjectSpec<'static> {
2988 type Narrowed<'de> = ProjectSpec<'de>;
2989
2990 #[inline]
2991 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2992 ::fidl_next::munge!(let Self { table } = out);
2993 ::fidl_next::wire::Table::zero_padding(table);
2994 }
2995 }
2996
2997 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ProjectSpec<'de>
2998 where
2999 ___D: ::fidl_next::Decoder<'de> + ?Sized,
3000 {
3001 fn decode(
3002 slot: ::fidl_next::Slot<'_, Self>,
3003 decoder: &mut ___D,
3004 _: (),
3005 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3006 ::fidl_next::munge!(let Self { table } = slot);
3007
3008 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3009 match ordinal {
3010 0 => unsafe { ::core::hint::unreachable_unchecked() },
3011
3012 1 => {
3013 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
3014 slot.as_mut(),
3015 decoder,
3016 (),
3017 )?;
3018
3019 Ok(())
3020 }
3021
3022 2 => {
3023 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
3024 slot.as_mut(),
3025 decoder,
3026 (),
3027 )?;
3028
3029 Ok(())
3030 }
3031
3032 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
3033 }
3034 })
3035 }
3036 }
3037
3038 impl<'de> ProjectSpec<'de> {
3039 pub fn customer_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
3040 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3041 }
3042
3043 pub fn take_customer_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
3044 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
3045 }
3046
3047 pub fn project_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
3048 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3049 }
3050
3051 pub fn take_project_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
3052 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
3053 }
3054 }
3055
3056 impl<'de> ::core::fmt::Debug for ProjectSpec<'de> {
3057 fn fmt(
3058 &self,
3059 f: &mut ::core::fmt::Formatter<'_>,
3060 ) -> ::core::result::Result<(), ::core::fmt::Error> {
3061 f.debug_struct("ProjectSpec")
3062 .field("customer_id", &self.customer_id())
3063 .field("project_id", &self.project_id())
3064 .finish()
3065 }
3066 }
3067
3068 impl<'de> ::fidl_next::IntoNatural for ProjectSpec<'de> {
3069 type Natural = crate::natural::ProjectSpec;
3070 }
3071
3072 pub type MetricEventLoggerFactoryCreateMetricEventLoggerResponse = ::fidl_next::wire::Unit;
3074
3075 pub type MetricEventLoggerFactoryCreateMetricEventLoggerWithExperimentsResponse =
3077 ::fidl_next::wire::Unit;
3078}
3079
3080pub mod wire_optional {
3081
3082 #[repr(transparent)]
3083 pub struct MetricEventPayload<'de> {
3084 pub(crate) raw: ::fidl_next::wire::Union,
3085 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
3086 }
3087
3088 impl ::fidl_next::Constrained for MetricEventPayload<'_> {
3089 type Constraint = ();
3090
3091 fn validate(
3092 _: ::fidl_next::Slot<'_, Self>,
3093 _: Self::Constraint,
3094 ) -> Result<(), ::fidl_next::ValidationError> {
3095 Ok(())
3096 }
3097 }
3098
3099 unsafe impl ::fidl_next::Wire for MetricEventPayload<'static> {
3100 type Narrowed<'de> = MetricEventPayload<'de>;
3101
3102 #[inline]
3103 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3104 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
3105 ::fidl_next::wire::Union::zero_padding(raw);
3106 }
3107 }
3108
3109 impl<'de> MetricEventPayload<'de> {
3110 pub fn is_some(&self) -> bool {
3111 self.raw.is_some()
3112 }
3113
3114 pub fn is_none(&self) -> bool {
3115 self.raw.is_none()
3116 }
3117
3118 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::MetricEventPayload<'de>> {
3119 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
3120 }
3121
3122 pub fn into_option(self) -> ::core::option::Option<crate::wire::MetricEventPayload<'de>> {
3123 if self.is_some() {
3124 Some(crate::wire::MetricEventPayload {
3125 raw: self.raw,
3126 _phantom: ::core::marker::PhantomData,
3127 })
3128 } else {
3129 None
3130 }
3131 }
3132 }
3133
3134 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MetricEventPayload<'de>
3135 where
3136 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3137 ___D: ::fidl_next::Decoder<'de>,
3138 {
3139 fn decode(
3140 mut slot: ::fidl_next::Slot<'_, Self>,
3141 decoder: &mut ___D,
3142 _: (),
3143 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3144 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
3145 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
3146 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint64>(
3147 raw,
3148 decoder,
3149 (),
3150 )?,
3151
3152 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int64>(
3153 raw,
3154 decoder,
3155 (),
3156 )?,
3157
3158 3 => ::fidl_next::wire::Union::decode_as::<
3159 ___D,
3160 ::fidl_next::wire::Vector<'de, crate::wire::HistogramBucket>,
3161 >(raw, decoder, (500, ()))?,
3162
3163 4 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
3164 raw, decoder, 256,
3165 )?,
3166
3167 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
3168 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
3169 }
3170
3171 Ok(())
3172 }
3173 }
3174
3175 impl<'de> ::core::fmt::Debug for MetricEventPayload<'de> {
3176 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3177 self.as_ref().fmt(f)
3178 }
3179 }
3180
3181 impl<'de> ::fidl_next::IntoNatural for MetricEventPayload<'de> {
3182 type Natural = ::core::option::Option<crate::natural::MetricEventPayload>;
3183 }
3184}
3185
3186pub mod generic {
3187
3188 pub struct HistogramBucket<T0, T1> {
3190 pub index: T0,
3191
3192 pub count: T1,
3193 }
3194
3195 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::HistogramBucket, ___E>
3196 for HistogramBucket<T0, T1>
3197 where
3198 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3199 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3200 T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
3201 {
3202 #[inline]
3203 fn encode(
3204 self,
3205 encoder_: &mut ___E,
3206 out_: &mut ::core::mem::MaybeUninit<crate::wire::HistogramBucket>,
3207 _: (),
3208 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3209 ::fidl_next::munge! {
3210 let crate::wire::HistogramBucket {
3211 index,
3212 count,
3213
3214 } = out_;
3215 }
3216
3217 ::fidl_next::Encode::encode(self.index, encoder_, index, ())?;
3218
3219 ::fidl_next::Encode::encode(self.count, encoder_, count, ())?;
3220
3221 Ok(())
3222 }
3223 }
3224
3225 pub struct MetricEvent<T0, T1, T2> {
3227 pub metric_id: T0,
3228
3229 pub event_codes: T1,
3230
3231 pub payload: T2,
3232 }
3233
3234 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<crate::wire::MetricEvent<'static>, ___E>
3235 for MetricEvent<T0, T1, T2>
3236 where
3237 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3238 ___E: ::fidl_next::Encoder,
3239 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3240 T1: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>, ___E>,
3241 T2: ::fidl_next::Encode<crate::wire::MetricEventPayload<'static>, ___E>,
3242 {
3243 #[inline]
3244 fn encode(
3245 self,
3246 encoder_: &mut ___E,
3247 out_: &mut ::core::mem::MaybeUninit<crate::wire::MetricEvent<'static>>,
3248 _: (),
3249 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3250 ::fidl_next::munge! {
3251 let crate::wire::MetricEvent {
3252 metric_id,
3253 event_codes,
3254 payload,
3255
3256 } = out_;
3257 }
3258
3259 ::fidl_next::Encode::encode(self.metric_id, encoder_, metric_id, ())?;
3260
3261 ::fidl_next::Encode::encode(self.event_codes, encoder_, event_codes, (10, ()))?;
3262
3263 ::fidl_next::Encode::encode(self.payload, encoder_, payload, ())?;
3264
3265 Ok(())
3266 }
3267 }
3268
3269 pub struct MetricEventLoggerLogOccurrenceRequest<T0, T1, T2> {
3271 pub metric_id: T0,
3272
3273 pub count: T1,
3274
3275 pub event_codes: T2,
3276 }
3277
3278 unsafe impl<___E, T0, T1, T2>
3279 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>, ___E>
3280 for MetricEventLoggerLogOccurrenceRequest<T0, T1, T2>
3281 where
3282 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3283 ___E: ::fidl_next::Encoder,
3284 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3285 T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
3286 T2: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>, ___E>,
3287 {
3288 #[inline]
3289 fn encode(
3290 self,
3291 encoder_: &mut ___E,
3292 out_: &mut ::core::mem::MaybeUninit<
3293 crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>,
3294 >,
3295 _: (),
3296 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3297 ::fidl_next::munge! {
3298 let crate::wire::MetricEventLoggerLogOccurrenceRequest {
3299 metric_id,
3300 count,
3301 event_codes,
3302
3303 } = out_;
3304 }
3305
3306 ::fidl_next::Encode::encode(self.metric_id, encoder_, metric_id, ())?;
3307
3308 ::fidl_next::Encode::encode(self.count, encoder_, count, ())?;
3309
3310 ::fidl_next::Encode::encode(self.event_codes, encoder_, event_codes, (10, ()))?;
3311
3312 Ok(())
3313 }
3314 }
3315
3316 pub type MetricEventLoggerLogOccurrenceResponse = ();
3318
3319 pub struct MetricEventLoggerLogIntegerRequest<T0, T1, T2> {
3321 pub metric_id: T0,
3322
3323 pub value: T1,
3324
3325 pub event_codes: T2,
3326 }
3327
3328 unsafe impl<___E, T0, T1, T2>
3329 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogIntegerRequest<'static>, ___E>
3330 for MetricEventLoggerLogIntegerRequest<T0, T1, T2>
3331 where
3332 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3333 ___E: ::fidl_next::Encoder,
3334 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3335 T1: ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>,
3336 T2: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>, ___E>,
3337 {
3338 #[inline]
3339 fn encode(
3340 self,
3341 encoder_: &mut ___E,
3342 out_: &mut ::core::mem::MaybeUninit<
3343 crate::wire::MetricEventLoggerLogIntegerRequest<'static>,
3344 >,
3345 _: (),
3346 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3347 ::fidl_next::munge! {
3348 let crate::wire::MetricEventLoggerLogIntegerRequest {
3349 metric_id,
3350 value,
3351 event_codes,
3352
3353 } = out_;
3354 }
3355
3356 ::fidl_next::Encode::encode(self.metric_id, encoder_, metric_id, ())?;
3357
3358 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
3359
3360 ::fidl_next::Encode::encode(self.event_codes, encoder_, event_codes, (10, ()))?;
3361
3362 Ok(())
3363 }
3364 }
3365
3366 pub type MetricEventLoggerLogIntegerResponse = ();
3368
3369 pub struct MetricEventLoggerLogIntegerHistogramRequest<T0, T1, T2> {
3371 pub metric_id: T0,
3372
3373 pub histogram: T1,
3374
3375 pub event_codes: T2,
3376 }
3377
3378 unsafe impl<___E, T0, T1, T2>
3379 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>, ___E>
3380 for MetricEventLoggerLogIntegerHistogramRequest<T0, T1, T2>
3381 where
3382 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3383 ___E: ::fidl_next::Encoder,
3384 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3385 T1: ::fidl_next::Encode<
3386 ::fidl_next::wire::Vector<'static, crate::wire::HistogramBucket>,
3387 ___E,
3388 >,
3389 T2: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>, ___E>,
3390 {
3391 #[inline]
3392 fn encode(
3393 self,
3394 encoder_: &mut ___E,
3395 out_: &mut ::core::mem::MaybeUninit<
3396 crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>,
3397 >,
3398 _: (),
3399 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3400 ::fidl_next::munge! {
3401 let crate::wire::MetricEventLoggerLogIntegerHistogramRequest {
3402 metric_id,
3403 histogram,
3404 event_codes,
3405
3406 } = out_;
3407 }
3408
3409 ::fidl_next::Encode::encode(self.metric_id, encoder_, metric_id, ())?;
3410
3411 ::fidl_next::Encode::encode(self.histogram, encoder_, histogram, (500, ()))?;
3412
3413 ::fidl_next::Encode::encode(self.event_codes, encoder_, event_codes, (10, ()))?;
3414
3415 Ok(())
3416 }
3417 }
3418
3419 pub type MetricEventLoggerLogIntegerHistogramResponse = ();
3421
3422 pub struct MetricEventLoggerLogStringRequest<T0, T1, T2> {
3424 pub metric_id: T0,
3425
3426 pub string_value: T1,
3427
3428 pub event_codes: T2,
3429 }
3430
3431 unsafe impl<___E, T0, T1, T2>
3432 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogStringRequest<'static>, ___E>
3433 for MetricEventLoggerLogStringRequest<T0, T1, T2>
3434 where
3435 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3436 ___E: ::fidl_next::Encoder,
3437 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3438 T1: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
3439 T2: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>, ___E>,
3440 {
3441 #[inline]
3442 fn encode(
3443 self,
3444 encoder_: &mut ___E,
3445 out_: &mut ::core::mem::MaybeUninit<
3446 crate::wire::MetricEventLoggerLogStringRequest<'static>,
3447 >,
3448 _: (),
3449 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3450 ::fidl_next::munge! {
3451 let crate::wire::MetricEventLoggerLogStringRequest {
3452 metric_id,
3453 string_value,
3454 event_codes,
3455
3456 } = out_;
3457 }
3458
3459 ::fidl_next::Encode::encode(self.metric_id, encoder_, metric_id, ())?;
3460
3461 ::fidl_next::Encode::encode(self.string_value, encoder_, string_value, 256)?;
3462
3463 ::fidl_next::Encode::encode(self.event_codes, encoder_, event_codes, (10, ()))?;
3464
3465 Ok(())
3466 }
3467 }
3468
3469 pub type MetricEventLoggerLogStringResponse = ();
3471
3472 pub struct MetricEventLoggerLogMetricEventsRequest<T0> {
3474 pub events: T0,
3475 }
3476
3477 unsafe impl<___E, T0>
3478 ::fidl_next::Encode<crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>, ___E>
3479 for MetricEventLoggerLogMetricEventsRequest<T0>
3480 where
3481 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3482 ___E: ::fidl_next::Encoder,
3483 T0: ::fidl_next::Encode<
3484 ::fidl_next::wire::Vector<'static, crate::wire::MetricEvent<'static>>,
3485 ___E,
3486 >,
3487 {
3488 #[inline]
3489 fn encode(
3490 self,
3491 encoder_: &mut ___E,
3492 out_: &mut ::core::mem::MaybeUninit<
3493 crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>,
3494 >,
3495 _: (),
3496 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3497 ::fidl_next::munge! {
3498 let crate::wire::MetricEventLoggerLogMetricEventsRequest {
3499 events,
3500
3501 } = out_;
3502 }
3503
3504 ::fidl_next::Encode::encode(self.events, encoder_, events, (500, ()))?;
3505
3506 Ok(())
3507 }
3508 }
3509
3510 pub type MetricEventLoggerLogMetricEventsResponse = ();
3512
3513 pub type MetricEventLoggerFactoryCreateMetricEventLoggerResponse = ();
3515
3516 pub type MetricEventLoggerFactoryCreateMetricEventLoggerWithExperimentsResponse = ();
3518}
3519
3520pub use self::natural::*;
3521
3522#[doc = " Maximum number of event codes that can be associated with a single event.\n"]
3523pub const MAX_METRIC_DIMENSIONS: u32 = 10 as u32;
3524
3525#[doc = " This is intended as a reasonable maximum number of histogram buckets per\n event.\n"]
3526pub const MAX_HISTOGRAM_BUCKETS: u32 = 500 as u32;
3527
3528#[doc = " Maximum number of events that may be logged in a single FIDL call.\n"]
3529pub const MAX_BATCHED_EVENTS: u32 = 500 as u32;
3530
3531#[doc = " The maximum size of a single Event is 100 KB.\n"]
3532pub const MAX_BYTES_PER_EVENT: i64 = 102400 as i64;
3533
3534#[doc = " Maximum number of experiment ids that can be provided to a single logger.\n"]
3535pub const MAX_EXPERIMENT_IDS: u32 = 100 as u32;
3536
3537#[doc = " String events should not be longer than this.\n"]
3538pub const MAX_STRING_EVENT_SIZE: u32 = 256 as u32;
3539
3540#[doc = " A logger for events that are associated with one project\'s metrics.\n"]
3542#[derive(PartialEq, Debug)]
3543pub struct MetricEventLogger;
3544
3545#[cfg(target_os = "fuchsia")]
3546impl ::fidl_next::HasTransport for MetricEventLogger {
3547 type Transport = ::fidl_next::fuchsia::zx::Channel;
3548}
3549
3550pub mod metric_event_logger {
3551 pub mod prelude {
3552 pub use crate::{
3553 MetricEventLogger, MetricEventLoggerClientHandler, MetricEventLoggerLocalClientHandler,
3554 MetricEventLoggerLocalServerHandler, MetricEventLoggerServerHandler,
3555 metric_event_logger,
3556 };
3557
3558 pub use crate::natural::Error;
3559
3560 pub use crate::natural::MetricEventLoggerLogIntegerHistogramRequest;
3561
3562 pub use crate::natural::MetricEventLoggerLogIntegerRequest;
3563
3564 pub use crate::natural::MetricEventLoggerLogMetricEventsRequest;
3565
3566 pub use crate::natural::MetricEventLoggerLogOccurrenceRequest;
3567
3568 pub use crate::natural::MetricEventLoggerLogStringRequest;
3569
3570 pub use crate::natural::MetricEventLoggerLogIntegerHistogramResponse;
3571
3572 pub use crate::natural::MetricEventLoggerLogIntegerResponse;
3573
3574 pub use crate::natural::MetricEventLoggerLogMetricEventsResponse;
3575
3576 pub use crate::natural::MetricEventLoggerLogOccurrenceResponse;
3577
3578 pub use crate::natural::MetricEventLoggerLogStringResponse;
3579 }
3580
3581 pub struct LogOccurrence;
3582
3583 impl ::fidl_next::Method for LogOccurrence {
3584 const ORDINAL: u64 = 2751850579569128364;
3585 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3586 ::fidl_next::protocol::Flexibility::Strict;
3587
3588 type Protocol = crate::MetricEventLogger;
3589
3590 type Request = crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>;
3591 }
3592
3593 impl ::fidl_next::TwoWayMethod for LogOccurrence {
3594 type Response = ::fidl_next::wire::Result<
3595 'static,
3596 crate::wire::MetricEventLoggerLogOccurrenceResponse,
3597 crate::wire::Error,
3598 >;
3599 }
3600
3601 impl<___R> ::fidl_next::Respond<___R> for LogOccurrence {
3602 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3603
3604 fn respond(response: ___R) -> Self::Output {
3605 ::core::result::Result::Ok(response)
3606 }
3607 }
3608
3609 impl<___R> ::fidl_next::RespondErr<___R> for LogOccurrence {
3610 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3611
3612 fn respond_err(response: ___R) -> Self::Output {
3613 ::core::result::Result::Err(response)
3614 }
3615 }
3616
3617 pub struct LogInteger;
3618
3619 impl ::fidl_next::Method for LogInteger {
3620 const ORDINAL: u64 = 6720834109725988178;
3621 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3622 ::fidl_next::protocol::Flexibility::Strict;
3623
3624 type Protocol = crate::MetricEventLogger;
3625
3626 type Request = crate::wire::MetricEventLoggerLogIntegerRequest<'static>;
3627 }
3628
3629 impl ::fidl_next::TwoWayMethod for LogInteger {
3630 type Response = ::fidl_next::wire::Result<
3631 'static,
3632 crate::wire::MetricEventLoggerLogIntegerResponse,
3633 crate::wire::Error,
3634 >;
3635 }
3636
3637 impl<___R> ::fidl_next::Respond<___R> for LogInteger {
3638 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3639
3640 fn respond(response: ___R) -> Self::Output {
3641 ::core::result::Result::Ok(response)
3642 }
3643 }
3644
3645 impl<___R> ::fidl_next::RespondErr<___R> for LogInteger {
3646 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3647
3648 fn respond_err(response: ___R) -> Self::Output {
3649 ::core::result::Result::Err(response)
3650 }
3651 }
3652
3653 pub struct LogIntegerHistogram;
3654
3655 impl ::fidl_next::Method for LogIntegerHistogram {
3656 const ORDINAL: u64 = 8767534769977819584;
3657 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3658 ::fidl_next::protocol::Flexibility::Strict;
3659
3660 type Protocol = crate::MetricEventLogger;
3661
3662 type Request = crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>;
3663 }
3664
3665 impl ::fidl_next::TwoWayMethod for LogIntegerHistogram {
3666 type Response = ::fidl_next::wire::Result<
3667 'static,
3668 crate::wire::MetricEventLoggerLogIntegerHistogramResponse,
3669 crate::wire::Error,
3670 >;
3671 }
3672
3673 impl<___R> ::fidl_next::Respond<___R> for LogIntegerHistogram {
3674 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3675
3676 fn respond(response: ___R) -> Self::Output {
3677 ::core::result::Result::Ok(response)
3678 }
3679 }
3680
3681 impl<___R> ::fidl_next::RespondErr<___R> for LogIntegerHistogram {
3682 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3683
3684 fn respond_err(response: ___R) -> Self::Output {
3685 ::core::result::Result::Err(response)
3686 }
3687 }
3688
3689 pub struct LogString;
3690
3691 impl ::fidl_next::Method for LogString {
3692 const ORDINAL: u64 = 1590315742604854016;
3693 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3694 ::fidl_next::protocol::Flexibility::Strict;
3695
3696 type Protocol = crate::MetricEventLogger;
3697
3698 type Request = crate::wire::MetricEventLoggerLogStringRequest<'static>;
3699 }
3700
3701 impl ::fidl_next::TwoWayMethod for LogString {
3702 type Response = ::fidl_next::wire::Result<
3703 'static,
3704 crate::wire::MetricEventLoggerLogStringResponse,
3705 crate::wire::Error,
3706 >;
3707 }
3708
3709 impl<___R> ::fidl_next::Respond<___R> for LogString {
3710 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3711
3712 fn respond(response: ___R) -> Self::Output {
3713 ::core::result::Result::Ok(response)
3714 }
3715 }
3716
3717 impl<___R> ::fidl_next::RespondErr<___R> for LogString {
3718 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3719
3720 fn respond_err(response: ___R) -> Self::Output {
3721 ::core::result::Result::Err(response)
3722 }
3723 }
3724
3725 pub struct LogMetricEvents;
3726
3727 impl ::fidl_next::Method for LogMetricEvents {
3728 const ORDINAL: u64 = 5587883824215362667;
3729 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3730 ::fidl_next::protocol::Flexibility::Strict;
3731
3732 type Protocol = crate::MetricEventLogger;
3733
3734 type Request = crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>;
3735 }
3736
3737 impl ::fidl_next::TwoWayMethod for LogMetricEvents {
3738 type Response = ::fidl_next::wire::Result<
3739 'static,
3740 crate::wire::MetricEventLoggerLogMetricEventsResponse,
3741 crate::wire::Error,
3742 >;
3743 }
3744
3745 impl<___R> ::fidl_next::Respond<___R> for LogMetricEvents {
3746 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3747
3748 fn respond(response: ___R) -> Self::Output {
3749 ::core::result::Result::Ok(response)
3750 }
3751 }
3752
3753 impl<___R> ::fidl_next::RespondErr<___R> for LogMetricEvents {
3754 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3755
3756 fn respond_err(response: ___R) -> Self::Output {
3757 ::core::result::Result::Err(response)
3758 }
3759 }
3760
3761 mod ___detail {
3762 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::MetricEventLogger
3763 where
3764 ___T: ::fidl_next::Transport,
3765 {
3766 type Client = MetricEventLoggerClient<___T>;
3767 type Server = MetricEventLoggerServer<___T>;
3768 }
3769
3770 #[repr(transparent)]
3772 pub struct MetricEventLoggerClient<___T: ::fidl_next::Transport> {
3773 #[allow(dead_code)]
3774 client: ::fidl_next::protocol::Client<___T>,
3775 }
3776
3777 impl<___T> MetricEventLoggerClient<___T>
3778 where
3779 ___T: ::fidl_next::Transport,
3780 {
3781 #[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"]
3782 pub fn log_occurrence(
3783 &self,
3784
3785 metric_id: impl ::fidl_next::Encode<
3786 ::fidl_next::wire::Uint32,
3787 <___T as ::fidl_next::Transport>::SendBuffer,
3788 >,
3789
3790 count: impl ::fidl_next::Encode<
3791 ::fidl_next::wire::Uint64,
3792 <___T as ::fidl_next::Transport>::SendBuffer,
3793 >,
3794
3795 event_codes: impl ::fidl_next::Encode<
3796 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>,
3797 <___T as ::fidl_next::Transport>::SendBuffer,
3798 >,
3799 ) -> ::fidl_next::TwoWayFuture<'_, super::LogOccurrence, ___T>
3800 where
3801 <___T as ::fidl_next::Transport>::SendBuffer:
3802 ::fidl_next::encoder::InternalHandleEncoder,
3803 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3804 {
3805 self.log_occurrence_with(crate::generic::MetricEventLoggerLogOccurrenceRequest {
3806 metric_id,
3807
3808 count,
3809
3810 event_codes,
3811 })
3812 }
3813
3814 #[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"]
3815 pub fn log_occurrence_with<___R>(
3816 &self,
3817 request: ___R,
3818 ) -> ::fidl_next::TwoWayFuture<'_, super::LogOccurrence, ___T>
3819 where
3820 ___R: ::fidl_next::Encode<
3821 crate::wire::MetricEventLoggerLogOccurrenceRequest<'static>,
3822 <___T as ::fidl_next::Transport>::SendBuffer,
3823 >,
3824 {
3825 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3826 2751850579569128364,
3827 <super::LogOccurrence as ::fidl_next::Method>::FLEXIBILITY,
3828 request,
3829 ))
3830 }
3831
3832 #[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"]
3833 pub fn log_integer(
3834 &self,
3835
3836 metric_id: impl ::fidl_next::Encode<
3837 ::fidl_next::wire::Uint32,
3838 <___T as ::fidl_next::Transport>::SendBuffer,
3839 >,
3840
3841 value: impl ::fidl_next::Encode<
3842 ::fidl_next::wire::Int64,
3843 <___T as ::fidl_next::Transport>::SendBuffer,
3844 >,
3845
3846 event_codes: impl ::fidl_next::Encode<
3847 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>,
3848 <___T as ::fidl_next::Transport>::SendBuffer,
3849 >,
3850 ) -> ::fidl_next::TwoWayFuture<'_, super::LogInteger, ___T>
3851 where
3852 <___T as ::fidl_next::Transport>::SendBuffer:
3853 ::fidl_next::encoder::InternalHandleEncoder,
3854 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3855 {
3856 self.log_integer_with(crate::generic::MetricEventLoggerLogIntegerRequest {
3857 metric_id,
3858
3859 value,
3860
3861 event_codes,
3862 })
3863 }
3864
3865 #[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"]
3866 pub fn log_integer_with<___R>(
3867 &self,
3868 request: ___R,
3869 ) -> ::fidl_next::TwoWayFuture<'_, super::LogInteger, ___T>
3870 where
3871 ___R: ::fidl_next::Encode<
3872 crate::wire::MetricEventLoggerLogIntegerRequest<'static>,
3873 <___T as ::fidl_next::Transport>::SendBuffer,
3874 >,
3875 {
3876 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3877 6720834109725988178,
3878 <super::LogInteger as ::fidl_next::Method>::FLEXIBILITY,
3879 request,
3880 ))
3881 }
3882
3883 #[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"]
3884 pub fn log_integer_histogram(
3885 &self,
3886
3887 metric_id: impl ::fidl_next::Encode<
3888 ::fidl_next::wire::Uint32,
3889 <___T as ::fidl_next::Transport>::SendBuffer,
3890 >,
3891
3892 histogram: impl ::fidl_next::Encode<
3893 ::fidl_next::wire::Vector<'static, crate::wire::HistogramBucket>,
3894 <___T as ::fidl_next::Transport>::SendBuffer,
3895 >,
3896
3897 event_codes: impl ::fidl_next::Encode<
3898 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>,
3899 <___T as ::fidl_next::Transport>::SendBuffer,
3900 >,
3901 ) -> ::fidl_next::TwoWayFuture<'_, super::LogIntegerHistogram, ___T>
3902 where
3903 <___T as ::fidl_next::Transport>::SendBuffer:
3904 ::fidl_next::encoder::InternalHandleEncoder,
3905 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3906 {
3907 self.log_integer_histogram_with(
3908 crate::generic::MetricEventLoggerLogIntegerHistogramRequest {
3909 metric_id,
3910
3911 histogram,
3912
3913 event_codes,
3914 },
3915 )
3916 }
3917
3918 #[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"]
3919 pub fn log_integer_histogram_with<___R>(
3920 &self,
3921 request: ___R,
3922 ) -> ::fidl_next::TwoWayFuture<'_, super::LogIntegerHistogram, ___T>
3923 where
3924 ___R: ::fidl_next::Encode<
3925 crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'static>,
3926 <___T as ::fidl_next::Transport>::SendBuffer,
3927 >,
3928 {
3929 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3930 8767534769977819584,
3931 <super::LogIntegerHistogram as ::fidl_next::Method>::FLEXIBILITY,
3932 request,
3933 ))
3934 }
3935
3936 #[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"]
3937 pub fn log_string(
3938 &self,
3939
3940 metric_id: impl ::fidl_next::Encode<
3941 ::fidl_next::wire::Uint32,
3942 <___T as ::fidl_next::Transport>::SendBuffer,
3943 >,
3944
3945 string_value: impl ::fidl_next::Encode<
3946 ::fidl_next::wire::String<'static>,
3947 <___T as ::fidl_next::Transport>::SendBuffer,
3948 >,
3949
3950 event_codes: impl ::fidl_next::Encode<
3951 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>,
3952 <___T as ::fidl_next::Transport>::SendBuffer,
3953 >,
3954 ) -> ::fidl_next::TwoWayFuture<'_, super::LogString, ___T>
3955 where
3956 <___T as ::fidl_next::Transport>::SendBuffer:
3957 ::fidl_next::encoder::InternalHandleEncoder,
3958 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3959 {
3960 self.log_string_with(crate::generic::MetricEventLoggerLogStringRequest {
3961 metric_id,
3962
3963 string_value,
3964
3965 event_codes,
3966 })
3967 }
3968
3969 #[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"]
3970 pub fn log_string_with<___R>(
3971 &self,
3972 request: ___R,
3973 ) -> ::fidl_next::TwoWayFuture<'_, super::LogString, ___T>
3974 where
3975 ___R: ::fidl_next::Encode<
3976 crate::wire::MetricEventLoggerLogStringRequest<'static>,
3977 <___T as ::fidl_next::Transport>::SendBuffer,
3978 >,
3979 {
3980 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3981 1590315742604854016,
3982 <super::LogString as ::fidl_next::Method>::FLEXIBILITY,
3983 request,
3984 ))
3985 }
3986
3987 #[doc = " Bulk logging method, equivalent to making many of the above Log*() calls\n at once.\n"]
3988 pub fn log_metric_events(
3989 &self,
3990
3991 events: impl ::fidl_next::Encode<
3992 ::fidl_next::wire::Vector<'static, crate::wire::MetricEvent<'static>>,
3993 <___T as ::fidl_next::Transport>::SendBuffer,
3994 >,
3995 ) -> ::fidl_next::TwoWayFuture<'_, super::LogMetricEvents, ___T>
3996 where
3997 <___T as ::fidl_next::Transport>::SendBuffer:
3998 ::fidl_next::encoder::InternalHandleEncoder,
3999 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4000 {
4001 self.log_metric_events_with(
4002 crate::generic::MetricEventLoggerLogMetricEventsRequest { events },
4003 )
4004 }
4005
4006 #[doc = " Bulk logging method, equivalent to making many of the above Log*() calls\n at once.\n"]
4007 pub fn log_metric_events_with<___R>(
4008 &self,
4009 request: ___R,
4010 ) -> ::fidl_next::TwoWayFuture<'_, super::LogMetricEvents, ___T>
4011 where
4012 ___R: ::fidl_next::Encode<
4013 crate::wire::MetricEventLoggerLogMetricEventsRequest<'static>,
4014 <___T as ::fidl_next::Transport>::SendBuffer,
4015 >,
4016 {
4017 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4018 5587883824215362667,
4019 <super::LogMetricEvents as ::fidl_next::Method>::FLEXIBILITY,
4020 request,
4021 ))
4022 }
4023 }
4024
4025 #[repr(transparent)]
4027 pub struct MetricEventLoggerServer<___T: ::fidl_next::Transport> {
4028 server: ::fidl_next::protocol::Server<___T>,
4029 }
4030
4031 impl<___T> MetricEventLoggerServer<___T> where ___T: ::fidl_next::Transport {}
4032 }
4033}
4034
4035#[diagnostic::on_unimplemented(
4036 note = "If {Self} implements the non-local MetricEventLoggerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
4037)]
4038
4039pub trait MetricEventLoggerLocalClientHandler<
4043 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4044 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4045>
4046{
4047}
4048
4049impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for MetricEventLogger
4050where
4051 ___H: MetricEventLoggerLocalClientHandler<___T>,
4052 ___T: ::fidl_next::Transport,
4053{
4054 async fn on_event(
4055 handler: &mut ___H,
4056 mut message: ::fidl_next::Message<___T>,
4057 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4058 match *message.header().ordinal {
4059 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4060 }
4061 }
4062}
4063
4064#[diagnostic::on_unimplemented(
4065 note = "If {Self} implements the non-local MetricEventLoggerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
4066)]
4067
4068pub trait MetricEventLoggerLocalServerHandler<
4072 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4073 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4074>
4075{
4076 #[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"]
4077 fn log_occurrence(
4078 &mut self,
4079
4080 request: ::fidl_next::Request<metric_event_logger::LogOccurrence, ___T>,
4081
4082 responder: ::fidl_next::Responder<metric_event_logger::LogOccurrence, ___T>,
4083 ) -> impl ::core::future::Future<Output = ()>;
4084
4085 #[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"]
4086 fn log_integer(
4087 &mut self,
4088
4089 request: ::fidl_next::Request<metric_event_logger::LogInteger, ___T>,
4090
4091 responder: ::fidl_next::Responder<metric_event_logger::LogInteger, ___T>,
4092 ) -> impl ::core::future::Future<Output = ()>;
4093
4094 #[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"]
4095 fn log_integer_histogram(
4096 &mut self,
4097
4098 request: ::fidl_next::Request<metric_event_logger::LogIntegerHistogram, ___T>,
4099
4100 responder: ::fidl_next::Responder<metric_event_logger::LogIntegerHistogram, ___T>,
4101 ) -> impl ::core::future::Future<Output = ()>;
4102
4103 #[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"]
4104 fn log_string(
4105 &mut self,
4106
4107 request: ::fidl_next::Request<metric_event_logger::LogString, ___T>,
4108
4109 responder: ::fidl_next::Responder<metric_event_logger::LogString, ___T>,
4110 ) -> impl ::core::future::Future<Output = ()>;
4111
4112 #[doc = " Bulk logging method, equivalent to making many of the above Log*() calls\n at once.\n"]
4113 fn log_metric_events(
4114 &mut self,
4115
4116 request: ::fidl_next::Request<metric_event_logger::LogMetricEvents, ___T>,
4117
4118 responder: ::fidl_next::Responder<metric_event_logger::LogMetricEvents, ___T>,
4119 ) -> impl ::core::future::Future<Output = ()>;
4120}
4121
4122impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for MetricEventLogger
4123where
4124 ___H: MetricEventLoggerLocalServerHandler<___T>,
4125 ___T: ::fidl_next::Transport,
4126 for<'de> crate::wire::MetricEventLoggerLogOccurrenceRequest<'de>: ::fidl_next::Decode<
4127 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4128 Constraint = (),
4129 >,
4130 for<'de> crate::wire::MetricEventLoggerLogIntegerRequest<'de>: ::fidl_next::Decode<
4131 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4132 Constraint = (),
4133 >,
4134 for<'de> crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'de>: ::fidl_next::Decode<
4135 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4136 Constraint = (),
4137 >,
4138 for<'de> crate::wire::MetricEventLoggerLogStringRequest<'de>: ::fidl_next::Decode<
4139 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4140 Constraint = (),
4141 >,
4142 for<'de> crate::wire::MetricEventLoggerLogMetricEventsRequest<'de>: ::fidl_next::Decode<
4143 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4144 Constraint = (),
4145 >,
4146{
4147 async fn on_one_way(
4148 handler: &mut ___H,
4149 mut message: ::fidl_next::Message<___T>,
4150 ) -> ::core::result::Result<
4151 (),
4152 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4153 > {
4154 match *message.header().ordinal {
4155 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4156 }
4157 }
4158
4159 async fn on_two_way(
4160 handler: &mut ___H,
4161 mut message: ::fidl_next::Message<___T>,
4162 responder: ::fidl_next::protocol::Responder<___T>,
4163 ) -> ::core::result::Result<
4164 (),
4165 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4166 > {
4167 match *message.header().ordinal {
4168 2751850579569128364 => {
4169 let responder = ::fidl_next::Responder::from_untyped(responder);
4170
4171 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4172 Ok(decoded) => {
4173 handler
4174 .log_occurrence(::fidl_next::Request::from_decoded(decoded), responder)
4175 .await;
4176 Ok(())
4177 }
4178 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4179 ordinal: 2751850579569128364,
4180 error,
4181 }),
4182 }
4183 }
4184
4185 6720834109725988178 => {
4186 let responder = ::fidl_next::Responder::from_untyped(responder);
4187
4188 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4189 Ok(decoded) => {
4190 handler
4191 .log_integer(::fidl_next::Request::from_decoded(decoded), responder)
4192 .await;
4193 Ok(())
4194 }
4195 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4196 ordinal: 6720834109725988178,
4197 error,
4198 }),
4199 }
4200 }
4201
4202 8767534769977819584 => {
4203 let responder = ::fidl_next::Responder::from_untyped(responder);
4204
4205 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4206 Ok(decoded) => {
4207 handler
4208 .log_integer_histogram(
4209 ::fidl_next::Request::from_decoded(decoded),
4210 responder,
4211 )
4212 .await;
4213 Ok(())
4214 }
4215 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4216 ordinal: 8767534769977819584,
4217 error,
4218 }),
4219 }
4220 }
4221
4222 1590315742604854016 => {
4223 let responder = ::fidl_next::Responder::from_untyped(responder);
4224
4225 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4226 Ok(decoded) => {
4227 handler
4228 .log_string(::fidl_next::Request::from_decoded(decoded), responder)
4229 .await;
4230 Ok(())
4231 }
4232 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4233 ordinal: 1590315742604854016,
4234 error,
4235 }),
4236 }
4237 }
4238
4239 5587883824215362667 => {
4240 let responder = ::fidl_next::Responder::from_untyped(responder);
4241
4242 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4243 Ok(decoded) => {
4244 handler
4245 .log_metric_events(
4246 ::fidl_next::Request::from_decoded(decoded),
4247 responder,
4248 )
4249 .await;
4250 Ok(())
4251 }
4252 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4253 ordinal: 5587883824215362667,
4254 error,
4255 }),
4256 }
4257 }
4258
4259 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4260 }
4261 }
4262}
4263
4264pub trait MetricEventLoggerClientHandler<
4268 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4269 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4270>
4271{
4272}
4273
4274impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for MetricEventLogger
4275where
4276 ___H: MetricEventLoggerClientHandler<___T> + ::core::marker::Send,
4277 ___T: ::fidl_next::Transport,
4278{
4279 async fn on_event(
4280 handler: &mut ___H,
4281 mut message: ::fidl_next::Message<___T>,
4282 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4283 match *message.header().ordinal {
4284 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4285 }
4286 }
4287}
4288
4289pub trait MetricEventLoggerServerHandler<
4293 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4294 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4295>
4296{
4297 #[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"]
4298 fn log_occurrence(
4299 &mut self,
4300
4301 request: ::fidl_next::Request<metric_event_logger::LogOccurrence, ___T>,
4302
4303 responder: ::fidl_next::Responder<metric_event_logger::LogOccurrence, ___T>,
4304 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4305
4306 #[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"]
4307 fn log_integer(
4308 &mut self,
4309
4310 request: ::fidl_next::Request<metric_event_logger::LogInteger, ___T>,
4311
4312 responder: ::fidl_next::Responder<metric_event_logger::LogInteger, ___T>,
4313 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4314
4315 #[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"]
4316 fn log_integer_histogram(
4317 &mut self,
4318
4319 request: ::fidl_next::Request<metric_event_logger::LogIntegerHistogram, ___T>,
4320
4321 responder: ::fidl_next::Responder<metric_event_logger::LogIntegerHistogram, ___T>,
4322 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4323
4324 #[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"]
4325 fn log_string(
4326 &mut self,
4327
4328 request: ::fidl_next::Request<metric_event_logger::LogString, ___T>,
4329
4330 responder: ::fidl_next::Responder<metric_event_logger::LogString, ___T>,
4331 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4332
4333 #[doc = " Bulk logging method, equivalent to making many of the above Log*() calls\n at once.\n"]
4334 fn log_metric_events(
4335 &mut self,
4336
4337 request: ::fidl_next::Request<metric_event_logger::LogMetricEvents, ___T>,
4338
4339 responder: ::fidl_next::Responder<metric_event_logger::LogMetricEvents, ___T>,
4340 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4341}
4342
4343impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for MetricEventLogger
4344where
4345 ___H: MetricEventLoggerServerHandler<___T> + ::core::marker::Send,
4346 ___T: ::fidl_next::Transport,
4347 for<'de> crate::wire::MetricEventLoggerLogOccurrenceRequest<'de>: ::fidl_next::Decode<
4348 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4349 Constraint = (),
4350 >,
4351 for<'de> crate::wire::MetricEventLoggerLogIntegerRequest<'de>: ::fidl_next::Decode<
4352 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4353 Constraint = (),
4354 >,
4355 for<'de> crate::wire::MetricEventLoggerLogIntegerHistogramRequest<'de>: ::fidl_next::Decode<
4356 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4357 Constraint = (),
4358 >,
4359 for<'de> crate::wire::MetricEventLoggerLogStringRequest<'de>: ::fidl_next::Decode<
4360 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4361 Constraint = (),
4362 >,
4363 for<'de> crate::wire::MetricEventLoggerLogMetricEventsRequest<'de>: ::fidl_next::Decode<
4364 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4365 Constraint = (),
4366 >,
4367{
4368 async fn on_one_way(
4369 handler: &mut ___H,
4370 mut message: ::fidl_next::Message<___T>,
4371 ) -> ::core::result::Result<
4372 (),
4373 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4374 > {
4375 match *message.header().ordinal {
4376 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4377 }
4378 }
4379
4380 async fn on_two_way(
4381 handler: &mut ___H,
4382 mut message: ::fidl_next::Message<___T>,
4383 responder: ::fidl_next::protocol::Responder<___T>,
4384 ) -> ::core::result::Result<
4385 (),
4386 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4387 > {
4388 match *message.header().ordinal {
4389 2751850579569128364 => {
4390 let responder = ::fidl_next::Responder::from_untyped(responder);
4391
4392 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4393 Ok(decoded) => {
4394 handler
4395 .log_occurrence(::fidl_next::Request::from_decoded(decoded), responder)
4396 .await;
4397 Ok(())
4398 }
4399 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4400 ordinal: 2751850579569128364,
4401 error,
4402 }),
4403 }
4404 }
4405
4406 6720834109725988178 => {
4407 let responder = ::fidl_next::Responder::from_untyped(responder);
4408
4409 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4410 Ok(decoded) => {
4411 handler
4412 .log_integer(::fidl_next::Request::from_decoded(decoded), responder)
4413 .await;
4414 Ok(())
4415 }
4416 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4417 ordinal: 6720834109725988178,
4418 error,
4419 }),
4420 }
4421 }
4422
4423 8767534769977819584 => {
4424 let responder = ::fidl_next::Responder::from_untyped(responder);
4425
4426 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4427 Ok(decoded) => {
4428 handler
4429 .log_integer_histogram(
4430 ::fidl_next::Request::from_decoded(decoded),
4431 responder,
4432 )
4433 .await;
4434 Ok(())
4435 }
4436 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4437 ordinal: 8767534769977819584,
4438 error,
4439 }),
4440 }
4441 }
4442
4443 1590315742604854016 => {
4444 let responder = ::fidl_next::Responder::from_untyped(responder);
4445
4446 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4447 Ok(decoded) => {
4448 handler
4449 .log_string(::fidl_next::Request::from_decoded(decoded), responder)
4450 .await;
4451 Ok(())
4452 }
4453 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4454 ordinal: 1590315742604854016,
4455 error,
4456 }),
4457 }
4458 }
4459
4460 5587883824215362667 => {
4461 let responder = ::fidl_next::Responder::from_untyped(responder);
4462
4463 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4464 Ok(decoded) => {
4465 handler
4466 .log_metric_events(
4467 ::fidl_next::Request::from_decoded(decoded),
4468 responder,
4469 )
4470 .await;
4471 Ok(())
4472 }
4473 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4474 ordinal: 5587883824215362667,
4475 error,
4476 }),
4477 }
4478 }
4479
4480 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4481 }
4482 }
4483}
4484
4485impl<___T> MetricEventLoggerClientHandler<___T> for ::fidl_next::IgnoreEvents where
4486 ___T: ::fidl_next::Transport
4487{
4488}
4489
4490impl<___H, ___T> MetricEventLoggerLocalClientHandler<___T> for ::fidl_next::Local<___H>
4491where
4492 ___H: MetricEventLoggerClientHandler<___T>,
4493 ___T: ::fidl_next::Transport,
4494{
4495}
4496
4497impl<___H, ___T> MetricEventLoggerLocalServerHandler<___T> for ::fidl_next::Local<___H>
4498where
4499 ___H: MetricEventLoggerServerHandler<___T>,
4500 ___T: ::fidl_next::Transport,
4501{
4502 async fn log_occurrence(
4503 &mut self,
4504
4505 request: ::fidl_next::Request<metric_event_logger::LogOccurrence, ___T>,
4506
4507 responder: ::fidl_next::Responder<metric_event_logger::LogOccurrence, ___T>,
4508 ) {
4509 ___H::log_occurrence(&mut self.0, request, responder).await
4510 }
4511
4512 async fn log_integer(
4513 &mut self,
4514
4515 request: ::fidl_next::Request<metric_event_logger::LogInteger, ___T>,
4516
4517 responder: ::fidl_next::Responder<metric_event_logger::LogInteger, ___T>,
4518 ) {
4519 ___H::log_integer(&mut self.0, request, responder).await
4520 }
4521
4522 async fn log_integer_histogram(
4523 &mut self,
4524
4525 request: ::fidl_next::Request<metric_event_logger::LogIntegerHistogram, ___T>,
4526
4527 responder: ::fidl_next::Responder<metric_event_logger::LogIntegerHistogram, ___T>,
4528 ) {
4529 ___H::log_integer_histogram(&mut self.0, request, responder).await
4530 }
4531
4532 async fn log_string(
4533 &mut self,
4534
4535 request: ::fidl_next::Request<metric_event_logger::LogString, ___T>,
4536
4537 responder: ::fidl_next::Responder<metric_event_logger::LogString, ___T>,
4538 ) {
4539 ___H::log_string(&mut self.0, request, responder).await
4540 }
4541
4542 async fn log_metric_events(
4543 &mut self,
4544
4545 request: ::fidl_next::Request<metric_event_logger::LogMetricEvents, ___T>,
4546
4547 responder: ::fidl_next::Responder<metric_event_logger::LogMetricEvents, ___T>,
4548 ) {
4549 ___H::log_metric_events(&mut self.0, request, responder).await
4550 }
4551}