1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 pub use fidl_next_common_fuchsia_logger::natural::*;
8
9 #[derive(Debug, PartialEq)]
10 pub struct LogListenSafeRequest {
11 pub log_listener:
12 ::fidl_next::ClientEnd<crate::LogListenerSafe, ::fidl_next::fuchsia::zx::Channel>,
13
14 pub options: ::core::option::Option<::std::boxed::Box<crate::natural::LogFilterOptions>>,
15 }
16
17 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LogListenSafeRequest<'static>, ___E>
18 for LogListenSafeRequest
19 where
20 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21 ___E: ::fidl_next::Encoder,
22 ___E: ::fidl_next::fuchsia::HandleEncoder,
23 {
24 #[inline]
25 fn encode(
26 self,
27 encoder_: &mut ___E,
28 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogListenSafeRequest<'static>>,
29 _: (),
30 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
31 ::fidl_next::munge! {
32 let crate::wire::LogListenSafeRequest {
33 log_listener,
34 options,
35
36 } = out_;
37 }
38
39 ::fidl_next::Encode::encode(self.log_listener, encoder_, log_listener, ())?;
40
41 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(log_listener.as_mut_ptr()) };
42
43 ::fidl_next::Encode::encode(self.options, encoder_, options, ())?;
44
45 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(options.as_mut_ptr()) };
46
47 Ok(())
48 }
49 }
50
51 unsafe impl<___E>
52 ::fidl_next::EncodeOption<
53 ::fidl_next::wire::Box<'static, crate::wire::LogListenSafeRequest<'static>>,
54 ___E,
55 > for LogListenSafeRequest
56 where
57 ___E: ::fidl_next::Encoder + ?Sized,
58 LogListenSafeRequest: ::fidl_next::Encode<crate::wire::LogListenSafeRequest<'static>, ___E>,
59 {
60 #[inline]
61 fn encode_option(
62 this: ::core::option::Option<Self>,
63 encoder: &mut ___E,
64 out: &mut ::core::mem::MaybeUninit<
65 ::fidl_next::wire::Box<'static, crate::wire::LogListenSafeRequest<'static>>,
66 >,
67 _: (),
68 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
69 if let Some(inner) = this {
70 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
71 ::fidl_next::wire::Box::encode_present(out);
72 } else {
73 ::fidl_next::wire::Box::encode_absent(out);
74 }
75
76 Ok(())
77 }
78 }
79
80 impl<'de> ::fidl_next::FromWire<crate::wire::LogListenSafeRequest<'de>> for LogListenSafeRequest {
81 #[inline]
82 fn from_wire(wire: crate::wire::LogListenSafeRequest<'de>) -> Self {
83 Self {
84 log_listener: ::fidl_next::FromWire::from_wire(wire.log_listener),
85
86 options: ::fidl_next::FromWire::from_wire(wire.options),
87 }
88 }
89 }
90
91 #[derive(Debug, Default, PartialEq)]
92 pub struct LogSinkOnInitRequest {
93 pub buffer: ::core::option::Option<::fidl_next::fuchsia::zx::Iob>,
94
95 pub interest:
96 ::core::option::Option<::fidl_next_fuchsia_diagnostics_types::natural::Interest>,
97 }
98
99 impl LogSinkOnInitRequest {
100 fn __max_ordinal(&self) -> usize {
101 if self.interest.is_some() {
102 return 2;
103 }
104
105 if self.buffer.is_some() {
106 return 1;
107 }
108
109 0
110 }
111 }
112
113 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LogSinkOnInitRequest<'static>, ___E>
114 for LogSinkOnInitRequest
115 where
116 ___E: ::fidl_next::Encoder + ?Sized,
117 ___E: ::fidl_next::fuchsia::HandleEncoder,
118 {
119 #[inline]
120 fn encode(
121 mut self,
122 encoder: &mut ___E,
123 out: &mut ::core::mem::MaybeUninit<crate::wire::LogSinkOnInitRequest<'static>>,
124 _: (),
125 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
126 ::fidl_next::munge!(let crate::wire::LogSinkOnInitRequest { table } = out);
127
128 let max_ord = self.__max_ordinal();
129
130 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
131 ::fidl_next::Wire::zero_padding(&mut out);
132
133 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
134 ::fidl_next::wire::Envelope,
135 >(encoder, max_ord);
136
137 for i in 1..=max_ord {
138 match i {
139 2 => {
140 if let Some(value) = self.interest.take() {
141 ::fidl_next::wire::Envelope::encode_value::<
142 ::fidl_next_fuchsia_diagnostics_types::wire::Interest<'static>,
143 ___E,
144 >(
145 value, preallocated.encoder, &mut out, ()
146 )?;
147 } else {
148 ::fidl_next::wire::Envelope::encode_zero(&mut out)
149 }
150 }
151
152 1 => {
153 if let Some(value) = self.buffer.take() {
154 ::fidl_next::wire::Envelope::encode_value::<
155 ::fidl_next::wire::fuchsia::Iob,
156 ___E,
157 >(
158 value, preallocated.encoder, &mut out, ()
159 )?;
160 } else {
161 ::fidl_next::wire::Envelope::encode_zero(&mut out)
162 }
163 }
164
165 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
166 }
167 unsafe {
168 preallocated.write_next(out.assume_init_ref());
169 }
170 }
171
172 ::fidl_next::wire::Table::encode_len(table, max_ord);
173
174 Ok(())
175 }
176 }
177
178 impl<'de> ::fidl_next::FromWire<crate::wire::LogSinkOnInitRequest<'de>> for LogSinkOnInitRequest {
179 #[inline]
180 fn from_wire(wire_: crate::wire::LogSinkOnInitRequest<'de>) -> Self {
181 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
182
183 let buffer = wire_.table.get(1);
184
185 let interest = wire_.table.get(2);
186
187 Self {
188
189
190 buffer: buffer.map(|envelope| ::fidl_next::FromWire::from_wire(
191 unsafe { envelope.read_unchecked::<::fidl_next::wire::fuchsia::Iob>() }
192 )),
193
194
195 interest: interest.map(|envelope| ::fidl_next::FromWire::from_wire(
196 unsafe { envelope.read_unchecked::<::fidl_next_fuchsia_diagnostics_types::wire::Interest<'de>>() }
197 )),
198
199 }
200 }
201 }
202
203 #[derive(Debug, PartialEq)]
204 #[repr(C)]
205 pub struct LogSinkConnectStructuredRequest {
206 pub socket: ::fidl_next::fuchsia::zx::Socket,
207 }
208
209 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LogSinkConnectStructuredRequest, ___E>
210 for LogSinkConnectStructuredRequest
211 where
212 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
213 ___E: ::fidl_next::fuchsia::HandleEncoder,
214 {
215 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
216 Self,
217 crate::wire::LogSinkConnectStructuredRequest,
218 > = unsafe {
219 ::fidl_next::CopyOptimization::enable_if(
220 true && <::fidl_next::fuchsia::zx::Socket as ::fidl_next::Encode<
221 ::fidl_next::wire::fuchsia::Socket,
222 ___E,
223 >>::COPY_OPTIMIZATION
224 .is_enabled(),
225 )
226 };
227
228 #[inline]
229 fn encode(
230 self,
231 encoder_: &mut ___E,
232 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogSinkConnectStructuredRequest>,
233 _: (),
234 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
235 ::fidl_next::munge! {
236 let crate::wire::LogSinkConnectStructuredRequest {
237 socket,
238
239 } = out_;
240 }
241
242 ::fidl_next::Encode::encode(self.socket, encoder_, socket, ())?;
243
244 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(socket.as_mut_ptr()) };
245
246 Ok(())
247 }
248 }
249
250 unsafe impl<___E>
251 ::fidl_next::EncodeOption<
252 ::fidl_next::wire::Box<'static, crate::wire::LogSinkConnectStructuredRequest>,
253 ___E,
254 > for LogSinkConnectStructuredRequest
255 where
256 ___E: ::fidl_next::Encoder + ?Sized,
257 LogSinkConnectStructuredRequest:
258 ::fidl_next::Encode<crate::wire::LogSinkConnectStructuredRequest, ___E>,
259 {
260 #[inline]
261 fn encode_option(
262 this: ::core::option::Option<Self>,
263 encoder: &mut ___E,
264 out: &mut ::core::mem::MaybeUninit<
265 ::fidl_next::wire::Box<'static, crate::wire::LogSinkConnectStructuredRequest>,
266 >,
267 _: (),
268 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
269 if let Some(inner) = this {
270 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
271 ::fidl_next::wire::Box::encode_present(out);
272 } else {
273 ::fidl_next::wire::Box::encode_absent(out);
274 }
275
276 Ok(())
277 }
278 }
279
280 impl ::fidl_next::FromWire<crate::wire::LogSinkConnectStructuredRequest>
281 for LogSinkConnectStructuredRequest
282 {
283 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
284 crate::wire::LogSinkConnectStructuredRequest,
285 Self,
286 > = unsafe {
287 ::fidl_next::CopyOptimization::enable_if(
288 true && <::fidl_next::fuchsia::zx::Socket as ::fidl_next::FromWire<
289 ::fidl_next::wire::fuchsia::Socket,
290 >>::COPY_OPTIMIZATION
291 .is_enabled(),
292 )
293 };
294
295 #[inline]
296 fn from_wire(wire: crate::wire::LogSinkConnectStructuredRequest) -> Self {
297 Self { socket: ::fidl_next::FromWire::from_wire(wire.socket) }
298 }
299 }
300}
301
302pub mod wire {
303
304 pub use fidl_next_common_fuchsia_logger::wire::*;
305
306 #[derive(Debug)]
308 #[repr(C)]
309 pub struct LogListenSafeRequest<'de> {
310 pub log_listener:
311 ::fidl_next::ClientEnd<crate::LogListenerSafe, ::fidl_next::wire::fuchsia::Channel>,
312
313 pub options: ::fidl_next::wire::Box<'de, crate::wire::LogFilterOptions<'de>>,
314 }
315
316 static_assertions::const_assert_eq!(std::mem::size_of::<LogListenSafeRequest<'_>>(), 16);
317 static_assertions::const_assert_eq!(std::mem::align_of::<LogListenSafeRequest<'_>>(), 8);
318
319 static_assertions::const_assert_eq!(
320 std::mem::offset_of!(LogListenSafeRequest<'_>, log_listener),
321 0
322 );
323
324 static_assertions::const_assert_eq!(std::mem::offset_of!(LogListenSafeRequest<'_>, options), 8);
325
326 impl ::fidl_next::Constrained for LogListenSafeRequest<'_> {
327 type Constraint = ();
328
329 fn validate(
330 _: ::fidl_next::Slot<'_, Self>,
331 _: Self::Constraint,
332 ) -> Result<(), ::fidl_next::ValidationError> {
333 Ok(())
334 }
335 }
336
337 unsafe impl ::fidl_next::Wire for LogListenSafeRequest<'static> {
338 type Narrowed<'de> = LogListenSafeRequest<'de>;
339
340 #[inline]
341 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
342 ::fidl_next::munge! {
343 let Self {
344 log_listener,
345 options,
346
347 } = &mut *out_;
348 }
349
350 ::fidl_next::Wire::zero_padding(log_listener);
351
352 ::fidl_next::Wire::zero_padding(options);
353
354 unsafe {
355 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
356 }
357 }
358 }
359
360 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogListenSafeRequest<'de>
361 where
362 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
363 ___D: ::fidl_next::Decoder<'de>,
364 ___D: ::fidl_next::fuchsia::HandleDecoder,
365 {
366 fn decode(
367 slot_: ::fidl_next::Slot<'_, Self>,
368 decoder_: &mut ___D,
369 _: (),
370 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
371 if slot_.as_bytes()[4..8] != [0u8; 4] {
372 return Err(::fidl_next::DecodeError::InvalidPadding);
373 }
374
375 ::fidl_next::munge! {
376 let Self {
377 mut log_listener,
378 mut options,
379
380 } = slot_;
381 }
382
383 let _field = log_listener.as_mut();
384
385 ::fidl_next::Decode::decode(log_listener.as_mut(), decoder_, ())?;
386
387 let _field = options.as_mut();
388
389 ::fidl_next::Decode::decode(options.as_mut(), decoder_, ())?;
390
391 Ok(())
392 }
393 }
394
395 impl<'de> ::fidl_next::IntoNatural for LogListenSafeRequest<'de> {
396 type Natural = crate::natural::LogListenSafeRequest;
397 }
398
399 #[repr(C)]
401 pub struct LogSinkOnInitRequest<'de> {
402 pub(crate) table: ::fidl_next::wire::Table<'de>,
403 }
404
405 impl<'de> Drop for LogSinkOnInitRequest<'de> {
406 fn drop(&mut self) {
407 let _ = self.table.get(1).map(|envelope| unsafe {
408 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Iob>()
409 });
410
411 let _ = self.table.get(2)
412 .map(|envelope| unsafe {
413 envelope.read_unchecked::<::fidl_next_fuchsia_diagnostics_types::wire::Interest<'de>>()
414 });
415 }
416 }
417
418 impl ::fidl_next::Constrained for LogSinkOnInitRequest<'_> {
419 type Constraint = ();
420
421 fn validate(
422 _: ::fidl_next::Slot<'_, Self>,
423 _: Self::Constraint,
424 ) -> Result<(), ::fidl_next::ValidationError> {
425 Ok(())
426 }
427 }
428
429 unsafe impl ::fidl_next::Wire for LogSinkOnInitRequest<'static> {
430 type Narrowed<'de> = LogSinkOnInitRequest<'de>;
431
432 #[inline]
433 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
434 ::fidl_next::munge!(let Self { table } = out);
435 ::fidl_next::wire::Table::zero_padding(table);
436 }
437 }
438
439 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogSinkOnInitRequest<'de>
440 where
441 ___D: ::fidl_next::Decoder<'de> + ?Sized,
442 ___D: ::fidl_next::fuchsia::HandleDecoder,
443 {
444 fn decode(
445 slot: ::fidl_next::Slot<'_, Self>,
446 decoder: &mut ___D,
447 _: (),
448 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
449 ::fidl_next::munge!(let Self { table } = slot);
450
451 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
452 match ordinal {
453 0 => unsafe { ::core::hint::unreachable_unchecked() },
454
455 1 => {
456 ::fidl_next::wire::Envelope::decode_as::<
457 ___D,
458 ::fidl_next::wire::fuchsia::Iob,
459 >(slot.as_mut(), decoder, ())?;
460
461 Ok(())
462 }
463
464 2 => {
465 ::fidl_next::wire::Envelope::decode_as::<
466 ___D,
467 ::fidl_next_fuchsia_diagnostics_types::wire::Interest<'de>,
468 >(slot.as_mut(), decoder, ())?;
469
470 Ok(())
471 }
472
473 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
474 }
475 })
476 }
477 }
478
479 impl<'de> LogSinkOnInitRequest<'de> {
480 pub fn buffer(&self) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Iob> {
481 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
482 }
483
484 pub fn interest(
485 &self,
486 ) -> ::core::option::Option<&::fidl_next_fuchsia_diagnostics_types::wire::Interest<'de>>
487 {
488 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
489 }
490 }
491
492 impl<'de> ::core::fmt::Debug for LogSinkOnInitRequest<'de> {
493 fn fmt(
494 &self,
495 f: &mut ::core::fmt::Formatter<'_>,
496 ) -> ::core::result::Result<(), ::core::fmt::Error> {
497 f.debug_struct("LogSinkOnInitRequest")
498 .field("buffer", &self.buffer())
499 .field("interest", &self.interest())
500 .finish()
501 }
502 }
503
504 impl<'de> ::fidl_next::IntoNatural for LogSinkOnInitRequest<'de> {
505 type Natural = crate::natural::LogSinkOnInitRequest;
506 }
507
508 #[derive(Debug)]
510 #[repr(C)]
511 pub struct LogSinkConnectStructuredRequest {
512 pub socket: ::fidl_next::wire::fuchsia::Socket,
513 }
514
515 static_assertions::const_assert_eq!(std::mem::size_of::<LogSinkConnectStructuredRequest>(), 4);
516 static_assertions::const_assert_eq!(std::mem::align_of::<LogSinkConnectStructuredRequest>(), 4);
517
518 static_assertions::const_assert_eq!(
519 std::mem::offset_of!(LogSinkConnectStructuredRequest, socket),
520 0
521 );
522
523 impl ::fidl_next::Constrained for LogSinkConnectStructuredRequest {
524 type Constraint = ();
525
526 fn validate(
527 _: ::fidl_next::Slot<'_, Self>,
528 _: Self::Constraint,
529 ) -> Result<(), ::fidl_next::ValidationError> {
530 Ok(())
531 }
532 }
533
534 unsafe impl ::fidl_next::Wire for LogSinkConnectStructuredRequest {
535 type Narrowed<'de> = LogSinkConnectStructuredRequest;
536
537 #[inline]
538 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
539 ::fidl_next::munge! {
540 let Self {
541 socket,
542
543 } = &mut *out_;
544 }
545
546 ::fidl_next::Wire::zero_padding(socket);
547 }
548 }
549
550 unsafe impl<___D> ::fidl_next::Decode<___D> for LogSinkConnectStructuredRequest
551 where
552 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
553 ___D: ::fidl_next::fuchsia::HandleDecoder,
554 {
555 fn decode(
556 slot_: ::fidl_next::Slot<'_, Self>,
557 decoder_: &mut ___D,
558 _: (),
559 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
560 ::fidl_next::munge! {
561 let Self {
562 mut socket,
563
564 } = slot_;
565 }
566
567 let _field = socket.as_mut();
568
569 ::fidl_next::Decode::decode(socket.as_mut(), decoder_, ())?;
570
571 Ok(())
572 }
573 }
574
575 impl ::fidl_next::IntoNatural for LogSinkConnectStructuredRequest {
576 type Natural = crate::natural::LogSinkConnectStructuredRequest;
577 }
578}
579
580pub mod wire_optional {
581
582 pub use fidl_next_common_fuchsia_logger::wire_optional::*;
583}
584
585pub mod generic {
586
587 pub use fidl_next_common_fuchsia_logger::generic::*;
588
589 pub struct LogListenSafeRequest<T0, T1> {
591 pub log_listener: T0,
592
593 pub options: T1,
594 }
595
596 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::LogListenSafeRequest<'static>, ___E>
597 for LogListenSafeRequest<T0, T1>
598 where
599 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
600 ___E: ::fidl_next::Encoder,
601 ___E: ::fidl_next::fuchsia::HandleEncoder,
602 T0: ::fidl_next::Encode<
603 ::fidl_next::ClientEnd<crate::LogListenerSafe, ::fidl_next::wire::fuchsia::Channel>,
604 ___E,
605 >,
606 T1: ::fidl_next::Encode<
607 ::fidl_next::wire::Box<'static, crate::wire::LogFilterOptions<'static>>,
608 ___E,
609 >,
610 {
611 #[inline]
612 fn encode(
613 self,
614 encoder_: &mut ___E,
615 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogListenSafeRequest<'static>>,
616 _: (),
617 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
618 ::fidl_next::munge! {
619 let crate::wire::LogListenSafeRequest {
620 log_listener,
621 options,
622
623 } = out_;
624 }
625
626 ::fidl_next::Encode::encode(self.log_listener, encoder_, log_listener, ())?;
627
628 ::fidl_next::Encode::encode(self.options, encoder_, options, ())?;
629
630 Ok(())
631 }
632 }
633
634 pub struct LogSinkConnectStructuredRequest<T0> {
636 pub socket: T0,
637 }
638
639 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::LogSinkConnectStructuredRequest, ___E>
640 for LogSinkConnectStructuredRequest<T0>
641 where
642 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
643 ___E: ::fidl_next::fuchsia::HandleEncoder,
644 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Socket, ___E>,
645 {
646 #[inline]
647 fn encode(
648 self,
649 encoder_: &mut ___E,
650 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogSinkConnectStructuredRequest>,
651 _: (),
652 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
653 ::fidl_next::munge! {
654 let crate::wire::LogSinkConnectStructuredRequest {
655 socket,
656
657 } = out_;
658 }
659
660 ::fidl_next::Encode::encode(self.socket, encoder_, socket, ())?;
661
662 Ok(())
663 }
664 }
665}
666
667pub use self::natural::*;
668
669#[doc = " Interface for LogListenerSafe to register to listen to logs.\n"]
671#[derive(PartialEq, Debug)]
672pub struct Log;
673
674impl ::fidl_next::Discoverable for Log {
675 const PROTOCOL_NAME: &'static str = "fuchsia.logger.Log";
676}
677
678#[cfg(target_os = "fuchsia")]
679impl ::fidl_next::HasTransport for Log {
680 type Transport = ::fidl_next::fuchsia::zx::Channel;
681}
682
683pub mod log {
684 pub mod prelude {
685 pub use crate::{
686 Log, LogClientHandler, LogLocalClientHandler, LogLocalServerHandler, LogServerHandler,
687 log,
688 };
689
690 pub use crate::natural::LogListenSafeRequest;
691 }
692
693 pub struct ListenSafe;
694
695 impl ::fidl_next::Method for ListenSafe {
696 const ORDINAL: u64 = 5643638173917143473;
697 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
698 ::fidl_next::protocol::Flexibility::Strict;
699
700 type Protocol = crate::Log;
701
702 type Request = crate::wire::LogListenSafeRequest<'static>;
703 }
704
705 mod ___detail {
706 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Log
707 where
708 ___T: ::fidl_next::Transport,
709 {
710 type Client = LogClient<___T>;
711 type Server = LogServer<___T>;
712 }
713
714 #[repr(transparent)]
716 pub struct LogClient<___T: ::fidl_next::Transport> {
717 #[allow(dead_code)]
718 client: ::fidl_next::protocol::Client<___T>,
719 }
720
721 impl<___T> LogClient<___T>
722 where
723 ___T: ::fidl_next::Transport,
724 {
725 #[doc = " Dumps all cached logs by calling LogMany() in batches followed by Log() for each new log\n message.\n A null `options` indicates no filtering is requested.\n"]
726 pub fn listen_safe(
727 &self,
728
729 log_listener: impl ::fidl_next::Encode<
730 ::fidl_next::ClientEnd<
731 crate::LogListenerSafe,
732 ::fidl_next::wire::fuchsia::Channel,
733 >,
734 <___T as ::fidl_next::Transport>::SendBuffer,
735 >,
736
737 options: impl ::fidl_next::Encode<
738 ::fidl_next::wire::Box<'static, crate::wire::LogFilterOptions<'static>>,
739 <___T as ::fidl_next::Transport>::SendBuffer,
740 >,
741 ) -> ::fidl_next::SendFuture<'_, ___T>
742 where
743 <___T as ::fidl_next::Transport>::SendBuffer:
744 ::fidl_next::encoder::InternalHandleEncoder,
745 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
746 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
747 {
748 self.listen_safe_with(crate::generic::LogListenSafeRequest {
749 log_listener,
750
751 options,
752 })
753 }
754
755 #[doc = " Dumps all cached logs by calling LogMany() in batches followed by Log() for each new log\n message.\n A null `options` indicates no filtering is requested.\n"]
756 pub fn listen_safe_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
757 where
758 ___R: ::fidl_next::Encode<
759 crate::wire::LogListenSafeRequest<'static>,
760 <___T as ::fidl_next::Transport>::SendBuffer,
761 >,
762 {
763 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
764 5643638173917143473,
765 <super::ListenSafe as ::fidl_next::Method>::FLEXIBILITY,
766 request,
767 ))
768 }
769 }
770
771 #[repr(transparent)]
773 pub struct LogServer<___T: ::fidl_next::Transport> {
774 server: ::fidl_next::protocol::Server<___T>,
775 }
776
777 impl<___T> LogServer<___T> where ___T: ::fidl_next::Transport {}
778 }
779}
780
781#[diagnostic::on_unimplemented(
782 note = "If {Self} implements the non-local LogClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
783)]
784
785pub trait LogLocalClientHandler<
789 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
790 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
791>
792{
793}
794
795impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Log
796where
797 ___H: LogLocalClientHandler<___T>,
798 ___T: ::fidl_next::Transport,
799{
800 async fn on_event(
801 handler: &mut ___H,
802 ordinal: u64,
803 flexibility: ::fidl_next::protocol::Flexibility,
804 body: ::fidl_next::Body<___T>,
805 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
806 match ordinal {
807 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
808 }
809 }
810}
811
812#[diagnostic::on_unimplemented(
813 note = "If {Self} implements the non-local LogServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
814)]
815
816pub trait LogLocalServerHandler<
820 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
821 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
822>
823{
824 #[doc = " Dumps all cached logs by calling LogMany() in batches followed by Log() for each new log\n message.\n A null `options` indicates no filtering is requested.\n"]
825 fn listen_safe(
826 &mut self,
827
828 request: ::fidl_next::Request<log::ListenSafe, ___T>,
829 ) -> impl ::core::future::Future<Output = ()>;
830}
831
832impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Log
833where
834 ___H: LogLocalServerHandler<___T>,
835 ___T: ::fidl_next::Transport,
836 for<'de> crate::wire::LogListenSafeRequest<'de>: ::fidl_next::Decode<
837 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
838 Constraint = (),
839 >,
840{
841 async fn on_one_way(
842 handler: &mut ___H,
843 ordinal: u64,
844 flexibility: ::fidl_next::protocol::Flexibility,
845 body: ::fidl_next::Body<___T>,
846 ) -> ::core::result::Result<
847 (),
848 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
849 > {
850 match ordinal {
851 5643638173917143473 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
852 Ok(decoded) => {
853 handler.listen_safe(::fidl_next::Request::from_decoded(decoded)).await;
854 Ok(())
855 }
856 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
857 ordinal: 5643638173917143473,
858 error,
859 }),
860 },
861
862 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
863 }
864 }
865
866 async fn on_two_way(
867 handler: &mut ___H,
868 ordinal: u64,
869 flexibility: ::fidl_next::protocol::Flexibility,
870 body: ::fidl_next::Body<___T>,
871 responder: ::fidl_next::protocol::Responder<___T>,
872 ) -> ::core::result::Result<
873 (),
874 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
875 > {
876 match ordinal {
877 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
878 }
879 }
880}
881
882pub trait LogClientHandler<
886 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
887 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
888>
889{
890}
891
892impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Log
893where
894 ___H: LogClientHandler<___T> + ::core::marker::Send,
895 ___T: ::fidl_next::Transport,
896{
897 async fn on_event(
898 handler: &mut ___H,
899 ordinal: u64,
900 flexibility: ::fidl_next::protocol::Flexibility,
901 body: ::fidl_next::Body<___T>,
902 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
903 match ordinal {
904 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
905 }
906 }
907}
908
909pub trait LogServerHandler<
913 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
914 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
915>
916{
917 #[doc = " Dumps all cached logs by calling LogMany() in batches followed by Log() for each new log\n message.\n A null `options` indicates no filtering is requested.\n"]
918 fn listen_safe(
919 &mut self,
920
921 request: ::fidl_next::Request<log::ListenSafe, ___T>,
922 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
923}
924
925impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Log
926where
927 ___H: LogServerHandler<___T> + ::core::marker::Send,
928 ___T: ::fidl_next::Transport,
929 for<'de> crate::wire::LogListenSafeRequest<'de>: ::fidl_next::Decode<
930 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
931 Constraint = (),
932 >,
933{
934 async fn on_one_way(
935 handler: &mut ___H,
936 ordinal: u64,
937 flexibility: ::fidl_next::protocol::Flexibility,
938 body: ::fidl_next::Body<___T>,
939 ) -> ::core::result::Result<
940 (),
941 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
942 > {
943 match ordinal {
944 5643638173917143473 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
945 Ok(decoded) => {
946 handler.listen_safe(::fidl_next::Request::from_decoded(decoded)).await;
947 Ok(())
948 }
949 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
950 ordinal: 5643638173917143473,
951 error,
952 }),
953 },
954
955 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
956 }
957 }
958
959 async fn on_two_way(
960 handler: &mut ___H,
961 ordinal: u64,
962 flexibility: ::fidl_next::protocol::Flexibility,
963 body: ::fidl_next::Body<___T>,
964 responder: ::fidl_next::protocol::Responder<___T>,
965 ) -> ::core::result::Result<
966 (),
967 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
968 > {
969 match ordinal {
970 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
971 }
972 }
973}
974
975impl<___T> LogClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport {}
976
977impl<___H, ___T> LogLocalClientHandler<___T> for ::fidl_next::Local<___H>
978where
979 ___H: LogClientHandler<___T>,
980 ___T: ::fidl_next::Transport,
981{
982}
983
984impl<___H, ___T> LogLocalServerHandler<___T> for ::fidl_next::Local<___H>
985where
986 ___H: LogServerHandler<___T>,
987 ___T: ::fidl_next::Transport,
988{
989 async fn listen_safe(&mut self, request: ::fidl_next::Request<log::ListenSafe, ___T>) {
990 ___H::listen_safe(&mut self.0, request).await
991 }
992}
993
994#[doc = " Drains a program\'s logs.\n"]
996#[derive(PartialEq, Debug)]
997pub struct LogSink;
998
999impl ::fidl_next::Discoverable for LogSink {
1000 const PROTOCOL_NAME: &'static str = "fuchsia.logger.LogSink";
1001}
1002
1003#[cfg(target_os = "fuchsia")]
1004impl ::fidl_next::HasTransport for LogSink {
1005 type Transport = ::fidl_next::fuchsia::zx::Channel;
1006}
1007
1008pub mod log_sink {
1009 pub mod prelude {
1010 pub use crate::{
1011 LogSink, LogSinkClientHandler, LogSinkLocalClientHandler, LogSinkLocalServerHandler,
1012 LogSinkServerHandler, log_sink,
1013 };
1014
1015 pub use crate::natural::InterestChangeError;
1016
1017 pub use crate::natural::LogSinkConnectStructuredRequest;
1018
1019 pub use crate::natural::LogSinkOnInitRequest;
1020
1021 pub use crate::natural::LogSinkWaitForInterestChangeResponse;
1022 }
1023
1024 pub struct OnInit;
1025
1026 impl ::fidl_next::Method for OnInit {
1027 const ORDINAL: u64 = 7052827292487084730;
1028 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1029 ::fidl_next::protocol::Flexibility::Flexible;
1030
1031 type Protocol = crate::LogSink;
1032
1033 type Request = crate::wire::LogSinkOnInitRequest<'static>;
1034 }
1035
1036 pub struct WaitForInterestChange;
1037
1038 impl ::fidl_next::Method for WaitForInterestChange {
1039 const ORDINAL: u64 = 2138400952013124162;
1040 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1041 ::fidl_next::protocol::Flexibility::Strict;
1042
1043 type Protocol = crate::LogSink;
1044
1045 type Request = ::fidl_next::wire::EmptyMessageBody;
1046 }
1047
1048 impl ::fidl_next::TwoWayMethod for WaitForInterestChange {
1049 type Response = ::fidl_next::wire::Result<
1050 'static,
1051 crate::wire::LogSinkWaitForInterestChangeResponse<'static>,
1052 crate::wire::InterestChangeError,
1053 >;
1054 }
1055
1056 impl<___R> ::fidl_next::Respond<___R> for WaitForInterestChange {
1057 type Output = ::core::result::Result<
1058 crate::generic::LogSinkWaitForInterestChangeResponse<___R>,
1059 ::fidl_next::util::Never,
1060 >;
1061
1062 fn respond(response: ___R) -> Self::Output {
1063 ::core::result::Result::Ok(crate::generic::LogSinkWaitForInterestChangeResponse {
1064 data: response,
1065 })
1066 }
1067 }
1068
1069 impl<___R> ::fidl_next::RespondErr<___R> for WaitForInterestChange {
1070 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
1071
1072 fn respond_err(response: ___R) -> Self::Output {
1073 ::core::result::Result::Err(response)
1074 }
1075 }
1076
1077 pub struct ConnectStructured;
1078
1079 impl ::fidl_next::Method for ConnectStructured {
1080 const ORDINAL: u64 = 7157386067685058380;
1081 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1082 ::fidl_next::protocol::Flexibility::Strict;
1083
1084 type Protocol = crate::LogSink;
1085
1086 type Request = crate::wire::LogSinkConnectStructuredRequest;
1087 }
1088
1089 mod ___detail {
1090 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::LogSink
1091 where
1092 ___T: ::fidl_next::Transport,
1093 {
1094 type Client = LogSinkClient<___T>;
1095 type Server = LogSinkServer<___T>;
1096 }
1097
1098 #[repr(transparent)]
1100 pub struct LogSinkClient<___T: ::fidl_next::Transport> {
1101 #[allow(dead_code)]
1102 client: ::fidl_next::protocol::Client<___T>,
1103 }
1104
1105 impl<___T> LogSinkClient<___T>
1106 where
1107 ___T: ::fidl_next::Transport,
1108 {
1109 #[doc = " LogSink implementers will return to this hanging-get whenever the scope of\n their interest changes. Clients are expected to emit messages based on\n the registered Interest. In the event that an empty interest is\n conveyed, clients should emit messages based on their default\n e.g. compile time configuration. Each client may only poll this once at a time.\n Invoking WaitForInterestChange a second time before the first call returns will\n result in an error being returned.\n"]
1110 pub fn wait_for_interest_change(
1111 &self,
1112 ) -> ::fidl_next::TwoWayFuture<'_, super::WaitForInterestChange, ___T> {
1113 ::fidl_next::TwoWayFuture::from_untyped(
1114 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
1115 2138400952013124162,
1116 <super::WaitForInterestChange as ::fidl_next::Method>::FLEXIBILITY,
1117 (),
1118 ),
1119 )
1120 }
1121
1122 #[doc = " Send this socket to be drained, using the structured logs format.\n\n See [Encoding structured records](https://fuchsia.dev/fuchsia-src/reference/platform-spec/diagnostics/logs-encoding)\n for what is expected to be received over the socket.\n"]
1123 pub fn connect_structured(
1124 &self,
1125
1126 socket: impl ::fidl_next::Encode<
1127 ::fidl_next::wire::fuchsia::Socket,
1128 <___T as ::fidl_next::Transport>::SendBuffer,
1129 >,
1130 ) -> ::fidl_next::SendFuture<'_, ___T>
1131 where
1132 <___T as ::fidl_next::Transport>::SendBuffer:
1133 ::fidl_next::encoder::InternalHandleEncoder,
1134 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
1135 {
1136 self.connect_structured_with(crate::generic::LogSinkConnectStructuredRequest {
1137 socket,
1138 })
1139 }
1140
1141 #[doc = " Send this socket to be drained, using the structured logs format.\n\n See [Encoding structured records](https://fuchsia.dev/fuchsia-src/reference/platform-spec/diagnostics/logs-encoding)\n for what is expected to be received over the socket.\n"]
1142 pub fn connect_structured_with<___R>(
1143 &self,
1144 request: ___R,
1145 ) -> ::fidl_next::SendFuture<'_, ___T>
1146 where
1147 ___R: ::fidl_next::Encode<
1148 crate::wire::LogSinkConnectStructuredRequest,
1149 <___T as ::fidl_next::Transport>::SendBuffer,
1150 >,
1151 {
1152 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
1153 7157386067685058380,
1154 <super::ConnectStructured as ::fidl_next::Method>::FLEXIBILITY,
1155 request,
1156 ))
1157 }
1158 }
1159
1160 #[repr(transparent)]
1162 pub struct LogSinkServer<___T: ::fidl_next::Transport> {
1163 server: ::fidl_next::protocol::Server<___T>,
1164 }
1165
1166 impl<___T> LogSinkServer<___T>
1167 where
1168 ___T: ::fidl_next::Transport,
1169 {
1170 #[doc = " This event is sent whenever Archivist accepts a new connection. Clients may use\n the returned IOBuffer to write logs.\n"]
1171
1172 pub fn on_init_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
1173 where
1174 ___R: ::fidl_next::Encode<
1175 <super::OnInit as ::fidl_next::Method>::Request,
1176 <___T as ::fidl_next::Transport>::SendBuffer,
1177 >,
1178 {
1179 ::fidl_next::SendFuture::from_untyped(self.server.send_event(
1180 7052827292487084730,
1181 <super::OnInit as ::fidl_next::Method>::FLEXIBILITY,
1182 request,
1183 ))
1184 }
1185 }
1186 }
1187}
1188
1189#[diagnostic::on_unimplemented(
1190 note = "If {Self} implements the non-local LogSinkClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1191)]
1192
1193pub trait LogSinkLocalClientHandler<
1197 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1198 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1199>
1200{
1201 #[doc = " This event is sent whenever Archivist accepts a new connection. Clients may use\n the returned IOBuffer to write logs.\n"]
1202 fn on_init(
1203 &mut self,
1204
1205 request: ::fidl_next::Request<log_sink::OnInit, ___T>,
1206 ) -> impl ::core::future::Future<Output = ()>;
1207
1208 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1209 ::core::future::ready(())
1210 }
1211}
1212
1213impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for LogSink
1214where
1215 ___H: LogSinkLocalClientHandler<___T>,
1216 ___T: ::fidl_next::Transport,
1217 for<'de> crate::wire::LogSinkOnInitRequest<'de>: ::fidl_next::Decode<
1218 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1219 Constraint = (),
1220 >,
1221{
1222 async fn on_event(
1223 handler: &mut ___H,
1224 ordinal: u64,
1225 flexibility: ::fidl_next::protocol::Flexibility,
1226 body: ::fidl_next::Body<___T>,
1227 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1228 match ordinal {
1229 7052827292487084730 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
1230 Ok(decoded) => {
1231 handler.on_init(::fidl_next::Request::from_decoded(decoded)).await;
1232 Ok(())
1233 }
1234 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1235 ordinal: 7052827292487084730,
1236 error,
1237 }),
1238 },
1239
1240 ordinal => {
1241 handler.on_unknown_interaction(ordinal).await;
1242 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1243 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1244 } else {
1245 Ok(())
1246 }
1247 }
1248 }
1249 }
1250}
1251
1252#[diagnostic::on_unimplemented(
1253 note = "If {Self} implements the non-local LogSinkServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
1254)]
1255
1256pub trait LogSinkLocalServerHandler<
1260 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1261 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1262>
1263{
1264 #[doc = " LogSink implementers will return to this hanging-get whenever the scope of\n their interest changes. Clients are expected to emit messages based on\n the registered Interest. In the event that an empty interest is\n conveyed, clients should emit messages based on their default\n e.g. compile time configuration. Each client may only poll this once at a time.\n Invoking WaitForInterestChange a second time before the first call returns will\n result in an error being returned.\n"]
1265 fn wait_for_interest_change(
1266 &mut self,
1267
1268 responder: ::fidl_next::Responder<log_sink::WaitForInterestChange, ___T>,
1269 ) -> impl ::core::future::Future<Output = ()>;
1270
1271 #[doc = " Send this socket to be drained, using the structured logs format.\n\n See [Encoding structured records](https://fuchsia.dev/fuchsia-src/reference/platform-spec/diagnostics/logs-encoding)\n for what is expected to be received over the socket.\n"]
1272 fn connect_structured(
1273 &mut self,
1274
1275 request: ::fidl_next::Request<log_sink::ConnectStructured, ___T>,
1276 ) -> impl ::core::future::Future<Output = ()>;
1277
1278 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1279 ::core::future::ready(())
1280 }
1281}
1282
1283impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for LogSink
1284where
1285 ___H: LogSinkLocalServerHandler<___T>,
1286 ___T: ::fidl_next::Transport,
1287 for<'de> crate::wire::LogSinkConnectStructuredRequest: ::fidl_next::Decode<
1288 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1289 Constraint = (),
1290 >,
1291{
1292 async fn on_one_way(
1293 handler: &mut ___H,
1294 ordinal: u64,
1295 flexibility: ::fidl_next::protocol::Flexibility,
1296 body: ::fidl_next::Body<___T>,
1297 ) -> ::core::result::Result<
1298 (),
1299 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1300 > {
1301 match ordinal {
1302 7157386067685058380 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
1303 Ok(decoded) => {
1304 handler.connect_structured(::fidl_next::Request::from_decoded(decoded)).await;
1305 Ok(())
1306 }
1307 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1308 ordinal: 7157386067685058380,
1309 error,
1310 }),
1311 },
1312
1313 ordinal => {
1314 handler.on_unknown_interaction(ordinal).await;
1315 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1316 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1317 } else {
1318 Ok(())
1319 }
1320 }
1321 }
1322 }
1323
1324 async fn on_two_way(
1325 handler: &mut ___H,
1326 ordinal: u64,
1327 flexibility: ::fidl_next::protocol::Flexibility,
1328 body: ::fidl_next::Body<___T>,
1329 responder: ::fidl_next::protocol::Responder<___T>,
1330 ) -> ::core::result::Result<
1331 (),
1332 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1333 > {
1334 match ordinal {
1335 2138400952013124162 => {
1336 let responder = ::fidl_next::Responder::from_untyped(responder);
1337
1338 handler.wait_for_interest_change(responder).await;
1339 Ok(())
1340 }
1341
1342 ordinal => {
1343 handler.on_unknown_interaction(ordinal).await;
1344 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1345 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1346 } else {
1347 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
1348 ordinal,
1349 flexibility,
1350 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
1351 )
1352 .expect("encoding a framework error should never fail")
1353 .await?;
1354 Ok(())
1355 }
1356 }
1357 }
1358 }
1359}
1360
1361pub trait LogSinkClientHandler<
1365 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1366 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1367>
1368{
1369 #[doc = " This event is sent whenever Archivist accepts a new connection. Clients may use\n the returned IOBuffer to write logs.\n"]
1370 fn on_init(
1371 &mut self,
1372
1373 request: ::fidl_next::Request<log_sink::OnInit, ___T>,
1374 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1375
1376 fn on_unknown_interaction(
1377 &mut self,
1378 ordinal: u64,
1379 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1380 ::core::future::ready(())
1381 }
1382}
1383
1384impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for LogSink
1385where
1386 ___H: LogSinkClientHandler<___T> + ::core::marker::Send,
1387 ___T: ::fidl_next::Transport,
1388 for<'de> crate::wire::LogSinkOnInitRequest<'de>: ::fidl_next::Decode<
1389 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1390 Constraint = (),
1391 >,
1392{
1393 async fn on_event(
1394 handler: &mut ___H,
1395 ordinal: u64,
1396 flexibility: ::fidl_next::protocol::Flexibility,
1397 body: ::fidl_next::Body<___T>,
1398 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1399 match ordinal {
1400 7052827292487084730 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
1401 Ok(decoded) => {
1402 handler.on_init(::fidl_next::Request::from_decoded(decoded)).await;
1403 Ok(())
1404 }
1405 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1406 ordinal: 7052827292487084730,
1407 error,
1408 }),
1409 },
1410
1411 ordinal => {
1412 handler.on_unknown_interaction(ordinal).await;
1413 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1414 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1415 } else {
1416 Ok(())
1417 }
1418 }
1419 }
1420 }
1421}
1422
1423pub trait LogSinkServerHandler<
1427 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1428 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1429>
1430{
1431 #[doc = " LogSink implementers will return to this hanging-get whenever the scope of\n their interest changes. Clients are expected to emit messages based on\n the registered Interest. In the event that an empty interest is\n conveyed, clients should emit messages based on their default\n e.g. compile time configuration. Each client may only poll this once at a time.\n Invoking WaitForInterestChange a second time before the first call returns will\n result in an error being returned.\n"]
1432 fn wait_for_interest_change(
1433 &mut self,
1434
1435 responder: ::fidl_next::Responder<log_sink::WaitForInterestChange, ___T>,
1436 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1437
1438 #[doc = " Send this socket to be drained, using the structured logs format.\n\n See [Encoding structured records](https://fuchsia.dev/fuchsia-src/reference/platform-spec/diagnostics/logs-encoding)\n for what is expected to be received over the socket.\n"]
1439 fn connect_structured(
1440 &mut self,
1441
1442 request: ::fidl_next::Request<log_sink::ConnectStructured, ___T>,
1443 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1444
1445 fn on_unknown_interaction(
1446 &mut self,
1447 ordinal: u64,
1448 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1449 ::core::future::ready(())
1450 }
1451}
1452
1453impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for LogSink
1454where
1455 ___H: LogSinkServerHandler<___T> + ::core::marker::Send,
1456 ___T: ::fidl_next::Transport,
1457 for<'de> crate::wire::LogSinkConnectStructuredRequest: ::fidl_next::Decode<
1458 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1459 Constraint = (),
1460 >,
1461{
1462 async fn on_one_way(
1463 handler: &mut ___H,
1464 ordinal: u64,
1465 flexibility: ::fidl_next::protocol::Flexibility,
1466 body: ::fidl_next::Body<___T>,
1467 ) -> ::core::result::Result<
1468 (),
1469 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1470 > {
1471 match ordinal {
1472 7157386067685058380 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
1473 Ok(decoded) => {
1474 handler.connect_structured(::fidl_next::Request::from_decoded(decoded)).await;
1475 Ok(())
1476 }
1477 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1478 ordinal: 7157386067685058380,
1479 error,
1480 }),
1481 },
1482
1483 ordinal => {
1484 handler.on_unknown_interaction(ordinal).await;
1485 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1486 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1487 } else {
1488 Ok(())
1489 }
1490 }
1491 }
1492 }
1493
1494 async fn on_two_way(
1495 handler: &mut ___H,
1496 ordinal: u64,
1497 flexibility: ::fidl_next::protocol::Flexibility,
1498 body: ::fidl_next::Body<___T>,
1499 responder: ::fidl_next::protocol::Responder<___T>,
1500 ) -> ::core::result::Result<
1501 (),
1502 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1503 > {
1504 match ordinal {
1505 2138400952013124162 => {
1506 let responder = ::fidl_next::Responder::from_untyped(responder);
1507
1508 handler.wait_for_interest_change(responder).await;
1509 Ok(())
1510 }
1511
1512 ordinal => {
1513 handler.on_unknown_interaction(ordinal).await;
1514 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1515 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1516 } else {
1517 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
1518 ordinal,
1519 flexibility,
1520 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
1521 )
1522 .expect("encoding a framework error should never fail")
1523 .await?;
1524 Ok(())
1525 }
1526 }
1527 }
1528 }
1529}
1530
1531impl<___T> LogSinkClientHandler<___T> for ::fidl_next::IgnoreEvents
1532where
1533 ___T: ::fidl_next::Transport,
1534{
1535 async fn on_init(&mut self, _: ::fidl_next::Request<log_sink::OnInit, ___T>) {}
1536
1537 async fn on_unknown_interaction(&mut self, _: u64) {}
1538}
1539
1540impl<___H, ___T> LogSinkLocalClientHandler<___T> for ::fidl_next::Local<___H>
1541where
1542 ___H: LogSinkClientHandler<___T>,
1543 ___T: ::fidl_next::Transport,
1544{
1545 async fn on_init(&mut self, request: ::fidl_next::Request<log_sink::OnInit, ___T>) {
1546 ___H::on_init(&mut self.0, request).await
1547 }
1548
1549 async fn on_unknown_interaction(&mut self, ordinal: u64) {
1550 ___H::on_unknown_interaction(&mut self.0, ordinal).await
1551 }
1552}
1553
1554impl<___H, ___T> LogSinkLocalServerHandler<___T> for ::fidl_next::Local<___H>
1555where
1556 ___H: LogSinkServerHandler<___T>,
1557 ___T: ::fidl_next::Transport,
1558{
1559 async fn wait_for_interest_change(
1560 &mut self,
1561
1562 responder: ::fidl_next::Responder<log_sink::WaitForInterestChange, ___T>,
1563 ) {
1564 ___H::wait_for_interest_change(&mut self.0, responder).await
1565 }
1566
1567 async fn connect_structured(
1568 &mut self,
1569
1570 request: ::fidl_next::Request<log_sink::ConnectStructured, ___T>,
1571 ) {
1572 ___H::connect_structured(&mut self.0, request).await
1573 }
1574
1575 async fn on_unknown_interaction(&mut self, ordinal: u64) {
1576 ___H::on_unknown_interaction(&mut self.0, ordinal).await
1577 }
1578}
1579
1580pub use fidl_next_common_fuchsia_logger::*;