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