Skip to main content

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