Skip to main content

fidl_next_common_fuchsia_hardware_pin/
fidl_next_common_fuchsia_hardware_pin.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    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8    #[repr(u32)]
9    pub enum DriveType {
10        PushPull = 0,
11        OpenDrain = 1,
12        OpenSource = 2,
13        UnknownOrdinal_(u32) = 3,
14    }
15    impl ::std::convert::From<u32> for DriveType {
16        fn from(value: u32) -> Self {
17            match value {
18                0 => Self::PushPull,
19                1 => Self::OpenDrain,
20                2 => Self::OpenSource,
21
22                _ => Self::UnknownOrdinal_(value),
23            }
24        }
25    }
26
27    impl ::std::convert::From<DriveType> for u32 {
28        fn from(value: DriveType) -> Self {
29            match value {
30                DriveType::PushPull => 0,
31                DriveType::OpenDrain => 1,
32                DriveType::OpenSource => 2,
33
34                DriveType::UnknownOrdinal_(value) => value,
35            }
36        }
37    }
38
39    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DriveType, ___E> for DriveType
40    where
41        ___E: ?Sized,
42    {
43        #[inline]
44        fn encode(
45            self,
46            encoder: &mut ___E,
47            out: &mut ::core::mem::MaybeUninit<crate::wire::DriveType>,
48            _: (),
49        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
50            ::fidl_next::Encode::encode(&self, encoder, out, ())
51        }
52    }
53
54    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DriveType, ___E> for &'a DriveType
55    where
56        ___E: ?Sized,
57    {
58        #[inline]
59        fn encode(
60            self,
61            encoder: &mut ___E,
62            out: &mut ::core::mem::MaybeUninit<crate::wire::DriveType>,
63            _: (),
64        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
65            ::fidl_next::munge!(let crate::wire::DriveType { value } = out);
66            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
67                DriveType::PushPull => 0,
68
69                DriveType::OpenDrain => 1,
70
71                DriveType::OpenSource => 2,
72
73                DriveType::UnknownOrdinal_(value) => value,
74            }));
75
76            Ok(())
77        }
78    }
79
80    impl ::core::convert::From<crate::wire::DriveType> for DriveType {
81        fn from(wire: crate::wire::DriveType) -> Self {
82            match u32::from(wire.value) {
83                0 => Self::PushPull,
84
85                1 => Self::OpenDrain,
86
87                2 => Self::OpenSource,
88
89                value => Self::UnknownOrdinal_(value),
90            }
91        }
92    }
93
94    impl ::fidl_next::FromWire<crate::wire::DriveType> for DriveType {
95        #[inline]
96        fn from_wire(wire: crate::wire::DriveType) -> Self {
97            Self::from(wire)
98        }
99    }
100
101    impl ::fidl_next::FromWireRef<crate::wire::DriveType> for DriveType {
102        #[inline]
103        fn from_wire_ref(wire: &crate::wire::DriveType) -> Self {
104            Self::from(*wire)
105        }
106    }
107
108    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
109    #[repr(u32)]
110    pub enum Pull {
111        Down = 0,
112        Up = 1,
113        None = 2,
114        BusHold = 3,
115    }
116    impl ::core::convert::TryFrom<u32> for Pull {
117        type Error = ::fidl_next::UnknownStrictEnumMemberError;
118        fn try_from(
119            value: u32,
120        ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
121            match value {
122                0 => Ok(Self::Down),
123                1 => Ok(Self::Up),
124                2 => Ok(Self::None),
125                3 => Ok(Self::BusHold),
126
127                _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
128            }
129        }
130    }
131
132    impl ::std::convert::From<Pull> for u32 {
133        fn from(value: Pull) -> Self {
134            match value {
135                Pull::Down => 0,
136                Pull::Up => 1,
137                Pull::None => 2,
138                Pull::BusHold => 3,
139            }
140        }
141    }
142
143    unsafe impl<___E> ::fidl_next::Encode<crate::wire::Pull, ___E> for Pull
144    where
145        ___E: ?Sized,
146    {
147        #[inline]
148        fn encode(
149            self,
150            encoder: &mut ___E,
151            out: &mut ::core::mem::MaybeUninit<crate::wire::Pull>,
152            _: (),
153        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
154            ::fidl_next::Encode::encode(&self, encoder, out, ())
155        }
156    }
157
158    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Pull, ___E> for &'a Pull
159    where
160        ___E: ?Sized,
161    {
162        #[inline]
163        fn encode(
164            self,
165            encoder: &mut ___E,
166            out: &mut ::core::mem::MaybeUninit<crate::wire::Pull>,
167            _: (),
168        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
169            ::fidl_next::munge!(let crate::wire::Pull { value } = out);
170            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
171                Pull::Down => 0,
172
173                Pull::Up => 1,
174
175                Pull::None => 2,
176
177                Pull::BusHold => 3,
178            }));
179
180            Ok(())
181        }
182    }
183
184    impl ::core::convert::From<crate::wire::Pull> for Pull {
185        fn from(wire: crate::wire::Pull) -> Self {
186            match u32::from(wire.value) {
187                0 => Self::Down,
188
189                1 => Self::Up,
190
191                2 => Self::None,
192
193                3 => Self::BusHold,
194
195                _ => unsafe { ::core::hint::unreachable_unchecked() },
196            }
197        }
198    }
199
200    impl ::fidl_next::FromWire<crate::wire::Pull> for Pull {
201        #[inline]
202        fn from_wire(wire: crate::wire::Pull) -> Self {
203            Self::from(wire)
204        }
205    }
206
207    impl ::fidl_next::FromWireRef<crate::wire::Pull> for Pull {
208        #[inline]
209        fn from_wire_ref(wire: &crate::wire::Pull) -> Self {
210            Self::from(*wire)
211        }
212    }
213
214    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
215    pub struct Configuration {
216        pub pull: ::core::option::Option<crate::natural::Pull>,
217
218        pub function: ::core::option::Option<u64>,
219
220        pub drive_strength_ua: ::core::option::Option<u64>,
221
222        pub drive_type: ::core::option::Option<crate::natural::DriveType>,
223
224        pub power_source: ::core::option::Option<u64>,
225
226        pub wake_vector: ::core::option::Option<bool>,
227
228        pub slew_rate: ::core::option::Option<u64>,
229
230        pub function_name: ::core::option::Option<::std::string::String>,
231
232        pub drive_strength: ::core::option::Option<u64>,
233    }
234
235    impl Configuration {
236        fn __max_ordinal(&self) -> usize {
237            if self.drive_strength.is_some() {
238                return 9;
239            }
240
241            if self.function_name.is_some() {
242                return 8;
243            }
244
245            if self.slew_rate.is_some() {
246                return 7;
247            }
248
249            if self.wake_vector.is_some() {
250                return 6;
251            }
252
253            if self.power_source.is_some() {
254                return 5;
255            }
256
257            if self.drive_type.is_some() {
258                return 4;
259            }
260
261            if self.drive_strength_ua.is_some() {
262                return 3;
263            }
264
265            if self.function.is_some() {
266                return 2;
267            }
268
269            if self.pull.is_some() {
270                return 1;
271            }
272
273            0
274        }
275    }
276
277    unsafe impl<___E> ::fidl_next::Encode<crate::wire::Configuration<'static>, ___E> for Configuration
278    where
279        ___E: ::fidl_next::Encoder + ?Sized,
280    {
281        #[inline]
282        fn encode(
283            mut self,
284            encoder: &mut ___E,
285            out: &mut ::core::mem::MaybeUninit<crate::wire::Configuration<'static>>,
286            _: (),
287        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
288            ::fidl_next::munge!(let crate::wire::Configuration { table } = out);
289
290            let max_ord = self.__max_ordinal();
291
292            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
293            ::fidl_next::Wire::zero_padding(&mut out);
294
295            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
296                ::fidl_next::wire::Envelope,
297            >(encoder, max_ord);
298
299            for i in 1..=max_ord {
300                match i {
301                    9 => {
302                        if let Some(value) = self.drive_strength.take() {
303                            ::fidl_next::wire::Envelope::encode_value::<
304                                ::fidl_next::wire::Uint64,
305                                ___E,
306                            >(
307                                value, preallocated.encoder, &mut out, ()
308                            )?;
309                        } else {
310                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
311                        }
312                    }
313
314                    8 => {
315                        if let Some(value) = self.function_name.take() {
316                            ::fidl_next::wire::Envelope::encode_value::<
317                                ::fidl_next::wire::String<'static>,
318                                ___E,
319                            >(
320                                value, preallocated.encoder, &mut out, 32
321                            )?;
322                        } else {
323                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
324                        }
325                    }
326
327                    7 => {
328                        if let Some(value) = self.slew_rate.take() {
329                            ::fidl_next::wire::Envelope::encode_value::<
330                                ::fidl_next::wire::Uint64,
331                                ___E,
332                            >(
333                                value, preallocated.encoder, &mut out, ()
334                            )?;
335                        } else {
336                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
337                        }
338                    }
339
340                    6 => {
341                        if let Some(value) = self.wake_vector.take() {
342                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
343                                value,
344                                preallocated.encoder,
345                                &mut out,
346                                (),
347                            )?;
348                        } else {
349                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
350                        }
351                    }
352
353                    5 => {
354                        if let Some(value) = self.power_source.take() {
355                            ::fidl_next::wire::Envelope::encode_value::<
356                                ::fidl_next::wire::Uint64,
357                                ___E,
358                            >(
359                                value, preallocated.encoder, &mut out, ()
360                            )?;
361                        } else {
362                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
363                        }
364                    }
365
366                    4 => {
367                        if let Some(value) = self.drive_type.take() {
368                            ::fidl_next::wire::Envelope::encode_value::<
369                                crate::wire::DriveType,
370                                ___E,
371                            >(
372                                value, preallocated.encoder, &mut out, ()
373                            )?;
374                        } else {
375                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
376                        }
377                    }
378
379                    3 => {
380                        if let Some(value) = self.drive_strength_ua.take() {
381                            ::fidl_next::wire::Envelope::encode_value::<
382                                ::fidl_next::wire::Uint64,
383                                ___E,
384                            >(
385                                value, preallocated.encoder, &mut out, ()
386                            )?;
387                        } else {
388                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
389                        }
390                    }
391
392                    2 => {
393                        if let Some(value) = self.function.take() {
394                            ::fidl_next::wire::Envelope::encode_value::<
395                                ::fidl_next::wire::Uint64,
396                                ___E,
397                            >(
398                                value, preallocated.encoder, &mut out, ()
399                            )?;
400                        } else {
401                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
402                        }
403                    }
404
405                    1 => {
406                        if let Some(value) = self.pull.take() {
407                            ::fidl_next::wire::Envelope::encode_value::<crate::wire::Pull, ___E>(
408                                value,
409                                preallocated.encoder,
410                                &mut out,
411                                (),
412                            )?;
413                        } else {
414                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
415                        }
416                    }
417
418                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
419                }
420                unsafe {
421                    preallocated.write_next(out.assume_init_ref());
422                }
423            }
424
425            ::fidl_next::wire::Table::encode_len(table, max_ord);
426
427            Ok(())
428        }
429    }
430
431    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Configuration<'static>, ___E>
432        for &'a Configuration
433    where
434        ___E: ::fidl_next::Encoder + ?Sized,
435    {
436        #[inline]
437        fn encode(
438            self,
439            encoder: &mut ___E,
440            out: &mut ::core::mem::MaybeUninit<crate::wire::Configuration<'static>>,
441            _: (),
442        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
443            ::fidl_next::munge!(let crate::wire::Configuration { table } = out);
444
445            let max_ord = self.__max_ordinal();
446
447            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
448            ::fidl_next::Wire::zero_padding(&mut out);
449
450            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
451                ::fidl_next::wire::Envelope,
452            >(encoder, max_ord);
453
454            for i in 1..=max_ord {
455                match i {
456                    9 => {
457                        if let Some(value) = &self.drive_strength {
458                            ::fidl_next::wire::Envelope::encode_value::<
459                                ::fidl_next::wire::Uint64,
460                                ___E,
461                            >(
462                                value, preallocated.encoder, &mut out, ()
463                            )?;
464                        } else {
465                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
466                        }
467                    }
468
469                    8 => {
470                        if let Some(value) = &self.function_name {
471                            ::fidl_next::wire::Envelope::encode_value::<
472                                ::fidl_next::wire::String<'static>,
473                                ___E,
474                            >(
475                                value, preallocated.encoder, &mut out, 32
476                            )?;
477                        } else {
478                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
479                        }
480                    }
481
482                    7 => {
483                        if let Some(value) = &self.slew_rate {
484                            ::fidl_next::wire::Envelope::encode_value::<
485                                ::fidl_next::wire::Uint64,
486                                ___E,
487                            >(
488                                value, preallocated.encoder, &mut out, ()
489                            )?;
490                        } else {
491                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
492                        }
493                    }
494
495                    6 => {
496                        if let Some(value) = &self.wake_vector {
497                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
498                                value,
499                                preallocated.encoder,
500                                &mut out,
501                                (),
502                            )?;
503                        } else {
504                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
505                        }
506                    }
507
508                    5 => {
509                        if let Some(value) = &self.power_source {
510                            ::fidl_next::wire::Envelope::encode_value::<
511                                ::fidl_next::wire::Uint64,
512                                ___E,
513                            >(
514                                value, preallocated.encoder, &mut out, ()
515                            )?;
516                        } else {
517                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
518                        }
519                    }
520
521                    4 => {
522                        if let Some(value) = &self.drive_type {
523                            ::fidl_next::wire::Envelope::encode_value::<
524                                crate::wire::DriveType,
525                                ___E,
526                            >(
527                                value, preallocated.encoder, &mut out, ()
528                            )?;
529                        } else {
530                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
531                        }
532                    }
533
534                    3 => {
535                        if let Some(value) = &self.drive_strength_ua {
536                            ::fidl_next::wire::Envelope::encode_value::<
537                                ::fidl_next::wire::Uint64,
538                                ___E,
539                            >(
540                                value, preallocated.encoder, &mut out, ()
541                            )?;
542                        } else {
543                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
544                        }
545                    }
546
547                    2 => {
548                        if let Some(value) = &self.function {
549                            ::fidl_next::wire::Envelope::encode_value::<
550                                ::fidl_next::wire::Uint64,
551                                ___E,
552                            >(
553                                value, preallocated.encoder, &mut out, ()
554                            )?;
555                        } else {
556                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
557                        }
558                    }
559
560                    1 => {
561                        if let Some(value) = &self.pull {
562                            ::fidl_next::wire::Envelope::encode_value::<crate::wire::Pull, ___E>(
563                                value,
564                                preallocated.encoder,
565                                &mut out,
566                                (),
567                            )?;
568                        } else {
569                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
570                        }
571                    }
572
573                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
574                }
575                unsafe {
576                    preallocated.write_next(out.assume_init_ref());
577                }
578            }
579
580            ::fidl_next::wire::Table::encode_len(table, max_ord);
581
582            Ok(())
583        }
584    }
585
586    impl<'de> ::fidl_next::FromWire<crate::wire::Configuration<'de>> for Configuration {
587        #[inline]
588        fn from_wire(wire_: crate::wire::Configuration<'de>) -> Self {
589            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
590
591            let pull = wire_.table.get(1);
592
593            let function = wire_.table.get(2);
594
595            let drive_strength_ua = wire_.table.get(3);
596
597            let drive_type = wire_.table.get(4);
598
599            let power_source = wire_.table.get(5);
600
601            let wake_vector = wire_.table.get(6);
602
603            let slew_rate = wire_.table.get(7);
604
605            let function_name = wire_.table.get(8);
606
607            let drive_strength = wire_.table.get(9);
608
609            Self {
610                pull: pull.map(|envelope| {
611                    ::fidl_next::FromWire::from_wire(unsafe {
612                        envelope.read_unchecked::<crate::wire::Pull>()
613                    })
614                }),
615
616                function: function.map(|envelope| {
617                    ::fidl_next::FromWire::from_wire(unsafe {
618                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
619                    })
620                }),
621
622                drive_strength_ua: drive_strength_ua.map(|envelope| {
623                    ::fidl_next::FromWire::from_wire(unsafe {
624                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
625                    })
626                }),
627
628                drive_type: drive_type.map(|envelope| {
629                    ::fidl_next::FromWire::from_wire(unsafe {
630                        envelope.read_unchecked::<crate::wire::DriveType>()
631                    })
632                }),
633
634                power_source: power_source.map(|envelope| {
635                    ::fidl_next::FromWire::from_wire(unsafe {
636                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
637                    })
638                }),
639
640                wake_vector: wake_vector.map(|envelope| {
641                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
642                }),
643
644                slew_rate: slew_rate.map(|envelope| {
645                    ::fidl_next::FromWire::from_wire(unsafe {
646                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
647                    })
648                }),
649
650                function_name: function_name.map(|envelope| {
651                    ::fidl_next::FromWire::from_wire(unsafe {
652                        envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
653                    })
654                }),
655
656                drive_strength: drive_strength.map(|envelope| {
657                    ::fidl_next::FromWire::from_wire(unsafe {
658                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
659                    })
660                }),
661            }
662        }
663    }
664
665    impl<'de> ::fidl_next::FromWireRef<crate::wire::Configuration<'de>> for Configuration {
666        #[inline]
667        fn from_wire_ref(wire: &crate::wire::Configuration<'de>) -> Self {
668            Self {
669                pull: wire.table.get(1).map(|envelope| {
670                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
671                        envelope.deref_unchecked::<crate::wire::Pull>()
672                    })
673                }),
674
675                function: wire.table.get(2).map(|envelope| {
676                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
677                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
678                    })
679                }),
680
681                drive_strength_ua: wire.table.get(3).map(|envelope| {
682                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
683                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
684                    })
685                }),
686
687                drive_type: wire.table.get(4).map(|envelope| {
688                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
689                        envelope.deref_unchecked::<crate::wire::DriveType>()
690                    })
691                }),
692
693                power_source: wire.table.get(5).map(|envelope| {
694                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
695                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
696                    })
697                }),
698
699                wake_vector: wire.table.get(6).map(|envelope| {
700                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
701                        envelope.deref_unchecked::<bool>()
702                    })
703                }),
704
705                slew_rate: wire.table.get(7).map(|envelope| {
706                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
707                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
708                    })
709                }),
710
711                function_name: wire.table.get(8).map(|envelope| {
712                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
713                        envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
714                    })
715                }),
716
717                drive_strength: wire.table.get(9).map(|envelope| {
718                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
719                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
720                    })
721                }),
722            }
723        }
724    }
725
726    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
727    pub struct DebugGetPropertiesResponse {
728        pub pin: ::core::option::Option<u32>,
729
730        pub name: ::core::option::Option<::std::string::String>,
731    }
732
733    impl DebugGetPropertiesResponse {
734        fn __max_ordinal(&self) -> usize {
735            if self.name.is_some() {
736                return 2;
737            }
738
739            if self.pin.is_some() {
740                return 1;
741            }
742
743            0
744        }
745    }
746
747    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DebugGetPropertiesResponse<'static>, ___E>
748        for DebugGetPropertiesResponse
749    where
750        ___E: ::fidl_next::Encoder + ?Sized,
751    {
752        #[inline]
753        fn encode(
754            mut self,
755            encoder: &mut ___E,
756            out: &mut ::core::mem::MaybeUninit<crate::wire::DebugGetPropertiesResponse<'static>>,
757            _: (),
758        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
759            ::fidl_next::munge!(let crate::wire::DebugGetPropertiesResponse { table } = out);
760
761            let max_ord = self.__max_ordinal();
762
763            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
764            ::fidl_next::Wire::zero_padding(&mut out);
765
766            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
767                ::fidl_next::wire::Envelope,
768            >(encoder, max_ord);
769
770            for i in 1..=max_ord {
771                match i {
772                    2 => {
773                        if let Some(value) = self.name.take() {
774                            ::fidl_next::wire::Envelope::encode_value::<
775                                ::fidl_next::wire::String<'static>,
776                                ___E,
777                            >(
778                                value, preallocated.encoder, &mut out, 64
779                            )?;
780                        } else {
781                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
782                        }
783                    }
784
785                    1 => {
786                        if let Some(value) = self.pin.take() {
787                            ::fidl_next::wire::Envelope::encode_value::<
788                                ::fidl_next::wire::Uint32,
789                                ___E,
790                            >(
791                                value, preallocated.encoder, &mut out, ()
792                            )?;
793                        } else {
794                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
795                        }
796                    }
797
798                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
799                }
800                unsafe {
801                    preallocated.write_next(out.assume_init_ref());
802                }
803            }
804
805            ::fidl_next::wire::Table::encode_len(table, max_ord);
806
807            Ok(())
808        }
809    }
810
811    unsafe impl<'a, ___E>
812        ::fidl_next::Encode<crate::wire::DebugGetPropertiesResponse<'static>, ___E>
813        for &'a DebugGetPropertiesResponse
814    where
815        ___E: ::fidl_next::Encoder + ?Sized,
816    {
817        #[inline]
818        fn encode(
819            self,
820            encoder: &mut ___E,
821            out: &mut ::core::mem::MaybeUninit<crate::wire::DebugGetPropertiesResponse<'static>>,
822            _: (),
823        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
824            ::fidl_next::munge!(let crate::wire::DebugGetPropertiesResponse { table } = out);
825
826            let max_ord = self.__max_ordinal();
827
828            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
829            ::fidl_next::Wire::zero_padding(&mut out);
830
831            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
832                ::fidl_next::wire::Envelope,
833            >(encoder, max_ord);
834
835            for i in 1..=max_ord {
836                match i {
837                    2 => {
838                        if let Some(value) = &self.name {
839                            ::fidl_next::wire::Envelope::encode_value::<
840                                ::fidl_next::wire::String<'static>,
841                                ___E,
842                            >(
843                                value, preallocated.encoder, &mut out, 64
844                            )?;
845                        } else {
846                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
847                        }
848                    }
849
850                    1 => {
851                        if let Some(value) = &self.pin {
852                            ::fidl_next::wire::Envelope::encode_value::<
853                                ::fidl_next::wire::Uint32,
854                                ___E,
855                            >(
856                                value, preallocated.encoder, &mut out, ()
857                            )?;
858                        } else {
859                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
860                        }
861                    }
862
863                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
864                }
865                unsafe {
866                    preallocated.write_next(out.assume_init_ref());
867                }
868            }
869
870            ::fidl_next::wire::Table::encode_len(table, max_ord);
871
872            Ok(())
873        }
874    }
875
876    impl<'de> ::fidl_next::FromWire<crate::wire::DebugGetPropertiesResponse<'de>>
877        for DebugGetPropertiesResponse
878    {
879        #[inline]
880        fn from_wire(wire_: crate::wire::DebugGetPropertiesResponse<'de>) -> Self {
881            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
882
883            let pin = wire_.table.get(1);
884
885            let name = wire_.table.get(2);
886
887            Self {
888                pin: pin.map(|envelope| {
889                    ::fidl_next::FromWire::from_wire(unsafe {
890                        envelope.read_unchecked::<::fidl_next::wire::Uint32>()
891                    })
892                }),
893
894                name: name.map(|envelope| {
895                    ::fidl_next::FromWire::from_wire(unsafe {
896                        envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
897                    })
898                }),
899            }
900        }
901    }
902
903    impl<'de> ::fidl_next::FromWireRef<crate::wire::DebugGetPropertiesResponse<'de>>
904        for DebugGetPropertiesResponse
905    {
906        #[inline]
907        fn from_wire_ref(wire: &crate::wire::DebugGetPropertiesResponse<'de>) -> Self {
908            Self {
909                pin: wire.table.get(1).map(|envelope| {
910                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
911                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
912                    })
913                }),
914
915                name: wire.table.get(2).map(|envelope| {
916                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
917                        envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
918                    })
919                }),
920            }
921        }
922    }
923
924    pub type DebugConnectPinResponse = ();
925
926    pub type DebugConnectGpioResponse = ();
927
928    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
929    pub struct PinConfigureRequest {
930        pub config: crate::natural::Configuration,
931    }
932
933    unsafe impl<___E> ::fidl_next::Encode<crate::wire::PinConfigureRequest<'static>, ___E>
934        for PinConfigureRequest
935    where
936        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
937        ___E: ::fidl_next::Encoder,
938    {
939        #[inline]
940        fn encode(
941            self,
942            encoder_: &mut ___E,
943            out_: &mut ::core::mem::MaybeUninit<crate::wire::PinConfigureRequest<'static>>,
944            _: (),
945        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
946            ::fidl_next::munge! {
947                let crate::wire::PinConfigureRequest {
948                    config,
949
950                } = out_;
951            }
952
953            ::fidl_next::Encode::encode(self.config, encoder_, config, ())?;
954
955            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(config.as_mut_ptr()) };
956
957            Ok(())
958        }
959    }
960
961    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::PinConfigureRequest<'static>, ___E>
962        for &'a PinConfigureRequest
963    where
964        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
965        ___E: ::fidl_next::Encoder,
966    {
967        #[inline]
968        fn encode(
969            self,
970            encoder_: &mut ___E,
971            out_: &mut ::core::mem::MaybeUninit<crate::wire::PinConfigureRequest<'static>>,
972            _: (),
973        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
974            ::fidl_next::munge! {
975                let crate::wire::PinConfigureRequest {
976                    config,
977
978                } = out_;
979            }
980
981            ::fidl_next::Encode::encode(&self.config, encoder_, config, ())?;
982
983            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(config.as_mut_ptr()) };
984
985            Ok(())
986        }
987    }
988
989    unsafe impl<___E>
990        ::fidl_next::EncodeOption<
991            ::fidl_next::wire::Box<'static, crate::wire::PinConfigureRequest<'static>>,
992            ___E,
993        > for PinConfigureRequest
994    where
995        ___E: ::fidl_next::Encoder + ?Sized,
996        PinConfigureRequest: ::fidl_next::Encode<crate::wire::PinConfigureRequest<'static>, ___E>,
997    {
998        #[inline]
999        fn encode_option(
1000            this: ::core::option::Option<Self>,
1001            encoder: &mut ___E,
1002            out: &mut ::core::mem::MaybeUninit<
1003                ::fidl_next::wire::Box<'static, crate::wire::PinConfigureRequest<'static>>,
1004            >,
1005            _: (),
1006        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1007            if let Some(inner) = this {
1008                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1009                ::fidl_next::wire::Box::encode_present(out);
1010            } else {
1011                ::fidl_next::wire::Box::encode_absent(out);
1012            }
1013
1014            Ok(())
1015        }
1016    }
1017
1018    unsafe impl<'a, ___E>
1019        ::fidl_next::EncodeOption<
1020            ::fidl_next::wire::Box<'static, crate::wire::PinConfigureRequest<'static>>,
1021            ___E,
1022        > for &'a PinConfigureRequest
1023    where
1024        ___E: ::fidl_next::Encoder + ?Sized,
1025        &'a PinConfigureRequest:
1026            ::fidl_next::Encode<crate::wire::PinConfigureRequest<'static>, ___E>,
1027    {
1028        #[inline]
1029        fn encode_option(
1030            this: ::core::option::Option<Self>,
1031            encoder: &mut ___E,
1032            out: &mut ::core::mem::MaybeUninit<
1033                ::fidl_next::wire::Box<'static, crate::wire::PinConfigureRequest<'static>>,
1034            >,
1035            _: (),
1036        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1037            if let Some(inner) = this {
1038                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1039                ::fidl_next::wire::Box::encode_present(out);
1040            } else {
1041                ::fidl_next::wire::Box::encode_absent(out);
1042            }
1043
1044            Ok(())
1045        }
1046    }
1047
1048    impl<'de> ::fidl_next::FromWire<crate::wire::PinConfigureRequest<'de>> for PinConfigureRequest {
1049        #[inline]
1050        fn from_wire(wire: crate::wire::PinConfigureRequest<'de>) -> Self {
1051            Self { config: ::fidl_next::FromWire::from_wire(wire.config) }
1052        }
1053    }
1054
1055    impl<'de> ::fidl_next::FromWireRef<crate::wire::PinConfigureRequest<'de>> for PinConfigureRequest {
1056        #[inline]
1057        fn from_wire_ref(wire: &crate::wire::PinConfigureRequest<'de>) -> Self {
1058            Self { config: ::fidl_next::FromWireRef::from_wire_ref(&wire.config) }
1059        }
1060    }
1061
1062    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1063    pub struct PinConfigureResponse {
1064        pub new_config: crate::natural::Configuration,
1065    }
1066
1067    unsafe impl<___E> ::fidl_next::Encode<crate::wire::PinConfigureResponse<'static>, ___E>
1068        for PinConfigureResponse
1069    where
1070        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1071        ___E: ::fidl_next::Encoder,
1072    {
1073        #[inline]
1074        fn encode(
1075            self,
1076            encoder_: &mut ___E,
1077            out_: &mut ::core::mem::MaybeUninit<crate::wire::PinConfigureResponse<'static>>,
1078            _: (),
1079        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1080            ::fidl_next::munge! {
1081                let crate::wire::PinConfigureResponse {
1082                    new_config,
1083
1084                } = out_;
1085            }
1086
1087            ::fidl_next::Encode::encode(self.new_config, encoder_, new_config, ())?;
1088
1089            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(new_config.as_mut_ptr()) };
1090
1091            Ok(())
1092        }
1093    }
1094
1095    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::PinConfigureResponse<'static>, ___E>
1096        for &'a PinConfigureResponse
1097    where
1098        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1099        ___E: ::fidl_next::Encoder,
1100    {
1101        #[inline]
1102        fn encode(
1103            self,
1104            encoder_: &mut ___E,
1105            out_: &mut ::core::mem::MaybeUninit<crate::wire::PinConfigureResponse<'static>>,
1106            _: (),
1107        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1108            ::fidl_next::munge! {
1109                let crate::wire::PinConfigureResponse {
1110                    new_config,
1111
1112                } = out_;
1113            }
1114
1115            ::fidl_next::Encode::encode(&self.new_config, encoder_, new_config, ())?;
1116
1117            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(new_config.as_mut_ptr()) };
1118
1119            Ok(())
1120        }
1121    }
1122
1123    unsafe impl<___E>
1124        ::fidl_next::EncodeOption<
1125            ::fidl_next::wire::Box<'static, crate::wire::PinConfigureResponse<'static>>,
1126            ___E,
1127        > for PinConfigureResponse
1128    where
1129        ___E: ::fidl_next::Encoder + ?Sized,
1130        PinConfigureResponse: ::fidl_next::Encode<crate::wire::PinConfigureResponse<'static>, ___E>,
1131    {
1132        #[inline]
1133        fn encode_option(
1134            this: ::core::option::Option<Self>,
1135            encoder: &mut ___E,
1136            out: &mut ::core::mem::MaybeUninit<
1137                ::fidl_next::wire::Box<'static, crate::wire::PinConfigureResponse<'static>>,
1138            >,
1139            _: (),
1140        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1141            if let Some(inner) = this {
1142                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1143                ::fidl_next::wire::Box::encode_present(out);
1144            } else {
1145                ::fidl_next::wire::Box::encode_absent(out);
1146            }
1147
1148            Ok(())
1149        }
1150    }
1151
1152    unsafe impl<'a, ___E>
1153        ::fidl_next::EncodeOption<
1154            ::fidl_next::wire::Box<'static, crate::wire::PinConfigureResponse<'static>>,
1155            ___E,
1156        > for &'a PinConfigureResponse
1157    where
1158        ___E: ::fidl_next::Encoder + ?Sized,
1159        &'a PinConfigureResponse:
1160            ::fidl_next::Encode<crate::wire::PinConfigureResponse<'static>, ___E>,
1161    {
1162        #[inline]
1163        fn encode_option(
1164            this: ::core::option::Option<Self>,
1165            encoder: &mut ___E,
1166            out: &mut ::core::mem::MaybeUninit<
1167                ::fidl_next::wire::Box<'static, crate::wire::PinConfigureResponse<'static>>,
1168            >,
1169            _: (),
1170        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1171            if let Some(inner) = this {
1172                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1173                ::fidl_next::wire::Box::encode_present(out);
1174            } else {
1175                ::fidl_next::wire::Box::encode_absent(out);
1176            }
1177
1178            Ok(())
1179        }
1180    }
1181
1182    impl<'de> ::fidl_next::FromWire<crate::wire::PinConfigureResponse<'de>> for PinConfigureResponse {
1183        #[inline]
1184        fn from_wire(wire: crate::wire::PinConfigureResponse<'de>) -> Self {
1185            Self { new_config: ::fidl_next::FromWire::from_wire(wire.new_config) }
1186        }
1187    }
1188
1189    impl<'de> ::fidl_next::FromWireRef<crate::wire::PinConfigureResponse<'de>>
1190        for PinConfigureResponse
1191    {
1192        #[inline]
1193        fn from_wire_ref(wire: &crate::wire::PinConfigureResponse<'de>) -> Self {
1194            Self { new_config: ::fidl_next::FromWireRef::from_wire_ref(&wire.new_config) }
1195        }
1196    }
1197
1198    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1199    pub struct PinStatesSelectStateRequest {
1200        pub name: ::std::string::String,
1201    }
1202
1203    unsafe impl<___E> ::fidl_next::Encode<crate::wire::PinStatesSelectStateRequest<'static>, ___E>
1204        for PinStatesSelectStateRequest
1205    where
1206        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1207        ___E: ::fidl_next::Encoder,
1208    {
1209        #[inline]
1210        fn encode(
1211            self,
1212            encoder_: &mut ___E,
1213            out_: &mut ::core::mem::MaybeUninit<crate::wire::PinStatesSelectStateRequest<'static>>,
1214            _: (),
1215        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1216            ::fidl_next::munge! {
1217                let crate::wire::PinStatesSelectStateRequest {
1218                    name,
1219
1220                } = out_;
1221            }
1222
1223            ::fidl_next::Encode::encode(self.name, encoder_, name, 64)?;
1224
1225            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
1226            ::fidl_next::Constrained::validate(_field, 64)?;
1227
1228            Ok(())
1229        }
1230    }
1231
1232    unsafe impl<'a, ___E>
1233        ::fidl_next::Encode<crate::wire::PinStatesSelectStateRequest<'static>, ___E>
1234        for &'a PinStatesSelectStateRequest
1235    where
1236        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1237        ___E: ::fidl_next::Encoder,
1238    {
1239        #[inline]
1240        fn encode(
1241            self,
1242            encoder_: &mut ___E,
1243            out_: &mut ::core::mem::MaybeUninit<crate::wire::PinStatesSelectStateRequest<'static>>,
1244            _: (),
1245        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1246            ::fidl_next::munge! {
1247                let crate::wire::PinStatesSelectStateRequest {
1248                    name,
1249
1250                } = out_;
1251            }
1252
1253            ::fidl_next::Encode::encode(&self.name, encoder_, name, 64)?;
1254
1255            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
1256            ::fidl_next::Constrained::validate(_field, 64)?;
1257
1258            Ok(())
1259        }
1260    }
1261
1262    unsafe impl<___E>
1263        ::fidl_next::EncodeOption<
1264            ::fidl_next::wire::Box<'static, crate::wire::PinStatesSelectStateRequest<'static>>,
1265            ___E,
1266        > for PinStatesSelectStateRequest
1267    where
1268        ___E: ::fidl_next::Encoder + ?Sized,
1269        PinStatesSelectStateRequest:
1270            ::fidl_next::Encode<crate::wire::PinStatesSelectStateRequest<'static>, ___E>,
1271    {
1272        #[inline]
1273        fn encode_option(
1274            this: ::core::option::Option<Self>,
1275            encoder: &mut ___E,
1276            out: &mut ::core::mem::MaybeUninit<
1277                ::fidl_next::wire::Box<'static, crate::wire::PinStatesSelectStateRequest<'static>>,
1278            >,
1279            _: (),
1280        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1281            if let Some(inner) = this {
1282                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1283                ::fidl_next::wire::Box::encode_present(out);
1284            } else {
1285                ::fidl_next::wire::Box::encode_absent(out);
1286            }
1287
1288            Ok(())
1289        }
1290    }
1291
1292    unsafe impl<'a, ___E>
1293        ::fidl_next::EncodeOption<
1294            ::fidl_next::wire::Box<'static, crate::wire::PinStatesSelectStateRequest<'static>>,
1295            ___E,
1296        > for &'a PinStatesSelectStateRequest
1297    where
1298        ___E: ::fidl_next::Encoder + ?Sized,
1299        &'a PinStatesSelectStateRequest:
1300            ::fidl_next::Encode<crate::wire::PinStatesSelectStateRequest<'static>, ___E>,
1301    {
1302        #[inline]
1303        fn encode_option(
1304            this: ::core::option::Option<Self>,
1305            encoder: &mut ___E,
1306            out: &mut ::core::mem::MaybeUninit<
1307                ::fidl_next::wire::Box<'static, crate::wire::PinStatesSelectStateRequest<'static>>,
1308            >,
1309            _: (),
1310        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1311            if let Some(inner) = this {
1312                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1313                ::fidl_next::wire::Box::encode_present(out);
1314            } else {
1315                ::fidl_next::wire::Box::encode_absent(out);
1316            }
1317
1318            Ok(())
1319        }
1320    }
1321
1322    impl<'de> ::fidl_next::FromWire<crate::wire::PinStatesSelectStateRequest<'de>>
1323        for PinStatesSelectStateRequest
1324    {
1325        #[inline]
1326        fn from_wire(wire: crate::wire::PinStatesSelectStateRequest<'de>) -> Self {
1327            Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
1328        }
1329    }
1330
1331    impl<'de> ::fidl_next::FromWireRef<crate::wire::PinStatesSelectStateRequest<'de>>
1332        for PinStatesSelectStateRequest
1333    {
1334        #[inline]
1335        fn from_wire_ref(wire: &crate::wire::PinStatesSelectStateRequest<'de>) -> Self {
1336            Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
1337        }
1338    }
1339
1340    pub type PinStatesSelectStateResponse = ();
1341}
1342
1343pub mod wire {
1344
1345    /// The wire type corresponding to [`DriveType`].
1346    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1347    #[repr(transparent)]
1348    pub struct DriveType {
1349        pub(crate) value: ::fidl_next::wire::Uint32,
1350    }
1351
1352    impl ::fidl_next::Constrained for DriveType {
1353        type Constraint = ();
1354
1355        fn validate(
1356            _: ::fidl_next::Slot<'_, Self>,
1357            _: Self::Constraint,
1358        ) -> Result<(), ::fidl_next::ValidationError> {
1359            Ok(())
1360        }
1361    }
1362
1363    unsafe impl ::fidl_next::Wire for DriveType {
1364        type Narrowed<'de> = Self;
1365
1366        #[inline]
1367        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1368            // Wire enums have no padding
1369        }
1370    }
1371
1372    impl DriveType {
1373        pub const PUSH_PULL: DriveType = DriveType { value: ::fidl_next::wire::Uint32(0) };
1374
1375        pub const OPEN_DRAIN: DriveType = DriveType { value: ::fidl_next::wire::Uint32(1) };
1376
1377        pub const OPEN_SOURCE: DriveType = DriveType { value: ::fidl_next::wire::Uint32(2) };
1378    }
1379
1380    unsafe impl<___D> ::fidl_next::Decode<___D> for DriveType
1381    where
1382        ___D: ?Sized,
1383    {
1384        fn decode(
1385            slot: ::fidl_next::Slot<'_, Self>,
1386            _: &mut ___D,
1387            _: (),
1388        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1389            Ok(())
1390        }
1391    }
1392
1393    impl ::core::convert::From<crate::natural::DriveType> for DriveType {
1394        fn from(natural: crate::natural::DriveType) -> Self {
1395            match natural {
1396                crate::natural::DriveType::PushPull => DriveType::PUSH_PULL,
1397
1398                crate::natural::DriveType::OpenDrain => DriveType::OPEN_DRAIN,
1399
1400                crate::natural::DriveType::OpenSource => DriveType::OPEN_SOURCE,
1401
1402                crate::natural::DriveType::UnknownOrdinal_(value) => {
1403                    DriveType { value: ::fidl_next::wire::Uint32::from(value) }
1404                }
1405            }
1406        }
1407    }
1408
1409    impl ::fidl_next::IntoNatural for DriveType {
1410        type Natural = crate::natural::DriveType;
1411    }
1412
1413    /// The wire type corresponding to [`Pull`].
1414    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1415    #[repr(transparent)]
1416    pub struct Pull {
1417        pub(crate) value: ::fidl_next::wire::Uint32,
1418    }
1419
1420    impl ::fidl_next::Constrained for Pull {
1421        type Constraint = ();
1422
1423        fn validate(
1424            _: ::fidl_next::Slot<'_, Self>,
1425            _: Self::Constraint,
1426        ) -> Result<(), ::fidl_next::ValidationError> {
1427            Ok(())
1428        }
1429    }
1430
1431    unsafe impl ::fidl_next::Wire for Pull {
1432        type Narrowed<'de> = Self;
1433
1434        #[inline]
1435        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1436            // Wire enums have no padding
1437        }
1438    }
1439
1440    impl Pull {
1441        pub const DOWN: Pull = Pull { value: ::fidl_next::wire::Uint32(0) };
1442
1443        pub const UP: Pull = Pull { value: ::fidl_next::wire::Uint32(1) };
1444
1445        pub const NONE: Pull = Pull { value: ::fidl_next::wire::Uint32(2) };
1446
1447        pub const BUS_HOLD: Pull = Pull { value: ::fidl_next::wire::Uint32(3) };
1448    }
1449
1450    unsafe impl<___D> ::fidl_next::Decode<___D> for Pull
1451    where
1452        ___D: ?Sized,
1453    {
1454        fn decode(
1455            slot: ::fidl_next::Slot<'_, Self>,
1456            _: &mut ___D,
1457            _: (),
1458        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1459            ::fidl_next::munge!(let Self { value } = slot);
1460
1461            match u32::from(*value) {
1462                0 | 1 | 2 | 3 => (),
1463                unknown => {
1464                    return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
1465                }
1466            }
1467
1468            Ok(())
1469        }
1470    }
1471
1472    impl ::core::convert::From<crate::natural::Pull> for Pull {
1473        fn from(natural: crate::natural::Pull) -> Self {
1474            match natural {
1475                crate::natural::Pull::Down => Pull::DOWN,
1476
1477                crate::natural::Pull::Up => Pull::UP,
1478
1479                crate::natural::Pull::None => Pull::NONE,
1480
1481                crate::natural::Pull::BusHold => Pull::BUS_HOLD,
1482            }
1483        }
1484    }
1485
1486    impl ::fidl_next::IntoNatural for Pull {
1487        type Natural = crate::natural::Pull;
1488    }
1489
1490    /// The wire type corresponding to [`Configuration`].
1491    #[repr(C)]
1492    pub struct Configuration<'de> {
1493        pub(crate) table: ::fidl_next::wire::Table<'de>,
1494    }
1495
1496    impl<'de> Drop for Configuration<'de> {
1497        fn drop(&mut self) {
1498            let _ = self
1499                .table
1500                .get(1)
1501                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Pull>() });
1502
1503            let _ = self
1504                .table
1505                .get(2)
1506                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
1507
1508            let _ = self
1509                .table
1510                .get(3)
1511                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
1512
1513            let _ = self
1514                .table
1515                .get(4)
1516                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::DriveType>() });
1517
1518            let _ = self
1519                .table
1520                .get(5)
1521                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
1522
1523            let _ = self.table.get(6).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
1524
1525            let _ = self
1526                .table
1527                .get(7)
1528                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
1529
1530            let _ = self.table.get(8).map(|envelope| unsafe {
1531                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
1532            });
1533
1534            let _ = self
1535                .table
1536                .get(9)
1537                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
1538        }
1539    }
1540
1541    impl ::fidl_next::Constrained for Configuration<'_> {
1542        type Constraint = ();
1543
1544        fn validate(
1545            _: ::fidl_next::Slot<'_, Self>,
1546            _: Self::Constraint,
1547        ) -> Result<(), ::fidl_next::ValidationError> {
1548            Ok(())
1549        }
1550    }
1551
1552    unsafe impl ::fidl_next::Wire for Configuration<'static> {
1553        type Narrowed<'de> = Configuration<'de>;
1554
1555        #[inline]
1556        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1557            ::fidl_next::munge!(let Self { table } = out);
1558            ::fidl_next::wire::Table::zero_padding(table);
1559        }
1560    }
1561
1562    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Configuration<'de>
1563    where
1564        ___D: ::fidl_next::Decoder<'de> + ?Sized,
1565    {
1566        fn decode(
1567            slot: ::fidl_next::Slot<'_, Self>,
1568            decoder: &mut ___D,
1569            _: (),
1570        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1571            ::fidl_next::munge!(let Self { table } = slot);
1572
1573            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1574                match ordinal {
1575                    0 => unsafe { ::core::hint::unreachable_unchecked() },
1576
1577                    1 => {
1578                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Pull>(
1579                            slot.as_mut(),
1580                            decoder,
1581                            (),
1582                        )?;
1583
1584                        Ok(())
1585                    }
1586
1587                    2 => {
1588                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
1589                            slot.as_mut(),
1590                            decoder,
1591                            (),
1592                        )?;
1593
1594                        Ok(())
1595                    }
1596
1597                    3 => {
1598                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
1599                            slot.as_mut(),
1600                            decoder,
1601                            (),
1602                        )?;
1603
1604                        Ok(())
1605                    }
1606
1607                    4 => {
1608                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DriveType>(
1609                            slot.as_mut(),
1610                            decoder,
1611                            (),
1612                        )?;
1613
1614                        Ok(())
1615                    }
1616
1617                    5 => {
1618                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
1619                            slot.as_mut(),
1620                            decoder,
1621                            (),
1622                        )?;
1623
1624                        Ok(())
1625                    }
1626
1627                    6 => {
1628                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
1629                            slot.as_mut(),
1630                            decoder,
1631                            (),
1632                        )?;
1633
1634                        Ok(())
1635                    }
1636
1637                    7 => {
1638                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
1639                            slot.as_mut(),
1640                            decoder,
1641                            (),
1642                        )?;
1643
1644                        Ok(())
1645                    }
1646
1647                    8 => {
1648                        ::fidl_next::wire::Envelope::decode_as::<
1649                            ___D,
1650                            ::fidl_next::wire::String<'de>,
1651                        >(slot.as_mut(), decoder, 32)?;
1652
1653                        let value = unsafe {
1654                            slot.deref_unchecked()
1655                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
1656                        };
1657
1658                        if value.len() > 32 {
1659                            return Err(::fidl_next::DecodeError::VectorTooLong {
1660                                size: value.len() as u64,
1661                                limit: 32,
1662                            });
1663                        }
1664
1665                        Ok(())
1666                    }
1667
1668                    9 => {
1669                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
1670                            slot.as_mut(),
1671                            decoder,
1672                            (),
1673                        )?;
1674
1675                        Ok(())
1676                    }
1677
1678                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1679                }
1680            })
1681        }
1682    }
1683
1684    impl<'de> Configuration<'de> {
1685        pub fn pull(&self) -> ::core::option::Option<&crate::wire::Pull> {
1686            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1687        }
1688
1689        pub fn take_pull(&mut self) -> ::core::option::Option<crate::wire::Pull> {
1690            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1691        }
1692
1693        pub fn function(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
1694            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1695        }
1696
1697        pub fn take_function(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
1698            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
1699        }
1700
1701        pub fn drive_strength_ua(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
1702            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
1703        }
1704
1705        pub fn take_drive_strength_ua(
1706            &mut self,
1707        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
1708            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
1709        }
1710
1711        pub fn drive_type(&self) -> ::core::option::Option<&crate::wire::DriveType> {
1712            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
1713        }
1714
1715        pub fn take_drive_type(&mut self) -> ::core::option::Option<crate::wire::DriveType> {
1716            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
1717        }
1718
1719        pub fn power_source(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
1720            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
1721        }
1722
1723        pub fn take_power_source(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
1724            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
1725        }
1726
1727        pub fn wake_vector(&self) -> ::core::option::Option<&bool> {
1728            unsafe { Some(self.table.get(6)?.deref_unchecked()) }
1729        }
1730
1731        pub fn take_wake_vector(&mut self) -> ::core::option::Option<bool> {
1732            unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
1733        }
1734
1735        pub fn slew_rate(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
1736            unsafe { Some(self.table.get(7)?.deref_unchecked()) }
1737        }
1738
1739        pub fn take_slew_rate(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
1740            unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
1741        }
1742
1743        pub fn function_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
1744            unsafe { Some(self.table.get(8)?.deref_unchecked()) }
1745        }
1746
1747        pub fn take_function_name(
1748            &mut self,
1749        ) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
1750            unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
1751        }
1752
1753        pub fn drive_strength(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
1754            unsafe { Some(self.table.get(9)?.deref_unchecked()) }
1755        }
1756
1757        pub fn take_drive_strength(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
1758            unsafe { Some(self.table.get_mut(9)?.take_unchecked()) }
1759        }
1760    }
1761
1762    impl<'de> ::core::fmt::Debug for Configuration<'de> {
1763        fn fmt(
1764            &self,
1765            f: &mut ::core::fmt::Formatter<'_>,
1766        ) -> ::core::result::Result<(), ::core::fmt::Error> {
1767            f.debug_struct("Configuration")
1768                .field("pull", &self.pull())
1769                .field("function", &self.function())
1770                .field("drive_strength_ua", &self.drive_strength_ua())
1771                .field("drive_type", &self.drive_type())
1772                .field("power_source", &self.power_source())
1773                .field("wake_vector", &self.wake_vector())
1774                .field("slew_rate", &self.slew_rate())
1775                .field("function_name", &self.function_name())
1776                .field("drive_strength", &self.drive_strength())
1777                .finish()
1778        }
1779    }
1780
1781    impl<'de> ::fidl_next::IntoNatural for Configuration<'de> {
1782        type Natural = crate::natural::Configuration;
1783    }
1784
1785    /// The wire type corresponding to [`DebugGetPropertiesResponse`].
1786    #[repr(C)]
1787    pub struct DebugGetPropertiesResponse<'de> {
1788        pub(crate) table: ::fidl_next::wire::Table<'de>,
1789    }
1790
1791    impl<'de> Drop for DebugGetPropertiesResponse<'de> {
1792        fn drop(&mut self) {
1793            let _ = self
1794                .table
1795                .get(1)
1796                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
1797
1798            let _ = self.table.get(2).map(|envelope| unsafe {
1799                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
1800            });
1801        }
1802    }
1803
1804    impl ::fidl_next::Constrained for DebugGetPropertiesResponse<'_> {
1805        type Constraint = ();
1806
1807        fn validate(
1808            _: ::fidl_next::Slot<'_, Self>,
1809            _: Self::Constraint,
1810        ) -> Result<(), ::fidl_next::ValidationError> {
1811            Ok(())
1812        }
1813    }
1814
1815    unsafe impl ::fidl_next::Wire for DebugGetPropertiesResponse<'static> {
1816        type Narrowed<'de> = DebugGetPropertiesResponse<'de>;
1817
1818        #[inline]
1819        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1820            ::fidl_next::munge!(let Self { table } = out);
1821            ::fidl_next::wire::Table::zero_padding(table);
1822        }
1823    }
1824
1825    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DebugGetPropertiesResponse<'de>
1826    where
1827        ___D: ::fidl_next::Decoder<'de> + ?Sized,
1828    {
1829        fn decode(
1830            slot: ::fidl_next::Slot<'_, Self>,
1831            decoder: &mut ___D,
1832            _: (),
1833        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1834            ::fidl_next::munge!(let Self { table } = slot);
1835
1836            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1837                match ordinal {
1838                    0 => unsafe { ::core::hint::unreachable_unchecked() },
1839
1840                    1 => {
1841                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
1842                            slot.as_mut(),
1843                            decoder,
1844                            (),
1845                        )?;
1846
1847                        Ok(())
1848                    }
1849
1850                    2 => {
1851                        ::fidl_next::wire::Envelope::decode_as::<
1852                            ___D,
1853                            ::fidl_next::wire::String<'de>,
1854                        >(slot.as_mut(), decoder, 64)?;
1855
1856                        let value = unsafe {
1857                            slot.deref_unchecked()
1858                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
1859                        };
1860
1861                        if value.len() > 64 {
1862                            return Err(::fidl_next::DecodeError::VectorTooLong {
1863                                size: value.len() as u64,
1864                                limit: 64,
1865                            });
1866                        }
1867
1868                        Ok(())
1869                    }
1870
1871                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1872                }
1873            })
1874        }
1875    }
1876
1877    impl<'de> DebugGetPropertiesResponse<'de> {
1878        pub fn pin(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
1879            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1880        }
1881
1882        pub fn take_pin(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
1883            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1884        }
1885
1886        pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
1887            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1888        }
1889
1890        pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
1891            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
1892        }
1893    }
1894
1895    impl<'de> ::core::fmt::Debug for DebugGetPropertiesResponse<'de> {
1896        fn fmt(
1897            &self,
1898            f: &mut ::core::fmt::Formatter<'_>,
1899        ) -> ::core::result::Result<(), ::core::fmt::Error> {
1900            f.debug_struct("DebugGetPropertiesResponse")
1901                .field("pin", &self.pin())
1902                .field("name", &self.name())
1903                .finish()
1904        }
1905    }
1906
1907    impl<'de> ::fidl_next::IntoNatural for DebugGetPropertiesResponse<'de> {
1908        type Natural = crate::natural::DebugGetPropertiesResponse;
1909    }
1910
1911    /// The wire type corresponding to [`DebugConnectPinResponse`].
1912    pub type DebugConnectPinResponse = ::fidl_next::wire::Unit;
1913
1914    /// The wire type corresponding to [`DebugConnectGpioResponse`].
1915    pub type DebugConnectGpioResponse = ::fidl_next::wire::Unit;
1916
1917    /// The wire type corresponding to [`PinConfigureRequest`].
1918    #[derive(Debug)]
1919    #[repr(C)]
1920    pub struct PinConfigureRequest<'de> {
1921        pub config: crate::wire::Configuration<'de>,
1922    }
1923
1924    static_assertions::const_assert_eq!(std::mem::size_of::<PinConfigureRequest<'_>>(), 16);
1925    static_assertions::const_assert_eq!(std::mem::align_of::<PinConfigureRequest<'_>>(), 8);
1926
1927    static_assertions::const_assert_eq!(std::mem::offset_of!(PinConfigureRequest<'_>, config), 0);
1928
1929    impl ::fidl_next::Constrained for PinConfigureRequest<'_> {
1930        type Constraint = ();
1931
1932        fn validate(
1933            _: ::fidl_next::Slot<'_, Self>,
1934            _: Self::Constraint,
1935        ) -> Result<(), ::fidl_next::ValidationError> {
1936            Ok(())
1937        }
1938    }
1939
1940    unsafe impl ::fidl_next::Wire for PinConfigureRequest<'static> {
1941        type Narrowed<'de> = PinConfigureRequest<'de>;
1942
1943        #[inline]
1944        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1945            ::fidl_next::munge! {
1946                let Self {
1947                    config,
1948
1949                } = &mut *out_;
1950            }
1951
1952            ::fidl_next::Wire::zero_padding(config);
1953        }
1954    }
1955
1956    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PinConfigureRequest<'de>
1957    where
1958        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1959        ___D: ::fidl_next::Decoder<'de>,
1960    {
1961        fn decode(
1962            slot_: ::fidl_next::Slot<'_, Self>,
1963            decoder_: &mut ___D,
1964            _: (),
1965        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1966            ::fidl_next::munge! {
1967                let Self {
1968                    mut config,
1969
1970                } = slot_;
1971            }
1972
1973            let _field = config.as_mut();
1974
1975            ::fidl_next::Decode::decode(config.as_mut(), decoder_, ())?;
1976
1977            Ok(())
1978        }
1979    }
1980
1981    impl<'de> ::fidl_next::IntoNatural for PinConfigureRequest<'de> {
1982        type Natural = crate::natural::PinConfigureRequest;
1983    }
1984
1985    /// The wire type corresponding to [`PinConfigureResponse`].
1986    #[derive(Debug)]
1987    #[repr(C)]
1988    pub struct PinConfigureResponse<'de> {
1989        pub new_config: crate::wire::Configuration<'de>,
1990    }
1991
1992    static_assertions::const_assert_eq!(std::mem::size_of::<PinConfigureResponse<'_>>(), 16);
1993    static_assertions::const_assert_eq!(std::mem::align_of::<PinConfigureResponse<'_>>(), 8);
1994
1995    static_assertions::const_assert_eq!(
1996        std::mem::offset_of!(PinConfigureResponse<'_>, new_config),
1997        0
1998    );
1999
2000    impl ::fidl_next::Constrained for PinConfigureResponse<'_> {
2001        type Constraint = ();
2002
2003        fn validate(
2004            _: ::fidl_next::Slot<'_, Self>,
2005            _: Self::Constraint,
2006        ) -> Result<(), ::fidl_next::ValidationError> {
2007            Ok(())
2008        }
2009    }
2010
2011    unsafe impl ::fidl_next::Wire for PinConfigureResponse<'static> {
2012        type Narrowed<'de> = PinConfigureResponse<'de>;
2013
2014        #[inline]
2015        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2016            ::fidl_next::munge! {
2017                let Self {
2018                    new_config,
2019
2020                } = &mut *out_;
2021            }
2022
2023            ::fidl_next::Wire::zero_padding(new_config);
2024        }
2025    }
2026
2027    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PinConfigureResponse<'de>
2028    where
2029        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2030        ___D: ::fidl_next::Decoder<'de>,
2031    {
2032        fn decode(
2033            slot_: ::fidl_next::Slot<'_, Self>,
2034            decoder_: &mut ___D,
2035            _: (),
2036        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2037            ::fidl_next::munge! {
2038                let Self {
2039                    mut new_config,
2040
2041                } = slot_;
2042            }
2043
2044            let _field = new_config.as_mut();
2045
2046            ::fidl_next::Decode::decode(new_config.as_mut(), decoder_, ())?;
2047
2048            Ok(())
2049        }
2050    }
2051
2052    impl<'de> ::fidl_next::IntoNatural for PinConfigureResponse<'de> {
2053        type Natural = crate::natural::PinConfigureResponse;
2054    }
2055
2056    /// The wire type corresponding to [`PinStatesSelectStateRequest`].
2057    #[derive(Debug)]
2058    #[repr(C)]
2059    pub struct PinStatesSelectStateRequest<'de> {
2060        pub name: ::fidl_next::wire::String<'de>,
2061    }
2062
2063    static_assertions::const_assert_eq!(std::mem::size_of::<PinStatesSelectStateRequest<'_>>(), 16);
2064    static_assertions::const_assert_eq!(std::mem::align_of::<PinStatesSelectStateRequest<'_>>(), 8);
2065
2066    static_assertions::const_assert_eq!(
2067        std::mem::offset_of!(PinStatesSelectStateRequest<'_>, name),
2068        0
2069    );
2070
2071    impl ::fidl_next::Constrained for PinStatesSelectStateRequest<'_> {
2072        type Constraint = ();
2073
2074        fn validate(
2075            _: ::fidl_next::Slot<'_, Self>,
2076            _: Self::Constraint,
2077        ) -> Result<(), ::fidl_next::ValidationError> {
2078            Ok(())
2079        }
2080    }
2081
2082    unsafe impl ::fidl_next::Wire for PinStatesSelectStateRequest<'static> {
2083        type Narrowed<'de> = PinStatesSelectStateRequest<'de>;
2084
2085        #[inline]
2086        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2087            ::fidl_next::munge! {
2088                let Self {
2089                    name,
2090
2091                } = &mut *out_;
2092            }
2093
2094            ::fidl_next::Wire::zero_padding(name);
2095        }
2096    }
2097
2098    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PinStatesSelectStateRequest<'de>
2099    where
2100        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2101        ___D: ::fidl_next::Decoder<'de>,
2102    {
2103        fn decode(
2104            slot_: ::fidl_next::Slot<'_, Self>,
2105            decoder_: &mut ___D,
2106            _: (),
2107        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2108            ::fidl_next::munge! {
2109                let Self {
2110                    mut name,
2111
2112                } = slot_;
2113            }
2114
2115            let _field = name.as_mut();
2116            ::fidl_next::Constrained::validate(_field, 64)?;
2117            ::fidl_next::Decode::decode(name.as_mut(), decoder_, 64)?;
2118
2119            let name = unsafe { name.deref_unchecked() };
2120
2121            if name.len() > 64 {
2122                return Err(::fidl_next::DecodeError::VectorTooLong {
2123                    size: name.len() as u64,
2124                    limit: 64,
2125                });
2126            }
2127
2128            Ok(())
2129        }
2130    }
2131
2132    impl<'de> ::fidl_next::IntoNatural for PinStatesSelectStateRequest<'de> {
2133        type Natural = crate::natural::PinStatesSelectStateRequest;
2134    }
2135
2136    /// The wire type corresponding to [`PinStatesSelectStateResponse`].
2137    pub type PinStatesSelectStateResponse = ::fidl_next::wire::Unit;
2138}
2139
2140pub mod wire_optional {}
2141
2142pub mod generic {
2143
2144    /// The generic type corresponding to [`DebugConnectPinResponse`].
2145    pub type DebugConnectPinResponse = ();
2146
2147    /// The generic type corresponding to [`DebugConnectGpioResponse`].
2148    pub type DebugConnectGpioResponse = ();
2149
2150    /// The generic type corresponding to [`PinConfigureRequest`].
2151    pub struct PinConfigureRequest<T0> {
2152        pub config: T0,
2153    }
2154
2155    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::PinConfigureRequest<'static>, ___E>
2156        for PinConfigureRequest<T0>
2157    where
2158        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2159        ___E: ::fidl_next::Encoder,
2160        T0: ::fidl_next::Encode<crate::wire::Configuration<'static>, ___E>,
2161    {
2162        #[inline]
2163        fn encode(
2164            self,
2165            encoder_: &mut ___E,
2166            out_: &mut ::core::mem::MaybeUninit<crate::wire::PinConfigureRequest<'static>>,
2167            _: (),
2168        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2169            ::fidl_next::munge! {
2170                let crate::wire::PinConfigureRequest {
2171                    config,
2172
2173                } = out_;
2174            }
2175
2176            ::fidl_next::Encode::encode(self.config, encoder_, config, ())?;
2177
2178            Ok(())
2179        }
2180    }
2181
2182    unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::PinConfigureRequest<'static>, ___E>
2183        for &'a PinConfigureRequest<T0>
2184    where
2185        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2186        ___E: ::fidl_next::Encoder,
2187        &'a T0: ::fidl_next::Encode<crate::wire::Configuration<'static>, ___E>,
2188    {
2189        #[inline]
2190        fn encode(
2191            self,
2192            encoder_: &mut ___E,
2193            out_: &mut ::core::mem::MaybeUninit<crate::wire::PinConfigureRequest<'static>>,
2194            _: (),
2195        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2196            ::fidl_next::munge! {
2197                let crate::wire::PinConfigureRequest {
2198                    config,
2199
2200                } = out_;
2201            }
2202
2203            ::fidl_next::Encode::encode(&self.config, encoder_, config, ())?;
2204
2205            Ok(())
2206        }
2207    }
2208
2209    /// The generic type corresponding to [`PinConfigureResponse`].
2210    pub struct PinConfigureResponse<T0> {
2211        pub new_config: T0,
2212    }
2213
2214    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::PinConfigureResponse<'static>, ___E>
2215        for PinConfigureResponse<T0>
2216    where
2217        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2218        ___E: ::fidl_next::Encoder,
2219        T0: ::fidl_next::Encode<crate::wire::Configuration<'static>, ___E>,
2220    {
2221        #[inline]
2222        fn encode(
2223            self,
2224            encoder_: &mut ___E,
2225            out_: &mut ::core::mem::MaybeUninit<crate::wire::PinConfigureResponse<'static>>,
2226            _: (),
2227        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2228            ::fidl_next::munge! {
2229                let crate::wire::PinConfigureResponse {
2230                    new_config,
2231
2232                } = out_;
2233            }
2234
2235            ::fidl_next::Encode::encode(self.new_config, encoder_, new_config, ())?;
2236
2237            Ok(())
2238        }
2239    }
2240
2241    unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::PinConfigureResponse<'static>, ___E>
2242        for &'a PinConfigureResponse<T0>
2243    where
2244        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2245        ___E: ::fidl_next::Encoder,
2246        &'a T0: ::fidl_next::Encode<crate::wire::Configuration<'static>, ___E>,
2247    {
2248        #[inline]
2249        fn encode(
2250            self,
2251            encoder_: &mut ___E,
2252            out_: &mut ::core::mem::MaybeUninit<crate::wire::PinConfigureResponse<'static>>,
2253            _: (),
2254        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2255            ::fidl_next::munge! {
2256                let crate::wire::PinConfigureResponse {
2257                    new_config,
2258
2259                } = out_;
2260            }
2261
2262            ::fidl_next::Encode::encode(&self.new_config, encoder_, new_config, ())?;
2263
2264            Ok(())
2265        }
2266    }
2267
2268    /// The generic type corresponding to [`PinStatesSelectStateRequest`].
2269    pub struct PinStatesSelectStateRequest<T0> {
2270        pub name: T0,
2271    }
2272
2273    unsafe impl<___E, T0>
2274        ::fidl_next::Encode<crate::wire::PinStatesSelectStateRequest<'static>, ___E>
2275        for PinStatesSelectStateRequest<T0>
2276    where
2277        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2278        ___E: ::fidl_next::Encoder,
2279        T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
2280    {
2281        #[inline]
2282        fn encode(
2283            self,
2284            encoder_: &mut ___E,
2285            out_: &mut ::core::mem::MaybeUninit<crate::wire::PinStatesSelectStateRequest<'static>>,
2286            _: (),
2287        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2288            ::fidl_next::munge! {
2289                let crate::wire::PinStatesSelectStateRequest {
2290                    name,
2291
2292                } = out_;
2293            }
2294
2295            ::fidl_next::Encode::encode(self.name, encoder_, name, 64)?;
2296
2297            Ok(())
2298        }
2299    }
2300
2301    unsafe impl<'a, ___E, T0>
2302        ::fidl_next::Encode<crate::wire::PinStatesSelectStateRequest<'static>, ___E>
2303        for &'a PinStatesSelectStateRequest<T0>
2304    where
2305        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2306        ___E: ::fidl_next::Encoder,
2307        &'a T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
2308    {
2309        #[inline]
2310        fn encode(
2311            self,
2312            encoder_: &mut ___E,
2313            out_: &mut ::core::mem::MaybeUninit<crate::wire::PinStatesSelectStateRequest<'static>>,
2314            _: (),
2315        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2316            ::fidl_next::munge! {
2317                let crate::wire::PinStatesSelectStateRequest {
2318                    name,
2319
2320                } = out_;
2321            }
2322
2323            ::fidl_next::Encode::encode(&self.name, encoder_, name, 64)?;
2324
2325            Ok(())
2326        }
2327    }
2328
2329    /// The generic type corresponding to [`PinStatesSelectStateResponse`].
2330    pub type PinStatesSelectStateResponse = ();
2331}
2332
2333pub use self::natural::*;
2334
2335#[doc = " Maximum length of the function name.\n"]
2336pub const MAX_FUNCTION_NAME_LEN: u32 = 32 as u32;
2337
2338#[doc = " Maximum length of the pin name.\n"]
2339pub const MAX_PIN_NAME_LEN: u32 = 64 as u32;
2340
2341#[doc = " Maximum length of the pin state name.\n"]
2342pub const MAX_STATE_NAME_LEN: u32 = 64 as u32;
2343
2344/// The type corresponding to the Pin protocol.
2345#[derive(PartialEq, Debug)]
2346pub struct Pin;
2347
2348#[cfg(target_os = "fuchsia")]
2349impl ::fidl_next::HasTransport for Pin {
2350    type Transport = ::fidl_next::fuchsia::zx::Channel;
2351}
2352
2353pub mod pin {
2354    pub mod prelude {
2355        pub use crate::{
2356            Pin, PinClientHandler, PinLocalClientHandler, PinLocalServerHandler, PinServerHandler,
2357            pin,
2358        };
2359
2360        pub use crate::natural::PinConfigureRequest;
2361
2362        pub use crate::natural::PinConfigureResponse;
2363    }
2364
2365    pub struct Configure;
2366
2367    impl ::fidl_next::Method for Configure {
2368        const ORDINAL: u64 = 339044404492915211;
2369        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2370            ::fidl_next::protocol::Flexibility::Strict;
2371
2372        type Protocol = crate::Pin;
2373
2374        type Request = crate::wire::PinConfigureRequest<'static>;
2375    }
2376
2377    impl ::fidl_next::TwoWayMethod for Configure {
2378        type Response = ::fidl_next::wire::Result<
2379            'static,
2380            crate::wire::PinConfigureResponse<'static>,
2381            ::fidl_next::wire::fuchsia::Status,
2382        >;
2383    }
2384
2385    impl<___R> ::fidl_next::Respond<___R> for Configure {
2386        type Output = ::core::result::Result<
2387            crate::generic::PinConfigureResponse<___R>,
2388            ::fidl_next::never::Never,
2389        >;
2390
2391        fn respond(response: ___R) -> Self::Output {
2392            ::core::result::Result::Ok(crate::generic::PinConfigureResponse {
2393                new_config: response,
2394            })
2395        }
2396    }
2397
2398    impl<___R> ::fidl_next::RespondErr<___R> for Configure {
2399        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2400
2401        fn respond_err(response: ___R) -> Self::Output {
2402            ::core::result::Result::Err(response)
2403        }
2404    }
2405
2406    mod ___detail {
2407        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Pin
2408        where
2409            ___T: ::fidl_next::Transport,
2410        {
2411            type Client = PinClient<___T>;
2412            type Server = PinServer<___T>;
2413        }
2414
2415        /// The client for the `Pin` protocol.
2416        #[repr(transparent)]
2417        pub struct PinClient<___T: ::fidl_next::Transport> {
2418            #[allow(dead_code)]
2419            client: ::fidl_next::protocol::Client<___T>,
2420        }
2421
2422        impl<___T> PinClient<___T>
2423        where
2424            ___T: ::fidl_next::Transport,
2425        {
2426            #[doc = " Applies the configuration passed in `config`; see `Configuration` above. Fields not set in\n `config` are not changed. The drive strength is rounded up or capped to a value that the\n controller supports.\n\n `new_config` contains the configuration of the pin after all supported fields have been set.\n `Configure()` can be called with an empty `config` to return the current configuration\n without making any changes.\n"]
2427            pub fn configure(
2428                &self,
2429
2430                config: impl ::fidl_next::Encode<
2431                    crate::wire::Configuration<'static>,
2432                    <___T as ::fidl_next::Transport>::SendBuffer,
2433                >,
2434            ) -> ::fidl_next::TwoWayFuture<'_, super::Configure, ___T>
2435            where
2436                <___T as ::fidl_next::Transport>::SendBuffer:
2437                    ::fidl_next::encoder::InternalHandleEncoder,
2438                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2439            {
2440                self.configure_with(crate::generic::PinConfigureRequest { config })
2441            }
2442
2443            #[doc = " Applies the configuration passed in `config`; see `Configuration` above. Fields not set in\n `config` are not changed. The drive strength is rounded up or capped to a value that the\n controller supports.\n\n `new_config` contains the configuration of the pin after all supported fields have been set.\n `Configure()` can be called with an empty `config` to return the current configuration\n without making any changes.\n"]
2444            pub fn configure_with<___R>(
2445                &self,
2446                request: ___R,
2447            ) -> ::fidl_next::TwoWayFuture<'_, super::Configure, ___T>
2448            where
2449                ___R: ::fidl_next::Encode<
2450                        crate::wire::PinConfigureRequest<'static>,
2451                        <___T as ::fidl_next::Transport>::SendBuffer,
2452                    >,
2453            {
2454                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2455                    339044404492915211,
2456                    <super::Configure as ::fidl_next::Method>::FLEXIBILITY,
2457                    request,
2458                ))
2459            }
2460        }
2461
2462        /// The server for the `Pin` protocol.
2463        #[repr(transparent)]
2464        pub struct PinServer<___T: ::fidl_next::Transport> {
2465            server: ::fidl_next::protocol::Server<___T>,
2466        }
2467
2468        impl<___T> PinServer<___T> where ___T: ::fidl_next::Transport {}
2469    }
2470}
2471
2472#[diagnostic::on_unimplemented(
2473    note = "If {Self} implements the non-local PinClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2474)]
2475
2476/// A client handler for the Pin protocol.
2477///
2478/// See [`Pin`] for more details.
2479pub trait PinLocalClientHandler<
2480    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2481    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2482>
2483{
2484    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2485        ::core::future::ready(())
2486    }
2487}
2488
2489impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Pin
2490where
2491    ___H: PinLocalClientHandler<___T>,
2492    ___T: ::fidl_next::Transport,
2493{
2494    async fn on_event(
2495        handler: &mut ___H,
2496        mut message: ::fidl_next::Message<___T>,
2497    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2498        match *message.header().ordinal {
2499            ordinal => {
2500                handler.on_unknown_interaction(ordinal).await;
2501                if ::core::matches!(
2502                    message.header().flexibility(),
2503                    ::fidl_next::protocol::Flexibility::Strict
2504                ) {
2505                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2506                } else {
2507                    Ok(())
2508                }
2509            }
2510        }
2511    }
2512}
2513
2514#[diagnostic::on_unimplemented(
2515    note = "If {Self} implements the non-local PinServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2516)]
2517
2518/// A server handler for the Pin protocol.
2519///
2520/// See [`Pin`] for more details.
2521pub trait PinLocalServerHandler<
2522    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2523    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2524>
2525{
2526    #[doc = " Applies the configuration passed in `config`; see `Configuration` above. Fields not set in\n `config` are not changed. The drive strength is rounded up or capped to a value that the\n controller supports.\n\n `new_config` contains the configuration of the pin after all supported fields have been set.\n `Configure()` can be called with an empty `config` to return the current configuration\n without making any changes.\n"]
2527    fn configure(
2528        &mut self,
2529
2530        request: ::fidl_next::Request<pin::Configure, ___T>,
2531
2532        responder: ::fidl_next::Responder<pin::Configure, ___T>,
2533    ) -> impl ::core::future::Future<Output = ()>;
2534
2535    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2536        ::core::future::ready(())
2537    }
2538}
2539
2540impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Pin
2541where
2542    ___H: PinLocalServerHandler<___T>,
2543    ___T: ::fidl_next::Transport,
2544    for<'de> crate::wire::PinConfigureRequest<'de>: ::fidl_next::Decode<
2545            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2546            Constraint = (),
2547        >,
2548{
2549    async fn on_one_way(
2550        handler: &mut ___H,
2551        mut message: ::fidl_next::Message<___T>,
2552    ) -> ::core::result::Result<
2553        (),
2554        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2555    > {
2556        match *message.header().ordinal {
2557            ordinal => {
2558                handler.on_unknown_interaction(ordinal).await;
2559                if ::core::matches!(
2560                    message.header().flexibility(),
2561                    ::fidl_next::protocol::Flexibility::Strict
2562                ) {
2563                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2564                } else {
2565                    Ok(())
2566                }
2567            }
2568        }
2569    }
2570
2571    async fn on_two_way(
2572        handler: &mut ___H,
2573        mut message: ::fidl_next::Message<___T>,
2574        responder: ::fidl_next::protocol::Responder<___T>,
2575    ) -> ::core::result::Result<
2576        (),
2577        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2578    > {
2579        match *message.header().ordinal {
2580            339044404492915211 => {
2581                let responder = ::fidl_next::Responder::from_untyped(responder);
2582
2583                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2584                    Ok(decoded) => {
2585                        handler
2586                            .configure(::fidl_next::Request::from_decoded(decoded), responder)
2587                            .await;
2588                        Ok(())
2589                    }
2590                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2591                        ordinal: 339044404492915211,
2592                        error,
2593                    }),
2594                }
2595            }
2596
2597            ordinal => {
2598                handler.on_unknown_interaction(ordinal).await;
2599                if ::core::matches!(
2600                    message.header().flexibility(),
2601                    ::fidl_next::protocol::Flexibility::Strict
2602                ) {
2603                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2604                } else {
2605                    responder
2606                        .respond_framework_error(
2607                            ordinal,
2608                            ::fidl_next::FrameworkError::UnknownMethod,
2609                        )
2610                        .expect("encoding a framework error should never fail")
2611                        .await?;
2612                    Ok(())
2613                }
2614            }
2615        }
2616    }
2617}
2618
2619/// A client handler for the Pin protocol.
2620///
2621/// See [`Pin`] for more details.
2622pub trait PinClientHandler<
2623    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2624    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2625>
2626{
2627    fn on_unknown_interaction(
2628        &mut self,
2629        ordinal: u64,
2630    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2631        ::core::future::ready(())
2632    }
2633}
2634
2635impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Pin
2636where
2637    ___H: PinClientHandler<___T> + ::core::marker::Send,
2638    ___T: ::fidl_next::Transport,
2639{
2640    async fn on_event(
2641        handler: &mut ___H,
2642        mut message: ::fidl_next::Message<___T>,
2643    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2644        match *message.header().ordinal {
2645            ordinal => {
2646                handler.on_unknown_interaction(ordinal).await;
2647                if ::core::matches!(
2648                    message.header().flexibility(),
2649                    ::fidl_next::protocol::Flexibility::Strict
2650                ) {
2651                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2652                } else {
2653                    Ok(())
2654                }
2655            }
2656        }
2657    }
2658}
2659
2660/// A server handler for the Pin protocol.
2661///
2662/// See [`Pin`] for more details.
2663pub trait PinServerHandler<
2664    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2665    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2666>
2667{
2668    #[doc = " Applies the configuration passed in `config`; see `Configuration` above. Fields not set in\n `config` are not changed. The drive strength is rounded up or capped to a value that the\n controller supports.\n\n `new_config` contains the configuration of the pin after all supported fields have been set.\n `Configure()` can be called with an empty `config` to return the current configuration\n without making any changes.\n"]
2669    fn configure(
2670        &mut self,
2671
2672        request: ::fidl_next::Request<pin::Configure, ___T>,
2673
2674        responder: ::fidl_next::Responder<pin::Configure, ___T>,
2675    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2676
2677    fn on_unknown_interaction(
2678        &mut self,
2679        ordinal: u64,
2680    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2681        ::core::future::ready(())
2682    }
2683}
2684
2685impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Pin
2686where
2687    ___H: PinServerHandler<___T> + ::core::marker::Send,
2688    ___T: ::fidl_next::Transport,
2689    for<'de> crate::wire::PinConfigureRequest<'de>: ::fidl_next::Decode<
2690            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2691            Constraint = (),
2692        >,
2693{
2694    async fn on_one_way(
2695        handler: &mut ___H,
2696        mut message: ::fidl_next::Message<___T>,
2697    ) -> ::core::result::Result<
2698        (),
2699        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2700    > {
2701        match *message.header().ordinal {
2702            ordinal => {
2703                handler.on_unknown_interaction(ordinal).await;
2704                if ::core::matches!(
2705                    message.header().flexibility(),
2706                    ::fidl_next::protocol::Flexibility::Strict
2707                ) {
2708                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2709                } else {
2710                    Ok(())
2711                }
2712            }
2713        }
2714    }
2715
2716    async fn on_two_way(
2717        handler: &mut ___H,
2718        mut message: ::fidl_next::Message<___T>,
2719        responder: ::fidl_next::protocol::Responder<___T>,
2720    ) -> ::core::result::Result<
2721        (),
2722        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2723    > {
2724        match *message.header().ordinal {
2725            339044404492915211 => {
2726                let responder = ::fidl_next::Responder::from_untyped(responder);
2727
2728                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2729                    Ok(decoded) => {
2730                        handler
2731                            .configure(::fidl_next::Request::from_decoded(decoded), responder)
2732                            .await;
2733                        Ok(())
2734                    }
2735                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2736                        ordinal: 339044404492915211,
2737                        error,
2738                    }),
2739                }
2740            }
2741
2742            ordinal => {
2743                handler.on_unknown_interaction(ordinal).await;
2744                if ::core::matches!(
2745                    message.header().flexibility(),
2746                    ::fidl_next::protocol::Flexibility::Strict
2747                ) {
2748                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2749                } else {
2750                    responder
2751                        .respond_framework_error(
2752                            ordinal,
2753                            ::fidl_next::FrameworkError::UnknownMethod,
2754                        )
2755                        .expect("encoding a framework error should never fail")
2756                        .await?;
2757                    Ok(())
2758                }
2759            }
2760        }
2761    }
2762}
2763
2764impl<___T> PinClientHandler<___T> for ::fidl_next::IgnoreEvents
2765where
2766    ___T: ::fidl_next::Transport,
2767{
2768    async fn on_unknown_interaction(&mut self, _: u64) {}
2769}
2770
2771impl<___H, ___T> PinLocalClientHandler<___T> for ::fidl_next::Local<___H>
2772where
2773    ___H: PinClientHandler<___T>,
2774    ___T: ::fidl_next::Transport,
2775{
2776    async fn on_unknown_interaction(&mut self, ordinal: u64) {
2777        ___H::on_unknown_interaction(&mut self.0, ordinal).await
2778    }
2779}
2780
2781impl<___H, ___T> PinLocalServerHandler<___T> for ::fidl_next::Local<___H>
2782where
2783    ___H: PinServerHandler<___T>,
2784    ___T: ::fidl_next::Transport,
2785{
2786    async fn configure(
2787        &mut self,
2788
2789        request: ::fidl_next::Request<pin::Configure, ___T>,
2790
2791        responder: ::fidl_next::Responder<pin::Configure, ___T>,
2792    ) {
2793        ___H::configure(&mut self.0, request, responder).await
2794    }
2795
2796    async fn on_unknown_interaction(&mut self, ordinal: u64) {
2797        ___H::on_unknown_interaction(&mut self.0, ordinal).await
2798    }
2799}
2800
2801/// The type corresponding to the PinStates protocol.
2802#[derive(PartialEq, Debug)]
2803pub struct PinStates;
2804
2805#[cfg(target_os = "fuchsia")]
2806impl ::fidl_next::HasTransport for PinStates {
2807    type Transport = ::fidl_next::fuchsia::zx::Channel;
2808}
2809
2810pub mod pin_states {
2811    pub mod prelude {
2812        pub use crate::{
2813            PinStates, PinStatesClientHandler, PinStatesLocalClientHandler,
2814            PinStatesLocalServerHandler, PinStatesServerHandler, pin_states,
2815        };
2816
2817        pub use crate::natural::PinStatesSelectStateRequest;
2818
2819        pub use crate::natural::PinStatesSelectStateResponse;
2820    }
2821
2822    pub struct SelectState;
2823
2824    impl ::fidl_next::Method for SelectState {
2825        const ORDINAL: u64 = 5052481683179630734;
2826        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2827            ::fidl_next::protocol::Flexibility::Strict;
2828
2829        type Protocol = crate::PinStates;
2830
2831        type Request = crate::wire::PinStatesSelectStateRequest<'static>;
2832    }
2833
2834    impl ::fidl_next::TwoWayMethod for SelectState {
2835        type Response = ::fidl_next::wire::Result<
2836            'static,
2837            crate::wire::PinStatesSelectStateResponse,
2838            ::fidl_next::wire::fuchsia::Status,
2839        >;
2840    }
2841
2842    impl<___R> ::fidl_next::Respond<___R> for SelectState {
2843        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
2844
2845        fn respond(response: ___R) -> Self::Output {
2846            ::core::result::Result::Ok(response)
2847        }
2848    }
2849
2850    impl<___R> ::fidl_next::RespondErr<___R> for SelectState {
2851        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2852
2853        fn respond_err(response: ___R) -> Self::Output {
2854            ::core::result::Result::Err(response)
2855        }
2856    }
2857
2858    mod ___detail {
2859        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::PinStates
2860        where
2861            ___T: ::fidl_next::Transport,
2862        {
2863            type Client = PinStatesClient<___T>;
2864            type Server = PinStatesServer<___T>;
2865        }
2866
2867        /// The client for the `PinStates` protocol.
2868        #[repr(transparent)]
2869        pub struct PinStatesClient<___T: ::fidl_next::Transport> {
2870            #[allow(dead_code)]
2871            client: ::fidl_next::protocol::Client<___T>,
2872        }
2873
2874        impl<___T> PinStatesClient<___T>
2875        where
2876            ___T: ::fidl_next::Transport,
2877        {
2878            #[doc = " Configures the pins to the state with the given name.\n\n Errors:\n * `ZX_ERR_NOT_FOUND`: The state with the given name is not found.\n * Other errors may be returned if applying the pin configuration fails.\n   In case of failure, some pin configurations might have been applied,\n   leaving the pins in a partially configured state.\n"]
2879            pub fn select_state(
2880                &self,
2881
2882                name: impl ::fidl_next::Encode<
2883                    ::fidl_next::wire::String<'static>,
2884                    <___T as ::fidl_next::Transport>::SendBuffer,
2885                >,
2886            ) -> ::fidl_next::TwoWayFuture<'_, super::SelectState, ___T>
2887            where
2888                <___T as ::fidl_next::Transport>::SendBuffer:
2889                    ::fidl_next::encoder::InternalHandleEncoder,
2890                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2891            {
2892                self.select_state_with(crate::generic::PinStatesSelectStateRequest { name })
2893            }
2894
2895            #[doc = " Configures the pins to the state with the given name.\n\n Errors:\n * `ZX_ERR_NOT_FOUND`: The state with the given name is not found.\n * Other errors may be returned if applying the pin configuration fails.\n   In case of failure, some pin configurations might have been applied,\n   leaving the pins in a partially configured state.\n"]
2896            pub fn select_state_with<___R>(
2897                &self,
2898                request: ___R,
2899            ) -> ::fidl_next::TwoWayFuture<'_, super::SelectState, ___T>
2900            where
2901                ___R: ::fidl_next::Encode<
2902                        crate::wire::PinStatesSelectStateRequest<'static>,
2903                        <___T as ::fidl_next::Transport>::SendBuffer,
2904                    >,
2905            {
2906                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2907                    5052481683179630734,
2908                    <super::SelectState as ::fidl_next::Method>::FLEXIBILITY,
2909                    request,
2910                ))
2911            }
2912        }
2913
2914        /// The server for the `PinStates` protocol.
2915        #[repr(transparent)]
2916        pub struct PinStatesServer<___T: ::fidl_next::Transport> {
2917            server: ::fidl_next::protocol::Server<___T>,
2918        }
2919
2920        impl<___T> PinStatesServer<___T> where ___T: ::fidl_next::Transport {}
2921    }
2922}
2923
2924#[diagnostic::on_unimplemented(
2925    note = "If {Self} implements the non-local PinStatesClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2926)]
2927
2928/// A client handler for the PinStates protocol.
2929///
2930/// See [`PinStates`] for more details.
2931pub trait PinStatesLocalClientHandler<
2932    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2933    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2934>
2935{
2936    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2937        ::core::future::ready(())
2938    }
2939}
2940
2941impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for PinStates
2942where
2943    ___H: PinStatesLocalClientHandler<___T>,
2944    ___T: ::fidl_next::Transport,
2945{
2946    async fn on_event(
2947        handler: &mut ___H,
2948        mut message: ::fidl_next::Message<___T>,
2949    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2950        match *message.header().ordinal {
2951            ordinal => {
2952                handler.on_unknown_interaction(ordinal).await;
2953                if ::core::matches!(
2954                    message.header().flexibility(),
2955                    ::fidl_next::protocol::Flexibility::Strict
2956                ) {
2957                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2958                } else {
2959                    Ok(())
2960                }
2961            }
2962        }
2963    }
2964}
2965
2966#[diagnostic::on_unimplemented(
2967    note = "If {Self} implements the non-local PinStatesServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2968)]
2969
2970/// A server handler for the PinStates protocol.
2971///
2972/// See [`PinStates`] for more details.
2973pub trait PinStatesLocalServerHandler<
2974    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2975    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2976>
2977{
2978    #[doc = " Configures the pins to the state with the given name.\n\n Errors:\n * `ZX_ERR_NOT_FOUND`: The state with the given name is not found.\n * Other errors may be returned if applying the pin configuration fails.\n   In case of failure, some pin configurations might have been applied,\n   leaving the pins in a partially configured state.\n"]
2979    fn select_state(
2980        &mut self,
2981
2982        request: ::fidl_next::Request<pin_states::SelectState, ___T>,
2983
2984        responder: ::fidl_next::Responder<pin_states::SelectState, ___T>,
2985    ) -> impl ::core::future::Future<Output = ()>;
2986
2987    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2988        ::core::future::ready(())
2989    }
2990}
2991
2992impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for PinStates
2993where
2994    ___H: PinStatesLocalServerHandler<___T>,
2995    ___T: ::fidl_next::Transport,
2996    for<'de> crate::wire::PinStatesSelectStateRequest<'de>: ::fidl_next::Decode<
2997            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2998            Constraint = (),
2999        >,
3000{
3001    async fn on_one_way(
3002        handler: &mut ___H,
3003        mut message: ::fidl_next::Message<___T>,
3004    ) -> ::core::result::Result<
3005        (),
3006        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3007    > {
3008        match *message.header().ordinal {
3009            ordinal => {
3010                handler.on_unknown_interaction(ordinal).await;
3011                if ::core::matches!(
3012                    message.header().flexibility(),
3013                    ::fidl_next::protocol::Flexibility::Strict
3014                ) {
3015                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3016                } else {
3017                    Ok(())
3018                }
3019            }
3020        }
3021    }
3022
3023    async fn on_two_way(
3024        handler: &mut ___H,
3025        mut message: ::fidl_next::Message<___T>,
3026        responder: ::fidl_next::protocol::Responder<___T>,
3027    ) -> ::core::result::Result<
3028        (),
3029        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3030    > {
3031        match *message.header().ordinal {
3032            5052481683179630734 => {
3033                let responder = ::fidl_next::Responder::from_untyped(responder);
3034
3035                match ::fidl_next::AsDecoderExt::into_decoded(message) {
3036                    Ok(decoded) => {
3037                        handler
3038                            .select_state(::fidl_next::Request::from_decoded(decoded), responder)
3039                            .await;
3040                        Ok(())
3041                    }
3042                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3043                        ordinal: 5052481683179630734,
3044                        error,
3045                    }),
3046                }
3047            }
3048
3049            ordinal => {
3050                handler.on_unknown_interaction(ordinal).await;
3051                if ::core::matches!(
3052                    message.header().flexibility(),
3053                    ::fidl_next::protocol::Flexibility::Strict
3054                ) {
3055                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3056                } else {
3057                    responder
3058                        .respond_framework_error(
3059                            ordinal,
3060                            ::fidl_next::FrameworkError::UnknownMethod,
3061                        )
3062                        .expect("encoding a framework error should never fail")
3063                        .await?;
3064                    Ok(())
3065                }
3066            }
3067        }
3068    }
3069}
3070
3071/// A client handler for the PinStates protocol.
3072///
3073/// See [`PinStates`] for more details.
3074pub trait PinStatesClientHandler<
3075    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3076    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3077>
3078{
3079    fn on_unknown_interaction(
3080        &mut self,
3081        ordinal: u64,
3082    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3083        ::core::future::ready(())
3084    }
3085}
3086
3087impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for PinStates
3088where
3089    ___H: PinStatesClientHandler<___T> + ::core::marker::Send,
3090    ___T: ::fidl_next::Transport,
3091{
3092    async fn on_event(
3093        handler: &mut ___H,
3094        mut message: ::fidl_next::Message<___T>,
3095    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3096        match *message.header().ordinal {
3097            ordinal => {
3098                handler.on_unknown_interaction(ordinal).await;
3099                if ::core::matches!(
3100                    message.header().flexibility(),
3101                    ::fidl_next::protocol::Flexibility::Strict
3102                ) {
3103                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3104                } else {
3105                    Ok(())
3106                }
3107            }
3108        }
3109    }
3110}
3111
3112/// A server handler for the PinStates protocol.
3113///
3114/// See [`PinStates`] for more details.
3115pub trait PinStatesServerHandler<
3116    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3117    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3118>
3119{
3120    #[doc = " Configures the pins to the state with the given name.\n\n Errors:\n * `ZX_ERR_NOT_FOUND`: The state with the given name is not found.\n * Other errors may be returned if applying the pin configuration fails.\n   In case of failure, some pin configurations might have been applied,\n   leaving the pins in a partially configured state.\n"]
3121    fn select_state(
3122        &mut self,
3123
3124        request: ::fidl_next::Request<pin_states::SelectState, ___T>,
3125
3126        responder: ::fidl_next::Responder<pin_states::SelectState, ___T>,
3127    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3128
3129    fn on_unknown_interaction(
3130        &mut self,
3131        ordinal: u64,
3132    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3133        ::core::future::ready(())
3134    }
3135}
3136
3137impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for PinStates
3138where
3139    ___H: PinStatesServerHandler<___T> + ::core::marker::Send,
3140    ___T: ::fidl_next::Transport,
3141    for<'de> crate::wire::PinStatesSelectStateRequest<'de>: ::fidl_next::Decode<
3142            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3143            Constraint = (),
3144        >,
3145{
3146    async fn on_one_way(
3147        handler: &mut ___H,
3148        mut message: ::fidl_next::Message<___T>,
3149    ) -> ::core::result::Result<
3150        (),
3151        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3152    > {
3153        match *message.header().ordinal {
3154            ordinal => {
3155                handler.on_unknown_interaction(ordinal).await;
3156                if ::core::matches!(
3157                    message.header().flexibility(),
3158                    ::fidl_next::protocol::Flexibility::Strict
3159                ) {
3160                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3161                } else {
3162                    Ok(())
3163                }
3164            }
3165        }
3166    }
3167
3168    async fn on_two_way(
3169        handler: &mut ___H,
3170        mut message: ::fidl_next::Message<___T>,
3171        responder: ::fidl_next::protocol::Responder<___T>,
3172    ) -> ::core::result::Result<
3173        (),
3174        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3175    > {
3176        match *message.header().ordinal {
3177            5052481683179630734 => {
3178                let responder = ::fidl_next::Responder::from_untyped(responder);
3179
3180                match ::fidl_next::AsDecoderExt::into_decoded(message) {
3181                    Ok(decoded) => {
3182                        handler
3183                            .select_state(::fidl_next::Request::from_decoded(decoded), responder)
3184                            .await;
3185                        Ok(())
3186                    }
3187                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3188                        ordinal: 5052481683179630734,
3189                        error,
3190                    }),
3191                }
3192            }
3193
3194            ordinal => {
3195                handler.on_unknown_interaction(ordinal).await;
3196                if ::core::matches!(
3197                    message.header().flexibility(),
3198                    ::fidl_next::protocol::Flexibility::Strict
3199                ) {
3200                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3201                } else {
3202                    responder
3203                        .respond_framework_error(
3204                            ordinal,
3205                            ::fidl_next::FrameworkError::UnknownMethod,
3206                        )
3207                        .expect("encoding a framework error should never fail")
3208                        .await?;
3209                    Ok(())
3210                }
3211            }
3212        }
3213    }
3214}
3215
3216impl<___T> PinStatesClientHandler<___T> for ::fidl_next::IgnoreEvents
3217where
3218    ___T: ::fidl_next::Transport,
3219{
3220    async fn on_unknown_interaction(&mut self, _: u64) {}
3221}
3222
3223impl<___H, ___T> PinStatesLocalClientHandler<___T> for ::fidl_next::Local<___H>
3224where
3225    ___H: PinStatesClientHandler<___T>,
3226    ___T: ::fidl_next::Transport,
3227{
3228    async fn on_unknown_interaction(&mut self, ordinal: u64) {
3229        ___H::on_unknown_interaction(&mut self.0, ordinal).await
3230    }
3231}
3232
3233impl<___H, ___T> PinStatesLocalServerHandler<___T> for ::fidl_next::Local<___H>
3234where
3235    ___H: PinStatesServerHandler<___T>,
3236    ___T: ::fidl_next::Transport,
3237{
3238    async fn select_state(
3239        &mut self,
3240
3241        request: ::fidl_next::Request<pin_states::SelectState, ___T>,
3242
3243        responder: ::fidl_next::Responder<pin_states::SelectState, ___T>,
3244    ) {
3245        ___H::select_state(&mut self.0, request, responder).await
3246    }
3247
3248    async fn on_unknown_interaction(&mut self, ordinal: u64) {
3249        ___H::on_unknown_interaction(&mut self.0, ordinal).await
3250    }
3251}