Skip to main content

fidl_next_common_fuchsia_hardware_reset/
fidl_next_common_fuchsia_hardware_reset.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    #[doc = " Describes a reset line managed by the controller.\n"]
8    #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9    pub struct ResetDescriptor {
10        pub reset_id: ::core::option::Option<u32>,
11    }
12
13    impl ResetDescriptor {
14        fn __max_ordinal(&self) -> usize {
15            if self.reset_id.is_some() {
16                return 1;
17            }
18
19            0
20        }
21    }
22
23    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ResetDescriptor<'static>, ___E>
24        for ResetDescriptor
25    where
26        ___E: ::fidl_next::Encoder + ?Sized,
27    {
28        #[inline]
29        fn encode(
30            mut self,
31            encoder: &mut ___E,
32            out: &mut ::core::mem::MaybeUninit<crate::wire::ResetDescriptor<'static>>,
33            _: (),
34        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35            ::fidl_next::munge!(let crate::wire::ResetDescriptor { table } = out);
36
37            let max_ord = self.__max_ordinal();
38
39            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
40            ::fidl_next::Wire::zero_padding(&mut out);
41
42            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
43                ::fidl_next::wire::Envelope,
44            >(encoder, max_ord);
45
46            for i in 1..=max_ord {
47                match i {
48                    1 => {
49                        if let Some(value) = self.reset_id.take() {
50                            ::fidl_next::wire::Envelope::encode_value::<
51                                ::fidl_next::wire::Uint32,
52                                ___E,
53                            >(
54                                value, preallocated.encoder, &mut out, ()
55                            )?;
56                        } else {
57                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
58                        }
59                    }
60
61                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
62                }
63                unsafe {
64                    preallocated.write_next(out.assume_init_ref());
65                }
66            }
67
68            ::fidl_next::wire::Table::encode_len(table, max_ord);
69
70            Ok(())
71        }
72    }
73
74    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ResetDescriptor<'static>, ___E>
75        for &'a ResetDescriptor
76    where
77        ___E: ::fidl_next::Encoder + ?Sized,
78    {
79        #[inline]
80        fn encode(
81            self,
82            encoder: &mut ___E,
83            out: &mut ::core::mem::MaybeUninit<crate::wire::ResetDescriptor<'static>>,
84            _: (),
85        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
86            ::fidl_next::munge!(let crate::wire::ResetDescriptor { table } = out);
87
88            let max_ord = self.__max_ordinal();
89
90            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
91            ::fidl_next::Wire::zero_padding(&mut out);
92
93            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
94                ::fidl_next::wire::Envelope,
95            >(encoder, max_ord);
96
97            for i in 1..=max_ord {
98                match i {
99                    1 => {
100                        if let Some(value) = &self.reset_id {
101                            ::fidl_next::wire::Envelope::encode_value::<
102                                ::fidl_next::wire::Uint32,
103                                ___E,
104                            >(
105                                value, preallocated.encoder, &mut out, ()
106                            )?;
107                        } else {
108                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
109                        }
110                    }
111
112                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
113                }
114                unsafe {
115                    preallocated.write_next(out.assume_init_ref());
116                }
117            }
118
119            ::fidl_next::wire::Table::encode_len(table, max_ord);
120
121            Ok(())
122        }
123    }
124
125    impl<'de> ::fidl_next::FromWire<crate::wire::ResetDescriptor<'de>> for ResetDescriptor {
126        #[inline]
127        fn from_wire(wire_: crate::wire::ResetDescriptor<'de>) -> Self {
128            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
129
130            let reset_id = wire_.table.get(1);
131
132            Self {
133                reset_id: reset_id.map(|envelope| {
134                    ::fidl_next::FromWire::from_wire(unsafe {
135                        envelope.read_unchecked::<::fidl_next::wire::Uint32>()
136                    })
137                }),
138            }
139        }
140    }
141
142    impl<'de> ::fidl_next::FromWireRef<crate::wire::ResetDescriptor<'de>> for ResetDescriptor {
143        #[inline]
144        fn from_wire_ref(wire: &crate::wire::ResetDescriptor<'de>) -> Self {
145            Self {
146                reset_id: wire.table.get(1).map(|envelope| {
147                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
148                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
149                    })
150                }),
151            }
152        }
153    }
154
155    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
156    pub struct Metadata {
157        pub controller_id: ::core::option::Option<u32>,
158
159        pub resets: ::core::option::Option<::std::vec::Vec<crate::natural::ResetDescriptor>>,
160    }
161
162    impl Metadata {
163        fn __max_ordinal(&self) -> usize {
164            if self.resets.is_some() {
165                return 2;
166            }
167
168            if self.controller_id.is_some() {
169                return 1;
170            }
171
172            0
173        }
174    }
175
176    unsafe impl<___E> ::fidl_next::Encode<crate::wire::Metadata<'static>, ___E> for Metadata
177    where
178        ___E: ::fidl_next::Encoder + ?Sized,
179    {
180        #[inline]
181        fn encode(
182            mut self,
183            encoder: &mut ___E,
184            out: &mut ::core::mem::MaybeUninit<crate::wire::Metadata<'static>>,
185            _: (),
186        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
187            ::fidl_next::munge!(let crate::wire::Metadata { table } = out);
188
189            let max_ord = self.__max_ordinal();
190
191            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
192            ::fidl_next::Wire::zero_padding(&mut out);
193
194            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
195                ::fidl_next::wire::Envelope,
196            >(encoder, max_ord);
197
198            for i in 1..=max_ord {
199                match i {
200                    2 => {
201                        if let Some(value) = self.resets.take() {
202                            ::fidl_next::wire::Envelope::encode_value::<
203                                ::fidl_next::wire::Vector<
204                                    'static,
205                                    crate::wire::ResetDescriptor<'static>,
206                                >,
207                                ___E,
208                            >(
209                                value, preallocated.encoder, &mut out, (4294967295, ())
210                            )?;
211                        } else {
212                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
213                        }
214                    }
215
216                    1 => {
217                        if let Some(value) = self.controller_id.take() {
218                            ::fidl_next::wire::Envelope::encode_value::<
219                                ::fidl_next::wire::Uint32,
220                                ___E,
221                            >(
222                                value, preallocated.encoder, &mut out, ()
223                            )?;
224                        } else {
225                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
226                        }
227                    }
228
229                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
230                }
231                unsafe {
232                    preallocated.write_next(out.assume_init_ref());
233                }
234            }
235
236            ::fidl_next::wire::Table::encode_len(table, max_ord);
237
238            Ok(())
239        }
240    }
241
242    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Metadata<'static>, ___E> for &'a Metadata
243    where
244        ___E: ::fidl_next::Encoder + ?Sized,
245    {
246        #[inline]
247        fn encode(
248            self,
249            encoder: &mut ___E,
250            out: &mut ::core::mem::MaybeUninit<crate::wire::Metadata<'static>>,
251            _: (),
252        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
253            ::fidl_next::munge!(let crate::wire::Metadata { table } = out);
254
255            let max_ord = self.__max_ordinal();
256
257            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
258            ::fidl_next::Wire::zero_padding(&mut out);
259
260            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
261                ::fidl_next::wire::Envelope,
262            >(encoder, max_ord);
263
264            for i in 1..=max_ord {
265                match i {
266                    2 => {
267                        if let Some(value) = &self.resets {
268                            ::fidl_next::wire::Envelope::encode_value::<
269                                ::fidl_next::wire::Vector<
270                                    'static,
271                                    crate::wire::ResetDescriptor<'static>,
272                                >,
273                                ___E,
274                            >(
275                                value, preallocated.encoder, &mut out, (4294967295, ())
276                            )?;
277                        } else {
278                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
279                        }
280                    }
281
282                    1 => {
283                        if let Some(value) = &self.controller_id {
284                            ::fidl_next::wire::Envelope::encode_value::<
285                                ::fidl_next::wire::Uint32,
286                                ___E,
287                            >(
288                                value, preallocated.encoder, &mut out, ()
289                            )?;
290                        } else {
291                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
292                        }
293                    }
294
295                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
296                }
297                unsafe {
298                    preallocated.write_next(out.assume_init_ref());
299                }
300            }
301
302            ::fidl_next::wire::Table::encode_len(table, max_ord);
303
304            Ok(())
305        }
306    }
307
308    impl<'de> ::fidl_next::FromWire<crate::wire::Metadata<'de>> for Metadata {
309        #[inline]
310        fn from_wire(wire_: crate::wire::Metadata<'de>) -> Self {
311            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
312
313            let controller_id = wire_.table.get(1);
314
315            let resets = wire_.table.get(2);
316
317            Self {
318
319
320                controller_id: controller_id.map(|envelope| ::fidl_next::FromWire::from_wire(
321                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() }
322                )),
323
324
325                resets: resets.map(|envelope| ::fidl_next::FromWire::from_wire(
326                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ResetDescriptor<'de>>>() }
327                )),
328
329        }
330        }
331    }
332
333    impl<'de> ::fidl_next::FromWireRef<crate::wire::Metadata<'de>> for Metadata {
334        #[inline]
335        fn from_wire_ref(wire: &crate::wire::Metadata<'de>) -> Self {
336            Self {
337
338
339                controller_id: wire.table.get(1)
340                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
341                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint32>() }
342                    )),
343
344
345                resets: wire.table.get(2)
346                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
347                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ResetDescriptor<'de>>>() }
348                    )),
349
350        }
351        }
352    }
353
354    pub type ResetAssertResponse = ();
355
356    pub type ResetDeassertResponse = ();
357
358    pub type ResetToggleResponse = ();
359
360    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
361    #[repr(C)]
362    pub struct ResetToggleWithTimeoutRequest {
363        pub timeout: i64,
364    }
365
366    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ResetToggleWithTimeoutRequest, ___E>
367        for ResetToggleWithTimeoutRequest
368    where
369        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
370    {
371        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
372            Self,
373            crate::wire::ResetToggleWithTimeoutRequest,
374        > = unsafe {
375            ::fidl_next::CopyOptimization::enable_if(
376            true
377
378                && <
379                    i64 as ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>
380                >::COPY_OPTIMIZATION.is_enabled()
381
382        )
383        };
384
385        #[inline]
386        fn encode(
387            self,
388            encoder_: &mut ___E,
389            out_: &mut ::core::mem::MaybeUninit<crate::wire::ResetToggleWithTimeoutRequest>,
390            _: (),
391        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
392            ::fidl_next::munge! {
393                let crate::wire::ResetToggleWithTimeoutRequest {
394                    timeout,
395
396                } = out_;
397            }
398
399            ::fidl_next::Encode::encode(self.timeout, encoder_, timeout, ())?;
400
401            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(timeout.as_mut_ptr()) };
402
403            Ok(())
404        }
405    }
406
407    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ResetToggleWithTimeoutRequest, ___E>
408        for &'a ResetToggleWithTimeoutRequest
409    where
410        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
411    {
412        #[inline]
413        fn encode(
414            self,
415            encoder_: &mut ___E,
416            out_: &mut ::core::mem::MaybeUninit<crate::wire::ResetToggleWithTimeoutRequest>,
417            _: (),
418        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
419            ::fidl_next::munge! {
420                let crate::wire::ResetToggleWithTimeoutRequest {
421                    timeout,
422
423                } = out_;
424            }
425
426            ::fidl_next::Encode::encode(&self.timeout, encoder_, timeout, ())?;
427
428            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(timeout.as_mut_ptr()) };
429
430            Ok(())
431        }
432    }
433
434    unsafe impl<___E>
435        ::fidl_next::EncodeOption<
436            ::fidl_next::wire::Box<'static, crate::wire::ResetToggleWithTimeoutRequest>,
437            ___E,
438        > for ResetToggleWithTimeoutRequest
439    where
440        ___E: ::fidl_next::Encoder + ?Sized,
441        ResetToggleWithTimeoutRequest:
442            ::fidl_next::Encode<crate::wire::ResetToggleWithTimeoutRequest, ___E>,
443    {
444        #[inline]
445        fn encode_option(
446            this: ::core::option::Option<Self>,
447            encoder: &mut ___E,
448            out: &mut ::core::mem::MaybeUninit<
449                ::fidl_next::wire::Box<'static, crate::wire::ResetToggleWithTimeoutRequest>,
450            >,
451            _: (),
452        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
453            if let Some(inner) = this {
454                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
455                ::fidl_next::wire::Box::encode_present(out);
456            } else {
457                ::fidl_next::wire::Box::encode_absent(out);
458            }
459
460            Ok(())
461        }
462    }
463
464    unsafe impl<'a, ___E>
465        ::fidl_next::EncodeOption<
466            ::fidl_next::wire::Box<'static, crate::wire::ResetToggleWithTimeoutRequest>,
467            ___E,
468        > for &'a ResetToggleWithTimeoutRequest
469    where
470        ___E: ::fidl_next::Encoder + ?Sized,
471        &'a ResetToggleWithTimeoutRequest:
472            ::fidl_next::Encode<crate::wire::ResetToggleWithTimeoutRequest, ___E>,
473    {
474        #[inline]
475        fn encode_option(
476            this: ::core::option::Option<Self>,
477            encoder: &mut ___E,
478            out: &mut ::core::mem::MaybeUninit<
479                ::fidl_next::wire::Box<'static, crate::wire::ResetToggleWithTimeoutRequest>,
480            >,
481            _: (),
482        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
483            if let Some(inner) = this {
484                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
485                ::fidl_next::wire::Box::encode_present(out);
486            } else {
487                ::fidl_next::wire::Box::encode_absent(out);
488            }
489
490            Ok(())
491        }
492    }
493
494    impl ::fidl_next::FromWire<crate::wire::ResetToggleWithTimeoutRequest>
495        for ResetToggleWithTimeoutRequest
496    {
497        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
498            crate::wire::ResetToggleWithTimeoutRequest,
499            Self,
500        > = unsafe {
501            ::fidl_next::CopyOptimization::enable_if(
502                true && <i64 as ::fidl_next::FromWire<::fidl_next::wire::Int64>>::COPY_OPTIMIZATION
503                    .is_enabled(),
504            )
505        };
506
507        #[inline]
508        fn from_wire(wire: crate::wire::ResetToggleWithTimeoutRequest) -> Self {
509            Self { timeout: ::fidl_next::FromWire::from_wire(wire.timeout) }
510        }
511    }
512
513    impl ::fidl_next::FromWireRef<crate::wire::ResetToggleWithTimeoutRequest>
514        for ResetToggleWithTimeoutRequest
515    {
516        #[inline]
517        fn from_wire_ref(wire: &crate::wire::ResetToggleWithTimeoutRequest) -> Self {
518            Self { timeout: ::fidl_next::FromWireRef::from_wire_ref(&wire.timeout) }
519        }
520    }
521
522    pub type ResetToggleWithTimeoutResponse = ();
523
524    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
525    #[repr(C)]
526    pub struct ResetStatusResponse {
527        pub asserted: bool,
528    }
529
530    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ResetStatusResponse, ___E>
531        for ResetStatusResponse
532    where
533        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
534    {
535        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
536            Self,
537            crate::wire::ResetStatusResponse,
538        > = unsafe {
539            ::fidl_next::CopyOptimization::enable_if(
540                true && <bool as ::fidl_next::Encode<bool, ___E>>::COPY_OPTIMIZATION.is_enabled(),
541            )
542        };
543
544        #[inline]
545        fn encode(
546            self,
547            encoder_: &mut ___E,
548            out_: &mut ::core::mem::MaybeUninit<crate::wire::ResetStatusResponse>,
549            _: (),
550        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
551            ::fidl_next::munge! {
552                let crate::wire::ResetStatusResponse {
553                    asserted,
554
555                } = out_;
556            }
557
558            ::fidl_next::Encode::encode(self.asserted, encoder_, asserted, ())?;
559
560            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(asserted.as_mut_ptr()) };
561
562            Ok(())
563        }
564    }
565
566    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ResetStatusResponse, ___E>
567        for &'a ResetStatusResponse
568    where
569        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
570    {
571        #[inline]
572        fn encode(
573            self,
574            encoder_: &mut ___E,
575            out_: &mut ::core::mem::MaybeUninit<crate::wire::ResetStatusResponse>,
576            _: (),
577        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
578            ::fidl_next::munge! {
579                let crate::wire::ResetStatusResponse {
580                    asserted,
581
582                } = out_;
583            }
584
585            ::fidl_next::Encode::encode(&self.asserted, encoder_, asserted, ())?;
586
587            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(asserted.as_mut_ptr()) };
588
589            Ok(())
590        }
591    }
592
593    unsafe impl<___E>
594        ::fidl_next::EncodeOption<
595            ::fidl_next::wire::Box<'static, crate::wire::ResetStatusResponse>,
596            ___E,
597        > for ResetStatusResponse
598    where
599        ___E: ::fidl_next::Encoder + ?Sized,
600        ResetStatusResponse: ::fidl_next::Encode<crate::wire::ResetStatusResponse, ___E>,
601    {
602        #[inline]
603        fn encode_option(
604            this: ::core::option::Option<Self>,
605            encoder: &mut ___E,
606            out: &mut ::core::mem::MaybeUninit<
607                ::fidl_next::wire::Box<'static, crate::wire::ResetStatusResponse>,
608            >,
609            _: (),
610        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
611            if let Some(inner) = this {
612                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
613                ::fidl_next::wire::Box::encode_present(out);
614            } else {
615                ::fidl_next::wire::Box::encode_absent(out);
616            }
617
618            Ok(())
619        }
620    }
621
622    unsafe impl<'a, ___E>
623        ::fidl_next::EncodeOption<
624            ::fidl_next::wire::Box<'static, crate::wire::ResetStatusResponse>,
625            ___E,
626        > for &'a ResetStatusResponse
627    where
628        ___E: ::fidl_next::Encoder + ?Sized,
629        &'a ResetStatusResponse: ::fidl_next::Encode<crate::wire::ResetStatusResponse, ___E>,
630    {
631        #[inline]
632        fn encode_option(
633            this: ::core::option::Option<Self>,
634            encoder: &mut ___E,
635            out: &mut ::core::mem::MaybeUninit<
636                ::fidl_next::wire::Box<'static, crate::wire::ResetStatusResponse>,
637            >,
638            _: (),
639        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
640            if let Some(inner) = this {
641                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
642                ::fidl_next::wire::Box::encode_present(out);
643            } else {
644                ::fidl_next::wire::Box::encode_absent(out);
645            }
646
647            Ok(())
648        }
649    }
650
651    impl ::fidl_next::FromWire<crate::wire::ResetStatusResponse> for ResetStatusResponse {
652        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
653            crate::wire::ResetStatusResponse,
654            Self,
655        > = unsafe {
656            ::fidl_next::CopyOptimization::enable_if(
657                true && <bool as ::fidl_next::FromWire<bool>>::COPY_OPTIMIZATION.is_enabled(),
658            )
659        };
660
661        #[inline]
662        fn from_wire(wire: crate::wire::ResetStatusResponse) -> Self {
663            Self { asserted: ::fidl_next::FromWire::from_wire(wire.asserted) }
664        }
665    }
666
667    impl ::fidl_next::FromWireRef<crate::wire::ResetStatusResponse> for ResetStatusResponse {
668        #[inline]
669        fn from_wire_ref(wire: &crate::wire::ResetStatusResponse) -> Self {
670            Self { asserted: ::fidl_next::FromWireRef::from_wire_ref(&wire.asserted) }
671        }
672    }
673}
674
675pub mod wire {
676
677    /// The wire type corresponding to [`ResetDescriptor`].
678    #[repr(C)]
679    pub struct ResetDescriptor<'de> {
680        pub(crate) table: ::fidl_next::wire::Table<'de>,
681    }
682
683    impl<'de> Drop for ResetDescriptor<'de> {
684        fn drop(&mut self) {
685            let _ = self
686                .table
687                .get(1)
688                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
689        }
690    }
691
692    impl ::fidl_next::Constrained for ResetDescriptor<'_> {
693        type Constraint = ();
694
695        fn validate(
696            _: ::fidl_next::Slot<'_, Self>,
697            _: Self::Constraint,
698        ) -> Result<(), ::fidl_next::ValidationError> {
699            Ok(())
700        }
701    }
702
703    unsafe impl ::fidl_next::Wire for ResetDescriptor<'static> {
704        type Narrowed<'de> = ResetDescriptor<'de>;
705
706        #[inline]
707        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
708            ::fidl_next::munge!(let Self { table } = out);
709            ::fidl_next::wire::Table::zero_padding(table);
710        }
711    }
712
713    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ResetDescriptor<'de>
714    where
715        ___D: ::fidl_next::Decoder<'de> + ?Sized,
716    {
717        fn decode(
718            slot: ::fidl_next::Slot<'_, Self>,
719            decoder: &mut ___D,
720            _: (),
721        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
722            ::fidl_next::munge!(let Self { table } = slot);
723
724            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
725                match ordinal {
726                    0 => unsafe { ::core::hint::unreachable_unchecked() },
727
728                    1 => {
729                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
730                            slot.as_mut(),
731                            decoder,
732                            (),
733                        )?;
734
735                        Ok(())
736                    }
737
738                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
739                }
740            })
741        }
742    }
743
744    impl<'de> ResetDescriptor<'de> {
745        pub fn reset_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
746            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
747        }
748    }
749
750    impl<'de> ::core::fmt::Debug for ResetDescriptor<'de> {
751        fn fmt(
752            &self,
753            f: &mut ::core::fmt::Formatter<'_>,
754        ) -> ::core::result::Result<(), ::core::fmt::Error> {
755            f.debug_struct("ResetDescriptor").field("reset_id", &self.reset_id()).finish()
756        }
757    }
758
759    impl<'de> ::fidl_next::IntoNatural for ResetDescriptor<'de> {
760        type Natural = crate::natural::ResetDescriptor;
761    }
762
763    /// The wire type corresponding to [`Metadata`].
764    #[repr(C)]
765    pub struct Metadata<'de> {
766        pub(crate) table: ::fidl_next::wire::Table<'de>,
767    }
768
769    impl<'de> Drop for Metadata<'de> {
770        fn drop(&mut self) {
771            let _ = self
772                .table
773                .get(1)
774                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
775
776            let _ = self.table.get(2)
777                .map(|envelope| unsafe {
778                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ResetDescriptor<'de>>>()
779                });
780        }
781    }
782
783    impl ::fidl_next::Constrained for Metadata<'_> {
784        type Constraint = ();
785
786        fn validate(
787            _: ::fidl_next::Slot<'_, Self>,
788            _: Self::Constraint,
789        ) -> Result<(), ::fidl_next::ValidationError> {
790            Ok(())
791        }
792    }
793
794    unsafe impl ::fidl_next::Wire for Metadata<'static> {
795        type Narrowed<'de> = Metadata<'de>;
796
797        #[inline]
798        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
799            ::fidl_next::munge!(let Self { table } = out);
800            ::fidl_next::wire::Table::zero_padding(table);
801        }
802    }
803
804    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Metadata<'de>
805    where
806        ___D: ::fidl_next::Decoder<'de> + ?Sized,
807    {
808        fn decode(
809            slot: ::fidl_next::Slot<'_, Self>,
810            decoder: &mut ___D,
811            _: (),
812        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
813            ::fidl_next::munge!(let Self { table } = slot);
814
815            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
816                match ordinal {
817                    0 => unsafe { ::core::hint::unreachable_unchecked() },
818
819                    1 => {
820                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
821                            slot.as_mut(),
822                            decoder,
823                            (),
824                        )?;
825
826                        Ok(())
827                    }
828
829                    2 => {
830                        ::fidl_next::wire::Envelope::decode_as::<
831                            ___D,
832                            ::fidl_next::wire::Vector<'de, crate::wire::ResetDescriptor<'de>>,
833                        >(slot.as_mut(), decoder, (4294967295, ()))?;
834
835                        Ok(())
836                    }
837
838                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
839                }
840            })
841        }
842    }
843
844    impl<'de> Metadata<'de> {
845        pub fn controller_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
846            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
847        }
848
849        pub fn resets(
850            &self,
851        ) -> ::core::option::Option<
852            &::fidl_next::wire::Vector<'de, crate::wire::ResetDescriptor<'de>>,
853        > {
854            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
855        }
856    }
857
858    impl<'de> ::core::fmt::Debug for Metadata<'de> {
859        fn fmt(
860            &self,
861            f: &mut ::core::fmt::Formatter<'_>,
862        ) -> ::core::result::Result<(), ::core::fmt::Error> {
863            f.debug_struct("Metadata")
864                .field("controller_id", &self.controller_id())
865                .field("resets", &self.resets())
866                .finish()
867        }
868    }
869
870    impl<'de> ::fidl_next::IntoNatural for Metadata<'de> {
871        type Natural = crate::natural::Metadata;
872    }
873
874    /// The wire type corresponding to [`ResetAssertResponse`].
875    pub type ResetAssertResponse = ::fidl_next::wire::Unit;
876
877    /// The wire type corresponding to [`ResetDeassertResponse`].
878    pub type ResetDeassertResponse = ::fidl_next::wire::Unit;
879
880    /// The wire type corresponding to [`ResetToggleResponse`].
881    pub type ResetToggleResponse = ::fidl_next::wire::Unit;
882
883    /// The wire type corresponding to [`ResetToggleWithTimeoutRequest`].
884    #[derive(Clone, Debug)]
885    #[repr(C)]
886    pub struct ResetToggleWithTimeoutRequest {
887        pub timeout: ::fidl_next::wire::Int64,
888    }
889
890    static_assertions::const_assert_eq!(std::mem::size_of::<ResetToggleWithTimeoutRequest>(), 8);
891    static_assertions::const_assert_eq!(std::mem::align_of::<ResetToggleWithTimeoutRequest>(), 8);
892
893    static_assertions::const_assert_eq!(
894        std::mem::offset_of!(ResetToggleWithTimeoutRequest, timeout),
895        0
896    );
897
898    impl ::fidl_next::Constrained for ResetToggleWithTimeoutRequest {
899        type Constraint = ();
900
901        fn validate(
902            _: ::fidl_next::Slot<'_, Self>,
903            _: Self::Constraint,
904        ) -> Result<(), ::fidl_next::ValidationError> {
905            Ok(())
906        }
907    }
908
909    unsafe impl ::fidl_next::Wire for ResetToggleWithTimeoutRequest {
910        type Narrowed<'de> = ResetToggleWithTimeoutRequest;
911
912        #[inline]
913        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
914            ::fidl_next::munge! {
915                let Self {
916                    timeout,
917
918                } = &mut *out_;
919            }
920
921            ::fidl_next::Wire::zero_padding(timeout);
922        }
923    }
924
925    unsafe impl<___D> ::fidl_next::Decode<___D> for ResetToggleWithTimeoutRequest
926    where
927        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
928    {
929        fn decode(
930            slot_: ::fidl_next::Slot<'_, Self>,
931            decoder_: &mut ___D,
932            _: (),
933        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
934            ::fidl_next::munge! {
935                let Self {
936                    mut timeout,
937
938                } = slot_;
939            }
940
941            let _field = timeout.as_mut();
942
943            ::fidl_next::Decode::decode(timeout.as_mut(), decoder_, ())?;
944
945            Ok(())
946        }
947    }
948
949    impl ::fidl_next::IntoNatural for ResetToggleWithTimeoutRequest {
950        type Natural = crate::natural::ResetToggleWithTimeoutRequest;
951    }
952
953    /// The wire type corresponding to [`ResetToggleWithTimeoutResponse`].
954    pub type ResetToggleWithTimeoutResponse = ::fidl_next::wire::Unit;
955
956    /// The wire type corresponding to [`ResetStatusResponse`].
957    #[derive(Clone, Debug)]
958    #[repr(C)]
959    pub struct ResetStatusResponse {
960        pub asserted: bool,
961    }
962
963    static_assertions::const_assert_eq!(std::mem::size_of::<ResetStatusResponse>(), 1);
964    static_assertions::const_assert_eq!(std::mem::align_of::<ResetStatusResponse>(), 1);
965
966    static_assertions::const_assert_eq!(std::mem::offset_of!(ResetStatusResponse, asserted), 0);
967
968    impl ::fidl_next::Constrained for ResetStatusResponse {
969        type Constraint = ();
970
971        fn validate(
972            _: ::fidl_next::Slot<'_, Self>,
973            _: Self::Constraint,
974        ) -> Result<(), ::fidl_next::ValidationError> {
975            Ok(())
976        }
977    }
978
979    unsafe impl ::fidl_next::Wire for ResetStatusResponse {
980        type Narrowed<'de> = ResetStatusResponse;
981
982        #[inline]
983        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
984            ::fidl_next::munge! {
985                let Self {
986                    asserted,
987
988                } = &mut *out_;
989            }
990
991            ::fidl_next::Wire::zero_padding(asserted);
992        }
993    }
994
995    unsafe impl<___D> ::fidl_next::Decode<___D> for ResetStatusResponse
996    where
997        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
998    {
999        fn decode(
1000            slot_: ::fidl_next::Slot<'_, Self>,
1001            decoder_: &mut ___D,
1002            _: (),
1003        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1004            ::fidl_next::munge! {
1005                let Self {
1006                    mut asserted,
1007
1008                } = slot_;
1009            }
1010
1011            let _field = asserted.as_mut();
1012
1013            ::fidl_next::Decode::decode(asserted.as_mut(), decoder_, ())?;
1014
1015            Ok(())
1016        }
1017    }
1018
1019    impl ::fidl_next::IntoNatural for ResetStatusResponse {
1020        type Natural = crate::natural::ResetStatusResponse;
1021    }
1022}
1023
1024pub mod wire_optional {}
1025
1026pub mod generic {
1027
1028    /// The generic type corresponding to [`ResetAssertResponse`].
1029    pub type ResetAssertResponse = ();
1030
1031    /// The generic type corresponding to [`ResetDeassertResponse`].
1032    pub type ResetDeassertResponse = ();
1033
1034    /// The generic type corresponding to [`ResetToggleResponse`].
1035    pub type ResetToggleResponse = ();
1036
1037    /// The generic type corresponding to [`ResetToggleWithTimeoutRequest`].
1038    pub struct ResetToggleWithTimeoutRequest<T0> {
1039        pub timeout: T0,
1040    }
1041
1042    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ResetToggleWithTimeoutRequest, ___E>
1043        for ResetToggleWithTimeoutRequest<T0>
1044    where
1045        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1046        T0: ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>,
1047    {
1048        #[inline]
1049        fn encode(
1050            self,
1051            encoder_: &mut ___E,
1052            out_: &mut ::core::mem::MaybeUninit<crate::wire::ResetToggleWithTimeoutRequest>,
1053            _: (),
1054        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1055            ::fidl_next::munge! {
1056                let crate::wire::ResetToggleWithTimeoutRequest {
1057                    timeout,
1058
1059                } = out_;
1060            }
1061
1062            ::fidl_next::Encode::encode(self.timeout, encoder_, timeout, ())?;
1063
1064            Ok(())
1065        }
1066    }
1067
1068    /// The generic type corresponding to [`ResetToggleWithTimeoutResponse`].
1069    pub type ResetToggleWithTimeoutResponse = ();
1070
1071    /// The generic type corresponding to [`ResetStatusResponse`].
1072    pub struct ResetStatusResponse<T0> {
1073        pub asserted: T0,
1074    }
1075
1076    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ResetStatusResponse, ___E>
1077        for ResetStatusResponse<T0>
1078    where
1079        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1080        T0: ::fidl_next::Encode<bool, ___E>,
1081    {
1082        #[inline]
1083        fn encode(
1084            self,
1085            encoder_: &mut ___E,
1086            out_: &mut ::core::mem::MaybeUninit<crate::wire::ResetStatusResponse>,
1087            _: (),
1088        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1089            ::fidl_next::munge! {
1090                let crate::wire::ResetStatusResponse {
1091                    asserted,
1092
1093                } = out_;
1094            }
1095
1096            ::fidl_next::Encode::encode(self.asserted, encoder_, asserted, ())?;
1097
1098            Ok(())
1099        }
1100    }
1101}
1102
1103pub use self::natural::*;
1104
1105/// The type corresponding to the Reset protocol.
1106#[derive(PartialEq, Debug)]
1107pub struct Reset;
1108
1109#[cfg(target_os = "fuchsia")]
1110impl ::fidl_next::HasTransport for Reset {
1111    type Transport = ::fidl_next::fuchsia::zx::Channel;
1112}
1113
1114pub mod reset {
1115    pub mod prelude {
1116        pub use crate::{
1117            Reset, ResetClientHandler, ResetLocalClientHandler, ResetLocalServerHandler,
1118            ResetServerHandler, reset,
1119        };
1120
1121        pub use crate::natural::ResetToggleWithTimeoutRequest;
1122
1123        pub use crate::natural::ResetAssertResponse;
1124
1125        pub use crate::natural::ResetDeassertResponse;
1126
1127        pub use crate::natural::ResetStatusResponse;
1128
1129        pub use crate::natural::ResetToggleWithTimeoutResponse;
1130
1131        pub use crate::natural::ResetToggleResponse;
1132    }
1133
1134    pub struct Assert;
1135
1136    impl ::fidl_next::Method for Assert {
1137        const ORDINAL: u64 = 4465217440581190491;
1138        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1139            ::fidl_next::protocol::Flexibility::Flexible;
1140
1141        type Protocol = crate::Reset;
1142
1143        type Request = ::fidl_next::wire::EmptyMessageBody;
1144    }
1145
1146    impl ::fidl_next::TwoWayMethod for Assert {
1147        type Response = ::fidl_next::wire::FlexibleResult<
1148            'static,
1149            crate::wire::ResetAssertResponse,
1150            ::fidl_next::wire::Int32,
1151        >;
1152    }
1153
1154    impl<___R> ::fidl_next::Respond<___R> for Assert {
1155        type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
1156
1157        fn respond(response: ___R) -> Self::Output {
1158            ::fidl_next::FlexibleResult::Ok(response)
1159        }
1160    }
1161
1162    impl<___R> ::fidl_next::RespondErr<___R> for Assert {
1163        type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
1164
1165        fn respond_err(response: ___R) -> Self::Output {
1166            ::fidl_next::FlexibleResult::Err(response)
1167        }
1168    }
1169
1170    pub struct Deassert;
1171
1172    impl ::fidl_next::Method for Deassert {
1173        const ORDINAL: u64 = 2201398593656438976;
1174        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1175            ::fidl_next::protocol::Flexibility::Flexible;
1176
1177        type Protocol = crate::Reset;
1178
1179        type Request = ::fidl_next::wire::EmptyMessageBody;
1180    }
1181
1182    impl ::fidl_next::TwoWayMethod for Deassert {
1183        type Response = ::fidl_next::wire::FlexibleResult<
1184            'static,
1185            crate::wire::ResetDeassertResponse,
1186            ::fidl_next::wire::Int32,
1187        >;
1188    }
1189
1190    impl<___R> ::fidl_next::Respond<___R> for Deassert {
1191        type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
1192
1193        fn respond(response: ___R) -> Self::Output {
1194            ::fidl_next::FlexibleResult::Ok(response)
1195        }
1196    }
1197
1198    impl<___R> ::fidl_next::RespondErr<___R> for Deassert {
1199        type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
1200
1201        fn respond_err(response: ___R) -> Self::Output {
1202            ::fidl_next::FlexibleResult::Err(response)
1203        }
1204    }
1205
1206    pub struct Toggle;
1207
1208    impl ::fidl_next::Method for Toggle {
1209        const ORDINAL: u64 = 7202640818393894049;
1210        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1211            ::fidl_next::protocol::Flexibility::Flexible;
1212
1213        type Protocol = crate::Reset;
1214
1215        type Request = ::fidl_next::wire::EmptyMessageBody;
1216    }
1217
1218    impl ::fidl_next::TwoWayMethod for Toggle {
1219        type Response = ::fidl_next::wire::FlexibleResult<
1220            'static,
1221            crate::wire::ResetToggleResponse,
1222            ::fidl_next::wire::Int32,
1223        >;
1224    }
1225
1226    impl<___R> ::fidl_next::Respond<___R> for Toggle {
1227        type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
1228
1229        fn respond(response: ___R) -> Self::Output {
1230            ::fidl_next::FlexibleResult::Ok(response)
1231        }
1232    }
1233
1234    impl<___R> ::fidl_next::RespondErr<___R> for Toggle {
1235        type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
1236
1237        fn respond_err(response: ___R) -> Self::Output {
1238            ::fidl_next::FlexibleResult::Err(response)
1239        }
1240    }
1241
1242    pub struct ToggleWithTimeout;
1243
1244    impl ::fidl_next::Method for ToggleWithTimeout {
1245        const ORDINAL: u64 = 2752273376724270908;
1246        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1247            ::fidl_next::protocol::Flexibility::Flexible;
1248
1249        type Protocol = crate::Reset;
1250
1251        type Request = crate::wire::ResetToggleWithTimeoutRequest;
1252    }
1253
1254    impl ::fidl_next::TwoWayMethod for ToggleWithTimeout {
1255        type Response = ::fidl_next::wire::FlexibleResult<
1256            'static,
1257            crate::wire::ResetToggleWithTimeoutResponse,
1258            ::fidl_next::wire::Int32,
1259        >;
1260    }
1261
1262    impl<___R> ::fidl_next::Respond<___R> for ToggleWithTimeout {
1263        type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
1264
1265        fn respond(response: ___R) -> Self::Output {
1266            ::fidl_next::FlexibleResult::Ok(response)
1267        }
1268    }
1269
1270    impl<___R> ::fidl_next::RespondErr<___R> for ToggleWithTimeout {
1271        type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
1272
1273        fn respond_err(response: ___R) -> Self::Output {
1274            ::fidl_next::FlexibleResult::Err(response)
1275        }
1276    }
1277
1278    pub struct Status;
1279
1280    impl ::fidl_next::Method for Status {
1281        const ORDINAL: u64 = 5845269014468013895;
1282        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1283            ::fidl_next::protocol::Flexibility::Flexible;
1284
1285        type Protocol = crate::Reset;
1286
1287        type Request = ::fidl_next::wire::EmptyMessageBody;
1288    }
1289
1290    impl ::fidl_next::TwoWayMethod for Status {
1291        type Response = ::fidl_next::wire::FlexibleResult<
1292            'static,
1293            crate::wire::ResetStatusResponse,
1294            ::fidl_next::wire::Int32,
1295        >;
1296    }
1297
1298    impl<___R> ::fidl_next::Respond<___R> for Status {
1299        type Output = ::fidl_next::FlexibleResult<
1300            crate::generic::ResetStatusResponse<___R>,
1301            ::fidl_next::util::Never,
1302        >;
1303
1304        fn respond(response: ___R) -> Self::Output {
1305            ::fidl_next::FlexibleResult::Ok(crate::generic::ResetStatusResponse {
1306                asserted: response,
1307            })
1308        }
1309    }
1310
1311    impl<___R> ::fidl_next::RespondErr<___R> for Status {
1312        type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
1313
1314        fn respond_err(response: ___R) -> Self::Output {
1315            ::fidl_next::FlexibleResult::Err(response)
1316        }
1317    }
1318
1319    mod ___detail {
1320        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Reset
1321        where
1322            ___T: ::fidl_next::Transport,
1323        {
1324            type Client = ResetClient<___T>;
1325            type Server = ResetServer<___T>;
1326        }
1327
1328        /// The client for the `Reset` protocol.
1329        #[repr(transparent)]
1330        pub struct ResetClient<___T: ::fidl_next::Transport> {
1331            #[allow(dead_code)]
1332            client: ::fidl_next::protocol::Client<___T>,
1333        }
1334
1335        impl<___T> ResetClient<___T>
1336        where
1337            ___T: ::fidl_next::Transport,
1338        {
1339            #[doc = " Asserts the reset pin and leaves it asserted until `Deassert` is called.\n"]
1340            pub fn assert(&self) -> ::fidl_next::TwoWayFuture<'_, super::Assert, ___T> {
1341                ::fidl_next::TwoWayFuture::from_untyped(
1342                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
1343                        4465217440581190491,
1344                        <super::Assert as ::fidl_next::Method>::FLEXIBILITY,
1345                        (),
1346                    ),
1347                )
1348            }
1349
1350            #[doc = " Deasserts the reset pin.\n"]
1351            pub fn deassert(&self) -> ::fidl_next::TwoWayFuture<'_, super::Deassert, ___T> {
1352                ::fidl_next::TwoWayFuture::from_untyped(
1353                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
1354                        2201398593656438976,
1355                        <super::Deassert as ::fidl_next::Method>::FLEXIBILITY,
1356                        (),
1357                    ),
1358                )
1359            }
1360
1361            #[doc = " These methods assert the pin, wait a predetermined amount of time, and then deassert the\n pin. The difference between `Toggle` and `ToggleWithTimeout` is that `Toggle` defers to the\n Reset driver to choose the timeout duration and `ToggleWithTimeout` allows the client to\n specify the timeout.\n"]
1362            pub fn toggle(&self) -> ::fidl_next::TwoWayFuture<'_, super::Toggle, ___T> {
1363                ::fidl_next::TwoWayFuture::from_untyped(
1364                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
1365                        7202640818393894049,
1366                        <super::Toggle as ::fidl_next::Method>::FLEXIBILITY,
1367                        (),
1368                    ),
1369                )
1370            }
1371
1372            pub fn toggle_with_timeout(
1373                &self,
1374
1375                timeout: impl ::fidl_next::Encode<
1376                    ::fidl_next::wire::Int64,
1377                    <___T as ::fidl_next::Transport>::SendBuffer,
1378                >,
1379            ) -> ::fidl_next::TwoWayFuture<'_, super::ToggleWithTimeout, ___T>
1380            where
1381                <___T as ::fidl_next::Transport>::SendBuffer:
1382                    ::fidl_next::encoder::InternalHandleEncoder,
1383            {
1384                self.toggle_with_timeout_with(crate::generic::ResetToggleWithTimeoutRequest {
1385                    timeout,
1386                })
1387            }
1388
1389            pub fn toggle_with_timeout_with<___R>(
1390                &self,
1391                request: ___R,
1392            ) -> ::fidl_next::TwoWayFuture<'_, super::ToggleWithTimeout, ___T>
1393            where
1394                ___R: ::fidl_next::Encode<
1395                        crate::wire::ResetToggleWithTimeoutRequest,
1396                        <___T as ::fidl_next::Transport>::SendBuffer,
1397                    >,
1398            {
1399                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1400                    2752273376724270908,
1401                    <super::ToggleWithTimeout as ::fidl_next::Method>::FLEXIBILITY,
1402                    request,
1403                ))
1404            }
1405
1406            pub fn status(&self) -> ::fidl_next::TwoWayFuture<'_, super::Status, ___T> {
1407                ::fidl_next::TwoWayFuture::from_untyped(
1408                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
1409                        5845269014468013895,
1410                        <super::Status as ::fidl_next::Method>::FLEXIBILITY,
1411                        (),
1412                    ),
1413                )
1414            }
1415        }
1416
1417        /// The server for the `Reset` protocol.
1418        #[repr(transparent)]
1419        pub struct ResetServer<___T: ::fidl_next::Transport> {
1420            server: ::fidl_next::protocol::Server<___T>,
1421        }
1422
1423        impl<___T> ResetServer<___T> where ___T: ::fidl_next::Transport {}
1424    }
1425}
1426
1427#[diagnostic::on_unimplemented(
1428    note = "If {Self} implements the non-local ResetClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1429)]
1430
1431/// A client handler for the Reset protocol.
1432///
1433/// See [`Reset`] for more details.
1434pub trait ResetLocalClientHandler<
1435    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1436    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1437>
1438{
1439    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1440        ::core::future::ready(())
1441    }
1442}
1443
1444impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Reset
1445where
1446    ___H: ResetLocalClientHandler<___T>,
1447    ___T: ::fidl_next::Transport,
1448{
1449    async fn on_event(
1450        handler: &mut ___H,
1451        ordinal: u64,
1452        flexibility: ::fidl_next::protocol::Flexibility,
1453        body: ::fidl_next::Body<___T>,
1454    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1455        match ordinal {
1456            ordinal => {
1457                handler.on_unknown_interaction(ordinal).await;
1458                if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1459                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1460                } else {
1461                    Ok(())
1462                }
1463            }
1464        }
1465    }
1466}
1467
1468#[diagnostic::on_unimplemented(
1469    note = "If {Self} implements the non-local ResetServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
1470)]
1471
1472/// A server handler for the Reset protocol.
1473///
1474/// See [`Reset`] for more details.
1475pub trait ResetLocalServerHandler<
1476    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1477    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1478>
1479{
1480    #[doc = " Asserts the reset pin and leaves it asserted until `Deassert` is called.\n"]
1481    fn assert(
1482        &mut self,
1483
1484        responder: ::fidl_next::Responder<reset::Assert, ___T>,
1485    ) -> impl ::core::future::Future<Output = ()>;
1486
1487    #[doc = " Deasserts the reset pin.\n"]
1488    fn deassert(
1489        &mut self,
1490
1491        responder: ::fidl_next::Responder<reset::Deassert, ___T>,
1492    ) -> impl ::core::future::Future<Output = ()>;
1493
1494    #[doc = " These methods assert the pin, wait a predetermined amount of time, and then deassert the\n pin. The difference between `Toggle` and `ToggleWithTimeout` is that `Toggle` defers to the\n Reset driver to choose the timeout duration and `ToggleWithTimeout` allows the client to\n specify the timeout.\n"]
1495    fn toggle(
1496        &mut self,
1497
1498        responder: ::fidl_next::Responder<reset::Toggle, ___T>,
1499    ) -> impl ::core::future::Future<Output = ()>;
1500
1501    fn toggle_with_timeout(
1502        &mut self,
1503
1504        request: ::fidl_next::Request<reset::ToggleWithTimeout, ___T>,
1505
1506        responder: ::fidl_next::Responder<reset::ToggleWithTimeout, ___T>,
1507    ) -> impl ::core::future::Future<Output = ()>;
1508
1509    fn status(
1510        &mut self,
1511
1512        responder: ::fidl_next::Responder<reset::Status, ___T>,
1513    ) -> impl ::core::future::Future<Output = ()>;
1514
1515    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1516        ::core::future::ready(())
1517    }
1518}
1519
1520impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Reset
1521where
1522    ___H: ResetLocalServerHandler<___T>,
1523    ___T: ::fidl_next::Transport,
1524    for<'de> crate::wire::ResetToggleWithTimeoutRequest: ::fidl_next::Decode<
1525            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1526            Constraint = (),
1527        >,
1528{
1529    async fn on_one_way(
1530        handler: &mut ___H,
1531        ordinal: u64,
1532        flexibility: ::fidl_next::protocol::Flexibility,
1533        body: ::fidl_next::Body<___T>,
1534    ) -> ::core::result::Result<
1535        (),
1536        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1537    > {
1538        match ordinal {
1539            ordinal => {
1540                handler.on_unknown_interaction(ordinal).await;
1541                if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1542                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1543                } else {
1544                    Ok(())
1545                }
1546            }
1547        }
1548    }
1549
1550    async fn on_two_way(
1551        handler: &mut ___H,
1552        ordinal: u64,
1553        flexibility: ::fidl_next::protocol::Flexibility,
1554        body: ::fidl_next::Body<___T>,
1555        responder: ::fidl_next::protocol::Responder<___T>,
1556    ) -> ::core::result::Result<
1557        (),
1558        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1559    > {
1560        match ordinal {
1561            4465217440581190491 => {
1562                let responder = ::fidl_next::Responder::from_untyped(responder);
1563
1564                handler.assert(responder).await;
1565                Ok(())
1566            }
1567
1568            2201398593656438976 => {
1569                let responder = ::fidl_next::Responder::from_untyped(responder);
1570
1571                handler.deassert(responder).await;
1572                Ok(())
1573            }
1574
1575            7202640818393894049 => {
1576                let responder = ::fidl_next::Responder::from_untyped(responder);
1577
1578                handler.toggle(responder).await;
1579                Ok(())
1580            }
1581
1582            2752273376724270908 => {
1583                let responder = ::fidl_next::Responder::from_untyped(responder);
1584
1585                match ::fidl_next::AsDecoderExt::into_decoded(body) {
1586                    Ok(decoded) => {
1587                        handler
1588                            .toggle_with_timeout(
1589                                ::fidl_next::Request::from_decoded(decoded),
1590                                responder,
1591                            )
1592                            .await;
1593                        Ok(())
1594                    }
1595                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1596                        ordinal: 2752273376724270908,
1597                        error,
1598                    }),
1599                }
1600            }
1601
1602            5845269014468013895 => {
1603                let responder = ::fidl_next::Responder::from_untyped(responder);
1604
1605                handler.status(responder).await;
1606                Ok(())
1607            }
1608
1609            ordinal => {
1610                handler.on_unknown_interaction(ordinal).await;
1611                if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1612                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1613                } else {
1614                    responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
1615                                ordinal,
1616                                flexibility,
1617                                ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
1618                            )
1619                            .expect("encoding a framework error should never fail")
1620                            .await?;
1621                    Ok(())
1622                }
1623            }
1624        }
1625    }
1626}
1627
1628/// A client handler for the Reset protocol.
1629///
1630/// See [`Reset`] for more details.
1631pub trait ResetClientHandler<
1632    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1633    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1634>
1635{
1636    fn on_unknown_interaction(
1637        &mut self,
1638        ordinal: u64,
1639    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1640        ::core::future::ready(())
1641    }
1642}
1643
1644impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Reset
1645where
1646    ___H: ResetClientHandler<___T> + ::core::marker::Send,
1647    ___T: ::fidl_next::Transport,
1648{
1649    async fn on_event(
1650        handler: &mut ___H,
1651        ordinal: u64,
1652        flexibility: ::fidl_next::protocol::Flexibility,
1653        body: ::fidl_next::Body<___T>,
1654    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1655        match ordinal {
1656            ordinal => {
1657                handler.on_unknown_interaction(ordinal).await;
1658                if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1659                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1660                } else {
1661                    Ok(())
1662                }
1663            }
1664        }
1665    }
1666}
1667
1668/// A server handler for the Reset protocol.
1669///
1670/// See [`Reset`] for more details.
1671pub trait ResetServerHandler<
1672    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1673    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1674>
1675{
1676    #[doc = " Asserts the reset pin and leaves it asserted until `Deassert` is called.\n"]
1677    fn assert(
1678        &mut self,
1679
1680        responder: ::fidl_next::Responder<reset::Assert, ___T>,
1681    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1682
1683    #[doc = " Deasserts the reset pin.\n"]
1684    fn deassert(
1685        &mut self,
1686
1687        responder: ::fidl_next::Responder<reset::Deassert, ___T>,
1688    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1689
1690    #[doc = " These methods assert the pin, wait a predetermined amount of time, and then deassert the\n pin. The difference between `Toggle` and `ToggleWithTimeout` is that `Toggle` defers to the\n Reset driver to choose the timeout duration and `ToggleWithTimeout` allows the client to\n specify the timeout.\n"]
1691    fn toggle(
1692        &mut self,
1693
1694        responder: ::fidl_next::Responder<reset::Toggle, ___T>,
1695    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1696
1697    fn toggle_with_timeout(
1698        &mut self,
1699
1700        request: ::fidl_next::Request<reset::ToggleWithTimeout, ___T>,
1701
1702        responder: ::fidl_next::Responder<reset::ToggleWithTimeout, ___T>,
1703    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1704
1705    fn status(
1706        &mut self,
1707
1708        responder: ::fidl_next::Responder<reset::Status, ___T>,
1709    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1710
1711    fn on_unknown_interaction(
1712        &mut self,
1713        ordinal: u64,
1714    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1715        ::core::future::ready(())
1716    }
1717}
1718
1719impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Reset
1720where
1721    ___H: ResetServerHandler<___T> + ::core::marker::Send,
1722    ___T: ::fidl_next::Transport,
1723    for<'de> crate::wire::ResetToggleWithTimeoutRequest: ::fidl_next::Decode<
1724            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1725            Constraint = (),
1726        >,
1727{
1728    async fn on_one_way(
1729        handler: &mut ___H,
1730        ordinal: u64,
1731        flexibility: ::fidl_next::protocol::Flexibility,
1732        body: ::fidl_next::Body<___T>,
1733    ) -> ::core::result::Result<
1734        (),
1735        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1736    > {
1737        match ordinal {
1738            ordinal => {
1739                handler.on_unknown_interaction(ordinal).await;
1740                if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1741                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1742                } else {
1743                    Ok(())
1744                }
1745            }
1746        }
1747    }
1748
1749    async fn on_two_way(
1750        handler: &mut ___H,
1751        ordinal: u64,
1752        flexibility: ::fidl_next::protocol::Flexibility,
1753        body: ::fidl_next::Body<___T>,
1754        responder: ::fidl_next::protocol::Responder<___T>,
1755    ) -> ::core::result::Result<
1756        (),
1757        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1758    > {
1759        match ordinal {
1760            4465217440581190491 => {
1761                let responder = ::fidl_next::Responder::from_untyped(responder);
1762
1763                handler.assert(responder).await;
1764                Ok(())
1765            }
1766
1767            2201398593656438976 => {
1768                let responder = ::fidl_next::Responder::from_untyped(responder);
1769
1770                handler.deassert(responder).await;
1771                Ok(())
1772            }
1773
1774            7202640818393894049 => {
1775                let responder = ::fidl_next::Responder::from_untyped(responder);
1776
1777                handler.toggle(responder).await;
1778                Ok(())
1779            }
1780
1781            2752273376724270908 => {
1782                let responder = ::fidl_next::Responder::from_untyped(responder);
1783
1784                match ::fidl_next::AsDecoderExt::into_decoded(body) {
1785                    Ok(decoded) => {
1786                        handler
1787                            .toggle_with_timeout(
1788                                ::fidl_next::Request::from_decoded(decoded),
1789                                responder,
1790                            )
1791                            .await;
1792                        Ok(())
1793                    }
1794                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1795                        ordinal: 2752273376724270908,
1796                        error,
1797                    }),
1798                }
1799            }
1800
1801            5845269014468013895 => {
1802                let responder = ::fidl_next::Responder::from_untyped(responder);
1803
1804                handler.status(responder).await;
1805                Ok(())
1806            }
1807
1808            ordinal => {
1809                handler.on_unknown_interaction(ordinal).await;
1810                if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1811                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1812                } else {
1813                    responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
1814                                ordinal,
1815                                flexibility,
1816                                ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
1817                            )
1818                            .expect("encoding a framework error should never fail")
1819                            .await?;
1820                    Ok(())
1821                }
1822            }
1823        }
1824    }
1825}
1826
1827impl<___T> ResetClientHandler<___T> for ::fidl_next::IgnoreEvents
1828where
1829    ___T: ::fidl_next::Transport,
1830{
1831    async fn on_unknown_interaction(&mut self, _: u64) {}
1832}
1833
1834impl<___H, ___T> ResetLocalClientHandler<___T> for ::fidl_next::Local<___H>
1835where
1836    ___H: ResetClientHandler<___T>,
1837    ___T: ::fidl_next::Transport,
1838{
1839    async fn on_unknown_interaction(&mut self, ordinal: u64) {
1840        ___H::on_unknown_interaction(&mut self.0, ordinal).await
1841    }
1842}
1843
1844impl<___H, ___T> ResetLocalServerHandler<___T> for ::fidl_next::Local<___H>
1845where
1846    ___H: ResetServerHandler<___T>,
1847    ___T: ::fidl_next::Transport,
1848{
1849    async fn assert(&mut self, responder: ::fidl_next::Responder<reset::Assert, ___T>) {
1850        ___H::assert(&mut self.0, responder).await
1851    }
1852
1853    async fn deassert(&mut self, responder: ::fidl_next::Responder<reset::Deassert, ___T>) {
1854        ___H::deassert(&mut self.0, responder).await
1855    }
1856
1857    async fn toggle(&mut self, responder: ::fidl_next::Responder<reset::Toggle, ___T>) {
1858        ___H::toggle(&mut self.0, responder).await
1859    }
1860
1861    async fn toggle_with_timeout(
1862        &mut self,
1863
1864        request: ::fidl_next::Request<reset::ToggleWithTimeout, ___T>,
1865
1866        responder: ::fidl_next::Responder<reset::ToggleWithTimeout, ___T>,
1867    ) {
1868        ___H::toggle_with_timeout(&mut self.0, request, responder).await
1869    }
1870
1871    async fn status(&mut self, responder: ::fidl_next::Responder<reset::Status, ___T>) {
1872        ___H::status(&mut self.0, responder).await
1873    }
1874
1875    async fn on_unknown_interaction(&mut self, ordinal: u64) {
1876        ___H::on_unknown_interaction(&mut self.0, ordinal).await
1877    }
1878}