Skip to main content

fidl_next_fuchsia_logger/
fidl_next_fuchsia_logger.rs

1// DO NOT EDIT: This file is machine-generated by fidlgen
2#![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    /// The wire type corresponding to [`LogListenSafeRequest`].
307    #[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    /// The wire type corresponding to [`LogSinkOnInitRequest`].
400    #[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 take_buffer(&mut self) -> ::core::option::Option<::fidl_next::wire::fuchsia::Iob> {
485            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
486        }
487
488        pub fn interest(
489            &self,
490        ) -> ::core::option::Option<&::fidl_next_fuchsia_diagnostics_types::wire::Interest<'de>>
491        {
492            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
493        }
494
495        pub fn take_interest(
496            &mut self,
497        ) -> ::core::option::Option<::fidl_next_fuchsia_diagnostics_types::wire::Interest<'de>>
498        {
499            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
500        }
501    }
502
503    impl<'de> ::core::fmt::Debug for LogSinkOnInitRequest<'de> {
504        fn fmt(
505            &self,
506            f: &mut ::core::fmt::Formatter<'_>,
507        ) -> ::core::result::Result<(), ::core::fmt::Error> {
508            f.debug_struct("LogSinkOnInitRequest")
509                .field("buffer", &self.buffer())
510                .field("interest", &self.interest())
511                .finish()
512        }
513    }
514
515    impl<'de> ::fidl_next::IntoNatural for LogSinkOnInitRequest<'de> {
516        type Natural = crate::natural::LogSinkOnInitRequest;
517    }
518
519    /// The wire type corresponding to [`LogSinkConnectStructuredRequest`].
520    #[derive(Debug)]
521    #[repr(C)]
522    pub struct LogSinkConnectStructuredRequest {
523        pub socket: ::fidl_next::wire::fuchsia::Socket,
524    }
525
526    static_assertions::const_assert_eq!(std::mem::size_of::<LogSinkConnectStructuredRequest>(), 4);
527    static_assertions::const_assert_eq!(std::mem::align_of::<LogSinkConnectStructuredRequest>(), 4);
528
529    static_assertions::const_assert_eq!(
530        std::mem::offset_of!(LogSinkConnectStructuredRequest, socket),
531        0
532    );
533
534    impl ::fidl_next::Constrained for LogSinkConnectStructuredRequest {
535        type Constraint = ();
536
537        fn validate(
538            _: ::fidl_next::Slot<'_, Self>,
539            _: Self::Constraint,
540        ) -> Result<(), ::fidl_next::ValidationError> {
541            Ok(())
542        }
543    }
544
545    unsafe impl ::fidl_next::Wire for LogSinkConnectStructuredRequest {
546        type Narrowed<'de> = LogSinkConnectStructuredRequest;
547
548        #[inline]
549        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
550            ::fidl_next::munge! {
551                let Self {
552                    socket,
553
554                } = &mut *out_;
555            }
556
557            ::fidl_next::Wire::zero_padding(socket);
558        }
559    }
560
561    unsafe impl<___D> ::fidl_next::Decode<___D> for LogSinkConnectStructuredRequest
562    where
563        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
564        ___D: ::fidl_next::fuchsia::HandleDecoder,
565    {
566        fn decode(
567            slot_: ::fidl_next::Slot<'_, Self>,
568            decoder_: &mut ___D,
569            _: (),
570        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
571            ::fidl_next::munge! {
572                let Self {
573                    mut socket,
574
575                } = slot_;
576            }
577
578            let _field = socket.as_mut();
579
580            ::fidl_next::Decode::decode(socket.as_mut(), decoder_, ())?;
581
582            Ok(())
583        }
584    }
585
586    impl ::fidl_next::IntoNatural for LogSinkConnectStructuredRequest {
587        type Natural = crate::natural::LogSinkConnectStructuredRequest;
588    }
589}
590
591pub mod wire_optional {
592
593    pub use fidl_next_common_fuchsia_logger::wire_optional::*;
594}
595
596pub mod generic {
597
598    pub use fidl_next_common_fuchsia_logger::generic::*;
599
600    /// The generic type corresponding to [`LogListenSafeRequest`].
601    pub struct LogListenSafeRequest<T0, T1> {
602        pub log_listener: T0,
603
604        pub options: T1,
605    }
606
607    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::LogListenSafeRequest<'static>, ___E>
608        for LogListenSafeRequest<T0, T1>
609    where
610        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
611        ___E: ::fidl_next::Encoder,
612        ___E: ::fidl_next::fuchsia::HandleEncoder,
613        T0: ::fidl_next::Encode<
614                ::fidl_next::ClientEnd<crate::LogListenerSafe, ::fidl_next::wire::fuchsia::Channel>,
615                ___E,
616            >,
617        T1: ::fidl_next::Encode<
618                ::fidl_next::wire::Box<'static, crate::wire::LogFilterOptions<'static>>,
619                ___E,
620            >,
621    {
622        #[inline]
623        fn encode(
624            self,
625            encoder_: &mut ___E,
626            out_: &mut ::core::mem::MaybeUninit<crate::wire::LogListenSafeRequest<'static>>,
627            _: (),
628        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
629            ::fidl_next::munge! {
630                let crate::wire::LogListenSafeRequest {
631                    log_listener,
632                    options,
633
634                } = out_;
635            }
636
637            ::fidl_next::Encode::encode(self.log_listener, encoder_, log_listener, ())?;
638
639            ::fidl_next::Encode::encode(self.options, encoder_, options, ())?;
640
641            Ok(())
642        }
643    }
644
645    /// The generic type corresponding to [`LogSinkConnectStructuredRequest`].
646    pub struct LogSinkConnectStructuredRequest<T0> {
647        pub socket: T0,
648    }
649
650    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::LogSinkConnectStructuredRequest, ___E>
651        for LogSinkConnectStructuredRequest<T0>
652    where
653        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
654        ___E: ::fidl_next::fuchsia::HandleEncoder,
655        T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Socket, ___E>,
656    {
657        #[inline]
658        fn encode(
659            self,
660            encoder_: &mut ___E,
661            out_: &mut ::core::mem::MaybeUninit<crate::wire::LogSinkConnectStructuredRequest>,
662            _: (),
663        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
664            ::fidl_next::munge! {
665                let crate::wire::LogSinkConnectStructuredRequest {
666                    socket,
667
668                } = out_;
669            }
670
671            ::fidl_next::Encode::encode(self.socket, encoder_, socket, ())?;
672
673            Ok(())
674        }
675    }
676}
677
678pub use self::natural::*;
679
680/// The type corresponding to the Log protocol.
681#[doc = " Interface for LogListenerSafe to register to listen to logs.\n"]
682#[derive(PartialEq, Debug)]
683pub struct Log;
684
685impl ::fidl_next::Discoverable for Log {
686    const PROTOCOL_NAME: &'static str = "fuchsia.logger.Log";
687}
688
689#[cfg(target_os = "fuchsia")]
690impl ::fidl_next::HasTransport for Log {
691    type Transport = ::fidl_next::fuchsia::zx::Channel;
692}
693
694pub mod log {
695    pub mod prelude {
696        pub use crate::{
697            Log, LogClientHandler, LogLocalClientHandler, LogLocalServerHandler, LogServerHandler,
698            log,
699        };
700
701        pub use crate::natural::LogListenSafeRequest;
702    }
703
704    pub struct ListenSafe;
705
706    impl ::fidl_next::Method for ListenSafe {
707        const ORDINAL: u64 = 5643638173917143473;
708        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
709            ::fidl_next::protocol::Flexibility::Strict;
710
711        type Protocol = crate::Log;
712
713        type Request = crate::wire::LogListenSafeRequest<'static>;
714    }
715
716    mod ___detail {
717        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Log
718        where
719            ___T: ::fidl_next::Transport,
720        {
721            type Client = LogClient<___T>;
722            type Server = LogServer<___T>;
723        }
724
725        /// The client for the `Log` protocol.
726        #[repr(transparent)]
727        pub struct LogClient<___T: ::fidl_next::Transport> {
728            #[allow(dead_code)]
729            client: ::fidl_next::protocol::Client<___T>,
730        }
731
732        impl<___T> LogClient<___T>
733        where
734            ___T: ::fidl_next::Transport,
735        {
736            #[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"]
737            pub fn listen_safe(
738                &self,
739
740                log_listener: impl ::fidl_next::Encode<
741                    ::fidl_next::ClientEnd<
742                        crate::LogListenerSafe,
743                        ::fidl_next::wire::fuchsia::Channel,
744                    >,
745                    <___T as ::fidl_next::Transport>::SendBuffer,
746                >,
747
748                options: impl ::fidl_next::Encode<
749                    ::fidl_next::wire::Box<'static, crate::wire::LogFilterOptions<'static>>,
750                    <___T as ::fidl_next::Transport>::SendBuffer,
751                >,
752            ) -> ::fidl_next::SendFuture<'_, ___T>
753            where
754                <___T as ::fidl_next::Transport>::SendBuffer:
755                    ::fidl_next::encoder::InternalHandleEncoder,
756                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
757                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
758            {
759                self.listen_safe_with(crate::generic::LogListenSafeRequest {
760                    log_listener,
761
762                    options,
763                })
764            }
765
766            #[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"]
767            pub fn listen_safe_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
768            where
769                ___R: ::fidl_next::Encode<
770                        crate::wire::LogListenSafeRequest<'static>,
771                        <___T as ::fidl_next::Transport>::SendBuffer,
772                    >,
773            {
774                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
775                    5643638173917143473,
776                    <super::ListenSafe as ::fidl_next::Method>::FLEXIBILITY,
777                    request,
778                ))
779            }
780        }
781
782        /// The server for the `Log` protocol.
783        #[repr(transparent)]
784        pub struct LogServer<___T: ::fidl_next::Transport> {
785            server: ::fidl_next::protocol::Server<___T>,
786        }
787
788        impl<___T> LogServer<___T> where ___T: ::fidl_next::Transport {}
789    }
790}
791
792#[diagnostic::on_unimplemented(
793    note = "If {Self} implements the non-local LogClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
794)]
795
796/// A client handler for the Log protocol.
797///
798/// See [`Log`] for more details.
799pub trait LogLocalClientHandler<
800    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
801    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
802>
803{
804}
805
806impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Log
807where
808    ___H: LogLocalClientHandler<___T>,
809    ___T: ::fidl_next::Transport,
810{
811    async fn on_event(
812        handler: &mut ___H,
813        mut message: ::fidl_next::Message<___T>,
814    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
815        match *message.header().ordinal {
816            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
817        }
818    }
819}
820
821#[diagnostic::on_unimplemented(
822    note = "If {Self} implements the non-local LogServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
823)]
824
825/// A server handler for the Log protocol.
826///
827/// See [`Log`] for more details.
828pub trait LogLocalServerHandler<
829    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
830    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
831>
832{
833    #[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"]
834    fn listen_safe(
835        &mut self,
836
837        request: ::fidl_next::Request<log::ListenSafe, ___T>,
838    ) -> impl ::core::future::Future<Output = ()>;
839}
840
841impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Log
842where
843    ___H: LogLocalServerHandler<___T>,
844    ___T: ::fidl_next::Transport,
845    for<'de> crate::wire::LogListenSafeRequest<'de>: ::fidl_next::Decode<
846            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
847            Constraint = (),
848        >,
849{
850    async fn on_one_way(
851        handler: &mut ___H,
852        mut message: ::fidl_next::Message<___T>,
853    ) -> ::core::result::Result<
854        (),
855        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
856    > {
857        match *message.header().ordinal {
858            5643638173917143473 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
859                Ok(decoded) => {
860                    handler.listen_safe(::fidl_next::Request::from_decoded(decoded)).await;
861                    Ok(())
862                }
863                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
864                    ordinal: 5643638173917143473,
865                    error,
866                }),
867            },
868
869            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
870        }
871    }
872
873    async fn on_two_way(
874        handler: &mut ___H,
875        mut message: ::fidl_next::Message<___T>,
876        responder: ::fidl_next::protocol::Responder<___T>,
877    ) -> ::core::result::Result<
878        (),
879        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
880    > {
881        match *message.header().ordinal {
882            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
883        }
884    }
885}
886
887/// A client handler for the Log protocol.
888///
889/// See [`Log`] for more details.
890pub trait LogClientHandler<
891    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
892    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
893>
894{
895}
896
897impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Log
898where
899    ___H: LogClientHandler<___T> + ::core::marker::Send,
900    ___T: ::fidl_next::Transport,
901{
902    async fn on_event(
903        handler: &mut ___H,
904        mut message: ::fidl_next::Message<___T>,
905    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
906        match *message.header().ordinal {
907            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
908        }
909    }
910}
911
912/// A server handler for the Log protocol.
913///
914/// See [`Log`] for more details.
915pub trait LogServerHandler<
916    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
917    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
918>
919{
920    #[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"]
921    fn listen_safe(
922        &mut self,
923
924        request: ::fidl_next::Request<log::ListenSafe, ___T>,
925    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
926}
927
928impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Log
929where
930    ___H: LogServerHandler<___T> + ::core::marker::Send,
931    ___T: ::fidl_next::Transport,
932    for<'de> crate::wire::LogListenSafeRequest<'de>: ::fidl_next::Decode<
933            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
934            Constraint = (),
935        >,
936{
937    async fn on_one_way(
938        handler: &mut ___H,
939        mut message: ::fidl_next::Message<___T>,
940    ) -> ::core::result::Result<
941        (),
942        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
943    > {
944        match *message.header().ordinal {
945            5643638173917143473 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
946                Ok(decoded) => {
947                    handler.listen_safe(::fidl_next::Request::from_decoded(decoded)).await;
948                    Ok(())
949                }
950                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
951                    ordinal: 5643638173917143473,
952                    error,
953                }),
954            },
955
956            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
957        }
958    }
959
960    async fn on_two_way(
961        handler: &mut ___H,
962        mut message: ::fidl_next::Message<___T>,
963        responder: ::fidl_next::protocol::Responder<___T>,
964    ) -> ::core::result::Result<
965        (),
966        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
967    > {
968        match *message.header().ordinal {
969            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
970        }
971    }
972}
973
974impl<___T> LogClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport {}
975
976impl<___H, ___T> LogLocalClientHandler<___T> for ::fidl_next::Local<___H>
977where
978    ___H: LogClientHandler<___T>,
979    ___T: ::fidl_next::Transport,
980{
981}
982
983impl<___H, ___T> LogLocalServerHandler<___T> for ::fidl_next::Local<___H>
984where
985    ___H: LogServerHandler<___T>,
986    ___T: ::fidl_next::Transport,
987{
988    async fn listen_safe(&mut self, request: ::fidl_next::Request<log::ListenSafe, ___T>) {
989        ___H::listen_safe(&mut self.0, request).await
990    }
991}
992
993/// The type corresponding to the LogSink protocol.
994#[doc = " Drains a program\'s logs.\n"]
995#[derive(PartialEq, Debug)]
996pub struct LogSink;
997
998impl ::fidl_next::Discoverable for LogSink {
999    const PROTOCOL_NAME: &'static str = "fuchsia.logger.LogSink";
1000}
1001
1002#[cfg(target_os = "fuchsia")]
1003impl ::fidl_next::HasTransport for LogSink {
1004    type Transport = ::fidl_next::fuchsia::zx::Channel;
1005}
1006
1007pub mod log_sink {
1008    pub mod prelude {
1009        pub use crate::{
1010            LogSink, LogSinkClientHandler, LogSinkLocalClientHandler, LogSinkLocalServerHandler,
1011            LogSinkServerHandler, log_sink,
1012        };
1013
1014        pub use crate::natural::InterestChangeError;
1015
1016        pub use crate::natural::LogSinkConnectStructuredRequest;
1017
1018        pub use crate::natural::LogSinkOnInitRequest;
1019
1020        pub use crate::natural::LogSinkWaitForInterestChangeResponse;
1021    }
1022
1023    pub struct OnInit;
1024
1025    impl ::fidl_next::Method for OnInit {
1026        const ORDINAL: u64 = 7052827292487084730;
1027        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1028            ::fidl_next::protocol::Flexibility::Flexible;
1029
1030        type Protocol = crate::LogSink;
1031
1032        type Request = crate::wire::LogSinkOnInitRequest<'static>;
1033    }
1034
1035    pub struct WaitForInterestChange;
1036
1037    impl ::fidl_next::Method for WaitForInterestChange {
1038        const ORDINAL: u64 = 2138400952013124162;
1039        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1040            ::fidl_next::protocol::Flexibility::Strict;
1041
1042        type Protocol = crate::LogSink;
1043
1044        type Request = ::fidl_next::wire::EmptyMessageBody;
1045    }
1046
1047    impl ::fidl_next::TwoWayMethod for WaitForInterestChange {
1048        type Response = ::fidl_next::wire::Result<
1049            'static,
1050            crate::wire::LogSinkWaitForInterestChangeResponse<'static>,
1051            crate::wire::InterestChangeError,
1052        >;
1053    }
1054
1055    impl<___R> ::fidl_next::Respond<___R> for WaitForInterestChange {
1056        type Output = ::core::result::Result<
1057            crate::generic::LogSinkWaitForInterestChangeResponse<___R>,
1058            ::fidl_next::never::Never,
1059        >;
1060
1061        fn respond(response: ___R) -> Self::Output {
1062            ::core::result::Result::Ok(crate::generic::LogSinkWaitForInterestChangeResponse {
1063                data: response,
1064            })
1065        }
1066    }
1067
1068    impl<___R> ::fidl_next::RespondErr<___R> for WaitForInterestChange {
1069        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1070
1071        fn respond_err(response: ___R) -> Self::Output {
1072            ::core::result::Result::Err(response)
1073        }
1074    }
1075
1076    pub struct ConnectStructured;
1077
1078    impl ::fidl_next::Method for ConnectStructured {
1079        const ORDINAL: u64 = 7157386067685058380;
1080        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1081            ::fidl_next::protocol::Flexibility::Strict;
1082
1083        type Protocol = crate::LogSink;
1084
1085        type Request = crate::wire::LogSinkConnectStructuredRequest;
1086    }
1087
1088    mod ___detail {
1089        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::LogSink
1090        where
1091            ___T: ::fidl_next::Transport,
1092        {
1093            type Client = LogSinkClient<___T>;
1094            type Server = LogSinkServer<___T>;
1095        }
1096
1097        /// The client for the `LogSink` protocol.
1098        #[repr(transparent)]
1099        pub struct LogSinkClient<___T: ::fidl_next::Transport> {
1100            #[allow(dead_code)]
1101            client: ::fidl_next::protocol::Client<___T>,
1102        }
1103
1104        impl<___T> LogSinkClient<___T>
1105        where
1106            ___T: ::fidl_next::Transport,
1107        {
1108            #[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"]
1109            pub fn wait_for_interest_change(
1110                &self,
1111            ) -> ::fidl_next::TwoWayFuture<'_, super::WaitForInterestChange, ___T> {
1112                ::fidl_next::TwoWayFuture::from_untyped(
1113                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
1114                        2138400952013124162,
1115                        <super::WaitForInterestChange as ::fidl_next::Method>::FLEXIBILITY,
1116                        (),
1117                    ),
1118                )
1119            }
1120
1121            #[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"]
1122            pub fn connect_structured(
1123                &self,
1124
1125                socket: impl ::fidl_next::Encode<
1126                    ::fidl_next::wire::fuchsia::Socket,
1127                    <___T as ::fidl_next::Transport>::SendBuffer,
1128                >,
1129            ) -> ::fidl_next::SendFuture<'_, ___T>
1130            where
1131                <___T as ::fidl_next::Transport>::SendBuffer:
1132                    ::fidl_next::encoder::InternalHandleEncoder,
1133                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
1134            {
1135                self.connect_structured_with(crate::generic::LogSinkConnectStructuredRequest {
1136                    socket,
1137                })
1138            }
1139
1140            #[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"]
1141            pub fn connect_structured_with<___R>(
1142                &self,
1143                request: ___R,
1144            ) -> ::fidl_next::SendFuture<'_, ___T>
1145            where
1146                ___R: ::fidl_next::Encode<
1147                        crate::wire::LogSinkConnectStructuredRequest,
1148                        <___T as ::fidl_next::Transport>::SendBuffer,
1149                    >,
1150            {
1151                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
1152                    7157386067685058380,
1153                    <super::ConnectStructured as ::fidl_next::Method>::FLEXIBILITY,
1154                    request,
1155                ))
1156            }
1157        }
1158
1159        /// The server for the `LogSink` protocol.
1160        #[repr(transparent)]
1161        pub struct LogSinkServer<___T: ::fidl_next::Transport> {
1162            server: ::fidl_next::protocol::Server<___T>,
1163        }
1164
1165        impl<___T> LogSinkServer<___T>
1166        where
1167            ___T: ::fidl_next::Transport,
1168        {
1169            #[doc = " This event is sent whenever Archivist accepts a new connection. Clients may use\n the returned IOBuffer to write logs.\n"]
1170
1171            pub fn on_init_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
1172            where
1173                ___R: ::fidl_next::Encode<
1174                        <super::OnInit as ::fidl_next::Method>::Request,
1175                        <___T as ::fidl_next::Transport>::SendBuffer,
1176                    >,
1177            {
1178                ::fidl_next::SendFuture::from_untyped(self.server.send_event(
1179                    7052827292487084730,
1180                    <super::OnInit as ::fidl_next::Method>::FLEXIBILITY,
1181                    request,
1182                ))
1183            }
1184        }
1185    }
1186}
1187
1188#[diagnostic::on_unimplemented(
1189    note = "If {Self} implements the non-local LogSinkClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1190)]
1191
1192/// A client handler for the LogSink protocol.
1193///
1194/// See [`LogSink`] for more details.
1195pub trait LogSinkLocalClientHandler<
1196    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1197    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1198>
1199{
1200    #[doc = " This event is sent whenever Archivist accepts a new connection. Clients may use\n the returned IOBuffer to write logs.\n"]
1201    fn on_init(
1202        &mut self,
1203
1204        request: ::fidl_next::Request<log_sink::OnInit, ___T>,
1205    ) -> impl ::core::future::Future<Output = ()>;
1206
1207    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1208        ::core::future::ready(())
1209    }
1210}
1211
1212impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for LogSink
1213where
1214    ___H: LogSinkLocalClientHandler<___T>,
1215    ___T: ::fidl_next::Transport,
1216    for<'de> crate::wire::LogSinkOnInitRequest<'de>: ::fidl_next::Decode<
1217            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1218            Constraint = (),
1219        >,
1220{
1221    async fn on_event(
1222        handler: &mut ___H,
1223        mut message: ::fidl_next::Message<___T>,
1224    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1225        match *message.header().ordinal {
1226            7052827292487084730 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1227                Ok(decoded) => {
1228                    handler.on_init(::fidl_next::Request::from_decoded(decoded)).await;
1229                    Ok(())
1230                }
1231                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1232                    ordinal: 7052827292487084730,
1233                    error,
1234                }),
1235            },
1236
1237            ordinal => {
1238                handler.on_unknown_interaction(ordinal).await;
1239                if ::core::matches!(
1240                    message.header().flexibility(),
1241                    ::fidl_next::protocol::Flexibility::Strict
1242                ) {
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
1256/// A server handler for the LogSink protocol.
1257///
1258/// See [`LogSink`] for more details.
1259pub 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        mut message: ::fidl_next::Message<___T>,
1295    ) -> ::core::result::Result<
1296        (),
1297        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1298    > {
1299        match *message.header().ordinal {
1300            7157386067685058380 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1301                Ok(decoded) => {
1302                    handler.connect_structured(::fidl_next::Request::from_decoded(decoded)).await;
1303                    Ok(())
1304                }
1305                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1306                    ordinal: 7157386067685058380,
1307                    error,
1308                }),
1309            },
1310
1311            ordinal => {
1312                handler.on_unknown_interaction(ordinal).await;
1313                if ::core::matches!(
1314                    message.header().flexibility(),
1315                    ::fidl_next::protocol::Flexibility::Strict
1316                ) {
1317                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1318                } else {
1319                    Ok(())
1320                }
1321            }
1322        }
1323    }
1324
1325    async fn on_two_way(
1326        handler: &mut ___H,
1327        mut message: ::fidl_next::Message<___T>,
1328        responder: ::fidl_next::protocol::Responder<___T>,
1329    ) -> ::core::result::Result<
1330        (),
1331        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1332    > {
1333        match *message.header().ordinal {
1334            2138400952013124162 => {
1335                let responder = ::fidl_next::Responder::from_untyped(responder);
1336
1337                handler.wait_for_interest_change(responder).await;
1338                Ok(())
1339            }
1340
1341            ordinal => {
1342                handler.on_unknown_interaction(ordinal).await;
1343                if ::core::matches!(
1344                    message.header().flexibility(),
1345                    ::fidl_next::protocol::Flexibility::Strict
1346                ) {
1347                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1348                } else {
1349                    responder
1350                        .respond_framework_error(
1351                            ordinal,
1352                            ::fidl_next::FrameworkError::UnknownMethod,
1353                        )
1354                        .expect("encoding a framework error should never fail")
1355                        .await?;
1356                    Ok(())
1357                }
1358            }
1359        }
1360    }
1361}
1362
1363/// A client handler for the LogSink protocol.
1364///
1365/// See [`LogSink`] for more details.
1366pub trait LogSinkClientHandler<
1367    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1368    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1369>
1370{
1371    #[doc = " This event is sent whenever Archivist accepts a new connection. Clients may use\n the returned IOBuffer to write logs.\n"]
1372    fn on_init(
1373        &mut self,
1374
1375        request: ::fidl_next::Request<log_sink::OnInit, ___T>,
1376    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1377
1378    fn on_unknown_interaction(
1379        &mut self,
1380        ordinal: u64,
1381    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1382        ::core::future::ready(())
1383    }
1384}
1385
1386impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for LogSink
1387where
1388    ___H: LogSinkClientHandler<___T> + ::core::marker::Send,
1389    ___T: ::fidl_next::Transport,
1390    for<'de> crate::wire::LogSinkOnInitRequest<'de>: ::fidl_next::Decode<
1391            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1392            Constraint = (),
1393        >,
1394{
1395    async fn on_event(
1396        handler: &mut ___H,
1397        mut message: ::fidl_next::Message<___T>,
1398    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1399        match *message.header().ordinal {
1400            7052827292487084730 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
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!(
1414                    message.header().flexibility(),
1415                    ::fidl_next::protocol::Flexibility::Strict
1416                ) {
1417                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1418                } else {
1419                    Ok(())
1420                }
1421            }
1422        }
1423    }
1424}
1425
1426/// A server handler for the LogSink protocol.
1427///
1428/// See [`LogSink`] for more details.
1429pub trait LogSinkServerHandler<
1430    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1431    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1432>
1433{
1434    #[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"]
1435    fn wait_for_interest_change(
1436        &mut self,
1437
1438        responder: ::fidl_next::Responder<log_sink::WaitForInterestChange, ___T>,
1439    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1440
1441    #[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"]
1442    fn connect_structured(
1443        &mut self,
1444
1445        request: ::fidl_next::Request<log_sink::ConnectStructured, ___T>,
1446    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1447
1448    fn on_unknown_interaction(
1449        &mut self,
1450        ordinal: u64,
1451    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1452        ::core::future::ready(())
1453    }
1454}
1455
1456impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for LogSink
1457where
1458    ___H: LogSinkServerHandler<___T> + ::core::marker::Send,
1459    ___T: ::fidl_next::Transport,
1460    for<'de> crate::wire::LogSinkConnectStructuredRequest: ::fidl_next::Decode<
1461            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1462            Constraint = (),
1463        >,
1464{
1465    async fn on_one_way(
1466        handler: &mut ___H,
1467        mut message: ::fidl_next::Message<___T>,
1468    ) -> ::core::result::Result<
1469        (),
1470        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1471    > {
1472        match *message.header().ordinal {
1473            7157386067685058380 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1474                Ok(decoded) => {
1475                    handler.connect_structured(::fidl_next::Request::from_decoded(decoded)).await;
1476                    Ok(())
1477                }
1478                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1479                    ordinal: 7157386067685058380,
1480                    error,
1481                }),
1482            },
1483
1484            ordinal => {
1485                handler.on_unknown_interaction(ordinal).await;
1486                if ::core::matches!(
1487                    message.header().flexibility(),
1488                    ::fidl_next::protocol::Flexibility::Strict
1489                ) {
1490                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1491                } else {
1492                    Ok(())
1493                }
1494            }
1495        }
1496    }
1497
1498    async fn on_two_way(
1499        handler: &mut ___H,
1500        mut message: ::fidl_next::Message<___T>,
1501        responder: ::fidl_next::protocol::Responder<___T>,
1502    ) -> ::core::result::Result<
1503        (),
1504        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1505    > {
1506        match *message.header().ordinal {
1507            2138400952013124162 => {
1508                let responder = ::fidl_next::Responder::from_untyped(responder);
1509
1510                handler.wait_for_interest_change(responder).await;
1511                Ok(())
1512            }
1513
1514            ordinal => {
1515                handler.on_unknown_interaction(ordinal).await;
1516                if ::core::matches!(
1517                    message.header().flexibility(),
1518                    ::fidl_next::protocol::Flexibility::Strict
1519                ) {
1520                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1521                } else {
1522                    responder
1523                        .respond_framework_error(
1524                            ordinal,
1525                            ::fidl_next::FrameworkError::UnknownMethod,
1526                        )
1527                        .expect("encoding a framework error should never fail")
1528                        .await?;
1529                    Ok(())
1530                }
1531            }
1532        }
1533    }
1534}
1535
1536impl<___T> LogSinkClientHandler<___T> for ::fidl_next::IgnoreEvents
1537where
1538    ___T: ::fidl_next::Transport,
1539{
1540    async fn on_init(&mut self, _: ::fidl_next::Request<log_sink::OnInit, ___T>) {}
1541
1542    async fn on_unknown_interaction(&mut self, _: u64) {}
1543}
1544
1545impl<___H, ___T> LogSinkLocalClientHandler<___T> for ::fidl_next::Local<___H>
1546where
1547    ___H: LogSinkClientHandler<___T>,
1548    ___T: ::fidl_next::Transport,
1549{
1550    async fn on_init(&mut self, request: ::fidl_next::Request<log_sink::OnInit, ___T>) {
1551        ___H::on_init(&mut self.0, request).await
1552    }
1553
1554    async fn on_unknown_interaction(&mut self, ordinal: u64) {
1555        ___H::on_unknown_interaction(&mut self.0, ordinal).await
1556    }
1557}
1558
1559impl<___H, ___T> LogSinkLocalServerHandler<___T> for ::fidl_next::Local<___H>
1560where
1561    ___H: LogSinkServerHandler<___T>,
1562    ___T: ::fidl_next::Transport,
1563{
1564    async fn wait_for_interest_change(
1565        &mut self,
1566
1567        responder: ::fidl_next::Responder<log_sink::WaitForInterestChange, ___T>,
1568    ) {
1569        ___H::wait_for_interest_change(&mut self.0, responder).await
1570    }
1571
1572    async fn connect_structured(
1573        &mut self,
1574
1575        request: ::fidl_next::Request<log_sink::ConnectStructured, ___T>,
1576    ) {
1577        ___H::connect_structured(&mut self.0, request).await
1578    }
1579
1580    async fn on_unknown_interaction(&mut self, ordinal: u64) {
1581        ___H::on_unknown_interaction(&mut self.0, ordinal).await
1582    }
1583}
1584
1585pub use fidl_next_common_fuchsia_logger::*;