fidl_next_fuchsia_driver_framework/
fidl_next_fuchsia_driver_framework.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 type NodePropertyKeyUint = u32;
6
7/// The wire type corresponding to [`NodePropertyKeyUint`].
8pub type WireNodePropertyKeyUint = ::fidl_next::WireU32;
9
10pub type NodePropertyKeyString = ::std::string::String;
11
12/// The wire type corresponding to [`NodePropertyKeyString`].
13pub type WireNodePropertyKeyString<'de> = ::fidl_next::WireString<'de>;
14
15#[derive(PartialEq, Clone, Debug)]
16pub enum NodePropertyKey {
17    IntValue(u32),
18
19    StringValue(::std::string::String),
20}
21
22impl ::fidl_next::Encodable for NodePropertyKey {
23    type Encoded = WireNodePropertyKey<'static>;
24}
25
26unsafe impl<___E> ::fidl_next::Encode<___E> for NodePropertyKey
27where
28    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
29    ___E: ::fidl_next::Encoder,
30{
31    #[inline]
32    fn encode(
33        self,
34        encoder: &mut ___E,
35        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
36    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
37        ::fidl_next::munge!(let WireNodePropertyKey { raw, _phantom: _ } = out);
38
39        match self {
40            Self::IntValue(value) => {
41                ::fidl_next::RawWireUnion::encode_as::<___E, u32>(value, 1, encoder, raw)?
42            }
43
44            Self::StringValue(value) => ::fidl_next::RawWireUnion::encode_as::<
45                ___E,
46                ::std::string::String,
47            >(value, 2, encoder, raw)?,
48        }
49
50        Ok(())
51    }
52}
53
54unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodePropertyKey
55where
56    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
57    ___E: ::fidl_next::Encoder,
58{
59    #[inline]
60    fn encode_ref(
61        &self,
62        encoder: &mut ___E,
63        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
64    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
65        ::fidl_next::munge!(let WireNodePropertyKey { raw, _phantom: _ } = out);
66
67        match self {
68            Self::IntValue(value) => {
69                ::fidl_next::RawWireUnion::encode_as::<___E, &u32>(value, 1, encoder, raw)?
70            }
71
72            Self::StringValue(value) => ::fidl_next::RawWireUnion::encode_as::<
73                ___E,
74                &::std::string::String,
75            >(value, 2, encoder, raw)?,
76        }
77
78        Ok(())
79    }
80}
81
82impl ::fidl_next::EncodableOption for NodePropertyKey {
83    type EncodedOption = WireOptionalNodePropertyKey<'static>;
84}
85
86unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodePropertyKey
87where
88    ___E: ?Sized,
89    NodePropertyKey: ::fidl_next::Encode<___E>,
90{
91    #[inline]
92    fn encode_option(
93        this: ::core::option::Option<Self>,
94        encoder: &mut ___E,
95        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
96    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
97        ::fidl_next::munge!(let WireOptionalNodePropertyKey { raw, _phantom: _ } = &mut *out);
98
99        if let Some(inner) = this {
100            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
101            ::fidl_next::Encode::encode(inner, encoder, value_out)?;
102        } else {
103            ::fidl_next::RawWireUnion::encode_absent(raw);
104        }
105
106        Ok(())
107    }
108}
109
110unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodePropertyKey
111where
112    ___E: ?Sized,
113    NodePropertyKey: ::fidl_next::EncodeRef<___E>,
114{
115    #[inline]
116    fn encode_option_ref(
117        this: ::core::option::Option<&Self>,
118        encoder: &mut ___E,
119        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
120    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
121        ::fidl_next::munge!(let WireOptionalNodePropertyKey { raw, _phantom: _ } = &mut *out);
122
123        if let Some(inner) = this {
124            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
125            ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
126        } else {
127            ::fidl_next::RawWireUnion::encode_absent(raw);
128        }
129
130        Ok(())
131    }
132}
133
134impl<'de> ::fidl_next::FromWire<WireNodePropertyKey<'de>> for NodePropertyKey {
135    #[inline]
136    fn from_wire(wire: WireNodePropertyKey<'de>) -> Self {
137        let wire = ::core::mem::ManuallyDrop::new(wire);
138        match wire.raw.ordinal() {
139            1 => Self::IntValue(::fidl_next::FromWire::from_wire(unsafe {
140                wire.raw.get().read_unchecked::<::fidl_next::WireU32>()
141            })),
142
143            2 => Self::StringValue(::fidl_next::FromWire::from_wire(unsafe {
144                wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
145            })),
146
147            _ => unsafe { ::core::hint::unreachable_unchecked() },
148        }
149    }
150}
151
152impl<'de> ::fidl_next::IntoNatural for WireNodePropertyKey<'de> {
153    type Natural = NodePropertyKey;
154}
155
156impl<'de> ::fidl_next::FromWireRef<WireNodePropertyKey<'de>> for NodePropertyKey {
157    #[inline]
158    fn from_wire_ref(wire: &WireNodePropertyKey<'de>) -> Self {
159        match wire.raw.ordinal() {
160            1 => Self::IntValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
161                wire.raw.get().deref_unchecked::<::fidl_next::WireU32>()
162            })),
163
164            2 => Self::StringValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
165                wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
166            })),
167
168            _ => unsafe { ::core::hint::unreachable_unchecked() },
169        }
170    }
171}
172
173impl<'de> ::fidl_next::FromWireOption<WireOptionalNodePropertyKey<'de>> for NodePropertyKey {
174    #[inline]
175    fn from_wire_option(wire: WireOptionalNodePropertyKey<'de>) -> ::core::option::Option<Self> {
176        if let Some(inner) = wire.into_option() {
177            Some(::fidl_next::FromWire::from_wire(inner))
178        } else {
179            None
180        }
181    }
182}
183
184impl<'de> ::fidl_next::IntoNatural for WireOptionalNodePropertyKey<'de> {
185    type Natural = ::core::option::Option<NodePropertyKey>;
186}
187
188impl<'de> ::fidl_next::FromWireOption<WireOptionalNodePropertyKey<'de>> for Box<NodePropertyKey> {
189    #[inline]
190    fn from_wire_option(wire: WireOptionalNodePropertyKey<'de>) -> ::core::option::Option<Self> {
191        <
192            NodePropertyKey as ::fidl_next::FromWireOption<WireOptionalNodePropertyKey<'de>>
193        >::from_wire_option(wire).map(Box::new)
194    }
195}
196
197impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalNodePropertyKey<'de>>
198    for Box<NodePropertyKey>
199{
200    #[inline]
201    fn from_wire_option_ref(
202        wire: &WireOptionalNodePropertyKey<'de>,
203    ) -> ::core::option::Option<Self> {
204        if let Some(inner) = wire.as_ref() {
205            Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
206        } else {
207            None
208        }
209    }
210}
211
212/// The wire type corresponding to [`NodePropertyKey`].
213#[repr(transparent)]
214pub struct WireNodePropertyKey<'de> {
215    raw: ::fidl_next::RawWireUnion,
216    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
217}
218
219impl<'de> Drop for WireNodePropertyKey<'de> {
220    fn drop(&mut self) {
221        match self.raw.ordinal() {
222            1 => {
223                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU32>() };
224            }
225
226            2 => {
227                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
228            }
229
230            _ => unsafe { ::core::hint::unreachable_unchecked() },
231        }
232    }
233}
234
235unsafe impl ::fidl_next::Wire for WireNodePropertyKey<'static> {
236    type Decoded<'de> = WireNodePropertyKey<'de>;
237
238    #[inline]
239    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
240        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
241        ::fidl_next::RawWireUnion::zero_padding(raw);
242    }
243}
244
245pub mod node_property_key {
246    pub enum Ref<'de> {
247        IntValue(&'de ::fidl_next::WireU32),
248
249        StringValue(&'de ::fidl_next::WireString<'de>),
250    }
251}
252
253impl<'de> WireNodePropertyKey<'de> {
254    pub fn as_ref(&self) -> crate::node_property_key::Ref<'_> {
255        match self.raw.ordinal() {
256            1 => crate::node_property_key::Ref::IntValue(unsafe {
257                self.raw.get().deref_unchecked::<::fidl_next::WireU32>()
258            }),
259
260            2 => crate::node_property_key::Ref::StringValue(unsafe {
261                self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
262            }),
263
264            _ => unsafe { ::core::hint::unreachable_unchecked() },
265        }
266    }
267}
268
269unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodePropertyKey<'static>
270where
271    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
272    ___D: ::fidl_next::Decoder,
273{
274    fn decode(
275        mut slot: ::fidl_next::Slot<'_, Self>,
276        decoder: &mut ___D,
277    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
278        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
279        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
280            1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
281
282            2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
283                raw, decoder,
284            )?,
285
286            ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
287        }
288
289        Ok(())
290    }
291}
292
293impl<'de> ::core::fmt::Debug for WireNodePropertyKey<'de> {
294    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
295        match self.raw.ordinal() {
296            1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU32>().fmt(f) },
297            2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f) },
298            _ => unsafe { ::core::hint::unreachable_unchecked() },
299        }
300    }
301}
302
303#[repr(transparent)]
304pub struct WireOptionalNodePropertyKey<'de> {
305    raw: ::fidl_next::RawWireUnion,
306    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
307}
308
309unsafe impl ::fidl_next::Wire for WireOptionalNodePropertyKey<'static> {
310    type Decoded<'de> = WireOptionalNodePropertyKey<'de>;
311
312    #[inline]
313    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
314        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
315        ::fidl_next::RawWireUnion::zero_padding(raw);
316    }
317}
318
319impl<'de> WireOptionalNodePropertyKey<'de> {
320    pub fn is_some(&self) -> bool {
321        self.raw.is_some()
322    }
323
324    pub fn is_none(&self) -> bool {
325        self.raw.is_none()
326    }
327
328    pub fn as_ref(&self) -> ::core::option::Option<&WireNodePropertyKey<'de>> {
329        if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
330    }
331
332    pub fn into_option(self) -> ::core::option::Option<WireNodePropertyKey<'de>> {
333        if self.is_some() {
334            Some(WireNodePropertyKey { raw: self.raw, _phantom: ::core::marker::PhantomData })
335        } else {
336            None
337        }
338    }
339}
340
341unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalNodePropertyKey<'static>
342where
343    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
344    ___D: ::fidl_next::Decoder,
345{
346    fn decode(
347        mut slot: ::fidl_next::Slot<'_, Self>,
348        decoder: &mut ___D,
349    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
350        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
351        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
352            1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
353
354            2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
355                raw, decoder,
356            )?,
357
358            0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
359            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
360        }
361
362        Ok(())
363    }
364}
365
366impl<'de> ::core::fmt::Debug for WireOptionalNodePropertyKey<'de> {
367    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
368        self.as_ref().fmt(f)
369    }
370}
371
372#[doc = " Represents a bind rule condition.\n"]
373#[derive(Clone, Copy, Debug, PartialEq, Eq)]
374#[repr(u32)]
375pub enum Condition {
376    Unknown = 0,
377    Accept = 1,
378    Reject = 2,
379}
380
381impl ::fidl_next::Encodable for Condition {
382    type Encoded = WireCondition;
383}
384impl ::core::convert::TryFrom<u32> for Condition {
385    type Error = ::fidl_next::UnknownStrictEnumMemberError;
386    fn try_from(
387        value: u32,
388    ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
389        match value {
390            0 => Ok(Self::Unknown),
391            1 => Ok(Self::Accept),
392            2 => Ok(Self::Reject),
393
394            _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
395        }
396    }
397}
398
399unsafe impl<___E> ::fidl_next::Encode<___E> for Condition
400where
401    ___E: ?Sized,
402{
403    #[inline]
404    fn encode(
405        self,
406        encoder: &mut ___E,
407        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
408    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
409        ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
410    }
411}
412
413unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Condition
414where
415    ___E: ?Sized,
416{
417    #[inline]
418    fn encode_ref(
419        &self,
420        encoder: &mut ___E,
421        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
422    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
423        ::fidl_next::munge!(let WireCondition { value } = out);
424        let _ = value.write(::fidl_next::WireU32::from(match *self {
425            Self::Unknown => 0,
426
427            Self::Accept => 1,
428
429            Self::Reject => 2,
430        }));
431
432        Ok(())
433    }
434}
435
436impl ::core::convert::From<WireCondition> for Condition {
437    fn from(wire: WireCondition) -> Self {
438        match u32::from(wire.value) {
439            0 => Self::Unknown,
440
441            1 => Self::Accept,
442
443            2 => Self::Reject,
444
445            _ => unsafe { ::core::hint::unreachable_unchecked() },
446        }
447    }
448}
449
450impl ::fidl_next::FromWire<WireCondition> for Condition {
451    #[inline]
452    fn from_wire(wire: WireCondition) -> Self {
453        Self::from(wire)
454    }
455}
456
457impl ::fidl_next::IntoNatural for WireCondition {
458    type Natural = Condition;
459}
460
461impl ::fidl_next::FromWireRef<WireCondition> for Condition {
462    #[inline]
463    fn from_wire_ref(wire: &WireCondition) -> Self {
464        Self::from(*wire)
465    }
466}
467
468/// The wire type corresponding to [`Condition`].
469#[derive(Clone, Copy, Debug, PartialEq, Eq)]
470#[repr(transparent)]
471pub struct WireCondition {
472    value: ::fidl_next::WireU32,
473}
474
475unsafe impl ::fidl_next::Wire for WireCondition {
476    type Decoded<'de> = Self;
477
478    #[inline]
479    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
480        // Wire enums have no padding
481    }
482}
483
484impl WireCondition {
485    pub const UNKNOWN: WireCondition = WireCondition { value: ::fidl_next::WireU32(0) };
486
487    pub const ACCEPT: WireCondition = WireCondition { value: ::fidl_next::WireU32(1) };
488
489    pub const REJECT: WireCondition = WireCondition { value: ::fidl_next::WireU32(2) };
490}
491
492unsafe impl<___D> ::fidl_next::Decode<___D> for WireCondition
493where
494    ___D: ?Sized,
495{
496    fn decode(
497        slot: ::fidl_next::Slot<'_, Self>,
498        _: &mut ___D,
499    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
500        ::fidl_next::munge!(let Self { value } = slot);
501
502        match u32::from(*value) {
503            0 | 1 | 2 => (),
504            unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
505        }
506
507        Ok(())
508    }
509}
510
511impl ::core::convert::From<Condition> for WireCondition {
512    fn from(natural: Condition) -> Self {
513        match natural {
514            Condition::Unknown => WireCondition::UNKNOWN,
515
516            Condition::Accept => WireCondition::ACCEPT,
517
518            Condition::Reject => WireCondition::REJECT,
519        }
520    }
521}
522
523pub type NodePropertyValueUint = u32;
524
525/// The wire type corresponding to [`NodePropertyValueUint`].
526pub type WireNodePropertyValueUint = ::fidl_next::WireU32;
527
528pub type NodePropertyValueString = ::std::string::String;
529
530/// The wire type corresponding to [`NodePropertyValueString`].
531pub type WireNodePropertyValueString<'de> = ::fidl_next::WireString<'de>;
532
533pub type NodePropertyValueBool = bool;
534
535/// The wire type corresponding to [`NodePropertyValueBool`].
536pub type WireNodePropertyValueBool = bool;
537
538pub type NodePropertyValueEnum = ::std::string::String;
539
540/// The wire type corresponding to [`NodePropertyValueEnum`].
541pub type WireNodePropertyValueEnum<'de> = ::fidl_next::WireString<'de>;
542
543#[derive(PartialEq, Clone, Debug)]
544pub enum NodePropertyValue {
545    IntValue(u32),
546
547    StringValue(::std::string::String),
548
549    BoolValue(bool),
550
551    EnumValue(::std::string::String),
552
553    UnknownOrdinal_(u64),
554}
555
556impl ::fidl_next::Encodable for NodePropertyValue {
557    type Encoded = WireNodePropertyValue<'static>;
558}
559
560unsafe impl<___E> ::fidl_next::Encode<___E> for NodePropertyValue
561where
562    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
563    ___E: ::fidl_next::Encoder,
564{
565    #[inline]
566    fn encode(
567        self,
568        encoder: &mut ___E,
569        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
570    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
571        ::fidl_next::munge!(let WireNodePropertyValue { raw, _phantom: _ } = out);
572
573        match self {
574            Self::IntValue(value) => {
575                ::fidl_next::RawWireUnion::encode_as::<___E, u32>(value, 1, encoder, raw)?
576            }
577
578            Self::StringValue(value) => ::fidl_next::RawWireUnion::encode_as::<
579                ___E,
580                ::std::string::String,
581            >(value, 2, encoder, raw)?,
582
583            Self::BoolValue(value) => {
584                ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 3, encoder, raw)?
585            }
586
587            Self::EnumValue(value) => ::fidl_next::RawWireUnion::encode_as::<
588                ___E,
589                ::std::string::String,
590            >(value, 4, encoder, raw)?,
591
592            Self::UnknownOrdinal_(ordinal) => {
593                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
594            }
595        }
596
597        Ok(())
598    }
599}
600
601unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodePropertyValue
602where
603    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
604    ___E: ::fidl_next::Encoder,
605{
606    #[inline]
607    fn encode_ref(
608        &self,
609        encoder: &mut ___E,
610        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
611    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
612        ::fidl_next::munge!(let WireNodePropertyValue { raw, _phantom: _ } = out);
613
614        match self {
615            Self::IntValue(value) => {
616                ::fidl_next::RawWireUnion::encode_as::<___E, &u32>(value, 1, encoder, raw)?
617            }
618
619            Self::StringValue(value) => ::fidl_next::RawWireUnion::encode_as::<
620                ___E,
621                &::std::string::String,
622            >(value, 2, encoder, raw)?,
623
624            Self::BoolValue(value) => {
625                ::fidl_next::RawWireUnion::encode_as::<___E, &bool>(value, 3, encoder, raw)?
626            }
627
628            Self::EnumValue(value) => ::fidl_next::RawWireUnion::encode_as::<
629                ___E,
630                &::std::string::String,
631            >(value, 4, encoder, raw)?,
632
633            Self::UnknownOrdinal_(ordinal) => {
634                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
635            }
636        }
637
638        Ok(())
639    }
640}
641
642impl ::fidl_next::EncodableOption for NodePropertyValue {
643    type EncodedOption = WireOptionalNodePropertyValue<'static>;
644}
645
646unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodePropertyValue
647where
648    ___E: ?Sized,
649    NodePropertyValue: ::fidl_next::Encode<___E>,
650{
651    #[inline]
652    fn encode_option(
653        this: ::core::option::Option<Self>,
654        encoder: &mut ___E,
655        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
656    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
657        ::fidl_next::munge!(let WireOptionalNodePropertyValue { raw, _phantom: _ } = &mut *out);
658
659        if let Some(inner) = this {
660            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
661            ::fidl_next::Encode::encode(inner, encoder, value_out)?;
662        } else {
663            ::fidl_next::RawWireUnion::encode_absent(raw);
664        }
665
666        Ok(())
667    }
668}
669
670unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodePropertyValue
671where
672    ___E: ?Sized,
673    NodePropertyValue: ::fidl_next::EncodeRef<___E>,
674{
675    #[inline]
676    fn encode_option_ref(
677        this: ::core::option::Option<&Self>,
678        encoder: &mut ___E,
679        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
680    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
681        ::fidl_next::munge!(let WireOptionalNodePropertyValue { raw, _phantom: _ } = &mut *out);
682
683        if let Some(inner) = this {
684            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
685            ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
686        } else {
687            ::fidl_next::RawWireUnion::encode_absent(raw);
688        }
689
690        Ok(())
691    }
692}
693
694impl<'de> ::fidl_next::FromWire<WireNodePropertyValue<'de>> for NodePropertyValue {
695    #[inline]
696    fn from_wire(wire: WireNodePropertyValue<'de>) -> Self {
697        let wire = ::core::mem::ManuallyDrop::new(wire);
698        match wire.raw.ordinal() {
699            1 => Self::IntValue(::fidl_next::FromWire::from_wire(unsafe {
700                wire.raw.get().read_unchecked::<::fidl_next::WireU32>()
701            })),
702
703            2 => Self::StringValue(::fidl_next::FromWire::from_wire(unsafe {
704                wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
705            })),
706
707            3 => Self::BoolValue(::fidl_next::FromWire::from_wire(unsafe {
708                wire.raw.get().read_unchecked::<bool>()
709            })),
710
711            4 => Self::EnumValue(::fidl_next::FromWire::from_wire(unsafe {
712                wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
713            })),
714
715            _ => unsafe { ::core::hint::unreachable_unchecked() },
716        }
717    }
718}
719
720impl<'de> ::fidl_next::IntoNatural for WireNodePropertyValue<'de> {
721    type Natural = NodePropertyValue;
722}
723
724impl<'de> ::fidl_next::FromWireRef<WireNodePropertyValue<'de>> for NodePropertyValue {
725    #[inline]
726    fn from_wire_ref(wire: &WireNodePropertyValue<'de>) -> Self {
727        match wire.raw.ordinal() {
728            1 => Self::IntValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
729                wire.raw.get().deref_unchecked::<::fidl_next::WireU32>()
730            })),
731
732            2 => Self::StringValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
733                wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
734            })),
735
736            3 => Self::BoolValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
737                wire.raw.get().deref_unchecked::<bool>()
738            })),
739
740            4 => Self::EnumValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
741                wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
742            })),
743
744            _ => unsafe { ::core::hint::unreachable_unchecked() },
745        }
746    }
747}
748
749impl<'de> ::fidl_next::FromWireOption<WireOptionalNodePropertyValue<'de>> for NodePropertyValue {
750    #[inline]
751    fn from_wire_option(wire: WireOptionalNodePropertyValue<'de>) -> ::core::option::Option<Self> {
752        if let Some(inner) = wire.into_option() {
753            Some(::fidl_next::FromWire::from_wire(inner))
754        } else {
755            None
756        }
757    }
758}
759
760impl<'de> ::fidl_next::IntoNatural for WireOptionalNodePropertyValue<'de> {
761    type Natural = ::core::option::Option<NodePropertyValue>;
762}
763
764impl<'de> ::fidl_next::FromWireOption<WireOptionalNodePropertyValue<'de>>
765    for Box<NodePropertyValue>
766{
767    #[inline]
768    fn from_wire_option(wire: WireOptionalNodePropertyValue<'de>) -> ::core::option::Option<Self> {
769        <
770            NodePropertyValue as ::fidl_next::FromWireOption<WireOptionalNodePropertyValue<'de>>
771        >::from_wire_option(wire).map(Box::new)
772    }
773}
774
775impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalNodePropertyValue<'de>>
776    for Box<NodePropertyValue>
777{
778    #[inline]
779    fn from_wire_option_ref(
780        wire: &WireOptionalNodePropertyValue<'de>,
781    ) -> ::core::option::Option<Self> {
782        if let Some(inner) = wire.as_ref() {
783            Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
784        } else {
785            None
786        }
787    }
788}
789
790/// The wire type corresponding to [`NodePropertyValue`].
791#[repr(transparent)]
792pub struct WireNodePropertyValue<'de> {
793    raw: ::fidl_next::RawWireUnion,
794    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
795}
796
797impl<'de> Drop for WireNodePropertyValue<'de> {
798    fn drop(&mut self) {
799        match self.raw.ordinal() {
800            1 => {
801                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU32>() };
802            }
803
804            2 => {
805                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
806            }
807
808            3 => {
809                let _ = unsafe { self.raw.get().read_unchecked::<bool>() };
810            }
811
812            4 => {
813                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
814            }
815
816            _ => (),
817        }
818    }
819}
820
821unsafe impl ::fidl_next::Wire for WireNodePropertyValue<'static> {
822    type Decoded<'de> = WireNodePropertyValue<'de>;
823
824    #[inline]
825    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
826        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
827        ::fidl_next::RawWireUnion::zero_padding(raw);
828    }
829}
830
831pub mod node_property_value {
832    pub enum Ref<'de> {
833        IntValue(&'de ::fidl_next::WireU32),
834
835        StringValue(&'de ::fidl_next::WireString<'de>),
836
837        BoolValue(&'de bool),
838
839        EnumValue(&'de ::fidl_next::WireString<'de>),
840
841        UnknownOrdinal_(u64),
842    }
843}
844
845impl<'de> WireNodePropertyValue<'de> {
846    pub fn as_ref(&self) -> crate::node_property_value::Ref<'_> {
847        match self.raw.ordinal() {
848            1 => crate::node_property_value::Ref::IntValue(unsafe {
849                self.raw.get().deref_unchecked::<::fidl_next::WireU32>()
850            }),
851
852            2 => crate::node_property_value::Ref::StringValue(unsafe {
853                self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
854            }),
855
856            3 => crate::node_property_value::Ref::BoolValue(unsafe {
857                self.raw.get().deref_unchecked::<bool>()
858            }),
859
860            4 => crate::node_property_value::Ref::EnumValue(unsafe {
861                self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
862            }),
863
864            unknown => crate::node_property_value::Ref::UnknownOrdinal_(unknown),
865        }
866    }
867}
868
869unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodePropertyValue<'static>
870where
871    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
872    ___D: ::fidl_next::Decoder,
873{
874    fn decode(
875        mut slot: ::fidl_next::Slot<'_, Self>,
876        decoder: &mut ___D,
877    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
878        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
879        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
880            1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
881
882            2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
883                raw, decoder,
884            )?,
885
886            3 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder)?,
887
888            4 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
889                raw, decoder,
890            )?,
891
892            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
893        }
894
895        Ok(())
896    }
897}
898
899impl<'de> ::core::fmt::Debug for WireNodePropertyValue<'de> {
900    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
901        match self.raw.ordinal() {
902            1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU32>().fmt(f) },
903            2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f) },
904            3 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) },
905            4 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f) },
906            _ => unsafe { ::core::hint::unreachable_unchecked() },
907        }
908    }
909}
910
911#[repr(transparent)]
912pub struct WireOptionalNodePropertyValue<'de> {
913    raw: ::fidl_next::RawWireUnion,
914    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
915}
916
917unsafe impl ::fidl_next::Wire for WireOptionalNodePropertyValue<'static> {
918    type Decoded<'de> = WireOptionalNodePropertyValue<'de>;
919
920    #[inline]
921    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
922        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
923        ::fidl_next::RawWireUnion::zero_padding(raw);
924    }
925}
926
927impl<'de> WireOptionalNodePropertyValue<'de> {
928    pub fn is_some(&self) -> bool {
929        self.raw.is_some()
930    }
931
932    pub fn is_none(&self) -> bool {
933        self.raw.is_none()
934    }
935
936    pub fn as_ref(&self) -> ::core::option::Option<&WireNodePropertyValue<'de>> {
937        if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
938    }
939
940    pub fn into_option(self) -> ::core::option::Option<WireNodePropertyValue<'de>> {
941        if self.is_some() {
942            Some(WireNodePropertyValue { raw: self.raw, _phantom: ::core::marker::PhantomData })
943        } else {
944            None
945        }
946    }
947}
948
949unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalNodePropertyValue<'static>
950where
951    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
952    ___D: ::fidl_next::Decoder,
953{
954    fn decode(
955        mut slot: ::fidl_next::Slot<'_, Self>,
956        decoder: &mut ___D,
957    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
958        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
959        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
960            1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
961
962            2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
963                raw, decoder,
964            )?,
965
966            3 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder)?,
967
968            4 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
969                raw, decoder,
970            )?,
971
972            0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
973            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
974        }
975
976        Ok(())
977    }
978}
979
980impl<'de> ::core::fmt::Debug for WireOptionalNodePropertyValue<'de> {
981    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
982        self.as_ref().fmt(f)
983    }
984}
985
986pub const MAX_PROPERTY_COUNT: u8 = 64 as u8;
987
988#[doc = " Represents a bind rule in a parent specification.\n"]
989#[derive(PartialEq, Clone, Debug)]
990pub struct BindRule {
991    pub key: crate::NodePropertyKey,
992
993    pub condition: crate::Condition,
994
995    pub values: ::std::vec::Vec<crate::NodePropertyValue>,
996}
997
998impl ::fidl_next::Encodable for BindRule {
999    type Encoded = WireBindRule<'static>;
1000}
1001
1002unsafe impl<___E> ::fidl_next::Encode<___E> for BindRule
1003where
1004    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1005    ___E: ::fidl_next::Encoder,
1006{
1007    #[inline]
1008    fn encode(
1009        self,
1010        encoder_: &mut ___E,
1011        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1012    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1013        ::fidl_next::munge! {
1014            let Self::Encoded {
1015                key,
1016                condition,
1017                values,
1018
1019            } = out_;
1020        }
1021
1022        ::fidl_next::Encode::encode(self.key, encoder_, key)?;
1023
1024        ::fidl_next::Encode::encode(self.condition, encoder_, condition)?;
1025
1026        ::fidl_next::Encode::encode(self.values, encoder_, values)?;
1027
1028        Ok(())
1029    }
1030}
1031
1032unsafe impl<___E> ::fidl_next::EncodeRef<___E> for BindRule
1033where
1034    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1035    ___E: ::fidl_next::Encoder,
1036{
1037    #[inline]
1038    fn encode_ref(
1039        &self,
1040        encoder_: &mut ___E,
1041        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1042    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1043        ::fidl_next::munge! {
1044            let Self::Encoded {
1045
1046                key,
1047                condition,
1048                values,
1049
1050            } = out_;
1051        }
1052
1053        ::fidl_next::EncodeRef::encode_ref(&self.key, encoder_, key)?;
1054
1055        ::fidl_next::EncodeRef::encode_ref(&self.condition, encoder_, condition)?;
1056
1057        ::fidl_next::EncodeRef::encode_ref(&self.values, encoder_, values)?;
1058
1059        Ok(())
1060    }
1061}
1062
1063impl ::fidl_next::EncodableOption for BindRule {
1064    type EncodedOption = ::fidl_next::WireBox<'static, WireBindRule<'static>>;
1065}
1066
1067unsafe impl<___E> ::fidl_next::EncodeOption<___E> for BindRule
1068where
1069    ___E: ::fidl_next::Encoder + ?Sized,
1070    BindRule: ::fidl_next::Encode<___E>,
1071{
1072    #[inline]
1073    fn encode_option(
1074        this: ::core::option::Option<Self>,
1075        encoder: &mut ___E,
1076        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1077    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1078        if let Some(inner) = this {
1079            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1080            ::fidl_next::WireBox::encode_present(out);
1081        } else {
1082            ::fidl_next::WireBox::encode_absent(out);
1083        }
1084
1085        Ok(())
1086    }
1087}
1088
1089unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for BindRule
1090where
1091    ___E: ::fidl_next::Encoder + ?Sized,
1092    BindRule: ::fidl_next::EncodeRef<___E>,
1093{
1094    #[inline]
1095    fn encode_option_ref(
1096        this: ::core::option::Option<&Self>,
1097        encoder: &mut ___E,
1098        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1099    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1100        if let Some(inner) = this {
1101            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1102            ::fidl_next::WireBox::encode_present(out);
1103        } else {
1104            ::fidl_next::WireBox::encode_absent(out);
1105        }
1106
1107        Ok(())
1108    }
1109}
1110
1111impl<'de> ::fidl_next::FromWire<WireBindRule<'de>> for BindRule {
1112    #[inline]
1113    fn from_wire(wire: WireBindRule<'de>) -> Self {
1114        Self {
1115            key: ::fidl_next::FromWire::from_wire(wire.key),
1116
1117            condition: ::fidl_next::FromWire::from_wire(wire.condition),
1118
1119            values: ::fidl_next::FromWire::from_wire(wire.values),
1120        }
1121    }
1122}
1123
1124impl<'de> ::fidl_next::IntoNatural for WireBindRule<'de> {
1125    type Natural = BindRule;
1126}
1127
1128impl<'de> ::fidl_next::FromWireRef<WireBindRule<'de>> for BindRule {
1129    #[inline]
1130    fn from_wire_ref(wire: &WireBindRule<'de>) -> Self {
1131        Self {
1132            key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
1133
1134            condition: ::fidl_next::FromWireRef::from_wire_ref(&wire.condition),
1135
1136            values: ::fidl_next::FromWireRef::from_wire_ref(&wire.values),
1137        }
1138    }
1139}
1140
1141/// The wire type corresponding to [`BindRule`].
1142#[derive(Debug)]
1143#[repr(C)]
1144pub struct WireBindRule<'de> {
1145    pub key: crate::WireNodePropertyKey<'de>,
1146
1147    pub condition: crate::WireCondition,
1148
1149    pub values: ::fidl_next::WireVector<'de, crate::WireNodePropertyValue<'de>>,
1150}
1151static_assertions::const_assert_eq!(std::mem::size_of::<WireBindRule<'_>>(), 40);
1152static_assertions::const_assert_eq!(std::mem::align_of::<WireBindRule<'_>>(), 8);
1153
1154static_assertions::const_assert_eq!(std::mem::offset_of!(WireBindRule<'_>, key), 0);
1155
1156static_assertions::const_assert_eq!(std::mem::offset_of!(WireBindRule<'_>, condition), 16);
1157
1158static_assertions::const_assert_eq!(std::mem::offset_of!(WireBindRule<'_>, values), 24);
1159
1160unsafe impl ::fidl_next::Wire for WireBindRule<'static> {
1161    type Decoded<'de> = WireBindRule<'de>;
1162
1163    #[inline]
1164    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1165        ::fidl_next::munge! {
1166            let Self {
1167
1168                key,
1169                condition,
1170                values,
1171
1172            } = &mut *out_;
1173        }
1174
1175        ::fidl_next::Wire::zero_padding(key);
1176
1177        ::fidl_next::Wire::zero_padding(condition);
1178
1179        ::fidl_next::Wire::zero_padding(values);
1180
1181        unsafe {
1182            out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
1183        }
1184    }
1185}
1186
1187unsafe impl<___D> ::fidl_next::Decode<___D> for WireBindRule<'static>
1188where
1189    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1190    ___D: ::fidl_next::Decoder,
1191{
1192    fn decode(
1193        slot_: ::fidl_next::Slot<'_, Self>,
1194        decoder_: &mut ___D,
1195    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1196        ::fidl_next::munge! {
1197            let Self {
1198
1199                mut key,
1200                mut condition,
1201                mut values,
1202
1203            } = slot_;
1204        }
1205
1206        ::fidl_next::Decode::decode(key.as_mut(), decoder_)?;
1207
1208        ::fidl_next::Decode::decode(condition.as_mut(), decoder_)?;
1209
1210        ::fidl_next::Decode::decode(values.as_mut(), decoder_)?;
1211
1212        let values = unsafe { values.deref_unchecked() };
1213
1214        if values.len() > 64 {
1215            return Err(::fidl_next::DecodeError::VectorTooLong {
1216                size: values.len() as u64,
1217                limit: 64,
1218            });
1219        }
1220
1221        Ok(())
1222    }
1223}
1224
1225#[doc = " Represents a bind rule in a parent specification.\n"]
1226#[derive(PartialEq, Clone, Debug)]
1227pub struct BindRule2 {
1228    pub key: ::std::string::String,
1229
1230    pub condition: crate::Condition,
1231
1232    pub values: ::std::vec::Vec<crate::NodePropertyValue>,
1233}
1234
1235impl ::fidl_next::Encodable for BindRule2 {
1236    type Encoded = WireBindRule2<'static>;
1237}
1238
1239unsafe impl<___E> ::fidl_next::Encode<___E> for BindRule2
1240where
1241    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1242    ___E: ::fidl_next::Encoder,
1243{
1244    #[inline]
1245    fn encode(
1246        self,
1247        encoder_: &mut ___E,
1248        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1249    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1250        ::fidl_next::munge! {
1251            let Self::Encoded {
1252                key,
1253                condition,
1254                values,
1255
1256            } = out_;
1257        }
1258
1259        ::fidl_next::Encode::encode(self.key, encoder_, key)?;
1260
1261        ::fidl_next::Encode::encode(self.condition, encoder_, condition)?;
1262
1263        ::fidl_next::Encode::encode(self.values, encoder_, values)?;
1264
1265        Ok(())
1266    }
1267}
1268
1269unsafe impl<___E> ::fidl_next::EncodeRef<___E> for BindRule2
1270where
1271    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1272    ___E: ::fidl_next::Encoder,
1273{
1274    #[inline]
1275    fn encode_ref(
1276        &self,
1277        encoder_: &mut ___E,
1278        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1279    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1280        ::fidl_next::munge! {
1281            let Self::Encoded {
1282
1283                key,
1284                condition,
1285                values,
1286
1287            } = out_;
1288        }
1289
1290        ::fidl_next::EncodeRef::encode_ref(&self.key, encoder_, key)?;
1291
1292        ::fidl_next::EncodeRef::encode_ref(&self.condition, encoder_, condition)?;
1293
1294        ::fidl_next::EncodeRef::encode_ref(&self.values, encoder_, values)?;
1295
1296        Ok(())
1297    }
1298}
1299
1300impl ::fidl_next::EncodableOption for BindRule2 {
1301    type EncodedOption = ::fidl_next::WireBox<'static, WireBindRule2<'static>>;
1302}
1303
1304unsafe impl<___E> ::fidl_next::EncodeOption<___E> for BindRule2
1305where
1306    ___E: ::fidl_next::Encoder + ?Sized,
1307    BindRule2: ::fidl_next::Encode<___E>,
1308{
1309    #[inline]
1310    fn encode_option(
1311        this: ::core::option::Option<Self>,
1312        encoder: &mut ___E,
1313        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1314    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1315        if let Some(inner) = this {
1316            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1317            ::fidl_next::WireBox::encode_present(out);
1318        } else {
1319            ::fidl_next::WireBox::encode_absent(out);
1320        }
1321
1322        Ok(())
1323    }
1324}
1325
1326unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for BindRule2
1327where
1328    ___E: ::fidl_next::Encoder + ?Sized,
1329    BindRule2: ::fidl_next::EncodeRef<___E>,
1330{
1331    #[inline]
1332    fn encode_option_ref(
1333        this: ::core::option::Option<&Self>,
1334        encoder: &mut ___E,
1335        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1336    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1337        if let Some(inner) = this {
1338            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1339            ::fidl_next::WireBox::encode_present(out);
1340        } else {
1341            ::fidl_next::WireBox::encode_absent(out);
1342        }
1343
1344        Ok(())
1345    }
1346}
1347
1348impl<'de> ::fidl_next::FromWire<WireBindRule2<'de>> for BindRule2 {
1349    #[inline]
1350    fn from_wire(wire: WireBindRule2<'de>) -> Self {
1351        Self {
1352            key: ::fidl_next::FromWire::from_wire(wire.key),
1353
1354            condition: ::fidl_next::FromWire::from_wire(wire.condition),
1355
1356            values: ::fidl_next::FromWire::from_wire(wire.values),
1357        }
1358    }
1359}
1360
1361impl<'de> ::fidl_next::IntoNatural for WireBindRule2<'de> {
1362    type Natural = BindRule2;
1363}
1364
1365impl<'de> ::fidl_next::FromWireRef<WireBindRule2<'de>> for BindRule2 {
1366    #[inline]
1367    fn from_wire_ref(wire: &WireBindRule2<'de>) -> Self {
1368        Self {
1369            key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
1370
1371            condition: ::fidl_next::FromWireRef::from_wire_ref(&wire.condition),
1372
1373            values: ::fidl_next::FromWireRef::from_wire_ref(&wire.values),
1374        }
1375    }
1376}
1377
1378/// The wire type corresponding to [`BindRule2`].
1379#[derive(Debug)]
1380#[repr(C)]
1381pub struct WireBindRule2<'de> {
1382    pub key: ::fidl_next::WireString<'de>,
1383
1384    pub condition: crate::WireCondition,
1385
1386    pub values: ::fidl_next::WireVector<'de, crate::WireNodePropertyValue<'de>>,
1387}
1388static_assertions::const_assert_eq!(std::mem::size_of::<WireBindRule2<'_>>(), 40);
1389static_assertions::const_assert_eq!(std::mem::align_of::<WireBindRule2<'_>>(), 8);
1390
1391static_assertions::const_assert_eq!(std::mem::offset_of!(WireBindRule2<'_>, key), 0);
1392
1393static_assertions::const_assert_eq!(std::mem::offset_of!(WireBindRule2<'_>, condition), 16);
1394
1395static_assertions::const_assert_eq!(std::mem::offset_of!(WireBindRule2<'_>, values), 24);
1396
1397unsafe impl ::fidl_next::Wire for WireBindRule2<'static> {
1398    type Decoded<'de> = WireBindRule2<'de>;
1399
1400    #[inline]
1401    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1402        ::fidl_next::munge! {
1403            let Self {
1404
1405                key,
1406                condition,
1407                values,
1408
1409            } = &mut *out_;
1410        }
1411
1412        ::fidl_next::Wire::zero_padding(key);
1413
1414        ::fidl_next::Wire::zero_padding(condition);
1415
1416        ::fidl_next::Wire::zero_padding(values);
1417
1418        unsafe {
1419            out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
1420        }
1421    }
1422}
1423
1424unsafe impl<___D> ::fidl_next::Decode<___D> for WireBindRule2<'static>
1425where
1426    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1427    ___D: ::fidl_next::Decoder,
1428{
1429    fn decode(
1430        slot_: ::fidl_next::Slot<'_, Self>,
1431        decoder_: &mut ___D,
1432    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1433        ::fidl_next::munge! {
1434            let Self {
1435
1436                mut key,
1437                mut condition,
1438                mut values,
1439
1440            } = slot_;
1441        }
1442
1443        ::fidl_next::Decode::decode(key.as_mut(), decoder_)?;
1444
1445        let key = unsafe { key.deref_unchecked() };
1446
1447        if key.len() > 256 {
1448            return Err(::fidl_next::DecodeError::VectorTooLong {
1449                size: key.len() as u64,
1450                limit: 256,
1451            });
1452        }
1453
1454        ::fidl_next::Decode::decode(condition.as_mut(), decoder_)?;
1455
1456        ::fidl_next::Decode::decode(values.as_mut(), decoder_)?;
1457
1458        let values = unsafe { values.deref_unchecked() };
1459
1460        if values.len() > 64 {
1461            return Err(::fidl_next::DecodeError::VectorTooLong {
1462                size: values.len() as u64,
1463                limit: 64,
1464            });
1465        }
1466
1467        Ok(())
1468    }
1469}
1470
1471#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1472#[repr(u32)]
1473pub enum BusType {
1474    Platform = 1,
1475    Acpi = 2,
1476    DeviceTree = 3,
1477    Pci = 4,
1478    Usb = 5,
1479    Gpio = 6,
1480    I2C = 7,
1481    Spi = 8,
1482    Sdio = 9,
1483    Uart = 10,
1484    Spmi = 11,
1485    UnknownOrdinal_(u32) = 12,
1486}
1487
1488impl ::fidl_next::Encodable for BusType {
1489    type Encoded = WireBusType;
1490}
1491impl ::std::convert::From<u32> for BusType {
1492    fn from(value: u32) -> Self {
1493        match value {
1494            1 => Self::Platform,
1495            2 => Self::Acpi,
1496            3 => Self::DeviceTree,
1497            4 => Self::Pci,
1498            5 => Self::Usb,
1499            6 => Self::Gpio,
1500            7 => Self::I2C,
1501            8 => Self::Spi,
1502            9 => Self::Sdio,
1503            10 => Self::Uart,
1504            11 => Self::Spmi,
1505
1506            _ => Self::UnknownOrdinal_(value),
1507        }
1508    }
1509}
1510
1511unsafe impl<___E> ::fidl_next::Encode<___E> for BusType
1512where
1513    ___E: ?Sized,
1514{
1515    #[inline]
1516    fn encode(
1517        self,
1518        encoder: &mut ___E,
1519        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1520    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1521        ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
1522    }
1523}
1524
1525unsafe impl<___E> ::fidl_next::EncodeRef<___E> for BusType
1526where
1527    ___E: ?Sized,
1528{
1529    #[inline]
1530    fn encode_ref(
1531        &self,
1532        encoder: &mut ___E,
1533        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1534    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1535        ::fidl_next::munge!(let WireBusType { value } = out);
1536        let _ = value.write(::fidl_next::WireU32::from(match *self {
1537            Self::Platform => 1,
1538
1539            Self::Acpi => 2,
1540
1541            Self::DeviceTree => 3,
1542
1543            Self::Pci => 4,
1544
1545            Self::Usb => 5,
1546
1547            Self::Gpio => 6,
1548
1549            Self::I2C => 7,
1550
1551            Self::Spi => 8,
1552
1553            Self::Sdio => 9,
1554
1555            Self::Uart => 10,
1556
1557            Self::Spmi => 11,
1558
1559            Self::UnknownOrdinal_(value) => value,
1560        }));
1561
1562        Ok(())
1563    }
1564}
1565
1566impl ::core::convert::From<WireBusType> for BusType {
1567    fn from(wire: WireBusType) -> Self {
1568        match u32::from(wire.value) {
1569            1 => Self::Platform,
1570
1571            2 => Self::Acpi,
1572
1573            3 => Self::DeviceTree,
1574
1575            4 => Self::Pci,
1576
1577            5 => Self::Usb,
1578
1579            6 => Self::Gpio,
1580
1581            7 => Self::I2C,
1582
1583            8 => Self::Spi,
1584
1585            9 => Self::Sdio,
1586
1587            10 => Self::Uart,
1588
1589            11 => Self::Spmi,
1590
1591            value => Self::UnknownOrdinal_(value),
1592        }
1593    }
1594}
1595
1596impl ::fidl_next::FromWire<WireBusType> for BusType {
1597    #[inline]
1598    fn from_wire(wire: WireBusType) -> Self {
1599        Self::from(wire)
1600    }
1601}
1602
1603impl ::fidl_next::IntoNatural for WireBusType {
1604    type Natural = BusType;
1605}
1606
1607impl ::fidl_next::FromWireRef<WireBusType> for BusType {
1608    #[inline]
1609    fn from_wire_ref(wire: &WireBusType) -> Self {
1610        Self::from(*wire)
1611    }
1612}
1613
1614/// The wire type corresponding to [`BusType`].
1615#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1616#[repr(transparent)]
1617pub struct WireBusType {
1618    value: ::fidl_next::WireU32,
1619}
1620
1621unsafe impl ::fidl_next::Wire for WireBusType {
1622    type Decoded<'de> = Self;
1623
1624    #[inline]
1625    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1626        // Wire enums have no padding
1627    }
1628}
1629
1630impl WireBusType {
1631    pub const PLATFORM: WireBusType = WireBusType { value: ::fidl_next::WireU32(1) };
1632
1633    pub const ACPI: WireBusType = WireBusType { value: ::fidl_next::WireU32(2) };
1634
1635    pub const DEVICE_TREE: WireBusType = WireBusType { value: ::fidl_next::WireU32(3) };
1636
1637    pub const PCI: WireBusType = WireBusType { value: ::fidl_next::WireU32(4) };
1638
1639    pub const USB: WireBusType = WireBusType { value: ::fidl_next::WireU32(5) };
1640
1641    pub const GPIO: WireBusType = WireBusType { value: ::fidl_next::WireU32(6) };
1642
1643    pub const I2_C: WireBusType = WireBusType { value: ::fidl_next::WireU32(7) };
1644
1645    pub const SPI: WireBusType = WireBusType { value: ::fidl_next::WireU32(8) };
1646
1647    pub const SDIO: WireBusType = WireBusType { value: ::fidl_next::WireU32(9) };
1648
1649    pub const UART: WireBusType = WireBusType { value: ::fidl_next::WireU32(10) };
1650
1651    pub const SPMI: WireBusType = WireBusType { value: ::fidl_next::WireU32(11) };
1652}
1653
1654unsafe impl<___D> ::fidl_next::Decode<___D> for WireBusType
1655where
1656    ___D: ?Sized,
1657{
1658    fn decode(
1659        slot: ::fidl_next::Slot<'_, Self>,
1660        _: &mut ___D,
1661    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1662        Ok(())
1663    }
1664}
1665
1666impl ::core::convert::From<BusType> for WireBusType {
1667    fn from(natural: BusType) -> Self {
1668        match natural {
1669            BusType::Platform => WireBusType::PLATFORM,
1670
1671            BusType::Acpi => WireBusType::ACPI,
1672
1673            BusType::DeviceTree => WireBusType::DEVICE_TREE,
1674
1675            BusType::Pci => WireBusType::PCI,
1676
1677            BusType::Usb => WireBusType::USB,
1678
1679            BusType::Gpio => WireBusType::GPIO,
1680
1681            BusType::I2C => WireBusType::I2_C,
1682
1683            BusType::Spi => WireBusType::SPI,
1684
1685            BusType::Sdio => WireBusType::SDIO,
1686
1687            BusType::Uart => WireBusType::UART,
1688
1689            BusType::Spmi => WireBusType::SPMI,
1690
1691            BusType::UnknownOrdinal_(value) => {
1692                WireBusType { value: ::fidl_next::WireU32::from(value) }
1693            }
1694        }
1695    }
1696}
1697
1698pub const MAX_DEVICE_ADDRESS_ARRAY_LEN: u32 = 10 as u32;
1699
1700pub const MAX_DEVICE_ADDRESS_STR_LEN: u32 = 32 as u32;
1701
1702#[derive(PartialEq, Clone, Debug)]
1703pub enum DeviceAddress {
1704    IntValue(u8),
1705
1706    ArrayIntValue(::std::vec::Vec<u8>),
1707
1708    CharIntValue(::std::string::String),
1709
1710    ArrayCharIntValue(::std::vec::Vec<::std::string::String>),
1711
1712    StringValue(::std::string::String),
1713
1714    UnknownOrdinal_(u64),
1715}
1716
1717impl ::fidl_next::Encodable for DeviceAddress {
1718    type Encoded = WireDeviceAddress<'static>;
1719}
1720
1721unsafe impl<___E> ::fidl_next::Encode<___E> for DeviceAddress
1722where
1723    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1724    ___E: ::fidl_next::Encoder,
1725{
1726    #[inline]
1727    fn encode(
1728        self,
1729        encoder: &mut ___E,
1730        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1731    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1732        ::fidl_next::munge!(let WireDeviceAddress { raw, _phantom: _ } = out);
1733
1734        match self {
1735            Self::IntValue(value) => {
1736                ::fidl_next::RawWireUnion::encode_as::<___E, u8>(value, 1, encoder, raw)?
1737            }
1738
1739            Self::ArrayIntValue(value) => ::fidl_next::RawWireUnion::encode_as::<
1740                ___E,
1741                ::std::vec::Vec<u8>,
1742            >(value, 2, encoder, raw)?,
1743
1744            Self::CharIntValue(value) => ::fidl_next::RawWireUnion::encode_as::<
1745                ___E,
1746                ::std::string::String,
1747            >(value, 3, encoder, raw)?,
1748
1749            Self::ArrayCharIntValue(value) => ::fidl_next::RawWireUnion::encode_as::<
1750                ___E,
1751                ::std::vec::Vec<::std::string::String>,
1752            >(value, 4, encoder, raw)?,
1753
1754            Self::StringValue(value) => ::fidl_next::RawWireUnion::encode_as::<
1755                ___E,
1756                ::std::string::String,
1757            >(value, 5, encoder, raw)?,
1758
1759            Self::UnknownOrdinal_(ordinal) => {
1760                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
1761            }
1762        }
1763
1764        Ok(())
1765    }
1766}
1767
1768unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DeviceAddress
1769where
1770    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1771    ___E: ::fidl_next::Encoder,
1772{
1773    #[inline]
1774    fn encode_ref(
1775        &self,
1776        encoder: &mut ___E,
1777        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1778    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1779        ::fidl_next::munge!(let WireDeviceAddress { raw, _phantom: _ } = out);
1780
1781        match self {
1782            Self::IntValue(value) => {
1783                ::fidl_next::RawWireUnion::encode_as::<___E, &u8>(value, 1, encoder, raw)?
1784            }
1785
1786            Self::ArrayIntValue(value) => ::fidl_next::RawWireUnion::encode_as::<
1787                ___E,
1788                &::std::vec::Vec<u8>,
1789            >(value, 2, encoder, raw)?,
1790
1791            Self::CharIntValue(value) => ::fidl_next::RawWireUnion::encode_as::<
1792                ___E,
1793                &::std::string::String,
1794            >(value, 3, encoder, raw)?,
1795
1796            Self::ArrayCharIntValue(value) => ::fidl_next::RawWireUnion::encode_as::<
1797                ___E,
1798                &::std::vec::Vec<::std::string::String>,
1799            >(value, 4, encoder, raw)?,
1800
1801            Self::StringValue(value) => ::fidl_next::RawWireUnion::encode_as::<
1802                ___E,
1803                &::std::string::String,
1804            >(value, 5, encoder, raw)?,
1805
1806            Self::UnknownOrdinal_(ordinal) => {
1807                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
1808            }
1809        }
1810
1811        Ok(())
1812    }
1813}
1814
1815impl ::fidl_next::EncodableOption for DeviceAddress {
1816    type EncodedOption = WireOptionalDeviceAddress<'static>;
1817}
1818
1819unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DeviceAddress
1820where
1821    ___E: ?Sized,
1822    DeviceAddress: ::fidl_next::Encode<___E>,
1823{
1824    #[inline]
1825    fn encode_option(
1826        this: ::core::option::Option<Self>,
1827        encoder: &mut ___E,
1828        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1829    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1830        ::fidl_next::munge!(let WireOptionalDeviceAddress { raw, _phantom: _ } = &mut *out);
1831
1832        if let Some(inner) = this {
1833            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1834            ::fidl_next::Encode::encode(inner, encoder, value_out)?;
1835        } else {
1836            ::fidl_next::RawWireUnion::encode_absent(raw);
1837        }
1838
1839        Ok(())
1840    }
1841}
1842
1843unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DeviceAddress
1844where
1845    ___E: ?Sized,
1846    DeviceAddress: ::fidl_next::EncodeRef<___E>,
1847{
1848    #[inline]
1849    fn encode_option_ref(
1850        this: ::core::option::Option<&Self>,
1851        encoder: &mut ___E,
1852        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1853    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1854        ::fidl_next::munge!(let WireOptionalDeviceAddress { raw, _phantom: _ } = &mut *out);
1855
1856        if let Some(inner) = this {
1857            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1858            ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
1859        } else {
1860            ::fidl_next::RawWireUnion::encode_absent(raw);
1861        }
1862
1863        Ok(())
1864    }
1865}
1866
1867impl<'de> ::fidl_next::FromWire<WireDeviceAddress<'de>> for DeviceAddress {
1868    #[inline]
1869    fn from_wire(wire: WireDeviceAddress<'de>) -> Self {
1870        let wire = ::core::mem::ManuallyDrop::new(wire);
1871        match wire.raw.ordinal() {
1872            1 => Self::IntValue(::fidl_next::FromWire::from_wire(unsafe {
1873                wire.raw.get().read_unchecked::<u8>()
1874            })),
1875
1876            2 => Self::ArrayIntValue(::fidl_next::FromWire::from_wire(unsafe {
1877                wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>()
1878            })),
1879
1880            3 => Self::CharIntValue(::fidl_next::FromWire::from_wire(unsafe {
1881                wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
1882            })),
1883
1884            4 => {
1885                Self::ArrayCharIntValue(::fidl_next::FromWire::from_wire(unsafe {
1886                    wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
1887                }))
1888            }
1889
1890            5 => Self::StringValue(::fidl_next::FromWire::from_wire(unsafe {
1891                wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
1892            })),
1893
1894            _ => unsafe { ::core::hint::unreachable_unchecked() },
1895        }
1896    }
1897}
1898
1899impl<'de> ::fidl_next::IntoNatural for WireDeviceAddress<'de> {
1900    type Natural = DeviceAddress;
1901}
1902
1903impl<'de> ::fidl_next::FromWireRef<WireDeviceAddress<'de>> for DeviceAddress {
1904    #[inline]
1905    fn from_wire_ref(wire: &WireDeviceAddress<'de>) -> Self {
1906        match wire.raw.ordinal() {
1907            1 => Self::IntValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1908                wire.raw.get().deref_unchecked::<u8>()
1909            })),
1910
1911            2 => Self::ArrayIntValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1912                wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
1913            })),
1914
1915            3 => Self::CharIntValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1916                wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
1917            })),
1918
1919            4 => {
1920                Self::ArrayCharIntValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1921                    wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
1922                }))
1923            }
1924
1925            5 => Self::StringValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1926                wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
1927            })),
1928
1929            _ => unsafe { ::core::hint::unreachable_unchecked() },
1930        }
1931    }
1932}
1933
1934impl<'de> ::fidl_next::FromWireOption<WireOptionalDeviceAddress<'de>> for DeviceAddress {
1935    #[inline]
1936    fn from_wire_option(wire: WireOptionalDeviceAddress<'de>) -> ::core::option::Option<Self> {
1937        if let Some(inner) = wire.into_option() {
1938            Some(::fidl_next::FromWire::from_wire(inner))
1939        } else {
1940            None
1941        }
1942    }
1943}
1944
1945impl<'de> ::fidl_next::IntoNatural for WireOptionalDeviceAddress<'de> {
1946    type Natural = ::core::option::Option<DeviceAddress>;
1947}
1948
1949impl<'de> ::fidl_next::FromWireOption<WireOptionalDeviceAddress<'de>> for Box<DeviceAddress> {
1950    #[inline]
1951    fn from_wire_option(wire: WireOptionalDeviceAddress<'de>) -> ::core::option::Option<Self> {
1952        <
1953            DeviceAddress as ::fidl_next::FromWireOption<WireOptionalDeviceAddress<'de>>
1954        >::from_wire_option(wire).map(Box::new)
1955    }
1956}
1957
1958impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalDeviceAddress<'de>> for Box<DeviceAddress> {
1959    #[inline]
1960    fn from_wire_option_ref(wire: &WireOptionalDeviceAddress<'de>) -> ::core::option::Option<Self> {
1961        if let Some(inner) = wire.as_ref() {
1962            Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
1963        } else {
1964            None
1965        }
1966    }
1967}
1968
1969/// The wire type corresponding to [`DeviceAddress`].
1970#[repr(transparent)]
1971pub struct WireDeviceAddress<'de> {
1972    raw: ::fidl_next::RawWireUnion,
1973    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1974}
1975
1976impl<'de> Drop for WireDeviceAddress<'de> {
1977    fn drop(&mut self) {
1978        match self.raw.ordinal() {
1979            1 => {
1980                let _ = unsafe { self.raw.get().read_unchecked::<u8>() };
1981            }
1982
1983            2 => {
1984                let _ =
1985                    unsafe { self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>() };
1986            }
1987
1988            3 => {
1989                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
1990            }
1991
1992            4 => {
1993                let _ = unsafe {
1994                    self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
1995                };
1996            }
1997
1998            5 => {
1999                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
2000            }
2001
2002            _ => (),
2003        }
2004    }
2005}
2006
2007unsafe impl ::fidl_next::Wire for WireDeviceAddress<'static> {
2008    type Decoded<'de> = WireDeviceAddress<'de>;
2009
2010    #[inline]
2011    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2012        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
2013        ::fidl_next::RawWireUnion::zero_padding(raw);
2014    }
2015}
2016
2017pub mod device_address {
2018    pub enum Ref<'de> {
2019        IntValue(&'de u8),
2020
2021        ArrayIntValue(&'de ::fidl_next::WireVector<'de, u8>),
2022
2023        CharIntValue(&'de ::fidl_next::WireString<'de>),
2024
2025        ArrayCharIntValue(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>),
2026
2027        StringValue(&'de ::fidl_next::WireString<'de>),
2028
2029        UnknownOrdinal_(u64),
2030    }
2031}
2032
2033impl<'de> WireDeviceAddress<'de> {
2034    pub fn as_ref(&self) -> crate::device_address::Ref<'_> {
2035        match self.raw.ordinal() {
2036            1 => crate::device_address::Ref::IntValue(unsafe {
2037                self.raw.get().deref_unchecked::<u8>()
2038            }),
2039
2040            2 => crate::device_address::Ref::ArrayIntValue(unsafe {
2041                self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
2042            }),
2043
2044            3 => crate::device_address::Ref::CharIntValue(unsafe {
2045                self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
2046            }),
2047
2048            4 => {
2049                crate::device_address::Ref::ArrayCharIntValue(unsafe {
2050                    self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireString<'_>>>()
2051                })
2052            }
2053
2054            5 => crate::device_address::Ref::StringValue(unsafe {
2055                self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
2056            }),
2057
2058            unknown => crate::device_address::Ref::UnknownOrdinal_(unknown),
2059        }
2060    }
2061}
2062
2063unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeviceAddress<'static>
2064where
2065    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2066    ___D: ::fidl_next::Decoder,
2067{
2068    fn decode(
2069        mut slot: ::fidl_next::Slot<'_, Self>,
2070        decoder: &mut ___D,
2071    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2072        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
2073        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
2074            1 => ::fidl_next::RawWireUnion::decode_as::<___D, u8>(raw, decoder)?,
2075
2076            2 => {
2077                ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
2078                    raw, decoder,
2079                )?
2080            }
2081
2082            3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
2083                raw, decoder,
2084            )?,
2085
2086            4 => ::fidl_next::RawWireUnion::decode_as::<
2087                ___D,
2088                ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
2089            >(raw, decoder)?,
2090
2091            5 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
2092                raw, decoder,
2093            )?,
2094
2095            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
2096        }
2097
2098        Ok(())
2099    }
2100}
2101
2102impl<'de> ::core::fmt::Debug for WireDeviceAddress<'de> {
2103    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2104        match self.raw.ordinal() {
2105            1 => unsafe { self.raw.get().deref_unchecked::<u8>().fmt(f) },
2106            2 => unsafe {
2107                self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>().fmt(f)
2108            },
2109            3 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f) },
2110            4 => unsafe {
2111                self.raw
2112                    .get()
2113                    .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireString<'_>>>()
2114                    .fmt(f)
2115            },
2116            5 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f) },
2117            _ => unsafe { ::core::hint::unreachable_unchecked() },
2118        }
2119    }
2120}
2121
2122#[repr(transparent)]
2123pub struct WireOptionalDeviceAddress<'de> {
2124    raw: ::fidl_next::RawWireUnion,
2125    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
2126}
2127
2128unsafe impl ::fidl_next::Wire for WireOptionalDeviceAddress<'static> {
2129    type Decoded<'de> = WireOptionalDeviceAddress<'de>;
2130
2131    #[inline]
2132    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2133        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
2134        ::fidl_next::RawWireUnion::zero_padding(raw);
2135    }
2136}
2137
2138impl<'de> WireOptionalDeviceAddress<'de> {
2139    pub fn is_some(&self) -> bool {
2140        self.raw.is_some()
2141    }
2142
2143    pub fn is_none(&self) -> bool {
2144        self.raw.is_none()
2145    }
2146
2147    pub fn as_ref(&self) -> ::core::option::Option<&WireDeviceAddress<'de>> {
2148        if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
2149    }
2150
2151    pub fn into_option(self) -> ::core::option::Option<WireDeviceAddress<'de>> {
2152        if self.is_some() {
2153            Some(WireDeviceAddress { raw: self.raw, _phantom: ::core::marker::PhantomData })
2154        } else {
2155            None
2156        }
2157    }
2158}
2159
2160unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDeviceAddress<'static>
2161where
2162    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2163    ___D: ::fidl_next::Decoder,
2164{
2165    fn decode(
2166        mut slot: ::fidl_next::Slot<'_, Self>,
2167        decoder: &mut ___D,
2168    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2169        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
2170        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
2171            1 => ::fidl_next::RawWireUnion::decode_as::<___D, u8>(raw, decoder)?,
2172
2173            2 => {
2174                ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
2175                    raw, decoder,
2176                )?
2177            }
2178
2179            3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
2180                raw, decoder,
2181            )?,
2182
2183            4 => ::fidl_next::RawWireUnion::decode_as::<
2184                ___D,
2185                ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
2186            >(raw, decoder)?,
2187
2188            5 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
2189                raw, decoder,
2190            )?,
2191
2192            0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
2193            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
2194        }
2195
2196        Ok(())
2197    }
2198}
2199
2200impl<'de> ::core::fmt::Debug for WireOptionalDeviceAddress<'de> {
2201    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2202        self.as_ref().fmt(f)
2203    }
2204}
2205
2206#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2207#[repr(u32)]
2208pub enum DeviceAddressStability {
2209    UnstableBetweenDriverRestart = 0,
2210    UnstableBetweenBoot = 1,
2211    UnstableBetweenSoftwareUpdate = 2,
2212    Stable = 3,
2213    UnknownOrdinal_(u32) = 4,
2214}
2215
2216impl ::fidl_next::Encodable for DeviceAddressStability {
2217    type Encoded = WireDeviceAddressStability;
2218}
2219impl ::std::convert::From<u32> for DeviceAddressStability {
2220    fn from(value: u32) -> Self {
2221        match value {
2222            0 => Self::UnstableBetweenDriverRestart,
2223            1 => Self::UnstableBetweenBoot,
2224            2 => Self::UnstableBetweenSoftwareUpdate,
2225            3 => Self::Stable,
2226
2227            _ => Self::UnknownOrdinal_(value),
2228        }
2229    }
2230}
2231
2232unsafe impl<___E> ::fidl_next::Encode<___E> for DeviceAddressStability
2233where
2234    ___E: ?Sized,
2235{
2236    #[inline]
2237    fn encode(
2238        self,
2239        encoder: &mut ___E,
2240        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2241    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2242        ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
2243    }
2244}
2245
2246unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DeviceAddressStability
2247where
2248    ___E: ?Sized,
2249{
2250    #[inline]
2251    fn encode_ref(
2252        &self,
2253        encoder: &mut ___E,
2254        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2255    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2256        ::fidl_next::munge!(let WireDeviceAddressStability { value } = out);
2257        let _ = value.write(::fidl_next::WireU32::from(match *self {
2258            Self::UnstableBetweenDriverRestart => 0,
2259
2260            Self::UnstableBetweenBoot => 1,
2261
2262            Self::UnstableBetweenSoftwareUpdate => 2,
2263
2264            Self::Stable => 3,
2265
2266            Self::UnknownOrdinal_(value) => value,
2267        }));
2268
2269        Ok(())
2270    }
2271}
2272
2273impl ::core::convert::From<WireDeviceAddressStability> for DeviceAddressStability {
2274    fn from(wire: WireDeviceAddressStability) -> Self {
2275        match u32::from(wire.value) {
2276            0 => Self::UnstableBetweenDriverRestart,
2277
2278            1 => Self::UnstableBetweenBoot,
2279
2280            2 => Self::UnstableBetweenSoftwareUpdate,
2281
2282            3 => Self::Stable,
2283
2284            value => Self::UnknownOrdinal_(value),
2285        }
2286    }
2287}
2288
2289impl ::fidl_next::FromWire<WireDeviceAddressStability> for DeviceAddressStability {
2290    #[inline]
2291    fn from_wire(wire: WireDeviceAddressStability) -> Self {
2292        Self::from(wire)
2293    }
2294}
2295
2296impl ::fidl_next::IntoNatural for WireDeviceAddressStability {
2297    type Natural = DeviceAddressStability;
2298}
2299
2300impl ::fidl_next::FromWireRef<WireDeviceAddressStability> for DeviceAddressStability {
2301    #[inline]
2302    fn from_wire_ref(wire: &WireDeviceAddressStability) -> Self {
2303        Self::from(*wire)
2304    }
2305}
2306
2307/// The wire type corresponding to [`DeviceAddressStability`].
2308#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2309#[repr(transparent)]
2310pub struct WireDeviceAddressStability {
2311    value: ::fidl_next::WireU32,
2312}
2313
2314unsafe impl ::fidl_next::Wire for WireDeviceAddressStability {
2315    type Decoded<'de> = Self;
2316
2317    #[inline]
2318    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2319        // Wire enums have no padding
2320    }
2321}
2322
2323impl WireDeviceAddressStability {
2324    pub const UNSTABLE_BETWEEN_DRIVER_RESTART: WireDeviceAddressStability =
2325        WireDeviceAddressStability { value: ::fidl_next::WireU32(0) };
2326
2327    pub const UNSTABLE_BETWEEN_BOOT: WireDeviceAddressStability =
2328        WireDeviceAddressStability { value: ::fidl_next::WireU32(1) };
2329
2330    pub const UNSTABLE_BETWEEN_SOFTWARE_UPDATE: WireDeviceAddressStability =
2331        WireDeviceAddressStability { value: ::fidl_next::WireU32(2) };
2332
2333    pub const STABLE: WireDeviceAddressStability =
2334        WireDeviceAddressStability { value: ::fidl_next::WireU32(3) };
2335}
2336
2337unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeviceAddressStability
2338where
2339    ___D: ?Sized,
2340{
2341    fn decode(
2342        slot: ::fidl_next::Slot<'_, Self>,
2343        _: &mut ___D,
2344    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2345        Ok(())
2346    }
2347}
2348
2349impl ::core::convert::From<DeviceAddressStability> for WireDeviceAddressStability {
2350    fn from(natural: DeviceAddressStability) -> Self {
2351        match natural {
2352            DeviceAddressStability::UnstableBetweenDriverRestart => {
2353                WireDeviceAddressStability::UNSTABLE_BETWEEN_DRIVER_RESTART
2354            }
2355
2356            DeviceAddressStability::UnstableBetweenBoot => {
2357                WireDeviceAddressStability::UNSTABLE_BETWEEN_BOOT
2358            }
2359
2360            DeviceAddressStability::UnstableBetweenSoftwareUpdate => {
2361                WireDeviceAddressStability::UNSTABLE_BETWEEN_SOFTWARE_UPDATE
2362            }
2363
2364            DeviceAddressStability::Stable => WireDeviceAddressStability::STABLE,
2365
2366            DeviceAddressStability::UnknownOrdinal_(value) => {
2367                WireDeviceAddressStability { value: ::fidl_next::WireU32::from(value) }
2368            }
2369        }
2370    }
2371}
2372
2373#[derive(PartialEq, Clone, Debug, Default)]
2374pub struct BusInfo {
2375    pub bus: ::core::option::Option<crate::BusType>,
2376
2377    pub address: ::core::option::Option<crate::DeviceAddress>,
2378
2379    pub address_stability: ::core::option::Option<crate::DeviceAddressStability>,
2380}
2381
2382impl BusInfo {
2383    fn __max_ordinal(&self) -> usize {
2384        if self.address_stability.is_some() {
2385            return 3;
2386        }
2387
2388        if self.address.is_some() {
2389            return 2;
2390        }
2391
2392        if self.bus.is_some() {
2393            return 1;
2394        }
2395
2396        0
2397    }
2398}
2399
2400impl ::fidl_next::Encodable for BusInfo {
2401    type Encoded = WireBusInfo<'static>;
2402}
2403
2404unsafe impl<___E> ::fidl_next::Encode<___E> for BusInfo
2405where
2406    ___E: ::fidl_next::Encoder + ?Sized,
2407{
2408    #[inline]
2409    fn encode(
2410        mut self,
2411        encoder: &mut ___E,
2412        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2413    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2414        ::fidl_next::munge!(let WireBusInfo { table } = out);
2415
2416        let max_ord = self.__max_ordinal();
2417
2418        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2419        ::fidl_next::Wire::zero_padding(&mut out);
2420
2421        let mut preallocated =
2422            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2423
2424        for i in 1..=max_ord {
2425            match i {
2426                3 => {
2427                    if let Some(value) = self.address_stability.take() {
2428                        ::fidl_next::WireEnvelope::encode_value(
2429                            value,
2430                            preallocated.encoder,
2431                            &mut out,
2432                        )?;
2433                    } else {
2434                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2435                    }
2436                }
2437
2438                2 => {
2439                    if let Some(value) = self.address.take() {
2440                        ::fidl_next::WireEnvelope::encode_value(
2441                            value,
2442                            preallocated.encoder,
2443                            &mut out,
2444                        )?;
2445                    } else {
2446                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2447                    }
2448                }
2449
2450                1 => {
2451                    if let Some(value) = self.bus.take() {
2452                        ::fidl_next::WireEnvelope::encode_value(
2453                            value,
2454                            preallocated.encoder,
2455                            &mut out,
2456                        )?;
2457                    } else {
2458                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2459                    }
2460                }
2461
2462                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2463            }
2464            unsafe {
2465                preallocated.write_next(out.assume_init_ref());
2466            }
2467        }
2468
2469        ::fidl_next::WireTable::encode_len(table, max_ord);
2470
2471        Ok(())
2472    }
2473}
2474
2475unsafe impl<___E> ::fidl_next::EncodeRef<___E> for BusInfo
2476where
2477    ___E: ::fidl_next::Encoder + ?Sized,
2478{
2479    #[inline]
2480    fn encode_ref(
2481        &self,
2482        encoder: &mut ___E,
2483        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2484    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2485        ::fidl_next::munge!(let WireBusInfo { table } = out);
2486
2487        let max_ord = self.__max_ordinal();
2488
2489        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2490        ::fidl_next::Wire::zero_padding(&mut out);
2491
2492        let mut preallocated =
2493            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2494
2495        for i in 1..=max_ord {
2496            match i {
2497                3 => {
2498                    if let Some(value) = &self.address_stability {
2499                        ::fidl_next::WireEnvelope::encode_value(
2500                            value,
2501                            preallocated.encoder,
2502                            &mut out,
2503                        )?;
2504                    } else {
2505                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2506                    }
2507                }
2508
2509                2 => {
2510                    if let Some(value) = &self.address {
2511                        ::fidl_next::WireEnvelope::encode_value(
2512                            value,
2513                            preallocated.encoder,
2514                            &mut out,
2515                        )?;
2516                    } else {
2517                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2518                    }
2519                }
2520
2521                1 => {
2522                    if let Some(value) = &self.bus {
2523                        ::fidl_next::WireEnvelope::encode_value(
2524                            value,
2525                            preallocated.encoder,
2526                            &mut out,
2527                        )?;
2528                    } else {
2529                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2530                    }
2531                }
2532
2533                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2534            }
2535            unsafe {
2536                preallocated.write_next(out.assume_init_ref());
2537            }
2538        }
2539
2540        ::fidl_next::WireTable::encode_len(table, max_ord);
2541
2542        Ok(())
2543    }
2544}
2545
2546impl<'de> ::fidl_next::FromWire<WireBusInfo<'de>> for BusInfo {
2547    #[inline]
2548    fn from_wire(wire_: WireBusInfo<'de>) -> Self {
2549        let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2550
2551        let bus = wire_.table.get(1);
2552
2553        let address = wire_.table.get(2);
2554
2555        let address_stability = wire_.table.get(3);
2556
2557        Self {
2558            bus: bus.map(|envelope| {
2559                ::fidl_next::FromWire::from_wire(unsafe {
2560                    envelope.read_unchecked::<crate::WireBusType>()
2561                })
2562            }),
2563
2564            address: address.map(|envelope| {
2565                ::fidl_next::FromWire::from_wire(unsafe {
2566                    envelope.read_unchecked::<crate::WireDeviceAddress<'de>>()
2567                })
2568            }),
2569
2570            address_stability: address_stability.map(|envelope| {
2571                ::fidl_next::FromWire::from_wire(unsafe {
2572                    envelope.read_unchecked::<crate::WireDeviceAddressStability>()
2573                })
2574            }),
2575        }
2576    }
2577}
2578
2579impl<'de> ::fidl_next::IntoNatural for WireBusInfo<'de> {
2580    type Natural = BusInfo;
2581}
2582
2583impl<'de> ::fidl_next::FromWireRef<WireBusInfo<'de>> for BusInfo {
2584    #[inline]
2585    fn from_wire_ref(wire: &WireBusInfo<'de>) -> Self {
2586        Self {
2587            bus: wire.table.get(1).map(|envelope| {
2588                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2589                    envelope.deref_unchecked::<crate::WireBusType>()
2590                })
2591            }),
2592
2593            address: wire.table.get(2).map(|envelope| {
2594                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2595                    envelope.deref_unchecked::<crate::WireDeviceAddress<'de>>()
2596                })
2597            }),
2598
2599            address_stability: wire.table.get(3).map(|envelope| {
2600                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2601                    envelope.deref_unchecked::<crate::WireDeviceAddressStability>()
2602                })
2603            }),
2604        }
2605    }
2606}
2607
2608/// The wire type corresponding to [`BusInfo`].
2609#[repr(C)]
2610pub struct WireBusInfo<'de> {
2611    table: ::fidl_next::WireTable<'de>,
2612}
2613
2614impl<'de> Drop for WireBusInfo<'de> {
2615    fn drop(&mut self) {
2616        let _ = self
2617            .table
2618            .get(1)
2619            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireBusType>() });
2620
2621        let _ = self
2622            .table
2623            .get(2)
2624            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDeviceAddress<'de>>() });
2625
2626        let _ = self.table.get(3).map(|envelope| unsafe {
2627            envelope.read_unchecked::<crate::WireDeviceAddressStability>()
2628        });
2629    }
2630}
2631
2632unsafe impl ::fidl_next::Wire for WireBusInfo<'static> {
2633    type Decoded<'de> = WireBusInfo<'de>;
2634
2635    #[inline]
2636    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2637        ::fidl_next::munge!(let Self { table } = out);
2638        ::fidl_next::WireTable::zero_padding(table);
2639    }
2640}
2641
2642unsafe impl<___D> ::fidl_next::Decode<___D> for WireBusInfo<'static>
2643where
2644    ___D: ::fidl_next::Decoder + ?Sized,
2645{
2646    fn decode(
2647        slot: ::fidl_next::Slot<'_, Self>,
2648        decoder: &mut ___D,
2649    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2650        ::fidl_next::munge!(let Self { table } = slot);
2651
2652        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2653            match ordinal {
2654                0 => unsafe { ::core::hint::unreachable_unchecked() },
2655
2656                1 => {
2657                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireBusType>(
2658                        slot.as_mut(),
2659                        decoder,
2660                    )?;
2661
2662                    Ok(())
2663                }
2664
2665                2 => {
2666                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDeviceAddress<'static>>(
2667                        slot.as_mut(),
2668                        decoder,
2669                    )?;
2670
2671                    Ok(())
2672                }
2673
2674                3 => {
2675                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDeviceAddressStability>(
2676                        slot.as_mut(),
2677                        decoder,
2678                    )?;
2679
2680                    Ok(())
2681                }
2682
2683                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2684            }
2685        })
2686    }
2687}
2688
2689impl<'de> WireBusInfo<'de> {
2690    pub fn bus(&self) -> ::core::option::Option<&crate::WireBusType> {
2691        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2692    }
2693
2694    pub fn address(&self) -> ::core::option::Option<&crate::WireDeviceAddress<'de>> {
2695        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2696    }
2697
2698    pub fn address_stability(&self) -> ::core::option::Option<&crate::WireDeviceAddressStability> {
2699        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2700    }
2701}
2702
2703impl<'de> ::core::fmt::Debug for WireBusInfo<'de> {
2704    fn fmt(
2705        &self,
2706        f: &mut ::core::fmt::Formatter<'_>,
2707    ) -> ::core::result::Result<(), ::core::fmt::Error> {
2708        f.debug_struct("BusInfo")
2709            .field("bus", &self.bus())
2710            .field("address", &self.address())
2711            .field("address_stability", &self.address_stability())
2712            .finish()
2713    }
2714}
2715
2716#[doc = " The type of Fuchsia package that a driver component is inside of.\n More details about the various package categories are available at:\n https://fuchsia.dev/fuchsia-src/concepts/packages/package#types_of_packages\n"]
2717#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2718#[repr(u8)]
2719pub enum DriverPackageType {
2720    Boot = 0,
2721    Base = 1,
2722    Cached = 2,
2723    Universe = 3,
2724    UnknownOrdinal_(u8) = 4,
2725}
2726
2727impl ::fidl_next::Encodable for DriverPackageType {
2728    type Encoded = WireDriverPackageType;
2729}
2730impl ::std::convert::From<u8> for DriverPackageType {
2731    fn from(value: u8) -> Self {
2732        match value {
2733            0 => Self::Boot,
2734            1 => Self::Base,
2735            2 => Self::Cached,
2736            3 => Self::Universe,
2737
2738            _ => Self::UnknownOrdinal_(value),
2739        }
2740    }
2741}
2742
2743unsafe impl<___E> ::fidl_next::Encode<___E> for DriverPackageType
2744where
2745    ___E: ?Sized,
2746{
2747    #[inline]
2748    fn encode(
2749        self,
2750        encoder: &mut ___E,
2751        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2752    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2753        ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
2754    }
2755}
2756
2757unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DriverPackageType
2758where
2759    ___E: ?Sized,
2760{
2761    #[inline]
2762    fn encode_ref(
2763        &self,
2764        encoder: &mut ___E,
2765        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2766    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2767        ::fidl_next::munge!(let WireDriverPackageType { value } = out);
2768        let _ = value.write(u8::from(match *self {
2769            Self::Boot => 0,
2770
2771            Self::Base => 1,
2772
2773            Self::Cached => 2,
2774
2775            Self::Universe => 3,
2776
2777            Self::UnknownOrdinal_(value) => value,
2778        }));
2779
2780        Ok(())
2781    }
2782}
2783
2784impl ::core::convert::From<WireDriverPackageType> for DriverPackageType {
2785    fn from(wire: WireDriverPackageType) -> Self {
2786        match u8::from(wire.value) {
2787            0 => Self::Boot,
2788
2789            1 => Self::Base,
2790
2791            2 => Self::Cached,
2792
2793            3 => Self::Universe,
2794
2795            value => Self::UnknownOrdinal_(value),
2796        }
2797    }
2798}
2799
2800impl ::fidl_next::FromWire<WireDriverPackageType> for DriverPackageType {
2801    #[inline]
2802    fn from_wire(wire: WireDriverPackageType) -> Self {
2803        Self::from(wire)
2804    }
2805}
2806
2807impl ::fidl_next::IntoNatural for WireDriverPackageType {
2808    type Natural = DriverPackageType;
2809}
2810
2811impl ::fidl_next::FromWireRef<WireDriverPackageType> for DriverPackageType {
2812    #[inline]
2813    fn from_wire_ref(wire: &WireDriverPackageType) -> Self {
2814        Self::from(*wire)
2815    }
2816}
2817
2818/// The wire type corresponding to [`DriverPackageType`].
2819#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2820#[repr(transparent)]
2821pub struct WireDriverPackageType {
2822    value: u8,
2823}
2824
2825unsafe impl ::fidl_next::Wire for WireDriverPackageType {
2826    type Decoded<'de> = Self;
2827
2828    #[inline]
2829    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2830        // Wire enums have no padding
2831    }
2832}
2833
2834impl WireDriverPackageType {
2835    pub const BOOT: WireDriverPackageType = WireDriverPackageType { value: 0 };
2836
2837    pub const BASE: WireDriverPackageType = WireDriverPackageType { value: 1 };
2838
2839    pub const CACHED: WireDriverPackageType = WireDriverPackageType { value: 2 };
2840
2841    pub const UNIVERSE: WireDriverPackageType = WireDriverPackageType { value: 3 };
2842}
2843
2844unsafe impl<___D> ::fidl_next::Decode<___D> for WireDriverPackageType
2845where
2846    ___D: ?Sized,
2847{
2848    fn decode(
2849        slot: ::fidl_next::Slot<'_, Self>,
2850        _: &mut ___D,
2851    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2852        Ok(())
2853    }
2854}
2855
2856impl ::core::convert::From<DriverPackageType> for WireDriverPackageType {
2857    fn from(natural: DriverPackageType) -> Self {
2858        match natural {
2859            DriverPackageType::Boot => WireDriverPackageType::BOOT,
2860
2861            DriverPackageType::Base => WireDriverPackageType::BASE,
2862
2863            DriverPackageType::Cached => WireDriverPackageType::CACHED,
2864
2865            DriverPackageType::Universe => WireDriverPackageType::UNIVERSE,
2866
2867            DriverPackageType::UnknownOrdinal_(value) => {
2868                WireDriverPackageType { value: u8::from(value) }
2869            }
2870        }
2871    }
2872}
2873
2874#[doc = " Device categories as provided in the driver\'s component manifest.\n"]
2875#[derive(PartialEq, Clone, Debug, Default)]
2876pub struct DeviceCategory {
2877    pub category: ::core::option::Option<::std::string::String>,
2878
2879    pub subcategory: ::core::option::Option<::std::string::String>,
2880}
2881
2882impl DeviceCategory {
2883    fn __max_ordinal(&self) -> usize {
2884        if self.subcategory.is_some() {
2885            return 2;
2886        }
2887
2888        if self.category.is_some() {
2889            return 1;
2890        }
2891
2892        0
2893    }
2894}
2895
2896impl ::fidl_next::Encodable for DeviceCategory {
2897    type Encoded = WireDeviceCategory<'static>;
2898}
2899
2900unsafe impl<___E> ::fidl_next::Encode<___E> for DeviceCategory
2901where
2902    ___E: ::fidl_next::Encoder + ?Sized,
2903{
2904    #[inline]
2905    fn encode(
2906        mut self,
2907        encoder: &mut ___E,
2908        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2909    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2910        ::fidl_next::munge!(let WireDeviceCategory { table } = out);
2911
2912        let max_ord = self.__max_ordinal();
2913
2914        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2915        ::fidl_next::Wire::zero_padding(&mut out);
2916
2917        let mut preallocated =
2918            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2919
2920        for i in 1..=max_ord {
2921            match i {
2922                2 => {
2923                    if let Some(value) = self.subcategory.take() {
2924                        ::fidl_next::WireEnvelope::encode_value(
2925                            value,
2926                            preallocated.encoder,
2927                            &mut out,
2928                        )?;
2929                    } else {
2930                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2931                    }
2932                }
2933
2934                1 => {
2935                    if let Some(value) = self.category.take() {
2936                        ::fidl_next::WireEnvelope::encode_value(
2937                            value,
2938                            preallocated.encoder,
2939                            &mut out,
2940                        )?;
2941                    } else {
2942                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2943                    }
2944                }
2945
2946                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2947            }
2948            unsafe {
2949                preallocated.write_next(out.assume_init_ref());
2950            }
2951        }
2952
2953        ::fidl_next::WireTable::encode_len(table, max_ord);
2954
2955        Ok(())
2956    }
2957}
2958
2959unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DeviceCategory
2960where
2961    ___E: ::fidl_next::Encoder + ?Sized,
2962{
2963    #[inline]
2964    fn encode_ref(
2965        &self,
2966        encoder: &mut ___E,
2967        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2968    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2969        ::fidl_next::munge!(let WireDeviceCategory { table } = out);
2970
2971        let max_ord = self.__max_ordinal();
2972
2973        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2974        ::fidl_next::Wire::zero_padding(&mut out);
2975
2976        let mut preallocated =
2977            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2978
2979        for i in 1..=max_ord {
2980            match i {
2981                2 => {
2982                    if let Some(value) = &self.subcategory {
2983                        ::fidl_next::WireEnvelope::encode_value(
2984                            value,
2985                            preallocated.encoder,
2986                            &mut out,
2987                        )?;
2988                    } else {
2989                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2990                    }
2991                }
2992
2993                1 => {
2994                    if let Some(value) = &self.category {
2995                        ::fidl_next::WireEnvelope::encode_value(
2996                            value,
2997                            preallocated.encoder,
2998                            &mut out,
2999                        )?;
3000                    } else {
3001                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3002                    }
3003                }
3004
3005                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3006            }
3007            unsafe {
3008                preallocated.write_next(out.assume_init_ref());
3009            }
3010        }
3011
3012        ::fidl_next::WireTable::encode_len(table, max_ord);
3013
3014        Ok(())
3015    }
3016}
3017
3018impl<'de> ::fidl_next::FromWire<WireDeviceCategory<'de>> for DeviceCategory {
3019    #[inline]
3020    fn from_wire(wire_: WireDeviceCategory<'de>) -> Self {
3021        let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3022
3023        let category = wire_.table.get(1);
3024
3025        let subcategory = wire_.table.get(2);
3026
3027        Self {
3028            category: category.map(|envelope| {
3029                ::fidl_next::FromWire::from_wire(unsafe {
3030                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
3031                })
3032            }),
3033
3034            subcategory: subcategory.map(|envelope| {
3035                ::fidl_next::FromWire::from_wire(unsafe {
3036                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
3037                })
3038            }),
3039        }
3040    }
3041}
3042
3043impl<'de> ::fidl_next::IntoNatural for WireDeviceCategory<'de> {
3044    type Natural = DeviceCategory;
3045}
3046
3047impl<'de> ::fidl_next::FromWireRef<WireDeviceCategory<'de>> for DeviceCategory {
3048    #[inline]
3049    fn from_wire_ref(wire: &WireDeviceCategory<'de>) -> Self {
3050        Self {
3051            category: wire.table.get(1).map(|envelope| {
3052                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3053                    envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
3054                })
3055            }),
3056
3057            subcategory: wire.table.get(2).map(|envelope| {
3058                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3059                    envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
3060                })
3061            }),
3062        }
3063    }
3064}
3065
3066/// The wire type corresponding to [`DeviceCategory`].
3067#[repr(C)]
3068pub struct WireDeviceCategory<'de> {
3069    table: ::fidl_next::WireTable<'de>,
3070}
3071
3072impl<'de> Drop for WireDeviceCategory<'de> {
3073    fn drop(&mut self) {
3074        let _ = self
3075            .table
3076            .get(1)
3077            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
3078
3079        let _ = self
3080            .table
3081            .get(2)
3082            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
3083    }
3084}
3085
3086unsafe impl ::fidl_next::Wire for WireDeviceCategory<'static> {
3087    type Decoded<'de> = WireDeviceCategory<'de>;
3088
3089    #[inline]
3090    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3091        ::fidl_next::munge!(let Self { table } = out);
3092        ::fidl_next::WireTable::zero_padding(table);
3093    }
3094}
3095
3096unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeviceCategory<'static>
3097where
3098    ___D: ::fidl_next::Decoder + ?Sized,
3099{
3100    fn decode(
3101        slot: ::fidl_next::Slot<'_, Self>,
3102        decoder: &mut ___D,
3103    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3104        ::fidl_next::munge!(let Self { table } = slot);
3105
3106        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3107            match ordinal {
3108                0 => unsafe { ::core::hint::unreachable_unchecked() },
3109
3110                1 => {
3111                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
3112                        slot.as_mut(),
3113                        decoder,
3114                    )?;
3115
3116                    Ok(())
3117                }
3118
3119                2 => {
3120                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
3121                        slot.as_mut(),
3122                        decoder,
3123                    )?;
3124
3125                    Ok(())
3126                }
3127
3128                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3129            }
3130        })
3131    }
3132}
3133
3134impl<'de> WireDeviceCategory<'de> {
3135    pub fn category(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
3136        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3137    }
3138
3139    pub fn subcategory(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
3140        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3141    }
3142}
3143
3144impl<'de> ::core::fmt::Debug for WireDeviceCategory<'de> {
3145    fn fmt(
3146        &self,
3147        f: &mut ::core::fmt::Formatter<'_>,
3148    ) -> ::core::result::Result<(), ::core::fmt::Error> {
3149        f.debug_struct("DeviceCategory")
3150            .field("category", &self.category())
3151            .field("subcategory", &self.subcategory())
3152            .finish()
3153    }
3154}
3155
3156#[doc = " General information for a driver, used with both composite and normal drivers.\n"]
3157#[derive(PartialEq, Clone, Debug, Default)]
3158pub struct DriverInfo {
3159    pub url: ::core::option::Option<::std::string::String>,
3160
3161    pub name: ::core::option::Option<::std::string::String>,
3162
3163    pub colocate: ::core::option::Option<bool>,
3164
3165    pub package_type: ::core::option::Option<crate::DriverPackageType>,
3166
3167    pub is_fallback: ::core::option::Option<bool>,
3168
3169    pub device_categories: ::core::option::Option<::std::vec::Vec<crate::DeviceCategory>>,
3170
3171    pub bind_rules_bytecode: ::core::option::Option<::std::vec::Vec<u8>>,
3172
3173    pub driver_framework_version: ::core::option::Option<u8>,
3174
3175    pub is_disabled: ::core::option::Option<bool>,
3176}
3177
3178impl DriverInfo {
3179    fn __max_ordinal(&self) -> usize {
3180        if self.is_disabled.is_some() {
3181            return 9;
3182        }
3183
3184        if self.driver_framework_version.is_some() {
3185            return 8;
3186        }
3187
3188        if self.bind_rules_bytecode.is_some() {
3189            return 7;
3190        }
3191
3192        if self.device_categories.is_some() {
3193            return 6;
3194        }
3195
3196        if self.is_fallback.is_some() {
3197            return 5;
3198        }
3199
3200        if self.package_type.is_some() {
3201            return 4;
3202        }
3203
3204        if self.colocate.is_some() {
3205            return 3;
3206        }
3207
3208        if self.name.is_some() {
3209            return 2;
3210        }
3211
3212        if self.url.is_some() {
3213            return 1;
3214        }
3215
3216        0
3217    }
3218}
3219
3220impl ::fidl_next::Encodable for DriverInfo {
3221    type Encoded = WireDriverInfo<'static>;
3222}
3223
3224unsafe impl<___E> ::fidl_next::Encode<___E> for DriverInfo
3225where
3226    ___E: ::fidl_next::Encoder + ?Sized,
3227{
3228    #[inline]
3229    fn encode(
3230        mut self,
3231        encoder: &mut ___E,
3232        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3233    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3234        ::fidl_next::munge!(let WireDriverInfo { table } = out);
3235
3236        let max_ord = self.__max_ordinal();
3237
3238        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3239        ::fidl_next::Wire::zero_padding(&mut out);
3240
3241        let mut preallocated =
3242            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3243
3244        for i in 1..=max_ord {
3245            match i {
3246                9 => {
3247                    if let Some(value) = self.is_disabled.take() {
3248                        ::fidl_next::WireEnvelope::encode_value(
3249                            value,
3250                            preallocated.encoder,
3251                            &mut out,
3252                        )?;
3253                    } else {
3254                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3255                    }
3256                }
3257
3258                8 => {
3259                    if let Some(value) = self.driver_framework_version.take() {
3260                        ::fidl_next::WireEnvelope::encode_value(
3261                            value,
3262                            preallocated.encoder,
3263                            &mut out,
3264                        )?;
3265                    } else {
3266                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3267                    }
3268                }
3269
3270                7 => {
3271                    if let Some(value) = self.bind_rules_bytecode.take() {
3272                        ::fidl_next::WireEnvelope::encode_value(
3273                            value,
3274                            preallocated.encoder,
3275                            &mut out,
3276                        )?;
3277                    } else {
3278                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3279                    }
3280                }
3281
3282                6 => {
3283                    if let Some(value) = self.device_categories.take() {
3284                        ::fidl_next::WireEnvelope::encode_value(
3285                            value,
3286                            preallocated.encoder,
3287                            &mut out,
3288                        )?;
3289                    } else {
3290                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3291                    }
3292                }
3293
3294                5 => {
3295                    if let Some(value) = self.is_fallback.take() {
3296                        ::fidl_next::WireEnvelope::encode_value(
3297                            value,
3298                            preallocated.encoder,
3299                            &mut out,
3300                        )?;
3301                    } else {
3302                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3303                    }
3304                }
3305
3306                4 => {
3307                    if let Some(value) = self.package_type.take() {
3308                        ::fidl_next::WireEnvelope::encode_value(
3309                            value,
3310                            preallocated.encoder,
3311                            &mut out,
3312                        )?;
3313                    } else {
3314                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3315                    }
3316                }
3317
3318                3 => {
3319                    if let Some(value) = self.colocate.take() {
3320                        ::fidl_next::WireEnvelope::encode_value(
3321                            value,
3322                            preallocated.encoder,
3323                            &mut out,
3324                        )?;
3325                    } else {
3326                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3327                    }
3328                }
3329
3330                2 => {
3331                    if let Some(value) = self.name.take() {
3332                        ::fidl_next::WireEnvelope::encode_value(
3333                            value,
3334                            preallocated.encoder,
3335                            &mut out,
3336                        )?;
3337                    } else {
3338                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3339                    }
3340                }
3341
3342                1 => {
3343                    if let Some(value) = self.url.take() {
3344                        ::fidl_next::WireEnvelope::encode_value(
3345                            value,
3346                            preallocated.encoder,
3347                            &mut out,
3348                        )?;
3349                    } else {
3350                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3351                    }
3352                }
3353
3354                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3355            }
3356            unsafe {
3357                preallocated.write_next(out.assume_init_ref());
3358            }
3359        }
3360
3361        ::fidl_next::WireTable::encode_len(table, max_ord);
3362
3363        Ok(())
3364    }
3365}
3366
3367unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DriverInfo
3368where
3369    ___E: ::fidl_next::Encoder + ?Sized,
3370{
3371    #[inline]
3372    fn encode_ref(
3373        &self,
3374        encoder: &mut ___E,
3375        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3376    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3377        ::fidl_next::munge!(let WireDriverInfo { table } = out);
3378
3379        let max_ord = self.__max_ordinal();
3380
3381        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3382        ::fidl_next::Wire::zero_padding(&mut out);
3383
3384        let mut preallocated =
3385            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3386
3387        for i in 1..=max_ord {
3388            match i {
3389                9 => {
3390                    if let Some(value) = &self.is_disabled {
3391                        ::fidl_next::WireEnvelope::encode_value(
3392                            value,
3393                            preallocated.encoder,
3394                            &mut out,
3395                        )?;
3396                    } else {
3397                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3398                    }
3399                }
3400
3401                8 => {
3402                    if let Some(value) = &self.driver_framework_version {
3403                        ::fidl_next::WireEnvelope::encode_value(
3404                            value,
3405                            preallocated.encoder,
3406                            &mut out,
3407                        )?;
3408                    } else {
3409                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3410                    }
3411                }
3412
3413                7 => {
3414                    if let Some(value) = &self.bind_rules_bytecode {
3415                        ::fidl_next::WireEnvelope::encode_value(
3416                            value,
3417                            preallocated.encoder,
3418                            &mut out,
3419                        )?;
3420                    } else {
3421                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3422                    }
3423                }
3424
3425                6 => {
3426                    if let Some(value) = &self.device_categories {
3427                        ::fidl_next::WireEnvelope::encode_value(
3428                            value,
3429                            preallocated.encoder,
3430                            &mut out,
3431                        )?;
3432                    } else {
3433                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3434                    }
3435                }
3436
3437                5 => {
3438                    if let Some(value) = &self.is_fallback {
3439                        ::fidl_next::WireEnvelope::encode_value(
3440                            value,
3441                            preallocated.encoder,
3442                            &mut out,
3443                        )?;
3444                    } else {
3445                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3446                    }
3447                }
3448
3449                4 => {
3450                    if let Some(value) = &self.package_type {
3451                        ::fidl_next::WireEnvelope::encode_value(
3452                            value,
3453                            preallocated.encoder,
3454                            &mut out,
3455                        )?;
3456                    } else {
3457                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3458                    }
3459                }
3460
3461                3 => {
3462                    if let Some(value) = &self.colocate {
3463                        ::fidl_next::WireEnvelope::encode_value(
3464                            value,
3465                            preallocated.encoder,
3466                            &mut out,
3467                        )?;
3468                    } else {
3469                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3470                    }
3471                }
3472
3473                2 => {
3474                    if let Some(value) = &self.name {
3475                        ::fidl_next::WireEnvelope::encode_value(
3476                            value,
3477                            preallocated.encoder,
3478                            &mut out,
3479                        )?;
3480                    } else {
3481                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3482                    }
3483                }
3484
3485                1 => {
3486                    if let Some(value) = &self.url {
3487                        ::fidl_next::WireEnvelope::encode_value(
3488                            value,
3489                            preallocated.encoder,
3490                            &mut out,
3491                        )?;
3492                    } else {
3493                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3494                    }
3495                }
3496
3497                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3498            }
3499            unsafe {
3500                preallocated.write_next(out.assume_init_ref());
3501            }
3502        }
3503
3504        ::fidl_next::WireTable::encode_len(table, max_ord);
3505
3506        Ok(())
3507    }
3508}
3509
3510impl<'de> ::fidl_next::FromWire<WireDriverInfo<'de>> for DriverInfo {
3511    #[inline]
3512    fn from_wire(wire_: WireDriverInfo<'de>) -> Self {
3513        let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3514
3515        let url = wire_.table.get(1);
3516
3517        let name = wire_.table.get(2);
3518
3519        let colocate = wire_.table.get(3);
3520
3521        let package_type = wire_.table.get(4);
3522
3523        let is_fallback = wire_.table.get(5);
3524
3525        let device_categories = wire_.table.get(6);
3526
3527        let bind_rules_bytecode = wire_.table.get(7);
3528
3529        let driver_framework_version = wire_.table.get(8);
3530
3531        let is_disabled = wire_.table.get(9);
3532
3533        Self {
3534
3535
3536                url: url.map(|envelope| ::fidl_next::FromWire::from_wire(
3537                    unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
3538                )),
3539
3540
3541                name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
3542                    unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
3543                )),
3544
3545
3546                colocate: colocate.map(|envelope| ::fidl_next::FromWire::from_wire(
3547                    unsafe { envelope.read_unchecked::<bool>() }
3548                )),
3549
3550
3551                package_type: package_type.map(|envelope| ::fidl_next::FromWire::from_wire(
3552                    unsafe { envelope.read_unchecked::<crate::WireDriverPackageType>() }
3553                )),
3554
3555
3556                is_fallback: is_fallback.map(|envelope| ::fidl_next::FromWire::from_wire(
3557                    unsafe { envelope.read_unchecked::<bool>() }
3558                )),
3559
3560
3561                device_categories: device_categories.map(|envelope| ::fidl_next::FromWire::from_wire(
3562                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireDeviceCategory<'de>>>() }
3563                )),
3564
3565
3566                bind_rules_bytecode: bind_rules_bytecode.map(|envelope| ::fidl_next::FromWire::from_wire(
3567                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>() }
3568                )),
3569
3570
3571                driver_framework_version: driver_framework_version.map(|envelope| ::fidl_next::FromWire::from_wire(
3572                    unsafe { envelope.read_unchecked::<u8>() }
3573                )),
3574
3575
3576                is_disabled: is_disabled.map(|envelope| ::fidl_next::FromWire::from_wire(
3577                    unsafe { envelope.read_unchecked::<bool>() }
3578                )),
3579
3580        }
3581    }
3582}
3583
3584impl<'de> ::fidl_next::IntoNatural for WireDriverInfo<'de> {
3585    type Natural = DriverInfo;
3586}
3587
3588impl<'de> ::fidl_next::FromWireRef<WireDriverInfo<'de>> for DriverInfo {
3589    #[inline]
3590    fn from_wire_ref(wire: &WireDriverInfo<'de>) -> Self {
3591        Self {
3592
3593
3594                url: wire.table.get(1)
3595                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3596                        unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
3597                    )),
3598
3599
3600                name: wire.table.get(2)
3601                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3602                        unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
3603                    )),
3604
3605
3606                colocate: wire.table.get(3)
3607                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3608                        unsafe { envelope.deref_unchecked::<bool>() }
3609                    )),
3610
3611
3612                package_type: wire.table.get(4)
3613                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3614                        unsafe { envelope.deref_unchecked::<crate::WireDriverPackageType>() }
3615                    )),
3616
3617
3618                is_fallback: wire.table.get(5)
3619                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3620                        unsafe { envelope.deref_unchecked::<bool>() }
3621                    )),
3622
3623
3624                device_categories: wire.table.get(6)
3625                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3626                        unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireDeviceCategory<'de>>>() }
3627                    )),
3628
3629
3630                bind_rules_bytecode: wire.table.get(7)
3631                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3632                        unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, u8>>() }
3633                    )),
3634
3635
3636                driver_framework_version: wire.table.get(8)
3637                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3638                        unsafe { envelope.deref_unchecked::<u8>() }
3639                    )),
3640
3641
3642                is_disabled: wire.table.get(9)
3643                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3644                        unsafe { envelope.deref_unchecked::<bool>() }
3645                    )),
3646
3647        }
3648    }
3649}
3650
3651/// The wire type corresponding to [`DriverInfo`].
3652#[repr(C)]
3653pub struct WireDriverInfo<'de> {
3654    table: ::fidl_next::WireTable<'de>,
3655}
3656
3657impl<'de> Drop for WireDriverInfo<'de> {
3658    fn drop(&mut self) {
3659        let _ = self
3660            .table
3661            .get(1)
3662            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
3663
3664        let _ = self
3665            .table
3666            .get(2)
3667            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
3668
3669        let _ = self.table.get(3).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
3670
3671        let _ = self
3672            .table
3673            .get(4)
3674            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDriverPackageType>() });
3675
3676        let _ = self.table.get(5).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
3677
3678        let _ = self.table.get(6).map(|envelope| unsafe {
3679            envelope
3680                .read_unchecked::<::fidl_next::WireVector<'de, crate::WireDeviceCategory<'de>>>()
3681        });
3682
3683        let _ = self.table.get(7).map(|envelope| unsafe {
3684            envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
3685        });
3686
3687        let _ = self.table.get(8).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
3688
3689        let _ = self.table.get(9).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
3690    }
3691}
3692
3693unsafe impl ::fidl_next::Wire for WireDriverInfo<'static> {
3694    type Decoded<'de> = WireDriverInfo<'de>;
3695
3696    #[inline]
3697    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3698        ::fidl_next::munge!(let Self { table } = out);
3699        ::fidl_next::WireTable::zero_padding(table);
3700    }
3701}
3702
3703unsafe impl<___D> ::fidl_next::Decode<___D> for WireDriverInfo<'static>
3704where
3705    ___D: ::fidl_next::Decoder + ?Sized,
3706{
3707    fn decode(
3708        slot: ::fidl_next::Slot<'_, Self>,
3709        decoder: &mut ___D,
3710    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3711        ::fidl_next::munge!(let Self { table } = slot);
3712
3713        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3714            match ordinal {
3715                0 => unsafe { ::core::hint::unreachable_unchecked() },
3716
3717                1 => {
3718                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
3719                        slot.as_mut(),
3720                        decoder,
3721                    )?;
3722
3723                    let value = unsafe {
3724                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
3725                    };
3726
3727                    if value.len() > 4096 {
3728                        return Err(::fidl_next::DecodeError::VectorTooLong {
3729                            size: value.len() as u64,
3730                            limit: 4096,
3731                        });
3732                    }
3733
3734                    Ok(())
3735                }
3736
3737                2 => {
3738                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
3739                        slot.as_mut(),
3740                        decoder,
3741                    )?;
3742
3743                    Ok(())
3744                }
3745
3746                3 => {
3747                    ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
3748
3749                    Ok(())
3750                }
3751
3752                4 => {
3753                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDriverPackageType>(
3754                        slot.as_mut(),
3755                        decoder,
3756                    )?;
3757
3758                    Ok(())
3759                }
3760
3761                5 => {
3762                    ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
3763
3764                    Ok(())
3765                }
3766
3767                6 => {
3768                    ::fidl_next::WireEnvelope::decode_as::<
3769                        ___D,
3770                        ::fidl_next::WireVector<'static, crate::WireDeviceCategory<'static>>,
3771                    >(slot.as_mut(), decoder)?;
3772
3773                    Ok(())
3774                }
3775
3776                7 => {
3777                    ::fidl_next::WireEnvelope::decode_as::<
3778                        ___D,
3779                        ::fidl_next::WireVector<'static, u8>,
3780                    >(slot.as_mut(), decoder)?;
3781
3782                    Ok(())
3783                }
3784
3785                8 => {
3786                    ::fidl_next::WireEnvelope::decode_as::<___D, u8>(slot.as_mut(), decoder)?;
3787
3788                    Ok(())
3789                }
3790
3791                9 => {
3792                    ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
3793
3794                    Ok(())
3795                }
3796
3797                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3798            }
3799        })
3800    }
3801}
3802
3803impl<'de> WireDriverInfo<'de> {
3804    pub fn url(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
3805        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3806    }
3807
3808    pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
3809        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3810    }
3811
3812    pub fn colocate(&self) -> ::core::option::Option<&bool> {
3813        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
3814    }
3815
3816    pub fn package_type(&self) -> ::core::option::Option<&crate::WireDriverPackageType> {
3817        unsafe { Some(self.table.get(4)?.deref_unchecked()) }
3818    }
3819
3820    pub fn is_fallback(&self) -> ::core::option::Option<&bool> {
3821        unsafe { Some(self.table.get(5)?.deref_unchecked()) }
3822    }
3823
3824    pub fn device_categories(
3825        &self,
3826    ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireDeviceCategory<'de>>> {
3827        unsafe { Some(self.table.get(6)?.deref_unchecked()) }
3828    }
3829
3830    pub fn bind_rules_bytecode(&self) -> ::core::option::Option<&::fidl_next::WireVector<'de, u8>> {
3831        unsafe { Some(self.table.get(7)?.deref_unchecked()) }
3832    }
3833
3834    pub fn driver_framework_version(&self) -> ::core::option::Option<&u8> {
3835        unsafe { Some(self.table.get(8)?.deref_unchecked()) }
3836    }
3837
3838    pub fn is_disabled(&self) -> ::core::option::Option<&bool> {
3839        unsafe { Some(self.table.get(9)?.deref_unchecked()) }
3840    }
3841}
3842
3843impl<'de> ::core::fmt::Debug for WireDriverInfo<'de> {
3844    fn fmt(
3845        &self,
3846        f: &mut ::core::fmt::Formatter<'_>,
3847    ) -> ::core::result::Result<(), ::core::fmt::Error> {
3848        f.debug_struct("DriverInfo")
3849            .field("url", &self.url())
3850            .field("name", &self.name())
3851            .field("colocate", &self.colocate())
3852            .field("package_type", &self.package_type())
3853            .field("is_fallback", &self.is_fallback())
3854            .field("device_categories", &self.device_categories())
3855            .field("bind_rules_bytecode", &self.bind_rules_bytecode())
3856            .field("driver_framework_version", &self.driver_framework_version())
3857            .field("is_disabled", &self.is_disabled())
3858            .finish()
3859    }
3860}
3861
3862#[doc = " Information for a composite driver.\n"]
3863#[derive(PartialEq, Clone, Debug, Default)]
3864pub struct CompositeDriverInfo {
3865    pub composite_name: ::core::option::Option<::std::string::String>,
3866
3867    pub driver_info: ::core::option::Option<crate::DriverInfo>,
3868}
3869
3870impl CompositeDriverInfo {
3871    fn __max_ordinal(&self) -> usize {
3872        if self.driver_info.is_some() {
3873            return 2;
3874        }
3875
3876        if self.composite_name.is_some() {
3877            return 1;
3878        }
3879
3880        0
3881    }
3882}
3883
3884impl ::fidl_next::Encodable for CompositeDriverInfo {
3885    type Encoded = WireCompositeDriverInfo<'static>;
3886}
3887
3888unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeDriverInfo
3889where
3890    ___E: ::fidl_next::Encoder + ?Sized,
3891{
3892    #[inline]
3893    fn encode(
3894        mut self,
3895        encoder: &mut ___E,
3896        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3897    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3898        ::fidl_next::munge!(let WireCompositeDriverInfo { table } = out);
3899
3900        let max_ord = self.__max_ordinal();
3901
3902        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3903        ::fidl_next::Wire::zero_padding(&mut out);
3904
3905        let mut preallocated =
3906            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3907
3908        for i in 1..=max_ord {
3909            match i {
3910                2 => {
3911                    if let Some(value) = self.driver_info.take() {
3912                        ::fidl_next::WireEnvelope::encode_value(
3913                            value,
3914                            preallocated.encoder,
3915                            &mut out,
3916                        )?;
3917                    } else {
3918                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3919                    }
3920                }
3921
3922                1 => {
3923                    if let Some(value) = self.composite_name.take() {
3924                        ::fidl_next::WireEnvelope::encode_value(
3925                            value,
3926                            preallocated.encoder,
3927                            &mut out,
3928                        )?;
3929                    } else {
3930                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3931                    }
3932                }
3933
3934                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3935            }
3936            unsafe {
3937                preallocated.write_next(out.assume_init_ref());
3938            }
3939        }
3940
3941        ::fidl_next::WireTable::encode_len(table, max_ord);
3942
3943        Ok(())
3944    }
3945}
3946
3947unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CompositeDriverInfo
3948where
3949    ___E: ::fidl_next::Encoder + ?Sized,
3950{
3951    #[inline]
3952    fn encode_ref(
3953        &self,
3954        encoder: &mut ___E,
3955        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3956    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3957        ::fidl_next::munge!(let WireCompositeDriverInfo { table } = out);
3958
3959        let max_ord = self.__max_ordinal();
3960
3961        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3962        ::fidl_next::Wire::zero_padding(&mut out);
3963
3964        let mut preallocated =
3965            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3966
3967        for i in 1..=max_ord {
3968            match i {
3969                2 => {
3970                    if let Some(value) = &self.driver_info {
3971                        ::fidl_next::WireEnvelope::encode_value(
3972                            value,
3973                            preallocated.encoder,
3974                            &mut out,
3975                        )?;
3976                    } else {
3977                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3978                    }
3979                }
3980
3981                1 => {
3982                    if let Some(value) = &self.composite_name {
3983                        ::fidl_next::WireEnvelope::encode_value(
3984                            value,
3985                            preallocated.encoder,
3986                            &mut out,
3987                        )?;
3988                    } else {
3989                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3990                    }
3991                }
3992
3993                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3994            }
3995            unsafe {
3996                preallocated.write_next(out.assume_init_ref());
3997            }
3998        }
3999
4000        ::fidl_next::WireTable::encode_len(table, max_ord);
4001
4002        Ok(())
4003    }
4004}
4005
4006impl<'de> ::fidl_next::FromWire<WireCompositeDriverInfo<'de>> for CompositeDriverInfo {
4007    #[inline]
4008    fn from_wire(wire_: WireCompositeDriverInfo<'de>) -> Self {
4009        let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4010
4011        let composite_name = wire_.table.get(1);
4012
4013        let driver_info = wire_.table.get(2);
4014
4015        Self {
4016            composite_name: composite_name.map(|envelope| {
4017                ::fidl_next::FromWire::from_wire(unsafe {
4018                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
4019                })
4020            }),
4021
4022            driver_info: driver_info.map(|envelope| {
4023                ::fidl_next::FromWire::from_wire(unsafe {
4024                    envelope.read_unchecked::<crate::WireDriverInfo<'de>>()
4025                })
4026            }),
4027        }
4028    }
4029}
4030
4031impl<'de> ::fidl_next::IntoNatural for WireCompositeDriverInfo<'de> {
4032    type Natural = CompositeDriverInfo;
4033}
4034
4035impl<'de> ::fidl_next::FromWireRef<WireCompositeDriverInfo<'de>> for CompositeDriverInfo {
4036    #[inline]
4037    fn from_wire_ref(wire: &WireCompositeDriverInfo<'de>) -> Self {
4038        Self {
4039            composite_name: wire.table.get(1).map(|envelope| {
4040                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4041                    envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
4042                })
4043            }),
4044
4045            driver_info: wire.table.get(2).map(|envelope| {
4046                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4047                    envelope.deref_unchecked::<crate::WireDriverInfo<'de>>()
4048                })
4049            }),
4050        }
4051    }
4052}
4053
4054/// The wire type corresponding to [`CompositeDriverInfo`].
4055#[repr(C)]
4056pub struct WireCompositeDriverInfo<'de> {
4057    table: ::fidl_next::WireTable<'de>,
4058}
4059
4060impl<'de> Drop for WireCompositeDriverInfo<'de> {
4061    fn drop(&mut self) {
4062        let _ = self
4063            .table
4064            .get(1)
4065            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
4066
4067        let _ = self
4068            .table
4069            .get(2)
4070            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDriverInfo<'de>>() });
4071    }
4072}
4073
4074unsafe impl ::fidl_next::Wire for WireCompositeDriverInfo<'static> {
4075    type Decoded<'de> = WireCompositeDriverInfo<'de>;
4076
4077    #[inline]
4078    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4079        ::fidl_next::munge!(let Self { table } = out);
4080        ::fidl_next::WireTable::zero_padding(table);
4081    }
4082}
4083
4084unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeDriverInfo<'static>
4085where
4086    ___D: ::fidl_next::Decoder + ?Sized,
4087{
4088    fn decode(
4089        slot: ::fidl_next::Slot<'_, Self>,
4090        decoder: &mut ___D,
4091    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4092        ::fidl_next::munge!(let Self { table } = slot);
4093
4094        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4095            match ordinal {
4096                0 => unsafe { ::core::hint::unreachable_unchecked() },
4097
4098                1 => {
4099                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
4100                        slot.as_mut(),
4101                        decoder,
4102                    )?;
4103
4104                    Ok(())
4105                }
4106
4107                2 => {
4108                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDriverInfo<'static>>(
4109                        slot.as_mut(),
4110                        decoder,
4111                    )?;
4112
4113                    Ok(())
4114                }
4115
4116                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
4117            }
4118        })
4119    }
4120}
4121
4122impl<'de> WireCompositeDriverInfo<'de> {
4123    pub fn composite_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
4124        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4125    }
4126
4127    pub fn driver_info(&self) -> ::core::option::Option<&crate::WireDriverInfo<'de>> {
4128        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4129    }
4130}
4131
4132impl<'de> ::core::fmt::Debug for WireCompositeDriverInfo<'de> {
4133    fn fmt(
4134        &self,
4135        f: &mut ::core::fmt::Formatter<'_>,
4136    ) -> ::core::result::Result<(), ::core::fmt::Error> {
4137        f.debug_struct("CompositeDriverInfo")
4138            .field("composite_name", &self.composite_name())
4139            .field("driver_info", &self.driver_info())
4140            .finish()
4141    }
4142}
4143
4144#[doc = " Information for a composite driver that has matched with a composite.\n"]
4145#[derive(PartialEq, Clone, Debug, Default)]
4146pub struct CompositeDriverMatch {
4147    pub composite_driver: ::core::option::Option<crate::CompositeDriverInfo>,
4148
4149    pub parent_names: ::core::option::Option<::std::vec::Vec<::std::string::String>>,
4150
4151    pub primary_parent_index: ::core::option::Option<u32>,
4152}
4153
4154impl CompositeDriverMatch {
4155    fn __max_ordinal(&self) -> usize {
4156        if self.primary_parent_index.is_some() {
4157            return 3;
4158        }
4159
4160        if self.parent_names.is_some() {
4161            return 2;
4162        }
4163
4164        if self.composite_driver.is_some() {
4165            return 1;
4166        }
4167
4168        0
4169    }
4170}
4171
4172impl ::fidl_next::Encodable for CompositeDriverMatch {
4173    type Encoded = WireCompositeDriverMatch<'static>;
4174}
4175
4176unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeDriverMatch
4177where
4178    ___E: ::fidl_next::Encoder + ?Sized,
4179{
4180    #[inline]
4181    fn encode(
4182        mut self,
4183        encoder: &mut ___E,
4184        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4185    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4186        ::fidl_next::munge!(let WireCompositeDriverMatch { table } = out);
4187
4188        let max_ord = self.__max_ordinal();
4189
4190        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4191        ::fidl_next::Wire::zero_padding(&mut out);
4192
4193        let mut preallocated =
4194            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4195
4196        for i in 1..=max_ord {
4197            match i {
4198                3 => {
4199                    if let Some(value) = self.primary_parent_index.take() {
4200                        ::fidl_next::WireEnvelope::encode_value(
4201                            value,
4202                            preallocated.encoder,
4203                            &mut out,
4204                        )?;
4205                    } else {
4206                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4207                    }
4208                }
4209
4210                2 => {
4211                    if let Some(value) = self.parent_names.take() {
4212                        ::fidl_next::WireEnvelope::encode_value(
4213                            value,
4214                            preallocated.encoder,
4215                            &mut out,
4216                        )?;
4217                    } else {
4218                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4219                    }
4220                }
4221
4222                1 => {
4223                    if let Some(value) = self.composite_driver.take() {
4224                        ::fidl_next::WireEnvelope::encode_value(
4225                            value,
4226                            preallocated.encoder,
4227                            &mut out,
4228                        )?;
4229                    } else {
4230                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4231                    }
4232                }
4233
4234                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4235            }
4236            unsafe {
4237                preallocated.write_next(out.assume_init_ref());
4238            }
4239        }
4240
4241        ::fidl_next::WireTable::encode_len(table, max_ord);
4242
4243        Ok(())
4244    }
4245}
4246
4247unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CompositeDriverMatch
4248where
4249    ___E: ::fidl_next::Encoder + ?Sized,
4250{
4251    #[inline]
4252    fn encode_ref(
4253        &self,
4254        encoder: &mut ___E,
4255        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4256    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4257        ::fidl_next::munge!(let WireCompositeDriverMatch { table } = out);
4258
4259        let max_ord = self.__max_ordinal();
4260
4261        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4262        ::fidl_next::Wire::zero_padding(&mut out);
4263
4264        let mut preallocated =
4265            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4266
4267        for i in 1..=max_ord {
4268            match i {
4269                3 => {
4270                    if let Some(value) = &self.primary_parent_index {
4271                        ::fidl_next::WireEnvelope::encode_value(
4272                            value,
4273                            preallocated.encoder,
4274                            &mut out,
4275                        )?;
4276                    } else {
4277                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4278                    }
4279                }
4280
4281                2 => {
4282                    if let Some(value) = &self.parent_names {
4283                        ::fidl_next::WireEnvelope::encode_value(
4284                            value,
4285                            preallocated.encoder,
4286                            &mut out,
4287                        )?;
4288                    } else {
4289                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4290                    }
4291                }
4292
4293                1 => {
4294                    if let Some(value) = &self.composite_driver {
4295                        ::fidl_next::WireEnvelope::encode_value(
4296                            value,
4297                            preallocated.encoder,
4298                            &mut out,
4299                        )?;
4300                    } else {
4301                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4302                    }
4303                }
4304
4305                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4306            }
4307            unsafe {
4308                preallocated.write_next(out.assume_init_ref());
4309            }
4310        }
4311
4312        ::fidl_next::WireTable::encode_len(table, max_ord);
4313
4314        Ok(())
4315    }
4316}
4317
4318impl<'de> ::fidl_next::FromWire<WireCompositeDriverMatch<'de>> for CompositeDriverMatch {
4319    #[inline]
4320    fn from_wire(wire_: WireCompositeDriverMatch<'de>) -> Self {
4321        let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4322
4323        let composite_driver = wire_.table.get(1);
4324
4325        let parent_names = wire_.table.get(2);
4326
4327        let primary_parent_index = wire_.table.get(3);
4328
4329        Self {
4330
4331
4332                composite_driver: composite_driver.map(|envelope| ::fidl_next::FromWire::from_wire(
4333                    unsafe { envelope.read_unchecked::<crate::WireCompositeDriverInfo<'de>>() }
4334                )),
4335
4336
4337                parent_names: parent_names.map(|envelope| ::fidl_next::FromWire::from_wire(
4338                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>() }
4339                )),
4340
4341
4342                primary_parent_index: primary_parent_index.map(|envelope| ::fidl_next::FromWire::from_wire(
4343                    unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() }
4344                )),
4345
4346        }
4347    }
4348}
4349
4350impl<'de> ::fidl_next::IntoNatural for WireCompositeDriverMatch<'de> {
4351    type Natural = CompositeDriverMatch;
4352}
4353
4354impl<'de> ::fidl_next::FromWireRef<WireCompositeDriverMatch<'de>> for CompositeDriverMatch {
4355    #[inline]
4356    fn from_wire_ref(wire: &WireCompositeDriverMatch<'de>) -> Self {
4357        Self {
4358
4359
4360                composite_driver: wire.table.get(1)
4361                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
4362                        unsafe { envelope.deref_unchecked::<crate::WireCompositeDriverInfo<'de>>() }
4363                    )),
4364
4365
4366                parent_names: wire.table.get(2)
4367                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
4368                        unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>() }
4369                    )),
4370
4371
4372                primary_parent_index: wire.table.get(3)
4373                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
4374                        unsafe { envelope.deref_unchecked::<::fidl_next::WireU32>() }
4375                    )),
4376
4377        }
4378    }
4379}
4380
4381/// The wire type corresponding to [`CompositeDriverMatch`].
4382#[repr(C)]
4383pub struct WireCompositeDriverMatch<'de> {
4384    table: ::fidl_next::WireTable<'de>,
4385}
4386
4387impl<'de> Drop for WireCompositeDriverMatch<'de> {
4388    fn drop(&mut self) {
4389        let _ = self.table.get(1).map(|envelope| unsafe {
4390            envelope.read_unchecked::<crate::WireCompositeDriverInfo<'de>>()
4391        });
4392
4393        let _ = self.table.get(2).map(|envelope| unsafe {
4394            envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
4395        });
4396
4397        let _ = self
4398            .table
4399            .get(3)
4400            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
4401    }
4402}
4403
4404unsafe impl ::fidl_next::Wire for WireCompositeDriverMatch<'static> {
4405    type Decoded<'de> = WireCompositeDriverMatch<'de>;
4406
4407    #[inline]
4408    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4409        ::fidl_next::munge!(let Self { table } = out);
4410        ::fidl_next::WireTable::zero_padding(table);
4411    }
4412}
4413
4414unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeDriverMatch<'static>
4415where
4416    ___D: ::fidl_next::Decoder + ?Sized,
4417{
4418    fn decode(
4419        slot: ::fidl_next::Slot<'_, Self>,
4420        decoder: &mut ___D,
4421    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4422        ::fidl_next::munge!(let Self { table } = slot);
4423
4424        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4425            match ordinal {
4426                0 => unsafe { ::core::hint::unreachable_unchecked() },
4427
4428                1 => {
4429                    ::fidl_next::WireEnvelope::decode_as::<
4430                        ___D,
4431                        crate::WireCompositeDriverInfo<'static>,
4432                    >(slot.as_mut(), decoder)?;
4433
4434                    Ok(())
4435                }
4436
4437                2 => {
4438                    ::fidl_next::WireEnvelope::decode_as::<
4439                        ___D,
4440                        ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
4441                    >(slot.as_mut(), decoder)?;
4442
4443                    Ok(())
4444                }
4445
4446                3 => {
4447                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
4448                        slot.as_mut(),
4449                        decoder,
4450                    )?;
4451
4452                    Ok(())
4453                }
4454
4455                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
4456            }
4457        })
4458    }
4459}
4460
4461impl<'de> WireCompositeDriverMatch<'de> {
4462    pub fn composite_driver(&self) -> ::core::option::Option<&crate::WireCompositeDriverInfo<'de>> {
4463        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4464    }
4465
4466    pub fn parent_names(
4467        &self,
4468    ) -> ::core::option::Option<&::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>> {
4469        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4470    }
4471
4472    pub fn primary_parent_index(&self) -> ::core::option::Option<&::fidl_next::WireU32> {
4473        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
4474    }
4475}
4476
4477impl<'de> ::core::fmt::Debug for WireCompositeDriverMatch<'de> {
4478    fn fmt(
4479        &self,
4480        f: &mut ::core::fmt::Formatter<'_>,
4481    ) -> ::core::result::Result<(), ::core::fmt::Error> {
4482        f.debug_struct("CompositeDriverMatch")
4483            .field("composite_driver", &self.composite_driver())
4484            .field("parent_names", &self.parent_names())
4485            .field("primary_parent_index", &self.primary_parent_index())
4486            .finish()
4487    }
4488}
4489
4490#[doc = " Definition of a property for a node. A property is commonly used to match a\n node to a driver for driver binding.\n"]
4491#[derive(PartialEq, Clone, Debug)]
4492pub struct NodeProperty {
4493    pub key: crate::NodePropertyKey,
4494
4495    pub value: crate::NodePropertyValue,
4496}
4497
4498impl ::fidl_next::Encodable for NodeProperty {
4499    type Encoded = WireNodeProperty<'static>;
4500}
4501
4502unsafe impl<___E> ::fidl_next::Encode<___E> for NodeProperty
4503where
4504    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4505    ___E: ::fidl_next::Encoder,
4506{
4507    #[inline]
4508    fn encode(
4509        self,
4510        encoder_: &mut ___E,
4511        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4512    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4513        ::fidl_next::munge! {
4514            let Self::Encoded {
4515                key,
4516                value,
4517
4518            } = out_;
4519        }
4520
4521        ::fidl_next::Encode::encode(self.key, encoder_, key)?;
4522
4523        ::fidl_next::Encode::encode(self.value, encoder_, value)?;
4524
4525        Ok(())
4526    }
4527}
4528
4529unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeProperty
4530where
4531    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4532    ___E: ::fidl_next::Encoder,
4533{
4534    #[inline]
4535    fn encode_ref(
4536        &self,
4537        encoder_: &mut ___E,
4538        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4539    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4540        ::fidl_next::munge! {
4541            let Self::Encoded {
4542
4543                key,
4544                value,
4545
4546            } = out_;
4547        }
4548
4549        ::fidl_next::EncodeRef::encode_ref(&self.key, encoder_, key)?;
4550
4551        ::fidl_next::EncodeRef::encode_ref(&self.value, encoder_, value)?;
4552
4553        Ok(())
4554    }
4555}
4556
4557impl ::fidl_next::EncodableOption for NodeProperty {
4558    type EncodedOption = ::fidl_next::WireBox<'static, WireNodeProperty<'static>>;
4559}
4560
4561unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeProperty
4562where
4563    ___E: ::fidl_next::Encoder + ?Sized,
4564    NodeProperty: ::fidl_next::Encode<___E>,
4565{
4566    #[inline]
4567    fn encode_option(
4568        this: ::core::option::Option<Self>,
4569        encoder: &mut ___E,
4570        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4571    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4572        if let Some(inner) = this {
4573            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4574            ::fidl_next::WireBox::encode_present(out);
4575        } else {
4576            ::fidl_next::WireBox::encode_absent(out);
4577        }
4578
4579        Ok(())
4580    }
4581}
4582
4583unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeProperty
4584where
4585    ___E: ::fidl_next::Encoder + ?Sized,
4586    NodeProperty: ::fidl_next::EncodeRef<___E>,
4587{
4588    #[inline]
4589    fn encode_option_ref(
4590        this: ::core::option::Option<&Self>,
4591        encoder: &mut ___E,
4592        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4593    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4594        if let Some(inner) = this {
4595            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4596            ::fidl_next::WireBox::encode_present(out);
4597        } else {
4598            ::fidl_next::WireBox::encode_absent(out);
4599        }
4600
4601        Ok(())
4602    }
4603}
4604
4605impl<'de> ::fidl_next::FromWire<WireNodeProperty<'de>> for NodeProperty {
4606    #[inline]
4607    fn from_wire(wire: WireNodeProperty<'de>) -> Self {
4608        Self {
4609            key: ::fidl_next::FromWire::from_wire(wire.key),
4610
4611            value: ::fidl_next::FromWire::from_wire(wire.value),
4612        }
4613    }
4614}
4615
4616impl<'de> ::fidl_next::IntoNatural for WireNodeProperty<'de> {
4617    type Natural = NodeProperty;
4618}
4619
4620impl<'de> ::fidl_next::FromWireRef<WireNodeProperty<'de>> for NodeProperty {
4621    #[inline]
4622    fn from_wire_ref(wire: &WireNodeProperty<'de>) -> Self {
4623        Self {
4624            key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
4625
4626            value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value),
4627        }
4628    }
4629}
4630
4631/// The wire type corresponding to [`NodeProperty`].
4632#[derive(Debug)]
4633#[repr(C)]
4634pub struct WireNodeProperty<'de> {
4635    pub key: crate::WireNodePropertyKey<'de>,
4636
4637    pub value: crate::WireNodePropertyValue<'de>,
4638}
4639static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeProperty<'_>>(), 32);
4640static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeProperty<'_>>(), 8);
4641
4642static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeProperty<'_>, key), 0);
4643
4644static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeProperty<'_>, value), 16);
4645
4646unsafe impl ::fidl_next::Wire for WireNodeProperty<'static> {
4647    type Decoded<'de> = WireNodeProperty<'de>;
4648
4649    #[inline]
4650    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
4651        ::fidl_next::munge! {
4652            let Self {
4653
4654                key,
4655                value,
4656
4657            } = &mut *out_;
4658        }
4659
4660        ::fidl_next::Wire::zero_padding(key);
4661
4662        ::fidl_next::Wire::zero_padding(value);
4663    }
4664}
4665
4666unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeProperty<'static>
4667where
4668    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4669    ___D: ::fidl_next::Decoder,
4670{
4671    fn decode(
4672        slot_: ::fidl_next::Slot<'_, Self>,
4673        decoder_: &mut ___D,
4674    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4675        ::fidl_next::munge! {
4676            let Self {
4677
4678                mut key,
4679                mut value,
4680
4681            } = slot_;
4682        }
4683
4684        ::fidl_next::Decode::decode(key.as_mut(), decoder_)?;
4685
4686        ::fidl_next::Decode::decode(value.as_mut(), decoder_)?;
4687
4688        Ok(())
4689    }
4690}
4691
4692#[doc = " Specification for a node that parents the composite node created from the\n composite node specification.\n"]
4693#[derive(PartialEq, Clone, Debug)]
4694pub struct ParentSpec {
4695    pub bind_rules: ::std::vec::Vec<crate::BindRule>,
4696
4697    pub properties: ::std::vec::Vec<crate::NodeProperty>,
4698}
4699
4700impl ::fidl_next::Encodable for ParentSpec {
4701    type Encoded = WireParentSpec<'static>;
4702}
4703
4704unsafe impl<___E> ::fidl_next::Encode<___E> for ParentSpec
4705where
4706    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4707    ___E: ::fidl_next::Encoder,
4708{
4709    #[inline]
4710    fn encode(
4711        self,
4712        encoder_: &mut ___E,
4713        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4714    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4715        ::fidl_next::munge! {
4716            let Self::Encoded {
4717                bind_rules,
4718                properties,
4719
4720            } = out_;
4721        }
4722
4723        ::fidl_next::Encode::encode(self.bind_rules, encoder_, bind_rules)?;
4724
4725        ::fidl_next::Encode::encode(self.properties, encoder_, properties)?;
4726
4727        Ok(())
4728    }
4729}
4730
4731unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ParentSpec
4732where
4733    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4734    ___E: ::fidl_next::Encoder,
4735{
4736    #[inline]
4737    fn encode_ref(
4738        &self,
4739        encoder_: &mut ___E,
4740        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4741    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4742        ::fidl_next::munge! {
4743            let Self::Encoded {
4744
4745                bind_rules,
4746                properties,
4747
4748            } = out_;
4749        }
4750
4751        ::fidl_next::EncodeRef::encode_ref(&self.bind_rules, encoder_, bind_rules)?;
4752
4753        ::fidl_next::EncodeRef::encode_ref(&self.properties, encoder_, properties)?;
4754
4755        Ok(())
4756    }
4757}
4758
4759impl ::fidl_next::EncodableOption for ParentSpec {
4760    type EncodedOption = ::fidl_next::WireBox<'static, WireParentSpec<'static>>;
4761}
4762
4763unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ParentSpec
4764where
4765    ___E: ::fidl_next::Encoder + ?Sized,
4766    ParentSpec: ::fidl_next::Encode<___E>,
4767{
4768    #[inline]
4769    fn encode_option(
4770        this: ::core::option::Option<Self>,
4771        encoder: &mut ___E,
4772        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4773    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4774        if let Some(inner) = this {
4775            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4776            ::fidl_next::WireBox::encode_present(out);
4777        } else {
4778            ::fidl_next::WireBox::encode_absent(out);
4779        }
4780
4781        Ok(())
4782    }
4783}
4784
4785unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ParentSpec
4786where
4787    ___E: ::fidl_next::Encoder + ?Sized,
4788    ParentSpec: ::fidl_next::EncodeRef<___E>,
4789{
4790    #[inline]
4791    fn encode_option_ref(
4792        this: ::core::option::Option<&Self>,
4793        encoder: &mut ___E,
4794        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4795    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4796        if let Some(inner) = this {
4797            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4798            ::fidl_next::WireBox::encode_present(out);
4799        } else {
4800            ::fidl_next::WireBox::encode_absent(out);
4801        }
4802
4803        Ok(())
4804    }
4805}
4806
4807impl<'de> ::fidl_next::FromWire<WireParentSpec<'de>> for ParentSpec {
4808    #[inline]
4809    fn from_wire(wire: WireParentSpec<'de>) -> Self {
4810        Self {
4811            bind_rules: ::fidl_next::FromWire::from_wire(wire.bind_rules),
4812
4813            properties: ::fidl_next::FromWire::from_wire(wire.properties),
4814        }
4815    }
4816}
4817
4818impl<'de> ::fidl_next::IntoNatural for WireParentSpec<'de> {
4819    type Natural = ParentSpec;
4820}
4821
4822impl<'de> ::fidl_next::FromWireRef<WireParentSpec<'de>> for ParentSpec {
4823    #[inline]
4824    fn from_wire_ref(wire: &WireParentSpec<'de>) -> Self {
4825        Self {
4826            bind_rules: ::fidl_next::FromWireRef::from_wire_ref(&wire.bind_rules),
4827
4828            properties: ::fidl_next::FromWireRef::from_wire_ref(&wire.properties),
4829        }
4830    }
4831}
4832
4833/// The wire type corresponding to [`ParentSpec`].
4834#[derive(Debug)]
4835#[repr(C)]
4836pub struct WireParentSpec<'de> {
4837    pub bind_rules: ::fidl_next::WireVector<'de, crate::WireBindRule<'de>>,
4838
4839    pub properties: ::fidl_next::WireVector<'de, crate::WireNodeProperty<'de>>,
4840}
4841static_assertions::const_assert_eq!(std::mem::size_of::<WireParentSpec<'_>>(), 32);
4842static_assertions::const_assert_eq!(std::mem::align_of::<WireParentSpec<'_>>(), 8);
4843
4844static_assertions::const_assert_eq!(std::mem::offset_of!(WireParentSpec<'_>, bind_rules), 0);
4845
4846static_assertions::const_assert_eq!(std::mem::offset_of!(WireParentSpec<'_>, properties), 16);
4847
4848unsafe impl ::fidl_next::Wire for WireParentSpec<'static> {
4849    type Decoded<'de> = WireParentSpec<'de>;
4850
4851    #[inline]
4852    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
4853        ::fidl_next::munge! {
4854            let Self {
4855
4856                bind_rules,
4857                properties,
4858
4859            } = &mut *out_;
4860        }
4861
4862        ::fidl_next::Wire::zero_padding(bind_rules);
4863
4864        ::fidl_next::Wire::zero_padding(properties);
4865    }
4866}
4867
4868unsafe impl<___D> ::fidl_next::Decode<___D> for WireParentSpec<'static>
4869where
4870    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4871    ___D: ::fidl_next::Decoder,
4872{
4873    fn decode(
4874        slot_: ::fidl_next::Slot<'_, Self>,
4875        decoder_: &mut ___D,
4876    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4877        ::fidl_next::munge! {
4878            let Self {
4879
4880                mut bind_rules,
4881                mut properties,
4882
4883            } = slot_;
4884        }
4885
4886        ::fidl_next::Decode::decode(bind_rules.as_mut(), decoder_)?;
4887
4888        let bind_rules = unsafe { bind_rules.deref_unchecked() };
4889
4890        if bind_rules.len() > 64 {
4891            return Err(::fidl_next::DecodeError::VectorTooLong {
4892                size: bind_rules.len() as u64,
4893                limit: 64,
4894            });
4895        }
4896
4897        ::fidl_next::Decode::decode(properties.as_mut(), decoder_)?;
4898
4899        let properties = unsafe { properties.deref_unchecked() };
4900
4901        if properties.len() > 64 {
4902            return Err(::fidl_next::DecodeError::VectorTooLong {
4903                size: properties.len() as u64,
4904                limit: 64,
4905            });
4906        }
4907
4908        Ok(())
4909    }
4910}
4911
4912#[derive(PartialEq, Clone, Debug)]
4913pub struct NodeProperty2 {
4914    pub key: ::std::string::String,
4915
4916    pub value: crate::NodePropertyValue,
4917}
4918
4919impl ::fidl_next::Encodable for NodeProperty2 {
4920    type Encoded = WireNodeProperty2<'static>;
4921}
4922
4923unsafe impl<___E> ::fidl_next::Encode<___E> for NodeProperty2
4924where
4925    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4926    ___E: ::fidl_next::Encoder,
4927{
4928    #[inline]
4929    fn encode(
4930        self,
4931        encoder_: &mut ___E,
4932        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4933    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4934        ::fidl_next::munge! {
4935            let Self::Encoded {
4936                key,
4937                value,
4938
4939            } = out_;
4940        }
4941
4942        ::fidl_next::Encode::encode(self.key, encoder_, key)?;
4943
4944        ::fidl_next::Encode::encode(self.value, encoder_, value)?;
4945
4946        Ok(())
4947    }
4948}
4949
4950unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeProperty2
4951where
4952    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4953    ___E: ::fidl_next::Encoder,
4954{
4955    #[inline]
4956    fn encode_ref(
4957        &self,
4958        encoder_: &mut ___E,
4959        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4960    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4961        ::fidl_next::munge! {
4962            let Self::Encoded {
4963
4964                key,
4965                value,
4966
4967            } = out_;
4968        }
4969
4970        ::fidl_next::EncodeRef::encode_ref(&self.key, encoder_, key)?;
4971
4972        ::fidl_next::EncodeRef::encode_ref(&self.value, encoder_, value)?;
4973
4974        Ok(())
4975    }
4976}
4977
4978impl ::fidl_next::EncodableOption for NodeProperty2 {
4979    type EncodedOption = ::fidl_next::WireBox<'static, WireNodeProperty2<'static>>;
4980}
4981
4982unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeProperty2
4983where
4984    ___E: ::fidl_next::Encoder + ?Sized,
4985    NodeProperty2: ::fidl_next::Encode<___E>,
4986{
4987    #[inline]
4988    fn encode_option(
4989        this: ::core::option::Option<Self>,
4990        encoder: &mut ___E,
4991        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4992    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4993        if let Some(inner) = this {
4994            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4995            ::fidl_next::WireBox::encode_present(out);
4996        } else {
4997            ::fidl_next::WireBox::encode_absent(out);
4998        }
4999
5000        Ok(())
5001    }
5002}
5003
5004unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeProperty2
5005where
5006    ___E: ::fidl_next::Encoder + ?Sized,
5007    NodeProperty2: ::fidl_next::EncodeRef<___E>,
5008{
5009    #[inline]
5010    fn encode_option_ref(
5011        this: ::core::option::Option<&Self>,
5012        encoder: &mut ___E,
5013        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5014    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5015        if let Some(inner) = this {
5016            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5017            ::fidl_next::WireBox::encode_present(out);
5018        } else {
5019            ::fidl_next::WireBox::encode_absent(out);
5020        }
5021
5022        Ok(())
5023    }
5024}
5025
5026impl<'de> ::fidl_next::FromWire<WireNodeProperty2<'de>> for NodeProperty2 {
5027    #[inline]
5028    fn from_wire(wire: WireNodeProperty2<'de>) -> Self {
5029        Self {
5030            key: ::fidl_next::FromWire::from_wire(wire.key),
5031
5032            value: ::fidl_next::FromWire::from_wire(wire.value),
5033        }
5034    }
5035}
5036
5037impl<'de> ::fidl_next::IntoNatural for WireNodeProperty2<'de> {
5038    type Natural = NodeProperty2;
5039}
5040
5041impl<'de> ::fidl_next::FromWireRef<WireNodeProperty2<'de>> for NodeProperty2 {
5042    #[inline]
5043    fn from_wire_ref(wire: &WireNodeProperty2<'de>) -> Self {
5044        Self {
5045            key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
5046
5047            value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value),
5048        }
5049    }
5050}
5051
5052/// The wire type corresponding to [`NodeProperty2`].
5053#[derive(Debug)]
5054#[repr(C)]
5055pub struct WireNodeProperty2<'de> {
5056    pub key: ::fidl_next::WireString<'de>,
5057
5058    pub value: crate::WireNodePropertyValue<'de>,
5059}
5060static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeProperty2<'_>>(), 32);
5061static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeProperty2<'_>>(), 8);
5062
5063static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeProperty2<'_>, key), 0);
5064
5065static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeProperty2<'_>, value), 16);
5066
5067unsafe impl ::fidl_next::Wire for WireNodeProperty2<'static> {
5068    type Decoded<'de> = WireNodeProperty2<'de>;
5069
5070    #[inline]
5071    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5072        ::fidl_next::munge! {
5073            let Self {
5074
5075                key,
5076                value,
5077
5078            } = &mut *out_;
5079        }
5080
5081        ::fidl_next::Wire::zero_padding(key);
5082
5083        ::fidl_next::Wire::zero_padding(value);
5084    }
5085}
5086
5087unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeProperty2<'static>
5088where
5089    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5090    ___D: ::fidl_next::Decoder,
5091{
5092    fn decode(
5093        slot_: ::fidl_next::Slot<'_, Self>,
5094        decoder_: &mut ___D,
5095    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5096        ::fidl_next::munge! {
5097            let Self {
5098
5099                mut key,
5100                mut value,
5101
5102            } = slot_;
5103        }
5104
5105        ::fidl_next::Decode::decode(key.as_mut(), decoder_)?;
5106
5107        let key = unsafe { key.deref_unchecked() };
5108
5109        if key.len() > 256 {
5110            return Err(::fidl_next::DecodeError::VectorTooLong {
5111                size: key.len() as u64,
5112                limit: 256,
5113            });
5114        }
5115
5116        ::fidl_next::Decode::decode(value.as_mut(), decoder_)?;
5117
5118        Ok(())
5119    }
5120}
5121
5122#[doc = " Specification for a node that parents the composite node created from the\n composite node specification.\n"]
5123#[derive(PartialEq, Clone, Debug)]
5124pub struct ParentSpec2 {
5125    pub bind_rules: ::std::vec::Vec<crate::BindRule2>,
5126
5127    pub properties: ::std::vec::Vec<crate::NodeProperty2>,
5128}
5129
5130impl ::fidl_next::Encodable for ParentSpec2 {
5131    type Encoded = WireParentSpec2<'static>;
5132}
5133
5134unsafe impl<___E> ::fidl_next::Encode<___E> for ParentSpec2
5135where
5136    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5137    ___E: ::fidl_next::Encoder,
5138{
5139    #[inline]
5140    fn encode(
5141        self,
5142        encoder_: &mut ___E,
5143        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5144    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5145        ::fidl_next::munge! {
5146            let Self::Encoded {
5147                bind_rules,
5148                properties,
5149
5150            } = out_;
5151        }
5152
5153        ::fidl_next::Encode::encode(self.bind_rules, encoder_, bind_rules)?;
5154
5155        ::fidl_next::Encode::encode(self.properties, encoder_, properties)?;
5156
5157        Ok(())
5158    }
5159}
5160
5161unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ParentSpec2
5162where
5163    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5164    ___E: ::fidl_next::Encoder,
5165{
5166    #[inline]
5167    fn encode_ref(
5168        &self,
5169        encoder_: &mut ___E,
5170        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5171    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5172        ::fidl_next::munge! {
5173            let Self::Encoded {
5174
5175                bind_rules,
5176                properties,
5177
5178            } = out_;
5179        }
5180
5181        ::fidl_next::EncodeRef::encode_ref(&self.bind_rules, encoder_, bind_rules)?;
5182
5183        ::fidl_next::EncodeRef::encode_ref(&self.properties, encoder_, properties)?;
5184
5185        Ok(())
5186    }
5187}
5188
5189impl ::fidl_next::EncodableOption for ParentSpec2 {
5190    type EncodedOption = ::fidl_next::WireBox<'static, WireParentSpec2<'static>>;
5191}
5192
5193unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ParentSpec2
5194where
5195    ___E: ::fidl_next::Encoder + ?Sized,
5196    ParentSpec2: ::fidl_next::Encode<___E>,
5197{
5198    #[inline]
5199    fn encode_option(
5200        this: ::core::option::Option<Self>,
5201        encoder: &mut ___E,
5202        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5203    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5204        if let Some(inner) = this {
5205            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5206            ::fidl_next::WireBox::encode_present(out);
5207        } else {
5208            ::fidl_next::WireBox::encode_absent(out);
5209        }
5210
5211        Ok(())
5212    }
5213}
5214
5215unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ParentSpec2
5216where
5217    ___E: ::fidl_next::Encoder + ?Sized,
5218    ParentSpec2: ::fidl_next::EncodeRef<___E>,
5219{
5220    #[inline]
5221    fn encode_option_ref(
5222        this: ::core::option::Option<&Self>,
5223        encoder: &mut ___E,
5224        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5225    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5226        if let Some(inner) = this {
5227            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5228            ::fidl_next::WireBox::encode_present(out);
5229        } else {
5230            ::fidl_next::WireBox::encode_absent(out);
5231        }
5232
5233        Ok(())
5234    }
5235}
5236
5237impl<'de> ::fidl_next::FromWire<WireParentSpec2<'de>> for ParentSpec2 {
5238    #[inline]
5239    fn from_wire(wire: WireParentSpec2<'de>) -> Self {
5240        Self {
5241            bind_rules: ::fidl_next::FromWire::from_wire(wire.bind_rules),
5242
5243            properties: ::fidl_next::FromWire::from_wire(wire.properties),
5244        }
5245    }
5246}
5247
5248impl<'de> ::fidl_next::IntoNatural for WireParentSpec2<'de> {
5249    type Natural = ParentSpec2;
5250}
5251
5252impl<'de> ::fidl_next::FromWireRef<WireParentSpec2<'de>> for ParentSpec2 {
5253    #[inline]
5254    fn from_wire_ref(wire: &WireParentSpec2<'de>) -> Self {
5255        Self {
5256            bind_rules: ::fidl_next::FromWireRef::from_wire_ref(&wire.bind_rules),
5257
5258            properties: ::fidl_next::FromWireRef::from_wire_ref(&wire.properties),
5259        }
5260    }
5261}
5262
5263/// The wire type corresponding to [`ParentSpec2`].
5264#[derive(Debug)]
5265#[repr(C)]
5266pub struct WireParentSpec2<'de> {
5267    pub bind_rules: ::fidl_next::WireVector<'de, crate::WireBindRule2<'de>>,
5268
5269    pub properties: ::fidl_next::WireVector<'de, crate::WireNodeProperty2<'de>>,
5270}
5271static_assertions::const_assert_eq!(std::mem::size_of::<WireParentSpec2<'_>>(), 32);
5272static_assertions::const_assert_eq!(std::mem::align_of::<WireParentSpec2<'_>>(), 8);
5273
5274static_assertions::const_assert_eq!(std::mem::offset_of!(WireParentSpec2<'_>, bind_rules), 0);
5275
5276static_assertions::const_assert_eq!(std::mem::offset_of!(WireParentSpec2<'_>, properties), 16);
5277
5278unsafe impl ::fidl_next::Wire for WireParentSpec2<'static> {
5279    type Decoded<'de> = WireParentSpec2<'de>;
5280
5281    #[inline]
5282    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5283        ::fidl_next::munge! {
5284            let Self {
5285
5286                bind_rules,
5287                properties,
5288
5289            } = &mut *out_;
5290        }
5291
5292        ::fidl_next::Wire::zero_padding(bind_rules);
5293
5294        ::fidl_next::Wire::zero_padding(properties);
5295    }
5296}
5297
5298unsafe impl<___D> ::fidl_next::Decode<___D> for WireParentSpec2<'static>
5299where
5300    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5301    ___D: ::fidl_next::Decoder,
5302{
5303    fn decode(
5304        slot_: ::fidl_next::Slot<'_, Self>,
5305        decoder_: &mut ___D,
5306    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5307        ::fidl_next::munge! {
5308            let Self {
5309
5310                mut bind_rules,
5311                mut properties,
5312
5313            } = slot_;
5314        }
5315
5316        ::fidl_next::Decode::decode(bind_rules.as_mut(), decoder_)?;
5317
5318        let bind_rules = unsafe { bind_rules.deref_unchecked() };
5319
5320        if bind_rules.len() > 64 {
5321            return Err(::fidl_next::DecodeError::VectorTooLong {
5322                size: bind_rules.len() as u64,
5323                limit: 64,
5324            });
5325        }
5326
5327        ::fidl_next::Decode::decode(properties.as_mut(), decoder_)?;
5328
5329        let properties = unsafe { properties.deref_unchecked() };
5330
5331        if properties.len() > 64 {
5332            return Err(::fidl_next::DecodeError::VectorTooLong {
5333                size: properties.len() as u64,
5334                limit: 64,
5335            });
5336        }
5337
5338        Ok(())
5339    }
5340}
5341
5342#[doc = " Struct that represents a composite node specification.\n"]
5343#[derive(PartialEq, Clone, Debug, Default)]
5344pub struct CompositeNodeSpec {
5345    pub name: ::core::option::Option<::std::string::String>,
5346
5347    pub parents: ::core::option::Option<::std::vec::Vec<crate::ParentSpec>>,
5348
5349    pub parents2: ::core::option::Option<::std::vec::Vec<crate::ParentSpec2>>,
5350}
5351
5352impl CompositeNodeSpec {
5353    fn __max_ordinal(&self) -> usize {
5354        if self.parents2.is_some() {
5355            return 3;
5356        }
5357
5358        if self.parents.is_some() {
5359            return 2;
5360        }
5361
5362        if self.name.is_some() {
5363            return 1;
5364        }
5365
5366        0
5367    }
5368}
5369
5370impl ::fidl_next::Encodable for CompositeNodeSpec {
5371    type Encoded = WireCompositeNodeSpec<'static>;
5372}
5373
5374unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeNodeSpec
5375where
5376    ___E: ::fidl_next::Encoder + ?Sized,
5377{
5378    #[inline]
5379    fn encode(
5380        mut self,
5381        encoder: &mut ___E,
5382        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5383    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5384        ::fidl_next::munge!(let WireCompositeNodeSpec { table } = out);
5385
5386        let max_ord = self.__max_ordinal();
5387
5388        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5389        ::fidl_next::Wire::zero_padding(&mut out);
5390
5391        let mut preallocated =
5392            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5393
5394        for i in 1..=max_ord {
5395            match i {
5396                3 => {
5397                    if let Some(value) = self.parents2.take() {
5398                        ::fidl_next::WireEnvelope::encode_value(
5399                            value,
5400                            preallocated.encoder,
5401                            &mut out,
5402                        )?;
5403                    } else {
5404                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5405                    }
5406                }
5407
5408                2 => {
5409                    if let Some(value) = self.parents.take() {
5410                        ::fidl_next::WireEnvelope::encode_value(
5411                            value,
5412                            preallocated.encoder,
5413                            &mut out,
5414                        )?;
5415                    } else {
5416                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5417                    }
5418                }
5419
5420                1 => {
5421                    if let Some(value) = self.name.take() {
5422                        ::fidl_next::WireEnvelope::encode_value(
5423                            value,
5424                            preallocated.encoder,
5425                            &mut out,
5426                        )?;
5427                    } else {
5428                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5429                    }
5430                }
5431
5432                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5433            }
5434            unsafe {
5435                preallocated.write_next(out.assume_init_ref());
5436            }
5437        }
5438
5439        ::fidl_next::WireTable::encode_len(table, max_ord);
5440
5441        Ok(())
5442    }
5443}
5444
5445unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CompositeNodeSpec
5446where
5447    ___E: ::fidl_next::Encoder + ?Sized,
5448{
5449    #[inline]
5450    fn encode_ref(
5451        &self,
5452        encoder: &mut ___E,
5453        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5454    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5455        ::fidl_next::munge!(let WireCompositeNodeSpec { table } = out);
5456
5457        let max_ord = self.__max_ordinal();
5458
5459        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5460        ::fidl_next::Wire::zero_padding(&mut out);
5461
5462        let mut preallocated =
5463            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5464
5465        for i in 1..=max_ord {
5466            match i {
5467                3 => {
5468                    if let Some(value) = &self.parents2 {
5469                        ::fidl_next::WireEnvelope::encode_value(
5470                            value,
5471                            preallocated.encoder,
5472                            &mut out,
5473                        )?;
5474                    } else {
5475                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5476                    }
5477                }
5478
5479                2 => {
5480                    if let Some(value) = &self.parents {
5481                        ::fidl_next::WireEnvelope::encode_value(
5482                            value,
5483                            preallocated.encoder,
5484                            &mut out,
5485                        )?;
5486                    } else {
5487                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5488                    }
5489                }
5490
5491                1 => {
5492                    if let Some(value) = &self.name {
5493                        ::fidl_next::WireEnvelope::encode_value(
5494                            value,
5495                            preallocated.encoder,
5496                            &mut out,
5497                        )?;
5498                    } else {
5499                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5500                    }
5501                }
5502
5503                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5504            }
5505            unsafe {
5506                preallocated.write_next(out.assume_init_ref());
5507            }
5508        }
5509
5510        ::fidl_next::WireTable::encode_len(table, max_ord);
5511
5512        Ok(())
5513    }
5514}
5515
5516impl<'de> ::fidl_next::FromWire<WireCompositeNodeSpec<'de>> for CompositeNodeSpec {
5517    #[inline]
5518    fn from_wire(wire_: WireCompositeNodeSpec<'de>) -> Self {
5519        let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5520
5521        let name = wire_.table.get(1);
5522
5523        let parents = wire_.table.get(2);
5524
5525        let parents2 = wire_.table.get(3);
5526
5527        Self {
5528
5529
5530                name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
5531                    unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
5532                )),
5533
5534
5535                parents: parents.map(|envelope| ::fidl_next::FromWire::from_wire(
5536                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireParentSpec<'de>>>() }
5537                )),
5538
5539
5540                parents2: parents2.map(|envelope| ::fidl_next::FromWire::from_wire(
5541                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireParentSpec2<'de>>>() }
5542                )),
5543
5544        }
5545    }
5546}
5547
5548impl<'de> ::fidl_next::IntoNatural for WireCompositeNodeSpec<'de> {
5549    type Natural = CompositeNodeSpec;
5550}
5551
5552impl<'de> ::fidl_next::FromWireRef<WireCompositeNodeSpec<'de>> for CompositeNodeSpec {
5553    #[inline]
5554    fn from_wire_ref(wire: &WireCompositeNodeSpec<'de>) -> Self {
5555        Self {
5556
5557
5558                name: wire.table.get(1)
5559                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5560                        unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
5561                    )),
5562
5563
5564                parents: wire.table.get(2)
5565                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5566                        unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireParentSpec<'de>>>() }
5567                    )),
5568
5569
5570                parents2: wire.table.get(3)
5571                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5572                        unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireParentSpec2<'de>>>() }
5573                    )),
5574
5575        }
5576    }
5577}
5578
5579/// The wire type corresponding to [`CompositeNodeSpec`].
5580#[repr(C)]
5581pub struct WireCompositeNodeSpec<'de> {
5582    table: ::fidl_next::WireTable<'de>,
5583}
5584
5585impl<'de> Drop for WireCompositeNodeSpec<'de> {
5586    fn drop(&mut self) {
5587        let _ = self
5588            .table
5589            .get(1)
5590            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
5591
5592        let _ = self.table.get(2).map(|envelope| unsafe {
5593            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireParentSpec<'de>>>()
5594        });
5595
5596        let _ = self.table.get(3).map(|envelope| unsafe {
5597            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireParentSpec2<'de>>>()
5598        });
5599    }
5600}
5601
5602unsafe impl ::fidl_next::Wire for WireCompositeNodeSpec<'static> {
5603    type Decoded<'de> = WireCompositeNodeSpec<'de>;
5604
5605    #[inline]
5606    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5607        ::fidl_next::munge!(let Self { table } = out);
5608        ::fidl_next::WireTable::zero_padding(table);
5609    }
5610}
5611
5612unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeNodeSpec<'static>
5613where
5614    ___D: ::fidl_next::Decoder + ?Sized,
5615{
5616    fn decode(
5617        slot: ::fidl_next::Slot<'_, Self>,
5618        decoder: &mut ___D,
5619    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5620        ::fidl_next::munge!(let Self { table } = slot);
5621
5622        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5623            match ordinal {
5624                0 => unsafe { ::core::hint::unreachable_unchecked() },
5625
5626                1 => {
5627                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
5628                        slot.as_mut(),
5629                        decoder,
5630                    )?;
5631
5632                    Ok(())
5633                }
5634
5635                2 => {
5636                    ::fidl_next::WireEnvelope::decode_as::<
5637                        ___D,
5638                        ::fidl_next::WireVector<'static, crate::WireParentSpec<'static>>,
5639                    >(slot.as_mut(), decoder)?;
5640
5641                    Ok(())
5642                }
5643
5644                3 => {
5645                    ::fidl_next::WireEnvelope::decode_as::<
5646                        ___D,
5647                        ::fidl_next::WireVector<'static, crate::WireParentSpec2<'static>>,
5648                    >(slot.as_mut(), decoder)?;
5649
5650                    Ok(())
5651                }
5652
5653                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
5654            }
5655        })
5656    }
5657}
5658
5659impl<'de> WireCompositeNodeSpec<'de> {
5660    pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
5661        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5662    }
5663
5664    pub fn parents(
5665        &self,
5666    ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireParentSpec<'de>>> {
5667        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5668    }
5669
5670    pub fn parents2(
5671        &self,
5672    ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireParentSpec2<'de>>> {
5673        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
5674    }
5675}
5676
5677impl<'de> ::core::fmt::Debug for WireCompositeNodeSpec<'de> {
5678    fn fmt(
5679        &self,
5680        f: &mut ::core::fmt::Formatter<'_>,
5681    ) -> ::core::result::Result<(), ::core::fmt::Error> {
5682        f.debug_struct("CompositeNodeSpec")
5683            .field("name", &self.name())
5684            .field("parents", &self.parents())
5685            .field("parents2", &self.parents2())
5686            .finish()
5687    }
5688}
5689
5690#[doc = " Information for a composite that is defined by a composite node spec.\n"]
5691#[derive(PartialEq, Clone, Debug, Default)]
5692pub struct CompositeInfo {
5693    pub spec: ::core::option::Option<crate::CompositeNodeSpec>,
5694
5695    pub matched_driver: ::core::option::Option<crate::CompositeDriverMatch>,
5696}
5697
5698impl CompositeInfo {
5699    fn __max_ordinal(&self) -> usize {
5700        if self.matched_driver.is_some() {
5701            return 2;
5702        }
5703
5704        if self.spec.is_some() {
5705            return 1;
5706        }
5707
5708        0
5709    }
5710}
5711
5712impl ::fidl_next::Encodable for CompositeInfo {
5713    type Encoded = WireCompositeInfo<'static>;
5714}
5715
5716unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeInfo
5717where
5718    ___E: ::fidl_next::Encoder + ?Sized,
5719{
5720    #[inline]
5721    fn encode(
5722        mut self,
5723        encoder: &mut ___E,
5724        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5725    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5726        ::fidl_next::munge!(let WireCompositeInfo { table } = out);
5727
5728        let max_ord = self.__max_ordinal();
5729
5730        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5731        ::fidl_next::Wire::zero_padding(&mut out);
5732
5733        let mut preallocated =
5734            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5735
5736        for i in 1..=max_ord {
5737            match i {
5738                2 => {
5739                    if let Some(value) = self.matched_driver.take() {
5740                        ::fidl_next::WireEnvelope::encode_value(
5741                            value,
5742                            preallocated.encoder,
5743                            &mut out,
5744                        )?;
5745                    } else {
5746                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5747                    }
5748                }
5749
5750                1 => {
5751                    if let Some(value) = self.spec.take() {
5752                        ::fidl_next::WireEnvelope::encode_value(
5753                            value,
5754                            preallocated.encoder,
5755                            &mut out,
5756                        )?;
5757                    } else {
5758                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5759                    }
5760                }
5761
5762                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5763            }
5764            unsafe {
5765                preallocated.write_next(out.assume_init_ref());
5766            }
5767        }
5768
5769        ::fidl_next::WireTable::encode_len(table, max_ord);
5770
5771        Ok(())
5772    }
5773}
5774
5775unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CompositeInfo
5776where
5777    ___E: ::fidl_next::Encoder + ?Sized,
5778{
5779    #[inline]
5780    fn encode_ref(
5781        &self,
5782        encoder: &mut ___E,
5783        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5784    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5785        ::fidl_next::munge!(let WireCompositeInfo { table } = out);
5786
5787        let max_ord = self.__max_ordinal();
5788
5789        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5790        ::fidl_next::Wire::zero_padding(&mut out);
5791
5792        let mut preallocated =
5793            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5794
5795        for i in 1..=max_ord {
5796            match i {
5797                2 => {
5798                    if let Some(value) = &self.matched_driver {
5799                        ::fidl_next::WireEnvelope::encode_value(
5800                            value,
5801                            preallocated.encoder,
5802                            &mut out,
5803                        )?;
5804                    } else {
5805                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5806                    }
5807                }
5808
5809                1 => {
5810                    if let Some(value) = &self.spec {
5811                        ::fidl_next::WireEnvelope::encode_value(
5812                            value,
5813                            preallocated.encoder,
5814                            &mut out,
5815                        )?;
5816                    } else {
5817                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5818                    }
5819                }
5820
5821                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5822            }
5823            unsafe {
5824                preallocated.write_next(out.assume_init_ref());
5825            }
5826        }
5827
5828        ::fidl_next::WireTable::encode_len(table, max_ord);
5829
5830        Ok(())
5831    }
5832}
5833
5834impl<'de> ::fidl_next::FromWire<WireCompositeInfo<'de>> for CompositeInfo {
5835    #[inline]
5836    fn from_wire(wire_: WireCompositeInfo<'de>) -> Self {
5837        let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5838
5839        let spec = wire_.table.get(1);
5840
5841        let matched_driver = wire_.table.get(2);
5842
5843        Self {
5844            spec: spec.map(|envelope| {
5845                ::fidl_next::FromWire::from_wire(unsafe {
5846                    envelope.read_unchecked::<crate::WireCompositeNodeSpec<'de>>()
5847                })
5848            }),
5849
5850            matched_driver: matched_driver.map(|envelope| {
5851                ::fidl_next::FromWire::from_wire(unsafe {
5852                    envelope.read_unchecked::<crate::WireCompositeDriverMatch<'de>>()
5853                })
5854            }),
5855        }
5856    }
5857}
5858
5859impl<'de> ::fidl_next::IntoNatural for WireCompositeInfo<'de> {
5860    type Natural = CompositeInfo;
5861}
5862
5863impl<'de> ::fidl_next::FromWireRef<WireCompositeInfo<'de>> for CompositeInfo {
5864    #[inline]
5865    fn from_wire_ref(wire: &WireCompositeInfo<'de>) -> Self {
5866        Self {
5867            spec: wire.table.get(1).map(|envelope| {
5868                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5869                    envelope.deref_unchecked::<crate::WireCompositeNodeSpec<'de>>()
5870                })
5871            }),
5872
5873            matched_driver: wire.table.get(2).map(|envelope| {
5874                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5875                    envelope.deref_unchecked::<crate::WireCompositeDriverMatch<'de>>()
5876                })
5877            }),
5878        }
5879    }
5880}
5881
5882/// The wire type corresponding to [`CompositeInfo`].
5883#[repr(C)]
5884pub struct WireCompositeInfo<'de> {
5885    table: ::fidl_next::WireTable<'de>,
5886}
5887
5888impl<'de> Drop for WireCompositeInfo<'de> {
5889    fn drop(&mut self) {
5890        let _ = self.table.get(1).map(|envelope| unsafe {
5891            envelope.read_unchecked::<crate::WireCompositeNodeSpec<'de>>()
5892        });
5893
5894        let _ = self.table.get(2).map(|envelope| unsafe {
5895            envelope.read_unchecked::<crate::WireCompositeDriverMatch<'de>>()
5896        });
5897    }
5898}
5899
5900unsafe impl ::fidl_next::Wire for WireCompositeInfo<'static> {
5901    type Decoded<'de> = WireCompositeInfo<'de>;
5902
5903    #[inline]
5904    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5905        ::fidl_next::munge!(let Self { table } = out);
5906        ::fidl_next::WireTable::zero_padding(table);
5907    }
5908}
5909
5910unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeInfo<'static>
5911where
5912    ___D: ::fidl_next::Decoder + ?Sized,
5913{
5914    fn decode(
5915        slot: ::fidl_next::Slot<'_, Self>,
5916        decoder: &mut ___D,
5917    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5918        ::fidl_next::munge!(let Self { table } = slot);
5919
5920        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5921            match ordinal {
5922                0 => unsafe { ::core::hint::unreachable_unchecked() },
5923
5924                1 => {
5925                    ::fidl_next::WireEnvelope::decode_as::<
5926                        ___D,
5927                        crate::WireCompositeNodeSpec<'static>,
5928                    >(slot.as_mut(), decoder)?;
5929
5930                    Ok(())
5931                }
5932
5933                2 => {
5934                    ::fidl_next::WireEnvelope::decode_as::<
5935                        ___D,
5936                        crate::WireCompositeDriverMatch<'static>,
5937                    >(slot.as_mut(), decoder)?;
5938
5939                    Ok(())
5940                }
5941
5942                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
5943            }
5944        })
5945    }
5946}
5947
5948impl<'de> WireCompositeInfo<'de> {
5949    pub fn spec(&self) -> ::core::option::Option<&crate::WireCompositeNodeSpec<'de>> {
5950        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5951    }
5952
5953    pub fn matched_driver(&self) -> ::core::option::Option<&crate::WireCompositeDriverMatch<'de>> {
5954        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5955    }
5956}
5957
5958impl<'de> ::core::fmt::Debug for WireCompositeInfo<'de> {
5959    fn fmt(
5960        &self,
5961        f: &mut ::core::fmt::Formatter<'_>,
5962    ) -> ::core::result::Result<(), ::core::fmt::Error> {
5963        f.debug_struct("CompositeInfo")
5964            .field("spec", &self.spec())
5965            .field("matched_driver", &self.matched_driver())
5966            .finish()
5967    }
5968}
5969
5970pub type CompositeNodeManagerAddSpecResponse = ();
5971
5972/// The wire type corresponding to [`CompositeNodeManagerAddSpecResponse`].
5973pub type WireCompositeNodeManagerAddSpecResponse = ();
5974
5975#[doc = " Error codes for the CompositeNodeManager protocol.\n"]
5976#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5977#[repr(u32)]
5978pub enum CompositeNodeSpecError {
5979    MissingArgs = 1,
5980    EmptyNodes = 2,
5981    AlreadyExists = 3,
5982    DriverIndexFailure = 4,
5983    DuplicateParents = 5,
5984    UnknownOrdinal_(u32) = 6,
5985}
5986
5987impl ::fidl_next::Encodable for CompositeNodeSpecError {
5988    type Encoded = WireCompositeNodeSpecError;
5989}
5990impl ::std::convert::From<u32> for CompositeNodeSpecError {
5991    fn from(value: u32) -> Self {
5992        match value {
5993            1 => Self::MissingArgs,
5994            2 => Self::EmptyNodes,
5995            3 => Self::AlreadyExists,
5996            4 => Self::DriverIndexFailure,
5997            5 => Self::DuplicateParents,
5998
5999            _ => Self::UnknownOrdinal_(value),
6000        }
6001    }
6002}
6003
6004unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeNodeSpecError
6005where
6006    ___E: ?Sized,
6007{
6008    #[inline]
6009    fn encode(
6010        self,
6011        encoder: &mut ___E,
6012        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6013    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6014        ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
6015    }
6016}
6017
6018unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CompositeNodeSpecError
6019where
6020    ___E: ?Sized,
6021{
6022    #[inline]
6023    fn encode_ref(
6024        &self,
6025        encoder: &mut ___E,
6026        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6027    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6028        ::fidl_next::munge!(let WireCompositeNodeSpecError { value } = out);
6029        let _ = value.write(::fidl_next::WireU32::from(match *self {
6030            Self::MissingArgs => 1,
6031
6032            Self::EmptyNodes => 2,
6033
6034            Self::AlreadyExists => 3,
6035
6036            Self::DriverIndexFailure => 4,
6037
6038            Self::DuplicateParents => 5,
6039
6040            Self::UnknownOrdinal_(value) => value,
6041        }));
6042
6043        Ok(())
6044    }
6045}
6046
6047impl ::core::convert::From<WireCompositeNodeSpecError> for CompositeNodeSpecError {
6048    fn from(wire: WireCompositeNodeSpecError) -> Self {
6049        match u32::from(wire.value) {
6050            1 => Self::MissingArgs,
6051
6052            2 => Self::EmptyNodes,
6053
6054            3 => Self::AlreadyExists,
6055
6056            4 => Self::DriverIndexFailure,
6057
6058            5 => Self::DuplicateParents,
6059
6060            value => Self::UnknownOrdinal_(value),
6061        }
6062    }
6063}
6064
6065impl ::fidl_next::FromWire<WireCompositeNodeSpecError> for CompositeNodeSpecError {
6066    #[inline]
6067    fn from_wire(wire: WireCompositeNodeSpecError) -> Self {
6068        Self::from(wire)
6069    }
6070}
6071
6072impl ::fidl_next::IntoNatural for WireCompositeNodeSpecError {
6073    type Natural = CompositeNodeSpecError;
6074}
6075
6076impl ::fidl_next::FromWireRef<WireCompositeNodeSpecError> for CompositeNodeSpecError {
6077    #[inline]
6078    fn from_wire_ref(wire: &WireCompositeNodeSpecError) -> Self {
6079        Self::from(*wire)
6080    }
6081}
6082
6083/// The wire type corresponding to [`CompositeNodeSpecError`].
6084#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6085#[repr(transparent)]
6086pub struct WireCompositeNodeSpecError {
6087    value: ::fidl_next::WireU32,
6088}
6089
6090unsafe impl ::fidl_next::Wire for WireCompositeNodeSpecError {
6091    type Decoded<'de> = Self;
6092
6093    #[inline]
6094    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
6095        // Wire enums have no padding
6096    }
6097}
6098
6099impl WireCompositeNodeSpecError {
6100    pub const MISSING_ARGS: WireCompositeNodeSpecError =
6101        WireCompositeNodeSpecError { value: ::fidl_next::WireU32(1) };
6102
6103    pub const EMPTY_NODES: WireCompositeNodeSpecError =
6104        WireCompositeNodeSpecError { value: ::fidl_next::WireU32(2) };
6105
6106    pub const ALREADY_EXISTS: WireCompositeNodeSpecError =
6107        WireCompositeNodeSpecError { value: ::fidl_next::WireU32(3) };
6108
6109    pub const DRIVER_INDEX_FAILURE: WireCompositeNodeSpecError =
6110        WireCompositeNodeSpecError { value: ::fidl_next::WireU32(4) };
6111
6112    pub const DUPLICATE_PARENTS: WireCompositeNodeSpecError =
6113        WireCompositeNodeSpecError { value: ::fidl_next::WireU32(5) };
6114}
6115
6116unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeNodeSpecError
6117where
6118    ___D: ?Sized,
6119{
6120    fn decode(
6121        slot: ::fidl_next::Slot<'_, Self>,
6122        _: &mut ___D,
6123    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6124        Ok(())
6125    }
6126}
6127
6128impl ::core::convert::From<CompositeNodeSpecError> for WireCompositeNodeSpecError {
6129    fn from(natural: CompositeNodeSpecError) -> Self {
6130        match natural {
6131            CompositeNodeSpecError::MissingArgs => WireCompositeNodeSpecError::MISSING_ARGS,
6132
6133            CompositeNodeSpecError::EmptyNodes => WireCompositeNodeSpecError::EMPTY_NODES,
6134
6135            CompositeNodeSpecError::AlreadyExists => WireCompositeNodeSpecError::ALREADY_EXISTS,
6136
6137            CompositeNodeSpecError::DriverIndexFailure => {
6138                WireCompositeNodeSpecError::DRIVER_INDEX_FAILURE
6139            }
6140
6141            CompositeNodeSpecError::DuplicateParents => {
6142                WireCompositeNodeSpecError::DUPLICATE_PARENTS
6143            }
6144
6145            CompositeNodeSpecError::UnknownOrdinal_(value) => {
6146                WireCompositeNodeSpecError { value: ::fidl_next::WireU32::from(value) }
6147            }
6148        }
6149    }
6150}
6151
6152/// The type corresponding to the CompositeNodeManager protocol.
6153#[doc = " Protocol through which board drivers can create composite node specs.\n\n Composite node specs are created at runtime to dynamically bridge the\n static bind rules of a composite driver with the dynamic bind properties\n of nodes in the system so that the driver bind rules are more generic and reusable.\n"]
6154#[derive(PartialEq, Debug)]
6155pub struct CompositeNodeManager;
6156
6157impl ::fidl_next::Discoverable for CompositeNodeManager {
6158    const PROTOCOL_NAME: &'static str = "fuchsia.driver.framework.CompositeNodeManager";
6159}
6160
6161pub mod composite_node_manager {
6162    pub mod prelude {
6163        pub use crate::{
6164            CompositeNodeManager, CompositeNodeManagerClientHandler,
6165            CompositeNodeManagerServerHandler, composite_node_manager,
6166        };
6167
6168        pub use crate::CompositeNodeManagerAddSpecResponse;
6169
6170        pub use crate::CompositeNodeSpec;
6171
6172        pub use crate::CompositeNodeSpecError;
6173    }
6174
6175    pub struct AddSpec;
6176
6177    impl ::fidl_next::Method for AddSpec {
6178        const ORDINAL: u64 = 5930736293275290740;
6179
6180        type Protocol = crate::CompositeNodeManager;
6181
6182        type Request = crate::WireCompositeNodeSpec<'static>;
6183
6184        type Response = ::fidl_next::WireFlexibleResult<
6185            'static,
6186            crate::WireCompositeNodeManagerAddSpecResponse,
6187            crate::WireCompositeNodeSpecError,
6188        >;
6189    }
6190
6191    mod ___detail {
6192
6193        unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::CompositeNodeManager
6194        where
6195            ___T: ::fidl_next::Transport,
6196        {
6197            type Client = CompositeNodeManagerClient<___T>;
6198            type Server = CompositeNodeManagerServer<___T>;
6199        }
6200
6201        /// The client for the `CompositeNodeManager` protocol.
6202        #[repr(transparent)]
6203        pub struct CompositeNodeManagerClient<___T: ::fidl_next::Transport> {
6204            #[allow(dead_code)]
6205            client: ::fidl_next::protocol::Client<___T>,
6206        }
6207
6208        impl<___T> CompositeNodeManagerClient<___T>
6209        where
6210            ___T: ::fidl_next::Transport,
6211        {
6212            #[doc = " Adds the given composite node specification to the driver framework.\n"]
6213            pub fn add_spec_with<___R>(
6214                &self,
6215                request: ___R,
6216            ) -> ::fidl_next::TwoWayFuture<'_, super::AddSpec, ___T>
6217            where
6218                ___R: ::fidl_next::Encode<
6219                        <___T as ::fidl_next::Transport>::SendBuffer,
6220                        Encoded = crate::WireCompositeNodeSpec<'static>,
6221                    >,
6222            {
6223                ::fidl_next::TwoWayFuture::from_untyped(
6224                    self.client.send_two_way(5930736293275290740, request),
6225                )
6226            }
6227        }
6228
6229        /// The server for the `CompositeNodeManager` protocol.
6230        #[repr(transparent)]
6231        pub struct CompositeNodeManagerServer<___T: ::fidl_next::Transport> {
6232            server: ::fidl_next::protocol::Server<___T>,
6233        }
6234
6235        impl<___T> CompositeNodeManagerServer<___T> where ___T: ::fidl_next::Transport {}
6236    }
6237}
6238
6239/// A client handler for the CompositeNodeManager protocol.
6240///
6241/// See [`CompositeNodeManager`] for more details.
6242pub trait CompositeNodeManagerClientHandler<
6243    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
6244    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
6245>
6246{
6247    fn on_unknown_interaction(
6248        &mut self,
6249        ordinal: u64,
6250    ) -> impl ::core::future::Future<
6251        Output = ::core::result::Result<
6252            (),
6253            ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
6254        >,
6255    > + ::core::marker::Send {
6256        ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
6257    }
6258}
6259
6260impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for CompositeNodeManager
6261where
6262    ___H: CompositeNodeManagerClientHandler<___T> + ::core::marker::Send,
6263    ___T: ::fidl_next::Transport,
6264    <composite_node_manager::AddSpec as ::fidl_next::Method>::Response:
6265        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6266{
6267    async fn on_event(
6268        handler: &mut ___H,
6269        ordinal: u64,
6270        buffer: ___T::RecvBuffer,
6271    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
6272        match ordinal {
6273            ordinal => handler.on_unknown_interaction(ordinal).await,
6274        }
6275    }
6276}
6277
6278/// A server handler for the CompositeNodeManager protocol.
6279///
6280/// See [`CompositeNodeManager`] for more details.
6281pub trait CompositeNodeManagerServerHandler<
6282    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
6283    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
6284>
6285{
6286    #[doc = " Adds the given composite node specification to the driver framework.\n"]
6287    fn add_spec(
6288        &mut self,
6289
6290        request: ::fidl_next::Request<composite_node_manager::AddSpec, ___T>,
6291
6292        responder: ::fidl_next::Responder<composite_node_manager::AddSpec, ___T>,
6293    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
6294
6295    fn on_unknown_interaction(
6296        &mut self,
6297        ordinal: u64,
6298    ) -> impl ::core::future::Future<
6299        Output = ::core::result::Result<
6300            (),
6301            ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
6302        >,
6303    > + ::core::marker::Send {
6304        ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
6305    }
6306}
6307
6308impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for CompositeNodeManager
6309where
6310    ___H: CompositeNodeManagerServerHandler<___T> + ::core::marker::Send,
6311    ___T: ::fidl_next::Transport,
6312    <composite_node_manager::AddSpec as ::fidl_next::Method>::Request:
6313        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6314{
6315    async fn on_one_way(
6316        handler: &mut ___H,
6317        ordinal: u64,
6318        buffer: ___T::RecvBuffer,
6319    ) -> ::core::result::Result<
6320        (),
6321        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
6322    > {
6323        match ordinal {
6324            ordinal => handler.on_unknown_interaction(ordinal).await,
6325        }
6326    }
6327
6328    async fn on_two_way(
6329        handler: &mut ___H,
6330        ordinal: u64,
6331        buffer: ___T::RecvBuffer,
6332        responder: ::fidl_next::protocol::Responder<___T>,
6333    ) -> ::core::result::Result<
6334        (),
6335        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
6336    > {
6337        match ordinal {
6338            5930736293275290740 => {
6339                let responder = ::fidl_next::Responder::from_untyped(responder);
6340
6341                match ::fidl_next::DecoderExt::decode(buffer) {
6342                    Ok(decoded) => {
6343                        handler.add_spec(decoded, responder).await;
6344                        Ok(())
6345                    }
6346                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
6347                        ordinal: 5930736293275290740,
6348                        error,
6349                    }),
6350                }
6351            }
6352
6353            ordinal => handler.on_unknown_interaction(ordinal).await,
6354        }
6355    }
6356}
6357
6358#[doc = " A parent to a composite that is defined by a composite node spec.\n"]
6359#[derive(PartialEq, Clone, Debug, Default)]
6360pub struct CompositeParent {
6361    pub composite: ::core::option::Option<crate::CompositeInfo>,
6362
6363    pub index: ::core::option::Option<u32>,
6364}
6365
6366impl CompositeParent {
6367    fn __max_ordinal(&self) -> usize {
6368        if self.index.is_some() {
6369            return 2;
6370        }
6371
6372        if self.composite.is_some() {
6373            return 1;
6374        }
6375
6376        0
6377    }
6378}
6379
6380impl ::fidl_next::Encodable for CompositeParent {
6381    type Encoded = WireCompositeParent<'static>;
6382}
6383
6384unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeParent
6385where
6386    ___E: ::fidl_next::Encoder + ?Sized,
6387{
6388    #[inline]
6389    fn encode(
6390        mut self,
6391        encoder: &mut ___E,
6392        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6393    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6394        ::fidl_next::munge!(let WireCompositeParent { table } = out);
6395
6396        let max_ord = self.__max_ordinal();
6397
6398        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
6399        ::fidl_next::Wire::zero_padding(&mut out);
6400
6401        let mut preallocated =
6402            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
6403
6404        for i in 1..=max_ord {
6405            match i {
6406                2 => {
6407                    if let Some(value) = self.index.take() {
6408                        ::fidl_next::WireEnvelope::encode_value(
6409                            value,
6410                            preallocated.encoder,
6411                            &mut out,
6412                        )?;
6413                    } else {
6414                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6415                    }
6416                }
6417
6418                1 => {
6419                    if let Some(value) = self.composite.take() {
6420                        ::fidl_next::WireEnvelope::encode_value(
6421                            value,
6422                            preallocated.encoder,
6423                            &mut out,
6424                        )?;
6425                    } else {
6426                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6427                    }
6428                }
6429
6430                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
6431            }
6432            unsafe {
6433                preallocated.write_next(out.assume_init_ref());
6434            }
6435        }
6436
6437        ::fidl_next::WireTable::encode_len(table, max_ord);
6438
6439        Ok(())
6440    }
6441}
6442
6443unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CompositeParent
6444where
6445    ___E: ::fidl_next::Encoder + ?Sized,
6446{
6447    #[inline]
6448    fn encode_ref(
6449        &self,
6450        encoder: &mut ___E,
6451        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6452    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6453        ::fidl_next::munge!(let WireCompositeParent { table } = out);
6454
6455        let max_ord = self.__max_ordinal();
6456
6457        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
6458        ::fidl_next::Wire::zero_padding(&mut out);
6459
6460        let mut preallocated =
6461            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
6462
6463        for i in 1..=max_ord {
6464            match i {
6465                2 => {
6466                    if let Some(value) = &self.index {
6467                        ::fidl_next::WireEnvelope::encode_value(
6468                            value,
6469                            preallocated.encoder,
6470                            &mut out,
6471                        )?;
6472                    } else {
6473                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6474                    }
6475                }
6476
6477                1 => {
6478                    if let Some(value) = &self.composite {
6479                        ::fidl_next::WireEnvelope::encode_value(
6480                            value,
6481                            preallocated.encoder,
6482                            &mut out,
6483                        )?;
6484                    } else {
6485                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6486                    }
6487                }
6488
6489                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
6490            }
6491            unsafe {
6492                preallocated.write_next(out.assume_init_ref());
6493            }
6494        }
6495
6496        ::fidl_next::WireTable::encode_len(table, max_ord);
6497
6498        Ok(())
6499    }
6500}
6501
6502impl<'de> ::fidl_next::FromWire<WireCompositeParent<'de>> for CompositeParent {
6503    #[inline]
6504    fn from_wire(wire_: WireCompositeParent<'de>) -> Self {
6505        let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6506
6507        let composite = wire_.table.get(1);
6508
6509        let index = wire_.table.get(2);
6510
6511        Self {
6512            composite: composite.map(|envelope| {
6513                ::fidl_next::FromWire::from_wire(unsafe {
6514                    envelope.read_unchecked::<crate::WireCompositeInfo<'de>>()
6515                })
6516            }),
6517
6518            index: index.map(|envelope| {
6519                ::fidl_next::FromWire::from_wire(unsafe {
6520                    envelope.read_unchecked::<::fidl_next::WireU32>()
6521                })
6522            }),
6523        }
6524    }
6525}
6526
6527impl<'de> ::fidl_next::IntoNatural for WireCompositeParent<'de> {
6528    type Natural = CompositeParent;
6529}
6530
6531impl<'de> ::fidl_next::FromWireRef<WireCompositeParent<'de>> for CompositeParent {
6532    #[inline]
6533    fn from_wire_ref(wire: &WireCompositeParent<'de>) -> Self {
6534        Self {
6535            composite: wire.table.get(1).map(|envelope| {
6536                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6537                    envelope.deref_unchecked::<crate::WireCompositeInfo<'de>>()
6538                })
6539            }),
6540
6541            index: wire.table.get(2).map(|envelope| {
6542                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6543                    envelope.deref_unchecked::<::fidl_next::WireU32>()
6544                })
6545            }),
6546        }
6547    }
6548}
6549
6550/// The wire type corresponding to [`CompositeParent`].
6551#[repr(C)]
6552pub struct WireCompositeParent<'de> {
6553    table: ::fidl_next::WireTable<'de>,
6554}
6555
6556impl<'de> Drop for WireCompositeParent<'de> {
6557    fn drop(&mut self) {
6558        let _ = self
6559            .table
6560            .get(1)
6561            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireCompositeInfo<'de>>() });
6562
6563        let _ = self
6564            .table
6565            .get(2)
6566            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
6567    }
6568}
6569
6570unsafe impl ::fidl_next::Wire for WireCompositeParent<'static> {
6571    type Decoded<'de> = WireCompositeParent<'de>;
6572
6573    #[inline]
6574    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6575        ::fidl_next::munge!(let Self { table } = out);
6576        ::fidl_next::WireTable::zero_padding(table);
6577    }
6578}
6579
6580unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeParent<'static>
6581where
6582    ___D: ::fidl_next::Decoder + ?Sized,
6583{
6584    fn decode(
6585        slot: ::fidl_next::Slot<'_, Self>,
6586        decoder: &mut ___D,
6587    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6588        ::fidl_next::munge!(let Self { table } = slot);
6589
6590        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6591            match ordinal {
6592                0 => unsafe { ::core::hint::unreachable_unchecked() },
6593
6594                1 => {
6595                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireCompositeInfo<'static>>(
6596                        slot.as_mut(),
6597                        decoder,
6598                    )?;
6599
6600                    Ok(())
6601                }
6602
6603                2 => {
6604                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
6605                        slot.as_mut(),
6606                        decoder,
6607                    )?;
6608
6609                    Ok(())
6610                }
6611
6612                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
6613            }
6614        })
6615    }
6616}
6617
6618impl<'de> WireCompositeParent<'de> {
6619    pub fn composite(&self) -> ::core::option::Option<&crate::WireCompositeInfo<'de>> {
6620        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6621    }
6622
6623    pub fn index(&self) -> ::core::option::Option<&::fidl_next::WireU32> {
6624        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
6625    }
6626}
6627
6628impl<'de> ::core::fmt::Debug for WireCompositeParent<'de> {
6629    fn fmt(
6630        &self,
6631        f: &mut ::core::fmt::Formatter<'_>,
6632    ) -> ::core::result::Result<(), ::core::fmt::Error> {
6633        f.debug_struct("CompositeParent")
6634            .field("composite", &self.composite())
6635            .field("index", &self.index())
6636            .finish()
6637    }
6638}
6639
6640#[derive(PartialEq, Debug, Default)]
6641pub struct DevfsAddArgs {
6642    pub connector: ::core::option::Option<
6643        ::fidl_next::ClientEnd<
6644            ::fidl_next_fuchsia_device_fs::Connector,
6645            ::fidl_next::fuchsia::zx::Channel,
6646        >,
6647    >,
6648
6649    pub class_name: ::core::option::Option<::std::string::String>,
6650
6651    pub inspect: ::core::option::Option<::fidl_next::fuchsia::zx::Vmo>,
6652
6653    pub connector_supports: ::core::option::Option<::fidl_next_fuchsia_device_fs::ConnectionType>,
6654
6655    pub controller_connector: ::core::option::Option<
6656        ::fidl_next::ClientEnd<
6657            ::fidl_next_fuchsia_device_fs::Connector,
6658            ::fidl_next::fuchsia::zx::Channel,
6659        >,
6660    >,
6661}
6662
6663impl DevfsAddArgs {
6664    fn __max_ordinal(&self) -> usize {
6665        if self.controller_connector.is_some() {
6666            return 5;
6667        }
6668
6669        if self.connector_supports.is_some() {
6670            return 4;
6671        }
6672
6673        if self.inspect.is_some() {
6674            return 3;
6675        }
6676
6677        if self.class_name.is_some() {
6678            return 2;
6679        }
6680
6681        if self.connector.is_some() {
6682            return 1;
6683        }
6684
6685        0
6686    }
6687}
6688
6689impl ::fidl_next::Encodable for DevfsAddArgs {
6690    type Encoded = WireDevfsAddArgs<'static>;
6691}
6692
6693unsafe impl<___E> ::fidl_next::Encode<___E> for DevfsAddArgs
6694where
6695    ___E: ::fidl_next::Encoder + ?Sized,
6696    ___E: ::fidl_next::fuchsia::HandleEncoder,
6697{
6698    #[inline]
6699    fn encode(
6700        mut self,
6701        encoder: &mut ___E,
6702        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6703    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6704        ::fidl_next::munge!(let WireDevfsAddArgs { table } = out);
6705
6706        let max_ord = self.__max_ordinal();
6707
6708        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
6709        ::fidl_next::Wire::zero_padding(&mut out);
6710
6711        let mut preallocated =
6712            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
6713
6714        for i in 1..=max_ord {
6715            match i {
6716                5 => {
6717                    if let Some(value) = self.controller_connector.take() {
6718                        ::fidl_next::WireEnvelope::encode_value(
6719                            value,
6720                            preallocated.encoder,
6721                            &mut out,
6722                        )?;
6723                    } else {
6724                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6725                    }
6726                }
6727
6728                4 => {
6729                    if let Some(value) = self.connector_supports.take() {
6730                        ::fidl_next::WireEnvelope::encode_value(
6731                            value,
6732                            preallocated.encoder,
6733                            &mut out,
6734                        )?;
6735                    } else {
6736                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6737                    }
6738                }
6739
6740                3 => {
6741                    if let Some(value) = self.inspect.take() {
6742                        ::fidl_next::WireEnvelope::encode_value(
6743                            value,
6744                            preallocated.encoder,
6745                            &mut out,
6746                        )?;
6747                    } else {
6748                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6749                    }
6750                }
6751
6752                2 => {
6753                    if let Some(value) = self.class_name.take() {
6754                        ::fidl_next::WireEnvelope::encode_value(
6755                            value,
6756                            preallocated.encoder,
6757                            &mut out,
6758                        )?;
6759                    } else {
6760                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6761                    }
6762                }
6763
6764                1 => {
6765                    if let Some(value) = self.connector.take() {
6766                        ::fidl_next::WireEnvelope::encode_value(
6767                            value,
6768                            preallocated.encoder,
6769                            &mut out,
6770                        )?;
6771                    } else {
6772                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6773                    }
6774                }
6775
6776                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
6777            }
6778            unsafe {
6779                preallocated.write_next(out.assume_init_ref());
6780            }
6781        }
6782
6783        ::fidl_next::WireTable::encode_len(table, max_ord);
6784
6785        Ok(())
6786    }
6787}
6788
6789impl<'de> ::fidl_next::FromWire<WireDevfsAddArgs<'de>> for DevfsAddArgs {
6790    #[inline]
6791    fn from_wire(wire_: WireDevfsAddArgs<'de>) -> Self {
6792        let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6793
6794        let connector = wire_.table.get(1);
6795
6796        let class_name = wire_.table.get(2);
6797
6798        let inspect = wire_.table.get(3);
6799
6800        let connector_supports = wire_.table.get(4);
6801
6802        let controller_connector = wire_.table.get(5);
6803
6804        Self {
6805            connector: connector.map(|envelope| {
6806                ::fidl_next::FromWire::from_wire(unsafe {
6807                    envelope.read_unchecked::<::fidl_next::ClientEnd<
6808                        ::fidl_next_fuchsia_device_fs::Connector,
6809                        ::fidl_next::fuchsia::WireChannel,
6810                    >>()
6811                })
6812            }),
6813
6814            class_name: class_name.map(|envelope| {
6815                ::fidl_next::FromWire::from_wire(unsafe {
6816                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
6817                })
6818            }),
6819
6820            inspect: inspect.map(|envelope| {
6821                ::fidl_next::FromWire::from_wire(unsafe {
6822                    envelope.read_unchecked::<::fidl_next::fuchsia::WireVmo>()
6823                })
6824            }),
6825
6826            connector_supports: connector_supports.map(|envelope| {
6827                ::fidl_next::FromWire::from_wire(unsafe {
6828                    envelope.read_unchecked::<::fidl_next_fuchsia_device_fs::WireConnectionType>()
6829                })
6830            }),
6831
6832            controller_connector: controller_connector.map(|envelope| {
6833                ::fidl_next::FromWire::from_wire(unsafe {
6834                    envelope.read_unchecked::<::fidl_next::ClientEnd<
6835                        ::fidl_next_fuchsia_device_fs::Connector,
6836                        ::fidl_next::fuchsia::WireChannel,
6837                    >>()
6838                })
6839            }),
6840        }
6841    }
6842}
6843
6844impl<'de> ::fidl_next::IntoNatural for WireDevfsAddArgs<'de> {
6845    type Natural = DevfsAddArgs;
6846}
6847
6848/// The wire type corresponding to [`DevfsAddArgs`].
6849#[repr(C)]
6850pub struct WireDevfsAddArgs<'de> {
6851    table: ::fidl_next::WireTable<'de>,
6852}
6853
6854impl<'de> Drop for WireDevfsAddArgs<'de> {
6855    fn drop(&mut self) {
6856        let _ = self.table.get(1).map(|envelope| unsafe {
6857            envelope.read_unchecked::<::fidl_next::ClientEnd<
6858                ::fidl_next_fuchsia_device_fs::Connector,
6859                ::fidl_next::fuchsia::WireChannel,
6860            >>()
6861        });
6862
6863        let _ = self
6864            .table
6865            .get(2)
6866            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
6867
6868        let _ = self
6869            .table
6870            .get(3)
6871            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::fuchsia::WireVmo>() });
6872
6873        let _ = self.table.get(4).map(|envelope| unsafe {
6874            envelope.read_unchecked::<::fidl_next_fuchsia_device_fs::WireConnectionType>()
6875        });
6876
6877        let _ = self.table.get(5).map(|envelope| unsafe {
6878            envelope.read_unchecked::<::fidl_next::ClientEnd<
6879                ::fidl_next_fuchsia_device_fs::Connector,
6880                ::fidl_next::fuchsia::WireChannel,
6881            >>()
6882        });
6883    }
6884}
6885
6886unsafe impl ::fidl_next::Wire for WireDevfsAddArgs<'static> {
6887    type Decoded<'de> = WireDevfsAddArgs<'de>;
6888
6889    #[inline]
6890    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6891        ::fidl_next::munge!(let Self { table } = out);
6892        ::fidl_next::WireTable::zero_padding(table);
6893    }
6894}
6895
6896unsafe impl<___D> ::fidl_next::Decode<___D> for WireDevfsAddArgs<'static>
6897where
6898    ___D: ::fidl_next::Decoder + ?Sized,
6899    ___D: ::fidl_next::fuchsia::HandleDecoder,
6900{
6901    fn decode(
6902        slot: ::fidl_next::Slot<'_, Self>,
6903        decoder: &mut ___D,
6904    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6905        ::fidl_next::munge!(let Self { table } = slot);
6906
6907        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6908            match ordinal {
6909                0 => unsafe { ::core::hint::unreachable_unchecked() },
6910
6911                1 => {
6912                    ::fidl_next::WireEnvelope::decode_as::<
6913                        ___D,
6914                        ::fidl_next::ClientEnd<
6915                            ::fidl_next_fuchsia_device_fs::Connector,
6916                            ::fidl_next::fuchsia::WireChannel,
6917                        >,
6918                    >(slot.as_mut(), decoder)?;
6919
6920                    Ok(())
6921                }
6922
6923                2 => {
6924                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
6925                        slot.as_mut(),
6926                        decoder,
6927                    )?;
6928
6929                    let value = unsafe {
6930                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
6931                    };
6932
6933                    if value.len() > 255 {
6934                        return Err(::fidl_next::DecodeError::VectorTooLong {
6935                            size: value.len() as u64,
6936                            limit: 255,
6937                        });
6938                    }
6939
6940                    Ok(())
6941                }
6942
6943                3 => {
6944                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireVmo>(
6945                        slot.as_mut(),
6946                        decoder,
6947                    )?;
6948
6949                    Ok(())
6950                }
6951
6952                4 => {
6953                    ::fidl_next::WireEnvelope::decode_as::<
6954                        ___D,
6955                        ::fidl_next_fuchsia_device_fs::WireConnectionType,
6956                    >(slot.as_mut(), decoder)?;
6957
6958                    Ok(())
6959                }
6960
6961                5 => {
6962                    ::fidl_next::WireEnvelope::decode_as::<
6963                        ___D,
6964                        ::fidl_next::ClientEnd<
6965                            ::fidl_next_fuchsia_device_fs::Connector,
6966                            ::fidl_next::fuchsia::WireChannel,
6967                        >,
6968                    >(slot.as_mut(), decoder)?;
6969
6970                    Ok(())
6971                }
6972
6973                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
6974            }
6975        })
6976    }
6977}
6978
6979impl<'de> WireDevfsAddArgs<'de> {
6980    pub fn connector(
6981        &self,
6982    ) -> ::core::option::Option<
6983        &::fidl_next::ClientEnd<
6984            ::fidl_next_fuchsia_device_fs::Connector,
6985            ::fidl_next::fuchsia::WireChannel,
6986        >,
6987    > {
6988        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6989    }
6990
6991    pub fn class_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
6992        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
6993    }
6994
6995    pub fn inspect(&self) -> ::core::option::Option<&::fidl_next::fuchsia::WireVmo> {
6996        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
6997    }
6998
6999    pub fn connector_supports(
7000        &self,
7001    ) -> ::core::option::Option<&::fidl_next_fuchsia_device_fs::WireConnectionType> {
7002        unsafe { Some(self.table.get(4)?.deref_unchecked()) }
7003    }
7004
7005    pub fn controller_connector(
7006        &self,
7007    ) -> ::core::option::Option<
7008        &::fidl_next::ClientEnd<
7009            ::fidl_next_fuchsia_device_fs::Connector,
7010            ::fidl_next::fuchsia::WireChannel,
7011        >,
7012    > {
7013        unsafe { Some(self.table.get(5)?.deref_unchecked()) }
7014    }
7015}
7016
7017impl<'de> ::core::fmt::Debug for WireDevfsAddArgs<'de> {
7018    fn fmt(
7019        &self,
7020        f: &mut ::core::fmt::Formatter<'_>,
7021    ) -> ::core::result::Result<(), ::core::fmt::Error> {
7022        f.debug_struct("DevfsAddArgs")
7023            .field("connector", &self.connector())
7024            .field("class_name", &self.class_name())
7025            .field("inspect", &self.inspect())
7026            .field("connector_supports", &self.connector_supports())
7027            .field("controller_connector", &self.controller_connector())
7028            .finish()
7029    }
7030}
7031
7032pub const MAX_SYMBOL_NAME_LENGTH: u8 = 128 as u8;
7033
7034pub const MAX_SYMBOL_COUNT: u8 = 64 as u8;
7035
7036pub const MAX_NAMESPACE_COUNT: u32 = 32 as u32;
7037
7038pub type DriverStartResponse = ();
7039
7040/// The wire type corresponding to [`DriverStartResponse`].
7041pub type WireDriverStartResponse = ();
7042
7043pub const MAX_NODE_NAME_LENGTH: u8 = 128 as u8;
7044
7045pub type NodeName = ::std::string::String;
7046
7047/// The wire type corresponding to [`NodeName`].
7048pub type WireNodeName<'de> = ::fidl_next::WireString<'de>;
7049
7050pub type NodePropertyVector = ::std::vec::Vec<crate::NodeProperty>;
7051
7052/// The wire type corresponding to [`NodePropertyVector`].
7053pub type WireNodePropertyVector<'de> = ::fidl_next::WireVector<'de, crate::WireNodeProperty<'de>>;
7054
7055pub const MAX_OFFER_COUNT: u32 = 128 as u32;
7056
7057#[doc = " Contains the node properties that belong to a node.\n"]
7058#[derive(PartialEq, Clone, Debug)]
7059pub struct NodePropertyEntry {
7060    pub name: ::std::string::String,
7061
7062    pub properties: ::std::vec::Vec<crate::NodeProperty>,
7063}
7064
7065impl ::fidl_next::Encodable for NodePropertyEntry {
7066    type Encoded = WireNodePropertyEntry<'static>;
7067}
7068
7069unsafe impl<___E> ::fidl_next::Encode<___E> for NodePropertyEntry
7070where
7071    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7072    ___E: ::fidl_next::Encoder,
7073{
7074    #[inline]
7075    fn encode(
7076        self,
7077        encoder_: &mut ___E,
7078        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7079    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7080        ::fidl_next::munge! {
7081            let Self::Encoded {
7082                name,
7083                properties,
7084
7085            } = out_;
7086        }
7087
7088        ::fidl_next::Encode::encode(self.name, encoder_, name)?;
7089
7090        ::fidl_next::Encode::encode(self.properties, encoder_, properties)?;
7091
7092        Ok(())
7093    }
7094}
7095
7096unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodePropertyEntry
7097where
7098    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7099    ___E: ::fidl_next::Encoder,
7100{
7101    #[inline]
7102    fn encode_ref(
7103        &self,
7104        encoder_: &mut ___E,
7105        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7106    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7107        ::fidl_next::munge! {
7108            let Self::Encoded {
7109
7110                name,
7111                properties,
7112
7113            } = out_;
7114        }
7115
7116        ::fidl_next::EncodeRef::encode_ref(&self.name, encoder_, name)?;
7117
7118        ::fidl_next::EncodeRef::encode_ref(&self.properties, encoder_, properties)?;
7119
7120        Ok(())
7121    }
7122}
7123
7124impl ::fidl_next::EncodableOption for NodePropertyEntry {
7125    type EncodedOption = ::fidl_next::WireBox<'static, WireNodePropertyEntry<'static>>;
7126}
7127
7128unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodePropertyEntry
7129where
7130    ___E: ::fidl_next::Encoder + ?Sized,
7131    NodePropertyEntry: ::fidl_next::Encode<___E>,
7132{
7133    #[inline]
7134    fn encode_option(
7135        this: ::core::option::Option<Self>,
7136        encoder: &mut ___E,
7137        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7138    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7139        if let Some(inner) = this {
7140            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7141            ::fidl_next::WireBox::encode_present(out);
7142        } else {
7143            ::fidl_next::WireBox::encode_absent(out);
7144        }
7145
7146        Ok(())
7147    }
7148}
7149
7150unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodePropertyEntry
7151where
7152    ___E: ::fidl_next::Encoder + ?Sized,
7153    NodePropertyEntry: ::fidl_next::EncodeRef<___E>,
7154{
7155    #[inline]
7156    fn encode_option_ref(
7157        this: ::core::option::Option<&Self>,
7158        encoder: &mut ___E,
7159        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7160    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7161        if let Some(inner) = this {
7162            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7163            ::fidl_next::WireBox::encode_present(out);
7164        } else {
7165            ::fidl_next::WireBox::encode_absent(out);
7166        }
7167
7168        Ok(())
7169    }
7170}
7171
7172impl<'de> ::fidl_next::FromWire<WireNodePropertyEntry<'de>> for NodePropertyEntry {
7173    #[inline]
7174    fn from_wire(wire: WireNodePropertyEntry<'de>) -> Self {
7175        Self {
7176            name: ::fidl_next::FromWire::from_wire(wire.name),
7177
7178            properties: ::fidl_next::FromWire::from_wire(wire.properties),
7179        }
7180    }
7181}
7182
7183impl<'de> ::fidl_next::IntoNatural for WireNodePropertyEntry<'de> {
7184    type Natural = NodePropertyEntry;
7185}
7186
7187impl<'de> ::fidl_next::FromWireRef<WireNodePropertyEntry<'de>> for NodePropertyEntry {
7188    #[inline]
7189    fn from_wire_ref(wire: &WireNodePropertyEntry<'de>) -> Self {
7190        Self {
7191            name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
7192
7193            properties: ::fidl_next::FromWireRef::from_wire_ref(&wire.properties),
7194        }
7195    }
7196}
7197
7198/// The wire type corresponding to [`NodePropertyEntry`].
7199#[derive(Debug)]
7200#[repr(C)]
7201pub struct WireNodePropertyEntry<'de> {
7202    pub name: ::fidl_next::WireString<'de>,
7203
7204    pub properties: ::fidl_next::WireVector<'de, crate::WireNodeProperty<'de>>,
7205}
7206static_assertions::const_assert_eq!(std::mem::size_of::<WireNodePropertyEntry<'_>>(), 32);
7207static_assertions::const_assert_eq!(std::mem::align_of::<WireNodePropertyEntry<'_>>(), 8);
7208
7209static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodePropertyEntry<'_>, name), 0);
7210
7211static_assertions::const_assert_eq!(
7212    std::mem::offset_of!(WireNodePropertyEntry<'_>, properties),
7213    16
7214);
7215
7216unsafe impl ::fidl_next::Wire for WireNodePropertyEntry<'static> {
7217    type Decoded<'de> = WireNodePropertyEntry<'de>;
7218
7219    #[inline]
7220    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
7221        ::fidl_next::munge! {
7222            let Self {
7223
7224                name,
7225                properties,
7226
7227            } = &mut *out_;
7228        }
7229
7230        ::fidl_next::Wire::zero_padding(name);
7231
7232        ::fidl_next::Wire::zero_padding(properties);
7233    }
7234}
7235
7236unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodePropertyEntry<'static>
7237where
7238    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7239    ___D: ::fidl_next::Decoder,
7240{
7241    fn decode(
7242        slot_: ::fidl_next::Slot<'_, Self>,
7243        decoder_: &mut ___D,
7244    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7245        ::fidl_next::munge! {
7246            let Self {
7247
7248                mut name,
7249                mut properties,
7250
7251            } = slot_;
7252        }
7253
7254        ::fidl_next::Decode::decode(name.as_mut(), decoder_)?;
7255
7256        let name = unsafe { name.deref_unchecked() };
7257
7258        if name.len() > 128 {
7259            return Err(::fidl_next::DecodeError::VectorTooLong {
7260                size: name.len() as u64,
7261                limit: 128,
7262            });
7263        }
7264
7265        ::fidl_next::Decode::decode(properties.as_mut(), decoder_)?;
7266
7267        let properties = unsafe { properties.deref_unchecked() };
7268
7269        if properties.len() > 64 {
7270            return Err(::fidl_next::DecodeError::VectorTooLong {
7271                size: properties.len() as u64,
7272                limit: 64,
7273            });
7274        }
7275
7276        Ok(())
7277    }
7278}
7279
7280pub type NodePropertyDictionary = ::std::vec::Vec<crate::NodePropertyEntry>;
7281
7282/// The wire type corresponding to [`NodePropertyDictionary`].
7283pub type WireNodePropertyDictionary<'de> =
7284    ::fidl_next::WireVector<'de, crate::WireNodePropertyEntry<'de>>;
7285
7286pub type NodeProperties = ::std::vec::Vec<crate::NodeProperty2>;
7287
7288/// The wire type corresponding to [`NodeProperties`].
7289pub type WireNodeProperties<'de> = ::fidl_next::WireVector<'de, crate::WireNodeProperty2<'de>>;
7290
7291#[doc = " Contains the node properties that belong to a node.\n"]
7292#[derive(PartialEq, Clone, Debug)]
7293pub struct NodePropertyEntry2 {
7294    pub name: ::std::string::String,
7295
7296    pub properties: ::std::vec::Vec<crate::NodeProperty2>,
7297}
7298
7299impl ::fidl_next::Encodable for NodePropertyEntry2 {
7300    type Encoded = WireNodePropertyEntry2<'static>;
7301}
7302
7303unsafe impl<___E> ::fidl_next::Encode<___E> for NodePropertyEntry2
7304where
7305    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7306    ___E: ::fidl_next::Encoder,
7307{
7308    #[inline]
7309    fn encode(
7310        self,
7311        encoder_: &mut ___E,
7312        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7313    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7314        ::fidl_next::munge! {
7315            let Self::Encoded {
7316                name,
7317                properties,
7318
7319            } = out_;
7320        }
7321
7322        ::fidl_next::Encode::encode(self.name, encoder_, name)?;
7323
7324        ::fidl_next::Encode::encode(self.properties, encoder_, properties)?;
7325
7326        Ok(())
7327    }
7328}
7329
7330unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodePropertyEntry2
7331where
7332    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7333    ___E: ::fidl_next::Encoder,
7334{
7335    #[inline]
7336    fn encode_ref(
7337        &self,
7338        encoder_: &mut ___E,
7339        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7340    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7341        ::fidl_next::munge! {
7342            let Self::Encoded {
7343
7344                name,
7345                properties,
7346
7347            } = out_;
7348        }
7349
7350        ::fidl_next::EncodeRef::encode_ref(&self.name, encoder_, name)?;
7351
7352        ::fidl_next::EncodeRef::encode_ref(&self.properties, encoder_, properties)?;
7353
7354        Ok(())
7355    }
7356}
7357
7358impl ::fidl_next::EncodableOption for NodePropertyEntry2 {
7359    type EncodedOption = ::fidl_next::WireBox<'static, WireNodePropertyEntry2<'static>>;
7360}
7361
7362unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodePropertyEntry2
7363where
7364    ___E: ::fidl_next::Encoder + ?Sized,
7365    NodePropertyEntry2: ::fidl_next::Encode<___E>,
7366{
7367    #[inline]
7368    fn encode_option(
7369        this: ::core::option::Option<Self>,
7370        encoder: &mut ___E,
7371        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7372    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7373        if let Some(inner) = this {
7374            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7375            ::fidl_next::WireBox::encode_present(out);
7376        } else {
7377            ::fidl_next::WireBox::encode_absent(out);
7378        }
7379
7380        Ok(())
7381    }
7382}
7383
7384unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodePropertyEntry2
7385where
7386    ___E: ::fidl_next::Encoder + ?Sized,
7387    NodePropertyEntry2: ::fidl_next::EncodeRef<___E>,
7388{
7389    #[inline]
7390    fn encode_option_ref(
7391        this: ::core::option::Option<&Self>,
7392        encoder: &mut ___E,
7393        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7394    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7395        if let Some(inner) = this {
7396            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7397            ::fidl_next::WireBox::encode_present(out);
7398        } else {
7399            ::fidl_next::WireBox::encode_absent(out);
7400        }
7401
7402        Ok(())
7403    }
7404}
7405
7406impl<'de> ::fidl_next::FromWire<WireNodePropertyEntry2<'de>> for NodePropertyEntry2 {
7407    #[inline]
7408    fn from_wire(wire: WireNodePropertyEntry2<'de>) -> Self {
7409        Self {
7410            name: ::fidl_next::FromWire::from_wire(wire.name),
7411
7412            properties: ::fidl_next::FromWire::from_wire(wire.properties),
7413        }
7414    }
7415}
7416
7417impl<'de> ::fidl_next::IntoNatural for WireNodePropertyEntry2<'de> {
7418    type Natural = NodePropertyEntry2;
7419}
7420
7421impl<'de> ::fidl_next::FromWireRef<WireNodePropertyEntry2<'de>> for NodePropertyEntry2 {
7422    #[inline]
7423    fn from_wire_ref(wire: &WireNodePropertyEntry2<'de>) -> Self {
7424        Self {
7425            name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
7426
7427            properties: ::fidl_next::FromWireRef::from_wire_ref(&wire.properties),
7428        }
7429    }
7430}
7431
7432/// The wire type corresponding to [`NodePropertyEntry2`].
7433#[derive(Debug)]
7434#[repr(C)]
7435pub struct WireNodePropertyEntry2<'de> {
7436    pub name: ::fidl_next::WireString<'de>,
7437
7438    pub properties: ::fidl_next::WireVector<'de, crate::WireNodeProperty2<'de>>,
7439}
7440static_assertions::const_assert_eq!(std::mem::size_of::<WireNodePropertyEntry2<'_>>(), 32);
7441static_assertions::const_assert_eq!(std::mem::align_of::<WireNodePropertyEntry2<'_>>(), 8);
7442
7443static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodePropertyEntry2<'_>, name), 0);
7444
7445static_assertions::const_assert_eq!(
7446    std::mem::offset_of!(WireNodePropertyEntry2<'_>, properties),
7447    16
7448);
7449
7450unsafe impl ::fidl_next::Wire for WireNodePropertyEntry2<'static> {
7451    type Decoded<'de> = WireNodePropertyEntry2<'de>;
7452
7453    #[inline]
7454    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
7455        ::fidl_next::munge! {
7456            let Self {
7457
7458                name,
7459                properties,
7460
7461            } = &mut *out_;
7462        }
7463
7464        ::fidl_next::Wire::zero_padding(name);
7465
7466        ::fidl_next::Wire::zero_padding(properties);
7467    }
7468}
7469
7470unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodePropertyEntry2<'static>
7471where
7472    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7473    ___D: ::fidl_next::Decoder,
7474{
7475    fn decode(
7476        slot_: ::fidl_next::Slot<'_, Self>,
7477        decoder_: &mut ___D,
7478    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7479        ::fidl_next::munge! {
7480            let Self {
7481
7482                mut name,
7483                mut properties,
7484
7485            } = slot_;
7486        }
7487
7488        ::fidl_next::Decode::decode(name.as_mut(), decoder_)?;
7489
7490        let name = unsafe { name.deref_unchecked() };
7491
7492        if name.len() > 128 {
7493            return Err(::fidl_next::DecodeError::VectorTooLong {
7494                size: name.len() as u64,
7495                limit: 128,
7496            });
7497        }
7498
7499        ::fidl_next::Decode::decode(properties.as_mut(), decoder_)?;
7500
7501        let properties = unsafe { properties.deref_unchecked() };
7502
7503        if properties.len() > 64 {
7504            return Err(::fidl_next::DecodeError::VectorTooLong {
7505                size: properties.len() as u64,
7506                limit: 64,
7507            });
7508        }
7509
7510        Ok(())
7511    }
7512}
7513
7514pub type NodePropertyDictionary2 = ::std::vec::Vec<crate::NodePropertyEntry2>;
7515
7516/// The wire type corresponding to [`NodePropertyDictionary2`].
7517pub type WireNodePropertyDictionary2<'de> =
7518    ::fidl_next::WireVector<'de, crate::WireNodePropertyEntry2<'de>>;
7519
7520pub const MAX_MODULE_NAME_LENGTH: u8 = 128 as u8;
7521
7522#[doc = " Definition of a symbol provided by a driver for a node. A symbol is local to\n a driver host.\n"]
7523#[derive(PartialEq, Clone, Debug, Default)]
7524pub struct NodeSymbol {
7525    pub name: ::core::option::Option<::std::string::String>,
7526
7527    pub address: ::core::option::Option<u64>,
7528
7529    pub module_name: ::core::option::Option<::std::string::String>,
7530}
7531
7532impl NodeSymbol {
7533    fn __max_ordinal(&self) -> usize {
7534        if self.module_name.is_some() {
7535            return 3;
7536        }
7537
7538        if self.address.is_some() {
7539            return 2;
7540        }
7541
7542        if self.name.is_some() {
7543            return 1;
7544        }
7545
7546        0
7547    }
7548}
7549
7550impl ::fidl_next::Encodable for NodeSymbol {
7551    type Encoded = WireNodeSymbol<'static>;
7552}
7553
7554unsafe impl<___E> ::fidl_next::Encode<___E> for NodeSymbol
7555where
7556    ___E: ::fidl_next::Encoder + ?Sized,
7557{
7558    #[inline]
7559    fn encode(
7560        mut self,
7561        encoder: &mut ___E,
7562        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7563    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7564        ::fidl_next::munge!(let WireNodeSymbol { table } = out);
7565
7566        let max_ord = self.__max_ordinal();
7567
7568        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7569        ::fidl_next::Wire::zero_padding(&mut out);
7570
7571        let mut preallocated =
7572            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7573
7574        for i in 1..=max_ord {
7575            match i {
7576                3 => {
7577                    if let Some(value) = self.module_name.take() {
7578                        ::fidl_next::WireEnvelope::encode_value(
7579                            value,
7580                            preallocated.encoder,
7581                            &mut out,
7582                        )?;
7583                    } else {
7584                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
7585                    }
7586                }
7587
7588                2 => {
7589                    if let Some(value) = self.address.take() {
7590                        ::fidl_next::WireEnvelope::encode_value(
7591                            value,
7592                            preallocated.encoder,
7593                            &mut out,
7594                        )?;
7595                    } else {
7596                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
7597                    }
7598                }
7599
7600                1 => {
7601                    if let Some(value) = self.name.take() {
7602                        ::fidl_next::WireEnvelope::encode_value(
7603                            value,
7604                            preallocated.encoder,
7605                            &mut out,
7606                        )?;
7607                    } else {
7608                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
7609                    }
7610                }
7611
7612                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7613            }
7614            unsafe {
7615                preallocated.write_next(out.assume_init_ref());
7616            }
7617        }
7618
7619        ::fidl_next::WireTable::encode_len(table, max_ord);
7620
7621        Ok(())
7622    }
7623}
7624
7625unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeSymbol
7626where
7627    ___E: ::fidl_next::Encoder + ?Sized,
7628{
7629    #[inline]
7630    fn encode_ref(
7631        &self,
7632        encoder: &mut ___E,
7633        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7634    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7635        ::fidl_next::munge!(let WireNodeSymbol { table } = out);
7636
7637        let max_ord = self.__max_ordinal();
7638
7639        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7640        ::fidl_next::Wire::zero_padding(&mut out);
7641
7642        let mut preallocated =
7643            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7644
7645        for i in 1..=max_ord {
7646            match i {
7647                3 => {
7648                    if let Some(value) = &self.module_name {
7649                        ::fidl_next::WireEnvelope::encode_value(
7650                            value,
7651                            preallocated.encoder,
7652                            &mut out,
7653                        )?;
7654                    } else {
7655                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
7656                    }
7657                }
7658
7659                2 => {
7660                    if let Some(value) = &self.address {
7661                        ::fidl_next::WireEnvelope::encode_value(
7662                            value,
7663                            preallocated.encoder,
7664                            &mut out,
7665                        )?;
7666                    } else {
7667                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
7668                    }
7669                }
7670
7671                1 => {
7672                    if let Some(value) = &self.name {
7673                        ::fidl_next::WireEnvelope::encode_value(
7674                            value,
7675                            preallocated.encoder,
7676                            &mut out,
7677                        )?;
7678                    } else {
7679                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
7680                    }
7681                }
7682
7683                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7684            }
7685            unsafe {
7686                preallocated.write_next(out.assume_init_ref());
7687            }
7688        }
7689
7690        ::fidl_next::WireTable::encode_len(table, max_ord);
7691
7692        Ok(())
7693    }
7694}
7695
7696impl<'de> ::fidl_next::FromWire<WireNodeSymbol<'de>> for NodeSymbol {
7697    #[inline]
7698    fn from_wire(wire_: WireNodeSymbol<'de>) -> Self {
7699        let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7700
7701        let name = wire_.table.get(1);
7702
7703        let address = wire_.table.get(2);
7704
7705        let module_name = wire_.table.get(3);
7706
7707        Self {
7708            name: name.map(|envelope| {
7709                ::fidl_next::FromWire::from_wire(unsafe {
7710                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7711                })
7712            }),
7713
7714            address: address.map(|envelope| {
7715                ::fidl_next::FromWire::from_wire(unsafe {
7716                    envelope.read_unchecked::<::fidl_next::WireU64>()
7717                })
7718            }),
7719
7720            module_name: module_name.map(|envelope| {
7721                ::fidl_next::FromWire::from_wire(unsafe {
7722                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7723                })
7724            }),
7725        }
7726    }
7727}
7728
7729impl<'de> ::fidl_next::IntoNatural for WireNodeSymbol<'de> {
7730    type Natural = NodeSymbol;
7731}
7732
7733impl<'de> ::fidl_next::FromWireRef<WireNodeSymbol<'de>> for NodeSymbol {
7734    #[inline]
7735    fn from_wire_ref(wire: &WireNodeSymbol<'de>) -> Self {
7736        Self {
7737            name: wire.table.get(1).map(|envelope| {
7738                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7739                    envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7740                })
7741            }),
7742
7743            address: wire.table.get(2).map(|envelope| {
7744                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7745                    envelope.deref_unchecked::<::fidl_next::WireU64>()
7746                })
7747            }),
7748
7749            module_name: wire.table.get(3).map(|envelope| {
7750                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7751                    envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7752                })
7753            }),
7754        }
7755    }
7756}
7757
7758/// The wire type corresponding to [`NodeSymbol`].
7759#[repr(C)]
7760pub struct WireNodeSymbol<'de> {
7761    table: ::fidl_next::WireTable<'de>,
7762}
7763
7764impl<'de> Drop for WireNodeSymbol<'de> {
7765    fn drop(&mut self) {
7766        let _ = self
7767            .table
7768            .get(1)
7769            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
7770
7771        let _ = self
7772            .table
7773            .get(2)
7774            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
7775
7776        let _ = self
7777            .table
7778            .get(3)
7779            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
7780    }
7781}
7782
7783unsafe impl ::fidl_next::Wire for WireNodeSymbol<'static> {
7784    type Decoded<'de> = WireNodeSymbol<'de>;
7785
7786    #[inline]
7787    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7788        ::fidl_next::munge!(let Self { table } = out);
7789        ::fidl_next::WireTable::zero_padding(table);
7790    }
7791}
7792
7793unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeSymbol<'static>
7794where
7795    ___D: ::fidl_next::Decoder + ?Sized,
7796{
7797    fn decode(
7798        slot: ::fidl_next::Slot<'_, Self>,
7799        decoder: &mut ___D,
7800    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7801        ::fidl_next::munge!(let Self { table } = slot);
7802
7803        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
7804            match ordinal {
7805                0 => unsafe { ::core::hint::unreachable_unchecked() },
7806
7807                1 => {
7808                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
7809                        slot.as_mut(),
7810                        decoder,
7811                    )?;
7812
7813                    let value = unsafe {
7814                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
7815                    };
7816
7817                    if value.len() > 128 {
7818                        return Err(::fidl_next::DecodeError::VectorTooLong {
7819                            size: value.len() as u64,
7820                            limit: 128,
7821                        });
7822                    }
7823
7824                    Ok(())
7825                }
7826
7827                2 => {
7828                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
7829                        slot.as_mut(),
7830                        decoder,
7831                    )?;
7832
7833                    Ok(())
7834                }
7835
7836                3 => {
7837                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
7838                        slot.as_mut(),
7839                        decoder,
7840                    )?;
7841
7842                    let value = unsafe {
7843                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
7844                    };
7845
7846                    if value.len() > 128 {
7847                        return Err(::fidl_next::DecodeError::VectorTooLong {
7848                            size: value.len() as u64,
7849                            limit: 128,
7850                        });
7851                    }
7852
7853                    Ok(())
7854                }
7855
7856                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
7857            }
7858        })
7859    }
7860}
7861
7862impl<'de> WireNodeSymbol<'de> {
7863    pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
7864        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
7865    }
7866
7867    pub fn address(&self) -> ::core::option::Option<&::fidl_next::WireU64> {
7868        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
7869    }
7870
7871    pub fn module_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
7872        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
7873    }
7874}
7875
7876impl<'de> ::core::fmt::Debug for WireNodeSymbol<'de> {
7877    fn fmt(
7878        &self,
7879        f: &mut ::core::fmt::Formatter<'_>,
7880    ) -> ::core::result::Result<(), ::core::fmt::Error> {
7881        f.debug_struct("NodeSymbol")
7882            .field("name", &self.name())
7883            .field("address", &self.address())
7884            .field("module_name", &self.module_name())
7885            .finish()
7886    }
7887}
7888
7889#[derive(PartialEq, Clone, Debug)]
7890pub enum Offer {
7891    ZirconTransport(::fidl_next_fuchsia_component_decl::Offer),
7892
7893    DriverTransport(::fidl_next_fuchsia_component_decl::Offer),
7894
7895    UnknownOrdinal_(u64),
7896}
7897
7898impl ::fidl_next::Encodable for Offer {
7899    type Encoded = WireOffer<'static>;
7900}
7901
7902unsafe impl<___E> ::fidl_next::Encode<___E> for Offer
7903where
7904    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7905    ___E: ::fidl_next::Encoder,
7906{
7907    #[inline]
7908    fn encode(
7909        self,
7910        encoder: &mut ___E,
7911        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7912    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7913        ::fidl_next::munge!(let WireOffer { raw, _phantom: _ } = out);
7914
7915        match self {
7916            Self::ZirconTransport(value) => ::fidl_next::RawWireUnion::encode_as::<
7917                ___E,
7918                ::fidl_next_fuchsia_component_decl::Offer,
7919            >(value, 1, encoder, raw)?,
7920
7921            Self::DriverTransport(value) => ::fidl_next::RawWireUnion::encode_as::<
7922                ___E,
7923                ::fidl_next_fuchsia_component_decl::Offer,
7924            >(value, 2, encoder, raw)?,
7925
7926            Self::UnknownOrdinal_(ordinal) => {
7927                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
7928            }
7929        }
7930
7931        Ok(())
7932    }
7933}
7934
7935unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Offer
7936where
7937    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7938    ___E: ::fidl_next::Encoder,
7939{
7940    #[inline]
7941    fn encode_ref(
7942        &self,
7943        encoder: &mut ___E,
7944        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7945    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7946        ::fidl_next::munge!(let WireOffer { raw, _phantom: _ } = out);
7947
7948        match self {
7949            Self::ZirconTransport(value) => ::fidl_next::RawWireUnion::encode_as::<
7950                ___E,
7951                &::fidl_next_fuchsia_component_decl::Offer,
7952            >(value, 1, encoder, raw)?,
7953
7954            Self::DriverTransport(value) => ::fidl_next::RawWireUnion::encode_as::<
7955                ___E,
7956                &::fidl_next_fuchsia_component_decl::Offer,
7957            >(value, 2, encoder, raw)?,
7958
7959            Self::UnknownOrdinal_(ordinal) => {
7960                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
7961            }
7962        }
7963
7964        Ok(())
7965    }
7966}
7967
7968impl ::fidl_next::EncodableOption for Offer {
7969    type EncodedOption = WireOptionalOffer<'static>;
7970}
7971
7972unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Offer
7973where
7974    ___E: ?Sized,
7975    Offer: ::fidl_next::Encode<___E>,
7976{
7977    #[inline]
7978    fn encode_option(
7979        this: ::core::option::Option<Self>,
7980        encoder: &mut ___E,
7981        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7982    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7983        ::fidl_next::munge!(let WireOptionalOffer { raw, _phantom: _ } = &mut *out);
7984
7985        if let Some(inner) = this {
7986            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7987            ::fidl_next::Encode::encode(inner, encoder, value_out)?;
7988        } else {
7989            ::fidl_next::RawWireUnion::encode_absent(raw);
7990        }
7991
7992        Ok(())
7993    }
7994}
7995
7996unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Offer
7997where
7998    ___E: ?Sized,
7999    Offer: ::fidl_next::EncodeRef<___E>,
8000{
8001    #[inline]
8002    fn encode_option_ref(
8003        this: ::core::option::Option<&Self>,
8004        encoder: &mut ___E,
8005        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8006    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8007        ::fidl_next::munge!(let WireOptionalOffer { raw, _phantom: _ } = &mut *out);
8008
8009        if let Some(inner) = this {
8010            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
8011            ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
8012        } else {
8013            ::fidl_next::RawWireUnion::encode_absent(raw);
8014        }
8015
8016        Ok(())
8017    }
8018}
8019
8020impl<'de> ::fidl_next::FromWire<WireOffer<'de>> for Offer {
8021    #[inline]
8022    fn from_wire(wire: WireOffer<'de>) -> Self {
8023        let wire = ::core::mem::ManuallyDrop::new(wire);
8024        match wire.raw.ordinal() {
8025            1 => Self::ZirconTransport(::fidl_next::FromWire::from_wire(unsafe {
8026                wire.raw
8027                    .get()
8028                    .read_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'de>>()
8029            })),
8030
8031            2 => Self::DriverTransport(::fidl_next::FromWire::from_wire(unsafe {
8032                wire.raw
8033                    .get()
8034                    .read_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'de>>()
8035            })),
8036
8037            _ => unsafe { ::core::hint::unreachable_unchecked() },
8038        }
8039    }
8040}
8041
8042impl<'de> ::fidl_next::IntoNatural for WireOffer<'de> {
8043    type Natural = Offer;
8044}
8045
8046impl<'de> ::fidl_next::FromWireRef<WireOffer<'de>> for Offer {
8047    #[inline]
8048    fn from_wire_ref(wire: &WireOffer<'de>) -> Self {
8049        match wire.raw.ordinal() {
8050            1 => Self::ZirconTransport(::fidl_next::FromWireRef::from_wire_ref(unsafe {
8051                wire.raw
8052                    .get()
8053                    .deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'de>>()
8054            })),
8055
8056            2 => Self::DriverTransport(::fidl_next::FromWireRef::from_wire_ref(unsafe {
8057                wire.raw
8058                    .get()
8059                    .deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'de>>()
8060            })),
8061
8062            _ => unsafe { ::core::hint::unreachable_unchecked() },
8063        }
8064    }
8065}
8066
8067impl<'de> ::fidl_next::FromWireOption<WireOptionalOffer<'de>> for Offer {
8068    #[inline]
8069    fn from_wire_option(wire: WireOptionalOffer<'de>) -> ::core::option::Option<Self> {
8070        if let Some(inner) = wire.into_option() {
8071            Some(::fidl_next::FromWire::from_wire(inner))
8072        } else {
8073            None
8074        }
8075    }
8076}
8077
8078impl<'de> ::fidl_next::IntoNatural for WireOptionalOffer<'de> {
8079    type Natural = ::core::option::Option<Offer>;
8080}
8081
8082impl<'de> ::fidl_next::FromWireOption<WireOptionalOffer<'de>> for Box<Offer> {
8083    #[inline]
8084    fn from_wire_option(wire: WireOptionalOffer<'de>) -> ::core::option::Option<Self> {
8085        <Offer as ::fidl_next::FromWireOption<WireOptionalOffer<'de>>>::from_wire_option(wire)
8086            .map(Box::new)
8087    }
8088}
8089
8090impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalOffer<'de>> for Box<Offer> {
8091    #[inline]
8092    fn from_wire_option_ref(wire: &WireOptionalOffer<'de>) -> ::core::option::Option<Self> {
8093        if let Some(inner) = wire.as_ref() {
8094            Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
8095        } else {
8096            None
8097        }
8098    }
8099}
8100
8101/// The wire type corresponding to [`Offer`].
8102#[repr(transparent)]
8103pub struct WireOffer<'de> {
8104    raw: ::fidl_next::RawWireUnion,
8105    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
8106}
8107
8108impl<'de> Drop for WireOffer<'de> {
8109    fn drop(&mut self) {
8110        match self.raw.ordinal() {
8111            1 => {
8112                let _ = unsafe {
8113                    self.raw
8114                        .get()
8115                        .read_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'de>>()
8116                };
8117            }
8118
8119            2 => {
8120                let _ = unsafe {
8121                    self.raw
8122                        .get()
8123                        .read_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'de>>()
8124                };
8125            }
8126
8127            _ => (),
8128        }
8129    }
8130}
8131
8132unsafe impl ::fidl_next::Wire for WireOffer<'static> {
8133    type Decoded<'de> = WireOffer<'de>;
8134
8135    #[inline]
8136    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8137        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
8138        ::fidl_next::RawWireUnion::zero_padding(raw);
8139    }
8140}
8141
8142pub mod offer {
8143    pub enum Ref<'de> {
8144        ZirconTransport(&'de ::fidl_next_fuchsia_component_decl::WireOffer<'de>),
8145
8146        DriverTransport(&'de ::fidl_next_fuchsia_component_decl::WireOffer<'de>),
8147
8148        UnknownOrdinal_(u64),
8149    }
8150}
8151
8152impl<'de> WireOffer<'de> {
8153    pub fn as_ref(&self) -> crate::offer::Ref<'_> {
8154        match self.raw.ordinal() {
8155            1 => crate::offer::Ref::ZirconTransport(unsafe {
8156                self.raw
8157                    .get()
8158                    .deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'_>>()
8159            }),
8160
8161            2 => crate::offer::Ref::DriverTransport(unsafe {
8162                self.raw
8163                    .get()
8164                    .deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'_>>()
8165            }),
8166
8167            unknown => crate::offer::Ref::UnknownOrdinal_(unknown),
8168        }
8169    }
8170}
8171
8172unsafe impl<___D> ::fidl_next::Decode<___D> for WireOffer<'static>
8173where
8174    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8175    ___D: ::fidl_next::Decoder,
8176{
8177    fn decode(
8178        mut slot: ::fidl_next::Slot<'_, Self>,
8179        decoder: &mut ___D,
8180    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8181        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
8182        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
8183            1 => ::fidl_next::RawWireUnion::decode_as::<
8184                ___D,
8185                ::fidl_next_fuchsia_component_decl::WireOffer<'static>,
8186            >(raw, decoder)?,
8187
8188            2 => ::fidl_next::RawWireUnion::decode_as::<
8189                ___D,
8190                ::fidl_next_fuchsia_component_decl::WireOffer<'static>,
8191            >(raw, decoder)?,
8192
8193            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
8194        }
8195
8196        Ok(())
8197    }
8198}
8199
8200impl<'de> ::core::fmt::Debug for WireOffer<'de> {
8201    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8202        match self.raw.ordinal() {
8203            1 => unsafe {
8204                self.raw
8205                    .get()
8206                    .deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'_>>()
8207                    .fmt(f)
8208            },
8209            2 => unsafe {
8210                self.raw
8211                    .get()
8212                    .deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'_>>()
8213                    .fmt(f)
8214            },
8215            _ => unsafe { ::core::hint::unreachable_unchecked() },
8216        }
8217    }
8218}
8219
8220#[repr(transparent)]
8221pub struct WireOptionalOffer<'de> {
8222    raw: ::fidl_next::RawWireUnion,
8223    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
8224}
8225
8226unsafe impl ::fidl_next::Wire for WireOptionalOffer<'static> {
8227    type Decoded<'de> = WireOptionalOffer<'de>;
8228
8229    #[inline]
8230    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8231        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
8232        ::fidl_next::RawWireUnion::zero_padding(raw);
8233    }
8234}
8235
8236impl<'de> WireOptionalOffer<'de> {
8237    pub fn is_some(&self) -> bool {
8238        self.raw.is_some()
8239    }
8240
8241    pub fn is_none(&self) -> bool {
8242        self.raw.is_none()
8243    }
8244
8245    pub fn as_ref(&self) -> ::core::option::Option<&WireOffer<'de>> {
8246        if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
8247    }
8248
8249    pub fn into_option(self) -> ::core::option::Option<WireOffer<'de>> {
8250        if self.is_some() {
8251            Some(WireOffer { raw: self.raw, _phantom: ::core::marker::PhantomData })
8252        } else {
8253            None
8254        }
8255    }
8256}
8257
8258unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalOffer<'static>
8259where
8260    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8261    ___D: ::fidl_next::Decoder,
8262{
8263    fn decode(
8264        mut slot: ::fidl_next::Slot<'_, Self>,
8265        decoder: &mut ___D,
8266    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8267        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
8268        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
8269            1 => ::fidl_next::RawWireUnion::decode_as::<
8270                ___D,
8271                ::fidl_next_fuchsia_component_decl::WireOffer<'static>,
8272            >(raw, decoder)?,
8273
8274            2 => ::fidl_next::RawWireUnion::decode_as::<
8275                ___D,
8276                ::fidl_next_fuchsia_component_decl::WireOffer<'static>,
8277            >(raw, decoder)?,
8278
8279            0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
8280            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
8281        }
8282
8283        Ok(())
8284    }
8285}
8286
8287impl<'de> ::core::fmt::Debug for WireOptionalOffer<'de> {
8288    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8289        self.as_ref().fmt(f)
8290    }
8291}
8292
8293pub type NodeOffersVector = ::std::vec::Vec<crate::Offer>;
8294
8295/// The wire type corresponding to [`NodeOffersVector`].
8296pub type WireNodeOffersVector<'de> = ::fidl_next::WireVector<'de, crate::WireOffer<'de>>;
8297
8298#[doc = " Arguments for starting a driver.\n"]
8299#[derive(PartialEq, Debug, Default)]
8300pub struct DriverStartArgs {
8301    pub node: ::core::option::Option<
8302        ::fidl_next::ClientEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel>,
8303    >,
8304
8305    pub symbols: ::core::option::Option<::std::vec::Vec<crate::NodeSymbol>>,
8306
8307    pub url: ::core::option::Option<::std::string::String>,
8308
8309    pub program: ::core::option::Option<::fidl_next_fuchsia_data::Dictionary>,
8310
8311    pub incoming: ::core::option::Option<
8312        ::std::vec::Vec<::fidl_next_fuchsia_component_runner::ComponentNamespaceEntry>,
8313    >,
8314
8315    pub outgoing_dir: ::core::option::Option<
8316        ::fidl_next::ServerEnd<
8317            ::fidl_next_fuchsia_io::Directory,
8318            ::fidl_next::fuchsia::zx::Channel,
8319        >,
8320    >,
8321
8322    pub config: ::core::option::Option<::fidl_next::fuchsia::zx::Vmo>,
8323
8324    pub node_name: ::core::option::Option<::std::string::String>,
8325
8326    pub node_properties: ::core::option::Option<::std::vec::Vec<crate::NodePropertyEntry>>,
8327
8328    pub node_offers: ::core::option::Option<::std::vec::Vec<crate::Offer>>,
8329
8330    pub node_token: ::core::option::Option<::fidl_next::fuchsia::zx::Event>,
8331
8332    pub node_properties_2: ::core::option::Option<::std::vec::Vec<crate::NodePropertyEntry2>>,
8333
8334    pub vmar: ::core::option::Option<::fidl_next::fuchsia::zx::Vmar>,
8335}
8336
8337impl DriverStartArgs {
8338    fn __max_ordinal(&self) -> usize {
8339        if self.vmar.is_some() {
8340            return 13;
8341        }
8342
8343        if self.node_properties_2.is_some() {
8344            return 12;
8345        }
8346
8347        if self.node_token.is_some() {
8348            return 11;
8349        }
8350
8351        if self.node_offers.is_some() {
8352            return 10;
8353        }
8354
8355        if self.node_properties.is_some() {
8356            return 9;
8357        }
8358
8359        if self.node_name.is_some() {
8360            return 8;
8361        }
8362
8363        if self.config.is_some() {
8364            return 7;
8365        }
8366
8367        if self.outgoing_dir.is_some() {
8368            return 6;
8369        }
8370
8371        if self.incoming.is_some() {
8372            return 5;
8373        }
8374
8375        if self.program.is_some() {
8376            return 4;
8377        }
8378
8379        if self.url.is_some() {
8380            return 3;
8381        }
8382
8383        if self.symbols.is_some() {
8384            return 2;
8385        }
8386
8387        if self.node.is_some() {
8388            return 1;
8389        }
8390
8391        0
8392    }
8393}
8394
8395impl ::fidl_next::Encodable for DriverStartArgs {
8396    type Encoded = WireDriverStartArgs<'static>;
8397}
8398
8399unsafe impl<___E> ::fidl_next::Encode<___E> for DriverStartArgs
8400where
8401    ___E: ::fidl_next::Encoder + ?Sized,
8402    ___E: ::fidl_next::fuchsia::HandleEncoder,
8403{
8404    #[inline]
8405    fn encode(
8406        mut self,
8407        encoder: &mut ___E,
8408        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8409    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8410        ::fidl_next::munge!(let WireDriverStartArgs { table } = out);
8411
8412        let max_ord = self.__max_ordinal();
8413
8414        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8415        ::fidl_next::Wire::zero_padding(&mut out);
8416
8417        let mut preallocated =
8418            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8419
8420        for i in 1..=max_ord {
8421            match i {
8422                13 => {
8423                    if let Some(value) = self.vmar.take() {
8424                        ::fidl_next::WireEnvelope::encode_value(
8425                            value,
8426                            preallocated.encoder,
8427                            &mut out,
8428                        )?;
8429                    } else {
8430                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8431                    }
8432                }
8433
8434                12 => {
8435                    if let Some(value) = self.node_properties_2.take() {
8436                        ::fidl_next::WireEnvelope::encode_value(
8437                            value,
8438                            preallocated.encoder,
8439                            &mut out,
8440                        )?;
8441                    } else {
8442                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8443                    }
8444                }
8445
8446                11 => {
8447                    if let Some(value) = self.node_token.take() {
8448                        ::fidl_next::WireEnvelope::encode_value(
8449                            value,
8450                            preallocated.encoder,
8451                            &mut out,
8452                        )?;
8453                    } else {
8454                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8455                    }
8456                }
8457
8458                10 => {
8459                    if let Some(value) = self.node_offers.take() {
8460                        ::fidl_next::WireEnvelope::encode_value(
8461                            value,
8462                            preallocated.encoder,
8463                            &mut out,
8464                        )?;
8465                    } else {
8466                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8467                    }
8468                }
8469
8470                9 => {
8471                    if let Some(value) = self.node_properties.take() {
8472                        ::fidl_next::WireEnvelope::encode_value(
8473                            value,
8474                            preallocated.encoder,
8475                            &mut out,
8476                        )?;
8477                    } else {
8478                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8479                    }
8480                }
8481
8482                8 => {
8483                    if let Some(value) = self.node_name.take() {
8484                        ::fidl_next::WireEnvelope::encode_value(
8485                            value,
8486                            preallocated.encoder,
8487                            &mut out,
8488                        )?;
8489                    } else {
8490                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8491                    }
8492                }
8493
8494                7 => {
8495                    if let Some(value) = self.config.take() {
8496                        ::fidl_next::WireEnvelope::encode_value(
8497                            value,
8498                            preallocated.encoder,
8499                            &mut out,
8500                        )?;
8501                    } else {
8502                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8503                    }
8504                }
8505
8506                6 => {
8507                    if let Some(value) = self.outgoing_dir.take() {
8508                        ::fidl_next::WireEnvelope::encode_value(
8509                            value,
8510                            preallocated.encoder,
8511                            &mut out,
8512                        )?;
8513                    } else {
8514                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8515                    }
8516                }
8517
8518                5 => {
8519                    if let Some(value) = self.incoming.take() {
8520                        ::fidl_next::WireEnvelope::encode_value(
8521                            value,
8522                            preallocated.encoder,
8523                            &mut out,
8524                        )?;
8525                    } else {
8526                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8527                    }
8528                }
8529
8530                4 => {
8531                    if let Some(value) = self.program.take() {
8532                        ::fidl_next::WireEnvelope::encode_value(
8533                            value,
8534                            preallocated.encoder,
8535                            &mut out,
8536                        )?;
8537                    } else {
8538                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8539                    }
8540                }
8541
8542                3 => {
8543                    if let Some(value) = self.url.take() {
8544                        ::fidl_next::WireEnvelope::encode_value(
8545                            value,
8546                            preallocated.encoder,
8547                            &mut out,
8548                        )?;
8549                    } else {
8550                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8551                    }
8552                }
8553
8554                2 => {
8555                    if let Some(value) = self.symbols.take() {
8556                        ::fidl_next::WireEnvelope::encode_value(
8557                            value,
8558                            preallocated.encoder,
8559                            &mut out,
8560                        )?;
8561                    } else {
8562                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8563                    }
8564                }
8565
8566                1 => {
8567                    if let Some(value) = self.node.take() {
8568                        ::fidl_next::WireEnvelope::encode_value(
8569                            value,
8570                            preallocated.encoder,
8571                            &mut out,
8572                        )?;
8573                    } else {
8574                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8575                    }
8576                }
8577
8578                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8579            }
8580            unsafe {
8581                preallocated.write_next(out.assume_init_ref());
8582            }
8583        }
8584
8585        ::fidl_next::WireTable::encode_len(table, max_ord);
8586
8587        Ok(())
8588    }
8589}
8590
8591impl<'de> ::fidl_next::FromWire<WireDriverStartArgs<'de>> for DriverStartArgs {
8592    #[inline]
8593    fn from_wire(wire_: WireDriverStartArgs<'de>) -> Self {
8594        let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8595
8596        let node = wire_.table.get(1);
8597
8598        let symbols = wire_.table.get(2);
8599
8600        let url = wire_.table.get(3);
8601
8602        let program = wire_.table.get(4);
8603
8604        let incoming = wire_.table.get(5);
8605
8606        let outgoing_dir = wire_.table.get(6);
8607
8608        let config = wire_.table.get(7);
8609
8610        let node_name = wire_.table.get(8);
8611
8612        let node_properties = wire_.table.get(9);
8613
8614        let node_offers = wire_.table.get(10);
8615
8616        let node_token = wire_.table.get(11);
8617
8618        let node_properties_2 = wire_.table.get(12);
8619
8620        let vmar = wire_.table.get(13);
8621
8622        Self {
8623
8624
8625                node: node.map(|envelope| ::fidl_next::FromWire::from_wire(
8626                    unsafe { envelope.read_unchecked::<::fidl_next::ClientEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>>() }
8627                )),
8628
8629
8630                symbols: symbols.map(|envelope| ::fidl_next::FromWire::from_wire(
8631                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeSymbol<'de>>>() }
8632                )),
8633
8634
8635                url: url.map(|envelope| ::fidl_next::FromWire::from_wire(
8636                    unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
8637                )),
8638
8639
8640                program: program.map(|envelope| ::fidl_next::FromWire::from_wire(
8641                    unsafe { envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>() }
8642                )),
8643
8644
8645                incoming: incoming.map(|envelope| ::fidl_next::FromWire::from_wire(
8646                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next_fuchsia_component_runner::WireComponentNamespaceEntry<'de>>>() }
8647                )),
8648
8649
8650                outgoing_dir: outgoing_dir.map(|envelope| ::fidl_next::FromWire::from_wire(
8651                    unsafe { envelope.read_unchecked::<::fidl_next::ServerEnd<::fidl_next_fuchsia_io::Directory, ::fidl_next::fuchsia::WireChannel>>() }
8652                )),
8653
8654
8655                config: config.map(|envelope| ::fidl_next::FromWire::from_wire(
8656                    unsafe { envelope.read_unchecked::<::fidl_next::fuchsia::WireVmo>() }
8657                )),
8658
8659
8660                node_name: node_name.map(|envelope| ::fidl_next::FromWire::from_wire(
8661                    unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
8662                )),
8663
8664
8665                node_properties: node_properties.map(|envelope| ::fidl_next::FromWire::from_wire(
8666                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodePropertyEntry<'de>>>() }
8667                )),
8668
8669
8670                node_offers: node_offers.map(|envelope| ::fidl_next::FromWire::from_wire(
8671                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireOffer<'de>>>() }
8672                )),
8673
8674
8675                node_token: node_token.map(|envelope| ::fidl_next::FromWire::from_wire(
8676                    unsafe { envelope.read_unchecked::<::fidl_next::fuchsia::WireEvent>() }
8677                )),
8678
8679
8680                node_properties_2: node_properties_2.map(|envelope| ::fidl_next::FromWire::from_wire(
8681                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodePropertyEntry2<'de>>>() }
8682                )),
8683
8684
8685                vmar: vmar.map(|envelope| ::fidl_next::FromWire::from_wire(
8686                    unsafe { envelope.read_unchecked::<::fidl_next::fuchsia::WireVmar>() }
8687                )),
8688
8689        }
8690    }
8691}
8692
8693impl<'de> ::fidl_next::IntoNatural for WireDriverStartArgs<'de> {
8694    type Natural = DriverStartArgs;
8695}
8696
8697/// The wire type corresponding to [`DriverStartArgs`].
8698#[repr(C)]
8699pub struct WireDriverStartArgs<'de> {
8700    table: ::fidl_next::WireTable<'de>,
8701}
8702
8703impl<'de> Drop for WireDriverStartArgs<'de> {
8704    fn drop(&mut self) {
8705        let _ = self.table.get(1)
8706                .map(|envelope| unsafe {
8707                    envelope.read_unchecked::<::fidl_next::ClientEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>>()
8708                });
8709
8710        let _ = self.table.get(2).map(|envelope| unsafe {
8711            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeSymbol<'de>>>()
8712        });
8713
8714        let _ = self
8715            .table
8716            .get(3)
8717            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
8718
8719        let _ = self.table.get(4).map(|envelope| unsafe {
8720            envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
8721        });
8722
8723        let _ = self.table.get(5).map(|envelope| unsafe {
8724            envelope.read_unchecked::<::fidl_next::WireVector<
8725                'de,
8726                ::fidl_next_fuchsia_component_runner::WireComponentNamespaceEntry<'de>,
8727            >>()
8728        });
8729
8730        let _ = self.table.get(6).map(|envelope| unsafe {
8731            envelope.read_unchecked::<::fidl_next::ServerEnd<
8732                ::fidl_next_fuchsia_io::Directory,
8733                ::fidl_next::fuchsia::WireChannel,
8734            >>()
8735        });
8736
8737        let _ = self
8738            .table
8739            .get(7)
8740            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::fuchsia::WireVmo>() });
8741
8742        let _ = self
8743            .table
8744            .get(8)
8745            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
8746
8747        let _ = self.table.get(9)
8748                .map(|envelope| unsafe {
8749                    envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodePropertyEntry<'de>>>()
8750                });
8751
8752        let _ = self.table.get(10).map(|envelope| unsafe {
8753            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireOffer<'de>>>()
8754        });
8755
8756        let _ = self.table.get(11).map(|envelope| unsafe {
8757            envelope.read_unchecked::<::fidl_next::fuchsia::WireEvent>()
8758        });
8759
8760        let _ = self.table.get(12).map(|envelope| unsafe {
8761            envelope
8762                .read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodePropertyEntry2<'de>>>(
8763                )
8764        });
8765
8766        let _ = self
8767            .table
8768            .get(13)
8769            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::fuchsia::WireVmar>() });
8770    }
8771}
8772
8773unsafe impl ::fidl_next::Wire for WireDriverStartArgs<'static> {
8774    type Decoded<'de> = WireDriverStartArgs<'de>;
8775
8776    #[inline]
8777    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8778        ::fidl_next::munge!(let Self { table } = out);
8779        ::fidl_next::WireTable::zero_padding(table);
8780    }
8781}
8782
8783unsafe impl<___D> ::fidl_next::Decode<___D> for WireDriverStartArgs<'static>
8784where
8785    ___D: ::fidl_next::Decoder + ?Sized,
8786    ___D: ::fidl_next::fuchsia::HandleDecoder,
8787{
8788    fn decode(
8789        slot: ::fidl_next::Slot<'_, Self>,
8790        decoder: &mut ___D,
8791    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8792        ::fidl_next::munge!(let Self { table } = slot);
8793
8794        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8795            match ordinal {
8796                0 => unsafe { ::core::hint::unreachable_unchecked() },
8797
8798                1 => {
8799                    ::fidl_next::WireEnvelope::decode_as::<
8800                        ___D,
8801                        ::fidl_next::ClientEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
8802                    >(slot.as_mut(), decoder)?;
8803
8804                    Ok(())
8805                }
8806
8807                2 => {
8808                    ::fidl_next::WireEnvelope::decode_as::<
8809                        ___D,
8810                        ::fidl_next::WireVector<'static, crate::WireNodeSymbol<'static>>,
8811                    >(slot.as_mut(), decoder)?;
8812
8813                    let value = unsafe {
8814                        slot
8815                                            .deref_unchecked()
8816                                            .deref_unchecked::<
8817                                                ::fidl_next::WireVector<'_, crate::WireNodeSymbol<'_>>
8818                                            >()
8819                    };
8820
8821                    if value.len() > 64 {
8822                        return Err(::fidl_next::DecodeError::VectorTooLong {
8823                            size: value.len() as u64,
8824                            limit: 64,
8825                        });
8826                    }
8827
8828                    Ok(())
8829                }
8830
8831                3 => {
8832                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
8833                        slot.as_mut(),
8834                        decoder,
8835                    )?;
8836
8837                    let value = unsafe {
8838                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
8839                    };
8840
8841                    if value.len() > 4096 {
8842                        return Err(::fidl_next::DecodeError::VectorTooLong {
8843                            size: value.len() as u64,
8844                            limit: 4096,
8845                        });
8846                    }
8847
8848                    Ok(())
8849                }
8850
8851                4 => {
8852                    ::fidl_next::WireEnvelope::decode_as::<
8853                        ___D,
8854                        ::fidl_next_fuchsia_data::WireDictionary<'static>,
8855                    >(slot.as_mut(), decoder)?;
8856
8857                    Ok(())
8858                }
8859
8860                5 => {
8861                    ::fidl_next::WireEnvelope::decode_as::<
8862                        ___D,
8863                        ::fidl_next::WireVector<
8864                            'static,
8865                            ::fidl_next_fuchsia_component_runner::WireComponentNamespaceEntry<
8866                                'static,
8867                            >,
8868                        >,
8869                    >(slot.as_mut(), decoder)?;
8870
8871                    let value = unsafe {
8872                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<
8873                            '_,
8874                            ::fidl_next_fuchsia_component_runner::WireComponentNamespaceEntry<'_>,
8875                        >>()
8876                    };
8877
8878                    if value.len() > 32 {
8879                        return Err(::fidl_next::DecodeError::VectorTooLong {
8880                            size: value.len() as u64,
8881                            limit: 32,
8882                        });
8883                    }
8884
8885                    Ok(())
8886                }
8887
8888                6 => {
8889                    ::fidl_next::WireEnvelope::decode_as::<
8890                        ___D,
8891                        ::fidl_next::ServerEnd<
8892                            ::fidl_next_fuchsia_io::Directory,
8893                            ::fidl_next::fuchsia::WireChannel,
8894                        >,
8895                    >(slot.as_mut(), decoder)?;
8896
8897                    Ok(())
8898                }
8899
8900                7 => {
8901                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireVmo>(
8902                        slot.as_mut(),
8903                        decoder,
8904                    )?;
8905
8906                    Ok(())
8907                }
8908
8909                8 => {
8910                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
8911                        slot.as_mut(),
8912                        decoder,
8913                    )?;
8914
8915                    Ok(())
8916                }
8917
8918                9 => {
8919                    ::fidl_next::WireEnvelope::decode_as::<
8920                        ___D,
8921                        ::fidl_next::WireVector<'static, crate::WireNodePropertyEntry<'static>>,
8922                    >(slot.as_mut(), decoder)?;
8923
8924                    Ok(())
8925                }
8926
8927                10 => {
8928                    ::fidl_next::WireEnvelope::decode_as::<
8929                        ___D,
8930                        ::fidl_next::WireVector<'static, crate::WireOffer<'static>>,
8931                    >(slot.as_mut(), decoder)?;
8932
8933                    let value = unsafe {
8934                        slot.deref_unchecked()
8935                            .deref_unchecked::<::fidl_next::WireVector<'_, crate::WireOffer<'_>>>()
8936                    };
8937
8938                    if value.len() > 128 {
8939                        return Err(::fidl_next::DecodeError::VectorTooLong {
8940                            size: value.len() as u64,
8941                            limit: 128,
8942                        });
8943                    }
8944
8945                    Ok(())
8946                }
8947
8948                11 => {
8949                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireEvent>(
8950                        slot.as_mut(),
8951                        decoder,
8952                    )?;
8953
8954                    Ok(())
8955                }
8956
8957                12 => {
8958                    ::fidl_next::WireEnvelope::decode_as::<
8959                        ___D,
8960                        ::fidl_next::WireVector<'static, crate::WireNodePropertyEntry2<'static>>,
8961                    >(slot.as_mut(), decoder)?;
8962
8963                    Ok(())
8964                }
8965
8966                13 => {
8967                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireVmar>(
8968                        slot.as_mut(),
8969                        decoder,
8970                    )?;
8971
8972                    Ok(())
8973                }
8974
8975                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
8976            }
8977        })
8978    }
8979}
8980
8981impl<'de> WireDriverStartArgs<'de> {
8982    pub fn node(
8983        &self,
8984    ) -> ::core::option::Option<
8985        &::fidl_next::ClientEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
8986    > {
8987        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8988    }
8989
8990    pub fn symbols(
8991        &self,
8992    ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireNodeSymbol<'de>>> {
8993        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
8994    }
8995
8996    pub fn url(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
8997        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
8998    }
8999
9000    pub fn program(
9001        &self,
9002    ) -> ::core::option::Option<&::fidl_next_fuchsia_data::WireDictionary<'de>> {
9003        unsafe { Some(self.table.get(4)?.deref_unchecked()) }
9004    }
9005
9006    pub fn incoming(
9007        &self,
9008    ) -> ::core::option::Option<
9009        &::fidl_next::WireVector<
9010            'de,
9011            ::fidl_next_fuchsia_component_runner::WireComponentNamespaceEntry<'de>,
9012        >,
9013    > {
9014        unsafe { Some(self.table.get(5)?.deref_unchecked()) }
9015    }
9016
9017    pub fn outgoing_dir(
9018        &self,
9019    ) -> ::core::option::Option<
9020        &::fidl_next::ServerEnd<
9021            ::fidl_next_fuchsia_io::Directory,
9022            ::fidl_next::fuchsia::WireChannel,
9023        >,
9024    > {
9025        unsafe { Some(self.table.get(6)?.deref_unchecked()) }
9026    }
9027
9028    pub fn config(&self) -> ::core::option::Option<&::fidl_next::fuchsia::WireVmo> {
9029        unsafe { Some(self.table.get(7)?.deref_unchecked()) }
9030    }
9031
9032    pub fn node_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
9033        unsafe { Some(self.table.get(8)?.deref_unchecked()) }
9034    }
9035
9036    pub fn node_properties(
9037        &self,
9038    ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireNodePropertyEntry<'de>>>
9039    {
9040        unsafe { Some(self.table.get(9)?.deref_unchecked()) }
9041    }
9042
9043    pub fn node_offers(
9044        &self,
9045    ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireOffer<'de>>> {
9046        unsafe { Some(self.table.get(10)?.deref_unchecked()) }
9047    }
9048
9049    pub fn node_token(&self) -> ::core::option::Option<&::fidl_next::fuchsia::WireEvent> {
9050        unsafe { Some(self.table.get(11)?.deref_unchecked()) }
9051    }
9052
9053    pub fn node_properties_2(
9054        &self,
9055    ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireNodePropertyEntry2<'de>>>
9056    {
9057        unsafe { Some(self.table.get(12)?.deref_unchecked()) }
9058    }
9059
9060    pub fn vmar(&self) -> ::core::option::Option<&::fidl_next::fuchsia::WireVmar> {
9061        unsafe { Some(self.table.get(13)?.deref_unchecked()) }
9062    }
9063}
9064
9065impl<'de> ::core::fmt::Debug for WireDriverStartArgs<'de> {
9066    fn fmt(
9067        &self,
9068        f: &mut ::core::fmt::Formatter<'_>,
9069    ) -> ::core::result::Result<(), ::core::fmt::Error> {
9070        f.debug_struct("DriverStartArgs")
9071            .field("node", &self.node())
9072            .field("symbols", &self.symbols())
9073            .field("url", &self.url())
9074            .field("program", &self.program())
9075            .field("incoming", &self.incoming())
9076            .field("outgoing_dir", &self.outgoing_dir())
9077            .field("config", &self.config())
9078            .field("node_name", &self.node_name())
9079            .field("node_properties", &self.node_properties())
9080            .field("node_offers", &self.node_offers())
9081            .field("node_token", &self.node_token())
9082            .field("node_properties_2", &self.node_properties_2())
9083            .field("vmar", &self.vmar())
9084            .finish()
9085    }
9086}
9087
9088#[derive(PartialEq, Debug)]
9089pub struct DriverStartRequest {
9090    pub start_args: crate::DriverStartArgs,
9091}
9092
9093impl ::fidl_next::Encodable for DriverStartRequest {
9094    type Encoded = WireDriverStartRequest<'static>;
9095}
9096
9097unsafe impl<___E> ::fidl_next::Encode<___E> for DriverStartRequest
9098where
9099    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9100    ___E: ::fidl_next::Encoder,
9101    ___E: ::fidl_next::fuchsia::HandleEncoder,
9102{
9103    #[inline]
9104    fn encode(
9105        self,
9106        encoder_: &mut ___E,
9107        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9108    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9109        ::fidl_next::munge! {
9110            let Self::Encoded {
9111                start_args,
9112
9113            } = out_;
9114        }
9115
9116        ::fidl_next::Encode::encode(self.start_args, encoder_, start_args)?;
9117
9118        Ok(())
9119    }
9120}
9121
9122impl ::fidl_next::EncodableOption for DriverStartRequest {
9123    type EncodedOption = ::fidl_next::WireBox<'static, WireDriverStartRequest<'static>>;
9124}
9125
9126unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DriverStartRequest
9127where
9128    ___E: ::fidl_next::Encoder + ?Sized,
9129    DriverStartRequest: ::fidl_next::Encode<___E>,
9130{
9131    #[inline]
9132    fn encode_option(
9133        this: ::core::option::Option<Self>,
9134        encoder: &mut ___E,
9135        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
9136    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9137        if let Some(inner) = this {
9138            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9139            ::fidl_next::WireBox::encode_present(out);
9140        } else {
9141            ::fidl_next::WireBox::encode_absent(out);
9142        }
9143
9144        Ok(())
9145    }
9146}
9147
9148impl<'de> ::fidl_next::FromWire<WireDriverStartRequest<'de>> for DriverStartRequest {
9149    #[inline]
9150    fn from_wire(wire: WireDriverStartRequest<'de>) -> Self {
9151        Self { start_args: ::fidl_next::FromWire::from_wire(wire.start_args) }
9152    }
9153}
9154
9155impl<'de> ::fidl_next::IntoNatural for WireDriverStartRequest<'de> {
9156    type Natural = DriverStartRequest;
9157}
9158
9159/// The wire type corresponding to [`DriverStartRequest`].
9160#[derive(Debug)]
9161#[repr(C)]
9162pub struct WireDriverStartRequest<'de> {
9163    pub start_args: crate::WireDriverStartArgs<'de>,
9164}
9165static_assertions::const_assert_eq!(std::mem::size_of::<WireDriverStartRequest<'_>>(), 16);
9166static_assertions::const_assert_eq!(std::mem::align_of::<WireDriverStartRequest<'_>>(), 8);
9167
9168static_assertions::const_assert_eq!(
9169    std::mem::offset_of!(WireDriverStartRequest<'_>, start_args),
9170    0
9171);
9172
9173unsafe impl ::fidl_next::Wire for WireDriverStartRequest<'static> {
9174    type Decoded<'de> = WireDriverStartRequest<'de>;
9175
9176    #[inline]
9177    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
9178        ::fidl_next::munge! {
9179            let Self {
9180
9181                start_args,
9182
9183            } = &mut *out_;
9184        }
9185
9186        ::fidl_next::Wire::zero_padding(start_args);
9187    }
9188}
9189
9190unsafe impl<___D> ::fidl_next::Decode<___D> for WireDriverStartRequest<'static>
9191where
9192    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
9193    ___D: ::fidl_next::Decoder,
9194    ___D: ::fidl_next::fuchsia::HandleDecoder,
9195{
9196    fn decode(
9197        slot_: ::fidl_next::Slot<'_, Self>,
9198        decoder_: &mut ___D,
9199    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9200        ::fidl_next::munge! {
9201            let Self {
9202
9203                mut start_args,
9204
9205            } = slot_;
9206        }
9207
9208        ::fidl_next::Decode::decode(start_args.as_mut(), decoder_)?;
9209
9210        Ok(())
9211    }
9212}
9213
9214/// The type corresponding to the Driver protocol.
9215#[doc = " This protocol is used by the Driver Framework\'s Driver Host to communicate various messages and\n lifecycle hooks to the driver. The connection for this protocol is established through the\n |DriverRegistration| defined in the `driver_symbols` library.\n\n Once the driver has closed its server end, the Driver Framework will initiate the shutdown\n of all dispatchers belonging to this driver.\n"]
9216#[derive(PartialEq, Debug)]
9217pub struct Driver;
9218
9219pub mod driver {
9220    pub mod prelude {
9221        pub use crate::{Driver, DriverClientHandler, DriverServerHandler, driver};
9222
9223        pub use crate::DriverStartRequest;
9224
9225        pub use crate::DriverStartResponse;
9226    }
9227
9228    pub struct Start;
9229
9230    impl ::fidl_next::Method for Start {
9231        const ORDINAL: u64 = 2863727161496985794;
9232
9233        type Protocol = crate::Driver;
9234
9235        type Request = crate::WireDriverStartRequest<'static>;
9236
9237        type Response = ::fidl_next::WireFlexibleResult<
9238            'static,
9239            crate::WireDriverStartResponse,
9240            ::fidl_next::WireI32,
9241        >;
9242    }
9243
9244    pub struct Stop;
9245
9246    impl ::fidl_next::Method for Stop {
9247        const ORDINAL: u64 = 5446759044519003197;
9248
9249        type Protocol = crate::Driver;
9250
9251        type Request = ();
9252
9253        type Response = ::fidl_next::Never;
9254    }
9255
9256    mod ___detail {
9257
9258        pub struct Start<T0> {
9259            start_args: T0,
9260        }
9261
9262        impl<T0> ::fidl_next::Encodable for Start<T0>
9263        where
9264            T0: ::fidl_next::Encodable<Encoded = crate::WireDriverStartArgs<'static>>,
9265        {
9266            type Encoded = crate::WireDriverStartRequest<'static>;
9267        }
9268
9269        unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Start<T0>
9270        where
9271            ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9272            ___E: ::fidl_next::Encoder,
9273            ___E: ::fidl_next::fuchsia::HandleEncoder,
9274            T0: ::fidl_next::Encode<___E, Encoded = crate::WireDriverStartArgs<'static>>,
9275        {
9276            #[inline]
9277            fn encode(
9278                self,
9279                encoder_: &mut ___E,
9280                out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9281            ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9282                ::fidl_next::munge! {
9283                    let Self::Encoded {
9284                        start_args,
9285
9286                    } = out_;
9287                }
9288
9289                ::fidl_next::Encode::encode(self.start_args, encoder_, start_args)?;
9290
9291                Ok(())
9292            }
9293        }
9294
9295        unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Driver
9296        where
9297            ___T: ::fidl_next::Transport,
9298        {
9299            type Client = DriverClient<___T>;
9300            type Server = DriverServer<___T>;
9301        }
9302
9303        /// The client for the `Driver` protocol.
9304        #[repr(transparent)]
9305        pub struct DriverClient<___T: ::fidl_next::Transport> {
9306            #[allow(dead_code)]
9307            client: ::fidl_next::protocol::Client<___T>,
9308        }
9309
9310        impl<___T> DriverClient<___T>
9311        where
9312            ___T: ::fidl_next::Transport,
9313        {
9314            #[doc = " Starts the driver with the given |start_args|.\n\n Drivers should finish their initial setup and enumeration before returning from |Start|.\n In particular they should enumerate all currently available nodes by utilizing\n `fuchsia.driver.framework/Node.AddChild` and waiting for all calls to be completed.\n\n The Framework will not consider the driver to be started until this call has returned\n successfully. Therefore a driver will not have |Stop| called on it until after it has\n replied to |Start| successfully.\n\n If a driver returns an error, it will not have |Stop| called on it before the\n Driver Framework initiates shutdown of the driver\'s dispatchers. Therefore it should have\n performed all necessary cleanup before returning an error.\n"]
9315            pub fn start(
9316                &self,
9317
9318                start_args: impl ::fidl_next::Encode<
9319                    <___T as ::fidl_next::Transport>::SendBuffer,
9320                    Encoded = crate::WireDriverStartArgs<'static>,
9321                >,
9322            ) -> ::fidl_next::TwoWayFuture<'_, super::Start, ___T>
9323            where
9324                <___T as ::fidl_next::Transport>::SendBuffer:
9325                    ::fidl_next::encoder::InternalHandleEncoder,
9326                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
9327                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
9328            {
9329                self.start_with(Start { start_args })
9330            }
9331
9332            #[doc = " Starts the driver with the given |start_args|.\n\n Drivers should finish their initial setup and enumeration before returning from |Start|.\n In particular they should enumerate all currently available nodes by utilizing\n `fuchsia.driver.framework/Node.AddChild` and waiting for all calls to be completed.\n\n The Framework will not consider the driver to be started until this call has returned\n successfully. Therefore a driver will not have |Stop| called on it until after it has\n replied to |Start| successfully.\n\n If a driver returns an error, it will not have |Stop| called on it before the\n Driver Framework initiates shutdown of the driver\'s dispatchers. Therefore it should have\n performed all necessary cleanup before returning an error.\n"]
9333            pub fn start_with<___R>(
9334                &self,
9335                request: ___R,
9336            ) -> ::fidl_next::TwoWayFuture<'_, super::Start, ___T>
9337            where
9338                ___R: ::fidl_next::Encode<
9339                        <___T as ::fidl_next::Transport>::SendBuffer,
9340                        Encoded = crate::WireDriverStartRequest<'static>,
9341                    >,
9342            {
9343                ::fidl_next::TwoWayFuture::from_untyped(
9344                    self.client.send_two_way(2863727161496985794, request),
9345                )
9346            }
9347
9348            #[doc = " Stops the driver. To stop, the driver should teardown any resources it set up in or after\n |Start|. This is a one-way FIDL method. When the driver has completed stopping, it should\n close its server end. Asynchronous operations should fully complete before closing\n the server end.\n"]
9349            pub fn stop(&self) -> ::fidl_next::SendFuture<'_, ___T> {
9350                ::fidl_next::SendFuture::from_untyped(
9351                    self.client.send_one_way(5446759044519003197, ()),
9352                )
9353            }
9354        }
9355
9356        /// The server for the `Driver` protocol.
9357        #[repr(transparent)]
9358        pub struct DriverServer<___T: ::fidl_next::Transport> {
9359            server: ::fidl_next::protocol::Server<___T>,
9360        }
9361
9362        impl<___T> DriverServer<___T> where ___T: ::fidl_next::Transport {}
9363    }
9364}
9365
9366/// A client handler for the Driver protocol.
9367///
9368/// See [`Driver`] for more details.
9369pub trait DriverClientHandler<
9370    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
9371    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
9372>
9373{
9374    fn on_unknown_interaction(
9375        &mut self,
9376        ordinal: u64,
9377    ) -> impl ::core::future::Future<
9378        Output = ::core::result::Result<
9379            (),
9380            ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
9381        >,
9382    > + ::core::marker::Send {
9383        ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
9384    }
9385}
9386
9387impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Driver
9388where
9389    ___H: DriverClientHandler<___T> + ::core::marker::Send,
9390    ___T: ::fidl_next::Transport,
9391    <driver::Start as ::fidl_next::Method>::Response:
9392        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9393{
9394    async fn on_event(
9395        handler: &mut ___H,
9396        ordinal: u64,
9397        buffer: ___T::RecvBuffer,
9398    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
9399        match ordinal {
9400            ordinal => handler.on_unknown_interaction(ordinal).await,
9401        }
9402    }
9403}
9404
9405/// A server handler for the Driver protocol.
9406///
9407/// See [`Driver`] for more details.
9408pub trait DriverServerHandler<
9409    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
9410    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
9411>
9412{
9413    #[doc = " Starts the driver with the given |start_args|.\n\n Drivers should finish their initial setup and enumeration before returning from |Start|.\n In particular they should enumerate all currently available nodes by utilizing\n `fuchsia.driver.framework/Node.AddChild` and waiting for all calls to be completed.\n\n The Framework will not consider the driver to be started until this call has returned\n successfully. Therefore a driver will not have |Stop| called on it until after it has\n replied to |Start| successfully.\n\n If a driver returns an error, it will not have |Stop| called on it before the\n Driver Framework initiates shutdown of the driver\'s dispatchers. Therefore it should have\n performed all necessary cleanup before returning an error.\n"]
9414    fn start(
9415        &mut self,
9416
9417        request: ::fidl_next::Request<driver::Start, ___T>,
9418
9419        responder: ::fidl_next::Responder<driver::Start, ___T>,
9420    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
9421
9422    #[doc = " Stops the driver. To stop, the driver should teardown any resources it set up in or after\n |Start|. This is a one-way FIDL method. When the driver has completed stopping, it should\n close its server end. Asynchronous operations should fully complete before closing\n the server end.\n"]
9423    fn stop(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
9424
9425    fn on_unknown_interaction(
9426        &mut self,
9427        ordinal: u64,
9428    ) -> impl ::core::future::Future<
9429        Output = ::core::result::Result<
9430            (),
9431            ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
9432        >,
9433    > + ::core::marker::Send {
9434        ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
9435    }
9436}
9437
9438impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Driver
9439where
9440    ___H: DriverServerHandler<___T> + ::core::marker::Send,
9441    ___T: ::fidl_next::Transport,
9442    <driver::Start as ::fidl_next::Method>::Request:
9443        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9444{
9445    async fn on_one_way(
9446        handler: &mut ___H,
9447        ordinal: u64,
9448        buffer: ___T::RecvBuffer,
9449    ) -> ::core::result::Result<
9450        (),
9451        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
9452    > {
9453        match ordinal {
9454            5446759044519003197 => {
9455                handler.stop().await;
9456                Ok(())
9457            }
9458
9459            ordinal => handler.on_unknown_interaction(ordinal).await,
9460        }
9461    }
9462
9463    async fn on_two_way(
9464        handler: &mut ___H,
9465        ordinal: u64,
9466        buffer: ___T::RecvBuffer,
9467        responder: ::fidl_next::protocol::Responder<___T>,
9468    ) -> ::core::result::Result<
9469        (),
9470        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
9471    > {
9472        match ordinal {
9473            2863727161496985794 => {
9474                let responder = ::fidl_next::Responder::from_untyped(responder);
9475
9476                match ::fidl_next::DecoderExt::decode(buffer) {
9477                    Ok(decoded) => {
9478                        handler.start(decoded, responder).await;
9479                        Ok(())
9480                    }
9481                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
9482                        ordinal: 2863727161496985794,
9483                        error,
9484                    }),
9485                }
9486            }
9487
9488            ordinal => handler.on_unknown_interaction(ordinal).await,
9489        }
9490    }
9491}
9492
9493#[derive(PartialEq, Debug)]
9494pub enum DriverResult {
9495    DriverStartedNodeToken(::fidl_next::fuchsia::zx::Event),
9496
9497    MatchError(i32),
9498
9499    StartError(i32),
9500
9501    UnknownOrdinal_(u64),
9502}
9503
9504impl ::fidl_next::Encodable for DriverResult {
9505    type Encoded = WireDriverResult<'static>;
9506}
9507
9508unsafe impl<___E> ::fidl_next::Encode<___E> for DriverResult
9509where
9510    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9511    ___E: ::fidl_next::Encoder,
9512    ___E: ::fidl_next::fuchsia::HandleEncoder,
9513{
9514    #[inline]
9515    fn encode(
9516        self,
9517        encoder: &mut ___E,
9518        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9519    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9520        ::fidl_next::munge!(let WireDriverResult { raw, _phantom: _ } = out);
9521
9522        match self {
9523            Self::DriverStartedNodeToken(value) => ::fidl_next::RawWireUnion::encode_as::<
9524                ___E,
9525                ::fidl_next::fuchsia::zx::Event,
9526            >(value, 1, encoder, raw)?,
9527
9528            Self::MatchError(value) => {
9529                ::fidl_next::RawWireUnion::encode_as::<___E, i32>(value, 2, encoder, raw)?
9530            }
9531
9532            Self::StartError(value) => {
9533                ::fidl_next::RawWireUnion::encode_as::<___E, i32>(value, 3, encoder, raw)?
9534            }
9535
9536            Self::UnknownOrdinal_(ordinal) => {
9537                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
9538            }
9539        }
9540
9541        Ok(())
9542    }
9543}
9544
9545impl ::fidl_next::EncodableOption for DriverResult {
9546    type EncodedOption = WireOptionalDriverResult<'static>;
9547}
9548
9549unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DriverResult
9550where
9551    ___E: ?Sized,
9552    DriverResult: ::fidl_next::Encode<___E>,
9553{
9554    #[inline]
9555    fn encode_option(
9556        this: ::core::option::Option<Self>,
9557        encoder: &mut ___E,
9558        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
9559    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9560        ::fidl_next::munge!(let WireOptionalDriverResult { raw, _phantom: _ } = &mut *out);
9561
9562        if let Some(inner) = this {
9563            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
9564            ::fidl_next::Encode::encode(inner, encoder, value_out)?;
9565        } else {
9566            ::fidl_next::RawWireUnion::encode_absent(raw);
9567        }
9568
9569        Ok(())
9570    }
9571}
9572
9573impl<'de> ::fidl_next::FromWire<WireDriverResult<'de>> for DriverResult {
9574    #[inline]
9575    fn from_wire(wire: WireDriverResult<'de>) -> Self {
9576        let wire = ::core::mem::ManuallyDrop::new(wire);
9577        match wire.raw.ordinal() {
9578            1 => Self::DriverStartedNodeToken(::fidl_next::FromWire::from_wire(unsafe {
9579                wire.raw.get().read_unchecked::<::fidl_next::fuchsia::WireEvent>()
9580            })),
9581
9582            2 => Self::MatchError(::fidl_next::FromWire::from_wire(unsafe {
9583                wire.raw.get().read_unchecked::<::fidl_next::WireI32>()
9584            })),
9585
9586            3 => Self::StartError(::fidl_next::FromWire::from_wire(unsafe {
9587                wire.raw.get().read_unchecked::<::fidl_next::WireI32>()
9588            })),
9589
9590            _ => unsafe { ::core::hint::unreachable_unchecked() },
9591        }
9592    }
9593}
9594
9595impl<'de> ::fidl_next::IntoNatural for WireDriverResult<'de> {
9596    type Natural = DriverResult;
9597}
9598
9599impl<'de> ::fidl_next::FromWireOption<WireOptionalDriverResult<'de>> for DriverResult {
9600    #[inline]
9601    fn from_wire_option(wire: WireOptionalDriverResult<'de>) -> ::core::option::Option<Self> {
9602        if let Some(inner) = wire.into_option() {
9603            Some(::fidl_next::FromWire::from_wire(inner))
9604        } else {
9605            None
9606        }
9607    }
9608}
9609
9610impl<'de> ::fidl_next::IntoNatural for WireOptionalDriverResult<'de> {
9611    type Natural = ::core::option::Option<DriverResult>;
9612}
9613
9614impl<'de> ::fidl_next::FromWireOption<WireOptionalDriverResult<'de>> for Box<DriverResult> {
9615    #[inline]
9616    fn from_wire_option(wire: WireOptionalDriverResult<'de>) -> ::core::option::Option<Self> {
9617        <
9618            DriverResult as ::fidl_next::FromWireOption<WireOptionalDriverResult<'de>>
9619        >::from_wire_option(wire).map(Box::new)
9620    }
9621}
9622
9623/// The wire type corresponding to [`DriverResult`].
9624#[repr(transparent)]
9625pub struct WireDriverResult<'de> {
9626    raw: ::fidl_next::RawWireUnion,
9627    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
9628}
9629
9630impl<'de> Drop for WireDriverResult<'de> {
9631    fn drop(&mut self) {
9632        match self.raw.ordinal() {
9633            1 => {
9634                let _ =
9635                    unsafe { self.raw.get().read_unchecked::<::fidl_next::fuchsia::WireEvent>() };
9636            }
9637
9638            2 => {
9639                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireI32>() };
9640            }
9641
9642            3 => {
9643                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireI32>() };
9644            }
9645
9646            _ => (),
9647        }
9648    }
9649}
9650
9651unsafe impl ::fidl_next::Wire for WireDriverResult<'static> {
9652    type Decoded<'de> = WireDriverResult<'de>;
9653
9654    #[inline]
9655    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9656        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
9657        ::fidl_next::RawWireUnion::zero_padding(raw);
9658    }
9659}
9660
9661pub mod driver_result {
9662    pub enum Ref<'de> {
9663        DriverStartedNodeToken(&'de ::fidl_next::fuchsia::WireEvent),
9664
9665        MatchError(&'de ::fidl_next::WireI32),
9666
9667        StartError(&'de ::fidl_next::WireI32),
9668
9669        UnknownOrdinal_(u64),
9670    }
9671}
9672
9673impl<'de> WireDriverResult<'de> {
9674    pub fn as_ref(&self) -> crate::driver_result::Ref<'_> {
9675        match self.raw.ordinal() {
9676            1 => crate::driver_result::Ref::DriverStartedNodeToken(unsafe {
9677                self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireEvent>()
9678            }),
9679
9680            2 => crate::driver_result::Ref::MatchError(unsafe {
9681                self.raw.get().deref_unchecked::<::fidl_next::WireI32>()
9682            }),
9683
9684            3 => crate::driver_result::Ref::StartError(unsafe {
9685                self.raw.get().deref_unchecked::<::fidl_next::WireI32>()
9686            }),
9687
9688            unknown => crate::driver_result::Ref::UnknownOrdinal_(unknown),
9689        }
9690    }
9691}
9692
9693unsafe impl<___D> ::fidl_next::Decode<___D> for WireDriverResult<'static>
9694where
9695    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
9696    ___D: ::fidl_next::Decoder,
9697    ___D: ::fidl_next::fuchsia::HandleDecoder,
9698{
9699    fn decode(
9700        mut slot: ::fidl_next::Slot<'_, Self>,
9701        decoder: &mut ___D,
9702    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9703        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
9704        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
9705            1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireEvent>(
9706                raw, decoder,
9707            )?,
9708
9709            2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI32>(raw, decoder)?,
9710
9711            3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI32>(raw, decoder)?,
9712
9713            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
9714        }
9715
9716        Ok(())
9717    }
9718}
9719
9720impl<'de> ::core::fmt::Debug for WireDriverResult<'de> {
9721    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
9722        match self.raw.ordinal() {
9723            1 => unsafe {
9724                self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireEvent>().fmt(f)
9725            },
9726            2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI32>().fmt(f) },
9727            3 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI32>().fmt(f) },
9728            _ => unsafe { ::core::hint::unreachable_unchecked() },
9729        }
9730    }
9731}
9732
9733#[repr(transparent)]
9734pub struct WireOptionalDriverResult<'de> {
9735    raw: ::fidl_next::RawWireUnion,
9736    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
9737}
9738
9739unsafe impl ::fidl_next::Wire for WireOptionalDriverResult<'static> {
9740    type Decoded<'de> = WireOptionalDriverResult<'de>;
9741
9742    #[inline]
9743    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9744        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
9745        ::fidl_next::RawWireUnion::zero_padding(raw);
9746    }
9747}
9748
9749impl<'de> WireOptionalDriverResult<'de> {
9750    pub fn is_some(&self) -> bool {
9751        self.raw.is_some()
9752    }
9753
9754    pub fn is_none(&self) -> bool {
9755        self.raw.is_none()
9756    }
9757
9758    pub fn as_ref(&self) -> ::core::option::Option<&WireDriverResult<'de>> {
9759        if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
9760    }
9761
9762    pub fn into_option(self) -> ::core::option::Option<WireDriverResult<'de>> {
9763        if self.is_some() {
9764            Some(WireDriverResult { raw: self.raw, _phantom: ::core::marker::PhantomData })
9765        } else {
9766            None
9767        }
9768    }
9769}
9770
9771unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDriverResult<'static>
9772where
9773    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
9774    ___D: ::fidl_next::Decoder,
9775    ___D: ::fidl_next::fuchsia::HandleDecoder,
9776{
9777    fn decode(
9778        mut slot: ::fidl_next::Slot<'_, Self>,
9779        decoder: &mut ___D,
9780    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9781        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
9782        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
9783            1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireEvent>(
9784                raw, decoder,
9785            )?,
9786
9787            2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI32>(raw, decoder)?,
9788
9789            3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI32>(raw, decoder)?,
9790
9791            0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
9792            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
9793        }
9794
9795        Ok(())
9796    }
9797}
9798
9799impl<'de> ::core::fmt::Debug for WireOptionalDriverResult<'de> {
9800    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
9801        self.as_ref().fmt(f)
9802    }
9803}
9804
9805pub const MAX_RESOURCE_NAME_LENGTH: u8 = 128 as u8;
9806
9807pub type NodeAddChildResponse = ();
9808
9809/// The wire type corresponding to [`NodeAddChildResponse`].
9810pub type WireNodeAddChildResponse = ();
9811
9812#[doc = " Error codes for the Node protocol.\n"]
9813#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9814#[repr(u32)]
9815pub enum NodeError {
9816    Internal = 1,
9817    NodeRemoved = 2,
9818    NameMissing = 3,
9819    NameInvalid = 4,
9820    NameAlreadyExists = 5,
9821    OfferSourceNameMissing = 6,
9822    OfferRefExists = 7,
9823    SymbolNameMissing = 8,
9824    SymbolAddressMissing = 9,
9825    SymbolAlreadyExists = 10,
9826    UnbindChildrenInProgress = 11,
9827    UnsupportedArgs = 12,
9828    DuplicatePropertyKeys = 13,
9829    OfferSourceInstanceFilterMissing = 14,
9830    OfferRenamedInstancesMissing = 15,
9831    UnknownOrdinal_(u32) = 16,
9832}
9833
9834impl ::fidl_next::Encodable for NodeError {
9835    type Encoded = WireNodeError;
9836}
9837impl ::std::convert::From<u32> for NodeError {
9838    fn from(value: u32) -> Self {
9839        match value {
9840            1 => Self::Internal,
9841            2 => Self::NodeRemoved,
9842            3 => Self::NameMissing,
9843            4 => Self::NameInvalid,
9844            5 => Self::NameAlreadyExists,
9845            6 => Self::OfferSourceNameMissing,
9846            7 => Self::OfferRefExists,
9847            8 => Self::SymbolNameMissing,
9848            9 => Self::SymbolAddressMissing,
9849            10 => Self::SymbolAlreadyExists,
9850            11 => Self::UnbindChildrenInProgress,
9851            12 => Self::UnsupportedArgs,
9852            13 => Self::DuplicatePropertyKeys,
9853            14 => Self::OfferSourceInstanceFilterMissing,
9854            15 => Self::OfferRenamedInstancesMissing,
9855
9856            _ => Self::UnknownOrdinal_(value),
9857        }
9858    }
9859}
9860
9861unsafe impl<___E> ::fidl_next::Encode<___E> for NodeError
9862where
9863    ___E: ?Sized,
9864{
9865    #[inline]
9866    fn encode(
9867        self,
9868        encoder: &mut ___E,
9869        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9870    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9871        ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
9872    }
9873}
9874
9875unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeError
9876where
9877    ___E: ?Sized,
9878{
9879    #[inline]
9880    fn encode_ref(
9881        &self,
9882        encoder: &mut ___E,
9883        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9884    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9885        ::fidl_next::munge!(let WireNodeError { value } = out);
9886        let _ = value.write(::fidl_next::WireU32::from(match *self {
9887            Self::Internal => 1,
9888
9889            Self::NodeRemoved => 2,
9890
9891            Self::NameMissing => 3,
9892
9893            Self::NameInvalid => 4,
9894
9895            Self::NameAlreadyExists => 5,
9896
9897            Self::OfferSourceNameMissing => 6,
9898
9899            Self::OfferRefExists => 7,
9900
9901            Self::SymbolNameMissing => 8,
9902
9903            Self::SymbolAddressMissing => 9,
9904
9905            Self::SymbolAlreadyExists => 10,
9906
9907            Self::UnbindChildrenInProgress => 11,
9908
9909            Self::UnsupportedArgs => 12,
9910
9911            Self::DuplicatePropertyKeys => 13,
9912
9913            Self::OfferSourceInstanceFilterMissing => 14,
9914
9915            Self::OfferRenamedInstancesMissing => 15,
9916
9917            Self::UnknownOrdinal_(value) => value,
9918        }));
9919
9920        Ok(())
9921    }
9922}
9923
9924impl ::core::convert::From<WireNodeError> for NodeError {
9925    fn from(wire: WireNodeError) -> Self {
9926        match u32::from(wire.value) {
9927            1 => Self::Internal,
9928
9929            2 => Self::NodeRemoved,
9930
9931            3 => Self::NameMissing,
9932
9933            4 => Self::NameInvalid,
9934
9935            5 => Self::NameAlreadyExists,
9936
9937            6 => Self::OfferSourceNameMissing,
9938
9939            7 => Self::OfferRefExists,
9940
9941            8 => Self::SymbolNameMissing,
9942
9943            9 => Self::SymbolAddressMissing,
9944
9945            10 => Self::SymbolAlreadyExists,
9946
9947            11 => Self::UnbindChildrenInProgress,
9948
9949            12 => Self::UnsupportedArgs,
9950
9951            13 => Self::DuplicatePropertyKeys,
9952
9953            14 => Self::OfferSourceInstanceFilterMissing,
9954
9955            15 => Self::OfferRenamedInstancesMissing,
9956
9957            value => Self::UnknownOrdinal_(value),
9958        }
9959    }
9960}
9961
9962impl ::fidl_next::FromWire<WireNodeError> for NodeError {
9963    #[inline]
9964    fn from_wire(wire: WireNodeError) -> Self {
9965        Self::from(wire)
9966    }
9967}
9968
9969impl ::fidl_next::IntoNatural for WireNodeError {
9970    type Natural = NodeError;
9971}
9972
9973impl ::fidl_next::FromWireRef<WireNodeError> for NodeError {
9974    #[inline]
9975    fn from_wire_ref(wire: &WireNodeError) -> Self {
9976        Self::from(*wire)
9977    }
9978}
9979
9980/// The wire type corresponding to [`NodeError`].
9981#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9982#[repr(transparent)]
9983pub struct WireNodeError {
9984    value: ::fidl_next::WireU32,
9985}
9986
9987unsafe impl ::fidl_next::Wire for WireNodeError {
9988    type Decoded<'de> = Self;
9989
9990    #[inline]
9991    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
9992        // Wire enums have no padding
9993    }
9994}
9995
9996impl WireNodeError {
9997    pub const INTERNAL: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(1) };
9998
9999    pub const NODE_REMOVED: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(2) };
10000
10001    pub const NAME_MISSING: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(3) };
10002
10003    pub const NAME_INVALID: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(4) };
10004
10005    pub const NAME_ALREADY_EXISTS: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(5) };
10006
10007    pub const OFFER_SOURCE_NAME_MISSING: WireNodeError =
10008        WireNodeError { value: ::fidl_next::WireU32(6) };
10009
10010    pub const OFFER_REF_EXISTS: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(7) };
10011
10012    pub const SYMBOL_NAME_MISSING: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(8) };
10013
10014    pub const SYMBOL_ADDRESS_MISSING: WireNodeError =
10015        WireNodeError { value: ::fidl_next::WireU32(9) };
10016
10017    pub const SYMBOL_ALREADY_EXISTS: WireNodeError =
10018        WireNodeError { value: ::fidl_next::WireU32(10) };
10019
10020    pub const UNBIND_CHILDREN_IN_PROGRESS: WireNodeError =
10021        WireNodeError { value: ::fidl_next::WireU32(11) };
10022
10023    pub const UNSUPPORTED_ARGS: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(12) };
10024
10025    pub const DUPLICATE_PROPERTY_KEYS: WireNodeError =
10026        WireNodeError { value: ::fidl_next::WireU32(13) };
10027
10028    pub const OFFER_SOURCE_INSTANCE_FILTER_MISSING: WireNodeError =
10029        WireNodeError { value: ::fidl_next::WireU32(14) };
10030
10031    pub const OFFER_RENAMED_INSTANCES_MISSING: WireNodeError =
10032        WireNodeError { value: ::fidl_next::WireU32(15) };
10033}
10034
10035unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeError
10036where
10037    ___D: ?Sized,
10038{
10039    fn decode(
10040        slot: ::fidl_next::Slot<'_, Self>,
10041        _: &mut ___D,
10042    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10043        Ok(())
10044    }
10045}
10046
10047impl ::core::convert::From<NodeError> for WireNodeError {
10048    fn from(natural: NodeError) -> Self {
10049        match natural {
10050            NodeError::Internal => WireNodeError::INTERNAL,
10051
10052            NodeError::NodeRemoved => WireNodeError::NODE_REMOVED,
10053
10054            NodeError::NameMissing => WireNodeError::NAME_MISSING,
10055
10056            NodeError::NameInvalid => WireNodeError::NAME_INVALID,
10057
10058            NodeError::NameAlreadyExists => WireNodeError::NAME_ALREADY_EXISTS,
10059
10060            NodeError::OfferSourceNameMissing => WireNodeError::OFFER_SOURCE_NAME_MISSING,
10061
10062            NodeError::OfferRefExists => WireNodeError::OFFER_REF_EXISTS,
10063
10064            NodeError::SymbolNameMissing => WireNodeError::SYMBOL_NAME_MISSING,
10065
10066            NodeError::SymbolAddressMissing => WireNodeError::SYMBOL_ADDRESS_MISSING,
10067
10068            NodeError::SymbolAlreadyExists => WireNodeError::SYMBOL_ALREADY_EXISTS,
10069
10070            NodeError::UnbindChildrenInProgress => WireNodeError::UNBIND_CHILDREN_IN_PROGRESS,
10071
10072            NodeError::UnsupportedArgs => WireNodeError::UNSUPPORTED_ARGS,
10073
10074            NodeError::DuplicatePropertyKeys => WireNodeError::DUPLICATE_PROPERTY_KEYS,
10075
10076            NodeError::OfferSourceInstanceFilterMissing => {
10077                WireNodeError::OFFER_SOURCE_INSTANCE_FILTER_MISSING
10078            }
10079
10080            NodeError::OfferRenamedInstancesMissing => {
10081                WireNodeError::OFFER_RENAMED_INSTANCES_MISSING
10082            }
10083
10084            NodeError::UnknownOrdinal_(value) => {
10085                WireNodeError { value: ::fidl_next::WireU32::from(value) }
10086            }
10087        }
10088    }
10089}
10090
10091#[doc = " Arguments for adding a node.\n"]
10092#[derive(PartialEq, Debug, Default)]
10093pub struct NodeAddArgs {
10094    pub name: ::core::option::Option<::std::string::String>,
10095
10096    pub symbols: ::core::option::Option<::std::vec::Vec<crate::NodeSymbol>>,
10097
10098    pub properties: ::core::option::Option<::std::vec::Vec<crate::NodeProperty>>,
10099
10100    pub devfs_args: ::core::option::Option<crate::DevfsAddArgs>,
10101
10102    pub offers2: ::core::option::Option<::std::vec::Vec<crate::Offer>>,
10103
10104    pub bus_info: ::core::option::Option<crate::BusInfo>,
10105
10106    pub properties2: ::core::option::Option<::std::vec::Vec<crate::NodeProperty2>>,
10107}
10108
10109impl NodeAddArgs {
10110    fn __max_ordinal(&self) -> usize {
10111        if self.properties2.is_some() {
10112            return 8;
10113        }
10114
10115        if self.bus_info.is_some() {
10116            return 7;
10117        }
10118
10119        if self.offers2.is_some() {
10120            return 6;
10121        }
10122
10123        if self.devfs_args.is_some() {
10124            return 5;
10125        }
10126
10127        if self.properties.is_some() {
10128            return 4;
10129        }
10130
10131        if self.symbols.is_some() {
10132            return 3;
10133        }
10134
10135        if self.name.is_some() {
10136            return 1;
10137        }
10138
10139        0
10140    }
10141}
10142
10143impl ::fidl_next::Encodable for NodeAddArgs {
10144    type Encoded = WireNodeAddArgs<'static>;
10145}
10146
10147unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAddArgs
10148where
10149    ___E: ::fidl_next::Encoder + ?Sized,
10150    ___E: ::fidl_next::fuchsia::HandleEncoder,
10151{
10152    #[inline]
10153    fn encode(
10154        mut self,
10155        encoder: &mut ___E,
10156        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10157    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10158        ::fidl_next::munge!(let WireNodeAddArgs { table } = out);
10159
10160        let max_ord = self.__max_ordinal();
10161
10162        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10163        ::fidl_next::Wire::zero_padding(&mut out);
10164
10165        let mut preallocated =
10166            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10167
10168        for i in 1..=max_ord {
10169            match i {
10170                8 => {
10171                    if let Some(value) = self.properties2.take() {
10172                        ::fidl_next::WireEnvelope::encode_value(
10173                            value,
10174                            preallocated.encoder,
10175                            &mut out,
10176                        )?;
10177                    } else {
10178                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
10179                    }
10180                }
10181
10182                7 => {
10183                    if let Some(value) = self.bus_info.take() {
10184                        ::fidl_next::WireEnvelope::encode_value(
10185                            value,
10186                            preallocated.encoder,
10187                            &mut out,
10188                        )?;
10189                    } else {
10190                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
10191                    }
10192                }
10193
10194                6 => {
10195                    if let Some(value) = self.offers2.take() {
10196                        ::fidl_next::WireEnvelope::encode_value(
10197                            value,
10198                            preallocated.encoder,
10199                            &mut out,
10200                        )?;
10201                    } else {
10202                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
10203                    }
10204                }
10205
10206                5 => {
10207                    if let Some(value) = self.devfs_args.take() {
10208                        ::fidl_next::WireEnvelope::encode_value(
10209                            value,
10210                            preallocated.encoder,
10211                            &mut out,
10212                        )?;
10213                    } else {
10214                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
10215                    }
10216                }
10217
10218                4 => {
10219                    if let Some(value) = self.properties.take() {
10220                        ::fidl_next::WireEnvelope::encode_value(
10221                            value,
10222                            preallocated.encoder,
10223                            &mut out,
10224                        )?;
10225                    } else {
10226                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
10227                    }
10228                }
10229
10230                3 => {
10231                    if let Some(value) = self.symbols.take() {
10232                        ::fidl_next::WireEnvelope::encode_value(
10233                            value,
10234                            preallocated.encoder,
10235                            &mut out,
10236                        )?;
10237                    } else {
10238                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
10239                    }
10240                }
10241
10242                1 => {
10243                    if let Some(value) = self.name.take() {
10244                        ::fidl_next::WireEnvelope::encode_value(
10245                            value,
10246                            preallocated.encoder,
10247                            &mut out,
10248                        )?;
10249                    } else {
10250                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
10251                    }
10252                }
10253
10254                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10255            }
10256            unsafe {
10257                preallocated.write_next(out.assume_init_ref());
10258            }
10259        }
10260
10261        ::fidl_next::WireTable::encode_len(table, max_ord);
10262
10263        Ok(())
10264    }
10265}
10266
10267impl<'de> ::fidl_next::FromWire<WireNodeAddArgs<'de>> for NodeAddArgs {
10268    #[inline]
10269    fn from_wire(wire_: WireNodeAddArgs<'de>) -> Self {
10270        let wire_ = ::core::mem::ManuallyDrop::new(wire_);
10271
10272        let name = wire_.table.get(1);
10273
10274        let symbols = wire_.table.get(3);
10275
10276        let properties = wire_.table.get(4);
10277
10278        let devfs_args = wire_.table.get(5);
10279
10280        let offers2 = wire_.table.get(6);
10281
10282        let bus_info = wire_.table.get(7);
10283
10284        let properties2 = wire_.table.get(8);
10285
10286        Self {
10287
10288
10289                name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
10290                    unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
10291                )),
10292
10293
10294                symbols: symbols.map(|envelope| ::fidl_next::FromWire::from_wire(
10295                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeSymbol<'de>>>() }
10296                )),
10297
10298
10299                properties: properties.map(|envelope| ::fidl_next::FromWire::from_wire(
10300                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeProperty<'de>>>() }
10301                )),
10302
10303
10304                devfs_args: devfs_args.map(|envelope| ::fidl_next::FromWire::from_wire(
10305                    unsafe { envelope.read_unchecked::<crate::WireDevfsAddArgs<'de>>() }
10306                )),
10307
10308
10309                offers2: offers2.map(|envelope| ::fidl_next::FromWire::from_wire(
10310                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireOffer<'de>>>() }
10311                )),
10312
10313
10314                bus_info: bus_info.map(|envelope| ::fidl_next::FromWire::from_wire(
10315                    unsafe { envelope.read_unchecked::<crate::WireBusInfo<'de>>() }
10316                )),
10317
10318
10319                properties2: properties2.map(|envelope| ::fidl_next::FromWire::from_wire(
10320                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeProperty2<'de>>>() }
10321                )),
10322
10323        }
10324    }
10325}
10326
10327impl<'de> ::fidl_next::IntoNatural for WireNodeAddArgs<'de> {
10328    type Natural = NodeAddArgs;
10329}
10330
10331/// The wire type corresponding to [`NodeAddArgs`].
10332#[repr(C)]
10333pub struct WireNodeAddArgs<'de> {
10334    table: ::fidl_next::WireTable<'de>,
10335}
10336
10337impl<'de> Drop for WireNodeAddArgs<'de> {
10338    fn drop(&mut self) {
10339        let _ = self
10340            .table
10341            .get(1)
10342            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
10343
10344        let _ = self.table.get(3).map(|envelope| unsafe {
10345            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeSymbol<'de>>>()
10346        });
10347
10348        let _ = self.table.get(4).map(|envelope| unsafe {
10349            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeProperty<'de>>>()
10350        });
10351
10352        let _ = self
10353            .table
10354            .get(5)
10355            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDevfsAddArgs<'de>>() });
10356
10357        let _ = self.table.get(6).map(|envelope| unsafe {
10358            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireOffer<'de>>>()
10359        });
10360
10361        let _ = self
10362            .table
10363            .get(7)
10364            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireBusInfo<'de>>() });
10365
10366        let _ = self.table.get(8).map(|envelope| unsafe {
10367            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeProperty2<'de>>>()
10368        });
10369    }
10370}
10371
10372unsafe impl ::fidl_next::Wire for WireNodeAddArgs<'static> {
10373    type Decoded<'de> = WireNodeAddArgs<'de>;
10374
10375    #[inline]
10376    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10377        ::fidl_next::munge!(let Self { table } = out);
10378        ::fidl_next::WireTable::zero_padding(table);
10379    }
10380}
10381
10382unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAddArgs<'static>
10383where
10384    ___D: ::fidl_next::Decoder + ?Sized,
10385    ___D: ::fidl_next::fuchsia::HandleDecoder,
10386{
10387    fn decode(
10388        slot: ::fidl_next::Slot<'_, Self>,
10389        decoder: &mut ___D,
10390    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10391        ::fidl_next::munge!(let Self { table } = slot);
10392
10393        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10394            match ordinal {
10395                0 => unsafe { ::core::hint::unreachable_unchecked() },
10396
10397                1 => {
10398                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
10399                        slot.as_mut(),
10400                        decoder,
10401                    )?;
10402
10403                    let value = unsafe {
10404                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
10405                    };
10406
10407                    if value.len() > 128 {
10408                        return Err(::fidl_next::DecodeError::VectorTooLong {
10409                            size: value.len() as u64,
10410                            limit: 128,
10411                        });
10412                    }
10413
10414                    Ok(())
10415                }
10416
10417                3 => {
10418                    ::fidl_next::WireEnvelope::decode_as::<
10419                        ___D,
10420                        ::fidl_next::WireVector<'static, crate::WireNodeSymbol<'static>>,
10421                    >(slot.as_mut(), decoder)?;
10422
10423                    let value = unsafe {
10424                        slot
10425                                            .deref_unchecked()
10426                                            .deref_unchecked::<
10427                                                ::fidl_next::WireVector<'_, crate::WireNodeSymbol<'_>>
10428                                            >()
10429                    };
10430
10431                    if value.len() > 64 {
10432                        return Err(::fidl_next::DecodeError::VectorTooLong {
10433                            size: value.len() as u64,
10434                            limit: 64,
10435                        });
10436                    }
10437
10438                    Ok(())
10439                }
10440
10441                4 => {
10442                    ::fidl_next::WireEnvelope::decode_as::<
10443                        ___D,
10444                        ::fidl_next::WireVector<'static, crate::WireNodeProperty<'static>>,
10445                    >(slot.as_mut(), decoder)?;
10446
10447                    let value = unsafe {
10448                        slot
10449                                            .deref_unchecked()
10450                                            .deref_unchecked::<
10451                                                ::fidl_next::WireVector<'_, crate::WireNodeProperty<'_>>
10452                                            >()
10453                    };
10454
10455                    if value.len() > 64 {
10456                        return Err(::fidl_next::DecodeError::VectorTooLong {
10457                            size: value.len() as u64,
10458                            limit: 64,
10459                        });
10460                    }
10461
10462                    Ok(())
10463                }
10464
10465                5 => {
10466                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDevfsAddArgs<'static>>(
10467                        slot.as_mut(),
10468                        decoder,
10469                    )?;
10470
10471                    Ok(())
10472                }
10473
10474                6 => {
10475                    ::fidl_next::WireEnvelope::decode_as::<
10476                        ___D,
10477                        ::fidl_next::WireVector<'static, crate::WireOffer<'static>>,
10478                    >(slot.as_mut(), decoder)?;
10479
10480                    let value = unsafe {
10481                        slot.deref_unchecked()
10482                            .deref_unchecked::<::fidl_next::WireVector<'_, crate::WireOffer<'_>>>()
10483                    };
10484
10485                    if value.len() > 128 {
10486                        return Err(::fidl_next::DecodeError::VectorTooLong {
10487                            size: value.len() as u64,
10488                            limit: 128,
10489                        });
10490                    }
10491
10492                    Ok(())
10493                }
10494
10495                7 => {
10496                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireBusInfo<'static>>(
10497                        slot.as_mut(),
10498                        decoder,
10499                    )?;
10500
10501                    Ok(())
10502                }
10503
10504                8 => {
10505                    ::fidl_next::WireEnvelope::decode_as::<
10506                        ___D,
10507                        ::fidl_next::WireVector<'static, crate::WireNodeProperty2<'static>>,
10508                    >(slot.as_mut(), decoder)?;
10509
10510                    let value = unsafe {
10511                        slot
10512                                            .deref_unchecked()
10513                                            .deref_unchecked::<
10514                                                ::fidl_next::WireVector<'_, crate::WireNodeProperty2<'_>>
10515                                            >()
10516                    };
10517
10518                    if value.len() > 64 {
10519                        return Err(::fidl_next::DecodeError::VectorTooLong {
10520                            size: value.len() as u64,
10521                            limit: 64,
10522                        });
10523                    }
10524
10525                    Ok(())
10526                }
10527
10528                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
10529            }
10530        })
10531    }
10532}
10533
10534impl<'de> WireNodeAddArgs<'de> {
10535    pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
10536        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10537    }
10538
10539    pub fn symbols(
10540        &self,
10541    ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireNodeSymbol<'de>>> {
10542        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10543    }
10544
10545    pub fn properties(
10546        &self,
10547    ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireNodeProperty<'de>>> {
10548        unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10549    }
10550
10551    pub fn devfs_args(&self) -> ::core::option::Option<&crate::WireDevfsAddArgs<'de>> {
10552        unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10553    }
10554
10555    pub fn offers2(
10556        &self,
10557    ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireOffer<'de>>> {
10558        unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10559    }
10560
10561    pub fn bus_info(&self) -> ::core::option::Option<&crate::WireBusInfo<'de>> {
10562        unsafe { Some(self.table.get(7)?.deref_unchecked()) }
10563    }
10564
10565    pub fn properties2(
10566        &self,
10567    ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireNodeProperty2<'de>>> {
10568        unsafe { Some(self.table.get(8)?.deref_unchecked()) }
10569    }
10570}
10571
10572impl<'de> ::core::fmt::Debug for WireNodeAddArgs<'de> {
10573    fn fmt(
10574        &self,
10575        f: &mut ::core::fmt::Formatter<'_>,
10576    ) -> ::core::result::Result<(), ::core::fmt::Error> {
10577        f.debug_struct("NodeAddArgs")
10578            .field("name", &self.name())
10579            .field("symbols", &self.symbols())
10580            .field("properties", &self.properties())
10581            .field("devfs_args", &self.devfs_args())
10582            .field("offers2", &self.offers2())
10583            .field("bus_info", &self.bus_info())
10584            .field("properties2", &self.properties2())
10585            .finish()
10586    }
10587}
10588
10589#[derive(PartialEq, Debug)]
10590pub struct NodeAddChildRequest {
10591    pub args: crate::NodeAddArgs,
10592
10593    pub controller:
10594        ::fidl_next::ServerEnd<crate::NodeController, ::fidl_next::fuchsia::zx::Channel>,
10595
10596    pub node: ::core::option::Option<
10597        ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel>,
10598    >,
10599}
10600
10601impl ::fidl_next::Encodable for NodeAddChildRequest {
10602    type Encoded = WireNodeAddChildRequest<'static>;
10603}
10604
10605unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAddChildRequest
10606where
10607    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10608    ___E: ::fidl_next::Encoder,
10609    ___E: ::fidl_next::fuchsia::HandleEncoder,
10610{
10611    #[inline]
10612    fn encode(
10613        self,
10614        encoder_: &mut ___E,
10615        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10616    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10617        ::fidl_next::munge! {
10618            let Self::Encoded {
10619                args,
10620                controller,
10621                node,
10622
10623            } = out_;
10624        }
10625
10626        ::fidl_next::Encode::encode(self.args, encoder_, args)?;
10627
10628        ::fidl_next::Encode::encode(self.controller, encoder_, controller)?;
10629
10630        ::fidl_next::Encode::encode(self.node, encoder_, node)?;
10631
10632        Ok(())
10633    }
10634}
10635
10636impl ::fidl_next::EncodableOption for NodeAddChildRequest {
10637    type EncodedOption = ::fidl_next::WireBox<'static, WireNodeAddChildRequest<'static>>;
10638}
10639
10640unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeAddChildRequest
10641where
10642    ___E: ::fidl_next::Encoder + ?Sized,
10643    NodeAddChildRequest: ::fidl_next::Encode<___E>,
10644{
10645    #[inline]
10646    fn encode_option(
10647        this: ::core::option::Option<Self>,
10648        encoder: &mut ___E,
10649        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10650    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10651        if let Some(inner) = this {
10652            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10653            ::fidl_next::WireBox::encode_present(out);
10654        } else {
10655            ::fidl_next::WireBox::encode_absent(out);
10656        }
10657
10658        Ok(())
10659    }
10660}
10661
10662impl<'de> ::fidl_next::FromWire<WireNodeAddChildRequest<'de>> for NodeAddChildRequest {
10663    #[inline]
10664    fn from_wire(wire: WireNodeAddChildRequest<'de>) -> Self {
10665        Self {
10666            args: ::fidl_next::FromWire::from_wire(wire.args),
10667
10668            controller: ::fidl_next::FromWire::from_wire(wire.controller),
10669
10670            node: ::fidl_next::FromWire::from_wire(wire.node),
10671        }
10672    }
10673}
10674
10675impl<'de> ::fidl_next::IntoNatural for WireNodeAddChildRequest<'de> {
10676    type Natural = NodeAddChildRequest;
10677}
10678
10679/// The wire type corresponding to [`NodeAddChildRequest`].
10680#[derive(Debug)]
10681#[repr(C)]
10682pub struct WireNodeAddChildRequest<'de> {
10683    pub args: crate::WireNodeAddArgs<'de>,
10684
10685    pub controller:
10686        ::fidl_next::ServerEnd<crate::NodeController, ::fidl_next::fuchsia::WireChannel>,
10687
10688    pub node: ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireOptionalChannel>,
10689}
10690static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeAddChildRequest<'_>>(), 24);
10691static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeAddChildRequest<'_>>(), 8);
10692
10693static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeAddChildRequest<'_>, args), 0);
10694
10695static_assertions::const_assert_eq!(
10696    std::mem::offset_of!(WireNodeAddChildRequest<'_>, controller),
10697    16
10698);
10699
10700static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeAddChildRequest<'_>, node), 20);
10701
10702unsafe impl ::fidl_next::Wire for WireNodeAddChildRequest<'static> {
10703    type Decoded<'de> = WireNodeAddChildRequest<'de>;
10704
10705    #[inline]
10706    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
10707        ::fidl_next::munge! {
10708            let Self {
10709
10710                args,
10711                controller,
10712                node,
10713
10714            } = &mut *out_;
10715        }
10716
10717        ::fidl_next::Wire::zero_padding(args);
10718
10719        ::fidl_next::Wire::zero_padding(controller);
10720
10721        ::fidl_next::Wire::zero_padding(node);
10722    }
10723}
10724
10725unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAddChildRequest<'static>
10726where
10727    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10728    ___D: ::fidl_next::Decoder,
10729    ___D: ::fidl_next::fuchsia::HandleDecoder,
10730{
10731    fn decode(
10732        slot_: ::fidl_next::Slot<'_, Self>,
10733        decoder_: &mut ___D,
10734    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10735        ::fidl_next::munge! {
10736            let Self {
10737
10738                mut args,
10739                mut controller,
10740                mut node,
10741
10742            } = slot_;
10743        }
10744
10745        ::fidl_next::Decode::decode(args.as_mut(), decoder_)?;
10746
10747        ::fidl_next::Decode::decode(controller.as_mut(), decoder_)?;
10748
10749        ::fidl_next::Decode::decode(node.as_mut(), decoder_)?;
10750
10751        Ok(())
10752    }
10753}
10754
10755/// The type corresponding to the Node protocol.
10756#[doc = " Protocol through which a driver manages a node that it is bound to.\n Drivers should maintain their client connection to the node. Dropping\n the client connection while the driver is running will cause the\n driver framework to remove the driver and node from the topology.\n If the driver has set `host_restart_on_crash` to \"true\" in their\n component manifest, dropping the connection will initiate a restart of\n the driver host and driver.\n"]
10757#[derive(PartialEq, Debug)]
10758pub struct Node;
10759
10760pub mod node {
10761    pub mod prelude {
10762        pub use crate::{Node, NodeClientHandler, NodeServerHandler, node};
10763
10764        pub use crate::NodeAddChildRequest;
10765
10766        pub use crate::NodeError;
10767
10768        pub use crate::NodeAddChildResponse;
10769    }
10770
10771    pub struct AddChild;
10772
10773    impl ::fidl_next::Method for AddChild {
10774        const ORDINAL: u64 = 8633697350522413353;
10775
10776        type Protocol = crate::Node;
10777
10778        type Request = crate::WireNodeAddChildRequest<'static>;
10779
10780        type Response = ::fidl_next::WireFlexibleResult<
10781            'static,
10782            crate::WireNodeAddChildResponse,
10783            crate::WireNodeError,
10784        >;
10785    }
10786
10787    mod ___detail {
10788
10789        pub struct AddChild<T0, T1, T2> {
10790            args: T0,
10791
10792            controller: T1,
10793
10794            node: T2,
10795        }
10796
10797        impl<T0, T1, T2> ::fidl_next::Encodable for AddChild<T0, T1, T2>
10798        where
10799            T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAddArgs<'static>>,
10800            T1: ::fidl_next::Encodable<
10801                    Encoded = ::fidl_next::ServerEnd<
10802                        crate::NodeController,
10803                        ::fidl_next::fuchsia::WireChannel,
10804                    >,
10805                >,
10806            T2: ::fidl_next::Encodable<
10807                    Encoded = ::fidl_next::ServerEnd<
10808                        crate::Node,
10809                        ::fidl_next::fuchsia::WireOptionalChannel,
10810                    >,
10811                >,
10812        {
10813            type Encoded = crate::WireNodeAddChildRequest<'static>;
10814        }
10815
10816        unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for AddChild<T0, T1, T2>
10817        where
10818            ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10819            ___E: ::fidl_next::Encoder,
10820            ___E: ::fidl_next::fuchsia::HandleEncoder,
10821            T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAddArgs<'static>>,
10822            T1: ::fidl_next::Encode<
10823                    ___E,
10824                    Encoded = ::fidl_next::ServerEnd<
10825                        crate::NodeController,
10826                        ::fidl_next::fuchsia::WireChannel,
10827                    >,
10828                >,
10829            T2: ::fidl_next::Encode<
10830                    ___E,
10831                    Encoded = ::fidl_next::ServerEnd<
10832                        crate::Node,
10833                        ::fidl_next::fuchsia::WireOptionalChannel,
10834                    >,
10835                >,
10836        {
10837            #[inline]
10838            fn encode(
10839                self,
10840                encoder_: &mut ___E,
10841                out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10842            ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10843                ::fidl_next::munge! {
10844                    let Self::Encoded {
10845                        args,
10846                        controller,
10847                        node,
10848
10849                    } = out_;
10850                }
10851
10852                ::fidl_next::Encode::encode(self.args, encoder_, args)?;
10853
10854                ::fidl_next::Encode::encode(self.controller, encoder_, controller)?;
10855
10856                ::fidl_next::Encode::encode(self.node, encoder_, node)?;
10857
10858                Ok(())
10859            }
10860        }
10861
10862        unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Node
10863        where
10864            ___T: ::fidl_next::Transport,
10865        {
10866            type Client = NodeClient<___T>;
10867            type Server = NodeServer<___T>;
10868        }
10869
10870        /// The client for the `Node` protocol.
10871        #[repr(transparent)]
10872        pub struct NodeClient<___T: ::fidl_next::Transport> {
10873            #[allow(dead_code)]
10874            client: ::fidl_next::protocol::Client<___T>,
10875        }
10876
10877        impl<___T> NodeClient<___T>
10878        where
10879            ___T: ::fidl_next::Transport,
10880        {
10881            #[doc = " Adds a child node to this node.\n\n If `node` is present, this driver takes responsibility for binding to\n the newly created child. Otherwise, the driver framework will locate an\n appropriate driver to bind the child to.\n"]
10882            pub fn add_child(
10883                &self,
10884
10885                args: impl ::fidl_next::Encode<
10886                    <___T as ::fidl_next::Transport>::SendBuffer,
10887                    Encoded = crate::WireNodeAddArgs<'static>,
10888                >,
10889
10890                controller: impl ::fidl_next::Encode<
10891                    <___T as ::fidl_next::Transport>::SendBuffer,
10892                    Encoded = ::fidl_next::ServerEnd<
10893                        crate::NodeController,
10894                        ::fidl_next::fuchsia::WireChannel,
10895                    >,
10896                >,
10897
10898                node: impl ::fidl_next::Encode<
10899                    <___T as ::fidl_next::Transport>::SendBuffer,
10900                    Encoded = ::fidl_next::ServerEnd<
10901                        crate::Node,
10902                        ::fidl_next::fuchsia::WireOptionalChannel,
10903                    >,
10904                >,
10905            ) -> ::fidl_next::TwoWayFuture<'_, super::AddChild, ___T>
10906            where
10907                <___T as ::fidl_next::Transport>::SendBuffer:
10908                    ::fidl_next::encoder::InternalHandleEncoder,
10909                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
10910                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
10911            {
10912                self.add_child_with(AddChild { args, controller, node })
10913            }
10914
10915            #[doc = " Adds a child node to this node.\n\n If `node` is present, this driver takes responsibility for binding to\n the newly created child. Otherwise, the driver framework will locate an\n appropriate driver to bind the child to.\n"]
10916            pub fn add_child_with<___R>(
10917                &self,
10918                request: ___R,
10919            ) -> ::fidl_next::TwoWayFuture<'_, super::AddChild, ___T>
10920            where
10921                ___R: ::fidl_next::Encode<
10922                        <___T as ::fidl_next::Transport>::SendBuffer,
10923                        Encoded = crate::WireNodeAddChildRequest<'static>,
10924                    >,
10925            {
10926                ::fidl_next::TwoWayFuture::from_untyped(
10927                    self.client.send_two_way(8633697350522413353, request),
10928                )
10929            }
10930        }
10931
10932        /// The server for the `Node` protocol.
10933        #[repr(transparent)]
10934        pub struct NodeServer<___T: ::fidl_next::Transport> {
10935            server: ::fidl_next::protocol::Server<___T>,
10936        }
10937
10938        impl<___T> NodeServer<___T> where ___T: ::fidl_next::Transport {}
10939    }
10940}
10941
10942/// A client handler for the Node protocol.
10943///
10944/// See [`Node`] for more details.
10945pub trait NodeClientHandler<
10946    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
10947    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
10948>
10949{
10950    fn on_unknown_interaction(
10951        &mut self,
10952        ordinal: u64,
10953    ) -> impl ::core::future::Future<
10954        Output = ::core::result::Result<
10955            (),
10956            ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
10957        >,
10958    > + ::core::marker::Send {
10959        ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
10960    }
10961}
10962
10963impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Node
10964where
10965    ___H: NodeClientHandler<___T> + ::core::marker::Send,
10966    ___T: ::fidl_next::Transport,
10967    <node::AddChild as ::fidl_next::Method>::Response:
10968        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
10969{
10970    async fn on_event(
10971        handler: &mut ___H,
10972        ordinal: u64,
10973        buffer: ___T::RecvBuffer,
10974    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
10975        match ordinal {
10976            ordinal => handler.on_unknown_interaction(ordinal).await,
10977        }
10978    }
10979}
10980
10981/// A server handler for the Node protocol.
10982///
10983/// See [`Node`] for more details.
10984pub trait NodeServerHandler<
10985    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
10986    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
10987>
10988{
10989    #[doc = " Adds a child node to this node.\n\n If `node` is present, this driver takes responsibility for binding to\n the newly created child. Otherwise, the driver framework will locate an\n appropriate driver to bind the child to.\n"]
10990    fn add_child(
10991        &mut self,
10992
10993        request: ::fidl_next::Request<node::AddChild, ___T>,
10994
10995        responder: ::fidl_next::Responder<node::AddChild, ___T>,
10996    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
10997
10998    fn on_unknown_interaction(
10999        &mut self,
11000        ordinal: u64,
11001    ) -> impl ::core::future::Future<
11002        Output = ::core::result::Result<
11003            (),
11004            ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
11005        >,
11006    > + ::core::marker::Send {
11007        ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
11008    }
11009}
11010
11011impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Node
11012where
11013    ___H: NodeServerHandler<___T> + ::core::marker::Send,
11014    ___T: ::fidl_next::Transport,
11015    <node::AddChild as ::fidl_next::Method>::Request:
11016        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11017{
11018    async fn on_one_way(
11019        handler: &mut ___H,
11020        ordinal: u64,
11021        buffer: ___T::RecvBuffer,
11022    ) -> ::core::result::Result<
11023        (),
11024        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
11025    > {
11026        match ordinal {
11027            ordinal => handler.on_unknown_interaction(ordinal).await,
11028        }
11029    }
11030
11031    async fn on_two_way(
11032        handler: &mut ___H,
11033        ordinal: u64,
11034        buffer: ___T::RecvBuffer,
11035        responder: ::fidl_next::protocol::Responder<___T>,
11036    ) -> ::core::result::Result<
11037        (),
11038        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
11039    > {
11040        match ordinal {
11041            8633697350522413353 => {
11042                let responder = ::fidl_next::Responder::from_untyped(responder);
11043
11044                match ::fidl_next::DecoderExt::decode(buffer) {
11045                    Ok(decoded) => {
11046                        handler.add_child(decoded, responder).await;
11047                        Ok(())
11048                    }
11049                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
11050                        ordinal: 8633697350522413353,
11051                        error,
11052                    }),
11053                }
11054            }
11055
11056            ordinal => handler.on_unknown_interaction(ordinal).await,
11057        }
11058    }
11059}
11060
11061#[derive(PartialEq, Clone, Debug, Default)]
11062pub struct NodeControllerRequestBindRequest {
11063    pub force_rebind: ::core::option::Option<bool>,
11064
11065    pub driver_url_suffix: ::core::option::Option<::std::string::String>,
11066}
11067
11068impl NodeControllerRequestBindRequest {
11069    fn __max_ordinal(&self) -> usize {
11070        if self.driver_url_suffix.is_some() {
11071            return 2;
11072        }
11073
11074        if self.force_rebind.is_some() {
11075            return 1;
11076        }
11077
11078        0
11079    }
11080}
11081
11082impl ::fidl_next::Encodable for NodeControllerRequestBindRequest {
11083    type Encoded = WireNodeControllerRequestBindRequest<'static>;
11084}
11085
11086unsafe impl<___E> ::fidl_next::Encode<___E> for NodeControllerRequestBindRequest
11087where
11088    ___E: ::fidl_next::Encoder + ?Sized,
11089{
11090    #[inline]
11091    fn encode(
11092        mut self,
11093        encoder: &mut ___E,
11094        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11095    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11096        ::fidl_next::munge!(let WireNodeControllerRequestBindRequest { table } = out);
11097
11098        let max_ord = self.__max_ordinal();
11099
11100        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11101        ::fidl_next::Wire::zero_padding(&mut out);
11102
11103        let mut preallocated =
11104            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11105
11106        for i in 1..=max_ord {
11107            match i {
11108                2 => {
11109                    if let Some(value) = self.driver_url_suffix.take() {
11110                        ::fidl_next::WireEnvelope::encode_value(
11111                            value,
11112                            preallocated.encoder,
11113                            &mut out,
11114                        )?;
11115                    } else {
11116                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
11117                    }
11118                }
11119
11120                1 => {
11121                    if let Some(value) = self.force_rebind.take() {
11122                        ::fidl_next::WireEnvelope::encode_value(
11123                            value,
11124                            preallocated.encoder,
11125                            &mut out,
11126                        )?;
11127                    } else {
11128                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
11129                    }
11130                }
11131
11132                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11133            }
11134            unsafe {
11135                preallocated.write_next(out.assume_init_ref());
11136            }
11137        }
11138
11139        ::fidl_next::WireTable::encode_len(table, max_ord);
11140
11141        Ok(())
11142    }
11143}
11144
11145unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeControllerRequestBindRequest
11146where
11147    ___E: ::fidl_next::Encoder + ?Sized,
11148{
11149    #[inline]
11150    fn encode_ref(
11151        &self,
11152        encoder: &mut ___E,
11153        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11154    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11155        ::fidl_next::munge!(let WireNodeControllerRequestBindRequest { table } = out);
11156
11157        let max_ord = self.__max_ordinal();
11158
11159        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11160        ::fidl_next::Wire::zero_padding(&mut out);
11161
11162        let mut preallocated =
11163            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11164
11165        for i in 1..=max_ord {
11166            match i {
11167                2 => {
11168                    if let Some(value) = &self.driver_url_suffix {
11169                        ::fidl_next::WireEnvelope::encode_value(
11170                            value,
11171                            preallocated.encoder,
11172                            &mut out,
11173                        )?;
11174                    } else {
11175                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
11176                    }
11177                }
11178
11179                1 => {
11180                    if let Some(value) = &self.force_rebind {
11181                        ::fidl_next::WireEnvelope::encode_value(
11182                            value,
11183                            preallocated.encoder,
11184                            &mut out,
11185                        )?;
11186                    } else {
11187                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
11188                    }
11189                }
11190
11191                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11192            }
11193            unsafe {
11194                preallocated.write_next(out.assume_init_ref());
11195            }
11196        }
11197
11198        ::fidl_next::WireTable::encode_len(table, max_ord);
11199
11200        Ok(())
11201    }
11202}
11203
11204impl<'de> ::fidl_next::FromWire<WireNodeControllerRequestBindRequest<'de>>
11205    for NodeControllerRequestBindRequest
11206{
11207    #[inline]
11208    fn from_wire(wire_: WireNodeControllerRequestBindRequest<'de>) -> Self {
11209        let wire_ = ::core::mem::ManuallyDrop::new(wire_);
11210
11211        let force_rebind = wire_.table.get(1);
11212
11213        let driver_url_suffix = wire_.table.get(2);
11214
11215        Self {
11216            force_rebind: force_rebind.map(|envelope| {
11217                ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
11218            }),
11219
11220            driver_url_suffix: driver_url_suffix.map(|envelope| {
11221                ::fidl_next::FromWire::from_wire(unsafe {
11222                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
11223                })
11224            }),
11225        }
11226    }
11227}
11228
11229impl<'de> ::fidl_next::IntoNatural for WireNodeControllerRequestBindRequest<'de> {
11230    type Natural = NodeControllerRequestBindRequest;
11231}
11232
11233impl<'de> ::fidl_next::FromWireRef<WireNodeControllerRequestBindRequest<'de>>
11234    for NodeControllerRequestBindRequest
11235{
11236    #[inline]
11237    fn from_wire_ref(wire: &WireNodeControllerRequestBindRequest<'de>) -> Self {
11238        Self {
11239            force_rebind: wire.table.get(1).map(|envelope| {
11240                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11241                    envelope.deref_unchecked::<bool>()
11242                })
11243            }),
11244
11245            driver_url_suffix: wire.table.get(2).map(|envelope| {
11246                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11247                    envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
11248                })
11249            }),
11250        }
11251    }
11252}
11253
11254/// The wire type corresponding to [`NodeControllerRequestBindRequest`].
11255#[repr(C)]
11256pub struct WireNodeControllerRequestBindRequest<'de> {
11257    table: ::fidl_next::WireTable<'de>,
11258}
11259
11260impl<'de> Drop for WireNodeControllerRequestBindRequest<'de> {
11261    fn drop(&mut self) {
11262        let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
11263
11264        let _ = self
11265            .table
11266            .get(2)
11267            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
11268    }
11269}
11270
11271unsafe impl ::fidl_next::Wire for WireNodeControllerRequestBindRequest<'static> {
11272    type Decoded<'de> = WireNodeControllerRequestBindRequest<'de>;
11273
11274    #[inline]
11275    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11276        ::fidl_next::munge!(let Self { table } = out);
11277        ::fidl_next::WireTable::zero_padding(table);
11278    }
11279}
11280
11281unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeControllerRequestBindRequest<'static>
11282where
11283    ___D: ::fidl_next::Decoder + ?Sized,
11284{
11285    fn decode(
11286        slot: ::fidl_next::Slot<'_, Self>,
11287        decoder: &mut ___D,
11288    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11289        ::fidl_next::munge!(let Self { table } = slot);
11290
11291        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11292            match ordinal {
11293                0 => unsafe { ::core::hint::unreachable_unchecked() },
11294
11295                1 => {
11296                    ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
11297
11298                    Ok(())
11299                }
11300
11301                2 => {
11302                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
11303                        slot.as_mut(),
11304                        decoder,
11305                    )?;
11306
11307                    Ok(())
11308                }
11309
11310                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
11311            }
11312        })
11313    }
11314}
11315
11316impl<'de> WireNodeControllerRequestBindRequest<'de> {
11317    pub fn force_rebind(&self) -> ::core::option::Option<&bool> {
11318        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11319    }
11320
11321    pub fn driver_url_suffix(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
11322        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11323    }
11324}
11325
11326impl<'de> ::core::fmt::Debug for WireNodeControllerRequestBindRequest<'de> {
11327    fn fmt(
11328        &self,
11329        f: &mut ::core::fmt::Formatter<'_>,
11330    ) -> ::core::result::Result<(), ::core::fmt::Error> {
11331        f.debug_struct("NodeControllerRequestBindRequest")
11332            .field("force_rebind", &self.force_rebind())
11333            .field("driver_url_suffix", &self.driver_url_suffix())
11334            .finish()
11335    }
11336}
11337
11338pub type NodeControllerRequestBindResponse = ();
11339
11340/// The wire type corresponding to [`NodeControllerRequestBindResponse`].
11341pub type WireNodeControllerRequestBindResponse = ();
11342
11343#[derive(PartialEq, Debug, Default)]
11344pub struct NodeControllerOnBindRequest {
11345    pub node_token: ::core::option::Option<::fidl_next::fuchsia::zx::Event>,
11346}
11347
11348impl NodeControllerOnBindRequest {
11349    fn __max_ordinal(&self) -> usize {
11350        if self.node_token.is_some() {
11351            return 1;
11352        }
11353
11354        0
11355    }
11356}
11357
11358impl ::fidl_next::Encodable for NodeControllerOnBindRequest {
11359    type Encoded = WireNodeControllerOnBindRequest<'static>;
11360}
11361
11362unsafe impl<___E> ::fidl_next::Encode<___E> for NodeControllerOnBindRequest
11363where
11364    ___E: ::fidl_next::Encoder + ?Sized,
11365    ___E: ::fidl_next::fuchsia::HandleEncoder,
11366{
11367    #[inline]
11368    fn encode(
11369        mut self,
11370        encoder: &mut ___E,
11371        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11372    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11373        ::fidl_next::munge!(let WireNodeControllerOnBindRequest { table } = out);
11374
11375        let max_ord = self.__max_ordinal();
11376
11377        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11378        ::fidl_next::Wire::zero_padding(&mut out);
11379
11380        let mut preallocated =
11381            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11382
11383        for i in 1..=max_ord {
11384            match i {
11385                1 => {
11386                    if let Some(value) = self.node_token.take() {
11387                        ::fidl_next::WireEnvelope::encode_value(
11388                            value,
11389                            preallocated.encoder,
11390                            &mut out,
11391                        )?;
11392                    } else {
11393                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
11394                    }
11395                }
11396
11397                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11398            }
11399            unsafe {
11400                preallocated.write_next(out.assume_init_ref());
11401            }
11402        }
11403
11404        ::fidl_next::WireTable::encode_len(table, max_ord);
11405
11406        Ok(())
11407    }
11408}
11409
11410impl<'de> ::fidl_next::FromWire<WireNodeControllerOnBindRequest<'de>>
11411    for NodeControllerOnBindRequest
11412{
11413    #[inline]
11414    fn from_wire(wire_: WireNodeControllerOnBindRequest<'de>) -> Self {
11415        let wire_ = ::core::mem::ManuallyDrop::new(wire_);
11416
11417        let node_token = wire_.table.get(1);
11418
11419        Self {
11420            node_token: node_token.map(|envelope| {
11421                ::fidl_next::FromWire::from_wire(unsafe {
11422                    envelope.read_unchecked::<::fidl_next::fuchsia::WireEvent>()
11423                })
11424            }),
11425        }
11426    }
11427}
11428
11429impl<'de> ::fidl_next::IntoNatural for WireNodeControllerOnBindRequest<'de> {
11430    type Natural = NodeControllerOnBindRequest;
11431}
11432
11433/// The wire type corresponding to [`NodeControllerOnBindRequest`].
11434#[repr(C)]
11435pub struct WireNodeControllerOnBindRequest<'de> {
11436    table: ::fidl_next::WireTable<'de>,
11437}
11438
11439impl<'de> Drop for WireNodeControllerOnBindRequest<'de> {
11440    fn drop(&mut self) {
11441        let _ = self.table.get(1).map(|envelope| unsafe {
11442            envelope.read_unchecked::<::fidl_next::fuchsia::WireEvent>()
11443        });
11444    }
11445}
11446
11447unsafe impl ::fidl_next::Wire for WireNodeControllerOnBindRequest<'static> {
11448    type Decoded<'de> = WireNodeControllerOnBindRequest<'de>;
11449
11450    #[inline]
11451    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11452        ::fidl_next::munge!(let Self { table } = out);
11453        ::fidl_next::WireTable::zero_padding(table);
11454    }
11455}
11456
11457unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeControllerOnBindRequest<'static>
11458where
11459    ___D: ::fidl_next::Decoder + ?Sized,
11460    ___D: ::fidl_next::fuchsia::HandleDecoder,
11461{
11462    fn decode(
11463        slot: ::fidl_next::Slot<'_, Self>,
11464        decoder: &mut ___D,
11465    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11466        ::fidl_next::munge!(let Self { table } = slot);
11467
11468        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11469            match ordinal {
11470                0 => unsafe { ::core::hint::unreachable_unchecked() },
11471
11472                1 => {
11473                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireEvent>(
11474                        slot.as_mut(),
11475                        decoder,
11476                    )?;
11477
11478                    Ok(())
11479                }
11480
11481                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
11482            }
11483        })
11484    }
11485}
11486
11487impl<'de> WireNodeControllerOnBindRequest<'de> {
11488    pub fn node_token(&self) -> ::core::option::Option<&::fidl_next::fuchsia::WireEvent> {
11489        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11490    }
11491}
11492
11493impl<'de> ::core::fmt::Debug for WireNodeControllerOnBindRequest<'de> {
11494    fn fmt(
11495        &self,
11496        f: &mut ::core::fmt::Formatter<'_>,
11497    ) -> ::core::result::Result<(), ::core::fmt::Error> {
11498        f.debug_struct("NodeControllerOnBindRequest")
11499            .field("node_token", &self.node_token())
11500            .finish()
11501    }
11502}
11503
11504/// The type corresponding to the NodeController protocol.
11505#[doc = " Protocol through which a parent node controls one of its children.\n"]
11506#[derive(PartialEq, Debug)]
11507pub struct NodeController;
11508
11509pub mod node_controller {
11510    pub mod prelude {
11511        pub use crate::{
11512            NodeController, NodeControllerClientHandler, NodeControllerServerHandler,
11513            node_controller,
11514        };
11515
11516        pub use crate::DriverResult;
11517
11518        pub use crate::NodeControllerOnBindRequest;
11519
11520        pub use crate::NodeControllerRequestBindRequest;
11521
11522        pub use crate::NodeControllerRequestBindResponse;
11523    }
11524
11525    pub struct Remove;
11526
11527    impl ::fidl_next::Method for Remove {
11528        const ORDINAL: u64 = 6123359741742396225;
11529
11530        type Protocol = crate::NodeController;
11531
11532        type Request = ();
11533
11534        type Response = ::fidl_next::Never;
11535    }
11536
11537    pub struct RequestBind;
11538
11539    impl ::fidl_next::Method for RequestBind {
11540        const ORDINAL: u64 = 4735909333556220047;
11541
11542        type Protocol = crate::NodeController;
11543
11544        type Request = crate::WireNodeControllerRequestBindRequest<'static>;
11545
11546        type Response = ::fidl_next::WireFlexibleResult<
11547            'static,
11548            crate::WireNodeControllerRequestBindResponse,
11549            ::fidl_next::WireI32,
11550        >;
11551    }
11552
11553    pub struct OnBind;
11554
11555    impl ::fidl_next::Method for OnBind {
11556        const ORDINAL: u64 = 5905369594807853098;
11557
11558        type Protocol = crate::NodeController;
11559
11560        type Request = ::fidl_next::Never;
11561
11562        type Response = crate::WireNodeControllerOnBindRequest<'static>;
11563    }
11564
11565    pub struct WaitForDriver;
11566
11567    impl ::fidl_next::Method for WaitForDriver {
11568        const ORDINAL: u64 = 7635589759067755399;
11569
11570        type Protocol = crate::NodeController;
11571
11572        type Request = ();
11573
11574        type Response = ::fidl_next::WireFlexibleResult<
11575            'static,
11576            crate::WireDriverResult<'static>,
11577            ::fidl_next::WireI32,
11578        >;
11579    }
11580
11581    mod ___detail {
11582
11583        unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::NodeController
11584        where
11585            ___T: ::fidl_next::Transport,
11586        {
11587            type Client = NodeControllerClient<___T>;
11588            type Server = NodeControllerServer<___T>;
11589        }
11590
11591        /// The client for the `NodeController` protocol.
11592        #[repr(transparent)]
11593        pub struct NodeControllerClient<___T: ::fidl_next::Transport> {
11594            #[allow(dead_code)]
11595            client: ::fidl_next::protocol::Client<___T>,
11596        }
11597
11598        impl<___T> NodeControllerClient<___T>
11599        where
11600            ___T: ::fidl_next::Transport,
11601        {
11602            #[doc = " Removes the node and all of its children.\n"]
11603            pub fn remove(&self) -> ::fidl_next::SendFuture<'_, ___T> {
11604                ::fidl_next::SendFuture::from_untyped(
11605                    self.client.send_one_way(6123359741742396225, ()),
11606                )
11607            }
11608
11609            #[doc = " Request that the framework attempts to bind a driver to this node.\n This is an *additional* request for binding as the framework attempts to bind a node once\n when the node is created.\n * error `ZX_ERR_ALREADY_BOUND` if the node is already bound and `force_rebind` is false.\n * error `ZX_ERR_ALREADY_EXISTS` if the node has an outstanding |RequestBind| call which has\n not completed.\n"]
11610            pub fn request_bind_with<___R>(
11611                &self,
11612                request: ___R,
11613            ) -> ::fidl_next::TwoWayFuture<'_, super::RequestBind, ___T>
11614            where
11615                ___R: ::fidl_next::Encode<
11616                        <___T as ::fidl_next::Transport>::SendBuffer,
11617                        Encoded = crate::WireNodeControllerRequestBindRequest<'static>,
11618                    >,
11619            {
11620                ::fidl_next::TwoWayFuture::from_untyped(
11621                    self.client.send_two_way(4735909333556220047, request),
11622                )
11623            }
11624
11625            #[doc = " Hanging get style call that returns a terminal state for the associated `Node`,\n or the composite node that is parented by this node.\n For a successfully started driver this returns immediately with the token of the\n node that the driver started on.\n If an error happens we wait until bootup is complete, which is when all drivers that\n can bind and start have done so, before returning the error.\n"]
11626            pub fn wait_for_driver(
11627                &self,
11628            ) -> ::fidl_next::TwoWayFuture<'_, super::WaitForDriver, ___T> {
11629                ::fidl_next::TwoWayFuture::from_untyped(
11630                    self.client.send_two_way(7635589759067755399, ()),
11631                )
11632            }
11633        }
11634
11635        /// The server for the `NodeController` protocol.
11636        #[repr(transparent)]
11637        pub struct NodeControllerServer<___T: ::fidl_next::Transport> {
11638            server: ::fidl_next::protocol::Server<___T>,
11639        }
11640
11641        impl<___T> NodeControllerServer<___T>
11642        where
11643            ___T: ::fidl_next::Transport,
11644        {
11645            #[doc = " Event that is triggered when the associated `Node` is bound to a driver.\n Replaced with WaitForDriver.\n"]
11646
11647            pub fn on_bind_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
11648            where
11649                ___R: ::fidl_next::Encode<
11650                        <___T as ::fidl_next::Transport>::SendBuffer,
11651                        Encoded = <super::OnBind as ::fidl_next::Method>::Response,
11652                    >,
11653            {
11654                ::fidl_next::SendFuture::from_untyped(
11655                    self.server.send_event(5905369594807853098, request),
11656                )
11657            }
11658        }
11659    }
11660}
11661
11662/// A client handler for the NodeController protocol.
11663///
11664/// See [`NodeController`] for more details.
11665pub trait NodeControllerClientHandler<
11666    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
11667    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
11668>
11669{
11670    #[doc = " Event that is triggered when the associated `Node` is bound to a driver.\n Replaced with WaitForDriver.\n"]
11671    fn on_bind(
11672        &mut self,
11673
11674        event: ::fidl_next::Response<node_controller::OnBind, ___T>,
11675    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
11676
11677    fn on_unknown_interaction(
11678        &mut self,
11679        ordinal: u64,
11680    ) -> impl ::core::future::Future<
11681        Output = ::core::result::Result<
11682            (),
11683            ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
11684        >,
11685    > + ::core::marker::Send {
11686        ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
11687    }
11688}
11689
11690impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for NodeController
11691where
11692    ___H: NodeControllerClientHandler<___T> + ::core::marker::Send,
11693    ___T: ::fidl_next::Transport,
11694    <node_controller::RequestBind as ::fidl_next::Method>::Response:
11695        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11696    <node_controller::OnBind as ::fidl_next::Method>::Response:
11697        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11698    <node_controller::WaitForDriver as ::fidl_next::Method>::Response:
11699        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11700{
11701    async fn on_event(
11702        handler: &mut ___H,
11703        ordinal: u64,
11704        buffer: ___T::RecvBuffer,
11705    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
11706        match ordinal {
11707            5905369594807853098 => match ::fidl_next::DecoderExt::decode(buffer) {
11708                Ok(decoded) => {
11709                    handler.on_bind(decoded).await;
11710                    Ok(())
11711                }
11712                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
11713                    ordinal: 5905369594807853098,
11714                    error,
11715                }),
11716            },
11717
11718            ordinal => handler.on_unknown_interaction(ordinal).await,
11719        }
11720    }
11721}
11722
11723/// A server handler for the NodeController protocol.
11724///
11725/// See [`NodeController`] for more details.
11726pub trait NodeControllerServerHandler<
11727    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
11728    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
11729>
11730{
11731    #[doc = " Removes the node and all of its children.\n"]
11732    fn remove(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
11733
11734    #[doc = " Request that the framework attempts to bind a driver to this node.\n This is an *additional* request for binding as the framework attempts to bind a node once\n when the node is created.\n * error `ZX_ERR_ALREADY_BOUND` if the node is already bound and `force_rebind` is false.\n * error `ZX_ERR_ALREADY_EXISTS` if the node has an outstanding |RequestBind| call which has\n not completed.\n"]
11735    fn request_bind(
11736        &mut self,
11737
11738        request: ::fidl_next::Request<node_controller::RequestBind, ___T>,
11739
11740        responder: ::fidl_next::Responder<node_controller::RequestBind, ___T>,
11741    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
11742
11743    #[doc = " Hanging get style call that returns a terminal state for the associated `Node`,\n or the composite node that is parented by this node.\n For a successfully started driver this returns immediately with the token of the\n node that the driver started on.\n If an error happens we wait until bootup is complete, which is when all drivers that\n can bind and start have done so, before returning the error.\n"]
11744    fn wait_for_driver(
11745        &mut self,
11746
11747        responder: ::fidl_next::Responder<node_controller::WaitForDriver, ___T>,
11748    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
11749
11750    fn on_unknown_interaction(
11751        &mut self,
11752        ordinal: u64,
11753    ) -> impl ::core::future::Future<
11754        Output = ::core::result::Result<
11755            (),
11756            ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
11757        >,
11758    > + ::core::marker::Send {
11759        ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
11760    }
11761}
11762
11763impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for NodeController
11764where
11765    ___H: NodeControllerServerHandler<___T> + ::core::marker::Send,
11766    ___T: ::fidl_next::Transport,
11767    <node_controller::RequestBind as ::fidl_next::Method>::Request:
11768        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11769{
11770    async fn on_one_way(
11771        handler: &mut ___H,
11772        ordinal: u64,
11773        buffer: ___T::RecvBuffer,
11774    ) -> ::core::result::Result<
11775        (),
11776        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
11777    > {
11778        match ordinal {
11779            6123359741742396225 => {
11780                handler.remove().await;
11781                Ok(())
11782            }
11783
11784            ordinal => handler.on_unknown_interaction(ordinal).await,
11785        }
11786    }
11787
11788    async fn on_two_way(
11789        handler: &mut ___H,
11790        ordinal: u64,
11791        buffer: ___T::RecvBuffer,
11792        responder: ::fidl_next::protocol::Responder<___T>,
11793    ) -> ::core::result::Result<
11794        (),
11795        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
11796    > {
11797        match ordinal {
11798            4735909333556220047 => {
11799                let responder = ::fidl_next::Responder::from_untyped(responder);
11800
11801                match ::fidl_next::DecoderExt::decode(buffer) {
11802                    Ok(decoded) => {
11803                        handler.request_bind(decoded, responder).await;
11804                        Ok(())
11805                    }
11806                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
11807                        ordinal: 4735909333556220047,
11808                        error,
11809                    }),
11810                }
11811            }
11812
11813            7635589759067755399 => {
11814                let responder = ::fidl_next::Responder::from_untyped(responder);
11815
11816                handler.wait_for_driver(responder).await;
11817                Ok(())
11818            }
11819
11820            ordinal => handler.on_unknown_interaction(ordinal).await,
11821        }
11822    }
11823}
11824
11825/// Compatibility shims which mimic some API surfaces of the current Rust bindings.
11826pub mod compat {
11827
11828    impl ::fidl_next::CompatFrom<crate::NodePropertyKey>
11829        for ::fidl_fuchsia_driver_framework::NodePropertyKey
11830    {
11831        fn compat_from(value: crate::NodePropertyKey) -> Self {
11832            match value {
11833                crate::NodePropertyKey::IntValue(value) => {
11834                    Self::IntValue(::fidl_next::CompatFrom::compat_from(value))
11835                }
11836
11837                crate::NodePropertyKey::StringValue(value) => {
11838                    Self::StringValue(::fidl_next::CompatFrom::compat_from(value))
11839                }
11840            }
11841        }
11842    }
11843
11844    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodePropertyKey>
11845        for crate::NodePropertyKey
11846    {
11847        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodePropertyKey) -> Self {
11848            match value {
11849                ::fidl_fuchsia_driver_framework::NodePropertyKey::IntValue(value) => {
11850                    Self::IntValue(::fidl_next::CompatFrom::compat_from(value))
11851                }
11852
11853                ::fidl_fuchsia_driver_framework::NodePropertyKey::StringValue(value) => {
11854                    Self::StringValue(::fidl_next::CompatFrom::compat_from(value))
11855                }
11856            }
11857        }
11858    }
11859
11860    impl ::fidl_next::CompatFrom<crate::Condition> for ::fidl_fuchsia_driver_framework::Condition {
11861        fn compat_from(value: crate::Condition) -> Self {
11862            match value {
11863                crate::Condition::Unknown => Self::Unknown,
11864
11865                crate::Condition::Accept => Self::Accept,
11866
11867                crate::Condition::Reject => Self::Reject,
11868            }
11869        }
11870    }
11871
11872    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::Condition> for crate::Condition {
11873        fn compat_from(value: ::fidl_fuchsia_driver_framework::Condition) -> Self {
11874            match value {
11875                ::fidl_fuchsia_driver_framework::Condition::Unknown => Self::Unknown,
11876
11877                ::fidl_fuchsia_driver_framework::Condition::Accept => Self::Accept,
11878
11879                ::fidl_fuchsia_driver_framework::Condition::Reject => Self::Reject,
11880            }
11881        }
11882    }
11883
11884    impl ::fidl_next::CompatFrom<crate::NodePropertyValue>
11885        for ::fidl_fuchsia_driver_framework::NodePropertyValue
11886    {
11887        fn compat_from(value: crate::NodePropertyValue) -> Self {
11888            match value {
11889                crate::NodePropertyValue::IntValue(value) => {
11890                    Self::IntValue(::fidl_next::CompatFrom::compat_from(value))
11891                }
11892
11893                crate::NodePropertyValue::StringValue(value) => {
11894                    Self::StringValue(::fidl_next::CompatFrom::compat_from(value))
11895                }
11896
11897                crate::NodePropertyValue::BoolValue(value) => {
11898                    Self::BoolValue(::fidl_next::CompatFrom::compat_from(value))
11899                }
11900
11901                crate::NodePropertyValue::EnumValue(value) => {
11902                    Self::EnumValue(::fidl_next::CompatFrom::compat_from(value))
11903                }
11904
11905                crate::NodePropertyValue::UnknownOrdinal_(unknown_ordinal) => {
11906                    Self::__SourceBreaking { unknown_ordinal }
11907                }
11908            }
11909        }
11910    }
11911
11912    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodePropertyValue>
11913        for crate::NodePropertyValue
11914    {
11915        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodePropertyValue) -> Self {
11916            match value {
11917                ::fidl_fuchsia_driver_framework::NodePropertyValue::IntValue(value) => {
11918                    Self::IntValue(::fidl_next::CompatFrom::compat_from(value))
11919                }
11920
11921                ::fidl_fuchsia_driver_framework::NodePropertyValue::StringValue(value) => {
11922                    Self::StringValue(::fidl_next::CompatFrom::compat_from(value))
11923                }
11924
11925                ::fidl_fuchsia_driver_framework::NodePropertyValue::BoolValue(value) => {
11926                    Self::BoolValue(::fidl_next::CompatFrom::compat_from(value))
11927                }
11928
11929                ::fidl_fuchsia_driver_framework::NodePropertyValue::EnumValue(value) => {
11930                    Self::EnumValue(::fidl_next::CompatFrom::compat_from(value))
11931                }
11932
11933                ::fidl_fuchsia_driver_framework::NodePropertyValue::__SourceBreaking {
11934                    unknown_ordinal,
11935                } => Self::UnknownOrdinal_(unknown_ordinal),
11936            }
11937        }
11938    }
11939
11940    impl ::fidl_next::CompatFrom<crate::BindRule> for ::fidl_fuchsia_driver_framework::BindRule {
11941        #[inline]
11942        fn compat_from(value: crate::BindRule) -> Self {
11943            Self {
11944                key: ::fidl_next::CompatFrom::compat_from(value.key),
11945
11946                condition: ::fidl_next::CompatFrom::compat_from(value.condition),
11947
11948                values: ::fidl_next::CompatFrom::compat_from(value.values),
11949            }
11950        }
11951    }
11952
11953    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::BindRule> for crate::BindRule {
11954        #[inline]
11955        fn compat_from(value: ::fidl_fuchsia_driver_framework::BindRule) -> Self {
11956            Self {
11957                key: ::fidl_next::CompatFrom::compat_from(value.key),
11958
11959                condition: ::fidl_next::CompatFrom::compat_from(value.condition),
11960
11961                values: ::fidl_next::CompatFrom::compat_from(value.values),
11962            }
11963        }
11964    }
11965
11966    impl ::fidl_next::CompatFrom<crate::BindRule2> for ::fidl_fuchsia_driver_framework::BindRule2 {
11967        #[inline]
11968        fn compat_from(value: crate::BindRule2) -> Self {
11969            Self {
11970                key: ::fidl_next::CompatFrom::compat_from(value.key),
11971
11972                condition: ::fidl_next::CompatFrom::compat_from(value.condition),
11973
11974                values: ::fidl_next::CompatFrom::compat_from(value.values),
11975            }
11976        }
11977    }
11978
11979    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::BindRule2> for crate::BindRule2 {
11980        #[inline]
11981        fn compat_from(value: ::fidl_fuchsia_driver_framework::BindRule2) -> Self {
11982            Self {
11983                key: ::fidl_next::CompatFrom::compat_from(value.key),
11984
11985                condition: ::fidl_next::CompatFrom::compat_from(value.condition),
11986
11987                values: ::fidl_next::CompatFrom::compat_from(value.values),
11988            }
11989        }
11990    }
11991
11992    impl ::fidl_next::CompatFrom<crate::BusType> for ::fidl_fuchsia_driver_framework::BusType {
11993        fn compat_from(value: crate::BusType) -> Self {
11994            match value {
11995                crate::BusType::Platform => Self::Platform,
11996
11997                crate::BusType::Acpi => Self::Acpi,
11998
11999                crate::BusType::DeviceTree => Self::DeviceTree,
12000
12001                crate::BusType::Pci => Self::Pci,
12002
12003                crate::BusType::Usb => Self::Usb,
12004
12005                crate::BusType::Gpio => Self::Gpio,
12006
12007                crate::BusType::I2C => Self::I2C,
12008
12009                crate::BusType::Spi => Self::Spi,
12010
12011                crate::BusType::Sdio => Self::Sdio,
12012
12013                crate::BusType::Uart => Self::Uart,
12014
12015                crate::BusType::Spmi => Self::Spmi,
12016
12017                crate::BusType::UnknownOrdinal_(unknown_ordinal) => {
12018                    Self::__SourceBreaking { unknown_ordinal }
12019                }
12020            }
12021        }
12022    }
12023
12024    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::BusType> for crate::BusType {
12025        fn compat_from(value: ::fidl_fuchsia_driver_framework::BusType) -> Self {
12026            match value {
12027                ::fidl_fuchsia_driver_framework::BusType::Platform => Self::Platform,
12028
12029                ::fidl_fuchsia_driver_framework::BusType::Acpi => Self::Acpi,
12030
12031                ::fidl_fuchsia_driver_framework::BusType::DeviceTree => Self::DeviceTree,
12032
12033                ::fidl_fuchsia_driver_framework::BusType::Pci => Self::Pci,
12034
12035                ::fidl_fuchsia_driver_framework::BusType::Usb => Self::Usb,
12036
12037                ::fidl_fuchsia_driver_framework::BusType::Gpio => Self::Gpio,
12038
12039                ::fidl_fuchsia_driver_framework::BusType::I2C => Self::I2C,
12040
12041                ::fidl_fuchsia_driver_framework::BusType::Spi => Self::Spi,
12042
12043                ::fidl_fuchsia_driver_framework::BusType::Sdio => Self::Sdio,
12044
12045                ::fidl_fuchsia_driver_framework::BusType::Uart => Self::Uart,
12046
12047                ::fidl_fuchsia_driver_framework::BusType::Spmi => Self::Spmi,
12048
12049                ::fidl_fuchsia_driver_framework::BusType::__SourceBreaking {
12050                    unknown_ordinal: value,
12051                } => Self::UnknownOrdinal_(value),
12052            }
12053        }
12054    }
12055
12056    impl ::fidl_next::CompatFrom<crate::DeviceAddress>
12057        for ::fidl_fuchsia_driver_framework::DeviceAddress
12058    {
12059        fn compat_from(value: crate::DeviceAddress) -> Self {
12060            match value {
12061                crate::DeviceAddress::IntValue(value) => {
12062                    Self::IntValue(::fidl_next::CompatFrom::compat_from(value))
12063                }
12064
12065                crate::DeviceAddress::ArrayIntValue(value) => {
12066                    Self::ArrayIntValue(::fidl_next::CompatFrom::compat_from(value))
12067                }
12068
12069                crate::DeviceAddress::CharIntValue(value) => {
12070                    Self::CharIntValue(::fidl_next::CompatFrom::compat_from(value))
12071                }
12072
12073                crate::DeviceAddress::ArrayCharIntValue(value) => {
12074                    Self::ArrayCharIntValue(::fidl_next::CompatFrom::compat_from(value))
12075                }
12076
12077                crate::DeviceAddress::StringValue(value) => {
12078                    Self::StringValue(::fidl_next::CompatFrom::compat_from(value))
12079                }
12080
12081                crate::DeviceAddress::UnknownOrdinal_(unknown_ordinal) => {
12082                    Self::__SourceBreaking { unknown_ordinal }
12083                }
12084            }
12085        }
12086    }
12087
12088    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DeviceAddress>
12089        for crate::DeviceAddress
12090    {
12091        fn compat_from(value: ::fidl_fuchsia_driver_framework::DeviceAddress) -> Self {
12092            match value {
12093                ::fidl_fuchsia_driver_framework::DeviceAddress::IntValue(value) => {
12094                    Self::IntValue(::fidl_next::CompatFrom::compat_from(value))
12095                }
12096
12097                ::fidl_fuchsia_driver_framework::DeviceAddress::ArrayIntValue(value) => {
12098                    Self::ArrayIntValue(::fidl_next::CompatFrom::compat_from(value))
12099                }
12100
12101                ::fidl_fuchsia_driver_framework::DeviceAddress::CharIntValue(value) => {
12102                    Self::CharIntValue(::fidl_next::CompatFrom::compat_from(value))
12103                }
12104
12105                ::fidl_fuchsia_driver_framework::DeviceAddress::ArrayCharIntValue(value) => {
12106                    Self::ArrayCharIntValue(::fidl_next::CompatFrom::compat_from(value))
12107                }
12108
12109                ::fidl_fuchsia_driver_framework::DeviceAddress::StringValue(value) => {
12110                    Self::StringValue(::fidl_next::CompatFrom::compat_from(value))
12111                }
12112
12113                ::fidl_fuchsia_driver_framework::DeviceAddress::__SourceBreaking {
12114                    unknown_ordinal,
12115                } => Self::UnknownOrdinal_(unknown_ordinal),
12116            }
12117        }
12118    }
12119
12120    impl ::fidl_next::CompatFrom<crate::DeviceAddressStability>
12121        for ::fidl_fuchsia_driver_framework::DeviceAddressStability
12122    {
12123        fn compat_from(value: crate::DeviceAddressStability) -> Self {
12124            match value {
12125                crate::DeviceAddressStability::UnstableBetweenDriverRestart => {
12126                    Self::UnstableBetweenDriverRestart
12127                }
12128
12129                crate::DeviceAddressStability::UnstableBetweenBoot => Self::UnstableBetweenBoot,
12130
12131                crate::DeviceAddressStability::UnstableBetweenSoftwareUpdate => {
12132                    Self::UnstableBetweenSoftwareUpdate
12133                }
12134
12135                crate::DeviceAddressStability::Stable => Self::Stable,
12136
12137                crate::DeviceAddressStability::UnknownOrdinal_(unknown_ordinal) => {
12138                    Self::__SourceBreaking { unknown_ordinal }
12139                }
12140            }
12141        }
12142    }
12143
12144    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DeviceAddressStability>
12145        for crate::DeviceAddressStability
12146    {
12147        fn compat_from(value: ::fidl_fuchsia_driver_framework::DeviceAddressStability) -> Self {
12148            match value {
12149
12150                ::fidl_fuchsia_driver_framework::DeviceAddressStability::UnstableBetweenDriverRestart =>
12151                    Self::UnstableBetweenDriverRestart,
12152
12153                ::fidl_fuchsia_driver_framework::DeviceAddressStability::UnstableBetweenBoot =>
12154                    Self::UnstableBetweenBoot,
12155
12156                ::fidl_fuchsia_driver_framework::DeviceAddressStability::UnstableBetweenSoftwareUpdate =>
12157                    Self::UnstableBetweenSoftwareUpdate,
12158
12159                ::fidl_fuchsia_driver_framework::DeviceAddressStability::Stable =>
12160                    Self::Stable,
12161
12162
12163                ::fidl_fuchsia_driver_framework::DeviceAddressStability::__SourceBreaking { unknown_ordinal: value } =>
12164                    Self::UnknownOrdinal_(value),
12165
12166        }
12167        }
12168    }
12169
12170    impl ::fidl_next::CompatFrom<crate::BusInfo> for ::fidl_fuchsia_driver_framework::BusInfo {
12171        fn compat_from(value: crate::BusInfo) -> Self {
12172            Self {
12173                bus: ::fidl_next::CompatFrom::compat_from(value.bus),
12174
12175                address: ::fidl_next::CompatFrom::compat_from(value.address),
12176
12177                address_stability: ::fidl_next::CompatFrom::compat_from(value.address_stability),
12178
12179                __source_breaking: ::fidl::marker::SourceBreaking,
12180            }
12181        }
12182    }
12183
12184    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::BusInfo> for crate::BusInfo {
12185        fn compat_from(value: ::fidl_fuchsia_driver_framework::BusInfo) -> Self {
12186            Self {
12187                bus: ::fidl_next::CompatFrom::compat_from(value.bus),
12188
12189                address: ::fidl_next::CompatFrom::compat_from(value.address),
12190
12191                address_stability: ::fidl_next::CompatFrom::compat_from(value.address_stability),
12192            }
12193        }
12194    }
12195
12196    impl ::fidl_next::CompatFrom<crate::DriverPackageType>
12197        for ::fidl_fuchsia_driver_framework::DriverPackageType
12198    {
12199        fn compat_from(value: crate::DriverPackageType) -> Self {
12200            match value {
12201                crate::DriverPackageType::Boot => Self::Boot,
12202
12203                crate::DriverPackageType::Base => Self::Base,
12204
12205                crate::DriverPackageType::Cached => Self::Cached,
12206
12207                crate::DriverPackageType::Universe => Self::Universe,
12208
12209                crate::DriverPackageType::UnknownOrdinal_(unknown_ordinal) => {
12210                    Self::__SourceBreaking { unknown_ordinal }
12211                }
12212            }
12213        }
12214    }
12215
12216    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DriverPackageType>
12217        for crate::DriverPackageType
12218    {
12219        fn compat_from(value: ::fidl_fuchsia_driver_framework::DriverPackageType) -> Self {
12220            match value {
12221                ::fidl_fuchsia_driver_framework::DriverPackageType::Boot => Self::Boot,
12222
12223                ::fidl_fuchsia_driver_framework::DriverPackageType::Base => Self::Base,
12224
12225                ::fidl_fuchsia_driver_framework::DriverPackageType::Cached => Self::Cached,
12226
12227                ::fidl_fuchsia_driver_framework::DriverPackageType::Universe => Self::Universe,
12228
12229                ::fidl_fuchsia_driver_framework::DriverPackageType::__SourceBreaking {
12230                    unknown_ordinal: value,
12231                } => Self::UnknownOrdinal_(value),
12232            }
12233        }
12234    }
12235
12236    impl ::fidl_next::CompatFrom<crate::DeviceCategory>
12237        for ::fidl_fuchsia_driver_framework::DeviceCategory
12238    {
12239        fn compat_from(value: crate::DeviceCategory) -> Self {
12240            Self {
12241                category: ::fidl_next::CompatFrom::compat_from(value.category),
12242
12243                subcategory: ::fidl_next::CompatFrom::compat_from(value.subcategory),
12244
12245                __source_breaking: ::fidl::marker::SourceBreaking,
12246            }
12247        }
12248    }
12249
12250    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DeviceCategory>
12251        for crate::DeviceCategory
12252    {
12253        fn compat_from(value: ::fidl_fuchsia_driver_framework::DeviceCategory) -> Self {
12254            Self {
12255                category: ::fidl_next::CompatFrom::compat_from(value.category),
12256
12257                subcategory: ::fidl_next::CompatFrom::compat_from(value.subcategory),
12258            }
12259        }
12260    }
12261
12262    impl ::fidl_next::CompatFrom<crate::DriverInfo> for ::fidl_fuchsia_driver_framework::DriverInfo {
12263        fn compat_from(value: crate::DriverInfo) -> Self {
12264            Self {
12265                url: ::fidl_next::CompatFrom::compat_from(value.url),
12266
12267                name: ::fidl_next::CompatFrom::compat_from(value.name),
12268
12269                colocate: ::fidl_next::CompatFrom::compat_from(value.colocate),
12270
12271                package_type: ::fidl_next::CompatFrom::compat_from(value.package_type),
12272
12273                is_fallback: ::fidl_next::CompatFrom::compat_from(value.is_fallback),
12274
12275                device_categories: ::fidl_next::CompatFrom::compat_from(value.device_categories),
12276
12277                bind_rules_bytecode: ::fidl_next::CompatFrom::compat_from(
12278                    value.bind_rules_bytecode,
12279                ),
12280
12281                driver_framework_version: ::fidl_next::CompatFrom::compat_from(
12282                    value.driver_framework_version,
12283                ),
12284
12285                is_disabled: ::fidl_next::CompatFrom::compat_from(value.is_disabled),
12286
12287                __source_breaking: ::fidl::marker::SourceBreaking,
12288            }
12289        }
12290    }
12291
12292    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DriverInfo> for crate::DriverInfo {
12293        fn compat_from(value: ::fidl_fuchsia_driver_framework::DriverInfo) -> Self {
12294            Self {
12295                url: ::fidl_next::CompatFrom::compat_from(value.url),
12296
12297                name: ::fidl_next::CompatFrom::compat_from(value.name),
12298
12299                colocate: ::fidl_next::CompatFrom::compat_from(value.colocate),
12300
12301                package_type: ::fidl_next::CompatFrom::compat_from(value.package_type),
12302
12303                is_fallback: ::fidl_next::CompatFrom::compat_from(value.is_fallback),
12304
12305                device_categories: ::fidl_next::CompatFrom::compat_from(value.device_categories),
12306
12307                bind_rules_bytecode: ::fidl_next::CompatFrom::compat_from(
12308                    value.bind_rules_bytecode,
12309                ),
12310
12311                driver_framework_version: ::fidl_next::CompatFrom::compat_from(
12312                    value.driver_framework_version,
12313                ),
12314
12315                is_disabled: ::fidl_next::CompatFrom::compat_from(value.is_disabled),
12316            }
12317        }
12318    }
12319
12320    impl ::fidl_next::CompatFrom<crate::CompositeDriverInfo>
12321        for ::fidl_fuchsia_driver_framework::CompositeDriverInfo
12322    {
12323        fn compat_from(value: crate::CompositeDriverInfo) -> Self {
12324            Self {
12325                composite_name: ::fidl_next::CompatFrom::compat_from(value.composite_name),
12326
12327                driver_info: ::fidl_next::CompatFrom::compat_from(value.driver_info),
12328
12329                __source_breaking: ::fidl::marker::SourceBreaking,
12330            }
12331        }
12332    }
12333
12334    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::CompositeDriverInfo>
12335        for crate::CompositeDriverInfo
12336    {
12337        fn compat_from(value: ::fidl_fuchsia_driver_framework::CompositeDriverInfo) -> Self {
12338            Self {
12339                composite_name: ::fidl_next::CompatFrom::compat_from(value.composite_name),
12340
12341                driver_info: ::fidl_next::CompatFrom::compat_from(value.driver_info),
12342            }
12343        }
12344    }
12345
12346    impl ::fidl_next::CompatFrom<crate::CompositeDriverMatch>
12347        for ::fidl_fuchsia_driver_framework::CompositeDriverMatch
12348    {
12349        fn compat_from(value: crate::CompositeDriverMatch) -> Self {
12350            Self {
12351                composite_driver: ::fidl_next::CompatFrom::compat_from(value.composite_driver),
12352
12353                parent_names: ::fidl_next::CompatFrom::compat_from(value.parent_names),
12354
12355                primary_parent_index: ::fidl_next::CompatFrom::compat_from(
12356                    value.primary_parent_index,
12357                ),
12358
12359                __source_breaking: ::fidl::marker::SourceBreaking,
12360            }
12361        }
12362    }
12363
12364    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::CompositeDriverMatch>
12365        for crate::CompositeDriverMatch
12366    {
12367        fn compat_from(value: ::fidl_fuchsia_driver_framework::CompositeDriverMatch) -> Self {
12368            Self {
12369                composite_driver: ::fidl_next::CompatFrom::compat_from(value.composite_driver),
12370
12371                parent_names: ::fidl_next::CompatFrom::compat_from(value.parent_names),
12372
12373                primary_parent_index: ::fidl_next::CompatFrom::compat_from(
12374                    value.primary_parent_index,
12375                ),
12376            }
12377        }
12378    }
12379
12380    impl ::fidl_next::CompatFrom<crate::NodeProperty>
12381        for ::fidl_fuchsia_driver_framework::NodeProperty
12382    {
12383        #[inline]
12384        fn compat_from(value: crate::NodeProperty) -> Self {
12385            Self {
12386                key: ::fidl_next::CompatFrom::compat_from(value.key),
12387
12388                value: ::fidl_next::CompatFrom::compat_from(value.value),
12389            }
12390        }
12391    }
12392
12393    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeProperty>
12394        for crate::NodeProperty
12395    {
12396        #[inline]
12397        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodeProperty) -> Self {
12398            Self {
12399                key: ::fidl_next::CompatFrom::compat_from(value.key),
12400
12401                value: ::fidl_next::CompatFrom::compat_from(value.value),
12402            }
12403        }
12404    }
12405
12406    impl ::fidl_next::CompatFrom<crate::ParentSpec> for ::fidl_fuchsia_driver_framework::ParentSpec {
12407        #[inline]
12408        fn compat_from(value: crate::ParentSpec) -> Self {
12409            Self {
12410                bind_rules: ::fidl_next::CompatFrom::compat_from(value.bind_rules),
12411
12412                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
12413            }
12414        }
12415    }
12416
12417    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::ParentSpec> for crate::ParentSpec {
12418        #[inline]
12419        fn compat_from(value: ::fidl_fuchsia_driver_framework::ParentSpec) -> Self {
12420            Self {
12421                bind_rules: ::fidl_next::CompatFrom::compat_from(value.bind_rules),
12422
12423                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
12424            }
12425        }
12426    }
12427
12428    impl ::fidl_next::CompatFrom<crate::NodeProperty2>
12429        for ::fidl_fuchsia_driver_framework::NodeProperty2
12430    {
12431        #[inline]
12432        fn compat_from(value: crate::NodeProperty2) -> Self {
12433            Self {
12434                key: ::fidl_next::CompatFrom::compat_from(value.key),
12435
12436                value: ::fidl_next::CompatFrom::compat_from(value.value),
12437            }
12438        }
12439    }
12440
12441    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeProperty2>
12442        for crate::NodeProperty2
12443    {
12444        #[inline]
12445        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodeProperty2) -> Self {
12446            Self {
12447                key: ::fidl_next::CompatFrom::compat_from(value.key),
12448
12449                value: ::fidl_next::CompatFrom::compat_from(value.value),
12450            }
12451        }
12452    }
12453
12454    impl ::fidl_next::CompatFrom<crate::ParentSpec2> for ::fidl_fuchsia_driver_framework::ParentSpec2 {
12455        #[inline]
12456        fn compat_from(value: crate::ParentSpec2) -> Self {
12457            Self {
12458                bind_rules: ::fidl_next::CompatFrom::compat_from(value.bind_rules),
12459
12460                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
12461            }
12462        }
12463    }
12464
12465    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::ParentSpec2> for crate::ParentSpec2 {
12466        #[inline]
12467        fn compat_from(value: ::fidl_fuchsia_driver_framework::ParentSpec2) -> Self {
12468            Self {
12469                bind_rules: ::fidl_next::CompatFrom::compat_from(value.bind_rules),
12470
12471                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
12472            }
12473        }
12474    }
12475
12476    impl ::fidl_next::CompatFrom<crate::CompositeNodeSpec>
12477        for ::fidl_fuchsia_driver_framework::CompositeNodeSpec
12478    {
12479        fn compat_from(value: crate::CompositeNodeSpec) -> Self {
12480            Self {
12481                name: ::fidl_next::CompatFrom::compat_from(value.name),
12482
12483                parents: ::fidl_next::CompatFrom::compat_from(value.parents),
12484
12485                parents2: ::fidl_next::CompatFrom::compat_from(value.parents2),
12486
12487                __source_breaking: ::fidl::marker::SourceBreaking,
12488            }
12489        }
12490    }
12491
12492    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::CompositeNodeSpec>
12493        for crate::CompositeNodeSpec
12494    {
12495        fn compat_from(value: ::fidl_fuchsia_driver_framework::CompositeNodeSpec) -> Self {
12496            Self {
12497                name: ::fidl_next::CompatFrom::compat_from(value.name),
12498
12499                parents: ::fidl_next::CompatFrom::compat_from(value.parents),
12500
12501                parents2: ::fidl_next::CompatFrom::compat_from(value.parents2),
12502            }
12503        }
12504    }
12505
12506    impl ::fidl_next::CompatFrom<crate::CompositeInfo>
12507        for ::fidl_fuchsia_driver_framework::CompositeInfo
12508    {
12509        fn compat_from(value: crate::CompositeInfo) -> Self {
12510            Self {
12511                spec: ::fidl_next::CompatFrom::compat_from(value.spec),
12512
12513                matched_driver: ::fidl_next::CompatFrom::compat_from(value.matched_driver),
12514
12515                __source_breaking: ::fidl::marker::SourceBreaking,
12516            }
12517        }
12518    }
12519
12520    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::CompositeInfo>
12521        for crate::CompositeInfo
12522    {
12523        fn compat_from(value: ::fidl_fuchsia_driver_framework::CompositeInfo) -> Self {
12524            Self {
12525                spec: ::fidl_next::CompatFrom::compat_from(value.spec),
12526
12527                matched_driver: ::fidl_next::CompatFrom::compat_from(value.matched_driver),
12528            }
12529        }
12530    }
12531
12532    impl ::fidl_next::CompatFrom<crate::CompositeNodeSpecError>
12533        for ::fidl_fuchsia_driver_framework::CompositeNodeSpecError
12534    {
12535        fn compat_from(value: crate::CompositeNodeSpecError) -> Self {
12536            match value {
12537                crate::CompositeNodeSpecError::MissingArgs => Self::MissingArgs,
12538
12539                crate::CompositeNodeSpecError::EmptyNodes => Self::EmptyNodes,
12540
12541                crate::CompositeNodeSpecError::AlreadyExists => Self::AlreadyExists,
12542
12543                crate::CompositeNodeSpecError::DriverIndexFailure => Self::DriverIndexFailure,
12544
12545                crate::CompositeNodeSpecError::DuplicateParents => Self::DuplicateParents,
12546
12547                crate::CompositeNodeSpecError::UnknownOrdinal_(unknown_ordinal) => {
12548                    Self::__SourceBreaking { unknown_ordinal }
12549                }
12550            }
12551        }
12552    }
12553
12554    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::CompositeNodeSpecError>
12555        for crate::CompositeNodeSpecError
12556    {
12557        fn compat_from(value: ::fidl_fuchsia_driver_framework::CompositeNodeSpecError) -> Self {
12558            match value {
12559                ::fidl_fuchsia_driver_framework::CompositeNodeSpecError::MissingArgs => {
12560                    Self::MissingArgs
12561                }
12562
12563                ::fidl_fuchsia_driver_framework::CompositeNodeSpecError::EmptyNodes => {
12564                    Self::EmptyNodes
12565                }
12566
12567                ::fidl_fuchsia_driver_framework::CompositeNodeSpecError::AlreadyExists => {
12568                    Self::AlreadyExists
12569                }
12570
12571                ::fidl_fuchsia_driver_framework::CompositeNodeSpecError::DriverIndexFailure => {
12572                    Self::DriverIndexFailure
12573                }
12574
12575                ::fidl_fuchsia_driver_framework::CompositeNodeSpecError::DuplicateParents => {
12576                    Self::DuplicateParents
12577                }
12578
12579                ::fidl_fuchsia_driver_framework::CompositeNodeSpecError::__SourceBreaking {
12580                    unknown_ordinal: value,
12581                } => Self::UnknownOrdinal_(value),
12582            }
12583        }
12584    }
12585
12586    #[cfg(target_os = "fuchsia")]
12587    /// An alias for a client over `zx::Channel` for the `CompositeNodeManager`
12588    /// protocol.
12589    pub type CompositeNodeManagerProxy = ::fidl_next::Client<crate::CompositeNodeManager>;
12590
12591    impl ::fidl_next::CompatFrom<crate::CompositeNodeManager>
12592        for ::fidl_fuchsia_driver_framework::CompositeNodeManagerMarker
12593    {
12594        fn compat_from(_: crate::CompositeNodeManager) -> Self {
12595            Self
12596        }
12597    }
12598
12599    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::CompositeNodeManagerMarker>
12600        for crate::CompositeNodeManager
12601    {
12602        fn compat_from(_: ::fidl_fuchsia_driver_framework::CompositeNodeManagerMarker) -> Self {
12603            Self
12604        }
12605    }
12606
12607    #[cfg(target_os = "fuchsia")]
12608
12609    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_driver_framework::CompositeNodeManagerProxy>
12610        for crate::CompositeNodeManager
12611    {
12612        fn client_compat_from(
12613            proxy: ::fidl_fuchsia_driver_framework::CompositeNodeManagerProxy,
12614        ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
12615            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
12616            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
12617            ::fidl_next::ClientDispatcher::new(client_end)
12618        }
12619    }
12620
12621    impl ::fidl_next::CompatFrom<crate::CompositeParent>
12622        for ::fidl_fuchsia_driver_framework::CompositeParent
12623    {
12624        fn compat_from(value: crate::CompositeParent) -> Self {
12625            Self {
12626                composite: ::fidl_next::CompatFrom::compat_from(value.composite),
12627
12628                index: ::fidl_next::CompatFrom::compat_from(value.index),
12629
12630                __source_breaking: ::fidl::marker::SourceBreaking,
12631            }
12632        }
12633    }
12634
12635    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::CompositeParent>
12636        for crate::CompositeParent
12637    {
12638        fn compat_from(value: ::fidl_fuchsia_driver_framework::CompositeParent) -> Self {
12639            Self {
12640                composite: ::fidl_next::CompatFrom::compat_from(value.composite),
12641
12642                index: ::fidl_next::CompatFrom::compat_from(value.index),
12643            }
12644        }
12645    }
12646
12647    impl ::fidl_next::CompatFrom<crate::DevfsAddArgs>
12648        for ::fidl_fuchsia_driver_framework::DevfsAddArgs
12649    {
12650        fn compat_from(value: crate::DevfsAddArgs) -> Self {
12651            Self {
12652                connector: ::fidl_next::CompatFrom::compat_from(value.connector),
12653
12654                class_name: ::fidl_next::CompatFrom::compat_from(value.class_name),
12655
12656                inspect: ::fidl_next::CompatFrom::compat_from(value.inspect),
12657
12658                connector_supports: ::fidl_next::CompatFrom::compat_from(value.connector_supports),
12659
12660                controller_connector: ::fidl_next::CompatFrom::compat_from(
12661                    value.controller_connector,
12662                ),
12663
12664                __source_breaking: ::fidl::marker::SourceBreaking,
12665            }
12666        }
12667    }
12668
12669    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DevfsAddArgs>
12670        for crate::DevfsAddArgs
12671    {
12672        fn compat_from(value: ::fidl_fuchsia_driver_framework::DevfsAddArgs) -> Self {
12673            Self {
12674                connector: ::fidl_next::CompatFrom::compat_from(value.connector),
12675
12676                class_name: ::fidl_next::CompatFrom::compat_from(value.class_name),
12677
12678                inspect: ::fidl_next::CompatFrom::compat_from(value.inspect),
12679
12680                connector_supports: ::fidl_next::CompatFrom::compat_from(value.connector_supports),
12681
12682                controller_connector: ::fidl_next::CompatFrom::compat_from(
12683                    value.controller_connector,
12684                ),
12685            }
12686        }
12687    }
12688
12689    impl ::fidl_next::CompatFrom<crate::NodePropertyEntry>
12690        for ::fidl_fuchsia_driver_framework::NodePropertyEntry
12691    {
12692        #[inline]
12693        fn compat_from(value: crate::NodePropertyEntry) -> Self {
12694            Self {
12695                name: ::fidl_next::CompatFrom::compat_from(value.name),
12696
12697                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
12698            }
12699        }
12700    }
12701
12702    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodePropertyEntry>
12703        for crate::NodePropertyEntry
12704    {
12705        #[inline]
12706        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodePropertyEntry) -> Self {
12707            Self {
12708                name: ::fidl_next::CompatFrom::compat_from(value.name),
12709
12710                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
12711            }
12712        }
12713    }
12714
12715    impl ::fidl_next::CompatFrom<crate::NodePropertyEntry2>
12716        for ::fidl_fuchsia_driver_framework::NodePropertyEntry2
12717    {
12718        #[inline]
12719        fn compat_from(value: crate::NodePropertyEntry2) -> Self {
12720            Self {
12721                name: ::fidl_next::CompatFrom::compat_from(value.name),
12722
12723                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
12724            }
12725        }
12726    }
12727
12728    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodePropertyEntry2>
12729        for crate::NodePropertyEntry2
12730    {
12731        #[inline]
12732        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodePropertyEntry2) -> Self {
12733            Self {
12734                name: ::fidl_next::CompatFrom::compat_from(value.name),
12735
12736                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
12737            }
12738        }
12739    }
12740
12741    impl ::fidl_next::CompatFrom<crate::NodeSymbol> for ::fidl_fuchsia_driver_framework::NodeSymbol {
12742        fn compat_from(value: crate::NodeSymbol) -> Self {
12743            Self {
12744                name: ::fidl_next::CompatFrom::compat_from(value.name),
12745
12746                address: ::fidl_next::CompatFrom::compat_from(value.address),
12747
12748                module_name: ::fidl_next::CompatFrom::compat_from(value.module_name),
12749
12750                __source_breaking: ::fidl::marker::SourceBreaking,
12751            }
12752        }
12753    }
12754
12755    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeSymbol> for crate::NodeSymbol {
12756        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodeSymbol) -> Self {
12757            Self {
12758                name: ::fidl_next::CompatFrom::compat_from(value.name),
12759
12760                address: ::fidl_next::CompatFrom::compat_from(value.address),
12761
12762                module_name: ::fidl_next::CompatFrom::compat_from(value.module_name),
12763            }
12764        }
12765    }
12766
12767    impl ::fidl_next::CompatFrom<crate::Offer> for ::fidl_fuchsia_driver_framework::Offer {
12768        fn compat_from(value: crate::Offer) -> Self {
12769            match value {
12770                crate::Offer::ZirconTransport(value) => {
12771                    Self::ZirconTransport(::fidl_next::CompatFrom::compat_from(value))
12772                }
12773
12774                crate::Offer::DriverTransport(value) => {
12775                    Self::DriverTransport(::fidl_next::CompatFrom::compat_from(value))
12776                }
12777
12778                crate::Offer::UnknownOrdinal_(unknown_ordinal) => {
12779                    Self::__SourceBreaking { unknown_ordinal }
12780                }
12781            }
12782        }
12783    }
12784
12785    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::Offer> for crate::Offer {
12786        fn compat_from(value: ::fidl_fuchsia_driver_framework::Offer) -> Self {
12787            match value {
12788                ::fidl_fuchsia_driver_framework::Offer::ZirconTransport(value) => {
12789                    Self::ZirconTransport(::fidl_next::CompatFrom::compat_from(value))
12790                }
12791
12792                ::fidl_fuchsia_driver_framework::Offer::DriverTransport(value) => {
12793                    Self::DriverTransport(::fidl_next::CompatFrom::compat_from(value))
12794                }
12795
12796                ::fidl_fuchsia_driver_framework::Offer::__SourceBreaking { unknown_ordinal } => {
12797                    Self::UnknownOrdinal_(unknown_ordinal)
12798                }
12799            }
12800        }
12801    }
12802
12803    impl ::fidl_next::CompatFrom<crate::DriverStartArgs>
12804        for ::fidl_fuchsia_driver_framework::DriverStartArgs
12805    {
12806        fn compat_from(value: crate::DriverStartArgs) -> Self {
12807            Self {
12808                node: ::fidl_next::CompatFrom::compat_from(value.node),
12809
12810                symbols: ::fidl_next::CompatFrom::compat_from(value.symbols),
12811
12812                url: ::fidl_next::CompatFrom::compat_from(value.url),
12813
12814                program: ::fidl_next::CompatFrom::compat_from(value.program),
12815
12816                incoming: ::fidl_next::CompatFrom::compat_from(value.incoming),
12817
12818                outgoing_dir: ::fidl_next::CompatFrom::compat_from(value.outgoing_dir),
12819
12820                config: ::fidl_next::CompatFrom::compat_from(value.config),
12821
12822                node_name: ::fidl_next::CompatFrom::compat_from(value.node_name),
12823
12824                node_properties: ::fidl_next::CompatFrom::compat_from(value.node_properties),
12825
12826                node_offers: ::fidl_next::CompatFrom::compat_from(value.node_offers),
12827
12828                node_token: ::fidl_next::CompatFrom::compat_from(value.node_token),
12829
12830                node_properties_2: ::fidl_next::CompatFrom::compat_from(value.node_properties_2),
12831
12832                vmar: ::fidl_next::CompatFrom::compat_from(value.vmar),
12833
12834                __source_breaking: ::fidl::marker::SourceBreaking,
12835            }
12836        }
12837    }
12838
12839    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DriverStartArgs>
12840        for crate::DriverStartArgs
12841    {
12842        fn compat_from(value: ::fidl_fuchsia_driver_framework::DriverStartArgs) -> Self {
12843            Self {
12844                node: ::fidl_next::CompatFrom::compat_from(value.node),
12845
12846                symbols: ::fidl_next::CompatFrom::compat_from(value.symbols),
12847
12848                url: ::fidl_next::CompatFrom::compat_from(value.url),
12849
12850                program: ::fidl_next::CompatFrom::compat_from(value.program),
12851
12852                incoming: ::fidl_next::CompatFrom::compat_from(value.incoming),
12853
12854                outgoing_dir: ::fidl_next::CompatFrom::compat_from(value.outgoing_dir),
12855
12856                config: ::fidl_next::CompatFrom::compat_from(value.config),
12857
12858                node_name: ::fidl_next::CompatFrom::compat_from(value.node_name),
12859
12860                node_properties: ::fidl_next::CompatFrom::compat_from(value.node_properties),
12861
12862                node_offers: ::fidl_next::CompatFrom::compat_from(value.node_offers),
12863
12864                node_token: ::fidl_next::CompatFrom::compat_from(value.node_token),
12865
12866                node_properties_2: ::fidl_next::CompatFrom::compat_from(value.node_properties_2),
12867
12868                vmar: ::fidl_next::CompatFrom::compat_from(value.vmar),
12869            }
12870        }
12871    }
12872
12873    #[cfg(feature = "driver")]
12874    impl ::fidl_next::CompatFrom<crate::DriverStartRequest>
12875        for ::fidl_fuchsia_driver_framework::DriverStartRequest
12876    {
12877        #[inline]
12878        fn compat_from(value: crate::DriverStartRequest) -> Self {
12879            Self { start_args: ::fidl_next::CompatFrom::compat_from(value.start_args) }
12880        }
12881    }
12882
12883    #[cfg(feature = "driver")]
12884    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DriverStartRequest>
12885        for crate::DriverStartRequest
12886    {
12887        #[inline]
12888        fn compat_from(value: ::fidl_fuchsia_driver_framework::DriverStartRequest) -> Self {
12889            Self { start_args: ::fidl_next::CompatFrom::compat_from(value.start_args) }
12890        }
12891    }
12892
12893    #[cfg(target_os = "fuchsia")]
12894    /// An alias for a client over `zx::Channel` for the `Driver`
12895    /// protocol.
12896    pub type DriverProxy = ::fidl_next::Client<crate::Driver>;
12897
12898    #[cfg(feature = "driver")]
12899    impl ::fidl_next::CompatFrom<crate::Driver> for ::fidl_fuchsia_driver_framework::DriverMarker {
12900        fn compat_from(_: crate::Driver) -> Self {
12901            Self
12902        }
12903    }
12904
12905    #[cfg(feature = "driver")]
12906    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DriverMarker> for crate::Driver {
12907        fn compat_from(_: ::fidl_fuchsia_driver_framework::DriverMarker) -> Self {
12908            Self
12909        }
12910    }
12911
12912    impl ::fidl_next::CompatFrom<crate::DriverResult>
12913        for ::fidl_fuchsia_driver_framework::DriverResult
12914    {
12915        fn compat_from(value: crate::DriverResult) -> Self {
12916            match value {
12917                crate::DriverResult::DriverStartedNodeToken(value) => {
12918                    Self::DriverStartedNodeToken(::fidl_next::CompatFrom::compat_from(value))
12919                }
12920
12921                crate::DriverResult::MatchError(value) => {
12922                    Self::MatchError(::fidl_next::CompatFrom::compat_from(value))
12923                }
12924
12925                crate::DriverResult::StartError(value) => {
12926                    Self::StartError(::fidl_next::CompatFrom::compat_from(value))
12927                }
12928
12929                crate::DriverResult::UnknownOrdinal_(unknown_ordinal) => {
12930                    Self::__SourceBreaking { unknown_ordinal }
12931                }
12932            }
12933        }
12934    }
12935
12936    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DriverResult>
12937        for crate::DriverResult
12938    {
12939        fn compat_from(value: ::fidl_fuchsia_driver_framework::DriverResult) -> Self {
12940            match value {
12941                ::fidl_fuchsia_driver_framework::DriverResult::DriverStartedNodeToken(value) => {
12942                    Self::DriverStartedNodeToken(::fidl_next::CompatFrom::compat_from(value))
12943                }
12944
12945                ::fidl_fuchsia_driver_framework::DriverResult::MatchError(value) => {
12946                    Self::MatchError(::fidl_next::CompatFrom::compat_from(value))
12947                }
12948
12949                ::fidl_fuchsia_driver_framework::DriverResult::StartError(value) => {
12950                    Self::StartError(::fidl_next::CompatFrom::compat_from(value))
12951                }
12952
12953                ::fidl_fuchsia_driver_framework::DriverResult::__SourceBreaking {
12954                    unknown_ordinal,
12955                } => Self::UnknownOrdinal_(unknown_ordinal),
12956            }
12957        }
12958    }
12959
12960    impl ::fidl_next::CompatFrom<crate::NodeError> for ::fidl_fuchsia_driver_framework::NodeError {
12961        fn compat_from(value: crate::NodeError) -> Self {
12962            match value {
12963                crate::NodeError::Internal => Self::Internal,
12964
12965                crate::NodeError::NodeRemoved => Self::NodeRemoved,
12966
12967                crate::NodeError::NameMissing => Self::NameMissing,
12968
12969                crate::NodeError::NameInvalid => Self::NameInvalid,
12970
12971                crate::NodeError::NameAlreadyExists => Self::NameAlreadyExists,
12972
12973                crate::NodeError::OfferSourceNameMissing => Self::OfferSourceNameMissing,
12974
12975                crate::NodeError::OfferRefExists => Self::OfferRefExists,
12976
12977                crate::NodeError::SymbolNameMissing => Self::SymbolNameMissing,
12978
12979                crate::NodeError::SymbolAddressMissing => Self::SymbolAddressMissing,
12980
12981                crate::NodeError::SymbolAlreadyExists => Self::SymbolAlreadyExists,
12982
12983                crate::NodeError::UnbindChildrenInProgress => Self::UnbindChildrenInProgress,
12984
12985                crate::NodeError::UnsupportedArgs => Self::UnsupportedArgs,
12986
12987                crate::NodeError::DuplicatePropertyKeys => Self::DuplicatePropertyKeys,
12988
12989                crate::NodeError::OfferSourceInstanceFilterMissing => {
12990                    Self::OfferSourceInstanceFilterMissing
12991                }
12992
12993                crate::NodeError::OfferRenamedInstancesMissing => {
12994                    Self::OfferRenamedInstancesMissing
12995                }
12996
12997                crate::NodeError::UnknownOrdinal_(unknown_ordinal) => {
12998                    Self::__SourceBreaking { unknown_ordinal }
12999                }
13000            }
13001        }
13002    }
13003
13004    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeError> for crate::NodeError {
13005        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodeError) -> Self {
13006            match value {
13007                ::fidl_fuchsia_driver_framework::NodeError::Internal => Self::Internal,
13008
13009                ::fidl_fuchsia_driver_framework::NodeError::NodeRemoved => Self::NodeRemoved,
13010
13011                ::fidl_fuchsia_driver_framework::NodeError::NameMissing => Self::NameMissing,
13012
13013                ::fidl_fuchsia_driver_framework::NodeError::NameInvalid => Self::NameInvalid,
13014
13015                ::fidl_fuchsia_driver_framework::NodeError::NameAlreadyExists => {
13016                    Self::NameAlreadyExists
13017                }
13018
13019                ::fidl_fuchsia_driver_framework::NodeError::OfferSourceNameMissing => {
13020                    Self::OfferSourceNameMissing
13021                }
13022
13023                ::fidl_fuchsia_driver_framework::NodeError::OfferRefExists => Self::OfferRefExists,
13024
13025                ::fidl_fuchsia_driver_framework::NodeError::SymbolNameMissing => {
13026                    Self::SymbolNameMissing
13027                }
13028
13029                ::fidl_fuchsia_driver_framework::NodeError::SymbolAddressMissing => {
13030                    Self::SymbolAddressMissing
13031                }
13032
13033                ::fidl_fuchsia_driver_framework::NodeError::SymbolAlreadyExists => {
13034                    Self::SymbolAlreadyExists
13035                }
13036
13037                ::fidl_fuchsia_driver_framework::NodeError::UnbindChildrenInProgress => {
13038                    Self::UnbindChildrenInProgress
13039                }
13040
13041                ::fidl_fuchsia_driver_framework::NodeError::UnsupportedArgs => {
13042                    Self::UnsupportedArgs
13043                }
13044
13045                ::fidl_fuchsia_driver_framework::NodeError::DuplicatePropertyKeys => {
13046                    Self::DuplicatePropertyKeys
13047                }
13048
13049                ::fidl_fuchsia_driver_framework::NodeError::OfferSourceInstanceFilterMissing => {
13050                    Self::OfferSourceInstanceFilterMissing
13051                }
13052
13053                ::fidl_fuchsia_driver_framework::NodeError::OfferRenamedInstancesMissing => {
13054                    Self::OfferRenamedInstancesMissing
13055                }
13056
13057                ::fidl_fuchsia_driver_framework::NodeError::__SourceBreaking {
13058                    unknown_ordinal: value,
13059                } => Self::UnknownOrdinal_(value),
13060            }
13061        }
13062    }
13063
13064    impl ::fidl_next::CompatFrom<crate::NodeAddArgs> for ::fidl_fuchsia_driver_framework::NodeAddArgs {
13065        fn compat_from(value: crate::NodeAddArgs) -> Self {
13066            Self {
13067                name: ::fidl_next::CompatFrom::compat_from(value.name),
13068
13069                symbols: ::fidl_next::CompatFrom::compat_from(value.symbols),
13070
13071                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
13072
13073                devfs_args: ::fidl_next::CompatFrom::compat_from(value.devfs_args),
13074
13075                offers2: ::fidl_next::CompatFrom::compat_from(value.offers2),
13076
13077                bus_info: ::fidl_next::CompatFrom::compat_from(value.bus_info),
13078
13079                properties2: ::fidl_next::CompatFrom::compat_from(value.properties2),
13080
13081                __source_breaking: ::fidl::marker::SourceBreaking,
13082            }
13083        }
13084    }
13085
13086    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeAddArgs> for crate::NodeAddArgs {
13087        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodeAddArgs) -> Self {
13088            Self {
13089                name: ::fidl_next::CompatFrom::compat_from(value.name),
13090
13091                symbols: ::fidl_next::CompatFrom::compat_from(value.symbols),
13092
13093                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
13094
13095                devfs_args: ::fidl_next::CompatFrom::compat_from(value.devfs_args),
13096
13097                offers2: ::fidl_next::CompatFrom::compat_from(value.offers2),
13098
13099                bus_info: ::fidl_next::CompatFrom::compat_from(value.bus_info),
13100
13101                properties2: ::fidl_next::CompatFrom::compat_from(value.properties2),
13102            }
13103        }
13104    }
13105
13106    impl ::fidl_next::CompatFrom<crate::NodeAddChildRequest>
13107        for ::fidl_fuchsia_driver_framework::NodeAddChildRequest
13108    {
13109        #[inline]
13110        fn compat_from(value: crate::NodeAddChildRequest) -> Self {
13111            Self {
13112                args: ::fidl_next::CompatFrom::compat_from(value.args),
13113
13114                controller: ::fidl_next::CompatFrom::compat_from(value.controller),
13115
13116                node: ::fidl_next::CompatFrom::compat_from(value.node),
13117            }
13118        }
13119    }
13120
13121    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeAddChildRequest>
13122        for crate::NodeAddChildRequest
13123    {
13124        #[inline]
13125        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodeAddChildRequest) -> Self {
13126            Self {
13127                args: ::fidl_next::CompatFrom::compat_from(value.args),
13128
13129                controller: ::fidl_next::CompatFrom::compat_from(value.controller),
13130
13131                node: ::fidl_next::CompatFrom::compat_from(value.node),
13132            }
13133        }
13134    }
13135
13136    #[cfg(target_os = "fuchsia")]
13137    /// An alias for a client over `zx::Channel` for the `Node`
13138    /// protocol.
13139    pub type NodeProxy = ::fidl_next::Client<crate::Node>;
13140
13141    impl ::fidl_next::CompatFrom<crate::Node> for ::fidl_fuchsia_driver_framework::NodeMarker {
13142        fn compat_from(_: crate::Node) -> Self {
13143            Self
13144        }
13145    }
13146
13147    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeMarker> for crate::Node {
13148        fn compat_from(_: ::fidl_fuchsia_driver_framework::NodeMarker) -> Self {
13149            Self
13150        }
13151    }
13152
13153    #[cfg(target_os = "fuchsia")]
13154
13155    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_driver_framework::NodeProxy> for crate::Node {
13156        fn client_compat_from(
13157            proxy: ::fidl_fuchsia_driver_framework::NodeProxy,
13158        ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
13159            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
13160            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
13161            ::fidl_next::ClientDispatcher::new(client_end)
13162        }
13163    }
13164
13165    impl ::fidl_next::CompatFrom<crate::NodeControllerRequestBindRequest>
13166        for ::fidl_fuchsia_driver_framework::NodeControllerRequestBindRequest
13167    {
13168        fn compat_from(value: crate::NodeControllerRequestBindRequest) -> Self {
13169            Self {
13170                force_rebind: ::fidl_next::CompatFrom::compat_from(value.force_rebind),
13171
13172                driver_url_suffix: ::fidl_next::CompatFrom::compat_from(value.driver_url_suffix),
13173
13174                __source_breaking: ::fidl::marker::SourceBreaking,
13175            }
13176        }
13177    }
13178
13179    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeControllerRequestBindRequest>
13180        for crate::NodeControllerRequestBindRequest
13181    {
13182        fn compat_from(
13183            value: ::fidl_fuchsia_driver_framework::NodeControllerRequestBindRequest,
13184        ) -> Self {
13185            Self {
13186                force_rebind: ::fidl_next::CompatFrom::compat_from(value.force_rebind),
13187
13188                driver_url_suffix: ::fidl_next::CompatFrom::compat_from(value.driver_url_suffix),
13189            }
13190        }
13191    }
13192
13193    impl ::fidl_next::CompatFrom<crate::NodeControllerOnBindRequest>
13194        for ::fidl_fuchsia_driver_framework::NodeControllerOnBindRequest
13195    {
13196        fn compat_from(value: crate::NodeControllerOnBindRequest) -> Self {
13197            Self {
13198                node_token: ::fidl_next::CompatFrom::compat_from(value.node_token),
13199
13200                __source_breaking: ::fidl::marker::SourceBreaking,
13201            }
13202        }
13203    }
13204
13205    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeControllerOnBindRequest>
13206        for crate::NodeControllerOnBindRequest
13207    {
13208        fn compat_from(
13209            value: ::fidl_fuchsia_driver_framework::NodeControllerOnBindRequest,
13210        ) -> Self {
13211            Self { node_token: ::fidl_next::CompatFrom::compat_from(value.node_token) }
13212        }
13213    }
13214
13215    #[cfg(target_os = "fuchsia")]
13216    /// An alias for a client over `zx::Channel` for the `NodeController`
13217    /// protocol.
13218    pub type NodeControllerProxy = ::fidl_next::Client<crate::NodeController>;
13219
13220    impl ::fidl_next::CompatFrom<crate::NodeController>
13221        for ::fidl_fuchsia_driver_framework::NodeControllerMarker
13222    {
13223        fn compat_from(_: crate::NodeController) -> Self {
13224            Self
13225        }
13226    }
13227
13228    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeControllerMarker>
13229        for crate::NodeController
13230    {
13231        fn compat_from(_: ::fidl_fuchsia_driver_framework::NodeControllerMarker) -> Self {
13232            Self
13233        }
13234    }
13235
13236    #[cfg(target_os = "fuchsia")]
13237
13238    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_driver_framework::NodeControllerProxy>
13239        for crate::NodeController
13240    {
13241        fn client_compat_from(
13242            proxy: ::fidl_fuchsia_driver_framework::NodeControllerProxy,
13243        ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
13244            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
13245            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
13246            ::fidl_next::ClientDispatcher::new(client_end)
13247        }
13248    }
13249}