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