Skip to main content

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