1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8 #[repr(u32)]
9 pub enum InterestChangeError {
10 CalledTwice = 1,
11 }
12 impl ::core::convert::TryFrom<u32> for InterestChangeError {
13 type Error = ::fidl_next::UnknownStrictEnumMemberError;
14 fn try_from(
15 value: u32,
16 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
17 match value {
18 1 => Ok(Self::CalledTwice),
19
20 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
21 }
22 }
23 }
24
25 impl ::std::convert::From<InterestChangeError> for u32 {
26 fn from(value: InterestChangeError) -> Self {
27 match value {
28 InterestChangeError::CalledTwice => 1,
29 }
30 }
31 }
32
33 unsafe impl<___E> ::fidl_next::Encode<crate::wire::InterestChangeError, ___E>
34 for InterestChangeError
35 where
36 ___E: ?Sized,
37 {
38 #[inline]
39 fn encode(
40 self,
41 encoder: &mut ___E,
42 out: &mut ::core::mem::MaybeUninit<crate::wire::InterestChangeError>,
43 _: (),
44 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
45 ::fidl_next::Encode::encode(&self, encoder, out, ())
46 }
47 }
48
49 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::InterestChangeError, ___E>
50 for &'a InterestChangeError
51 where
52 ___E: ?Sized,
53 {
54 #[inline]
55 fn encode(
56 self,
57 encoder: &mut ___E,
58 out: &mut ::core::mem::MaybeUninit<crate::wire::InterestChangeError>,
59 _: (),
60 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
61 ::fidl_next::munge!(let crate::wire::InterestChangeError { value } = out);
62 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
63 InterestChangeError::CalledTwice => 1,
64 }));
65
66 Ok(())
67 }
68 }
69
70 impl ::core::convert::From<crate::wire::InterestChangeError> for InterestChangeError {
71 fn from(wire: crate::wire::InterestChangeError) -> Self {
72 match u32::from(wire.value) {
73 1 => Self::CalledTwice,
74
75 _ => unsafe { ::core::hint::unreachable_unchecked() },
76 }
77 }
78 }
79
80 impl ::fidl_next::FromWire<crate::wire::InterestChangeError> for InterestChangeError {
81 #[inline]
82 fn from_wire(wire: crate::wire::InterestChangeError) -> Self {
83 Self::from(wire)
84 }
85 }
86
87 impl ::fidl_next::FromWireRef<crate::wire::InterestChangeError> for InterestChangeError {
88 #[inline]
89 fn from_wire_ref(wire: &crate::wire::InterestChangeError) -> Self {
90 Self::from(*wire)
91 }
92 }
93
94 #[doc = " Log levels used with log related filtering.\n Filtering uses a heuristic based on a threshold of\n minimum severity level - with any log equal to or\n greater than the threshold being included in the\n printable logs.\n"]
95 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
96 #[repr(i8)]
97 pub enum LogLevelFilter {
98 Trace = 16,
99 Debug = 32,
100 Info = 48,
101 Warn = 64,
102 Error = 80,
103 Fatal = 96,
104 None = 127,
105 }
106 impl ::core::convert::TryFrom<i8> for LogLevelFilter {
107 type Error = ::fidl_next::UnknownStrictEnumMemberError;
108 fn try_from(
109 value: i8,
110 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
111 match value {
112 16 => Ok(Self::Trace),
113 32 => Ok(Self::Debug),
114 48 => Ok(Self::Info),
115 64 => Ok(Self::Warn),
116 80 => Ok(Self::Error),
117 96 => Ok(Self::Fatal),
118 127 => Ok(Self::None),
119
120 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
121 }
122 }
123 }
124
125 impl ::std::convert::From<LogLevelFilter> for i8 {
126 fn from(value: LogLevelFilter) -> Self {
127 match value {
128 LogLevelFilter::Trace => 16,
129 LogLevelFilter::Debug => 32,
130 LogLevelFilter::Info => 48,
131 LogLevelFilter::Warn => 64,
132 LogLevelFilter::Error => 80,
133 LogLevelFilter::Fatal => 96,
134 LogLevelFilter::None => 127,
135 }
136 }
137 }
138
139 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LogLevelFilter, ___E> for LogLevelFilter
140 where
141 ___E: ?Sized,
142 {
143 #[inline]
144 fn encode(
145 self,
146 encoder: &mut ___E,
147 out: &mut ::core::mem::MaybeUninit<crate::wire::LogLevelFilter>,
148 _: (),
149 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
150 ::fidl_next::Encode::encode(&self, encoder, out, ())
151 }
152 }
153
154 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LogLevelFilter, ___E> for &'a LogLevelFilter
155 where
156 ___E: ?Sized,
157 {
158 #[inline]
159 fn encode(
160 self,
161 encoder: &mut ___E,
162 out: &mut ::core::mem::MaybeUninit<crate::wire::LogLevelFilter>,
163 _: (),
164 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
165 ::fidl_next::munge!(let crate::wire::LogLevelFilter { value } = out);
166 let _ = value.write(i8::from(match *self {
167 LogLevelFilter::Trace => 16,
168
169 LogLevelFilter::Debug => 32,
170
171 LogLevelFilter::Info => 48,
172
173 LogLevelFilter::Warn => 64,
174
175 LogLevelFilter::Error => 80,
176
177 LogLevelFilter::Fatal => 96,
178
179 LogLevelFilter::None => 127,
180 }));
181
182 Ok(())
183 }
184 }
185
186 impl ::core::convert::From<crate::wire::LogLevelFilter> for LogLevelFilter {
187 fn from(wire: crate::wire::LogLevelFilter) -> Self {
188 match i8::from(wire.value) {
189 16 => Self::Trace,
190
191 32 => Self::Debug,
192
193 48 => Self::Info,
194
195 64 => Self::Warn,
196
197 80 => Self::Error,
198
199 96 => Self::Fatal,
200
201 127 => Self::None,
202
203 _ => unsafe { ::core::hint::unreachable_unchecked() },
204 }
205 }
206 }
207
208 impl ::fidl_next::FromWire<crate::wire::LogLevelFilter> for LogLevelFilter {
209 #[inline]
210 fn from_wire(wire: crate::wire::LogLevelFilter) -> Self {
211 Self::from(wire)
212 }
213 }
214
215 impl ::fidl_next::FromWireRef<crate::wire::LogLevelFilter> for LogLevelFilter {
216 #[inline]
217 fn from_wire_ref(wire: &crate::wire::LogLevelFilter) -> Self {
218 Self::from(*wire)
219 }
220 }
221
222 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
223 pub struct LogFilterOptions {
224 pub filter_by_pid: bool,
225
226 pub pid: u64,
227
228 pub filter_by_tid: bool,
229
230 pub tid: u64,
231
232 pub verbosity: u8,
233
234 pub min_severity: crate::natural::LogLevelFilter,
235
236 pub tags: ::std::vec::Vec<::std::string::String>,
237 }
238
239 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LogFilterOptions<'static>, ___E>
240 for LogFilterOptions
241 where
242 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
243 ___E: ::fidl_next::Encoder,
244 {
245 #[inline]
246 fn encode(
247 self,
248 encoder_: &mut ___E,
249 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogFilterOptions<'static>>,
250 _: (),
251 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
252 ::fidl_next::munge! {
253 let crate::wire::LogFilterOptions {
254 filter_by_pid,
255 pid,
256 filter_by_tid,
257 tid,
258 verbosity,
259 min_severity,
260 tags,
261
262 } = out_;
263 }
264
265 ::fidl_next::Encode::encode(self.filter_by_pid, encoder_, filter_by_pid, ())?;
266
267 let mut _field =
268 unsafe { ::fidl_next::Slot::new_unchecked(filter_by_pid.as_mut_ptr()) };
269
270 ::fidl_next::Encode::encode(self.pid, encoder_, pid, ())?;
271
272 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(pid.as_mut_ptr()) };
273
274 ::fidl_next::Encode::encode(self.filter_by_tid, encoder_, filter_by_tid, ())?;
275
276 let mut _field =
277 unsafe { ::fidl_next::Slot::new_unchecked(filter_by_tid.as_mut_ptr()) };
278
279 ::fidl_next::Encode::encode(self.tid, encoder_, tid, ())?;
280
281 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(tid.as_mut_ptr()) };
282
283 ::fidl_next::Encode::encode(self.verbosity, encoder_, verbosity, ())?;
284
285 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(verbosity.as_mut_ptr()) };
286
287 ::fidl_next::Encode::encode(self.min_severity, encoder_, min_severity, ())?;
288
289 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(min_severity.as_mut_ptr()) };
290
291 ::fidl_next::Encode::encode(self.tags, encoder_, tags, (16, 63))?;
292
293 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(tags.as_mut_ptr()) };
294 ::fidl_next::Constrained::validate(_field, (16, 63))?;
295
296 Ok(())
297 }
298 }
299
300 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LogFilterOptions<'static>, ___E>
301 for &'a LogFilterOptions
302 where
303 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
304 ___E: ::fidl_next::Encoder,
305 {
306 #[inline]
307 fn encode(
308 self,
309 encoder_: &mut ___E,
310 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogFilterOptions<'static>>,
311 _: (),
312 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
313 ::fidl_next::munge! {
314 let crate::wire::LogFilterOptions {
315 filter_by_pid,
316 pid,
317 filter_by_tid,
318 tid,
319 verbosity,
320 min_severity,
321 tags,
322
323 } = out_;
324 }
325
326 ::fidl_next::Encode::encode(&self.filter_by_pid, encoder_, filter_by_pid, ())?;
327
328 let mut _field =
329 unsafe { ::fidl_next::Slot::new_unchecked(filter_by_pid.as_mut_ptr()) };
330
331 ::fidl_next::Encode::encode(&self.pid, encoder_, pid, ())?;
332
333 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(pid.as_mut_ptr()) };
334
335 ::fidl_next::Encode::encode(&self.filter_by_tid, encoder_, filter_by_tid, ())?;
336
337 let mut _field =
338 unsafe { ::fidl_next::Slot::new_unchecked(filter_by_tid.as_mut_ptr()) };
339
340 ::fidl_next::Encode::encode(&self.tid, encoder_, tid, ())?;
341
342 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(tid.as_mut_ptr()) };
343
344 ::fidl_next::Encode::encode(&self.verbosity, encoder_, verbosity, ())?;
345
346 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(verbosity.as_mut_ptr()) };
347
348 ::fidl_next::Encode::encode(&self.min_severity, encoder_, min_severity, ())?;
349
350 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(min_severity.as_mut_ptr()) };
351
352 ::fidl_next::Encode::encode(&self.tags, encoder_, tags, (16, 63))?;
353
354 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(tags.as_mut_ptr()) };
355 ::fidl_next::Constrained::validate(_field, (16, 63))?;
356
357 Ok(())
358 }
359 }
360
361 unsafe impl<___E>
362 ::fidl_next::EncodeOption<
363 ::fidl_next::wire::Box<'static, crate::wire::LogFilterOptions<'static>>,
364 ___E,
365 > for LogFilterOptions
366 where
367 ___E: ::fidl_next::Encoder + ?Sized,
368 LogFilterOptions: ::fidl_next::Encode<crate::wire::LogFilterOptions<'static>, ___E>,
369 {
370 #[inline]
371 fn encode_option(
372 this: ::core::option::Option<Self>,
373 encoder: &mut ___E,
374 out: &mut ::core::mem::MaybeUninit<
375 ::fidl_next::wire::Box<'static, crate::wire::LogFilterOptions<'static>>,
376 >,
377 _: (),
378 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
379 if let Some(inner) = this {
380 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
381 ::fidl_next::wire::Box::encode_present(out);
382 } else {
383 ::fidl_next::wire::Box::encode_absent(out);
384 }
385
386 Ok(())
387 }
388 }
389
390 unsafe impl<'a, ___E>
391 ::fidl_next::EncodeOption<
392 ::fidl_next::wire::Box<'static, crate::wire::LogFilterOptions<'static>>,
393 ___E,
394 > for &'a LogFilterOptions
395 where
396 ___E: ::fidl_next::Encoder + ?Sized,
397 &'a LogFilterOptions: ::fidl_next::Encode<crate::wire::LogFilterOptions<'static>, ___E>,
398 {
399 #[inline]
400 fn encode_option(
401 this: ::core::option::Option<Self>,
402 encoder: &mut ___E,
403 out: &mut ::core::mem::MaybeUninit<
404 ::fidl_next::wire::Box<'static, crate::wire::LogFilterOptions<'static>>,
405 >,
406 _: (),
407 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
408 if let Some(inner) = this {
409 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
410 ::fidl_next::wire::Box::encode_present(out);
411 } else {
412 ::fidl_next::wire::Box::encode_absent(out);
413 }
414
415 Ok(())
416 }
417 }
418
419 impl<'de> ::fidl_next::FromWire<crate::wire::LogFilterOptions<'de>> for LogFilterOptions {
420 #[inline]
421 fn from_wire(wire: crate::wire::LogFilterOptions<'de>) -> Self {
422 Self {
423 filter_by_pid: ::fidl_next::FromWire::from_wire(wire.filter_by_pid),
424
425 pid: ::fidl_next::FromWire::from_wire(wire.pid),
426
427 filter_by_tid: ::fidl_next::FromWire::from_wire(wire.filter_by_tid),
428
429 tid: ::fidl_next::FromWire::from_wire(wire.tid),
430
431 verbosity: ::fidl_next::FromWire::from_wire(wire.verbosity),
432
433 min_severity: ::fidl_next::FromWire::from_wire(wire.min_severity),
434
435 tags: ::fidl_next::FromWire::from_wire(wire.tags),
436 }
437 }
438 }
439
440 impl<'de> ::fidl_next::FromWireRef<crate::wire::LogFilterOptions<'de>> for LogFilterOptions {
441 #[inline]
442 fn from_wire_ref(wire: &crate::wire::LogFilterOptions<'de>) -> Self {
443 Self {
444 filter_by_pid: ::fidl_next::FromWireRef::from_wire_ref(&wire.filter_by_pid),
445
446 pid: ::fidl_next::FromWireRef::from_wire_ref(&wire.pid),
447
448 filter_by_tid: ::fidl_next::FromWireRef::from_wire_ref(&wire.filter_by_tid),
449
450 tid: ::fidl_next::FromWireRef::from_wire_ref(&wire.tid),
451
452 verbosity: ::fidl_next::FromWireRef::from_wire_ref(&wire.verbosity),
453
454 min_severity: ::fidl_next::FromWireRef::from_wire_ref(&wire.min_severity),
455
456 tags: ::fidl_next::FromWireRef::from_wire_ref(&wire.tags),
457 }
458 }
459 }
460
461 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
462 pub struct LogMessage {
463 pub pid: u64,
464
465 pub tid: u64,
466
467 pub time: i64,
468
469 pub severity: i32,
470
471 pub dropped_logs: u32,
472
473 pub tags: ::std::vec::Vec<::std::string::String>,
474
475 pub msg: ::std::string::String,
476 }
477
478 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LogMessage<'static>, ___E> for LogMessage
479 where
480 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
481 ___E: ::fidl_next::Encoder,
482 {
483 #[inline]
484 fn encode(
485 self,
486 encoder_: &mut ___E,
487 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogMessage<'static>>,
488 _: (),
489 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
490 ::fidl_next::munge! {
491 let crate::wire::LogMessage {
492 pid,
493 tid,
494 time,
495 severity,
496 dropped_logs,
497 tags,
498 msg,
499
500 } = out_;
501 }
502
503 ::fidl_next::Encode::encode(self.pid, encoder_, pid, ())?;
504
505 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(pid.as_mut_ptr()) };
506
507 ::fidl_next::Encode::encode(self.tid, encoder_, tid, ())?;
508
509 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(tid.as_mut_ptr()) };
510
511 ::fidl_next::Encode::encode(self.time, encoder_, time, ())?;
512
513 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(time.as_mut_ptr()) };
514
515 ::fidl_next::Encode::encode(self.severity, encoder_, severity, ())?;
516
517 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(severity.as_mut_ptr()) };
518
519 ::fidl_next::Encode::encode(self.dropped_logs, encoder_, dropped_logs, ())?;
520
521 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(dropped_logs.as_mut_ptr()) };
522
523 ::fidl_next::Encode::encode(self.tags, encoder_, tags, (5, 63))?;
524
525 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(tags.as_mut_ptr()) };
526 ::fidl_next::Constrained::validate(_field, (5, 63))?;
527
528 ::fidl_next::Encode::encode(self.msg, encoder_, msg, 32768)?;
529
530 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(msg.as_mut_ptr()) };
531 ::fidl_next::Constrained::validate(_field, 32768)?;
532
533 Ok(())
534 }
535 }
536
537 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LogMessage<'static>, ___E> for &'a LogMessage
538 where
539 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
540 ___E: ::fidl_next::Encoder,
541 {
542 #[inline]
543 fn encode(
544 self,
545 encoder_: &mut ___E,
546 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogMessage<'static>>,
547 _: (),
548 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
549 ::fidl_next::munge! {
550 let crate::wire::LogMessage {
551 pid,
552 tid,
553 time,
554 severity,
555 dropped_logs,
556 tags,
557 msg,
558
559 } = out_;
560 }
561
562 ::fidl_next::Encode::encode(&self.pid, encoder_, pid, ())?;
563
564 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(pid.as_mut_ptr()) };
565
566 ::fidl_next::Encode::encode(&self.tid, encoder_, tid, ())?;
567
568 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(tid.as_mut_ptr()) };
569
570 ::fidl_next::Encode::encode(&self.time, encoder_, time, ())?;
571
572 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(time.as_mut_ptr()) };
573
574 ::fidl_next::Encode::encode(&self.severity, encoder_, severity, ())?;
575
576 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(severity.as_mut_ptr()) };
577
578 ::fidl_next::Encode::encode(&self.dropped_logs, encoder_, dropped_logs, ())?;
579
580 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(dropped_logs.as_mut_ptr()) };
581
582 ::fidl_next::Encode::encode(&self.tags, encoder_, tags, (5, 63))?;
583
584 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(tags.as_mut_ptr()) };
585 ::fidl_next::Constrained::validate(_field, (5, 63))?;
586
587 ::fidl_next::Encode::encode(&self.msg, encoder_, msg, 32768)?;
588
589 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(msg.as_mut_ptr()) };
590 ::fidl_next::Constrained::validate(_field, 32768)?;
591
592 Ok(())
593 }
594 }
595
596 unsafe impl<___E>
597 ::fidl_next::EncodeOption<
598 ::fidl_next::wire::Box<'static, crate::wire::LogMessage<'static>>,
599 ___E,
600 > for LogMessage
601 where
602 ___E: ::fidl_next::Encoder + ?Sized,
603 LogMessage: ::fidl_next::Encode<crate::wire::LogMessage<'static>, ___E>,
604 {
605 #[inline]
606 fn encode_option(
607 this: ::core::option::Option<Self>,
608 encoder: &mut ___E,
609 out: &mut ::core::mem::MaybeUninit<
610 ::fidl_next::wire::Box<'static, crate::wire::LogMessage<'static>>,
611 >,
612 _: (),
613 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
614 if let Some(inner) = this {
615 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
616 ::fidl_next::wire::Box::encode_present(out);
617 } else {
618 ::fidl_next::wire::Box::encode_absent(out);
619 }
620
621 Ok(())
622 }
623 }
624
625 unsafe impl<'a, ___E>
626 ::fidl_next::EncodeOption<
627 ::fidl_next::wire::Box<'static, crate::wire::LogMessage<'static>>,
628 ___E,
629 > for &'a LogMessage
630 where
631 ___E: ::fidl_next::Encoder + ?Sized,
632 &'a LogMessage: ::fidl_next::Encode<crate::wire::LogMessage<'static>, ___E>,
633 {
634 #[inline]
635 fn encode_option(
636 this: ::core::option::Option<Self>,
637 encoder: &mut ___E,
638 out: &mut ::core::mem::MaybeUninit<
639 ::fidl_next::wire::Box<'static, crate::wire::LogMessage<'static>>,
640 >,
641 _: (),
642 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
643 if let Some(inner) = this {
644 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
645 ::fidl_next::wire::Box::encode_present(out);
646 } else {
647 ::fidl_next::wire::Box::encode_absent(out);
648 }
649
650 Ok(())
651 }
652 }
653
654 impl<'de> ::fidl_next::FromWire<crate::wire::LogMessage<'de>> for LogMessage {
655 #[inline]
656 fn from_wire(wire: crate::wire::LogMessage<'de>) -> Self {
657 Self {
658 pid: ::fidl_next::FromWire::from_wire(wire.pid),
659
660 tid: ::fidl_next::FromWire::from_wire(wire.tid),
661
662 time: ::fidl_next::FromWire::from_wire(wire.time),
663
664 severity: ::fidl_next::FromWire::from_wire(wire.severity),
665
666 dropped_logs: ::fidl_next::FromWire::from_wire(wire.dropped_logs),
667
668 tags: ::fidl_next::FromWire::from_wire(wire.tags),
669
670 msg: ::fidl_next::FromWire::from_wire(wire.msg),
671 }
672 }
673 }
674
675 impl<'de> ::fidl_next::FromWireRef<crate::wire::LogMessage<'de>> for LogMessage {
676 #[inline]
677 fn from_wire_ref(wire: &crate::wire::LogMessage<'de>) -> Self {
678 Self {
679 pid: ::fidl_next::FromWireRef::from_wire_ref(&wire.pid),
680
681 tid: ::fidl_next::FromWireRef::from_wire_ref(&wire.tid),
682
683 time: ::fidl_next::FromWireRef::from_wire_ref(&wire.time),
684
685 severity: ::fidl_next::FromWireRef::from_wire_ref(&wire.severity),
686
687 dropped_logs: ::fidl_next::FromWireRef::from_wire_ref(&wire.dropped_logs),
688
689 tags: ::fidl_next::FromWireRef::from_wire_ref(&wire.tags),
690
691 msg: ::fidl_next::FromWireRef::from_wire_ref(&wire.msg),
692 }
693 }
694 }
695
696 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
697 pub struct LogListenerSafeLogRequest {
698 pub log: crate::natural::LogMessage,
699 }
700
701 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LogListenerSafeLogRequest<'static>, ___E>
702 for LogListenerSafeLogRequest
703 where
704 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
705 ___E: ::fidl_next::Encoder,
706 {
707 #[inline]
708 fn encode(
709 self,
710 encoder_: &mut ___E,
711 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogListenerSafeLogRequest<'static>>,
712 _: (),
713 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
714 ::fidl_next::munge! {
715 let crate::wire::LogListenerSafeLogRequest {
716 log,
717
718 } = out_;
719 }
720
721 ::fidl_next::Encode::encode(self.log, encoder_, log, ())?;
722
723 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(log.as_mut_ptr()) };
724
725 Ok(())
726 }
727 }
728
729 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LogListenerSafeLogRequest<'static>, ___E>
730 for &'a LogListenerSafeLogRequest
731 where
732 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
733 ___E: ::fidl_next::Encoder,
734 {
735 #[inline]
736 fn encode(
737 self,
738 encoder_: &mut ___E,
739 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogListenerSafeLogRequest<'static>>,
740 _: (),
741 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
742 ::fidl_next::munge! {
743 let crate::wire::LogListenerSafeLogRequest {
744 log,
745
746 } = out_;
747 }
748
749 ::fidl_next::Encode::encode(&self.log, encoder_, log, ())?;
750
751 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(log.as_mut_ptr()) };
752
753 Ok(())
754 }
755 }
756
757 unsafe impl<___E>
758 ::fidl_next::EncodeOption<
759 ::fidl_next::wire::Box<'static, crate::wire::LogListenerSafeLogRequest<'static>>,
760 ___E,
761 > for LogListenerSafeLogRequest
762 where
763 ___E: ::fidl_next::Encoder + ?Sized,
764 LogListenerSafeLogRequest:
765 ::fidl_next::Encode<crate::wire::LogListenerSafeLogRequest<'static>, ___E>,
766 {
767 #[inline]
768 fn encode_option(
769 this: ::core::option::Option<Self>,
770 encoder: &mut ___E,
771 out: &mut ::core::mem::MaybeUninit<
772 ::fidl_next::wire::Box<'static, crate::wire::LogListenerSafeLogRequest<'static>>,
773 >,
774 _: (),
775 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
776 if let Some(inner) = this {
777 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
778 ::fidl_next::wire::Box::encode_present(out);
779 } else {
780 ::fidl_next::wire::Box::encode_absent(out);
781 }
782
783 Ok(())
784 }
785 }
786
787 unsafe impl<'a, ___E>
788 ::fidl_next::EncodeOption<
789 ::fidl_next::wire::Box<'static, crate::wire::LogListenerSafeLogRequest<'static>>,
790 ___E,
791 > for &'a LogListenerSafeLogRequest
792 where
793 ___E: ::fidl_next::Encoder + ?Sized,
794 &'a LogListenerSafeLogRequest:
795 ::fidl_next::Encode<crate::wire::LogListenerSafeLogRequest<'static>, ___E>,
796 {
797 #[inline]
798 fn encode_option(
799 this: ::core::option::Option<Self>,
800 encoder: &mut ___E,
801 out: &mut ::core::mem::MaybeUninit<
802 ::fidl_next::wire::Box<'static, crate::wire::LogListenerSafeLogRequest<'static>>,
803 >,
804 _: (),
805 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
806 if let Some(inner) = this {
807 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
808 ::fidl_next::wire::Box::encode_present(out);
809 } else {
810 ::fidl_next::wire::Box::encode_absent(out);
811 }
812
813 Ok(())
814 }
815 }
816
817 impl<'de> ::fidl_next::FromWire<crate::wire::LogListenerSafeLogRequest<'de>>
818 for LogListenerSafeLogRequest
819 {
820 #[inline]
821 fn from_wire(wire: crate::wire::LogListenerSafeLogRequest<'de>) -> Self {
822 Self { log: ::fidl_next::FromWire::from_wire(wire.log) }
823 }
824 }
825
826 impl<'de> ::fidl_next::FromWireRef<crate::wire::LogListenerSafeLogRequest<'de>>
827 for LogListenerSafeLogRequest
828 {
829 #[inline]
830 fn from_wire_ref(wire: &crate::wire::LogListenerSafeLogRequest<'de>) -> Self {
831 Self { log: ::fidl_next::FromWireRef::from_wire_ref(&wire.log) }
832 }
833 }
834
835 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
836 pub struct LogListenerSafeLogManyRequest {
837 pub log: ::std::vec::Vec<crate::natural::LogMessage>,
838 }
839
840 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LogListenerSafeLogManyRequest<'static>, ___E>
841 for LogListenerSafeLogManyRequest
842 where
843 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
844 ___E: ::fidl_next::Encoder,
845 {
846 #[inline]
847 fn encode(
848 self,
849 encoder_: &mut ___E,
850 out_: &mut ::core::mem::MaybeUninit<
851 crate::wire::LogListenerSafeLogManyRequest<'static>,
852 >,
853 _: (),
854 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
855 ::fidl_next::munge! {
856 let crate::wire::LogListenerSafeLogManyRequest {
857 log,
858
859 } = out_;
860 }
861
862 ::fidl_next::Encode::encode(self.log, encoder_, log, (4294967295, ()))?;
863
864 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(log.as_mut_ptr()) };
865 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
866
867 Ok(())
868 }
869 }
870
871 unsafe impl<'a, ___E>
872 ::fidl_next::Encode<crate::wire::LogListenerSafeLogManyRequest<'static>, ___E>
873 for &'a LogListenerSafeLogManyRequest
874 where
875 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
876 ___E: ::fidl_next::Encoder,
877 {
878 #[inline]
879 fn encode(
880 self,
881 encoder_: &mut ___E,
882 out_: &mut ::core::mem::MaybeUninit<
883 crate::wire::LogListenerSafeLogManyRequest<'static>,
884 >,
885 _: (),
886 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
887 ::fidl_next::munge! {
888 let crate::wire::LogListenerSafeLogManyRequest {
889 log,
890
891 } = out_;
892 }
893
894 ::fidl_next::Encode::encode(&self.log, encoder_, log, (4294967295, ()))?;
895
896 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(log.as_mut_ptr()) };
897 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
898
899 Ok(())
900 }
901 }
902
903 unsafe impl<___E>
904 ::fidl_next::EncodeOption<
905 ::fidl_next::wire::Box<'static, crate::wire::LogListenerSafeLogManyRequest<'static>>,
906 ___E,
907 > for LogListenerSafeLogManyRequest
908 where
909 ___E: ::fidl_next::Encoder + ?Sized,
910 LogListenerSafeLogManyRequest:
911 ::fidl_next::Encode<crate::wire::LogListenerSafeLogManyRequest<'static>, ___E>,
912 {
913 #[inline]
914 fn encode_option(
915 this: ::core::option::Option<Self>,
916 encoder: &mut ___E,
917 out: &mut ::core::mem::MaybeUninit<
918 ::fidl_next::wire::Box<
919 'static,
920 crate::wire::LogListenerSafeLogManyRequest<'static>,
921 >,
922 >,
923 _: (),
924 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
925 if let Some(inner) = this {
926 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
927 ::fidl_next::wire::Box::encode_present(out);
928 } else {
929 ::fidl_next::wire::Box::encode_absent(out);
930 }
931
932 Ok(())
933 }
934 }
935
936 unsafe impl<'a, ___E>
937 ::fidl_next::EncodeOption<
938 ::fidl_next::wire::Box<'static, crate::wire::LogListenerSafeLogManyRequest<'static>>,
939 ___E,
940 > for &'a LogListenerSafeLogManyRequest
941 where
942 ___E: ::fidl_next::Encoder + ?Sized,
943 &'a LogListenerSafeLogManyRequest:
944 ::fidl_next::Encode<crate::wire::LogListenerSafeLogManyRequest<'static>, ___E>,
945 {
946 #[inline]
947 fn encode_option(
948 this: ::core::option::Option<Self>,
949 encoder: &mut ___E,
950 out: &mut ::core::mem::MaybeUninit<
951 ::fidl_next::wire::Box<
952 'static,
953 crate::wire::LogListenerSafeLogManyRequest<'static>,
954 >,
955 >,
956 _: (),
957 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
958 if let Some(inner) = this {
959 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
960 ::fidl_next::wire::Box::encode_present(out);
961 } else {
962 ::fidl_next::wire::Box::encode_absent(out);
963 }
964
965 Ok(())
966 }
967 }
968
969 impl<'de> ::fidl_next::FromWire<crate::wire::LogListenerSafeLogManyRequest<'de>>
970 for LogListenerSafeLogManyRequest
971 {
972 #[inline]
973 fn from_wire(wire: crate::wire::LogListenerSafeLogManyRequest<'de>) -> Self {
974 Self { log: ::fidl_next::FromWire::from_wire(wire.log) }
975 }
976 }
977
978 impl<'de> ::fidl_next::FromWireRef<crate::wire::LogListenerSafeLogManyRequest<'de>>
979 for LogListenerSafeLogManyRequest
980 {
981 #[inline]
982 fn from_wire_ref(wire: &crate::wire::LogListenerSafeLogManyRequest<'de>) -> Self {
983 Self { log: ::fidl_next::FromWireRef::from_wire_ref(&wire.log) }
984 }
985 }
986
987 #[derive(Debug, Clone, PartialEq)]
988 pub struct LogSinkWaitForInterestChangeResponse {
989 pub data: ::fidl_next_common_fuchsia_diagnostics_types::natural::Interest,
990 }
991
992 unsafe impl<___E>
993 ::fidl_next::Encode<crate::wire::LogSinkWaitForInterestChangeResponse<'static>, ___E>
994 for LogSinkWaitForInterestChangeResponse
995 where
996 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
997 ___E: ::fidl_next::Encoder,
998 {
999 #[inline]
1000 fn encode(
1001 self,
1002 encoder_: &mut ___E,
1003 out_: &mut ::core::mem::MaybeUninit<
1004 crate::wire::LogSinkWaitForInterestChangeResponse<'static>,
1005 >,
1006 _: (),
1007 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1008 ::fidl_next::munge! {
1009 let crate::wire::LogSinkWaitForInterestChangeResponse {
1010 data,
1011
1012 } = out_;
1013 }
1014
1015 ::fidl_next::Encode::encode(self.data, encoder_, data, ())?;
1016
1017 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
1018
1019 Ok(())
1020 }
1021 }
1022
1023 unsafe impl<'a, ___E>
1024 ::fidl_next::Encode<crate::wire::LogSinkWaitForInterestChangeResponse<'static>, ___E>
1025 for &'a LogSinkWaitForInterestChangeResponse
1026 where
1027 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1028 ___E: ::fidl_next::Encoder,
1029 {
1030 #[inline]
1031 fn encode(
1032 self,
1033 encoder_: &mut ___E,
1034 out_: &mut ::core::mem::MaybeUninit<
1035 crate::wire::LogSinkWaitForInterestChangeResponse<'static>,
1036 >,
1037 _: (),
1038 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1039 ::fidl_next::munge! {
1040 let crate::wire::LogSinkWaitForInterestChangeResponse {
1041 data,
1042
1043 } = out_;
1044 }
1045
1046 ::fidl_next::Encode::encode(&self.data, encoder_, data, ())?;
1047
1048 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
1049
1050 Ok(())
1051 }
1052 }
1053
1054 unsafe impl<___E>
1055 ::fidl_next::EncodeOption<
1056 ::fidl_next::wire::Box<
1057 'static,
1058 crate::wire::LogSinkWaitForInterestChangeResponse<'static>,
1059 >,
1060 ___E,
1061 > for LogSinkWaitForInterestChangeResponse
1062 where
1063 ___E: ::fidl_next::Encoder + ?Sized,
1064 LogSinkWaitForInterestChangeResponse:
1065 ::fidl_next::Encode<crate::wire::LogSinkWaitForInterestChangeResponse<'static>, ___E>,
1066 {
1067 #[inline]
1068 fn encode_option(
1069 this: ::core::option::Option<Self>,
1070 encoder: &mut ___E,
1071 out: &mut ::core::mem::MaybeUninit<
1072 ::fidl_next::wire::Box<
1073 'static,
1074 crate::wire::LogSinkWaitForInterestChangeResponse<'static>,
1075 >,
1076 >,
1077 _: (),
1078 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1079 if let Some(inner) = this {
1080 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1081 ::fidl_next::wire::Box::encode_present(out);
1082 } else {
1083 ::fidl_next::wire::Box::encode_absent(out);
1084 }
1085
1086 Ok(())
1087 }
1088 }
1089
1090 unsafe impl<'a, ___E>
1091 ::fidl_next::EncodeOption<
1092 ::fidl_next::wire::Box<
1093 'static,
1094 crate::wire::LogSinkWaitForInterestChangeResponse<'static>,
1095 >,
1096 ___E,
1097 > for &'a LogSinkWaitForInterestChangeResponse
1098 where
1099 ___E: ::fidl_next::Encoder + ?Sized,
1100 &'a LogSinkWaitForInterestChangeResponse:
1101 ::fidl_next::Encode<crate::wire::LogSinkWaitForInterestChangeResponse<'static>, ___E>,
1102 {
1103 #[inline]
1104 fn encode_option(
1105 this: ::core::option::Option<Self>,
1106 encoder: &mut ___E,
1107 out: &mut ::core::mem::MaybeUninit<
1108 ::fidl_next::wire::Box<
1109 'static,
1110 crate::wire::LogSinkWaitForInterestChangeResponse<'static>,
1111 >,
1112 >,
1113 _: (),
1114 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1115 if let Some(inner) = this {
1116 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1117 ::fidl_next::wire::Box::encode_present(out);
1118 } else {
1119 ::fidl_next::wire::Box::encode_absent(out);
1120 }
1121
1122 Ok(())
1123 }
1124 }
1125
1126 impl<'de> ::fidl_next::FromWire<crate::wire::LogSinkWaitForInterestChangeResponse<'de>>
1127 for LogSinkWaitForInterestChangeResponse
1128 {
1129 #[inline]
1130 fn from_wire(wire: crate::wire::LogSinkWaitForInterestChangeResponse<'de>) -> Self {
1131 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
1132 }
1133 }
1134
1135 impl<'de> ::fidl_next::FromWireRef<crate::wire::LogSinkWaitForInterestChangeResponse<'de>>
1136 for LogSinkWaitForInterestChangeResponse
1137 {
1138 #[inline]
1139 fn from_wire_ref(wire: &crate::wire::LogSinkWaitForInterestChangeResponse<'de>) -> Self {
1140 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
1141 }
1142 }
1143}
1144
1145pub mod wire {
1146
1147 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1149 #[repr(transparent)]
1150 pub struct InterestChangeError {
1151 pub(crate) value: ::fidl_next::wire::Uint32,
1152 }
1153
1154 impl ::fidl_next::Constrained for InterestChangeError {
1155 type Constraint = ();
1156
1157 fn validate(
1158 _: ::fidl_next::Slot<'_, Self>,
1159 _: Self::Constraint,
1160 ) -> Result<(), ::fidl_next::ValidationError> {
1161 Ok(())
1162 }
1163 }
1164
1165 unsafe impl ::fidl_next::Wire for InterestChangeError {
1166 type Narrowed<'de> = Self;
1167
1168 #[inline]
1169 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1170 }
1172 }
1173
1174 impl InterestChangeError {
1175 pub const CALLED_TWICE: InterestChangeError =
1176 InterestChangeError { value: ::fidl_next::wire::Uint32(1) };
1177 }
1178
1179 unsafe impl<___D> ::fidl_next::Decode<___D> for InterestChangeError
1180 where
1181 ___D: ?Sized,
1182 {
1183 fn decode(
1184 slot: ::fidl_next::Slot<'_, Self>,
1185 _: &mut ___D,
1186 _: (),
1187 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1188 ::fidl_next::munge!(let Self { value } = slot);
1189
1190 match u32::from(*value) {
1191 1 => (),
1192 unknown => {
1193 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
1194 }
1195 }
1196
1197 Ok(())
1198 }
1199 }
1200
1201 impl ::core::convert::From<crate::natural::InterestChangeError> for InterestChangeError {
1202 fn from(natural: crate::natural::InterestChangeError) -> Self {
1203 match natural {
1204 crate::natural::InterestChangeError::CalledTwice => {
1205 InterestChangeError::CALLED_TWICE
1206 }
1207 }
1208 }
1209 }
1210
1211 impl ::fidl_next::IntoNatural for InterestChangeError {
1212 type Natural = crate::natural::InterestChangeError;
1213 }
1214
1215 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1217 #[repr(transparent)]
1218 pub struct LogLevelFilter {
1219 pub(crate) value: i8,
1220 }
1221
1222 impl ::fidl_next::Constrained for LogLevelFilter {
1223 type Constraint = ();
1224
1225 fn validate(
1226 _: ::fidl_next::Slot<'_, Self>,
1227 _: Self::Constraint,
1228 ) -> Result<(), ::fidl_next::ValidationError> {
1229 Ok(())
1230 }
1231 }
1232
1233 unsafe impl ::fidl_next::Wire for LogLevelFilter {
1234 type Narrowed<'de> = Self;
1235
1236 #[inline]
1237 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1238 }
1240 }
1241
1242 impl LogLevelFilter {
1243 pub const TRACE: LogLevelFilter = LogLevelFilter { value: 16 };
1244
1245 pub const DEBUG: LogLevelFilter = LogLevelFilter { value: 32 };
1246
1247 pub const INFO: LogLevelFilter = LogLevelFilter { value: 48 };
1248
1249 pub const WARN: LogLevelFilter = LogLevelFilter { value: 64 };
1250
1251 pub const ERROR: LogLevelFilter = LogLevelFilter { value: 80 };
1252
1253 pub const FATAL: LogLevelFilter = LogLevelFilter { value: 96 };
1254
1255 pub const NONE: LogLevelFilter = LogLevelFilter { value: 127 };
1256 }
1257
1258 unsafe impl<___D> ::fidl_next::Decode<___D> for LogLevelFilter
1259 where
1260 ___D: ?Sized,
1261 {
1262 fn decode(
1263 slot: ::fidl_next::Slot<'_, Self>,
1264 _: &mut ___D,
1265 _: (),
1266 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1267 ::fidl_next::munge!(let Self { value } = slot);
1268
1269 match i8::from(*value) {
1270 16 | 32 | 48 | 64 | 80 | 96 | 127 => (),
1271 unknown => {
1272 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
1273 }
1274 }
1275
1276 Ok(())
1277 }
1278 }
1279
1280 impl ::core::convert::From<crate::natural::LogLevelFilter> for LogLevelFilter {
1281 fn from(natural: crate::natural::LogLevelFilter) -> Self {
1282 match natural {
1283 crate::natural::LogLevelFilter::Trace => LogLevelFilter::TRACE,
1284
1285 crate::natural::LogLevelFilter::Debug => LogLevelFilter::DEBUG,
1286
1287 crate::natural::LogLevelFilter::Info => LogLevelFilter::INFO,
1288
1289 crate::natural::LogLevelFilter::Warn => LogLevelFilter::WARN,
1290
1291 crate::natural::LogLevelFilter::Error => LogLevelFilter::ERROR,
1292
1293 crate::natural::LogLevelFilter::Fatal => LogLevelFilter::FATAL,
1294
1295 crate::natural::LogLevelFilter::None => LogLevelFilter::NONE,
1296 }
1297 }
1298 }
1299
1300 impl ::fidl_next::IntoNatural for LogLevelFilter {
1301 type Natural = crate::natural::LogLevelFilter;
1302 }
1303
1304 #[derive(Debug)]
1306 #[repr(C)]
1307 pub struct LogFilterOptions<'de> {
1308 pub filter_by_pid: bool,
1309
1310 pub pid: ::fidl_next::wire::Uint64,
1311
1312 pub filter_by_tid: bool,
1313
1314 pub tid: ::fidl_next::wire::Uint64,
1315
1316 pub verbosity: u8,
1317
1318 pub min_severity: crate::wire::LogLevelFilter,
1319
1320 pub tags: ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>,
1321 }
1322
1323 static_assertions::const_assert_eq!(std::mem::size_of::<LogFilterOptions<'_>>(), 56);
1324 static_assertions::const_assert_eq!(std::mem::align_of::<LogFilterOptions<'_>>(), 8);
1325
1326 static_assertions::const_assert_eq!(
1327 std::mem::offset_of!(LogFilterOptions<'_>, filter_by_pid),
1328 0
1329 );
1330
1331 static_assertions::const_assert_eq!(std::mem::offset_of!(LogFilterOptions<'_>, pid), 8);
1332
1333 static_assertions::const_assert_eq!(
1334 std::mem::offset_of!(LogFilterOptions<'_>, filter_by_tid),
1335 16
1336 );
1337
1338 static_assertions::const_assert_eq!(std::mem::offset_of!(LogFilterOptions<'_>, tid), 24);
1339
1340 static_assertions::const_assert_eq!(std::mem::offset_of!(LogFilterOptions<'_>, verbosity), 32);
1341
1342 static_assertions::const_assert_eq!(
1343 std::mem::offset_of!(LogFilterOptions<'_>, min_severity),
1344 33
1345 );
1346
1347 static_assertions::const_assert_eq!(std::mem::offset_of!(LogFilterOptions<'_>, tags), 40);
1348
1349 impl ::fidl_next::Constrained for LogFilterOptions<'_> {
1350 type Constraint = ();
1351
1352 fn validate(
1353 _: ::fidl_next::Slot<'_, Self>,
1354 _: Self::Constraint,
1355 ) -> Result<(), ::fidl_next::ValidationError> {
1356 Ok(())
1357 }
1358 }
1359
1360 unsafe impl ::fidl_next::Wire for LogFilterOptions<'static> {
1361 type Narrowed<'de> = LogFilterOptions<'de>;
1362
1363 #[inline]
1364 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1365 ::fidl_next::munge! {
1366 let Self {
1367 filter_by_pid,
1368 pid,
1369 filter_by_tid,
1370 tid,
1371 verbosity,
1372 min_severity,
1373 tags,
1374
1375 } = &mut *out_;
1376 }
1377
1378 ::fidl_next::Wire::zero_padding(filter_by_pid);
1379
1380 ::fidl_next::Wire::zero_padding(pid);
1381
1382 ::fidl_next::Wire::zero_padding(filter_by_tid);
1383
1384 ::fidl_next::Wire::zero_padding(tid);
1385
1386 ::fidl_next::Wire::zero_padding(verbosity);
1387
1388 ::fidl_next::Wire::zero_padding(min_severity);
1389
1390 ::fidl_next::Wire::zero_padding(tags);
1391
1392 unsafe {
1393 out_.as_mut_ptr().cast::<u8>().add(34).write_bytes(0, 6);
1394 }
1395
1396 unsafe {
1397 out_.as_mut_ptr().cast::<u8>().add(17).write_bytes(0, 7);
1398 }
1399
1400 unsafe {
1401 out_.as_mut_ptr().cast::<u8>().add(1).write_bytes(0, 7);
1402 }
1403 }
1404 }
1405
1406 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogFilterOptions<'de>
1407 where
1408 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1409 ___D: ::fidl_next::Decoder<'de>,
1410 {
1411 fn decode(
1412 slot_: ::fidl_next::Slot<'_, Self>,
1413 decoder_: &mut ___D,
1414 _: (),
1415 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1416 if slot_.as_bytes()[34..40] != [0u8; 6] {
1417 return Err(::fidl_next::DecodeError::InvalidPadding);
1418 }
1419
1420 if slot_.as_bytes()[17..24] != [0u8; 7] {
1421 return Err(::fidl_next::DecodeError::InvalidPadding);
1422 }
1423
1424 if slot_.as_bytes()[1..8] != [0u8; 7] {
1425 return Err(::fidl_next::DecodeError::InvalidPadding);
1426 }
1427
1428 ::fidl_next::munge! {
1429 let Self {
1430 mut filter_by_pid,
1431 mut pid,
1432 mut filter_by_tid,
1433 mut tid,
1434 mut verbosity,
1435 mut min_severity,
1436 mut tags,
1437
1438 } = slot_;
1439 }
1440
1441 let _field = filter_by_pid.as_mut();
1442
1443 ::fidl_next::Decode::decode(filter_by_pid.as_mut(), decoder_, ())?;
1444
1445 let _field = pid.as_mut();
1446
1447 ::fidl_next::Decode::decode(pid.as_mut(), decoder_, ())?;
1448
1449 let _field = filter_by_tid.as_mut();
1450
1451 ::fidl_next::Decode::decode(filter_by_tid.as_mut(), decoder_, ())?;
1452
1453 let _field = tid.as_mut();
1454
1455 ::fidl_next::Decode::decode(tid.as_mut(), decoder_, ())?;
1456
1457 let _field = verbosity.as_mut();
1458
1459 ::fidl_next::Decode::decode(verbosity.as_mut(), decoder_, ())?;
1460
1461 let _field = min_severity.as_mut();
1462
1463 ::fidl_next::Decode::decode(min_severity.as_mut(), decoder_, ())?;
1464
1465 let _field = tags.as_mut();
1466 ::fidl_next::Constrained::validate(_field, (16, 63))?;
1467 ::fidl_next::Decode::decode(tags.as_mut(), decoder_, (16, 63))?;
1468
1469 let tags = unsafe { tags.deref_unchecked() };
1470
1471 if tags.len() > 16 {
1472 return Err(::fidl_next::DecodeError::VectorTooLong {
1473 size: tags.len() as u64,
1474 limit: 16,
1475 });
1476 }
1477
1478 Ok(())
1479 }
1480 }
1481
1482 impl<'de> ::fidl_next::IntoNatural for LogFilterOptions<'de> {
1483 type Natural = crate::natural::LogFilterOptions;
1484 }
1485
1486 #[derive(Debug)]
1488 #[repr(C)]
1489 pub struct LogMessage<'de> {
1490 pub pid: ::fidl_next::wire::Uint64,
1491
1492 pub tid: ::fidl_next::wire::Uint64,
1493
1494 pub time: ::fidl_next::wire::Int64,
1495
1496 pub severity: ::fidl_next::wire::Int32,
1497
1498 pub dropped_logs: ::fidl_next::wire::Uint32,
1499
1500 pub tags: ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>,
1501
1502 pub msg: ::fidl_next::wire::String<'de>,
1503 }
1504
1505 static_assertions::const_assert_eq!(std::mem::size_of::<LogMessage<'_>>(), 64);
1506 static_assertions::const_assert_eq!(std::mem::align_of::<LogMessage<'_>>(), 8);
1507
1508 static_assertions::const_assert_eq!(std::mem::offset_of!(LogMessage<'_>, pid), 0);
1509
1510 static_assertions::const_assert_eq!(std::mem::offset_of!(LogMessage<'_>, tid), 8);
1511
1512 static_assertions::const_assert_eq!(std::mem::offset_of!(LogMessage<'_>, time), 16);
1513
1514 static_assertions::const_assert_eq!(std::mem::offset_of!(LogMessage<'_>, severity), 24);
1515
1516 static_assertions::const_assert_eq!(std::mem::offset_of!(LogMessage<'_>, dropped_logs), 28);
1517
1518 static_assertions::const_assert_eq!(std::mem::offset_of!(LogMessage<'_>, tags), 32);
1519
1520 static_assertions::const_assert_eq!(std::mem::offset_of!(LogMessage<'_>, msg), 48);
1521
1522 impl ::fidl_next::Constrained for LogMessage<'_> {
1523 type Constraint = ();
1524
1525 fn validate(
1526 _: ::fidl_next::Slot<'_, Self>,
1527 _: Self::Constraint,
1528 ) -> Result<(), ::fidl_next::ValidationError> {
1529 Ok(())
1530 }
1531 }
1532
1533 unsafe impl ::fidl_next::Wire for LogMessage<'static> {
1534 type Narrowed<'de> = LogMessage<'de>;
1535
1536 #[inline]
1537 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1538 ::fidl_next::munge! {
1539 let Self {
1540 pid,
1541 tid,
1542 time,
1543 severity,
1544 dropped_logs,
1545 tags,
1546 msg,
1547
1548 } = &mut *out_;
1549 }
1550
1551 ::fidl_next::Wire::zero_padding(pid);
1552
1553 ::fidl_next::Wire::zero_padding(tid);
1554
1555 ::fidl_next::Wire::zero_padding(time);
1556
1557 ::fidl_next::Wire::zero_padding(severity);
1558
1559 ::fidl_next::Wire::zero_padding(dropped_logs);
1560
1561 ::fidl_next::Wire::zero_padding(tags);
1562
1563 ::fidl_next::Wire::zero_padding(msg);
1564 }
1565 }
1566
1567 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogMessage<'de>
1568 where
1569 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1570 ___D: ::fidl_next::Decoder<'de>,
1571 {
1572 fn decode(
1573 slot_: ::fidl_next::Slot<'_, Self>,
1574 decoder_: &mut ___D,
1575 _: (),
1576 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1577 ::fidl_next::munge! {
1578 let Self {
1579 mut pid,
1580 mut tid,
1581 mut time,
1582 mut severity,
1583 mut dropped_logs,
1584 mut tags,
1585 mut msg,
1586
1587 } = slot_;
1588 }
1589
1590 let _field = pid.as_mut();
1591
1592 ::fidl_next::Decode::decode(pid.as_mut(), decoder_, ())?;
1593
1594 let _field = tid.as_mut();
1595
1596 ::fidl_next::Decode::decode(tid.as_mut(), decoder_, ())?;
1597
1598 let _field = time.as_mut();
1599
1600 ::fidl_next::Decode::decode(time.as_mut(), decoder_, ())?;
1601
1602 let _field = severity.as_mut();
1603
1604 ::fidl_next::Decode::decode(severity.as_mut(), decoder_, ())?;
1605
1606 let _field = dropped_logs.as_mut();
1607
1608 ::fidl_next::Decode::decode(dropped_logs.as_mut(), decoder_, ())?;
1609
1610 let _field = tags.as_mut();
1611 ::fidl_next::Constrained::validate(_field, (5, 63))?;
1612 ::fidl_next::Decode::decode(tags.as_mut(), decoder_, (5, 63))?;
1613
1614 let tags = unsafe { tags.deref_unchecked() };
1615
1616 if tags.len() > 5 {
1617 return Err(::fidl_next::DecodeError::VectorTooLong {
1618 size: tags.len() as u64,
1619 limit: 5,
1620 });
1621 }
1622
1623 let _field = msg.as_mut();
1624 ::fidl_next::Constrained::validate(_field, 32768)?;
1625 ::fidl_next::Decode::decode(msg.as_mut(), decoder_, 32768)?;
1626
1627 let msg = unsafe { msg.deref_unchecked() };
1628
1629 if msg.len() > 32768 {
1630 return Err(::fidl_next::DecodeError::VectorTooLong {
1631 size: msg.len() as u64,
1632 limit: 32768,
1633 });
1634 }
1635
1636 Ok(())
1637 }
1638 }
1639
1640 impl<'de> ::fidl_next::IntoNatural for LogMessage<'de> {
1641 type Natural = crate::natural::LogMessage;
1642 }
1643
1644 #[derive(Debug)]
1646 #[repr(C)]
1647 pub struct LogListenerSafeLogRequest<'de> {
1648 pub log: crate::wire::LogMessage<'de>,
1649 }
1650
1651 static_assertions::const_assert_eq!(std::mem::size_of::<LogListenerSafeLogRequest<'_>>(), 64);
1652 static_assertions::const_assert_eq!(std::mem::align_of::<LogListenerSafeLogRequest<'_>>(), 8);
1653
1654 static_assertions::const_assert_eq!(
1655 std::mem::offset_of!(LogListenerSafeLogRequest<'_>, log),
1656 0
1657 );
1658
1659 impl ::fidl_next::Constrained for LogListenerSafeLogRequest<'_> {
1660 type Constraint = ();
1661
1662 fn validate(
1663 _: ::fidl_next::Slot<'_, Self>,
1664 _: Self::Constraint,
1665 ) -> Result<(), ::fidl_next::ValidationError> {
1666 Ok(())
1667 }
1668 }
1669
1670 unsafe impl ::fidl_next::Wire for LogListenerSafeLogRequest<'static> {
1671 type Narrowed<'de> = LogListenerSafeLogRequest<'de>;
1672
1673 #[inline]
1674 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1675 ::fidl_next::munge! {
1676 let Self {
1677 log,
1678
1679 } = &mut *out_;
1680 }
1681
1682 ::fidl_next::Wire::zero_padding(log);
1683 }
1684 }
1685
1686 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogListenerSafeLogRequest<'de>
1687 where
1688 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1689 ___D: ::fidl_next::Decoder<'de>,
1690 {
1691 fn decode(
1692 slot_: ::fidl_next::Slot<'_, Self>,
1693 decoder_: &mut ___D,
1694 _: (),
1695 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1696 ::fidl_next::munge! {
1697 let Self {
1698 mut log,
1699
1700 } = slot_;
1701 }
1702
1703 let _field = log.as_mut();
1704
1705 ::fidl_next::Decode::decode(log.as_mut(), decoder_, ())?;
1706
1707 Ok(())
1708 }
1709 }
1710
1711 impl<'de> ::fidl_next::IntoNatural for LogListenerSafeLogRequest<'de> {
1712 type Natural = crate::natural::LogListenerSafeLogRequest;
1713 }
1714
1715 #[derive(Debug)]
1717 #[repr(C)]
1718 pub struct LogListenerSafeLogManyRequest<'de> {
1719 pub log: ::fidl_next::wire::Vector<'de, crate::wire::LogMessage<'de>>,
1720 }
1721
1722 static_assertions::const_assert_eq!(
1723 std::mem::size_of::<LogListenerSafeLogManyRequest<'_>>(),
1724 16
1725 );
1726 static_assertions::const_assert_eq!(
1727 std::mem::align_of::<LogListenerSafeLogManyRequest<'_>>(),
1728 8
1729 );
1730
1731 static_assertions::const_assert_eq!(
1732 std::mem::offset_of!(LogListenerSafeLogManyRequest<'_>, log),
1733 0
1734 );
1735
1736 impl ::fidl_next::Constrained for LogListenerSafeLogManyRequest<'_> {
1737 type Constraint = ();
1738
1739 fn validate(
1740 _: ::fidl_next::Slot<'_, Self>,
1741 _: Self::Constraint,
1742 ) -> Result<(), ::fidl_next::ValidationError> {
1743 Ok(())
1744 }
1745 }
1746
1747 unsafe impl ::fidl_next::Wire for LogListenerSafeLogManyRequest<'static> {
1748 type Narrowed<'de> = LogListenerSafeLogManyRequest<'de>;
1749
1750 #[inline]
1751 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1752 ::fidl_next::munge! {
1753 let Self {
1754 log,
1755
1756 } = &mut *out_;
1757 }
1758
1759 ::fidl_next::Wire::zero_padding(log);
1760 }
1761 }
1762
1763 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogListenerSafeLogManyRequest<'de>
1764 where
1765 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1766 ___D: ::fidl_next::Decoder<'de>,
1767 {
1768 fn decode(
1769 slot_: ::fidl_next::Slot<'_, Self>,
1770 decoder_: &mut ___D,
1771 _: (),
1772 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1773 ::fidl_next::munge! {
1774 let Self {
1775 mut log,
1776
1777 } = slot_;
1778 }
1779
1780 let _field = log.as_mut();
1781 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1782 ::fidl_next::Decode::decode(log.as_mut(), decoder_, (4294967295, ()))?;
1783
1784 Ok(())
1785 }
1786 }
1787
1788 impl<'de> ::fidl_next::IntoNatural for LogListenerSafeLogManyRequest<'de> {
1789 type Natural = crate::natural::LogListenerSafeLogManyRequest;
1790 }
1791
1792 #[derive(Debug)]
1794 #[repr(C)]
1795 pub struct LogSinkWaitForInterestChangeResponse<'de> {
1796 pub data: ::fidl_next_common_fuchsia_diagnostics_types::wire::Interest<'de>,
1797 }
1798
1799 static_assertions::const_assert_eq!(
1800 std::mem::size_of::<LogSinkWaitForInterestChangeResponse<'_>>(),
1801 16
1802 );
1803 static_assertions::const_assert_eq!(
1804 std::mem::align_of::<LogSinkWaitForInterestChangeResponse<'_>>(),
1805 8
1806 );
1807
1808 static_assertions::const_assert_eq!(
1809 std::mem::offset_of!(LogSinkWaitForInterestChangeResponse<'_>, data),
1810 0
1811 );
1812
1813 impl ::fidl_next::Constrained for LogSinkWaitForInterestChangeResponse<'_> {
1814 type Constraint = ();
1815
1816 fn validate(
1817 _: ::fidl_next::Slot<'_, Self>,
1818 _: Self::Constraint,
1819 ) -> Result<(), ::fidl_next::ValidationError> {
1820 Ok(())
1821 }
1822 }
1823
1824 unsafe impl ::fidl_next::Wire for LogSinkWaitForInterestChangeResponse<'static> {
1825 type Narrowed<'de> = LogSinkWaitForInterestChangeResponse<'de>;
1826
1827 #[inline]
1828 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1829 ::fidl_next::munge! {
1830 let Self {
1831 data,
1832
1833 } = &mut *out_;
1834 }
1835
1836 ::fidl_next::Wire::zero_padding(data);
1837 }
1838 }
1839
1840 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogSinkWaitForInterestChangeResponse<'de>
1841 where
1842 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1843 ___D: ::fidl_next::Decoder<'de>,
1844 {
1845 fn decode(
1846 slot_: ::fidl_next::Slot<'_, Self>,
1847 decoder_: &mut ___D,
1848 _: (),
1849 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1850 ::fidl_next::munge! {
1851 let Self {
1852 mut data,
1853
1854 } = slot_;
1855 }
1856
1857 let _field = data.as_mut();
1858
1859 ::fidl_next::Decode::decode(data.as_mut(), decoder_, ())?;
1860
1861 Ok(())
1862 }
1863 }
1864
1865 impl<'de> ::fidl_next::IntoNatural for LogSinkWaitForInterestChangeResponse<'de> {
1866 type Natural = crate::natural::LogSinkWaitForInterestChangeResponse;
1867 }
1868}
1869
1870pub mod wire_optional {}
1871
1872pub mod generic {
1873
1874 pub struct LogFilterOptions<T0, T1, T2, T3, T4, T5, T6> {
1876 pub filter_by_pid: T0,
1877
1878 pub pid: T1,
1879
1880 pub filter_by_tid: T2,
1881
1882 pub tid: T3,
1883
1884 pub verbosity: T4,
1885
1886 pub min_severity: T5,
1887
1888 pub tags: T6,
1889 }
1890
1891 unsafe impl<___E, T0, T1, T2, T3, T4, T5, T6>
1892 ::fidl_next::Encode<crate::wire::LogFilterOptions<'static>, ___E>
1893 for LogFilterOptions<T0, T1, T2, T3, T4, T5, T6>
1894 where
1895 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1896 ___E: ::fidl_next::Encoder,
1897 T0: ::fidl_next::Encode<bool, ___E>,
1898 T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
1899 T2: ::fidl_next::Encode<bool, ___E>,
1900 T3: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
1901 T4: ::fidl_next::Encode<u8, ___E>,
1902 T5: ::fidl_next::Encode<crate::wire::LogLevelFilter, ___E>,
1903 T6: ::fidl_next::Encode<
1904 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::String<'static>>,
1905 ___E,
1906 >,
1907 {
1908 #[inline]
1909 fn encode(
1910 self,
1911 encoder_: &mut ___E,
1912 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogFilterOptions<'static>>,
1913 _: (),
1914 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1915 ::fidl_next::munge! {
1916 let crate::wire::LogFilterOptions {
1917 filter_by_pid,
1918 pid,
1919 filter_by_tid,
1920 tid,
1921 verbosity,
1922 min_severity,
1923 tags,
1924
1925 } = out_;
1926 }
1927
1928 ::fidl_next::Encode::encode(self.filter_by_pid, encoder_, filter_by_pid, ())?;
1929
1930 ::fidl_next::Encode::encode(self.pid, encoder_, pid, ())?;
1931
1932 ::fidl_next::Encode::encode(self.filter_by_tid, encoder_, filter_by_tid, ())?;
1933
1934 ::fidl_next::Encode::encode(self.tid, encoder_, tid, ())?;
1935
1936 ::fidl_next::Encode::encode(self.verbosity, encoder_, verbosity, ())?;
1937
1938 ::fidl_next::Encode::encode(self.min_severity, encoder_, min_severity, ())?;
1939
1940 ::fidl_next::Encode::encode(self.tags, encoder_, tags, (16, 63))?;
1941
1942 Ok(())
1943 }
1944 }
1945
1946 unsafe impl<'a, ___E, T0, T1, T2, T3, T4, T5, T6>
1947 ::fidl_next::Encode<crate::wire::LogFilterOptions<'static>, ___E>
1948 for &'a LogFilterOptions<T0, T1, T2, T3, T4, T5, T6>
1949 where
1950 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1951 ___E: ::fidl_next::Encoder,
1952 &'a T0: ::fidl_next::Encode<bool, ___E>,
1953 &'a T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
1954 &'a T2: ::fidl_next::Encode<bool, ___E>,
1955 &'a T3: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
1956 &'a T4: ::fidl_next::Encode<u8, ___E>,
1957 &'a T5: ::fidl_next::Encode<crate::wire::LogLevelFilter, ___E>,
1958 &'a T6: ::fidl_next::Encode<
1959 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::String<'static>>,
1960 ___E,
1961 >,
1962 {
1963 #[inline]
1964 fn encode(
1965 self,
1966 encoder_: &mut ___E,
1967 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogFilterOptions<'static>>,
1968 _: (),
1969 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1970 ::fidl_next::munge! {
1971 let crate::wire::LogFilterOptions {
1972 filter_by_pid,
1973 pid,
1974 filter_by_tid,
1975 tid,
1976 verbosity,
1977 min_severity,
1978 tags,
1979
1980 } = out_;
1981 }
1982
1983 ::fidl_next::Encode::encode(&self.filter_by_pid, encoder_, filter_by_pid, ())?;
1984
1985 ::fidl_next::Encode::encode(&self.pid, encoder_, pid, ())?;
1986
1987 ::fidl_next::Encode::encode(&self.filter_by_tid, encoder_, filter_by_tid, ())?;
1988
1989 ::fidl_next::Encode::encode(&self.tid, encoder_, tid, ())?;
1990
1991 ::fidl_next::Encode::encode(&self.verbosity, encoder_, verbosity, ())?;
1992
1993 ::fidl_next::Encode::encode(&self.min_severity, encoder_, min_severity, ())?;
1994
1995 ::fidl_next::Encode::encode(&self.tags, encoder_, tags, (16, 63))?;
1996
1997 Ok(())
1998 }
1999 }
2000
2001 pub struct LogMessage<T0, T1, T2, T3, T4, T5, T6> {
2003 pub pid: T0,
2004
2005 pub tid: T1,
2006
2007 pub time: T2,
2008
2009 pub severity: T3,
2010
2011 pub dropped_logs: T4,
2012
2013 pub tags: T5,
2014
2015 pub msg: T6,
2016 }
2017
2018 unsafe impl<___E, T0, T1, T2, T3, T4, T5, T6>
2019 ::fidl_next::Encode<crate::wire::LogMessage<'static>, ___E>
2020 for LogMessage<T0, T1, T2, T3, T4, T5, T6>
2021 where
2022 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2023 ___E: ::fidl_next::Encoder,
2024 T0: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
2025 T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
2026 T2: ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>,
2027 T3: ::fidl_next::Encode<::fidl_next::wire::Int32, ___E>,
2028 T4: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
2029 T5: ::fidl_next::Encode<
2030 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::String<'static>>,
2031 ___E,
2032 >,
2033 T6: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
2034 {
2035 #[inline]
2036 fn encode(
2037 self,
2038 encoder_: &mut ___E,
2039 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogMessage<'static>>,
2040 _: (),
2041 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2042 ::fidl_next::munge! {
2043 let crate::wire::LogMessage {
2044 pid,
2045 tid,
2046 time,
2047 severity,
2048 dropped_logs,
2049 tags,
2050 msg,
2051
2052 } = out_;
2053 }
2054
2055 ::fidl_next::Encode::encode(self.pid, encoder_, pid, ())?;
2056
2057 ::fidl_next::Encode::encode(self.tid, encoder_, tid, ())?;
2058
2059 ::fidl_next::Encode::encode(self.time, encoder_, time, ())?;
2060
2061 ::fidl_next::Encode::encode(self.severity, encoder_, severity, ())?;
2062
2063 ::fidl_next::Encode::encode(self.dropped_logs, encoder_, dropped_logs, ())?;
2064
2065 ::fidl_next::Encode::encode(self.tags, encoder_, tags, (5, 63))?;
2066
2067 ::fidl_next::Encode::encode(self.msg, encoder_, msg, 32768)?;
2068
2069 Ok(())
2070 }
2071 }
2072
2073 unsafe impl<'a, ___E, T0, T1, T2, T3, T4, T5, T6>
2074 ::fidl_next::Encode<crate::wire::LogMessage<'static>, ___E>
2075 for &'a LogMessage<T0, T1, T2, T3, T4, T5, T6>
2076 where
2077 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2078 ___E: ::fidl_next::Encoder,
2079 &'a T0: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
2080 &'a T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
2081 &'a T2: ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>,
2082 &'a T3: ::fidl_next::Encode<::fidl_next::wire::Int32, ___E>,
2083 &'a T4: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
2084 &'a T5: ::fidl_next::Encode<
2085 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::String<'static>>,
2086 ___E,
2087 >,
2088 &'a T6: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
2089 {
2090 #[inline]
2091 fn encode(
2092 self,
2093 encoder_: &mut ___E,
2094 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogMessage<'static>>,
2095 _: (),
2096 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2097 ::fidl_next::munge! {
2098 let crate::wire::LogMessage {
2099 pid,
2100 tid,
2101 time,
2102 severity,
2103 dropped_logs,
2104 tags,
2105 msg,
2106
2107 } = out_;
2108 }
2109
2110 ::fidl_next::Encode::encode(&self.pid, encoder_, pid, ())?;
2111
2112 ::fidl_next::Encode::encode(&self.tid, encoder_, tid, ())?;
2113
2114 ::fidl_next::Encode::encode(&self.time, encoder_, time, ())?;
2115
2116 ::fidl_next::Encode::encode(&self.severity, encoder_, severity, ())?;
2117
2118 ::fidl_next::Encode::encode(&self.dropped_logs, encoder_, dropped_logs, ())?;
2119
2120 ::fidl_next::Encode::encode(&self.tags, encoder_, tags, (5, 63))?;
2121
2122 ::fidl_next::Encode::encode(&self.msg, encoder_, msg, 32768)?;
2123
2124 Ok(())
2125 }
2126 }
2127
2128 pub struct LogListenerSafeLogRequest<T0> {
2130 pub log: T0,
2131 }
2132
2133 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::LogListenerSafeLogRequest<'static>, ___E>
2134 for LogListenerSafeLogRequest<T0>
2135 where
2136 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2137 ___E: ::fidl_next::Encoder,
2138 T0: ::fidl_next::Encode<crate::wire::LogMessage<'static>, ___E>,
2139 {
2140 #[inline]
2141 fn encode(
2142 self,
2143 encoder_: &mut ___E,
2144 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogListenerSafeLogRequest<'static>>,
2145 _: (),
2146 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2147 ::fidl_next::munge! {
2148 let crate::wire::LogListenerSafeLogRequest {
2149 log,
2150
2151 } = out_;
2152 }
2153
2154 ::fidl_next::Encode::encode(self.log, encoder_, log, ())?;
2155
2156 Ok(())
2157 }
2158 }
2159
2160 unsafe impl<'a, ___E, T0>
2161 ::fidl_next::Encode<crate::wire::LogListenerSafeLogRequest<'static>, ___E>
2162 for &'a LogListenerSafeLogRequest<T0>
2163 where
2164 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2165 ___E: ::fidl_next::Encoder,
2166 &'a T0: ::fidl_next::Encode<crate::wire::LogMessage<'static>, ___E>,
2167 {
2168 #[inline]
2169 fn encode(
2170 self,
2171 encoder_: &mut ___E,
2172 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogListenerSafeLogRequest<'static>>,
2173 _: (),
2174 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2175 ::fidl_next::munge! {
2176 let crate::wire::LogListenerSafeLogRequest {
2177 log,
2178
2179 } = out_;
2180 }
2181
2182 ::fidl_next::Encode::encode(&self.log, encoder_, log, ())?;
2183
2184 Ok(())
2185 }
2186 }
2187
2188 pub struct LogListenerSafeLogManyRequest<T0> {
2190 pub log: T0,
2191 }
2192
2193 unsafe impl<___E, T0>
2194 ::fidl_next::Encode<crate::wire::LogListenerSafeLogManyRequest<'static>, ___E>
2195 for LogListenerSafeLogManyRequest<T0>
2196 where
2197 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2198 ___E: ::fidl_next::Encoder,
2199 T0: ::fidl_next::Encode<
2200 ::fidl_next::wire::Vector<'static, crate::wire::LogMessage<'static>>,
2201 ___E,
2202 >,
2203 {
2204 #[inline]
2205 fn encode(
2206 self,
2207 encoder_: &mut ___E,
2208 out_: &mut ::core::mem::MaybeUninit<
2209 crate::wire::LogListenerSafeLogManyRequest<'static>,
2210 >,
2211 _: (),
2212 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2213 ::fidl_next::munge! {
2214 let crate::wire::LogListenerSafeLogManyRequest {
2215 log,
2216
2217 } = out_;
2218 }
2219
2220 ::fidl_next::Encode::encode(self.log, encoder_, log, (4294967295, ()))?;
2221
2222 Ok(())
2223 }
2224 }
2225
2226 unsafe impl<'a, ___E, T0>
2227 ::fidl_next::Encode<crate::wire::LogListenerSafeLogManyRequest<'static>, ___E>
2228 for &'a LogListenerSafeLogManyRequest<T0>
2229 where
2230 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2231 ___E: ::fidl_next::Encoder,
2232 &'a T0: ::fidl_next::Encode<
2233 ::fidl_next::wire::Vector<'static, crate::wire::LogMessage<'static>>,
2234 ___E,
2235 >,
2236 {
2237 #[inline]
2238 fn encode(
2239 self,
2240 encoder_: &mut ___E,
2241 out_: &mut ::core::mem::MaybeUninit<
2242 crate::wire::LogListenerSafeLogManyRequest<'static>,
2243 >,
2244 _: (),
2245 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2246 ::fidl_next::munge! {
2247 let crate::wire::LogListenerSafeLogManyRequest {
2248 log,
2249
2250 } = out_;
2251 }
2252
2253 ::fidl_next::Encode::encode(&self.log, encoder_, log, (4294967295, ()))?;
2254
2255 Ok(())
2256 }
2257 }
2258
2259 pub struct LogSinkWaitForInterestChangeResponse<T0> {
2261 pub data: T0,
2262 }
2263
2264 unsafe impl<___E, T0>
2265 ::fidl_next::Encode<crate::wire::LogSinkWaitForInterestChangeResponse<'static>, ___E>
2266 for LogSinkWaitForInterestChangeResponse<T0>
2267 where
2268 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2269 ___E: ::fidl_next::Encoder,
2270 T0: ::fidl_next::Encode<
2271 ::fidl_next_common_fuchsia_diagnostics_types::wire::Interest<'static>,
2272 ___E,
2273 >,
2274 {
2275 #[inline]
2276 fn encode(
2277 self,
2278 encoder_: &mut ___E,
2279 out_: &mut ::core::mem::MaybeUninit<
2280 crate::wire::LogSinkWaitForInterestChangeResponse<'static>,
2281 >,
2282 _: (),
2283 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2284 ::fidl_next::munge! {
2285 let crate::wire::LogSinkWaitForInterestChangeResponse {
2286 data,
2287
2288 } = out_;
2289 }
2290
2291 ::fidl_next::Encode::encode(self.data, encoder_, data, ())?;
2292
2293 Ok(())
2294 }
2295 }
2296
2297 unsafe impl<'a, ___E, T0>
2298 ::fidl_next::Encode<crate::wire::LogSinkWaitForInterestChangeResponse<'static>, ___E>
2299 for &'a LogSinkWaitForInterestChangeResponse<T0>
2300 where
2301 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2302 ___E: ::fidl_next::Encoder,
2303 &'a T0: ::fidl_next::Encode<
2304 ::fidl_next_common_fuchsia_diagnostics_types::wire::Interest<'static>,
2305 ___E,
2306 >,
2307 {
2308 #[inline]
2309 fn encode(
2310 self,
2311 encoder_: &mut ___E,
2312 out_: &mut ::core::mem::MaybeUninit<
2313 crate::wire::LogSinkWaitForInterestChangeResponse<'static>,
2314 >,
2315 _: (),
2316 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2317 ::fidl_next::munge! {
2318 let crate::wire::LogSinkWaitForInterestChangeResponse {
2319 data,
2320
2321 } = out_;
2322 }
2323
2324 ::fidl_next::Encode::encode(&self.data, encoder_, data, ())?;
2325
2326 Ok(())
2327 }
2328 }
2329}
2330
2331pub use self::natural::*;
2332
2333#[doc = " Default log level used to initialize loggers.\n"]
2334pub const LOG_LEVEL_DEFAULT: crate::natural::LogLevelFilter = crate::natural::LogLevelFilter::Info;
2335
2336#[doc = " Maximum available log severity.\n"]
2337pub const LOG_SEVERITY_MAX_STEP: u8 = 6 as u8;
2338
2339#[doc = " The interval between discrete log severity levels\n"]
2340pub const LOG_SEVERITY_STEP_SIZE: u8 = 16 as u8;
2341
2342#[doc = " The interval between discrete log verbosity levels\n"]
2343pub const LOG_VERBOSITY_STEP_SIZE: u8 = 1 as u8;
2344
2345#[doc = " Max tag length that can be passed to filter by listener.\n"]
2346pub const MAX_TAG_LEN_BYTES: u8 = 63 as u8;
2347
2348#[doc = " Max number of tags that can be passed to filter by listener.\n"]
2349pub const MAX_TAGS: u8 = 16 as u8;
2350
2351#[doc = " Max tags that will be attached to a LogMessage.\n"]
2352pub const MAX_TAGS_PER_LOG_MESSAGE: u8 = 5 as u8;
2353
2354#[doc = " Max byte size for message payload.\n"]
2355pub const MAX_DATAGRAM_LEN_BYTES: u32 = 32768 as u32;
2356
2357#[doc = " A listener who will notify the `Log` of the receipt of each message.\n"]
2359#[derive(PartialEq, Debug)]
2360pub struct LogListenerSafe;
2361
2362#[cfg(target_os = "fuchsia")]
2363impl ::fidl_next::HasTransport for LogListenerSafe {
2364 type Transport = ::fidl_next::fuchsia::zx::Channel;
2365}
2366
2367pub mod log_listener_safe {
2368 pub mod prelude {
2369 pub use crate::{
2370 LogListenerSafe, LogListenerSafeClientHandler, LogListenerSafeLocalClientHandler,
2371 LogListenerSafeLocalServerHandler, LogListenerSafeServerHandler, log_listener_safe,
2372 };
2373
2374 pub use crate::natural::LogListenerSafeLogManyRequest;
2375
2376 pub use crate::natural::LogListenerSafeLogRequest;
2377 }
2378
2379 pub struct Log;
2380
2381 impl ::fidl_next::Method for Log {
2382 const ORDINAL: u64 = 5882719137999207690;
2383 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2384 ::fidl_next::protocol::Flexibility::Strict;
2385
2386 type Protocol = crate::LogListenerSafe;
2387
2388 type Request = crate::wire::LogListenerSafeLogRequest<'static>;
2389 }
2390
2391 impl ::fidl_next::TwoWayMethod for Log {
2392 type Response = ::fidl_next::wire::Strict<::fidl_next::wire::EmptyMessageBody>;
2393 }
2394
2395 impl<___R> ::fidl_next::Respond<___R> for Log {
2396 type Output = ::fidl_next::Strict<___R>;
2397
2398 fn respond(response: ___R) -> Self::Output {
2399 ::fidl_next::Strict(response)
2400 }
2401 }
2402
2403 pub struct LogMany;
2404
2405 impl ::fidl_next::Method for LogMany {
2406 const ORDINAL: u64 = 139706434677727850;
2407 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2408 ::fidl_next::protocol::Flexibility::Strict;
2409
2410 type Protocol = crate::LogListenerSafe;
2411
2412 type Request = crate::wire::LogListenerSafeLogManyRequest<'static>;
2413 }
2414
2415 impl ::fidl_next::TwoWayMethod for LogMany {
2416 type Response = ::fidl_next::wire::Strict<::fidl_next::wire::EmptyMessageBody>;
2417 }
2418
2419 impl<___R> ::fidl_next::Respond<___R> for LogMany {
2420 type Output = ::fidl_next::Strict<___R>;
2421
2422 fn respond(response: ___R) -> Self::Output {
2423 ::fidl_next::Strict(response)
2424 }
2425 }
2426
2427 pub struct Done;
2428
2429 impl ::fidl_next::Method for Done {
2430 const ORDINAL: u64 = 3789886091192272056;
2431 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2432 ::fidl_next::protocol::Flexibility::Strict;
2433
2434 type Protocol = crate::LogListenerSafe;
2435
2436 type Request = ::fidl_next::wire::EmptyMessageBody;
2437 }
2438
2439 mod ___detail {
2440 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::LogListenerSafe
2441 where
2442 ___T: ::fidl_next::Transport,
2443 {
2444 type Client = LogListenerSafeClient<___T>;
2445 type Server = LogListenerSafeServer<___T>;
2446 }
2447
2448 #[repr(transparent)]
2450 pub struct LogListenerSafeClient<___T: ::fidl_next::Transport> {
2451 #[allow(dead_code)]
2452 client: ::fidl_next::protocol::Client<___T>,
2453 }
2454
2455 impl<___T> LogListenerSafeClient<___T>
2456 where
2457 ___T: ::fidl_next::Transport,
2458 {
2459 #[doc = " Called for single messages.\n\n The return value is used for flow control, and implementers should acknowledge receipt of\n each message in order to continue receiving future messages.\n"]
2460 pub fn log(
2461 &self,
2462
2463 log: impl ::fidl_next::Encode<
2464 crate::wire::LogMessage<'static>,
2465 <___T as ::fidl_next::Transport>::SendBuffer,
2466 >,
2467 ) -> ::fidl_next::TwoWayFuture<'_, super::Log, ___T>
2468 where
2469 <___T as ::fidl_next::Transport>::SendBuffer:
2470 ::fidl_next::encoder::InternalHandleEncoder,
2471 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2472 {
2473 self.log_with(crate::generic::LogListenerSafeLogRequest { log })
2474 }
2475
2476 #[doc = " Called for single messages.\n\n The return value is used for flow control, and implementers should acknowledge receipt of\n each message in order to continue receiving future messages.\n"]
2477 pub fn log_with<___R>(
2478 &self,
2479 request: ___R,
2480 ) -> ::fidl_next::TwoWayFuture<'_, super::Log, ___T>
2481 where
2482 ___R: ::fidl_next::Encode<
2483 crate::wire::LogListenerSafeLogRequest<'static>,
2484 <___T as ::fidl_next::Transport>::SendBuffer,
2485 >,
2486 {
2487 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2488 5882719137999207690,
2489 <super::Log as ::fidl_next::Method>::FLEXIBILITY,
2490 request,
2491 ))
2492 }
2493
2494 #[doc = " Called when serving cached logs.\n\n Max logs size per call is `MAX_LOG_MANY_SIZE_BYTES` bytes.\n\n The return value is used for flow control, and implementers should acknowledge receipt of\n each batch in order to continue receiving future messages.\n"]
2495 pub fn log_many(
2496 &self,
2497
2498 log: impl ::fidl_next::Encode<
2499 ::fidl_next::wire::Vector<'static, crate::wire::LogMessage<'static>>,
2500 <___T as ::fidl_next::Transport>::SendBuffer,
2501 >,
2502 ) -> ::fidl_next::TwoWayFuture<'_, super::LogMany, ___T>
2503 where
2504 <___T as ::fidl_next::Transport>::SendBuffer:
2505 ::fidl_next::encoder::InternalHandleEncoder,
2506 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2507 {
2508 self.log_many_with(crate::generic::LogListenerSafeLogManyRequest { log })
2509 }
2510
2511 #[doc = " Called when serving cached logs.\n\n Max logs size per call is `MAX_LOG_MANY_SIZE_BYTES` bytes.\n\n The return value is used for flow control, and implementers should acknowledge receipt of\n each batch in order to continue receiving future messages.\n"]
2512 pub fn log_many_with<___R>(
2513 &self,
2514 request: ___R,
2515 ) -> ::fidl_next::TwoWayFuture<'_, super::LogMany, ___T>
2516 where
2517 ___R: ::fidl_next::Encode<
2518 crate::wire::LogListenerSafeLogManyRequest<'static>,
2519 <___T as ::fidl_next::Transport>::SendBuffer,
2520 >,
2521 {
2522 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2523 139706434677727850,
2524 <super::LogMany as ::fidl_next::Method>::FLEXIBILITY,
2525 request,
2526 ))
2527 }
2528
2529 #[doc = " Called when this listener was passed to `DumpLogsSafe()` and all cached logs have been sent.\n"]
2530 pub fn done(&self) -> ::fidl_next::SendFuture<'_, ___T> {
2531 ::fidl_next::SendFuture::from_untyped(
2532 self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
2533 3789886091192272056,
2534 <super::Done as ::fidl_next::Method>::FLEXIBILITY,
2535 (),
2536 ),
2537 )
2538 }
2539 }
2540
2541 #[repr(transparent)]
2543 pub struct LogListenerSafeServer<___T: ::fidl_next::Transport> {
2544 server: ::fidl_next::protocol::Server<___T>,
2545 }
2546
2547 impl<___T> LogListenerSafeServer<___T> where ___T: ::fidl_next::Transport {}
2548 }
2549}
2550
2551#[diagnostic::on_unimplemented(
2552 note = "If {Self} implements the non-local LogListenerSafeClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2553)]
2554
2555pub trait LogListenerSafeLocalClientHandler<
2559 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2560 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2561>
2562{
2563}
2564
2565impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for LogListenerSafe
2566where
2567 ___H: LogListenerSafeLocalClientHandler<___T>,
2568 ___T: ::fidl_next::Transport,
2569{
2570 async fn on_event(
2571 handler: &mut ___H,
2572 mut message: ::fidl_next::Message<___T>,
2573 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2574 match *message.header().ordinal {
2575 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2576 }
2577 }
2578}
2579
2580#[diagnostic::on_unimplemented(
2581 note = "If {Self} implements the non-local LogListenerSafeServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2582)]
2583
2584pub trait LogListenerSafeLocalServerHandler<
2588 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2589 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2590>
2591{
2592 #[doc = " Called for single messages.\n\n The return value is used for flow control, and implementers should acknowledge receipt of\n each message in order to continue receiving future messages.\n"]
2593 fn log(
2594 &mut self,
2595
2596 request: ::fidl_next::Request<log_listener_safe::Log, ___T>,
2597
2598 responder: ::fidl_next::Responder<log_listener_safe::Log, ___T>,
2599 ) -> impl ::core::future::Future<Output = ()>;
2600
2601 #[doc = " Called when serving cached logs.\n\n Max logs size per call is `MAX_LOG_MANY_SIZE_BYTES` bytes.\n\n The return value is used for flow control, and implementers should acknowledge receipt of\n each batch in order to continue receiving future messages.\n"]
2602 fn log_many(
2603 &mut self,
2604
2605 request: ::fidl_next::Request<log_listener_safe::LogMany, ___T>,
2606
2607 responder: ::fidl_next::Responder<log_listener_safe::LogMany, ___T>,
2608 ) -> impl ::core::future::Future<Output = ()>;
2609
2610 #[doc = " Called when this listener was passed to `DumpLogsSafe()` and all cached logs have been sent.\n"]
2611 fn done(&mut self) -> impl ::core::future::Future<Output = ()>;
2612}
2613
2614impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for LogListenerSafe
2615where
2616 ___H: LogListenerSafeLocalServerHandler<___T>,
2617 ___T: ::fidl_next::Transport,
2618 for<'de> crate::wire::LogListenerSafeLogRequest<'de>: ::fidl_next::Decode<
2619 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2620 Constraint = (),
2621 >,
2622 for<'de> crate::wire::LogListenerSafeLogManyRequest<'de>: ::fidl_next::Decode<
2623 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2624 Constraint = (),
2625 >,
2626{
2627 async fn on_one_way(
2628 handler: &mut ___H,
2629 mut message: ::fidl_next::Message<___T>,
2630 ) -> ::core::result::Result<
2631 (),
2632 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2633 > {
2634 match *message.header().ordinal {
2635 3789886091192272056 => {
2636 handler.done().await;
2637 Ok(())
2638 }
2639
2640 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2641 }
2642 }
2643
2644 async fn on_two_way(
2645 handler: &mut ___H,
2646 mut message: ::fidl_next::Message<___T>,
2647 responder: ::fidl_next::protocol::Responder<___T>,
2648 ) -> ::core::result::Result<
2649 (),
2650 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2651 > {
2652 match *message.header().ordinal {
2653 5882719137999207690 => {
2654 let responder = ::fidl_next::Responder::from_untyped(responder);
2655
2656 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2657 Ok(decoded) => {
2658 handler.log(::fidl_next::Request::from_decoded(decoded), responder).await;
2659 Ok(())
2660 }
2661 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2662 ordinal: 5882719137999207690,
2663 error,
2664 }),
2665 }
2666 }
2667
2668 139706434677727850 => {
2669 let responder = ::fidl_next::Responder::from_untyped(responder);
2670
2671 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2672 Ok(decoded) => {
2673 handler
2674 .log_many(::fidl_next::Request::from_decoded(decoded), responder)
2675 .await;
2676 Ok(())
2677 }
2678 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2679 ordinal: 139706434677727850,
2680 error,
2681 }),
2682 }
2683 }
2684
2685 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2686 }
2687 }
2688}
2689
2690pub trait LogListenerSafeClientHandler<
2694 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2695 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2696>
2697{
2698}
2699
2700impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for LogListenerSafe
2701where
2702 ___H: LogListenerSafeClientHandler<___T> + ::core::marker::Send,
2703 ___T: ::fidl_next::Transport,
2704{
2705 async fn on_event(
2706 handler: &mut ___H,
2707 mut message: ::fidl_next::Message<___T>,
2708 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2709 match *message.header().ordinal {
2710 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2711 }
2712 }
2713}
2714
2715pub trait LogListenerSafeServerHandler<
2719 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2720 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2721>
2722{
2723 #[doc = " Called for single messages.\n\n The return value is used for flow control, and implementers should acknowledge receipt of\n each message in order to continue receiving future messages.\n"]
2724 fn log(
2725 &mut self,
2726
2727 request: ::fidl_next::Request<log_listener_safe::Log, ___T>,
2728
2729 responder: ::fidl_next::Responder<log_listener_safe::Log, ___T>,
2730 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2731
2732 #[doc = " Called when serving cached logs.\n\n Max logs size per call is `MAX_LOG_MANY_SIZE_BYTES` bytes.\n\n The return value is used for flow control, and implementers should acknowledge receipt of\n each batch in order to continue receiving future messages.\n"]
2733 fn log_many(
2734 &mut self,
2735
2736 request: ::fidl_next::Request<log_listener_safe::LogMany, ___T>,
2737
2738 responder: ::fidl_next::Responder<log_listener_safe::LogMany, ___T>,
2739 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2740
2741 #[doc = " Called when this listener was passed to `DumpLogsSafe()` and all cached logs have been sent.\n"]
2742 fn done(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2743}
2744
2745impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for LogListenerSafe
2746where
2747 ___H: LogListenerSafeServerHandler<___T> + ::core::marker::Send,
2748 ___T: ::fidl_next::Transport,
2749 for<'de> crate::wire::LogListenerSafeLogRequest<'de>: ::fidl_next::Decode<
2750 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2751 Constraint = (),
2752 >,
2753 for<'de> crate::wire::LogListenerSafeLogManyRequest<'de>: ::fidl_next::Decode<
2754 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2755 Constraint = (),
2756 >,
2757{
2758 async fn on_one_way(
2759 handler: &mut ___H,
2760 mut message: ::fidl_next::Message<___T>,
2761 ) -> ::core::result::Result<
2762 (),
2763 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2764 > {
2765 match *message.header().ordinal {
2766 3789886091192272056 => {
2767 handler.done().await;
2768 Ok(())
2769 }
2770
2771 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2772 }
2773 }
2774
2775 async fn on_two_way(
2776 handler: &mut ___H,
2777 mut message: ::fidl_next::Message<___T>,
2778 responder: ::fidl_next::protocol::Responder<___T>,
2779 ) -> ::core::result::Result<
2780 (),
2781 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2782 > {
2783 match *message.header().ordinal {
2784 5882719137999207690 => {
2785 let responder = ::fidl_next::Responder::from_untyped(responder);
2786
2787 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2788 Ok(decoded) => {
2789 handler.log(::fidl_next::Request::from_decoded(decoded), responder).await;
2790 Ok(())
2791 }
2792 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2793 ordinal: 5882719137999207690,
2794 error,
2795 }),
2796 }
2797 }
2798
2799 139706434677727850 => {
2800 let responder = ::fidl_next::Responder::from_untyped(responder);
2801
2802 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2803 Ok(decoded) => {
2804 handler
2805 .log_many(::fidl_next::Request::from_decoded(decoded), responder)
2806 .await;
2807 Ok(())
2808 }
2809 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2810 ordinal: 139706434677727850,
2811 error,
2812 }),
2813 }
2814 }
2815
2816 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2817 }
2818 }
2819}
2820
2821impl<___T> LogListenerSafeClientHandler<___T> for ::fidl_next::IgnoreEvents where
2822 ___T: ::fidl_next::Transport
2823{
2824}
2825
2826impl<___H, ___T> LogListenerSafeLocalClientHandler<___T> for ::fidl_next::Local<___H>
2827where
2828 ___H: LogListenerSafeClientHandler<___T>,
2829 ___T: ::fidl_next::Transport,
2830{
2831}
2832
2833impl<___H, ___T> LogListenerSafeLocalServerHandler<___T> for ::fidl_next::Local<___H>
2834where
2835 ___H: LogListenerSafeServerHandler<___T>,
2836 ___T: ::fidl_next::Transport,
2837{
2838 async fn log(
2839 &mut self,
2840
2841 request: ::fidl_next::Request<log_listener_safe::Log, ___T>,
2842
2843 responder: ::fidl_next::Responder<log_listener_safe::Log, ___T>,
2844 ) {
2845 ___H::log(&mut self.0, request, responder).await
2846 }
2847
2848 async fn log_many(
2849 &mut self,
2850
2851 request: ::fidl_next::Request<log_listener_safe::LogMany, ___T>,
2852
2853 responder: ::fidl_next::Responder<log_listener_safe::LogMany, ___T>,
2854 ) {
2855 ___H::log_many(&mut self.0, request, responder).await
2856 }
2857
2858 async fn done(&mut self) {
2859 ___H::done(&mut self.0).await
2860 }
2861}
2862
2863#[doc = " Max log bytes per call to a listener.\n"]
2864pub const MAX_LOG_MANY_SIZE_BYTES: u64 = 16384 as u64;