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    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DriverError, ___E> for DriverError
813    where
814        ___E: ?Sized,
815    {
816        #[inline]
817        fn encode(
818            self,
819            encoder: &mut ___E,
820            out: &mut ::core::mem::MaybeUninit<crate::wire::DriverError>,
821            _: (),
822        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
823            ::fidl_next::Encode::encode(&self, encoder, out, ())
824        }
825    }
826
827    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DriverError, ___E> for &'a DriverError
828    where
829        ___E: ?Sized,
830    {
831        #[inline]
832        fn encode(
833            self,
834            encoder: &mut ___E,
835            out: &mut ::core::mem::MaybeUninit<crate::wire::DriverError>,
836            _: (),
837        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
838            ::fidl_next::munge!(let crate::wire::DriverError { value } = out);
839            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
840                DriverError::Internal => 1,
841
842                DriverError::NotSupported => 2,
843
844                DriverError::InvalidArgs => 3,
845
846                DriverError::BadState => 4,
847
848                DriverError::IoRefused => 5,
849
850                DriverError::Canceled => 6,
851
852                DriverError::NotFound => 7,
853
854                DriverError::UnknownOrdinal_(value) => value,
855            }));
856
857            Ok(())
858        }
859    }
860
861    impl ::core::convert::From<crate::wire::DriverError> for DriverError {
862        fn from(wire: crate::wire::DriverError) -> Self {
863            match u32::from(wire.value) {
864                1 => Self::Internal,
865
866                2 => Self::NotSupported,
867
868                3 => Self::InvalidArgs,
869
870                4 => Self::BadState,
871
872                5 => Self::IoRefused,
873
874                6 => Self::Canceled,
875
876                7 => Self::NotFound,
877
878                value => Self::UnknownOrdinal_(value),
879            }
880        }
881    }
882
883    impl ::fidl_next::FromWire<crate::wire::DriverError> for DriverError {
884        #[inline]
885        fn from_wire(wire: crate::wire::DriverError) -> Self {
886            Self::from(wire)
887        }
888    }
889
890    impl ::fidl_next::FromWireRef<crate::wire::DriverError> for DriverError {
891        #[inline]
892        fn from_wire_ref(wire: &crate::wire::DriverError) -> Self {
893            Self::from(*wire)
894        }
895    }
896
897    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
898    pub struct DebugGetControllerPropertiesResponse {
899        pub name: ::core::option::Option<::std::string::String>,
900    }
901
902    impl DebugGetControllerPropertiesResponse {
903        fn __max_ordinal(&self) -> usize {
904            if self.name.is_some() {
905                return 1;
906            }
907
908            0
909        }
910    }
911
912    unsafe impl<___E>
913        ::fidl_next::Encode<crate::wire::DebugGetControllerPropertiesResponse<'static>, ___E>
914        for DebugGetControllerPropertiesResponse
915    where
916        ___E: ::fidl_next::Encoder + ?Sized,
917    {
918        #[inline]
919        fn encode(
920            mut self,
921            encoder: &mut ___E,
922            out: &mut ::core::mem::MaybeUninit<
923                crate::wire::DebugGetControllerPropertiesResponse<'static>,
924            >,
925            _: (),
926        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
927            ::fidl_next::munge!(let crate::wire::DebugGetControllerPropertiesResponse { table } = out);
928
929            let max_ord = self.__max_ordinal();
930
931            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
932            ::fidl_next::Wire::zero_padding(&mut out);
933
934            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
935                ::fidl_next::wire::Envelope,
936            >(encoder, max_ord);
937
938            for i in 1..=max_ord {
939                match i {
940                    1 => {
941                        if let Some(value) = self.name.take() {
942                            ::fidl_next::wire::Envelope::encode_value::<
943                                ::fidl_next::wire::String<'static>,
944                                ___E,
945                            >(
946                                value, preallocated.encoder, &mut out, 64
947                            )?;
948                        } else {
949                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
950                        }
951                    }
952
953                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
954                }
955                unsafe {
956                    preallocated.write_next(out.assume_init_ref());
957                }
958            }
959
960            ::fidl_next::wire::Table::encode_len(table, max_ord);
961
962            Ok(())
963        }
964    }
965
966    unsafe impl<'a, ___E>
967        ::fidl_next::Encode<crate::wire::DebugGetControllerPropertiesResponse<'static>, ___E>
968        for &'a DebugGetControllerPropertiesResponse
969    where
970        ___E: ::fidl_next::Encoder + ?Sized,
971    {
972        #[inline]
973        fn encode(
974            self,
975            encoder: &mut ___E,
976            out: &mut ::core::mem::MaybeUninit<
977                crate::wire::DebugGetControllerPropertiesResponse<'static>,
978            >,
979            _: (),
980        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
981            ::fidl_next::munge!(let crate::wire::DebugGetControllerPropertiesResponse { table } = out);
982
983            let max_ord = self.__max_ordinal();
984
985            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
986            ::fidl_next::Wire::zero_padding(&mut out);
987
988            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
989                ::fidl_next::wire::Envelope,
990            >(encoder, max_ord);
991
992            for i in 1..=max_ord {
993                match i {
994                    1 => {
995                        if let Some(value) = &self.name {
996                            ::fidl_next::wire::Envelope::encode_value::<
997                                ::fidl_next::wire::String<'static>,
998                                ___E,
999                            >(
1000                                value, preallocated.encoder, &mut out, 64
1001                            )?;
1002                        } else {
1003                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1004                        }
1005                    }
1006
1007                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1008                }
1009                unsafe {
1010                    preallocated.write_next(out.assume_init_ref());
1011                }
1012            }
1013
1014            ::fidl_next::wire::Table::encode_len(table, max_ord);
1015
1016            Ok(())
1017        }
1018    }
1019
1020    impl<'de> ::fidl_next::FromWire<crate::wire::DebugGetControllerPropertiesResponse<'de>>
1021        for DebugGetControllerPropertiesResponse
1022    {
1023        #[inline]
1024        fn from_wire(wire_: crate::wire::DebugGetControllerPropertiesResponse<'de>) -> Self {
1025            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1026
1027            let name = wire_.table.get(1);
1028
1029            Self {
1030                name: name.map(|envelope| {
1031                    ::fidl_next::FromWire::from_wire(unsafe {
1032                        envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
1033                    })
1034                }),
1035            }
1036        }
1037    }
1038
1039    impl<'de> ::fidl_next::FromWireRef<crate::wire::DebugGetControllerPropertiesResponse<'de>>
1040        for DebugGetControllerPropertiesResponse
1041    {
1042        #[inline]
1043        fn from_wire_ref(wire: &crate::wire::DebugGetControllerPropertiesResponse<'de>) -> Self {
1044            Self {
1045                name: wire.table.get(1).map(|envelope| {
1046                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1047                        envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
1048                    })
1049                }),
1050            }
1051        }
1052    }
1053
1054    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1055    pub struct DeviceRegisterReadRequest {
1056        pub address: u16,
1057
1058        pub size_bytes: u32,
1059    }
1060
1061    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceRegisterReadRequest, ___E>
1062        for DeviceRegisterReadRequest
1063    where
1064        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1065    {
1066        #[inline]
1067        fn encode(
1068            self,
1069            encoder_: &mut ___E,
1070            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRegisterReadRequest>,
1071            _: (),
1072        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1073            ::fidl_next::munge! {
1074                let crate::wire::DeviceRegisterReadRequest {
1075                    address,
1076                    size_bytes,
1077
1078                } = out_;
1079            }
1080
1081            ::fidl_next::Encode::encode(self.address, encoder_, address, ())?;
1082
1083            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(address.as_mut_ptr()) };
1084
1085            ::fidl_next::Encode::encode(self.size_bytes, encoder_, size_bytes, ())?;
1086
1087            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(size_bytes.as_mut_ptr()) };
1088
1089            Ok(())
1090        }
1091    }
1092
1093    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceRegisterReadRequest, ___E>
1094        for &'a DeviceRegisterReadRequest
1095    where
1096        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1097    {
1098        #[inline]
1099        fn encode(
1100            self,
1101            encoder_: &mut ___E,
1102            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRegisterReadRequest>,
1103            _: (),
1104        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1105            ::fidl_next::munge! {
1106                let crate::wire::DeviceRegisterReadRequest {
1107                    address,
1108                    size_bytes,
1109
1110                } = out_;
1111            }
1112
1113            ::fidl_next::Encode::encode(&self.address, encoder_, address, ())?;
1114
1115            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(address.as_mut_ptr()) };
1116
1117            ::fidl_next::Encode::encode(&self.size_bytes, encoder_, size_bytes, ())?;
1118
1119            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(size_bytes.as_mut_ptr()) };
1120
1121            Ok(())
1122        }
1123    }
1124
1125    unsafe impl<___E>
1126        ::fidl_next::EncodeOption<
1127            ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterReadRequest>,
1128            ___E,
1129        > for DeviceRegisterReadRequest
1130    where
1131        ___E: ::fidl_next::Encoder + ?Sized,
1132        DeviceRegisterReadRequest:
1133            ::fidl_next::Encode<crate::wire::DeviceRegisterReadRequest, ___E>,
1134    {
1135        #[inline]
1136        fn encode_option(
1137            this: ::core::option::Option<Self>,
1138            encoder: &mut ___E,
1139            out: &mut ::core::mem::MaybeUninit<
1140                ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterReadRequest>,
1141            >,
1142            _: (),
1143        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1144            if let Some(inner) = this {
1145                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1146                ::fidl_next::wire::Box::encode_present(out);
1147            } else {
1148                ::fidl_next::wire::Box::encode_absent(out);
1149            }
1150
1151            Ok(())
1152        }
1153    }
1154
1155    unsafe impl<'a, ___E>
1156        ::fidl_next::EncodeOption<
1157            ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterReadRequest>,
1158            ___E,
1159        > for &'a DeviceRegisterReadRequest
1160    where
1161        ___E: ::fidl_next::Encoder + ?Sized,
1162        &'a DeviceRegisterReadRequest:
1163            ::fidl_next::Encode<crate::wire::DeviceRegisterReadRequest, ___E>,
1164    {
1165        #[inline]
1166        fn encode_option(
1167            this: ::core::option::Option<Self>,
1168            encoder: &mut ___E,
1169            out: &mut ::core::mem::MaybeUninit<
1170                ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterReadRequest>,
1171            >,
1172            _: (),
1173        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1174            if let Some(inner) = this {
1175                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1176                ::fidl_next::wire::Box::encode_present(out);
1177            } else {
1178                ::fidl_next::wire::Box::encode_absent(out);
1179            }
1180
1181            Ok(())
1182        }
1183    }
1184
1185    impl ::fidl_next::FromWire<crate::wire::DeviceRegisterReadRequest> for DeviceRegisterReadRequest {
1186        #[inline]
1187        fn from_wire(wire: crate::wire::DeviceRegisterReadRequest) -> Self {
1188            Self {
1189                address: ::fidl_next::FromWire::from_wire(wire.address),
1190
1191                size_bytes: ::fidl_next::FromWire::from_wire(wire.size_bytes),
1192            }
1193        }
1194    }
1195
1196    impl ::fidl_next::FromWireRef<crate::wire::DeviceRegisterReadRequest>
1197        for DeviceRegisterReadRequest
1198    {
1199        #[inline]
1200        fn from_wire_ref(wire: &crate::wire::DeviceRegisterReadRequest) -> Self {
1201            Self {
1202                address: ::fidl_next::FromWireRef::from_wire_ref(&wire.address),
1203
1204                size_bytes: ::fidl_next::FromWireRef::from_wire_ref(&wire.size_bytes),
1205            }
1206        }
1207    }
1208
1209    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1210    pub struct DeviceRegisterReadResponse {
1211        pub data: ::std::vec::Vec<u8>,
1212    }
1213
1214    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceRegisterReadResponse<'static>, ___E>
1215        for DeviceRegisterReadResponse
1216    where
1217        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1218        ___E: ::fidl_next::Encoder,
1219    {
1220        #[inline]
1221        fn encode(
1222            self,
1223            encoder_: &mut ___E,
1224            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRegisterReadResponse<'static>>,
1225            _: (),
1226        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1227            ::fidl_next::munge! {
1228                let crate::wire::DeviceRegisterReadResponse {
1229                    data,
1230
1231                } = out_;
1232            }
1233
1234            ::fidl_next::Encode::encode(self.data, encoder_, data, (4294967295, ()))?;
1235
1236            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
1237            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1238
1239            Ok(())
1240        }
1241    }
1242
1243    unsafe impl<'a, ___E>
1244        ::fidl_next::Encode<crate::wire::DeviceRegisterReadResponse<'static>, ___E>
1245        for &'a DeviceRegisterReadResponse
1246    where
1247        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1248        ___E: ::fidl_next::Encoder,
1249    {
1250        #[inline]
1251        fn encode(
1252            self,
1253            encoder_: &mut ___E,
1254            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRegisterReadResponse<'static>>,
1255            _: (),
1256        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1257            ::fidl_next::munge! {
1258                let crate::wire::DeviceRegisterReadResponse {
1259                    data,
1260
1261                } = out_;
1262            }
1263
1264            ::fidl_next::Encode::encode(&self.data, encoder_, data, (4294967295, ()))?;
1265
1266            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
1267            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1268
1269            Ok(())
1270        }
1271    }
1272
1273    unsafe impl<___E>
1274        ::fidl_next::EncodeOption<
1275            ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterReadResponse<'static>>,
1276            ___E,
1277        > for DeviceRegisterReadResponse
1278    where
1279        ___E: ::fidl_next::Encoder + ?Sized,
1280        DeviceRegisterReadResponse:
1281            ::fidl_next::Encode<crate::wire::DeviceRegisterReadResponse<'static>, ___E>,
1282    {
1283        #[inline]
1284        fn encode_option(
1285            this: ::core::option::Option<Self>,
1286            encoder: &mut ___E,
1287            out: &mut ::core::mem::MaybeUninit<
1288                ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterReadResponse<'static>>,
1289            >,
1290            _: (),
1291        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1292            if let Some(inner) = this {
1293                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1294                ::fidl_next::wire::Box::encode_present(out);
1295            } else {
1296                ::fidl_next::wire::Box::encode_absent(out);
1297            }
1298
1299            Ok(())
1300        }
1301    }
1302
1303    unsafe impl<'a, ___E>
1304        ::fidl_next::EncodeOption<
1305            ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterReadResponse<'static>>,
1306            ___E,
1307        > for &'a DeviceRegisterReadResponse
1308    where
1309        ___E: ::fidl_next::Encoder + ?Sized,
1310        &'a DeviceRegisterReadResponse:
1311            ::fidl_next::Encode<crate::wire::DeviceRegisterReadResponse<'static>, ___E>,
1312    {
1313        #[inline]
1314        fn encode_option(
1315            this: ::core::option::Option<Self>,
1316            encoder: &mut ___E,
1317            out: &mut ::core::mem::MaybeUninit<
1318                ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterReadResponse<'static>>,
1319            >,
1320            _: (),
1321        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1322            if let Some(inner) = this {
1323                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1324                ::fidl_next::wire::Box::encode_present(out);
1325            } else {
1326                ::fidl_next::wire::Box::encode_absent(out);
1327            }
1328
1329            Ok(())
1330        }
1331    }
1332
1333    impl<'de> ::fidl_next::FromWire<crate::wire::DeviceRegisterReadResponse<'de>>
1334        for DeviceRegisterReadResponse
1335    {
1336        #[inline]
1337        fn from_wire(wire: crate::wire::DeviceRegisterReadResponse<'de>) -> Self {
1338            Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
1339        }
1340    }
1341
1342    impl<'de> ::fidl_next::FromWireRef<crate::wire::DeviceRegisterReadResponse<'de>>
1343        for DeviceRegisterReadResponse
1344    {
1345        #[inline]
1346        fn from_wire_ref(wire: &crate::wire::DeviceRegisterReadResponse<'de>) -> Self {
1347            Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
1348        }
1349    }
1350
1351    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1352    pub struct DeviceRegisterWriteRequest {
1353        pub address: u16,
1354
1355        pub data: ::std::vec::Vec<u8>,
1356    }
1357
1358    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceRegisterWriteRequest<'static>, ___E>
1359        for DeviceRegisterWriteRequest
1360    where
1361        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1362        ___E: ::fidl_next::Encoder,
1363    {
1364        #[inline]
1365        fn encode(
1366            self,
1367            encoder_: &mut ___E,
1368            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRegisterWriteRequest<'static>>,
1369            _: (),
1370        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1371            ::fidl_next::munge! {
1372                let crate::wire::DeviceRegisterWriteRequest {
1373                    address,
1374                    data,
1375
1376                } = out_;
1377            }
1378
1379            ::fidl_next::Encode::encode(self.address, encoder_, address, ())?;
1380
1381            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(address.as_mut_ptr()) };
1382
1383            ::fidl_next::Encode::encode(self.data, encoder_, data, (4294967295, ()))?;
1384
1385            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
1386            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1387
1388            Ok(())
1389        }
1390    }
1391
1392    unsafe impl<'a, ___E>
1393        ::fidl_next::Encode<crate::wire::DeviceRegisterWriteRequest<'static>, ___E>
1394        for &'a DeviceRegisterWriteRequest
1395    where
1396        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1397        ___E: ::fidl_next::Encoder,
1398    {
1399        #[inline]
1400        fn encode(
1401            self,
1402            encoder_: &mut ___E,
1403            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRegisterWriteRequest<'static>>,
1404            _: (),
1405        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1406            ::fidl_next::munge! {
1407                let crate::wire::DeviceRegisterWriteRequest {
1408                    address,
1409                    data,
1410
1411                } = out_;
1412            }
1413
1414            ::fidl_next::Encode::encode(&self.address, encoder_, address, ())?;
1415
1416            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(address.as_mut_ptr()) };
1417
1418            ::fidl_next::Encode::encode(&self.data, encoder_, data, (4294967295, ()))?;
1419
1420            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
1421            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1422
1423            Ok(())
1424        }
1425    }
1426
1427    unsafe impl<___E>
1428        ::fidl_next::EncodeOption<
1429            ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterWriteRequest<'static>>,
1430            ___E,
1431        > for DeviceRegisterWriteRequest
1432    where
1433        ___E: ::fidl_next::Encoder + ?Sized,
1434        DeviceRegisterWriteRequest:
1435            ::fidl_next::Encode<crate::wire::DeviceRegisterWriteRequest<'static>, ___E>,
1436    {
1437        #[inline]
1438        fn encode_option(
1439            this: ::core::option::Option<Self>,
1440            encoder: &mut ___E,
1441            out: &mut ::core::mem::MaybeUninit<
1442                ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterWriteRequest<'static>>,
1443            >,
1444            _: (),
1445        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1446            if let Some(inner) = this {
1447                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1448                ::fidl_next::wire::Box::encode_present(out);
1449            } else {
1450                ::fidl_next::wire::Box::encode_absent(out);
1451            }
1452
1453            Ok(())
1454        }
1455    }
1456
1457    unsafe impl<'a, ___E>
1458        ::fidl_next::EncodeOption<
1459            ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterWriteRequest<'static>>,
1460            ___E,
1461        > for &'a DeviceRegisterWriteRequest
1462    where
1463        ___E: ::fidl_next::Encoder + ?Sized,
1464        &'a DeviceRegisterWriteRequest:
1465            ::fidl_next::Encode<crate::wire::DeviceRegisterWriteRequest<'static>, ___E>,
1466    {
1467        #[inline]
1468        fn encode_option(
1469            this: ::core::option::Option<Self>,
1470            encoder: &mut ___E,
1471            out: &mut ::core::mem::MaybeUninit<
1472                ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterWriteRequest<'static>>,
1473            >,
1474            _: (),
1475        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1476            if let Some(inner) = this {
1477                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1478                ::fidl_next::wire::Box::encode_present(out);
1479            } else {
1480                ::fidl_next::wire::Box::encode_absent(out);
1481            }
1482
1483            Ok(())
1484        }
1485    }
1486
1487    impl<'de> ::fidl_next::FromWire<crate::wire::DeviceRegisterWriteRequest<'de>>
1488        for DeviceRegisterWriteRequest
1489    {
1490        #[inline]
1491        fn from_wire(wire: crate::wire::DeviceRegisterWriteRequest<'de>) -> Self {
1492            Self {
1493                address: ::fidl_next::FromWire::from_wire(wire.address),
1494
1495                data: ::fidl_next::FromWire::from_wire(wire.data),
1496            }
1497        }
1498    }
1499
1500    impl<'de> ::fidl_next::FromWireRef<crate::wire::DeviceRegisterWriteRequest<'de>>
1501        for DeviceRegisterWriteRequest
1502    {
1503        #[inline]
1504        fn from_wire_ref(wire: &crate::wire::DeviceRegisterWriteRequest<'de>) -> Self {
1505            Self {
1506                address: ::fidl_next::FromWireRef::from_wire_ref(&wire.address),
1507
1508                data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data),
1509            }
1510        }
1511    }
1512
1513    pub type DeviceRegisterWriteResponse = ();
1514
1515    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1516    pub struct DeviceGetPropertiesResponse {
1517        pub sid: ::core::option::Option<u8>,
1518
1519        pub name: ::core::option::Option<::std::string::String>,
1520    }
1521
1522    impl DeviceGetPropertiesResponse {
1523        fn __max_ordinal(&self) -> usize {
1524            if self.name.is_some() {
1525                return 2;
1526            }
1527
1528            if self.sid.is_some() {
1529                return 1;
1530            }
1531
1532            0
1533        }
1534    }
1535
1536    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceGetPropertiesResponse<'static>, ___E>
1537        for DeviceGetPropertiesResponse
1538    where
1539        ___E: ::fidl_next::Encoder + ?Sized,
1540    {
1541        #[inline]
1542        fn encode(
1543            mut self,
1544            encoder: &mut ___E,
1545            out: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetPropertiesResponse<'static>>,
1546            _: (),
1547        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1548            ::fidl_next::munge!(let crate::wire::DeviceGetPropertiesResponse { table } = out);
1549
1550            let max_ord = self.__max_ordinal();
1551
1552            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1553            ::fidl_next::Wire::zero_padding(&mut out);
1554
1555            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1556                ::fidl_next::wire::Envelope,
1557            >(encoder, max_ord);
1558
1559            for i in 1..=max_ord {
1560                match i {
1561                    2 => {
1562                        if let Some(value) = self.name.take() {
1563                            ::fidl_next::wire::Envelope::encode_value::<
1564                                ::fidl_next::wire::String<'static>,
1565                                ___E,
1566                            >(
1567                                value, preallocated.encoder, &mut out, 64
1568                            )?;
1569                        } else {
1570                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1571                        }
1572                    }
1573
1574                    1 => {
1575                        if let Some(value) = self.sid.take() {
1576                            ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
1577                                value,
1578                                preallocated.encoder,
1579                                &mut out,
1580                                (),
1581                            )?;
1582                        } else {
1583                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1584                        }
1585                    }
1586
1587                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1588                }
1589                unsafe {
1590                    preallocated.write_next(out.assume_init_ref());
1591                }
1592            }
1593
1594            ::fidl_next::wire::Table::encode_len(table, max_ord);
1595
1596            Ok(())
1597        }
1598    }
1599
1600    unsafe impl<'a, ___E>
1601        ::fidl_next::Encode<crate::wire::DeviceGetPropertiesResponse<'static>, ___E>
1602        for &'a DeviceGetPropertiesResponse
1603    where
1604        ___E: ::fidl_next::Encoder + ?Sized,
1605    {
1606        #[inline]
1607        fn encode(
1608            self,
1609            encoder: &mut ___E,
1610            out: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetPropertiesResponse<'static>>,
1611            _: (),
1612        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1613            ::fidl_next::munge!(let crate::wire::DeviceGetPropertiesResponse { table } = out);
1614
1615            let max_ord = self.__max_ordinal();
1616
1617            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1618            ::fidl_next::Wire::zero_padding(&mut out);
1619
1620            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1621                ::fidl_next::wire::Envelope,
1622            >(encoder, max_ord);
1623
1624            for i in 1..=max_ord {
1625                match i {
1626                    2 => {
1627                        if let Some(value) = &self.name {
1628                            ::fidl_next::wire::Envelope::encode_value::<
1629                                ::fidl_next::wire::String<'static>,
1630                                ___E,
1631                            >(
1632                                value, preallocated.encoder, &mut out, 64
1633                            )?;
1634                        } else {
1635                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1636                        }
1637                    }
1638
1639                    1 => {
1640                        if let Some(value) = &self.sid {
1641                            ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
1642                                value,
1643                                preallocated.encoder,
1644                                &mut out,
1645                                (),
1646                            )?;
1647                        } else {
1648                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1649                        }
1650                    }
1651
1652                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1653                }
1654                unsafe {
1655                    preallocated.write_next(out.assume_init_ref());
1656                }
1657            }
1658
1659            ::fidl_next::wire::Table::encode_len(table, max_ord);
1660
1661            Ok(())
1662        }
1663    }
1664
1665    impl<'de> ::fidl_next::FromWire<crate::wire::DeviceGetPropertiesResponse<'de>>
1666        for DeviceGetPropertiesResponse
1667    {
1668        #[inline]
1669        fn from_wire(wire_: crate::wire::DeviceGetPropertiesResponse<'de>) -> Self {
1670            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1671
1672            let sid = wire_.table.get(1);
1673
1674            let name = wire_.table.get(2);
1675
1676            Self {
1677                sid: sid.map(|envelope| {
1678                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
1679                }),
1680
1681                name: name.map(|envelope| {
1682                    ::fidl_next::FromWire::from_wire(unsafe {
1683                        envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
1684                    })
1685                }),
1686            }
1687        }
1688    }
1689
1690    impl<'de> ::fidl_next::FromWireRef<crate::wire::DeviceGetPropertiesResponse<'de>>
1691        for DeviceGetPropertiesResponse
1692    {
1693        #[inline]
1694        fn from_wire_ref(wire: &crate::wire::DeviceGetPropertiesResponse<'de>) -> Self {
1695            Self {
1696                sid: wire.table.get(1).map(|envelope| {
1697                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1698                        envelope.deref_unchecked::<u8>()
1699                    })
1700                }),
1701
1702                name: wire.table.get(2).map(|envelope| {
1703                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1704                        envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
1705                    })
1706                }),
1707            }
1708        }
1709    }
1710
1711    #[doc = " A single register read from or written to with an SPMI command that uses an 8-bit address.\n"]
1712    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1713    #[repr(C)]
1714    pub struct Register8 {
1715        pub address: u8,
1716
1717        pub data: u8,
1718    }
1719
1720    unsafe impl<___E> ::fidl_next::Encode<crate::wire::Register8, ___E> for Register8
1721    where
1722        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1723    {
1724        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, crate::wire::Register8> = unsafe {
1725            ::fidl_next::CopyOptimization::enable_if(
1726                true && <u8 as ::fidl_next::Encode<u8, ___E>>::COPY_OPTIMIZATION.is_enabled()
1727                    && <u8 as ::fidl_next::Encode<u8, ___E>>::COPY_OPTIMIZATION.is_enabled(),
1728            )
1729        };
1730
1731        #[inline]
1732        fn encode(
1733            self,
1734            encoder_: &mut ___E,
1735            out_: &mut ::core::mem::MaybeUninit<crate::wire::Register8>,
1736            _: (),
1737        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1738            ::fidl_next::munge! {
1739                let crate::wire::Register8 {
1740                    address,
1741                    data,
1742
1743                } = out_;
1744            }
1745
1746            ::fidl_next::Encode::encode(self.address, encoder_, address, ())?;
1747
1748            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(address.as_mut_ptr()) };
1749
1750            ::fidl_next::Encode::encode(self.data, encoder_, data, ())?;
1751
1752            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
1753
1754            Ok(())
1755        }
1756    }
1757
1758    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Register8, ___E> for &'a Register8
1759    where
1760        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1761    {
1762        #[inline]
1763        fn encode(
1764            self,
1765            encoder_: &mut ___E,
1766            out_: &mut ::core::mem::MaybeUninit<crate::wire::Register8>,
1767            _: (),
1768        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1769            ::fidl_next::munge! {
1770                let crate::wire::Register8 {
1771                    address,
1772                    data,
1773
1774                } = out_;
1775            }
1776
1777            ::fidl_next::Encode::encode(&self.address, encoder_, address, ())?;
1778
1779            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(address.as_mut_ptr()) };
1780
1781            ::fidl_next::Encode::encode(&self.data, encoder_, data, ())?;
1782
1783            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
1784
1785            Ok(())
1786        }
1787    }
1788
1789    unsafe impl<___E>
1790        ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::Register8>, ___E>
1791        for Register8
1792    where
1793        ___E: ::fidl_next::Encoder + ?Sized,
1794        Register8: ::fidl_next::Encode<crate::wire::Register8, ___E>,
1795    {
1796        #[inline]
1797        fn encode_option(
1798            this: ::core::option::Option<Self>,
1799            encoder: &mut ___E,
1800            out: &mut ::core::mem::MaybeUninit<
1801                ::fidl_next::wire::Box<'static, crate::wire::Register8>,
1802            >,
1803            _: (),
1804        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1805            if let Some(inner) = this {
1806                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1807                ::fidl_next::wire::Box::encode_present(out);
1808            } else {
1809                ::fidl_next::wire::Box::encode_absent(out);
1810            }
1811
1812            Ok(())
1813        }
1814    }
1815
1816    unsafe impl<'a, ___E>
1817        ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::Register8>, ___E>
1818        for &'a Register8
1819    where
1820        ___E: ::fidl_next::Encoder + ?Sized,
1821        &'a Register8: ::fidl_next::Encode<crate::wire::Register8, ___E>,
1822    {
1823        #[inline]
1824        fn encode_option(
1825            this: ::core::option::Option<Self>,
1826            encoder: &mut ___E,
1827            out: &mut ::core::mem::MaybeUninit<
1828                ::fidl_next::wire::Box<'static, crate::wire::Register8>,
1829            >,
1830            _: (),
1831        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1832            if let Some(inner) = this {
1833                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1834                ::fidl_next::wire::Box::encode_present(out);
1835            } else {
1836                ::fidl_next::wire::Box::encode_absent(out);
1837            }
1838
1839            Ok(())
1840        }
1841    }
1842
1843    impl ::fidl_next::FromWire<crate::wire::Register8> for Register8 {
1844        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::Register8, Self> = unsafe {
1845            ::fidl_next::CopyOptimization::enable_if(
1846                true && <u8 as ::fidl_next::FromWire<u8>>::COPY_OPTIMIZATION.is_enabled()
1847                    && <u8 as ::fidl_next::FromWire<u8>>::COPY_OPTIMIZATION.is_enabled(),
1848            )
1849        };
1850
1851        #[inline]
1852        fn from_wire(wire: crate::wire::Register8) -> Self {
1853            Self {
1854                address: ::fidl_next::FromWire::from_wire(wire.address),
1855
1856                data: ::fidl_next::FromWire::from_wire(wire.data),
1857            }
1858        }
1859    }
1860
1861    impl ::fidl_next::FromWireRef<crate::wire::Register8> for Register8 {
1862        #[inline]
1863        fn from_wire_ref(wire: &crate::wire::Register8) -> Self {
1864            Self {
1865                address: ::fidl_next::FromWireRef::from_wire_ref(&wire.address),
1866
1867                data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data),
1868            }
1869        }
1870    }
1871
1872    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1873    pub struct DeviceCancelWatchControllerWriteCommandsRequest {
1874        pub address: u8,
1875
1876        pub size: u16,
1877    }
1878
1879    unsafe impl<___E>
1880        ::fidl_next::Encode<crate::wire::DeviceCancelWatchControllerWriteCommandsRequest, ___E>
1881        for DeviceCancelWatchControllerWriteCommandsRequest
1882    where
1883        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1884    {
1885        #[inline]
1886        fn encode(
1887            self,
1888            encoder_: &mut ___E,
1889            out_: &mut ::core::mem::MaybeUninit<
1890                crate::wire::DeviceCancelWatchControllerWriteCommandsRequest,
1891            >,
1892            _: (),
1893        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1894            ::fidl_next::munge! {
1895                let crate::wire::DeviceCancelWatchControllerWriteCommandsRequest {
1896                    address,
1897                    size,
1898
1899                } = out_;
1900            }
1901
1902            ::fidl_next::Encode::encode(self.address, encoder_, address, ())?;
1903
1904            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(address.as_mut_ptr()) };
1905
1906            ::fidl_next::Encode::encode(self.size, encoder_, size, ())?;
1907
1908            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(size.as_mut_ptr()) };
1909
1910            Ok(())
1911        }
1912    }
1913
1914    unsafe impl<'a, ___E>
1915        ::fidl_next::Encode<crate::wire::DeviceCancelWatchControllerWriteCommandsRequest, ___E>
1916        for &'a DeviceCancelWatchControllerWriteCommandsRequest
1917    where
1918        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1919    {
1920        #[inline]
1921        fn encode(
1922            self,
1923            encoder_: &mut ___E,
1924            out_: &mut ::core::mem::MaybeUninit<
1925                crate::wire::DeviceCancelWatchControllerWriteCommandsRequest,
1926            >,
1927            _: (),
1928        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1929            ::fidl_next::munge! {
1930                let crate::wire::DeviceCancelWatchControllerWriteCommandsRequest {
1931                    address,
1932                    size,
1933
1934                } = out_;
1935            }
1936
1937            ::fidl_next::Encode::encode(&self.address, encoder_, address, ())?;
1938
1939            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(address.as_mut_ptr()) };
1940
1941            ::fidl_next::Encode::encode(&self.size, encoder_, size, ())?;
1942
1943            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(size.as_mut_ptr()) };
1944
1945            Ok(())
1946        }
1947    }
1948
1949    unsafe impl<___E>
1950        ::fidl_next::EncodeOption<
1951            ::fidl_next::wire::Box<
1952                'static,
1953                crate::wire::DeviceCancelWatchControllerWriteCommandsRequest,
1954            >,
1955            ___E,
1956        > for DeviceCancelWatchControllerWriteCommandsRequest
1957    where
1958        ___E: ::fidl_next::Encoder + ?Sized,
1959        DeviceCancelWatchControllerWriteCommandsRequest:
1960            ::fidl_next::Encode<crate::wire::DeviceCancelWatchControllerWriteCommandsRequest, ___E>,
1961    {
1962        #[inline]
1963        fn encode_option(
1964            this: ::core::option::Option<Self>,
1965            encoder: &mut ___E,
1966            out: &mut ::core::mem::MaybeUninit<
1967                ::fidl_next::wire::Box<
1968                    'static,
1969                    crate::wire::DeviceCancelWatchControllerWriteCommandsRequest,
1970                >,
1971            >,
1972            _: (),
1973        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1974            if let Some(inner) = this {
1975                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1976                ::fidl_next::wire::Box::encode_present(out);
1977            } else {
1978                ::fidl_next::wire::Box::encode_absent(out);
1979            }
1980
1981            Ok(())
1982        }
1983    }
1984
1985    unsafe impl<'a, ___E>
1986        ::fidl_next::EncodeOption<
1987            ::fidl_next::wire::Box<
1988                'static,
1989                crate::wire::DeviceCancelWatchControllerWriteCommandsRequest,
1990            >,
1991            ___E,
1992        > for &'a DeviceCancelWatchControllerWriteCommandsRequest
1993    where
1994        ___E: ::fidl_next::Encoder + ?Sized,
1995        &'a DeviceCancelWatchControllerWriteCommandsRequest:
1996            ::fidl_next::Encode<crate::wire::DeviceCancelWatchControllerWriteCommandsRequest, ___E>,
1997    {
1998        #[inline]
1999        fn encode_option(
2000            this: ::core::option::Option<Self>,
2001            encoder: &mut ___E,
2002            out: &mut ::core::mem::MaybeUninit<
2003                ::fidl_next::wire::Box<
2004                    'static,
2005                    crate::wire::DeviceCancelWatchControllerWriteCommandsRequest,
2006                >,
2007            >,
2008            _: (),
2009        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2010            if let Some(inner) = this {
2011                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2012                ::fidl_next::wire::Box::encode_present(out);
2013            } else {
2014                ::fidl_next::wire::Box::encode_absent(out);
2015            }
2016
2017            Ok(())
2018        }
2019    }
2020
2021    impl ::fidl_next::FromWire<crate::wire::DeviceCancelWatchControllerWriteCommandsRequest>
2022        for DeviceCancelWatchControllerWriteCommandsRequest
2023    {
2024        #[inline]
2025        fn from_wire(wire: crate::wire::DeviceCancelWatchControllerWriteCommandsRequest) -> Self {
2026            Self {
2027                address: ::fidl_next::FromWire::from_wire(wire.address),
2028
2029                size: ::fidl_next::FromWire::from_wire(wire.size),
2030            }
2031        }
2032    }
2033
2034    impl ::fidl_next::FromWireRef<crate::wire::DeviceCancelWatchControllerWriteCommandsRequest>
2035        for DeviceCancelWatchControllerWriteCommandsRequest
2036    {
2037        #[inline]
2038        fn from_wire_ref(
2039            wire: &crate::wire::DeviceCancelWatchControllerWriteCommandsRequest,
2040        ) -> Self {
2041            Self {
2042                address: ::fidl_next::FromWireRef::from_wire_ref(&wire.address),
2043
2044                size: ::fidl_next::FromWireRef::from_wire_ref(&wire.size),
2045            }
2046        }
2047    }
2048
2049    pub type DeviceCancelWatchControllerWriteCommandsResponse = ();
2050}
2051
2052pub mod wire {
2053
2054    /// The wire type corresponding to [`SubTargetInfo`].
2055    #[repr(C)]
2056    pub struct SubTargetInfo<'de> {
2057        pub(crate) table: ::fidl_next::wire::Table<'de>,
2058    }
2059
2060    impl<'de> Drop for SubTargetInfo<'de> {
2061        fn drop(&mut self) {
2062            let _ = self
2063                .table
2064                .get(1)
2065                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint16>() });
2066
2067            let _ = self
2068                .table
2069                .get(2)
2070                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
2071
2072            let _ = self.table.get(3).map(|envelope| unsafe {
2073                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2074            });
2075
2076            let _ = self.table.get(4).map(|envelope| unsafe {
2077                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2078            });
2079        }
2080    }
2081
2082    impl ::fidl_next::Constrained for SubTargetInfo<'_> {
2083        type Constraint = ();
2084
2085        fn validate(
2086            _: ::fidl_next::Slot<'_, Self>,
2087            _: Self::Constraint,
2088        ) -> Result<(), ::fidl_next::ValidationError> {
2089            Ok(())
2090        }
2091    }
2092
2093    unsafe impl ::fidl_next::Wire for SubTargetInfo<'static> {
2094        type Narrowed<'de> = SubTargetInfo<'de>;
2095
2096        #[inline]
2097        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2098            ::fidl_next::munge!(let Self { table } = out);
2099            ::fidl_next::wire::Table::zero_padding(table);
2100        }
2101    }
2102
2103    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SubTargetInfo<'de>
2104    where
2105        ___D: ::fidl_next::Decoder<'de> + ?Sized,
2106    {
2107        fn decode(
2108            slot: ::fidl_next::Slot<'_, Self>,
2109            decoder: &mut ___D,
2110            _: (),
2111        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2112            ::fidl_next::munge!(let Self { table } = slot);
2113
2114            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2115                match ordinal {
2116                    0 => unsafe { ::core::hint::unreachable_unchecked() },
2117
2118                    1 => {
2119                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint16>(
2120                            slot.as_mut(),
2121                            decoder,
2122                            (),
2123                        )?;
2124
2125                        Ok(())
2126                    }
2127
2128                    2 => {
2129                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
2130                            slot.as_mut(),
2131                            decoder,
2132                            (),
2133                        )?;
2134
2135                        Ok(())
2136                    }
2137
2138                    3 => {
2139                        ::fidl_next::wire::Envelope::decode_as::<
2140                            ___D,
2141                            ::fidl_next::wire::String<'de>,
2142                        >(slot.as_mut(), decoder, 64)?;
2143
2144                        let value = unsafe {
2145                            slot.deref_unchecked()
2146                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
2147                        };
2148
2149                        if value.len() > 64 {
2150                            return Err(::fidl_next::DecodeError::VectorTooLong {
2151                                size: value.len() as u64,
2152                                limit: 64,
2153                            });
2154                        }
2155
2156                        Ok(())
2157                    }
2158
2159                    4 => {
2160                        ::fidl_next::wire::Envelope::decode_as::<
2161                            ___D,
2162                            ::fidl_next::wire::String<'de>,
2163                        >(slot.as_mut(), decoder, 4294967295)?;
2164
2165                        Ok(())
2166                    }
2167
2168                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2169                }
2170            })
2171        }
2172    }
2173
2174    impl<'de> SubTargetInfo<'de> {
2175        pub fn address(&self) -> ::core::option::Option<&::fidl_next::wire::Uint16> {
2176            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2177        }
2178
2179        pub fn take_address(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint16> {
2180            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2181        }
2182
2183        pub fn size(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
2184            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2185        }
2186
2187        pub fn take_size(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
2188            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2189        }
2190
2191        pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
2192            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2193        }
2194
2195        pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
2196            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
2197        }
2198
2199        pub fn display_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
2200            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
2201        }
2202
2203        pub fn take_display_name(
2204            &mut self,
2205        ) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
2206            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
2207        }
2208    }
2209
2210    impl<'de> ::core::fmt::Debug for SubTargetInfo<'de> {
2211        fn fmt(
2212            &self,
2213            f: &mut ::core::fmt::Formatter<'_>,
2214        ) -> ::core::result::Result<(), ::core::fmt::Error> {
2215            f.debug_struct("SubTargetInfo")
2216                .field("address", &self.address())
2217                .field("size", &self.size())
2218                .field("name", &self.name())
2219                .field("display_name", &self.display_name())
2220                .finish()
2221        }
2222    }
2223
2224    impl<'de> ::fidl_next::IntoNatural for SubTargetInfo<'de> {
2225        type Natural = crate::natural::SubTargetInfo;
2226    }
2227
2228    /// The wire type corresponding to [`TargetInfo`].
2229    #[repr(C)]
2230    pub struct TargetInfo<'de> {
2231        pub(crate) table: ::fidl_next::wire::Table<'de>,
2232    }
2233
2234    impl<'de> Drop for TargetInfo<'de> {
2235        fn drop(&mut self) {
2236            let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
2237
2238            let _ = self.table.get(2)
2239                .map(|envelope| unsafe {
2240                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SubTargetInfo<'de>>>()
2241                });
2242
2243            let _ = self.table.get(3).map(|envelope| unsafe {
2244                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2245            });
2246
2247            let _ = self.table.get(4).map(|envelope| unsafe {
2248                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2249            });
2250        }
2251    }
2252
2253    impl ::fidl_next::Constrained for TargetInfo<'_> {
2254        type Constraint = ();
2255
2256        fn validate(
2257            _: ::fidl_next::Slot<'_, Self>,
2258            _: Self::Constraint,
2259        ) -> Result<(), ::fidl_next::ValidationError> {
2260            Ok(())
2261        }
2262    }
2263
2264    unsafe impl ::fidl_next::Wire for TargetInfo<'static> {
2265        type Narrowed<'de> = TargetInfo<'de>;
2266
2267        #[inline]
2268        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2269            ::fidl_next::munge!(let Self { table } = out);
2270            ::fidl_next::wire::Table::zero_padding(table);
2271        }
2272    }
2273
2274    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for TargetInfo<'de>
2275    where
2276        ___D: ::fidl_next::Decoder<'de> + ?Sized,
2277    {
2278        fn decode(
2279            slot: ::fidl_next::Slot<'_, Self>,
2280            decoder: &mut ___D,
2281            _: (),
2282        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2283            ::fidl_next::munge!(let Self { table } = slot);
2284
2285            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2286                match ordinal {
2287                    0 => unsafe { ::core::hint::unreachable_unchecked() },
2288
2289                    1 => {
2290                        ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
2291                            slot.as_mut(),
2292                            decoder,
2293                            (),
2294                        )?;
2295
2296                        Ok(())
2297                    }
2298
2299                    2 => {
2300                        ::fidl_next::wire::Envelope::decode_as::<
2301                            ___D,
2302                            ::fidl_next::wire::Vector<'de, crate::wire::SubTargetInfo<'de>>,
2303                        >(slot.as_mut(), decoder, (65536, ()))?;
2304
2305                        let value = unsafe {
2306                            slot
2307                                            .deref_unchecked()
2308                                            .deref_unchecked::<
2309                                                ::fidl_next::wire::Vector<'_, crate::wire::SubTargetInfo<'_>>
2310                                            >()
2311                        };
2312
2313                        if value.len() > 65536 {
2314                            return Err(::fidl_next::DecodeError::VectorTooLong {
2315                                size: value.len() as u64,
2316                                limit: 65536,
2317                            });
2318                        }
2319
2320                        Ok(())
2321                    }
2322
2323                    3 => {
2324                        ::fidl_next::wire::Envelope::decode_as::<
2325                            ___D,
2326                            ::fidl_next::wire::String<'de>,
2327                        >(slot.as_mut(), decoder, 64)?;
2328
2329                        let value = unsafe {
2330                            slot.deref_unchecked()
2331                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
2332                        };
2333
2334                        if value.len() > 64 {
2335                            return Err(::fidl_next::DecodeError::VectorTooLong {
2336                                size: value.len() as u64,
2337                                limit: 64,
2338                            });
2339                        }
2340
2341                        Ok(())
2342                    }
2343
2344                    4 => {
2345                        ::fidl_next::wire::Envelope::decode_as::<
2346                            ___D,
2347                            ::fidl_next::wire::String<'de>,
2348                        >(slot.as_mut(), decoder, 4294967295)?;
2349
2350                        Ok(())
2351                    }
2352
2353                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2354                }
2355            })
2356        }
2357    }
2358
2359    impl<'de> TargetInfo<'de> {
2360        pub fn id(&self) -> ::core::option::Option<&u8> {
2361            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2362        }
2363
2364        pub fn take_id(&mut self) -> ::core::option::Option<u8> {
2365            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2366        }
2367
2368        pub fn sub_targets(
2369            &self,
2370        ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::SubTargetInfo<'de>>>
2371        {
2372            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2373        }
2374
2375        pub fn take_sub_targets(
2376            &mut self,
2377        ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::SubTargetInfo<'de>>>
2378        {
2379            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2380        }
2381
2382        pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
2383            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2384        }
2385
2386        pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
2387            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
2388        }
2389
2390        pub fn display_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
2391            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
2392        }
2393
2394        pub fn take_display_name(
2395            &mut self,
2396        ) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
2397            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
2398        }
2399    }
2400
2401    impl<'de> ::core::fmt::Debug for TargetInfo<'de> {
2402        fn fmt(
2403            &self,
2404            f: &mut ::core::fmt::Formatter<'_>,
2405        ) -> ::core::result::Result<(), ::core::fmt::Error> {
2406            f.debug_struct("TargetInfo")
2407                .field("id", &self.id())
2408                .field("sub_targets", &self.sub_targets())
2409                .field("name", &self.name())
2410                .field("display_name", &self.display_name())
2411                .finish()
2412        }
2413    }
2414
2415    impl<'de> ::fidl_next::IntoNatural for TargetInfo<'de> {
2416        type Natural = crate::natural::TargetInfo;
2417    }
2418
2419    /// The wire type corresponding to [`ControllerInfo`].
2420    #[repr(C)]
2421    pub struct ControllerInfo<'de> {
2422        pub(crate) table: ::fidl_next::wire::Table<'de>,
2423    }
2424
2425    impl<'de> Drop for ControllerInfo<'de> {
2426        fn drop(&mut self) {
2427            let _ = self
2428                .table
2429                .get(1)
2430                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
2431
2432            let _ = self.table.get(2).map(|envelope| unsafe {
2433                envelope
2434                    .read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::TargetInfo<'de>>>(
2435                    )
2436            });
2437        }
2438    }
2439
2440    impl ::fidl_next::Constrained for ControllerInfo<'_> {
2441        type Constraint = ();
2442
2443        fn validate(
2444            _: ::fidl_next::Slot<'_, Self>,
2445            _: Self::Constraint,
2446        ) -> Result<(), ::fidl_next::ValidationError> {
2447            Ok(())
2448        }
2449    }
2450
2451    unsafe impl ::fidl_next::Wire for ControllerInfo<'static> {
2452        type Narrowed<'de> = ControllerInfo<'de>;
2453
2454        #[inline]
2455        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2456            ::fidl_next::munge!(let Self { table } = out);
2457            ::fidl_next::wire::Table::zero_padding(table);
2458        }
2459    }
2460
2461    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ControllerInfo<'de>
2462    where
2463        ___D: ::fidl_next::Decoder<'de> + ?Sized,
2464    {
2465        fn decode(
2466            slot: ::fidl_next::Slot<'_, Self>,
2467            decoder: &mut ___D,
2468            _: (),
2469        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2470            ::fidl_next::munge!(let Self { table } = slot);
2471
2472            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2473                match ordinal {
2474                    0 => unsafe { ::core::hint::unreachable_unchecked() },
2475
2476                    1 => {
2477                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
2478                            slot.as_mut(),
2479                            decoder,
2480                            (),
2481                        )?;
2482
2483                        Ok(())
2484                    }
2485
2486                    2 => {
2487                        ::fidl_next::wire::Envelope::decode_as::<
2488                            ___D,
2489                            ::fidl_next::wire::Vector<'de, crate::wire::TargetInfo<'de>>,
2490                        >(slot.as_mut(), decoder, (16, ()))?;
2491
2492                        let value = unsafe {
2493                            slot
2494                                            .deref_unchecked()
2495                                            .deref_unchecked::<
2496                                                ::fidl_next::wire::Vector<'_, crate::wire::TargetInfo<'_>>
2497                                            >()
2498                        };
2499
2500                        if value.len() > 16 {
2501                            return Err(::fidl_next::DecodeError::VectorTooLong {
2502                                size: value.len() as u64,
2503                                limit: 16,
2504                            });
2505                        }
2506
2507                        Ok(())
2508                    }
2509
2510                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2511                }
2512            })
2513        }
2514    }
2515
2516    impl<'de> ControllerInfo<'de> {
2517        pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
2518            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2519        }
2520
2521        pub fn take_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
2522            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2523        }
2524
2525        pub fn targets(
2526            &self,
2527        ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::TargetInfo<'de>>>
2528        {
2529            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2530        }
2531
2532        pub fn take_targets(
2533            &mut self,
2534        ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::TargetInfo<'de>>>
2535        {
2536            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2537        }
2538    }
2539
2540    impl<'de> ::core::fmt::Debug for ControllerInfo<'de> {
2541        fn fmt(
2542            &self,
2543            f: &mut ::core::fmt::Formatter<'_>,
2544        ) -> ::core::result::Result<(), ::core::fmt::Error> {
2545            f.debug_struct("ControllerInfo")
2546                .field("id", &self.id())
2547                .field("targets", &self.targets())
2548                .finish()
2549        }
2550    }
2551
2552    impl<'de> ::fidl_next::IntoNatural for ControllerInfo<'de> {
2553        type Natural = crate::natural::ControllerInfo;
2554    }
2555
2556    /// The wire type corresponding to [`DebugConnectTargetResponse`].
2557    pub type DebugConnectTargetResponse = ::fidl_next::wire::Unit;
2558
2559    /// The wire type corresponding to [`DriverError`].
2560    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2561    #[repr(transparent)]
2562    pub struct DriverError {
2563        pub(crate) value: ::fidl_next::wire::Uint32,
2564    }
2565
2566    impl ::fidl_next::Constrained for DriverError {
2567        type Constraint = ();
2568
2569        fn validate(
2570            _: ::fidl_next::Slot<'_, Self>,
2571            _: Self::Constraint,
2572        ) -> Result<(), ::fidl_next::ValidationError> {
2573            Ok(())
2574        }
2575    }
2576
2577    unsafe impl ::fidl_next::Wire for DriverError {
2578        type Narrowed<'de> = Self;
2579
2580        #[inline]
2581        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2582            // Wire enums have no padding
2583        }
2584    }
2585
2586    impl DriverError {
2587        pub const INTERNAL: DriverError = DriverError { value: ::fidl_next::wire::Uint32(1) };
2588
2589        pub const NOT_SUPPORTED: DriverError = DriverError { value: ::fidl_next::wire::Uint32(2) };
2590
2591        pub const INVALID_ARGS: DriverError = DriverError { value: ::fidl_next::wire::Uint32(3) };
2592
2593        pub const BAD_STATE: DriverError = DriverError { value: ::fidl_next::wire::Uint32(4) };
2594
2595        pub const IO_REFUSED: DriverError = DriverError { value: ::fidl_next::wire::Uint32(5) };
2596
2597        pub const CANCELED: DriverError = DriverError { value: ::fidl_next::wire::Uint32(6) };
2598
2599        pub const NOT_FOUND: DriverError = DriverError { value: ::fidl_next::wire::Uint32(7) };
2600    }
2601
2602    unsafe impl<___D> ::fidl_next::Decode<___D> for DriverError
2603    where
2604        ___D: ?Sized,
2605    {
2606        fn decode(
2607            slot: ::fidl_next::Slot<'_, Self>,
2608            _: &mut ___D,
2609            _: (),
2610        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2611            Ok(())
2612        }
2613    }
2614
2615    impl ::core::convert::From<crate::natural::DriverError> for DriverError {
2616        fn from(natural: crate::natural::DriverError) -> Self {
2617            match natural {
2618                crate::natural::DriverError::Internal => DriverError::INTERNAL,
2619
2620                crate::natural::DriverError::NotSupported => DriverError::NOT_SUPPORTED,
2621
2622                crate::natural::DriverError::InvalidArgs => DriverError::INVALID_ARGS,
2623
2624                crate::natural::DriverError::BadState => DriverError::BAD_STATE,
2625
2626                crate::natural::DriverError::IoRefused => DriverError::IO_REFUSED,
2627
2628                crate::natural::DriverError::Canceled => DriverError::CANCELED,
2629
2630                crate::natural::DriverError::NotFound => DriverError::NOT_FOUND,
2631
2632                crate::natural::DriverError::UnknownOrdinal_(value) => {
2633                    DriverError { value: ::fidl_next::wire::Uint32::from(value) }
2634                }
2635            }
2636        }
2637    }
2638
2639    impl ::fidl_next::IntoNatural for DriverError {
2640        type Natural = crate::natural::DriverError;
2641    }
2642
2643    /// The wire type corresponding to [`DebugGetControllerPropertiesResponse`].
2644    #[repr(C)]
2645    pub struct DebugGetControllerPropertiesResponse<'de> {
2646        pub(crate) table: ::fidl_next::wire::Table<'de>,
2647    }
2648
2649    impl<'de> Drop for DebugGetControllerPropertiesResponse<'de> {
2650        fn drop(&mut self) {
2651            let _ = self.table.get(1).map(|envelope| unsafe {
2652                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2653            });
2654        }
2655    }
2656
2657    impl ::fidl_next::Constrained for DebugGetControllerPropertiesResponse<'_> {
2658        type Constraint = ();
2659
2660        fn validate(
2661            _: ::fidl_next::Slot<'_, Self>,
2662            _: Self::Constraint,
2663        ) -> Result<(), ::fidl_next::ValidationError> {
2664            Ok(())
2665        }
2666    }
2667
2668    unsafe impl ::fidl_next::Wire for DebugGetControllerPropertiesResponse<'static> {
2669        type Narrowed<'de> = DebugGetControllerPropertiesResponse<'de>;
2670
2671        #[inline]
2672        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2673            ::fidl_next::munge!(let Self { table } = out);
2674            ::fidl_next::wire::Table::zero_padding(table);
2675        }
2676    }
2677
2678    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DebugGetControllerPropertiesResponse<'de>
2679    where
2680        ___D: ::fidl_next::Decoder<'de> + ?Sized,
2681    {
2682        fn decode(
2683            slot: ::fidl_next::Slot<'_, Self>,
2684            decoder: &mut ___D,
2685            _: (),
2686        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2687            ::fidl_next::munge!(let Self { table } = slot);
2688
2689            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2690                match ordinal {
2691                    0 => unsafe { ::core::hint::unreachable_unchecked() },
2692
2693                    1 => {
2694                        ::fidl_next::wire::Envelope::decode_as::<
2695                            ___D,
2696                            ::fidl_next::wire::String<'de>,
2697                        >(slot.as_mut(), decoder, 64)?;
2698
2699                        let value = unsafe {
2700                            slot.deref_unchecked()
2701                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
2702                        };
2703
2704                        if value.len() > 64 {
2705                            return Err(::fidl_next::DecodeError::VectorTooLong {
2706                                size: value.len() as u64,
2707                                limit: 64,
2708                            });
2709                        }
2710
2711                        Ok(())
2712                    }
2713
2714                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2715                }
2716            })
2717        }
2718    }
2719
2720    impl<'de> DebugGetControllerPropertiesResponse<'de> {
2721        pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
2722            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2723        }
2724
2725        pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
2726            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2727        }
2728    }
2729
2730    impl<'de> ::core::fmt::Debug for DebugGetControllerPropertiesResponse<'de> {
2731        fn fmt(
2732            &self,
2733            f: &mut ::core::fmt::Formatter<'_>,
2734        ) -> ::core::result::Result<(), ::core::fmt::Error> {
2735            f.debug_struct("DebugGetControllerPropertiesResponse")
2736                .field("name", &self.name())
2737                .finish()
2738        }
2739    }
2740
2741    impl<'de> ::fidl_next::IntoNatural for DebugGetControllerPropertiesResponse<'de> {
2742        type Natural = crate::natural::DebugGetControllerPropertiesResponse;
2743    }
2744
2745    /// The wire type corresponding to [`DeviceRegisterReadRequest`].
2746    #[derive(Clone, Debug)]
2747    #[repr(C)]
2748    pub struct DeviceRegisterReadRequest {
2749        pub address: ::fidl_next::wire::Uint16,
2750
2751        pub size_bytes: ::fidl_next::wire::Uint32,
2752    }
2753
2754    static_assertions::const_assert_eq!(std::mem::size_of::<DeviceRegisterReadRequest>(), 8);
2755    static_assertions::const_assert_eq!(std::mem::align_of::<DeviceRegisterReadRequest>(), 4);
2756
2757    static_assertions::const_assert_eq!(
2758        std::mem::offset_of!(DeviceRegisterReadRequest, address),
2759        0
2760    );
2761
2762    static_assertions::const_assert_eq!(
2763        std::mem::offset_of!(DeviceRegisterReadRequest, size_bytes),
2764        4
2765    );
2766
2767    impl ::fidl_next::Constrained for DeviceRegisterReadRequest {
2768        type Constraint = ();
2769
2770        fn validate(
2771            _: ::fidl_next::Slot<'_, Self>,
2772            _: Self::Constraint,
2773        ) -> Result<(), ::fidl_next::ValidationError> {
2774            Ok(())
2775        }
2776    }
2777
2778    unsafe impl ::fidl_next::Wire for DeviceRegisterReadRequest {
2779        type Narrowed<'de> = DeviceRegisterReadRequest;
2780
2781        #[inline]
2782        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2783            ::fidl_next::munge! {
2784                let Self {
2785                    address,
2786                    size_bytes,
2787
2788                } = &mut *out_;
2789            }
2790
2791            ::fidl_next::Wire::zero_padding(address);
2792
2793            ::fidl_next::Wire::zero_padding(size_bytes);
2794
2795            unsafe {
2796                out_.as_mut_ptr().cast::<u8>().add(2).write_bytes(0, 2);
2797            }
2798        }
2799    }
2800
2801    unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceRegisterReadRequest
2802    where
2803        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2804    {
2805        fn decode(
2806            slot_: ::fidl_next::Slot<'_, Self>,
2807            decoder_: &mut ___D,
2808            _: (),
2809        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2810            if slot_.as_bytes()[2..4] != [0u8; 2] {
2811                return Err(::fidl_next::DecodeError::InvalidPadding);
2812            }
2813
2814            ::fidl_next::munge! {
2815                let Self {
2816                    mut address,
2817                    mut size_bytes,
2818
2819                } = slot_;
2820            }
2821
2822            let _field = address.as_mut();
2823
2824            ::fidl_next::Decode::decode(address.as_mut(), decoder_, ())?;
2825
2826            let _field = size_bytes.as_mut();
2827
2828            ::fidl_next::Decode::decode(size_bytes.as_mut(), decoder_, ())?;
2829
2830            Ok(())
2831        }
2832    }
2833
2834    impl ::fidl_next::IntoNatural for DeviceRegisterReadRequest {
2835        type Natural = crate::natural::DeviceRegisterReadRequest;
2836    }
2837
2838    /// The wire type corresponding to [`DeviceRegisterReadResponse`].
2839    #[derive(Debug)]
2840    #[repr(C)]
2841    pub struct DeviceRegisterReadResponse<'de> {
2842        pub data: ::fidl_next::wire::Vector<'de, u8>,
2843    }
2844
2845    static_assertions::const_assert_eq!(std::mem::size_of::<DeviceRegisterReadResponse<'_>>(), 16);
2846    static_assertions::const_assert_eq!(std::mem::align_of::<DeviceRegisterReadResponse<'_>>(), 8);
2847
2848    static_assertions::const_assert_eq!(
2849        std::mem::offset_of!(DeviceRegisterReadResponse<'_>, data),
2850        0
2851    );
2852
2853    impl ::fidl_next::Constrained for DeviceRegisterReadResponse<'_> {
2854        type Constraint = ();
2855
2856        fn validate(
2857            _: ::fidl_next::Slot<'_, Self>,
2858            _: Self::Constraint,
2859        ) -> Result<(), ::fidl_next::ValidationError> {
2860            Ok(())
2861        }
2862    }
2863
2864    unsafe impl ::fidl_next::Wire for DeviceRegisterReadResponse<'static> {
2865        type Narrowed<'de> = DeviceRegisterReadResponse<'de>;
2866
2867        #[inline]
2868        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2869            ::fidl_next::munge! {
2870                let Self {
2871                    data,
2872
2873                } = &mut *out_;
2874            }
2875
2876            ::fidl_next::Wire::zero_padding(data);
2877        }
2878    }
2879
2880    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DeviceRegisterReadResponse<'de>
2881    where
2882        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2883        ___D: ::fidl_next::Decoder<'de>,
2884    {
2885        fn decode(
2886            slot_: ::fidl_next::Slot<'_, Self>,
2887            decoder_: &mut ___D,
2888            _: (),
2889        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2890            ::fidl_next::munge! {
2891                let Self {
2892                    mut data,
2893
2894                } = slot_;
2895            }
2896
2897            let _field = data.as_mut();
2898            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
2899            ::fidl_next::Decode::decode(data.as_mut(), decoder_, (4294967295, ()))?;
2900
2901            Ok(())
2902        }
2903    }
2904
2905    impl<'de> ::fidl_next::IntoNatural for DeviceRegisterReadResponse<'de> {
2906        type Natural = crate::natural::DeviceRegisterReadResponse;
2907    }
2908
2909    /// The wire type corresponding to [`DeviceRegisterWriteRequest`].
2910    #[derive(Debug)]
2911    #[repr(C)]
2912    pub struct DeviceRegisterWriteRequest<'de> {
2913        pub address: ::fidl_next::wire::Uint16,
2914
2915        pub data: ::fidl_next::wire::Vector<'de, u8>,
2916    }
2917
2918    static_assertions::const_assert_eq!(std::mem::size_of::<DeviceRegisterWriteRequest<'_>>(), 24);
2919    static_assertions::const_assert_eq!(std::mem::align_of::<DeviceRegisterWriteRequest<'_>>(), 8);
2920
2921    static_assertions::const_assert_eq!(
2922        std::mem::offset_of!(DeviceRegisterWriteRequest<'_>, address),
2923        0
2924    );
2925
2926    static_assertions::const_assert_eq!(
2927        std::mem::offset_of!(DeviceRegisterWriteRequest<'_>, data),
2928        8
2929    );
2930
2931    impl ::fidl_next::Constrained for DeviceRegisterWriteRequest<'_> {
2932        type Constraint = ();
2933
2934        fn validate(
2935            _: ::fidl_next::Slot<'_, Self>,
2936            _: Self::Constraint,
2937        ) -> Result<(), ::fidl_next::ValidationError> {
2938            Ok(())
2939        }
2940    }
2941
2942    unsafe impl ::fidl_next::Wire for DeviceRegisterWriteRequest<'static> {
2943        type Narrowed<'de> = DeviceRegisterWriteRequest<'de>;
2944
2945        #[inline]
2946        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2947            ::fidl_next::munge! {
2948                let Self {
2949                    address,
2950                    data,
2951
2952                } = &mut *out_;
2953            }
2954
2955            ::fidl_next::Wire::zero_padding(address);
2956
2957            ::fidl_next::Wire::zero_padding(data);
2958
2959            unsafe {
2960                out_.as_mut_ptr().cast::<u8>().add(2).write_bytes(0, 6);
2961            }
2962        }
2963    }
2964
2965    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DeviceRegisterWriteRequest<'de>
2966    where
2967        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2968        ___D: ::fidl_next::Decoder<'de>,
2969    {
2970        fn decode(
2971            slot_: ::fidl_next::Slot<'_, Self>,
2972            decoder_: &mut ___D,
2973            _: (),
2974        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2975            if slot_.as_bytes()[2..8] != [0u8; 6] {
2976                return Err(::fidl_next::DecodeError::InvalidPadding);
2977            }
2978
2979            ::fidl_next::munge! {
2980                let Self {
2981                    mut address,
2982                    mut data,
2983
2984                } = slot_;
2985            }
2986
2987            let _field = address.as_mut();
2988
2989            ::fidl_next::Decode::decode(address.as_mut(), decoder_, ())?;
2990
2991            let _field = data.as_mut();
2992            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
2993            ::fidl_next::Decode::decode(data.as_mut(), decoder_, (4294967295, ()))?;
2994
2995            Ok(())
2996        }
2997    }
2998
2999    impl<'de> ::fidl_next::IntoNatural for DeviceRegisterWriteRequest<'de> {
3000        type Natural = crate::natural::DeviceRegisterWriteRequest;
3001    }
3002
3003    /// The wire type corresponding to [`DeviceRegisterWriteResponse`].
3004    pub type DeviceRegisterWriteResponse = ::fidl_next::wire::Unit;
3005
3006    /// The wire type corresponding to [`DeviceGetPropertiesResponse`].
3007    #[repr(C)]
3008    pub struct DeviceGetPropertiesResponse<'de> {
3009        pub(crate) table: ::fidl_next::wire::Table<'de>,
3010    }
3011
3012    impl<'de> Drop for DeviceGetPropertiesResponse<'de> {
3013        fn drop(&mut self) {
3014            let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
3015
3016            let _ = self.table.get(2).map(|envelope| unsafe {
3017                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
3018            });
3019        }
3020    }
3021
3022    impl ::fidl_next::Constrained for DeviceGetPropertiesResponse<'_> {
3023        type Constraint = ();
3024
3025        fn validate(
3026            _: ::fidl_next::Slot<'_, Self>,
3027            _: Self::Constraint,
3028        ) -> Result<(), ::fidl_next::ValidationError> {
3029            Ok(())
3030        }
3031    }
3032
3033    unsafe impl ::fidl_next::Wire for DeviceGetPropertiesResponse<'static> {
3034        type Narrowed<'de> = DeviceGetPropertiesResponse<'de>;
3035
3036        #[inline]
3037        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3038            ::fidl_next::munge!(let Self { table } = out);
3039            ::fidl_next::wire::Table::zero_padding(table);
3040        }
3041    }
3042
3043    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DeviceGetPropertiesResponse<'de>
3044    where
3045        ___D: ::fidl_next::Decoder<'de> + ?Sized,
3046    {
3047        fn decode(
3048            slot: ::fidl_next::Slot<'_, Self>,
3049            decoder: &mut ___D,
3050            _: (),
3051        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3052            ::fidl_next::munge!(let Self { table } = slot);
3053
3054            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3055                match ordinal {
3056                    0 => unsafe { ::core::hint::unreachable_unchecked() },
3057
3058                    1 => {
3059                        ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
3060                            slot.as_mut(),
3061                            decoder,
3062                            (),
3063                        )?;
3064
3065                        Ok(())
3066                    }
3067
3068                    2 => {
3069                        ::fidl_next::wire::Envelope::decode_as::<
3070                            ___D,
3071                            ::fidl_next::wire::String<'de>,
3072                        >(slot.as_mut(), decoder, 64)?;
3073
3074                        let value = unsafe {
3075                            slot.deref_unchecked()
3076                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
3077                        };
3078
3079                        if value.len() > 64 {
3080                            return Err(::fidl_next::DecodeError::VectorTooLong {
3081                                size: value.len() as u64,
3082                                limit: 64,
3083                            });
3084                        }
3085
3086                        Ok(())
3087                    }
3088
3089                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
3090                }
3091            })
3092        }
3093    }
3094
3095    impl<'de> DeviceGetPropertiesResponse<'de> {
3096        pub fn sid(&self) -> ::core::option::Option<&u8> {
3097            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3098        }
3099
3100        pub fn take_sid(&mut self) -> ::core::option::Option<u8> {
3101            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
3102        }
3103
3104        pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
3105            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3106        }
3107
3108        pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
3109            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
3110        }
3111    }
3112
3113    impl<'de> ::core::fmt::Debug for DeviceGetPropertiesResponse<'de> {
3114        fn fmt(
3115            &self,
3116            f: &mut ::core::fmt::Formatter<'_>,
3117        ) -> ::core::result::Result<(), ::core::fmt::Error> {
3118            f.debug_struct("DeviceGetPropertiesResponse")
3119                .field("sid", &self.sid())
3120                .field("name", &self.name())
3121                .finish()
3122        }
3123    }
3124
3125    impl<'de> ::fidl_next::IntoNatural for DeviceGetPropertiesResponse<'de> {
3126        type Natural = crate::natural::DeviceGetPropertiesResponse;
3127    }
3128
3129    /// The wire type corresponding to [`Register8`].
3130    #[derive(Clone, Debug)]
3131    #[repr(C)]
3132    pub struct Register8 {
3133        pub address: u8,
3134
3135        pub data: u8,
3136    }
3137
3138    static_assertions::const_assert_eq!(std::mem::size_of::<Register8>(), 2);
3139    static_assertions::const_assert_eq!(std::mem::align_of::<Register8>(), 1);
3140
3141    static_assertions::const_assert_eq!(std::mem::offset_of!(Register8, address), 0);
3142
3143    static_assertions::const_assert_eq!(std::mem::offset_of!(Register8, data), 1);
3144
3145    impl ::fidl_next::Constrained for Register8 {
3146        type Constraint = ();
3147
3148        fn validate(
3149            _: ::fidl_next::Slot<'_, Self>,
3150            _: Self::Constraint,
3151        ) -> Result<(), ::fidl_next::ValidationError> {
3152            Ok(())
3153        }
3154    }
3155
3156    unsafe impl ::fidl_next::Wire for Register8 {
3157        type Narrowed<'de> = Register8;
3158
3159        #[inline]
3160        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3161            ::fidl_next::munge! {
3162                let Self {
3163                    address,
3164                    data,
3165
3166                } = &mut *out_;
3167            }
3168
3169            ::fidl_next::Wire::zero_padding(address);
3170
3171            ::fidl_next::Wire::zero_padding(data);
3172        }
3173    }
3174
3175    unsafe impl<___D> ::fidl_next::Decode<___D> for Register8
3176    where
3177        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3178    {
3179        fn decode(
3180            slot_: ::fidl_next::Slot<'_, Self>,
3181            decoder_: &mut ___D,
3182            _: (),
3183        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3184            ::fidl_next::munge! {
3185                let Self {
3186                    mut address,
3187                    mut data,
3188
3189                } = slot_;
3190            }
3191
3192            let _field = address.as_mut();
3193
3194            ::fidl_next::Decode::decode(address.as_mut(), decoder_, ())?;
3195
3196            let _field = data.as_mut();
3197
3198            ::fidl_next::Decode::decode(data.as_mut(), decoder_, ())?;
3199
3200            Ok(())
3201        }
3202    }
3203
3204    impl ::fidl_next::IntoNatural for Register8 {
3205        type Natural = crate::natural::Register8;
3206    }
3207
3208    /// The wire type corresponding to [`DeviceCancelWatchControllerWriteCommandsRequest`].
3209    #[derive(Clone, Debug)]
3210    #[repr(C)]
3211    pub struct DeviceCancelWatchControllerWriteCommandsRequest {
3212        pub address: u8,
3213
3214        pub size: ::fidl_next::wire::Uint16,
3215    }
3216
3217    static_assertions::const_assert_eq!(
3218        std::mem::size_of::<DeviceCancelWatchControllerWriteCommandsRequest>(),
3219        4
3220    );
3221    static_assertions::const_assert_eq!(
3222        std::mem::align_of::<DeviceCancelWatchControllerWriteCommandsRequest>(),
3223        2
3224    );
3225
3226    static_assertions::const_assert_eq!(
3227        std::mem::offset_of!(DeviceCancelWatchControllerWriteCommandsRequest, address),
3228        0
3229    );
3230
3231    static_assertions::const_assert_eq!(
3232        std::mem::offset_of!(DeviceCancelWatchControllerWriteCommandsRequest, size),
3233        2
3234    );
3235
3236    impl ::fidl_next::Constrained for DeviceCancelWatchControllerWriteCommandsRequest {
3237        type Constraint = ();
3238
3239        fn validate(
3240            _: ::fidl_next::Slot<'_, Self>,
3241            _: Self::Constraint,
3242        ) -> Result<(), ::fidl_next::ValidationError> {
3243            Ok(())
3244        }
3245    }
3246
3247    unsafe impl ::fidl_next::Wire for DeviceCancelWatchControllerWriteCommandsRequest {
3248        type Narrowed<'de> = DeviceCancelWatchControllerWriteCommandsRequest;
3249
3250        #[inline]
3251        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3252            ::fidl_next::munge! {
3253                let Self {
3254                    address,
3255                    size,
3256
3257                } = &mut *out_;
3258            }
3259
3260            ::fidl_next::Wire::zero_padding(address);
3261
3262            ::fidl_next::Wire::zero_padding(size);
3263
3264            unsafe {
3265                out_.as_mut_ptr().cast::<u8>().add(1).write_bytes(0, 1);
3266            }
3267        }
3268    }
3269
3270    unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceCancelWatchControllerWriteCommandsRequest
3271    where
3272        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3273    {
3274        fn decode(
3275            slot_: ::fidl_next::Slot<'_, Self>,
3276            decoder_: &mut ___D,
3277            _: (),
3278        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3279            if slot_.as_bytes()[1..2] != [0u8; 1] {
3280                return Err(::fidl_next::DecodeError::InvalidPadding);
3281            }
3282
3283            ::fidl_next::munge! {
3284                let Self {
3285                    mut address,
3286                    mut size,
3287
3288                } = slot_;
3289            }
3290
3291            let _field = address.as_mut();
3292
3293            ::fidl_next::Decode::decode(address.as_mut(), decoder_, ())?;
3294
3295            let _field = size.as_mut();
3296
3297            ::fidl_next::Decode::decode(size.as_mut(), decoder_, ())?;
3298
3299            Ok(())
3300        }
3301    }
3302
3303    impl ::fidl_next::IntoNatural for DeviceCancelWatchControllerWriteCommandsRequest {
3304        type Natural = crate::natural::DeviceCancelWatchControllerWriteCommandsRequest;
3305    }
3306
3307    /// The wire type corresponding to [`DeviceCancelWatchControllerWriteCommandsResponse`].
3308    pub type DeviceCancelWatchControllerWriteCommandsResponse = ::fidl_next::wire::Unit;
3309}
3310
3311pub mod wire_optional {}
3312
3313pub mod generic {
3314
3315    /// The generic type corresponding to [`DebugConnectTargetResponse`].
3316    pub type DebugConnectTargetResponse = ();
3317
3318    /// The generic type corresponding to [`DeviceRegisterReadRequest`].
3319    pub struct DeviceRegisterReadRequest<T0, T1> {
3320        pub address: T0,
3321
3322        pub size_bytes: T1,
3323    }
3324
3325    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::DeviceRegisterReadRequest, ___E>
3326        for DeviceRegisterReadRequest<T0, T1>
3327    where
3328        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3329        T0: ::fidl_next::Encode<::fidl_next::wire::Uint16, ___E>,
3330        T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3331    {
3332        #[inline]
3333        fn encode(
3334            self,
3335            encoder_: &mut ___E,
3336            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRegisterReadRequest>,
3337            _: (),
3338        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3339            ::fidl_next::munge! {
3340                let crate::wire::DeviceRegisterReadRequest {
3341                    address,
3342                    size_bytes,
3343
3344                } = out_;
3345            }
3346
3347            ::fidl_next::Encode::encode(self.address, encoder_, address, ())?;
3348
3349            ::fidl_next::Encode::encode(self.size_bytes, encoder_, size_bytes, ())?;
3350
3351            Ok(())
3352        }
3353    }
3354
3355    /// The generic type corresponding to [`DeviceRegisterReadResponse`].
3356    pub struct DeviceRegisterReadResponse<T0> {
3357        pub data: T0,
3358    }
3359
3360    unsafe impl<___E, T0>
3361        ::fidl_next::Encode<crate::wire::DeviceRegisterReadResponse<'static>, ___E>
3362        for DeviceRegisterReadResponse<T0>
3363    where
3364        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3365        ___E: ::fidl_next::Encoder,
3366        T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
3367    {
3368        #[inline]
3369        fn encode(
3370            self,
3371            encoder_: &mut ___E,
3372            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRegisterReadResponse<'static>>,
3373            _: (),
3374        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3375            ::fidl_next::munge! {
3376                let crate::wire::DeviceRegisterReadResponse {
3377                    data,
3378
3379                } = out_;
3380            }
3381
3382            ::fidl_next::Encode::encode(self.data, encoder_, data, (4294967295, ()))?;
3383
3384            Ok(())
3385        }
3386    }
3387
3388    /// The generic type corresponding to [`DeviceRegisterWriteRequest`].
3389    pub struct DeviceRegisterWriteRequest<T0, T1> {
3390        pub address: T0,
3391
3392        pub data: T1,
3393    }
3394
3395    unsafe impl<___E, T0, T1>
3396        ::fidl_next::Encode<crate::wire::DeviceRegisterWriteRequest<'static>, ___E>
3397        for DeviceRegisterWriteRequest<T0, T1>
3398    where
3399        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3400        ___E: ::fidl_next::Encoder,
3401        T0: ::fidl_next::Encode<::fidl_next::wire::Uint16, ___E>,
3402        T1: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
3403    {
3404        #[inline]
3405        fn encode(
3406            self,
3407            encoder_: &mut ___E,
3408            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRegisterWriteRequest<'static>>,
3409            _: (),
3410        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3411            ::fidl_next::munge! {
3412                let crate::wire::DeviceRegisterWriteRequest {
3413                    address,
3414                    data,
3415
3416                } = out_;
3417            }
3418
3419            ::fidl_next::Encode::encode(self.address, encoder_, address, ())?;
3420
3421            ::fidl_next::Encode::encode(self.data, encoder_, data, (4294967295, ()))?;
3422
3423            Ok(())
3424        }
3425    }
3426
3427    /// The generic type corresponding to [`DeviceRegisterWriteResponse`].
3428    pub type DeviceRegisterWriteResponse = ();
3429
3430    /// The generic type corresponding to [`Register8`].
3431    pub struct Register8<T0, T1> {
3432        pub address: T0,
3433
3434        pub data: T1,
3435    }
3436
3437    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::Register8, ___E> for Register8<T0, T1>
3438    where
3439        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3440        T0: ::fidl_next::Encode<u8, ___E>,
3441        T1: ::fidl_next::Encode<u8, ___E>,
3442    {
3443        #[inline]
3444        fn encode(
3445            self,
3446            encoder_: &mut ___E,
3447            out_: &mut ::core::mem::MaybeUninit<crate::wire::Register8>,
3448            _: (),
3449        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3450            ::fidl_next::munge! {
3451                let crate::wire::Register8 {
3452                    address,
3453                    data,
3454
3455                } = out_;
3456            }
3457
3458            ::fidl_next::Encode::encode(self.address, encoder_, address, ())?;
3459
3460            ::fidl_next::Encode::encode(self.data, encoder_, data, ())?;
3461
3462            Ok(())
3463        }
3464    }
3465
3466    /// The generic type corresponding to [`DeviceCancelWatchControllerWriteCommandsRequest`].
3467    pub struct DeviceCancelWatchControllerWriteCommandsRequest<T0, T1> {
3468        pub address: T0,
3469
3470        pub size: T1,
3471    }
3472
3473    unsafe impl<___E, T0, T1>
3474        ::fidl_next::Encode<crate::wire::DeviceCancelWatchControllerWriteCommandsRequest, ___E>
3475        for DeviceCancelWatchControllerWriteCommandsRequest<T0, T1>
3476    where
3477        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3478        T0: ::fidl_next::Encode<u8, ___E>,
3479        T1: ::fidl_next::Encode<::fidl_next::wire::Uint16, ___E>,
3480    {
3481        #[inline]
3482        fn encode(
3483            self,
3484            encoder_: &mut ___E,
3485            out_: &mut ::core::mem::MaybeUninit<
3486                crate::wire::DeviceCancelWatchControllerWriteCommandsRequest,
3487            >,
3488            _: (),
3489        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3490            ::fidl_next::munge! {
3491                let crate::wire::DeviceCancelWatchControllerWriteCommandsRequest {
3492                    address,
3493                    size,
3494
3495                } = out_;
3496            }
3497
3498            ::fidl_next::Encode::encode(self.address, encoder_, address, ())?;
3499
3500            ::fidl_next::Encode::encode(self.size, encoder_, size, ())?;
3501
3502            Ok(())
3503        }
3504    }
3505
3506    /// The generic type corresponding to [`DeviceCancelWatchControllerWriteCommandsResponse`].
3507    pub type DeviceCancelWatchControllerWriteCommandsResponse = ();
3508}
3509
3510pub use self::natural::*;
3511
3512#[doc = " Maximum length of the SPMI device name.\n"]
3513pub const MAX_SPMI_NAME_LEN: u32 = 64 as u32;
3514
3515pub const MAX_SUB_TARGETS: u32 = 65536 as u32;
3516
3517pub const MAX_TARGETS: u32 = 16 as u32;
3518
3519#[doc = " An arbitrary limit on the number of register writes that can be returned to\n `WatchControllerWriteCommands()`.\n"]
3520pub const MAX_CONTROLLER_WRITE_COMMANDS: u32 = 256 as u32;