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 = String;
11
12/// The wire type corresponding to [`NodePropertyKeyString`].
13pub type WireNodePropertyKeyString<'de> = ::fidl_next::WireString<'de>;
14
15#[derive(Clone, Debug)]
16pub enum NodePropertyKey {
17    IntValue(u32),
18
19    StringValue(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    ) -> 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) => {
45                ::fidl_next::RawWireUnion::encode_as::<___E, String>(value, 2, encoder, raw)?
46            }
47        }
48
49        Ok(())
50    }
51}
52
53unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodePropertyKey
54where
55    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
56    ___E: ::fidl_next::Encoder,
57{
58    #[inline]
59    fn encode_ref(
60        &self,
61        encoder: &mut ___E,
62        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
63    ) -> Result<(), ::fidl_next::EncodeError> {
64        ::fidl_next::munge!(let WireNodePropertyKey { raw, _phantom: _ } = out);
65
66        match self {
67            Self::IntValue(value) => {
68                ::fidl_next::RawWireUnion::encode_as::<___E, &u32>(value, 1, encoder, raw)?
69            }
70
71            Self::StringValue(value) => {
72                ::fidl_next::RawWireUnion::encode_as::<___E, &String>(value, 2, encoder, raw)?
73            }
74        }
75
76        Ok(())
77    }
78}
79
80impl ::fidl_next::EncodableOption for NodePropertyKey {
81    type EncodedOption = WireOptionalNodePropertyKey<'static>;
82}
83
84unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodePropertyKey
85where
86    ___E: ?Sized,
87    NodePropertyKey: ::fidl_next::Encode<___E>,
88{
89    #[inline]
90    fn encode_option(
91        this: Option<Self>,
92        encoder: &mut ___E,
93        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
94    ) -> Result<(), ::fidl_next::EncodeError> {
95        ::fidl_next::munge!(let WireOptionalNodePropertyKey { raw, _phantom: _ } = &mut *out);
96
97        if let Some(inner) = this {
98            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
99            ::fidl_next::Encode::encode(inner, encoder, value_out)?;
100        } else {
101            ::fidl_next::RawWireUnion::encode_absent(raw);
102        }
103
104        Ok(())
105    }
106}
107
108unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodePropertyKey
109where
110    ___E: ?Sized,
111    NodePropertyKey: ::fidl_next::EncodeRef<___E>,
112{
113    #[inline]
114    fn encode_option_ref(
115        this: Option<&Self>,
116        encoder: &mut ___E,
117        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
118    ) -> Result<(), ::fidl_next::EncodeError> {
119        ::fidl_next::munge!(let WireOptionalNodePropertyKey { raw, _phantom: _ } = &mut *out);
120
121        if let Some(inner) = this {
122            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
123            ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
124        } else {
125            ::fidl_next::RawWireUnion::encode_absent(raw);
126        }
127
128        Ok(())
129    }
130}
131
132impl<'de> ::fidl_next::FromWire<WireNodePropertyKey<'de>> for NodePropertyKey {
133    #[inline]
134    fn from_wire(wire: WireNodePropertyKey<'de>) -> Self {
135        let wire = ::core::mem::ManuallyDrop::new(wire);
136        match wire.raw.ordinal() {
137            1 => Self::IntValue(::fidl_next::FromWire::from_wire(unsafe {
138                wire.raw.get().read_unchecked::<::fidl_next::WireU32>()
139            })),
140
141            2 => Self::StringValue(::fidl_next::FromWire::from_wire(unsafe {
142                wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
143            })),
144
145            _ => unsafe { ::core::hint::unreachable_unchecked() },
146        }
147    }
148}
149
150impl<'de> ::fidl_next::FromWireRef<WireNodePropertyKey<'de>> for NodePropertyKey {
151    #[inline]
152    fn from_wire_ref(wire: &WireNodePropertyKey<'de>) -> Self {
153        match wire.raw.ordinal() {
154            1 => Self::IntValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
155                wire.raw.get().deref_unchecked::<::fidl_next::WireU32>()
156            })),
157
158            2 => Self::StringValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
159                wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
160            })),
161
162            _ => unsafe { ::core::hint::unreachable_unchecked() },
163        }
164    }
165}
166
167impl<'de> ::fidl_next::FromWireOption<WireOptionalNodePropertyKey<'de>> for Box<NodePropertyKey> {
168    #[inline]
169    fn from_wire_option(wire: WireOptionalNodePropertyKey<'de>) -> Option<Self> {
170        if let Some(inner) = wire.into_option() {
171            Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
172        } else {
173            None
174        }
175    }
176}
177
178impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalNodePropertyKey<'de>>
179    for Box<NodePropertyKey>
180{
181    #[inline]
182    fn from_wire_option_ref(wire: &WireOptionalNodePropertyKey<'de>) -> Option<Self> {
183        if let Some(inner) = wire.as_ref() {
184            Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
185        } else {
186            None
187        }
188    }
189}
190
191/// The wire type corresponding to [`NodePropertyKey`].
192#[repr(transparent)]
193pub struct WireNodePropertyKey<'de> {
194    raw: ::fidl_next::RawWireUnion,
195    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
196}
197
198impl<'de> Drop for WireNodePropertyKey<'de> {
199    fn drop(&mut self) {
200        match self.raw.ordinal() {
201            1 => {
202                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU32>() };
203            }
204
205            2 => {
206                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
207            }
208
209            _ => unsafe { ::core::hint::unreachable_unchecked() },
210        }
211    }
212}
213
214unsafe impl ::fidl_next::Wire for WireNodePropertyKey<'static> {
215    type Decoded<'de> = WireNodePropertyKey<'de>;
216
217    #[inline]
218    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
219        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
220        ::fidl_next::RawWireUnion::zero_padding(raw);
221    }
222}
223
224pub mod node_property_key {
225    pub enum Ref<'de> {
226        IntValue(&'de ::fidl_next::WireU32),
227
228        StringValue(&'de ::fidl_next::WireString<'de>),
229    }
230}
231
232impl<'de> WireNodePropertyKey<'de> {
233    pub fn as_ref(&self) -> crate::node_property_key::Ref<'_> {
234        match self.raw.ordinal() {
235            1 => crate::node_property_key::Ref::IntValue(unsafe {
236                self.raw.get().deref_unchecked::<::fidl_next::WireU32>()
237            }),
238
239            2 => crate::node_property_key::Ref::StringValue(unsafe {
240                self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
241            }),
242
243            _ => unsafe { ::core::hint::unreachable_unchecked() },
244        }
245    }
246}
247
248unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodePropertyKey<'static>
249where
250    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
251    ___D: ::fidl_next::Decoder,
252{
253    fn decode(
254        mut slot: ::fidl_next::Slot<'_, Self>,
255        decoder: &mut ___D,
256    ) -> Result<(), ::fidl_next::DecodeError> {
257        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
258        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
259            1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
260
261            2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
262                raw, decoder,
263            )?,
264
265            ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
266        }
267
268        Ok(())
269    }
270}
271
272impl<'de> ::core::fmt::Debug for WireNodePropertyKey<'de> {
273    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
274        match self.raw.ordinal() {
275            1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU32>().fmt(f) },
276            2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f) },
277            _ => unsafe { ::core::hint::unreachable_unchecked() },
278        }
279    }
280}
281
282#[repr(transparent)]
283pub struct WireOptionalNodePropertyKey<'de> {
284    raw: ::fidl_next::RawWireUnion,
285    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
286}
287
288unsafe impl ::fidl_next::Wire for WireOptionalNodePropertyKey<'static> {
289    type Decoded<'de> = WireOptionalNodePropertyKey<'de>;
290
291    #[inline]
292    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
293        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
294        ::fidl_next::RawWireUnion::zero_padding(raw);
295    }
296}
297
298impl<'de> WireOptionalNodePropertyKey<'de> {
299    pub fn is_some(&self) -> bool {
300        self.raw.is_some()
301    }
302
303    pub fn is_none(&self) -> bool {
304        self.raw.is_none()
305    }
306
307    pub fn as_ref(&self) -> Option<&WireNodePropertyKey<'de>> {
308        if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
309    }
310
311    pub fn into_option(self) -> Option<WireNodePropertyKey<'de>> {
312        if self.is_some() {
313            Some(WireNodePropertyKey { raw: self.raw, _phantom: ::core::marker::PhantomData })
314        } else {
315            None
316        }
317    }
318}
319
320unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalNodePropertyKey<'static>
321where
322    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
323    ___D: ::fidl_next::Decoder,
324{
325    fn decode(
326        mut slot: ::fidl_next::Slot<'_, Self>,
327        decoder: &mut ___D,
328    ) -> Result<(), ::fidl_next::DecodeError> {
329        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
330        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
331            1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
332
333            2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
334                raw, decoder,
335            )?,
336
337            0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
338            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
339        }
340
341        Ok(())
342    }
343}
344
345impl<'de> ::core::fmt::Debug for WireOptionalNodePropertyKey<'de> {
346    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
347        self.as_ref().fmt(f)
348    }
349}
350
351#[doc = " Represents a bind rule condition.\n"]
352#[derive(Clone, Copy, Debug, PartialEq, Eq)]
353#[repr(u32)]
354pub enum Condition {
355    Unknown = 0,
356    Accept = 1,
357    Reject = 2,
358}
359
360impl ::fidl_next::Encodable for Condition {
361    type Encoded = WireCondition;
362}
363impl ::std::convert::TryFrom<u32> for Condition {
364    type Error = ::fidl_next::UnknownStrictEnumMemberError;
365    fn try_from(value: u32) -> Result<Self, Self::Error> {
366        match value {
367            0 => Ok(Self::Unknown),
368            1 => Ok(Self::Accept),
369            2 => Ok(Self::Reject),
370
371            _ => Err(Self::Error::new(value.into())),
372        }
373    }
374}
375
376unsafe impl<___E> ::fidl_next::Encode<___E> for Condition
377where
378    ___E: ?Sized,
379{
380    #[inline]
381    fn encode(
382        self,
383        encoder: &mut ___E,
384        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
385    ) -> Result<(), ::fidl_next::EncodeError> {
386        ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
387    }
388}
389
390unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Condition
391where
392    ___E: ?Sized,
393{
394    #[inline]
395    fn encode_ref(
396        &self,
397        encoder: &mut ___E,
398        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
399    ) -> Result<(), ::fidl_next::EncodeError> {
400        ::fidl_next::munge!(let WireCondition { value } = out);
401        let _ = value.write(::fidl_next::WireU32::from(match *self {
402            Self::Unknown => 0,
403
404            Self::Accept => 1,
405
406            Self::Reject => 2,
407        }));
408
409        Ok(())
410    }
411}
412
413impl ::core::convert::From<WireCondition> for Condition {
414    fn from(wire: WireCondition) -> Self {
415        match u32::from(wire.value) {
416            0 => Self::Unknown,
417
418            1 => Self::Accept,
419
420            2 => Self::Reject,
421
422            _ => unsafe { ::core::hint::unreachable_unchecked() },
423        }
424    }
425}
426
427impl ::fidl_next::FromWire<WireCondition> for Condition {
428    #[inline]
429    fn from_wire(wire: WireCondition) -> Self {
430        Self::from(wire)
431    }
432}
433
434impl ::fidl_next::FromWireRef<WireCondition> for Condition {
435    #[inline]
436    fn from_wire_ref(wire: &WireCondition) -> Self {
437        Self::from(*wire)
438    }
439}
440
441/// The wire type corresponding to [`Condition`].
442#[derive(Clone, Copy, Debug, PartialEq, Eq)]
443#[repr(transparent)]
444pub struct WireCondition {
445    value: ::fidl_next::WireU32,
446}
447
448unsafe impl ::fidl_next::Wire for WireCondition {
449    type Decoded<'de> = Self;
450
451    #[inline]
452    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
453        // Wire enums have no padding
454    }
455}
456
457impl WireCondition {
458    pub const UNKNOWN: WireCondition = WireCondition { value: ::fidl_next::WireU32(0) };
459
460    pub const ACCEPT: WireCondition = WireCondition { value: ::fidl_next::WireU32(1) };
461
462    pub const REJECT: WireCondition = WireCondition { value: ::fidl_next::WireU32(2) };
463}
464
465unsafe impl<___D> ::fidl_next::Decode<___D> for WireCondition
466where
467    ___D: ?Sized,
468{
469    fn decode(
470        slot: ::fidl_next::Slot<'_, Self>,
471        _: &mut ___D,
472    ) -> Result<(), ::fidl_next::DecodeError> {
473        ::fidl_next::munge!(let Self { value } = slot);
474
475        match u32::from(*value) {
476            0 | 1 | 2 => (),
477            unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
478        }
479
480        Ok(())
481    }
482}
483
484impl ::core::convert::From<Condition> for WireCondition {
485    fn from(natural: Condition) -> Self {
486        match natural {
487            Condition::Unknown => WireCondition::UNKNOWN,
488
489            Condition::Accept => WireCondition::ACCEPT,
490
491            Condition::Reject => WireCondition::REJECT,
492        }
493    }
494}
495
496pub type NodePropertyValueUint = u32;
497
498/// The wire type corresponding to [`NodePropertyValueUint`].
499pub type WireNodePropertyValueUint = ::fidl_next::WireU32;
500
501pub type NodePropertyValueString = String;
502
503/// The wire type corresponding to [`NodePropertyValueString`].
504pub type WireNodePropertyValueString<'de> = ::fidl_next::WireString<'de>;
505
506pub type NodePropertyValueBool = bool;
507
508/// The wire type corresponding to [`NodePropertyValueBool`].
509pub type WireNodePropertyValueBool = bool;
510
511pub type NodePropertyValueEnum = String;
512
513/// The wire type corresponding to [`NodePropertyValueEnum`].
514pub type WireNodePropertyValueEnum<'de> = ::fidl_next::WireString<'de>;
515
516#[derive(Clone, Debug)]
517pub enum NodePropertyValue {
518    IntValue(u32),
519
520    StringValue(String),
521
522    BoolValue(bool),
523
524    EnumValue(String),
525
526    UnknownOrdinal_(u64),
527}
528
529impl ::fidl_next::Encodable for NodePropertyValue {
530    type Encoded = WireNodePropertyValue<'static>;
531}
532
533unsafe impl<___E> ::fidl_next::Encode<___E> for NodePropertyValue
534where
535    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
536    ___E: ::fidl_next::Encoder,
537{
538    #[inline]
539    fn encode(
540        self,
541        encoder: &mut ___E,
542        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
543    ) -> Result<(), ::fidl_next::EncodeError> {
544        ::fidl_next::munge!(let WireNodePropertyValue { raw, _phantom: _ } = out);
545
546        match self {
547            Self::IntValue(value) => {
548                ::fidl_next::RawWireUnion::encode_as::<___E, u32>(value, 1, encoder, raw)?
549            }
550
551            Self::StringValue(value) => {
552                ::fidl_next::RawWireUnion::encode_as::<___E, String>(value, 2, encoder, raw)?
553            }
554
555            Self::BoolValue(value) => {
556                ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 3, encoder, raw)?
557            }
558
559            Self::EnumValue(value) => {
560                ::fidl_next::RawWireUnion::encode_as::<___E, String>(value, 4, encoder, raw)?
561            }
562
563            Self::UnknownOrdinal_(ordinal) => {
564                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
565            }
566        }
567
568        Ok(())
569    }
570}
571
572unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodePropertyValue
573where
574    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
575    ___E: ::fidl_next::Encoder,
576{
577    #[inline]
578    fn encode_ref(
579        &self,
580        encoder: &mut ___E,
581        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
582    ) -> Result<(), ::fidl_next::EncodeError> {
583        ::fidl_next::munge!(let WireNodePropertyValue { raw, _phantom: _ } = out);
584
585        match self {
586            Self::IntValue(value) => {
587                ::fidl_next::RawWireUnion::encode_as::<___E, &u32>(value, 1, encoder, raw)?
588            }
589
590            Self::StringValue(value) => {
591                ::fidl_next::RawWireUnion::encode_as::<___E, &String>(value, 2, encoder, raw)?
592            }
593
594            Self::BoolValue(value) => {
595                ::fidl_next::RawWireUnion::encode_as::<___E, &bool>(value, 3, encoder, raw)?
596            }
597
598            Self::EnumValue(value) => {
599                ::fidl_next::RawWireUnion::encode_as::<___E, &String>(value, 4, encoder, raw)?
600            }
601
602            Self::UnknownOrdinal_(ordinal) => {
603                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
604            }
605        }
606
607        Ok(())
608    }
609}
610
611impl ::fidl_next::EncodableOption for NodePropertyValue {
612    type EncodedOption = WireOptionalNodePropertyValue<'static>;
613}
614
615unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodePropertyValue
616where
617    ___E: ?Sized,
618    NodePropertyValue: ::fidl_next::Encode<___E>,
619{
620    #[inline]
621    fn encode_option(
622        this: Option<Self>,
623        encoder: &mut ___E,
624        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
625    ) -> Result<(), ::fidl_next::EncodeError> {
626        ::fidl_next::munge!(let WireOptionalNodePropertyValue { raw, _phantom: _ } = &mut *out);
627
628        if let Some(inner) = this {
629            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
630            ::fidl_next::Encode::encode(inner, encoder, value_out)?;
631        } else {
632            ::fidl_next::RawWireUnion::encode_absent(raw);
633        }
634
635        Ok(())
636    }
637}
638
639unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodePropertyValue
640where
641    ___E: ?Sized,
642    NodePropertyValue: ::fidl_next::EncodeRef<___E>,
643{
644    #[inline]
645    fn encode_option_ref(
646        this: Option<&Self>,
647        encoder: &mut ___E,
648        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
649    ) -> Result<(), ::fidl_next::EncodeError> {
650        ::fidl_next::munge!(let WireOptionalNodePropertyValue { raw, _phantom: _ } = &mut *out);
651
652        if let Some(inner) = this {
653            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
654            ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
655        } else {
656            ::fidl_next::RawWireUnion::encode_absent(raw);
657        }
658
659        Ok(())
660    }
661}
662
663impl<'de> ::fidl_next::FromWire<WireNodePropertyValue<'de>> for NodePropertyValue {
664    #[inline]
665    fn from_wire(wire: WireNodePropertyValue<'de>) -> Self {
666        let wire = ::core::mem::ManuallyDrop::new(wire);
667        match wire.raw.ordinal() {
668            1 => Self::IntValue(::fidl_next::FromWire::from_wire(unsafe {
669                wire.raw.get().read_unchecked::<::fidl_next::WireU32>()
670            })),
671
672            2 => Self::StringValue(::fidl_next::FromWire::from_wire(unsafe {
673                wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
674            })),
675
676            3 => Self::BoolValue(::fidl_next::FromWire::from_wire(unsafe {
677                wire.raw.get().read_unchecked::<bool>()
678            })),
679
680            4 => Self::EnumValue(::fidl_next::FromWire::from_wire(unsafe {
681                wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
682            })),
683
684            _ => unsafe { ::core::hint::unreachable_unchecked() },
685        }
686    }
687}
688
689impl<'de> ::fidl_next::FromWireRef<WireNodePropertyValue<'de>> for NodePropertyValue {
690    #[inline]
691    fn from_wire_ref(wire: &WireNodePropertyValue<'de>) -> Self {
692        match wire.raw.ordinal() {
693            1 => Self::IntValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
694                wire.raw.get().deref_unchecked::<::fidl_next::WireU32>()
695            })),
696
697            2 => Self::StringValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
698                wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
699            })),
700
701            3 => Self::BoolValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
702                wire.raw.get().deref_unchecked::<bool>()
703            })),
704
705            4 => Self::EnumValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
706                wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
707            })),
708
709            _ => unsafe { ::core::hint::unreachable_unchecked() },
710        }
711    }
712}
713
714impl<'de> ::fidl_next::FromWireOption<WireOptionalNodePropertyValue<'de>>
715    for Box<NodePropertyValue>
716{
717    #[inline]
718    fn from_wire_option(wire: WireOptionalNodePropertyValue<'de>) -> Option<Self> {
719        if let Some(inner) = wire.into_option() {
720            Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
721        } else {
722            None
723        }
724    }
725}
726
727impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalNodePropertyValue<'de>>
728    for Box<NodePropertyValue>
729{
730    #[inline]
731    fn from_wire_option_ref(wire: &WireOptionalNodePropertyValue<'de>) -> Option<Self> {
732        if let Some(inner) = wire.as_ref() {
733            Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
734        } else {
735            None
736        }
737    }
738}
739
740/// The wire type corresponding to [`NodePropertyValue`].
741#[repr(transparent)]
742pub struct WireNodePropertyValue<'de> {
743    raw: ::fidl_next::RawWireUnion,
744    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
745}
746
747impl<'de> Drop for WireNodePropertyValue<'de> {
748    fn drop(&mut self) {
749        match self.raw.ordinal() {
750            1 => {
751                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU32>() };
752            }
753
754            2 => {
755                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
756            }
757
758            3 => {
759                let _ = unsafe { self.raw.get().read_unchecked::<bool>() };
760            }
761
762            4 => {
763                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
764            }
765
766            _ => (),
767        }
768    }
769}
770
771unsafe impl ::fidl_next::Wire for WireNodePropertyValue<'static> {
772    type Decoded<'de> = WireNodePropertyValue<'de>;
773
774    #[inline]
775    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
776        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
777        ::fidl_next::RawWireUnion::zero_padding(raw);
778    }
779}
780
781pub mod node_property_value {
782    pub enum Ref<'de> {
783        IntValue(&'de ::fidl_next::WireU32),
784
785        StringValue(&'de ::fidl_next::WireString<'de>),
786
787        BoolValue(&'de bool),
788
789        EnumValue(&'de ::fidl_next::WireString<'de>),
790
791        UnknownOrdinal_(u64),
792    }
793}
794
795impl<'de> WireNodePropertyValue<'de> {
796    pub fn as_ref(&self) -> crate::node_property_value::Ref<'_> {
797        match self.raw.ordinal() {
798            1 => crate::node_property_value::Ref::IntValue(unsafe {
799                self.raw.get().deref_unchecked::<::fidl_next::WireU32>()
800            }),
801
802            2 => crate::node_property_value::Ref::StringValue(unsafe {
803                self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
804            }),
805
806            3 => crate::node_property_value::Ref::BoolValue(unsafe {
807                self.raw.get().deref_unchecked::<bool>()
808            }),
809
810            4 => crate::node_property_value::Ref::EnumValue(unsafe {
811                self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
812            }),
813
814            unknown => crate::node_property_value::Ref::UnknownOrdinal_(unknown),
815        }
816    }
817}
818
819unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodePropertyValue<'static>
820where
821    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
822    ___D: ::fidl_next::Decoder,
823{
824    fn decode(
825        mut slot: ::fidl_next::Slot<'_, Self>,
826        decoder: &mut ___D,
827    ) -> Result<(), ::fidl_next::DecodeError> {
828        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
829        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
830            1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
831
832            2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
833                raw, decoder,
834            )?,
835
836            3 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder)?,
837
838            4 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
839                raw, decoder,
840            )?,
841
842            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
843        }
844
845        Ok(())
846    }
847}
848
849impl<'de> ::core::fmt::Debug for WireNodePropertyValue<'de> {
850    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
851        match self.raw.ordinal() {
852            1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU32>().fmt(f) },
853            2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f) },
854            3 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) },
855            4 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f) },
856            _ => unsafe { ::core::hint::unreachable_unchecked() },
857        }
858    }
859}
860
861#[repr(transparent)]
862pub struct WireOptionalNodePropertyValue<'de> {
863    raw: ::fidl_next::RawWireUnion,
864    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
865}
866
867unsafe impl ::fidl_next::Wire for WireOptionalNodePropertyValue<'static> {
868    type Decoded<'de> = WireOptionalNodePropertyValue<'de>;
869
870    #[inline]
871    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
872        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
873        ::fidl_next::RawWireUnion::zero_padding(raw);
874    }
875}
876
877impl<'de> WireOptionalNodePropertyValue<'de> {
878    pub fn is_some(&self) -> bool {
879        self.raw.is_some()
880    }
881
882    pub fn is_none(&self) -> bool {
883        self.raw.is_none()
884    }
885
886    pub fn as_ref(&self) -> Option<&WireNodePropertyValue<'de>> {
887        if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
888    }
889
890    pub fn into_option(self) -> Option<WireNodePropertyValue<'de>> {
891        if self.is_some() {
892            Some(WireNodePropertyValue { raw: self.raw, _phantom: ::core::marker::PhantomData })
893        } else {
894            None
895        }
896    }
897}
898
899unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalNodePropertyValue<'static>
900where
901    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
902    ___D: ::fidl_next::Decoder,
903{
904    fn decode(
905        mut slot: ::fidl_next::Slot<'_, Self>,
906        decoder: &mut ___D,
907    ) -> Result<(), ::fidl_next::DecodeError> {
908        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
909        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
910            1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
911
912            2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
913                raw, decoder,
914            )?,
915
916            3 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder)?,
917
918            4 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
919                raw, decoder,
920            )?,
921
922            0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
923            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
924        }
925
926        Ok(())
927    }
928}
929
930impl<'de> ::core::fmt::Debug for WireOptionalNodePropertyValue<'de> {
931    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
932        self.as_ref().fmt(f)
933    }
934}
935
936pub const MAX_PROPERTY_COUNT: u8 = 64;
937
938#[doc = " Represents a bind rule in a parent specification.\n"]
939#[derive(Clone, Debug)]
940pub struct BindRule {
941    pub key: crate::NodePropertyKey,
942
943    pub condition: crate::Condition,
944
945    pub values: Vec<crate::NodePropertyValue>,
946}
947
948impl ::fidl_next::Encodable for BindRule {
949    type Encoded = WireBindRule<'static>;
950}
951
952unsafe impl<___E> ::fidl_next::Encode<___E> for BindRule
953where
954    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
955    ___E: ::fidl_next::Encoder,
956{
957    #[inline]
958    fn encode(
959        self,
960        encoder: &mut ___E,
961        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
962    ) -> Result<(), ::fidl_next::EncodeError> {
963        ::fidl_next::munge! {
964            let Self::Encoded {
965                key,
966                condition,
967                values,
968
969            } = out;
970        }
971
972        ::fidl_next::Encode::encode(self.key, encoder, key)?;
973
974        ::fidl_next::Encode::encode(self.condition, encoder, condition)?;
975
976        ::fidl_next::Encode::encode(self.values, encoder, values)?;
977
978        Ok(())
979    }
980}
981
982unsafe impl<___E> ::fidl_next::EncodeRef<___E> for BindRule
983where
984    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
985    ___E: ::fidl_next::Encoder,
986{
987    #[inline]
988    fn encode_ref(
989        &self,
990        encoder: &mut ___E,
991        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
992    ) -> Result<(), ::fidl_next::EncodeError> {
993        ::fidl_next::munge! {
994            let Self::Encoded {
995                key,
996                condition,
997                values,
998
999            } = out;
1000        }
1001
1002        ::fidl_next::EncodeRef::encode_ref(&self.key, encoder, key)?;
1003
1004        ::fidl_next::EncodeRef::encode_ref(&self.condition, encoder, condition)?;
1005
1006        ::fidl_next::EncodeRef::encode_ref(&self.values, encoder, values)?;
1007
1008        Ok(())
1009    }
1010}
1011
1012impl ::fidl_next::EncodableOption for BindRule {
1013    type EncodedOption = ::fidl_next::WireBox<'static, WireBindRule<'static>>;
1014}
1015
1016unsafe impl<___E> ::fidl_next::EncodeOption<___E> for BindRule
1017where
1018    ___E: ::fidl_next::Encoder + ?Sized,
1019    BindRule: ::fidl_next::Encode<___E>,
1020{
1021    #[inline]
1022    fn encode_option(
1023        this: Option<Self>,
1024        encoder: &mut ___E,
1025        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1026    ) -> Result<(), ::fidl_next::EncodeError> {
1027        if let Some(inner) = this {
1028            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1029            ::fidl_next::WireBox::encode_present(out);
1030        } else {
1031            ::fidl_next::WireBox::encode_absent(out);
1032        }
1033
1034        Ok(())
1035    }
1036}
1037
1038unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for BindRule
1039where
1040    ___E: ::fidl_next::Encoder + ?Sized,
1041    BindRule: ::fidl_next::EncodeRef<___E>,
1042{
1043    #[inline]
1044    fn encode_option_ref(
1045        this: Option<&Self>,
1046        encoder: &mut ___E,
1047        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1048    ) -> Result<(), ::fidl_next::EncodeError> {
1049        if let Some(inner) = this {
1050            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1051            ::fidl_next::WireBox::encode_present(out);
1052        } else {
1053            ::fidl_next::WireBox::encode_absent(out);
1054        }
1055
1056        Ok(())
1057    }
1058}
1059
1060impl<'de> ::fidl_next::FromWire<WireBindRule<'de>> for BindRule {
1061    #[inline]
1062    fn from_wire(wire: WireBindRule<'de>) -> Self {
1063        Self {
1064            key: ::fidl_next::FromWire::from_wire(wire.key),
1065
1066            condition: ::fidl_next::FromWire::from_wire(wire.condition),
1067
1068            values: ::fidl_next::FromWire::from_wire(wire.values),
1069        }
1070    }
1071}
1072
1073impl<'de> ::fidl_next::FromWireRef<WireBindRule<'de>> for BindRule {
1074    #[inline]
1075    fn from_wire_ref(wire: &WireBindRule<'de>) -> Self {
1076        Self {
1077            key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
1078
1079            condition: ::fidl_next::FromWireRef::from_wire_ref(&wire.condition),
1080
1081            values: ::fidl_next::FromWireRef::from_wire_ref(&wire.values),
1082        }
1083    }
1084}
1085
1086/// The wire type corresponding to [`BindRule`].
1087#[derive(Debug)]
1088#[repr(C)]
1089pub struct WireBindRule<'de> {
1090    pub key: crate::WireNodePropertyKey<'de>,
1091
1092    pub condition: crate::WireCondition,
1093
1094    pub values: ::fidl_next::WireVector<'de, crate::WireNodePropertyValue<'de>>,
1095}
1096
1097unsafe impl ::fidl_next::Wire for WireBindRule<'static> {
1098    type Decoded<'de> = WireBindRule<'de>;
1099
1100    #[inline]
1101    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1102        unsafe {
1103            out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
1104        }
1105    }
1106}
1107
1108unsafe impl<___D> ::fidl_next::Decode<___D> for WireBindRule<'static>
1109where
1110    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1111    ___D: ::fidl_next::Decoder,
1112{
1113    fn decode(
1114        slot: ::fidl_next::Slot<'_, Self>,
1115        decoder: &mut ___D,
1116    ) -> Result<(), ::fidl_next::DecodeError> {
1117        ::fidl_next::munge! {
1118            let Self {
1119                mut key,
1120                mut condition,
1121                mut values,
1122
1123            } = slot;
1124        }
1125
1126        ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
1127
1128        ::fidl_next::Decode::decode(condition.as_mut(), decoder)?;
1129
1130        ::fidl_next::Decode::decode(values.as_mut(), decoder)?;
1131
1132        let values = unsafe { values.deref_unchecked() };
1133
1134        if values.len() > 64 {
1135            return Err(::fidl_next::DecodeError::VectorTooLong {
1136                size: values.len() as u64,
1137                limit: 64,
1138            });
1139        }
1140
1141        Ok(())
1142    }
1143}
1144
1145#[doc = " Represents a bind rule in a parent specification.\n"]
1146#[derive(Clone, Debug)]
1147pub struct BindRule2 {
1148    pub key: String,
1149
1150    pub condition: crate::Condition,
1151
1152    pub values: Vec<crate::NodePropertyValue>,
1153}
1154
1155impl ::fidl_next::Encodable for BindRule2 {
1156    type Encoded = WireBindRule2<'static>;
1157}
1158
1159unsafe impl<___E> ::fidl_next::Encode<___E> for BindRule2
1160where
1161    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1162    ___E: ::fidl_next::Encoder,
1163{
1164    #[inline]
1165    fn encode(
1166        self,
1167        encoder: &mut ___E,
1168        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1169    ) -> Result<(), ::fidl_next::EncodeError> {
1170        ::fidl_next::munge! {
1171            let Self::Encoded {
1172                key,
1173                condition,
1174                values,
1175
1176            } = out;
1177        }
1178
1179        ::fidl_next::Encode::encode(self.key, encoder, key)?;
1180
1181        ::fidl_next::Encode::encode(self.condition, encoder, condition)?;
1182
1183        ::fidl_next::Encode::encode(self.values, encoder, values)?;
1184
1185        Ok(())
1186    }
1187}
1188
1189unsafe impl<___E> ::fidl_next::EncodeRef<___E> for BindRule2
1190where
1191    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1192    ___E: ::fidl_next::Encoder,
1193{
1194    #[inline]
1195    fn encode_ref(
1196        &self,
1197        encoder: &mut ___E,
1198        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1199    ) -> Result<(), ::fidl_next::EncodeError> {
1200        ::fidl_next::munge! {
1201            let Self::Encoded {
1202                key,
1203                condition,
1204                values,
1205
1206            } = out;
1207        }
1208
1209        ::fidl_next::EncodeRef::encode_ref(&self.key, encoder, key)?;
1210
1211        ::fidl_next::EncodeRef::encode_ref(&self.condition, encoder, condition)?;
1212
1213        ::fidl_next::EncodeRef::encode_ref(&self.values, encoder, values)?;
1214
1215        Ok(())
1216    }
1217}
1218
1219impl ::fidl_next::EncodableOption for BindRule2 {
1220    type EncodedOption = ::fidl_next::WireBox<'static, WireBindRule2<'static>>;
1221}
1222
1223unsafe impl<___E> ::fidl_next::EncodeOption<___E> for BindRule2
1224where
1225    ___E: ::fidl_next::Encoder + ?Sized,
1226    BindRule2: ::fidl_next::Encode<___E>,
1227{
1228    #[inline]
1229    fn encode_option(
1230        this: Option<Self>,
1231        encoder: &mut ___E,
1232        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1233    ) -> Result<(), ::fidl_next::EncodeError> {
1234        if let Some(inner) = this {
1235            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1236            ::fidl_next::WireBox::encode_present(out);
1237        } else {
1238            ::fidl_next::WireBox::encode_absent(out);
1239        }
1240
1241        Ok(())
1242    }
1243}
1244
1245unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for BindRule2
1246where
1247    ___E: ::fidl_next::Encoder + ?Sized,
1248    BindRule2: ::fidl_next::EncodeRef<___E>,
1249{
1250    #[inline]
1251    fn encode_option_ref(
1252        this: Option<&Self>,
1253        encoder: &mut ___E,
1254        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1255    ) -> Result<(), ::fidl_next::EncodeError> {
1256        if let Some(inner) = this {
1257            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1258            ::fidl_next::WireBox::encode_present(out);
1259        } else {
1260            ::fidl_next::WireBox::encode_absent(out);
1261        }
1262
1263        Ok(())
1264    }
1265}
1266
1267impl<'de> ::fidl_next::FromWire<WireBindRule2<'de>> for BindRule2 {
1268    #[inline]
1269    fn from_wire(wire: WireBindRule2<'de>) -> Self {
1270        Self {
1271            key: ::fidl_next::FromWire::from_wire(wire.key),
1272
1273            condition: ::fidl_next::FromWire::from_wire(wire.condition),
1274
1275            values: ::fidl_next::FromWire::from_wire(wire.values),
1276        }
1277    }
1278}
1279
1280impl<'de> ::fidl_next::FromWireRef<WireBindRule2<'de>> for BindRule2 {
1281    #[inline]
1282    fn from_wire_ref(wire: &WireBindRule2<'de>) -> Self {
1283        Self {
1284            key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
1285
1286            condition: ::fidl_next::FromWireRef::from_wire_ref(&wire.condition),
1287
1288            values: ::fidl_next::FromWireRef::from_wire_ref(&wire.values),
1289        }
1290    }
1291}
1292
1293/// The wire type corresponding to [`BindRule2`].
1294#[derive(Debug)]
1295#[repr(C)]
1296pub struct WireBindRule2<'de> {
1297    pub key: ::fidl_next::WireString<'de>,
1298
1299    pub condition: crate::WireCondition,
1300
1301    pub values: ::fidl_next::WireVector<'de, crate::WireNodePropertyValue<'de>>,
1302}
1303
1304unsafe impl ::fidl_next::Wire for WireBindRule2<'static> {
1305    type Decoded<'de> = WireBindRule2<'de>;
1306
1307    #[inline]
1308    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1309        unsafe {
1310            out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
1311        }
1312    }
1313}
1314
1315unsafe impl<___D> ::fidl_next::Decode<___D> for WireBindRule2<'static>
1316where
1317    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1318    ___D: ::fidl_next::Decoder,
1319{
1320    fn decode(
1321        slot: ::fidl_next::Slot<'_, Self>,
1322        decoder: &mut ___D,
1323    ) -> Result<(), ::fidl_next::DecodeError> {
1324        ::fidl_next::munge! {
1325            let Self {
1326                mut key,
1327                mut condition,
1328                mut values,
1329
1330            } = slot;
1331        }
1332
1333        ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
1334
1335        let key = unsafe { key.deref_unchecked() };
1336
1337        if key.len() > 256 {
1338            return Err(::fidl_next::DecodeError::VectorTooLong {
1339                size: key.len() as u64,
1340                limit: 256,
1341            });
1342        }
1343
1344        ::fidl_next::Decode::decode(condition.as_mut(), decoder)?;
1345
1346        ::fidl_next::Decode::decode(values.as_mut(), decoder)?;
1347
1348        let values = unsafe { values.deref_unchecked() };
1349
1350        if values.len() > 64 {
1351            return Err(::fidl_next::DecodeError::VectorTooLong {
1352                size: values.len() as u64,
1353                limit: 64,
1354            });
1355        }
1356
1357        Ok(())
1358    }
1359}
1360
1361#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1362#[repr(u32)]
1363pub enum BusType {
1364    Platform = 1,
1365    Acpi = 2,
1366    DeviceTree = 3,
1367    Pci = 4,
1368    Usb = 5,
1369    Gpio = 6,
1370    I2C = 7,
1371    Spi = 8,
1372    Sdio = 9,
1373    Uart = 10,
1374    Spmi = 11,
1375    UnknownOrdinal_(u32),
1376}
1377
1378impl ::fidl_next::Encodable for BusType {
1379    type Encoded = WireBusType;
1380}
1381impl ::std::convert::From<u32> for BusType {
1382    fn from(value: u32) -> Self {
1383        match value {
1384            1 => Self::Platform,
1385            2 => Self::Acpi,
1386            3 => Self::DeviceTree,
1387            4 => Self::Pci,
1388            5 => Self::Usb,
1389            6 => Self::Gpio,
1390            7 => Self::I2C,
1391            8 => Self::Spi,
1392            9 => Self::Sdio,
1393            10 => Self::Uart,
1394            11 => Self::Spmi,
1395
1396            _ => Self::UnknownOrdinal_(value),
1397        }
1398    }
1399}
1400
1401unsafe impl<___E> ::fidl_next::Encode<___E> for BusType
1402where
1403    ___E: ?Sized,
1404{
1405    #[inline]
1406    fn encode(
1407        self,
1408        encoder: &mut ___E,
1409        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1410    ) -> Result<(), ::fidl_next::EncodeError> {
1411        ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
1412    }
1413}
1414
1415unsafe impl<___E> ::fidl_next::EncodeRef<___E> for BusType
1416where
1417    ___E: ?Sized,
1418{
1419    #[inline]
1420    fn encode_ref(
1421        &self,
1422        encoder: &mut ___E,
1423        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1424    ) -> Result<(), ::fidl_next::EncodeError> {
1425        ::fidl_next::munge!(let WireBusType { value } = out);
1426        let _ = value.write(::fidl_next::WireU32::from(match *self {
1427            Self::Platform => 1,
1428
1429            Self::Acpi => 2,
1430
1431            Self::DeviceTree => 3,
1432
1433            Self::Pci => 4,
1434
1435            Self::Usb => 5,
1436
1437            Self::Gpio => 6,
1438
1439            Self::I2C => 7,
1440
1441            Self::Spi => 8,
1442
1443            Self::Sdio => 9,
1444
1445            Self::Uart => 10,
1446
1447            Self::Spmi => 11,
1448
1449            Self::UnknownOrdinal_(value) => value,
1450        }));
1451
1452        Ok(())
1453    }
1454}
1455
1456impl ::core::convert::From<WireBusType> for BusType {
1457    fn from(wire: WireBusType) -> Self {
1458        match u32::from(wire.value) {
1459            1 => Self::Platform,
1460
1461            2 => Self::Acpi,
1462
1463            3 => Self::DeviceTree,
1464
1465            4 => Self::Pci,
1466
1467            5 => Self::Usb,
1468
1469            6 => Self::Gpio,
1470
1471            7 => Self::I2C,
1472
1473            8 => Self::Spi,
1474
1475            9 => Self::Sdio,
1476
1477            10 => Self::Uart,
1478
1479            11 => Self::Spmi,
1480
1481            value => Self::UnknownOrdinal_(value),
1482        }
1483    }
1484}
1485
1486impl ::fidl_next::FromWire<WireBusType> for BusType {
1487    #[inline]
1488    fn from_wire(wire: WireBusType) -> Self {
1489        Self::from(wire)
1490    }
1491}
1492
1493impl ::fidl_next::FromWireRef<WireBusType> for BusType {
1494    #[inline]
1495    fn from_wire_ref(wire: &WireBusType) -> Self {
1496        Self::from(*wire)
1497    }
1498}
1499
1500/// The wire type corresponding to [`BusType`].
1501#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1502#[repr(transparent)]
1503pub struct WireBusType {
1504    value: ::fidl_next::WireU32,
1505}
1506
1507unsafe impl ::fidl_next::Wire for WireBusType {
1508    type Decoded<'de> = Self;
1509
1510    #[inline]
1511    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1512        // Wire enums have no padding
1513    }
1514}
1515
1516impl WireBusType {
1517    pub const PLATFORM: WireBusType = WireBusType { value: ::fidl_next::WireU32(1) };
1518
1519    pub const ACPI: WireBusType = WireBusType { value: ::fidl_next::WireU32(2) };
1520
1521    pub const DEVICE_TREE: WireBusType = WireBusType { value: ::fidl_next::WireU32(3) };
1522
1523    pub const PCI: WireBusType = WireBusType { value: ::fidl_next::WireU32(4) };
1524
1525    pub const USB: WireBusType = WireBusType { value: ::fidl_next::WireU32(5) };
1526
1527    pub const GPIO: WireBusType = WireBusType { value: ::fidl_next::WireU32(6) };
1528
1529    pub const I2_C: WireBusType = WireBusType { value: ::fidl_next::WireU32(7) };
1530
1531    pub const SPI: WireBusType = WireBusType { value: ::fidl_next::WireU32(8) };
1532
1533    pub const SDIO: WireBusType = WireBusType { value: ::fidl_next::WireU32(9) };
1534
1535    pub const UART: WireBusType = WireBusType { value: ::fidl_next::WireU32(10) };
1536
1537    pub const SPMI: WireBusType = WireBusType { value: ::fidl_next::WireU32(11) };
1538}
1539
1540unsafe impl<___D> ::fidl_next::Decode<___D> for WireBusType
1541where
1542    ___D: ?Sized,
1543{
1544    fn decode(
1545        slot: ::fidl_next::Slot<'_, Self>,
1546        _: &mut ___D,
1547    ) -> Result<(), ::fidl_next::DecodeError> {
1548        Ok(())
1549    }
1550}
1551
1552impl ::core::convert::From<BusType> for WireBusType {
1553    fn from(natural: BusType) -> Self {
1554        match natural {
1555            BusType::Platform => WireBusType::PLATFORM,
1556
1557            BusType::Acpi => WireBusType::ACPI,
1558
1559            BusType::DeviceTree => WireBusType::DEVICE_TREE,
1560
1561            BusType::Pci => WireBusType::PCI,
1562
1563            BusType::Usb => WireBusType::USB,
1564
1565            BusType::Gpio => WireBusType::GPIO,
1566
1567            BusType::I2C => WireBusType::I2_C,
1568
1569            BusType::Spi => WireBusType::SPI,
1570
1571            BusType::Sdio => WireBusType::SDIO,
1572
1573            BusType::Uart => WireBusType::UART,
1574
1575            BusType::Spmi => WireBusType::SPMI,
1576
1577            BusType::UnknownOrdinal_(value) => {
1578                WireBusType { value: ::fidl_next::WireU32::from(value) }
1579            }
1580        }
1581    }
1582}
1583
1584pub const MAX_DEVICE_ADDRESS_ARRAY_LEN: u32 = 10;
1585
1586pub const MAX_DEVICE_ADDRESS_STR_LEN: u32 = 32;
1587
1588#[derive(Clone, Debug)]
1589pub enum DeviceAddress {
1590    IntValue(u8),
1591
1592    ArrayIntValue(Vec<u8>),
1593
1594    CharIntValue(String),
1595
1596    ArrayCharIntValue(Vec<String>),
1597
1598    StringValue(String),
1599
1600    UnknownOrdinal_(u64),
1601}
1602
1603impl ::fidl_next::Encodable for DeviceAddress {
1604    type Encoded = WireDeviceAddress<'static>;
1605}
1606
1607unsafe impl<___E> ::fidl_next::Encode<___E> for DeviceAddress
1608where
1609    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1610    ___E: ::fidl_next::Encoder,
1611{
1612    #[inline]
1613    fn encode(
1614        self,
1615        encoder: &mut ___E,
1616        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1617    ) -> Result<(), ::fidl_next::EncodeError> {
1618        ::fidl_next::munge!(let WireDeviceAddress { raw, _phantom: _ } = out);
1619
1620        match self {
1621            Self::IntValue(value) => {
1622                ::fidl_next::RawWireUnion::encode_as::<___E, u8>(value, 1, encoder, raw)?
1623            }
1624
1625            Self::ArrayIntValue(value) => {
1626                ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u8>>(value, 2, encoder, raw)?
1627            }
1628
1629            Self::CharIntValue(value) => {
1630                ::fidl_next::RawWireUnion::encode_as::<___E, String>(value, 3, encoder, raw)?
1631            }
1632
1633            Self::ArrayCharIntValue(value) => {
1634                ::fidl_next::RawWireUnion::encode_as::<___E, Vec<String>>(value, 4, encoder, raw)?
1635            }
1636
1637            Self::StringValue(value) => {
1638                ::fidl_next::RawWireUnion::encode_as::<___E, String>(value, 5, encoder, raw)?
1639            }
1640
1641            Self::UnknownOrdinal_(ordinal) => {
1642                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
1643            }
1644        }
1645
1646        Ok(())
1647    }
1648}
1649
1650unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DeviceAddress
1651where
1652    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1653    ___E: ::fidl_next::Encoder,
1654{
1655    #[inline]
1656    fn encode_ref(
1657        &self,
1658        encoder: &mut ___E,
1659        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1660    ) -> Result<(), ::fidl_next::EncodeError> {
1661        ::fidl_next::munge!(let WireDeviceAddress { raw, _phantom: _ } = out);
1662
1663        match self {
1664            Self::IntValue(value) => {
1665                ::fidl_next::RawWireUnion::encode_as::<___E, &u8>(value, 1, encoder, raw)?
1666            }
1667
1668            Self::ArrayIntValue(value) => {
1669                ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<u8>>(value, 2, encoder, raw)?
1670            }
1671
1672            Self::CharIntValue(value) => {
1673                ::fidl_next::RawWireUnion::encode_as::<___E, &String>(value, 3, encoder, raw)?
1674            }
1675
1676            Self::ArrayCharIntValue(value) => {
1677                ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<String>>(value, 4, encoder, raw)?
1678            }
1679
1680            Self::StringValue(value) => {
1681                ::fidl_next::RawWireUnion::encode_as::<___E, &String>(value, 5, encoder, raw)?
1682            }
1683
1684            Self::UnknownOrdinal_(ordinal) => {
1685                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
1686            }
1687        }
1688
1689        Ok(())
1690    }
1691}
1692
1693impl ::fidl_next::EncodableOption for DeviceAddress {
1694    type EncodedOption = WireOptionalDeviceAddress<'static>;
1695}
1696
1697unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DeviceAddress
1698where
1699    ___E: ?Sized,
1700    DeviceAddress: ::fidl_next::Encode<___E>,
1701{
1702    #[inline]
1703    fn encode_option(
1704        this: Option<Self>,
1705        encoder: &mut ___E,
1706        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1707    ) -> Result<(), ::fidl_next::EncodeError> {
1708        ::fidl_next::munge!(let WireOptionalDeviceAddress { raw, _phantom: _ } = &mut *out);
1709
1710        if let Some(inner) = this {
1711            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1712            ::fidl_next::Encode::encode(inner, encoder, value_out)?;
1713        } else {
1714            ::fidl_next::RawWireUnion::encode_absent(raw);
1715        }
1716
1717        Ok(())
1718    }
1719}
1720
1721unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DeviceAddress
1722where
1723    ___E: ?Sized,
1724    DeviceAddress: ::fidl_next::EncodeRef<___E>,
1725{
1726    #[inline]
1727    fn encode_option_ref(
1728        this: Option<&Self>,
1729        encoder: &mut ___E,
1730        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1731    ) -> Result<(), ::fidl_next::EncodeError> {
1732        ::fidl_next::munge!(let WireOptionalDeviceAddress { raw, _phantom: _ } = &mut *out);
1733
1734        if let Some(inner) = this {
1735            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1736            ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
1737        } else {
1738            ::fidl_next::RawWireUnion::encode_absent(raw);
1739        }
1740
1741        Ok(())
1742    }
1743}
1744
1745impl<'de> ::fidl_next::FromWire<WireDeviceAddress<'de>> for DeviceAddress {
1746    #[inline]
1747    fn from_wire(wire: WireDeviceAddress<'de>) -> Self {
1748        let wire = ::core::mem::ManuallyDrop::new(wire);
1749        match wire.raw.ordinal() {
1750            1 => Self::IntValue(::fidl_next::FromWire::from_wire(unsafe {
1751                wire.raw.get().read_unchecked::<u8>()
1752            })),
1753
1754            2 => Self::ArrayIntValue(::fidl_next::FromWire::from_wire(unsafe {
1755                wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>()
1756            })),
1757
1758            3 => Self::CharIntValue(::fidl_next::FromWire::from_wire(unsafe {
1759                wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
1760            })),
1761
1762            4 => {
1763                Self::ArrayCharIntValue(::fidl_next::FromWire::from_wire(unsafe {
1764                    wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
1765                }))
1766            }
1767
1768            5 => Self::StringValue(::fidl_next::FromWire::from_wire(unsafe {
1769                wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
1770            })),
1771
1772            _ => unsafe { ::core::hint::unreachable_unchecked() },
1773        }
1774    }
1775}
1776
1777impl<'de> ::fidl_next::FromWireRef<WireDeviceAddress<'de>> for DeviceAddress {
1778    #[inline]
1779    fn from_wire_ref(wire: &WireDeviceAddress<'de>) -> Self {
1780        match wire.raw.ordinal() {
1781            1 => Self::IntValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1782                wire.raw.get().deref_unchecked::<u8>()
1783            })),
1784
1785            2 => Self::ArrayIntValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1786                wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
1787            })),
1788
1789            3 => Self::CharIntValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1790                wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
1791            })),
1792
1793            4 => {
1794                Self::ArrayCharIntValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1795                    wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
1796                }))
1797            }
1798
1799            5 => Self::StringValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1800                wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
1801            })),
1802
1803            _ => unsafe { ::core::hint::unreachable_unchecked() },
1804        }
1805    }
1806}
1807
1808impl<'de> ::fidl_next::FromWireOption<WireOptionalDeviceAddress<'de>> for Box<DeviceAddress> {
1809    #[inline]
1810    fn from_wire_option(wire: WireOptionalDeviceAddress<'de>) -> Option<Self> {
1811        if let Some(inner) = wire.into_option() {
1812            Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
1813        } else {
1814            None
1815        }
1816    }
1817}
1818
1819impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalDeviceAddress<'de>> for Box<DeviceAddress> {
1820    #[inline]
1821    fn from_wire_option_ref(wire: &WireOptionalDeviceAddress<'de>) -> Option<Self> {
1822        if let Some(inner) = wire.as_ref() {
1823            Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
1824        } else {
1825            None
1826        }
1827    }
1828}
1829
1830/// The wire type corresponding to [`DeviceAddress`].
1831#[repr(transparent)]
1832pub struct WireDeviceAddress<'de> {
1833    raw: ::fidl_next::RawWireUnion,
1834    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1835}
1836
1837impl<'de> Drop for WireDeviceAddress<'de> {
1838    fn drop(&mut self) {
1839        match self.raw.ordinal() {
1840            1 => {
1841                let _ = unsafe { self.raw.get().read_unchecked::<u8>() };
1842            }
1843
1844            2 => {
1845                let _ =
1846                    unsafe { self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>() };
1847            }
1848
1849            3 => {
1850                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
1851            }
1852
1853            4 => {
1854                let _ = unsafe {
1855                    self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
1856                };
1857            }
1858
1859            5 => {
1860                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
1861            }
1862
1863            _ => (),
1864        }
1865    }
1866}
1867
1868unsafe impl ::fidl_next::Wire for WireDeviceAddress<'static> {
1869    type Decoded<'de> = WireDeviceAddress<'de>;
1870
1871    #[inline]
1872    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1873        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1874        ::fidl_next::RawWireUnion::zero_padding(raw);
1875    }
1876}
1877
1878pub mod device_address {
1879    pub enum Ref<'de> {
1880        IntValue(&'de u8),
1881
1882        ArrayIntValue(&'de ::fidl_next::WireVector<'de, u8>),
1883
1884        CharIntValue(&'de ::fidl_next::WireString<'de>),
1885
1886        ArrayCharIntValue(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>),
1887
1888        StringValue(&'de ::fidl_next::WireString<'de>),
1889
1890        UnknownOrdinal_(u64),
1891    }
1892}
1893
1894impl<'de> WireDeviceAddress<'de> {
1895    pub fn as_ref(&self) -> crate::device_address::Ref<'_> {
1896        match self.raw.ordinal() {
1897            1 => crate::device_address::Ref::IntValue(unsafe {
1898                self.raw.get().deref_unchecked::<u8>()
1899            }),
1900
1901            2 => crate::device_address::Ref::ArrayIntValue(unsafe {
1902                self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
1903            }),
1904
1905            3 => crate::device_address::Ref::CharIntValue(unsafe {
1906                self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
1907            }),
1908
1909            4 => {
1910                crate::device_address::Ref::ArrayCharIntValue(unsafe {
1911                    self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireString<'_>>>()
1912                })
1913            }
1914
1915            5 => crate::device_address::Ref::StringValue(unsafe {
1916                self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
1917            }),
1918
1919            unknown => crate::device_address::Ref::UnknownOrdinal_(unknown),
1920        }
1921    }
1922}
1923
1924unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeviceAddress<'static>
1925where
1926    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1927    ___D: ::fidl_next::Decoder,
1928{
1929    fn decode(
1930        mut slot: ::fidl_next::Slot<'_, Self>,
1931        decoder: &mut ___D,
1932    ) -> Result<(), ::fidl_next::DecodeError> {
1933        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1934        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1935            1 => ::fidl_next::RawWireUnion::decode_as::<___D, u8>(raw, decoder)?,
1936
1937            2 => {
1938                ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
1939                    raw, decoder,
1940                )?
1941            }
1942
1943            3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
1944                raw, decoder,
1945            )?,
1946
1947            4 => ::fidl_next::RawWireUnion::decode_as::<
1948                ___D,
1949                ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
1950            >(raw, decoder)?,
1951
1952            5 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
1953                raw, decoder,
1954            )?,
1955
1956            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
1957        }
1958
1959        Ok(())
1960    }
1961}
1962
1963impl<'de> ::core::fmt::Debug for WireDeviceAddress<'de> {
1964    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1965        match self.raw.ordinal() {
1966            1 => unsafe { self.raw.get().deref_unchecked::<u8>().fmt(f) },
1967            2 => unsafe {
1968                self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>().fmt(f)
1969            },
1970            3 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f) },
1971            4 => unsafe {
1972                self.raw
1973                    .get()
1974                    .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireString<'_>>>()
1975                    .fmt(f)
1976            },
1977            5 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f) },
1978            _ => unsafe { ::core::hint::unreachable_unchecked() },
1979        }
1980    }
1981}
1982
1983#[repr(transparent)]
1984pub struct WireOptionalDeviceAddress<'de> {
1985    raw: ::fidl_next::RawWireUnion,
1986    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1987}
1988
1989unsafe impl ::fidl_next::Wire for WireOptionalDeviceAddress<'static> {
1990    type Decoded<'de> = WireOptionalDeviceAddress<'de>;
1991
1992    #[inline]
1993    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1994        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1995        ::fidl_next::RawWireUnion::zero_padding(raw);
1996    }
1997}
1998
1999impl<'de> WireOptionalDeviceAddress<'de> {
2000    pub fn is_some(&self) -> bool {
2001        self.raw.is_some()
2002    }
2003
2004    pub fn is_none(&self) -> bool {
2005        self.raw.is_none()
2006    }
2007
2008    pub fn as_ref(&self) -> Option<&WireDeviceAddress<'de>> {
2009        if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
2010    }
2011
2012    pub fn into_option(self) -> Option<WireDeviceAddress<'de>> {
2013        if self.is_some() {
2014            Some(WireDeviceAddress { raw: self.raw, _phantom: ::core::marker::PhantomData })
2015        } else {
2016            None
2017        }
2018    }
2019}
2020
2021unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDeviceAddress<'static>
2022where
2023    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2024    ___D: ::fidl_next::Decoder,
2025{
2026    fn decode(
2027        mut slot: ::fidl_next::Slot<'_, Self>,
2028        decoder: &mut ___D,
2029    ) -> Result<(), ::fidl_next::DecodeError> {
2030        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
2031        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
2032            1 => ::fidl_next::RawWireUnion::decode_as::<___D, u8>(raw, decoder)?,
2033
2034            2 => {
2035                ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
2036                    raw, decoder,
2037                )?
2038            }
2039
2040            3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
2041                raw, decoder,
2042            )?,
2043
2044            4 => ::fidl_next::RawWireUnion::decode_as::<
2045                ___D,
2046                ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
2047            >(raw, decoder)?,
2048
2049            5 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
2050                raw, decoder,
2051            )?,
2052
2053            0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
2054            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
2055        }
2056
2057        Ok(())
2058    }
2059}
2060
2061impl<'de> ::core::fmt::Debug for WireOptionalDeviceAddress<'de> {
2062    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2063        self.as_ref().fmt(f)
2064    }
2065}
2066
2067#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2068#[repr(u32)]
2069pub enum DeviceAddressStability {
2070    UnstableBetweenDriverRestart = 0,
2071    UnstableBetweenBoot = 1,
2072    UnstableBetweenSoftwareUpdate = 2,
2073    Stable = 3,
2074    UnknownOrdinal_(u32),
2075}
2076
2077impl ::fidl_next::Encodable for DeviceAddressStability {
2078    type Encoded = WireDeviceAddressStability;
2079}
2080impl ::std::convert::From<u32> for DeviceAddressStability {
2081    fn from(value: u32) -> Self {
2082        match value {
2083            0 => Self::UnstableBetweenDriverRestart,
2084            1 => Self::UnstableBetweenBoot,
2085            2 => Self::UnstableBetweenSoftwareUpdate,
2086            3 => Self::Stable,
2087
2088            _ => Self::UnknownOrdinal_(value),
2089        }
2090    }
2091}
2092
2093unsafe impl<___E> ::fidl_next::Encode<___E> for DeviceAddressStability
2094where
2095    ___E: ?Sized,
2096{
2097    #[inline]
2098    fn encode(
2099        self,
2100        encoder: &mut ___E,
2101        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2102    ) -> Result<(), ::fidl_next::EncodeError> {
2103        ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
2104    }
2105}
2106
2107unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DeviceAddressStability
2108where
2109    ___E: ?Sized,
2110{
2111    #[inline]
2112    fn encode_ref(
2113        &self,
2114        encoder: &mut ___E,
2115        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2116    ) -> Result<(), ::fidl_next::EncodeError> {
2117        ::fidl_next::munge!(let WireDeviceAddressStability { value } = out);
2118        let _ = value.write(::fidl_next::WireU32::from(match *self {
2119            Self::UnstableBetweenDriverRestart => 0,
2120
2121            Self::UnstableBetweenBoot => 1,
2122
2123            Self::UnstableBetweenSoftwareUpdate => 2,
2124
2125            Self::Stable => 3,
2126
2127            Self::UnknownOrdinal_(value) => value,
2128        }));
2129
2130        Ok(())
2131    }
2132}
2133
2134impl ::core::convert::From<WireDeviceAddressStability> for DeviceAddressStability {
2135    fn from(wire: WireDeviceAddressStability) -> Self {
2136        match u32::from(wire.value) {
2137            0 => Self::UnstableBetweenDriverRestart,
2138
2139            1 => Self::UnstableBetweenBoot,
2140
2141            2 => Self::UnstableBetweenSoftwareUpdate,
2142
2143            3 => Self::Stable,
2144
2145            value => Self::UnknownOrdinal_(value),
2146        }
2147    }
2148}
2149
2150impl ::fidl_next::FromWire<WireDeviceAddressStability> for DeviceAddressStability {
2151    #[inline]
2152    fn from_wire(wire: WireDeviceAddressStability) -> Self {
2153        Self::from(wire)
2154    }
2155}
2156
2157impl ::fidl_next::FromWireRef<WireDeviceAddressStability> for DeviceAddressStability {
2158    #[inline]
2159    fn from_wire_ref(wire: &WireDeviceAddressStability) -> Self {
2160        Self::from(*wire)
2161    }
2162}
2163
2164/// The wire type corresponding to [`DeviceAddressStability`].
2165#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2166#[repr(transparent)]
2167pub struct WireDeviceAddressStability {
2168    value: ::fidl_next::WireU32,
2169}
2170
2171unsafe impl ::fidl_next::Wire for WireDeviceAddressStability {
2172    type Decoded<'de> = Self;
2173
2174    #[inline]
2175    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2176        // Wire enums have no padding
2177    }
2178}
2179
2180impl WireDeviceAddressStability {
2181    pub const UNSTABLE_BETWEEN_DRIVER_RESTART: WireDeviceAddressStability =
2182        WireDeviceAddressStability { value: ::fidl_next::WireU32(0) };
2183
2184    pub const UNSTABLE_BETWEEN_BOOT: WireDeviceAddressStability =
2185        WireDeviceAddressStability { value: ::fidl_next::WireU32(1) };
2186
2187    pub const UNSTABLE_BETWEEN_SOFTWARE_UPDATE: WireDeviceAddressStability =
2188        WireDeviceAddressStability { value: ::fidl_next::WireU32(2) };
2189
2190    pub const STABLE: WireDeviceAddressStability =
2191        WireDeviceAddressStability { value: ::fidl_next::WireU32(3) };
2192}
2193
2194unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeviceAddressStability
2195where
2196    ___D: ?Sized,
2197{
2198    fn decode(
2199        slot: ::fidl_next::Slot<'_, Self>,
2200        _: &mut ___D,
2201    ) -> Result<(), ::fidl_next::DecodeError> {
2202        Ok(())
2203    }
2204}
2205
2206impl ::core::convert::From<DeviceAddressStability> for WireDeviceAddressStability {
2207    fn from(natural: DeviceAddressStability) -> Self {
2208        match natural {
2209            DeviceAddressStability::UnstableBetweenDriverRestart => {
2210                WireDeviceAddressStability::UNSTABLE_BETWEEN_DRIVER_RESTART
2211            }
2212
2213            DeviceAddressStability::UnstableBetweenBoot => {
2214                WireDeviceAddressStability::UNSTABLE_BETWEEN_BOOT
2215            }
2216
2217            DeviceAddressStability::UnstableBetweenSoftwareUpdate => {
2218                WireDeviceAddressStability::UNSTABLE_BETWEEN_SOFTWARE_UPDATE
2219            }
2220
2221            DeviceAddressStability::Stable => WireDeviceAddressStability::STABLE,
2222
2223            DeviceAddressStability::UnknownOrdinal_(value) => {
2224                WireDeviceAddressStability { value: ::fidl_next::WireU32::from(value) }
2225            }
2226        }
2227    }
2228}
2229
2230#[derive(Clone, Debug, Default)]
2231pub struct BusInfo {
2232    pub bus: Option<crate::BusType>,
2233
2234    pub address: Option<crate::DeviceAddress>,
2235
2236    pub address_stability: Option<crate::DeviceAddressStability>,
2237}
2238
2239impl BusInfo {
2240    fn __max_ordinal(&self) -> usize {
2241        if self.address_stability.is_some() {
2242            return 3;
2243        }
2244
2245        if self.address.is_some() {
2246            return 2;
2247        }
2248
2249        if self.bus.is_some() {
2250            return 1;
2251        }
2252
2253        0
2254    }
2255}
2256
2257impl ::fidl_next::Encodable for BusInfo {
2258    type Encoded = WireBusInfo<'static>;
2259}
2260
2261unsafe impl<___E> ::fidl_next::Encode<___E> for BusInfo
2262where
2263    ___E: ::fidl_next::Encoder + ?Sized,
2264{
2265    #[inline]
2266    fn encode(
2267        mut self,
2268        encoder: &mut ___E,
2269        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2270    ) -> Result<(), ::fidl_next::EncodeError> {
2271        ::fidl_next::munge!(let WireBusInfo { table } = out);
2272
2273        let max_ord = self.__max_ordinal();
2274
2275        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2276        ::fidl_next::Wire::zero_padding(&mut out);
2277
2278        let mut preallocated =
2279            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2280
2281        for i in 1..=max_ord {
2282            match i {
2283                3 => {
2284                    if let Some(address_stability) = self.address_stability.take() {
2285                        ::fidl_next::WireEnvelope::encode_value(
2286                            address_stability,
2287                            preallocated.encoder,
2288                            &mut out,
2289                        )?;
2290                    } else {
2291                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2292                    }
2293                }
2294
2295                2 => {
2296                    if let Some(address) = self.address.take() {
2297                        ::fidl_next::WireEnvelope::encode_value(
2298                            address,
2299                            preallocated.encoder,
2300                            &mut out,
2301                        )?;
2302                    } else {
2303                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2304                    }
2305                }
2306
2307                1 => {
2308                    if let Some(bus) = self.bus.take() {
2309                        ::fidl_next::WireEnvelope::encode_value(
2310                            bus,
2311                            preallocated.encoder,
2312                            &mut out,
2313                        )?;
2314                    } else {
2315                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2316                    }
2317                }
2318
2319                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2320            }
2321            unsafe {
2322                preallocated.write_next(out.assume_init_ref());
2323            }
2324        }
2325
2326        ::fidl_next::WireTable::encode_len(table, max_ord);
2327
2328        Ok(())
2329    }
2330}
2331
2332unsafe impl<___E> ::fidl_next::EncodeRef<___E> for BusInfo
2333where
2334    ___E: ::fidl_next::Encoder + ?Sized,
2335{
2336    #[inline]
2337    fn encode_ref(
2338        &self,
2339        encoder: &mut ___E,
2340        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2341    ) -> Result<(), ::fidl_next::EncodeError> {
2342        ::fidl_next::munge!(let WireBusInfo { table } = out);
2343
2344        let max_ord = self.__max_ordinal();
2345
2346        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2347        ::fidl_next::Wire::zero_padding(&mut out);
2348
2349        let mut preallocated =
2350            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2351
2352        for i in 1..=max_ord {
2353            match i {
2354                3 => {
2355                    if let Some(address_stability) = &self.address_stability {
2356                        ::fidl_next::WireEnvelope::encode_value(
2357                            address_stability,
2358                            preallocated.encoder,
2359                            &mut out,
2360                        )?;
2361                    } else {
2362                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2363                    }
2364                }
2365
2366                2 => {
2367                    if let Some(address) = &self.address {
2368                        ::fidl_next::WireEnvelope::encode_value(
2369                            address,
2370                            preallocated.encoder,
2371                            &mut out,
2372                        )?;
2373                    } else {
2374                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2375                    }
2376                }
2377
2378                1 => {
2379                    if let Some(bus) = &self.bus {
2380                        ::fidl_next::WireEnvelope::encode_value(
2381                            bus,
2382                            preallocated.encoder,
2383                            &mut out,
2384                        )?;
2385                    } else {
2386                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2387                    }
2388                }
2389
2390                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2391            }
2392            unsafe {
2393                preallocated.write_next(out.assume_init_ref());
2394            }
2395        }
2396
2397        ::fidl_next::WireTable::encode_len(table, max_ord);
2398
2399        Ok(())
2400    }
2401}
2402
2403impl<'de> ::fidl_next::FromWire<WireBusInfo<'de>> for BusInfo {
2404    #[inline]
2405    fn from_wire(wire: WireBusInfo<'de>) -> Self {
2406        let wire = ::core::mem::ManuallyDrop::new(wire);
2407
2408        let bus = wire.table.get(1);
2409
2410        let address = wire.table.get(2);
2411
2412        let address_stability = wire.table.get(3);
2413
2414        Self {
2415            bus: bus.map(|envelope| {
2416                ::fidl_next::FromWire::from_wire(unsafe {
2417                    envelope.read_unchecked::<crate::WireBusType>()
2418                })
2419            }),
2420
2421            address: address.map(|envelope| {
2422                ::fidl_next::FromWire::from_wire(unsafe {
2423                    envelope.read_unchecked::<crate::WireDeviceAddress<'de>>()
2424                })
2425            }),
2426
2427            address_stability: address_stability.map(|envelope| {
2428                ::fidl_next::FromWire::from_wire(unsafe {
2429                    envelope.read_unchecked::<crate::WireDeviceAddressStability>()
2430                })
2431            }),
2432        }
2433    }
2434}
2435
2436impl<'de> ::fidl_next::FromWireRef<WireBusInfo<'de>> for BusInfo {
2437    #[inline]
2438    fn from_wire_ref(wire: &WireBusInfo<'de>) -> Self {
2439        Self {
2440            bus: wire.table.get(1).map(|envelope| {
2441                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2442                    envelope.deref_unchecked::<crate::WireBusType>()
2443                })
2444            }),
2445
2446            address: wire.table.get(2).map(|envelope| {
2447                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2448                    envelope.deref_unchecked::<crate::WireDeviceAddress<'de>>()
2449                })
2450            }),
2451
2452            address_stability: wire.table.get(3).map(|envelope| {
2453                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2454                    envelope.deref_unchecked::<crate::WireDeviceAddressStability>()
2455                })
2456            }),
2457        }
2458    }
2459}
2460
2461/// The wire type corresponding to [`BusInfo`].
2462#[repr(C)]
2463pub struct WireBusInfo<'de> {
2464    table: ::fidl_next::WireTable<'de>,
2465}
2466
2467impl<'de> Drop for WireBusInfo<'de> {
2468    fn drop(&mut self) {
2469        let _ = self
2470            .table
2471            .get(1)
2472            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireBusType>() });
2473
2474        let _ = self
2475            .table
2476            .get(2)
2477            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDeviceAddress<'de>>() });
2478
2479        let _ = self.table.get(3).map(|envelope| unsafe {
2480            envelope.read_unchecked::<crate::WireDeviceAddressStability>()
2481        });
2482    }
2483}
2484
2485unsafe impl ::fidl_next::Wire for WireBusInfo<'static> {
2486    type Decoded<'de> = WireBusInfo<'de>;
2487
2488    #[inline]
2489    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2490        ::fidl_next::munge!(let Self { table } = out);
2491        ::fidl_next::WireTable::zero_padding(table);
2492    }
2493}
2494
2495unsafe impl<___D> ::fidl_next::Decode<___D> for WireBusInfo<'static>
2496where
2497    ___D: ::fidl_next::Decoder + ?Sized,
2498{
2499    fn decode(
2500        slot: ::fidl_next::Slot<'_, Self>,
2501        decoder: &mut ___D,
2502    ) -> Result<(), ::fidl_next::DecodeError> {
2503        ::fidl_next::munge!(let Self { table } = slot);
2504
2505        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2506            match ordinal {
2507                0 => unsafe { ::core::hint::unreachable_unchecked() },
2508
2509                1 => {
2510                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireBusType>(
2511                        slot.as_mut(),
2512                        decoder,
2513                    )?;
2514
2515                    Ok(())
2516                }
2517
2518                2 => {
2519                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDeviceAddress<'static>>(
2520                        slot.as_mut(),
2521                        decoder,
2522                    )?;
2523
2524                    Ok(())
2525                }
2526
2527                3 => {
2528                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDeviceAddressStability>(
2529                        slot.as_mut(),
2530                        decoder,
2531                    )?;
2532
2533                    Ok(())
2534                }
2535
2536                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2537            }
2538        })
2539    }
2540}
2541
2542impl<'de> WireBusInfo<'de> {
2543    pub fn bus(&self) -> Option<&crate::WireBusType> {
2544        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2545    }
2546
2547    pub fn address(&self) -> Option<&crate::WireDeviceAddress<'de>> {
2548        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2549    }
2550
2551    pub fn address_stability(&self) -> Option<&crate::WireDeviceAddressStability> {
2552        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2553    }
2554}
2555
2556impl<'de> ::core::fmt::Debug for WireBusInfo<'de> {
2557    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2558        f.debug_struct("BusInfo")
2559            .field("bus", &self.bus())
2560            .field("address", &self.address())
2561            .field("address_stability", &self.address_stability())
2562            .finish()
2563    }
2564}
2565
2566#[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"]
2567#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2568#[repr(u8)]
2569pub enum DriverPackageType {
2570    Boot = 0,
2571    Base = 1,
2572    Cached = 2,
2573    Universe = 3,
2574    UnknownOrdinal_(u8),
2575}
2576
2577impl ::fidl_next::Encodable for DriverPackageType {
2578    type Encoded = WireDriverPackageType;
2579}
2580impl ::std::convert::From<u8> for DriverPackageType {
2581    fn from(value: u8) -> Self {
2582        match value {
2583            0 => Self::Boot,
2584            1 => Self::Base,
2585            2 => Self::Cached,
2586            3 => Self::Universe,
2587
2588            _ => Self::UnknownOrdinal_(value),
2589        }
2590    }
2591}
2592
2593unsafe impl<___E> ::fidl_next::Encode<___E> for DriverPackageType
2594where
2595    ___E: ?Sized,
2596{
2597    #[inline]
2598    fn encode(
2599        self,
2600        encoder: &mut ___E,
2601        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2602    ) -> Result<(), ::fidl_next::EncodeError> {
2603        ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
2604    }
2605}
2606
2607unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DriverPackageType
2608where
2609    ___E: ?Sized,
2610{
2611    #[inline]
2612    fn encode_ref(
2613        &self,
2614        encoder: &mut ___E,
2615        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2616    ) -> Result<(), ::fidl_next::EncodeError> {
2617        ::fidl_next::munge!(let WireDriverPackageType { value } = out);
2618        let _ = value.write(u8::from(match *self {
2619            Self::Boot => 0,
2620
2621            Self::Base => 1,
2622
2623            Self::Cached => 2,
2624
2625            Self::Universe => 3,
2626
2627            Self::UnknownOrdinal_(value) => value,
2628        }));
2629
2630        Ok(())
2631    }
2632}
2633
2634impl ::core::convert::From<WireDriverPackageType> for DriverPackageType {
2635    fn from(wire: WireDriverPackageType) -> Self {
2636        match u8::from(wire.value) {
2637            0 => Self::Boot,
2638
2639            1 => Self::Base,
2640
2641            2 => Self::Cached,
2642
2643            3 => Self::Universe,
2644
2645            value => Self::UnknownOrdinal_(value),
2646        }
2647    }
2648}
2649
2650impl ::fidl_next::FromWire<WireDriverPackageType> for DriverPackageType {
2651    #[inline]
2652    fn from_wire(wire: WireDriverPackageType) -> Self {
2653        Self::from(wire)
2654    }
2655}
2656
2657impl ::fidl_next::FromWireRef<WireDriverPackageType> for DriverPackageType {
2658    #[inline]
2659    fn from_wire_ref(wire: &WireDriverPackageType) -> Self {
2660        Self::from(*wire)
2661    }
2662}
2663
2664/// The wire type corresponding to [`DriverPackageType`].
2665#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2666#[repr(transparent)]
2667pub struct WireDriverPackageType {
2668    value: u8,
2669}
2670
2671unsafe impl ::fidl_next::Wire for WireDriverPackageType {
2672    type Decoded<'de> = Self;
2673
2674    #[inline]
2675    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2676        // Wire enums have no padding
2677    }
2678}
2679
2680impl WireDriverPackageType {
2681    pub const BOOT: WireDriverPackageType = WireDriverPackageType { value: 0 };
2682
2683    pub const BASE: WireDriverPackageType = WireDriverPackageType { value: 1 };
2684
2685    pub const CACHED: WireDriverPackageType = WireDriverPackageType { value: 2 };
2686
2687    pub const UNIVERSE: WireDriverPackageType = WireDriverPackageType { value: 3 };
2688}
2689
2690unsafe impl<___D> ::fidl_next::Decode<___D> for WireDriverPackageType
2691where
2692    ___D: ?Sized,
2693{
2694    fn decode(
2695        slot: ::fidl_next::Slot<'_, Self>,
2696        _: &mut ___D,
2697    ) -> Result<(), ::fidl_next::DecodeError> {
2698        Ok(())
2699    }
2700}
2701
2702impl ::core::convert::From<DriverPackageType> for WireDriverPackageType {
2703    fn from(natural: DriverPackageType) -> Self {
2704        match natural {
2705            DriverPackageType::Boot => WireDriverPackageType::BOOT,
2706
2707            DriverPackageType::Base => WireDriverPackageType::BASE,
2708
2709            DriverPackageType::Cached => WireDriverPackageType::CACHED,
2710
2711            DriverPackageType::Universe => WireDriverPackageType::UNIVERSE,
2712
2713            DriverPackageType::UnknownOrdinal_(value) => {
2714                WireDriverPackageType { value: u8::from(value) }
2715            }
2716        }
2717    }
2718}
2719
2720#[doc = " Device categories as provided in the driver\'s component manifest.\n"]
2721#[derive(Clone, Debug, Default)]
2722pub struct DeviceCategory {
2723    pub category: Option<String>,
2724
2725    pub subcategory: Option<String>,
2726}
2727
2728impl DeviceCategory {
2729    fn __max_ordinal(&self) -> usize {
2730        if self.subcategory.is_some() {
2731            return 2;
2732        }
2733
2734        if self.category.is_some() {
2735            return 1;
2736        }
2737
2738        0
2739    }
2740}
2741
2742impl ::fidl_next::Encodable for DeviceCategory {
2743    type Encoded = WireDeviceCategory<'static>;
2744}
2745
2746unsafe impl<___E> ::fidl_next::Encode<___E> for DeviceCategory
2747where
2748    ___E: ::fidl_next::Encoder + ?Sized,
2749{
2750    #[inline]
2751    fn encode(
2752        mut self,
2753        encoder: &mut ___E,
2754        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2755    ) -> Result<(), ::fidl_next::EncodeError> {
2756        ::fidl_next::munge!(let WireDeviceCategory { table } = out);
2757
2758        let max_ord = self.__max_ordinal();
2759
2760        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2761        ::fidl_next::Wire::zero_padding(&mut out);
2762
2763        let mut preallocated =
2764            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2765
2766        for i in 1..=max_ord {
2767            match i {
2768                2 => {
2769                    if let Some(subcategory) = self.subcategory.take() {
2770                        ::fidl_next::WireEnvelope::encode_value(
2771                            subcategory,
2772                            preallocated.encoder,
2773                            &mut out,
2774                        )?;
2775                    } else {
2776                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2777                    }
2778                }
2779
2780                1 => {
2781                    if let Some(category) = self.category.take() {
2782                        ::fidl_next::WireEnvelope::encode_value(
2783                            category,
2784                            preallocated.encoder,
2785                            &mut out,
2786                        )?;
2787                    } else {
2788                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2789                    }
2790                }
2791
2792                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2793            }
2794            unsafe {
2795                preallocated.write_next(out.assume_init_ref());
2796            }
2797        }
2798
2799        ::fidl_next::WireTable::encode_len(table, max_ord);
2800
2801        Ok(())
2802    }
2803}
2804
2805unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DeviceCategory
2806where
2807    ___E: ::fidl_next::Encoder + ?Sized,
2808{
2809    #[inline]
2810    fn encode_ref(
2811        &self,
2812        encoder: &mut ___E,
2813        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2814    ) -> Result<(), ::fidl_next::EncodeError> {
2815        ::fidl_next::munge!(let WireDeviceCategory { table } = out);
2816
2817        let max_ord = self.__max_ordinal();
2818
2819        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2820        ::fidl_next::Wire::zero_padding(&mut out);
2821
2822        let mut preallocated =
2823            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2824
2825        for i in 1..=max_ord {
2826            match i {
2827                2 => {
2828                    if let Some(subcategory) = &self.subcategory {
2829                        ::fidl_next::WireEnvelope::encode_value(
2830                            subcategory,
2831                            preallocated.encoder,
2832                            &mut out,
2833                        )?;
2834                    } else {
2835                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2836                    }
2837                }
2838
2839                1 => {
2840                    if let Some(category) = &self.category {
2841                        ::fidl_next::WireEnvelope::encode_value(
2842                            category,
2843                            preallocated.encoder,
2844                            &mut out,
2845                        )?;
2846                    } else {
2847                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2848                    }
2849                }
2850
2851                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2852            }
2853            unsafe {
2854                preallocated.write_next(out.assume_init_ref());
2855            }
2856        }
2857
2858        ::fidl_next::WireTable::encode_len(table, max_ord);
2859
2860        Ok(())
2861    }
2862}
2863
2864impl<'de> ::fidl_next::FromWire<WireDeviceCategory<'de>> for DeviceCategory {
2865    #[inline]
2866    fn from_wire(wire: WireDeviceCategory<'de>) -> Self {
2867        let wire = ::core::mem::ManuallyDrop::new(wire);
2868
2869        let category = wire.table.get(1);
2870
2871        let subcategory = wire.table.get(2);
2872
2873        Self {
2874            category: category.map(|envelope| {
2875                ::fidl_next::FromWire::from_wire(unsafe {
2876                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
2877                })
2878            }),
2879
2880            subcategory: subcategory.map(|envelope| {
2881                ::fidl_next::FromWire::from_wire(unsafe {
2882                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
2883                })
2884            }),
2885        }
2886    }
2887}
2888
2889impl<'de> ::fidl_next::FromWireRef<WireDeviceCategory<'de>> for DeviceCategory {
2890    #[inline]
2891    fn from_wire_ref(wire: &WireDeviceCategory<'de>) -> Self {
2892        Self {
2893            category: wire.table.get(1).map(|envelope| {
2894                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2895                    envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
2896                })
2897            }),
2898
2899            subcategory: wire.table.get(2).map(|envelope| {
2900                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2901                    envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
2902                })
2903            }),
2904        }
2905    }
2906}
2907
2908/// The wire type corresponding to [`DeviceCategory`].
2909#[repr(C)]
2910pub struct WireDeviceCategory<'de> {
2911    table: ::fidl_next::WireTable<'de>,
2912}
2913
2914impl<'de> Drop for WireDeviceCategory<'de> {
2915    fn drop(&mut self) {
2916        let _ = self
2917            .table
2918            .get(1)
2919            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
2920
2921        let _ = self
2922            .table
2923            .get(2)
2924            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
2925    }
2926}
2927
2928unsafe impl ::fidl_next::Wire for WireDeviceCategory<'static> {
2929    type Decoded<'de> = WireDeviceCategory<'de>;
2930
2931    #[inline]
2932    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2933        ::fidl_next::munge!(let Self { table } = out);
2934        ::fidl_next::WireTable::zero_padding(table);
2935    }
2936}
2937
2938unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeviceCategory<'static>
2939where
2940    ___D: ::fidl_next::Decoder + ?Sized,
2941{
2942    fn decode(
2943        slot: ::fidl_next::Slot<'_, Self>,
2944        decoder: &mut ___D,
2945    ) -> Result<(), ::fidl_next::DecodeError> {
2946        ::fidl_next::munge!(let Self { table } = slot);
2947
2948        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2949            match ordinal {
2950                0 => unsafe { ::core::hint::unreachable_unchecked() },
2951
2952                1 => {
2953                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
2954                        slot.as_mut(),
2955                        decoder,
2956                    )?;
2957
2958                    Ok(())
2959                }
2960
2961                2 => {
2962                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
2963                        slot.as_mut(),
2964                        decoder,
2965                    )?;
2966
2967                    Ok(())
2968                }
2969
2970                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2971            }
2972        })
2973    }
2974}
2975
2976impl<'de> WireDeviceCategory<'de> {
2977    pub fn category(&self) -> Option<&::fidl_next::WireString<'de>> {
2978        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2979    }
2980
2981    pub fn subcategory(&self) -> Option<&::fidl_next::WireString<'de>> {
2982        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2983    }
2984}
2985
2986impl<'de> ::core::fmt::Debug for WireDeviceCategory<'de> {
2987    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2988        f.debug_struct("DeviceCategory")
2989            .field("category", &self.category())
2990            .field("subcategory", &self.subcategory())
2991            .finish()
2992    }
2993}
2994
2995#[doc = " General information for a driver, used with both composite and normal drivers.\n"]
2996#[derive(Clone, Debug, Default)]
2997pub struct DriverInfo {
2998    pub url: Option<String>,
2999
3000    pub name: Option<String>,
3001
3002    pub colocate: Option<bool>,
3003
3004    pub package_type: Option<crate::DriverPackageType>,
3005
3006    pub is_fallback: Option<bool>,
3007
3008    pub device_categories: Option<Vec<crate::DeviceCategory>>,
3009
3010    pub bind_rules_bytecode: Option<Vec<u8>>,
3011
3012    pub driver_framework_version: Option<u8>,
3013
3014    pub is_disabled: Option<bool>,
3015}
3016
3017impl DriverInfo {
3018    fn __max_ordinal(&self) -> usize {
3019        if self.is_disabled.is_some() {
3020            return 9;
3021        }
3022
3023        if self.driver_framework_version.is_some() {
3024            return 8;
3025        }
3026
3027        if self.bind_rules_bytecode.is_some() {
3028            return 7;
3029        }
3030
3031        if self.device_categories.is_some() {
3032            return 6;
3033        }
3034
3035        if self.is_fallback.is_some() {
3036            return 5;
3037        }
3038
3039        if self.package_type.is_some() {
3040            return 4;
3041        }
3042
3043        if self.colocate.is_some() {
3044            return 3;
3045        }
3046
3047        if self.name.is_some() {
3048            return 2;
3049        }
3050
3051        if self.url.is_some() {
3052            return 1;
3053        }
3054
3055        0
3056    }
3057}
3058
3059impl ::fidl_next::Encodable for DriverInfo {
3060    type Encoded = WireDriverInfo<'static>;
3061}
3062
3063unsafe impl<___E> ::fidl_next::Encode<___E> for DriverInfo
3064where
3065    ___E: ::fidl_next::Encoder + ?Sized,
3066{
3067    #[inline]
3068    fn encode(
3069        mut self,
3070        encoder: &mut ___E,
3071        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3072    ) -> Result<(), ::fidl_next::EncodeError> {
3073        ::fidl_next::munge!(let WireDriverInfo { table } = out);
3074
3075        let max_ord = self.__max_ordinal();
3076
3077        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3078        ::fidl_next::Wire::zero_padding(&mut out);
3079
3080        let mut preallocated =
3081            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3082
3083        for i in 1..=max_ord {
3084            match i {
3085                9 => {
3086                    if let Some(is_disabled) = self.is_disabled.take() {
3087                        ::fidl_next::WireEnvelope::encode_value(
3088                            is_disabled,
3089                            preallocated.encoder,
3090                            &mut out,
3091                        )?;
3092                    } else {
3093                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3094                    }
3095                }
3096
3097                8 => {
3098                    if let Some(driver_framework_version) = self.driver_framework_version.take() {
3099                        ::fidl_next::WireEnvelope::encode_value(
3100                            driver_framework_version,
3101                            preallocated.encoder,
3102                            &mut out,
3103                        )?;
3104                    } else {
3105                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3106                    }
3107                }
3108
3109                7 => {
3110                    if let Some(bind_rules_bytecode) = self.bind_rules_bytecode.take() {
3111                        ::fidl_next::WireEnvelope::encode_value(
3112                            bind_rules_bytecode,
3113                            preallocated.encoder,
3114                            &mut out,
3115                        )?;
3116                    } else {
3117                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3118                    }
3119                }
3120
3121                6 => {
3122                    if let Some(device_categories) = self.device_categories.take() {
3123                        ::fidl_next::WireEnvelope::encode_value(
3124                            device_categories,
3125                            preallocated.encoder,
3126                            &mut out,
3127                        )?;
3128                    } else {
3129                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3130                    }
3131                }
3132
3133                5 => {
3134                    if let Some(is_fallback) = self.is_fallback.take() {
3135                        ::fidl_next::WireEnvelope::encode_value(
3136                            is_fallback,
3137                            preallocated.encoder,
3138                            &mut out,
3139                        )?;
3140                    } else {
3141                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3142                    }
3143                }
3144
3145                4 => {
3146                    if let Some(package_type) = self.package_type.take() {
3147                        ::fidl_next::WireEnvelope::encode_value(
3148                            package_type,
3149                            preallocated.encoder,
3150                            &mut out,
3151                        )?;
3152                    } else {
3153                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3154                    }
3155                }
3156
3157                3 => {
3158                    if let Some(colocate) = self.colocate.take() {
3159                        ::fidl_next::WireEnvelope::encode_value(
3160                            colocate,
3161                            preallocated.encoder,
3162                            &mut out,
3163                        )?;
3164                    } else {
3165                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3166                    }
3167                }
3168
3169                2 => {
3170                    if let Some(name) = self.name.take() {
3171                        ::fidl_next::WireEnvelope::encode_value(
3172                            name,
3173                            preallocated.encoder,
3174                            &mut out,
3175                        )?;
3176                    } else {
3177                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3178                    }
3179                }
3180
3181                1 => {
3182                    if let Some(url) = self.url.take() {
3183                        ::fidl_next::WireEnvelope::encode_value(
3184                            url,
3185                            preallocated.encoder,
3186                            &mut out,
3187                        )?;
3188                    } else {
3189                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3190                    }
3191                }
3192
3193                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3194            }
3195            unsafe {
3196                preallocated.write_next(out.assume_init_ref());
3197            }
3198        }
3199
3200        ::fidl_next::WireTable::encode_len(table, max_ord);
3201
3202        Ok(())
3203    }
3204}
3205
3206unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DriverInfo
3207where
3208    ___E: ::fidl_next::Encoder + ?Sized,
3209{
3210    #[inline]
3211    fn encode_ref(
3212        &self,
3213        encoder: &mut ___E,
3214        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3215    ) -> Result<(), ::fidl_next::EncodeError> {
3216        ::fidl_next::munge!(let WireDriverInfo { table } = out);
3217
3218        let max_ord = self.__max_ordinal();
3219
3220        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3221        ::fidl_next::Wire::zero_padding(&mut out);
3222
3223        let mut preallocated =
3224            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3225
3226        for i in 1..=max_ord {
3227            match i {
3228                9 => {
3229                    if let Some(is_disabled) = &self.is_disabled {
3230                        ::fidl_next::WireEnvelope::encode_value(
3231                            is_disabled,
3232                            preallocated.encoder,
3233                            &mut out,
3234                        )?;
3235                    } else {
3236                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3237                    }
3238                }
3239
3240                8 => {
3241                    if let Some(driver_framework_version) = &self.driver_framework_version {
3242                        ::fidl_next::WireEnvelope::encode_value(
3243                            driver_framework_version,
3244                            preallocated.encoder,
3245                            &mut out,
3246                        )?;
3247                    } else {
3248                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3249                    }
3250                }
3251
3252                7 => {
3253                    if let Some(bind_rules_bytecode) = &self.bind_rules_bytecode {
3254                        ::fidl_next::WireEnvelope::encode_value(
3255                            bind_rules_bytecode,
3256                            preallocated.encoder,
3257                            &mut out,
3258                        )?;
3259                    } else {
3260                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3261                    }
3262                }
3263
3264                6 => {
3265                    if let Some(device_categories) = &self.device_categories {
3266                        ::fidl_next::WireEnvelope::encode_value(
3267                            device_categories,
3268                            preallocated.encoder,
3269                            &mut out,
3270                        )?;
3271                    } else {
3272                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3273                    }
3274                }
3275
3276                5 => {
3277                    if let Some(is_fallback) = &self.is_fallback {
3278                        ::fidl_next::WireEnvelope::encode_value(
3279                            is_fallback,
3280                            preallocated.encoder,
3281                            &mut out,
3282                        )?;
3283                    } else {
3284                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3285                    }
3286                }
3287
3288                4 => {
3289                    if let Some(package_type) = &self.package_type {
3290                        ::fidl_next::WireEnvelope::encode_value(
3291                            package_type,
3292                            preallocated.encoder,
3293                            &mut out,
3294                        )?;
3295                    } else {
3296                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3297                    }
3298                }
3299
3300                3 => {
3301                    if let Some(colocate) = &self.colocate {
3302                        ::fidl_next::WireEnvelope::encode_value(
3303                            colocate,
3304                            preallocated.encoder,
3305                            &mut out,
3306                        )?;
3307                    } else {
3308                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3309                    }
3310                }
3311
3312                2 => {
3313                    if let Some(name) = &self.name {
3314                        ::fidl_next::WireEnvelope::encode_value(
3315                            name,
3316                            preallocated.encoder,
3317                            &mut out,
3318                        )?;
3319                    } else {
3320                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3321                    }
3322                }
3323
3324                1 => {
3325                    if let Some(url) = &self.url {
3326                        ::fidl_next::WireEnvelope::encode_value(
3327                            url,
3328                            preallocated.encoder,
3329                            &mut out,
3330                        )?;
3331                    } else {
3332                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3333                    }
3334                }
3335
3336                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3337            }
3338            unsafe {
3339                preallocated.write_next(out.assume_init_ref());
3340            }
3341        }
3342
3343        ::fidl_next::WireTable::encode_len(table, max_ord);
3344
3345        Ok(())
3346    }
3347}
3348
3349impl<'de> ::fidl_next::FromWire<WireDriverInfo<'de>> for DriverInfo {
3350    #[inline]
3351    fn from_wire(wire: WireDriverInfo<'de>) -> Self {
3352        let wire = ::core::mem::ManuallyDrop::new(wire);
3353
3354        let url = wire.table.get(1);
3355
3356        let name = wire.table.get(2);
3357
3358        let colocate = wire.table.get(3);
3359
3360        let package_type = wire.table.get(4);
3361
3362        let is_fallback = wire.table.get(5);
3363
3364        let device_categories = wire.table.get(6);
3365
3366        let bind_rules_bytecode = wire.table.get(7);
3367
3368        let driver_framework_version = wire.table.get(8);
3369
3370        let is_disabled = wire.table.get(9);
3371
3372        Self {
3373
3374
3375                url: url.map(|envelope| ::fidl_next::FromWire::from_wire(
3376                    unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
3377                )),
3378
3379
3380                name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
3381                    unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
3382                )),
3383
3384
3385                colocate: colocate.map(|envelope| ::fidl_next::FromWire::from_wire(
3386                    unsafe { envelope.read_unchecked::<bool>() }
3387                )),
3388
3389
3390                package_type: package_type.map(|envelope| ::fidl_next::FromWire::from_wire(
3391                    unsafe { envelope.read_unchecked::<crate::WireDriverPackageType>() }
3392                )),
3393
3394
3395                is_fallback: is_fallback.map(|envelope| ::fidl_next::FromWire::from_wire(
3396                    unsafe { envelope.read_unchecked::<bool>() }
3397                )),
3398
3399
3400                device_categories: device_categories.map(|envelope| ::fidl_next::FromWire::from_wire(
3401                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireDeviceCategory<'de>>>() }
3402                )),
3403
3404
3405                bind_rules_bytecode: bind_rules_bytecode.map(|envelope| ::fidl_next::FromWire::from_wire(
3406                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>() }
3407                )),
3408
3409
3410                driver_framework_version: driver_framework_version.map(|envelope| ::fidl_next::FromWire::from_wire(
3411                    unsafe { envelope.read_unchecked::<u8>() }
3412                )),
3413
3414
3415                is_disabled: is_disabled.map(|envelope| ::fidl_next::FromWire::from_wire(
3416                    unsafe { envelope.read_unchecked::<bool>() }
3417                )),
3418
3419        }
3420    }
3421}
3422
3423impl<'de> ::fidl_next::FromWireRef<WireDriverInfo<'de>> for DriverInfo {
3424    #[inline]
3425    fn from_wire_ref(wire: &WireDriverInfo<'de>) -> Self {
3426        Self {
3427
3428
3429                url: wire.table.get(1)
3430                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3431                        unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
3432                    )),
3433
3434
3435                name: wire.table.get(2)
3436                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3437                        unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
3438                    )),
3439
3440
3441                colocate: wire.table.get(3)
3442                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3443                        unsafe { envelope.deref_unchecked::<bool>() }
3444                    )),
3445
3446
3447                package_type: wire.table.get(4)
3448                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3449                        unsafe { envelope.deref_unchecked::<crate::WireDriverPackageType>() }
3450                    )),
3451
3452
3453                is_fallback: wire.table.get(5)
3454                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3455                        unsafe { envelope.deref_unchecked::<bool>() }
3456                    )),
3457
3458
3459                device_categories: wire.table.get(6)
3460                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3461                        unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireDeviceCategory<'de>>>() }
3462                    )),
3463
3464
3465                bind_rules_bytecode: wire.table.get(7)
3466                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3467                        unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, u8>>() }
3468                    )),
3469
3470
3471                driver_framework_version: wire.table.get(8)
3472                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3473                        unsafe { envelope.deref_unchecked::<u8>() }
3474                    )),
3475
3476
3477                is_disabled: wire.table.get(9)
3478                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3479                        unsafe { envelope.deref_unchecked::<bool>() }
3480                    )),
3481
3482        }
3483    }
3484}
3485
3486/// The wire type corresponding to [`DriverInfo`].
3487#[repr(C)]
3488pub struct WireDriverInfo<'de> {
3489    table: ::fidl_next::WireTable<'de>,
3490}
3491
3492impl<'de> Drop for WireDriverInfo<'de> {
3493    fn drop(&mut self) {
3494        let _ = self
3495            .table
3496            .get(1)
3497            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
3498
3499        let _ = self
3500            .table
3501            .get(2)
3502            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
3503
3504        let _ = self.table.get(3).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
3505
3506        let _ = self
3507            .table
3508            .get(4)
3509            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDriverPackageType>() });
3510
3511        let _ = self.table.get(5).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
3512
3513        let _ = self.table.get(6).map(|envelope| unsafe {
3514            envelope
3515                .read_unchecked::<::fidl_next::WireVector<'de, crate::WireDeviceCategory<'de>>>()
3516        });
3517
3518        let _ = self.table.get(7).map(|envelope| unsafe {
3519            envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
3520        });
3521
3522        let _ = self.table.get(8).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
3523
3524        let _ = self.table.get(9).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
3525    }
3526}
3527
3528unsafe impl ::fidl_next::Wire for WireDriverInfo<'static> {
3529    type Decoded<'de> = WireDriverInfo<'de>;
3530
3531    #[inline]
3532    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3533        ::fidl_next::munge!(let Self { table } = out);
3534        ::fidl_next::WireTable::zero_padding(table);
3535    }
3536}
3537
3538unsafe impl<___D> ::fidl_next::Decode<___D> for WireDriverInfo<'static>
3539where
3540    ___D: ::fidl_next::Decoder + ?Sized,
3541{
3542    fn decode(
3543        slot: ::fidl_next::Slot<'_, Self>,
3544        decoder: &mut ___D,
3545    ) -> Result<(), ::fidl_next::DecodeError> {
3546        ::fidl_next::munge!(let Self { table } = slot);
3547
3548        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3549            match ordinal {
3550                0 => unsafe { ::core::hint::unreachable_unchecked() },
3551
3552                1 => {
3553                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
3554                        slot.as_mut(),
3555                        decoder,
3556                    )?;
3557
3558                    let url = unsafe {
3559                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
3560                    };
3561
3562                    if url.len() > 4096 {
3563                        return Err(::fidl_next::DecodeError::VectorTooLong {
3564                            size: url.len() as u64,
3565                            limit: 4096,
3566                        });
3567                    }
3568
3569                    Ok(())
3570                }
3571
3572                2 => {
3573                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
3574                        slot.as_mut(),
3575                        decoder,
3576                    )?;
3577
3578                    Ok(())
3579                }
3580
3581                3 => {
3582                    ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
3583
3584                    Ok(())
3585                }
3586
3587                4 => {
3588                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDriverPackageType>(
3589                        slot.as_mut(),
3590                        decoder,
3591                    )?;
3592
3593                    Ok(())
3594                }
3595
3596                5 => {
3597                    ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
3598
3599                    Ok(())
3600                }
3601
3602                6 => {
3603                    ::fidl_next::WireEnvelope::decode_as::<
3604                        ___D,
3605                        ::fidl_next::WireVector<'static, crate::WireDeviceCategory<'static>>,
3606                    >(slot.as_mut(), decoder)?;
3607
3608                    Ok(())
3609                }
3610
3611                7 => {
3612                    ::fidl_next::WireEnvelope::decode_as::<
3613                        ___D,
3614                        ::fidl_next::WireVector<'static, u8>,
3615                    >(slot.as_mut(), decoder)?;
3616
3617                    Ok(())
3618                }
3619
3620                8 => {
3621                    ::fidl_next::WireEnvelope::decode_as::<___D, u8>(slot.as_mut(), decoder)?;
3622
3623                    Ok(())
3624                }
3625
3626                9 => {
3627                    ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
3628
3629                    Ok(())
3630                }
3631
3632                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3633            }
3634        })
3635    }
3636}
3637
3638impl<'de> WireDriverInfo<'de> {
3639    pub fn url(&self) -> Option<&::fidl_next::WireString<'de>> {
3640        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3641    }
3642
3643    pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
3644        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3645    }
3646
3647    pub fn colocate(&self) -> Option<&bool> {
3648        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
3649    }
3650
3651    pub fn package_type(&self) -> Option<&crate::WireDriverPackageType> {
3652        unsafe { Some(self.table.get(4)?.deref_unchecked()) }
3653    }
3654
3655    pub fn is_fallback(&self) -> Option<&bool> {
3656        unsafe { Some(self.table.get(5)?.deref_unchecked()) }
3657    }
3658
3659    pub fn device_categories(
3660        &self,
3661    ) -> Option<&::fidl_next::WireVector<'de, crate::WireDeviceCategory<'de>>> {
3662        unsafe { Some(self.table.get(6)?.deref_unchecked()) }
3663    }
3664
3665    pub fn bind_rules_bytecode(&self) -> Option<&::fidl_next::WireVector<'de, u8>> {
3666        unsafe { Some(self.table.get(7)?.deref_unchecked()) }
3667    }
3668
3669    pub fn driver_framework_version(&self) -> Option<&u8> {
3670        unsafe { Some(self.table.get(8)?.deref_unchecked()) }
3671    }
3672
3673    pub fn is_disabled(&self) -> Option<&bool> {
3674        unsafe { Some(self.table.get(9)?.deref_unchecked()) }
3675    }
3676}
3677
3678impl<'de> ::core::fmt::Debug for WireDriverInfo<'de> {
3679    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3680        f.debug_struct("DriverInfo")
3681            .field("url", &self.url())
3682            .field("name", &self.name())
3683            .field("colocate", &self.colocate())
3684            .field("package_type", &self.package_type())
3685            .field("is_fallback", &self.is_fallback())
3686            .field("device_categories", &self.device_categories())
3687            .field("bind_rules_bytecode", &self.bind_rules_bytecode())
3688            .field("driver_framework_version", &self.driver_framework_version())
3689            .field("is_disabled", &self.is_disabled())
3690            .finish()
3691    }
3692}
3693
3694#[doc = " Information for a composite driver.\n"]
3695#[derive(Clone, Debug, Default)]
3696pub struct CompositeDriverInfo {
3697    pub composite_name: Option<String>,
3698
3699    pub driver_info: Option<crate::DriverInfo>,
3700}
3701
3702impl CompositeDriverInfo {
3703    fn __max_ordinal(&self) -> usize {
3704        if self.driver_info.is_some() {
3705            return 2;
3706        }
3707
3708        if self.composite_name.is_some() {
3709            return 1;
3710        }
3711
3712        0
3713    }
3714}
3715
3716impl ::fidl_next::Encodable for CompositeDriverInfo {
3717    type Encoded = WireCompositeDriverInfo<'static>;
3718}
3719
3720unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeDriverInfo
3721where
3722    ___E: ::fidl_next::Encoder + ?Sized,
3723{
3724    #[inline]
3725    fn encode(
3726        mut self,
3727        encoder: &mut ___E,
3728        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3729    ) -> Result<(), ::fidl_next::EncodeError> {
3730        ::fidl_next::munge!(let WireCompositeDriverInfo { table } = out);
3731
3732        let max_ord = self.__max_ordinal();
3733
3734        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3735        ::fidl_next::Wire::zero_padding(&mut out);
3736
3737        let mut preallocated =
3738            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3739
3740        for i in 1..=max_ord {
3741            match i {
3742                2 => {
3743                    if let Some(driver_info) = self.driver_info.take() {
3744                        ::fidl_next::WireEnvelope::encode_value(
3745                            driver_info,
3746                            preallocated.encoder,
3747                            &mut out,
3748                        )?;
3749                    } else {
3750                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3751                    }
3752                }
3753
3754                1 => {
3755                    if let Some(composite_name) = self.composite_name.take() {
3756                        ::fidl_next::WireEnvelope::encode_value(
3757                            composite_name,
3758                            preallocated.encoder,
3759                            &mut out,
3760                        )?;
3761                    } else {
3762                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3763                    }
3764                }
3765
3766                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3767            }
3768            unsafe {
3769                preallocated.write_next(out.assume_init_ref());
3770            }
3771        }
3772
3773        ::fidl_next::WireTable::encode_len(table, max_ord);
3774
3775        Ok(())
3776    }
3777}
3778
3779unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CompositeDriverInfo
3780where
3781    ___E: ::fidl_next::Encoder + ?Sized,
3782{
3783    #[inline]
3784    fn encode_ref(
3785        &self,
3786        encoder: &mut ___E,
3787        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3788    ) -> Result<(), ::fidl_next::EncodeError> {
3789        ::fidl_next::munge!(let WireCompositeDriverInfo { table } = out);
3790
3791        let max_ord = self.__max_ordinal();
3792
3793        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3794        ::fidl_next::Wire::zero_padding(&mut out);
3795
3796        let mut preallocated =
3797            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3798
3799        for i in 1..=max_ord {
3800            match i {
3801                2 => {
3802                    if let Some(driver_info) = &self.driver_info {
3803                        ::fidl_next::WireEnvelope::encode_value(
3804                            driver_info,
3805                            preallocated.encoder,
3806                            &mut out,
3807                        )?;
3808                    } else {
3809                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3810                    }
3811                }
3812
3813                1 => {
3814                    if let Some(composite_name) = &self.composite_name {
3815                        ::fidl_next::WireEnvelope::encode_value(
3816                            composite_name,
3817                            preallocated.encoder,
3818                            &mut out,
3819                        )?;
3820                    } else {
3821                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3822                    }
3823                }
3824
3825                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3826            }
3827            unsafe {
3828                preallocated.write_next(out.assume_init_ref());
3829            }
3830        }
3831
3832        ::fidl_next::WireTable::encode_len(table, max_ord);
3833
3834        Ok(())
3835    }
3836}
3837
3838impl<'de> ::fidl_next::FromWire<WireCompositeDriverInfo<'de>> for CompositeDriverInfo {
3839    #[inline]
3840    fn from_wire(wire: WireCompositeDriverInfo<'de>) -> Self {
3841        let wire = ::core::mem::ManuallyDrop::new(wire);
3842
3843        let composite_name = wire.table.get(1);
3844
3845        let driver_info = wire.table.get(2);
3846
3847        Self {
3848            composite_name: composite_name.map(|envelope| {
3849                ::fidl_next::FromWire::from_wire(unsafe {
3850                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
3851                })
3852            }),
3853
3854            driver_info: driver_info.map(|envelope| {
3855                ::fidl_next::FromWire::from_wire(unsafe {
3856                    envelope.read_unchecked::<crate::WireDriverInfo<'de>>()
3857                })
3858            }),
3859        }
3860    }
3861}
3862
3863impl<'de> ::fidl_next::FromWireRef<WireCompositeDriverInfo<'de>> for CompositeDriverInfo {
3864    #[inline]
3865    fn from_wire_ref(wire: &WireCompositeDriverInfo<'de>) -> Self {
3866        Self {
3867            composite_name: wire.table.get(1).map(|envelope| {
3868                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3869                    envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
3870                })
3871            }),
3872
3873            driver_info: wire.table.get(2).map(|envelope| {
3874                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3875                    envelope.deref_unchecked::<crate::WireDriverInfo<'de>>()
3876                })
3877            }),
3878        }
3879    }
3880}
3881
3882/// The wire type corresponding to [`CompositeDriverInfo`].
3883#[repr(C)]
3884pub struct WireCompositeDriverInfo<'de> {
3885    table: ::fidl_next::WireTable<'de>,
3886}
3887
3888impl<'de> Drop for WireCompositeDriverInfo<'de> {
3889    fn drop(&mut self) {
3890        let _ = self
3891            .table
3892            .get(1)
3893            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
3894
3895        let _ = self
3896            .table
3897            .get(2)
3898            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDriverInfo<'de>>() });
3899    }
3900}
3901
3902unsafe impl ::fidl_next::Wire for WireCompositeDriverInfo<'static> {
3903    type Decoded<'de> = WireCompositeDriverInfo<'de>;
3904
3905    #[inline]
3906    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3907        ::fidl_next::munge!(let Self { table } = out);
3908        ::fidl_next::WireTable::zero_padding(table);
3909    }
3910}
3911
3912unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeDriverInfo<'static>
3913where
3914    ___D: ::fidl_next::Decoder + ?Sized,
3915{
3916    fn decode(
3917        slot: ::fidl_next::Slot<'_, Self>,
3918        decoder: &mut ___D,
3919    ) -> Result<(), ::fidl_next::DecodeError> {
3920        ::fidl_next::munge!(let Self { table } = slot);
3921
3922        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3923            match ordinal {
3924                0 => unsafe { ::core::hint::unreachable_unchecked() },
3925
3926                1 => {
3927                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
3928                        slot.as_mut(),
3929                        decoder,
3930                    )?;
3931
3932                    Ok(())
3933                }
3934
3935                2 => {
3936                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDriverInfo<'static>>(
3937                        slot.as_mut(),
3938                        decoder,
3939                    )?;
3940
3941                    Ok(())
3942                }
3943
3944                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3945            }
3946        })
3947    }
3948}
3949
3950impl<'de> WireCompositeDriverInfo<'de> {
3951    pub fn composite_name(&self) -> Option<&::fidl_next::WireString<'de>> {
3952        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3953    }
3954
3955    pub fn driver_info(&self) -> Option<&crate::WireDriverInfo<'de>> {
3956        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3957    }
3958}
3959
3960impl<'de> ::core::fmt::Debug for WireCompositeDriverInfo<'de> {
3961    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3962        f.debug_struct("CompositeDriverInfo")
3963            .field("composite_name", &self.composite_name())
3964            .field("driver_info", &self.driver_info())
3965            .finish()
3966    }
3967}
3968
3969#[doc = " Information for a composite driver that has matched with a composite.\n"]
3970#[derive(Clone, Debug, Default)]
3971pub struct CompositeDriverMatch {
3972    pub composite_driver: Option<crate::CompositeDriverInfo>,
3973
3974    pub parent_names: Option<Vec<String>>,
3975
3976    pub primary_parent_index: Option<u32>,
3977}
3978
3979impl CompositeDriverMatch {
3980    fn __max_ordinal(&self) -> usize {
3981        if self.primary_parent_index.is_some() {
3982            return 3;
3983        }
3984
3985        if self.parent_names.is_some() {
3986            return 2;
3987        }
3988
3989        if self.composite_driver.is_some() {
3990            return 1;
3991        }
3992
3993        0
3994    }
3995}
3996
3997impl ::fidl_next::Encodable for CompositeDriverMatch {
3998    type Encoded = WireCompositeDriverMatch<'static>;
3999}
4000
4001unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeDriverMatch
4002where
4003    ___E: ::fidl_next::Encoder + ?Sized,
4004{
4005    #[inline]
4006    fn encode(
4007        mut self,
4008        encoder: &mut ___E,
4009        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4010    ) -> Result<(), ::fidl_next::EncodeError> {
4011        ::fidl_next::munge!(let WireCompositeDriverMatch { table } = out);
4012
4013        let max_ord = self.__max_ordinal();
4014
4015        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4016        ::fidl_next::Wire::zero_padding(&mut out);
4017
4018        let mut preallocated =
4019            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4020
4021        for i in 1..=max_ord {
4022            match i {
4023                3 => {
4024                    if let Some(primary_parent_index) = self.primary_parent_index.take() {
4025                        ::fidl_next::WireEnvelope::encode_value(
4026                            primary_parent_index,
4027                            preallocated.encoder,
4028                            &mut out,
4029                        )?;
4030                    } else {
4031                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4032                    }
4033                }
4034
4035                2 => {
4036                    if let Some(parent_names) = self.parent_names.take() {
4037                        ::fidl_next::WireEnvelope::encode_value(
4038                            parent_names,
4039                            preallocated.encoder,
4040                            &mut out,
4041                        )?;
4042                    } else {
4043                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4044                    }
4045                }
4046
4047                1 => {
4048                    if let Some(composite_driver) = self.composite_driver.take() {
4049                        ::fidl_next::WireEnvelope::encode_value(
4050                            composite_driver,
4051                            preallocated.encoder,
4052                            &mut out,
4053                        )?;
4054                    } else {
4055                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4056                    }
4057                }
4058
4059                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4060            }
4061            unsafe {
4062                preallocated.write_next(out.assume_init_ref());
4063            }
4064        }
4065
4066        ::fidl_next::WireTable::encode_len(table, max_ord);
4067
4068        Ok(())
4069    }
4070}
4071
4072unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CompositeDriverMatch
4073where
4074    ___E: ::fidl_next::Encoder + ?Sized,
4075{
4076    #[inline]
4077    fn encode_ref(
4078        &self,
4079        encoder: &mut ___E,
4080        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4081    ) -> Result<(), ::fidl_next::EncodeError> {
4082        ::fidl_next::munge!(let WireCompositeDriverMatch { table } = out);
4083
4084        let max_ord = self.__max_ordinal();
4085
4086        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4087        ::fidl_next::Wire::zero_padding(&mut out);
4088
4089        let mut preallocated =
4090            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4091
4092        for i in 1..=max_ord {
4093            match i {
4094                3 => {
4095                    if let Some(primary_parent_index) = &self.primary_parent_index {
4096                        ::fidl_next::WireEnvelope::encode_value(
4097                            primary_parent_index,
4098                            preallocated.encoder,
4099                            &mut out,
4100                        )?;
4101                    } else {
4102                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4103                    }
4104                }
4105
4106                2 => {
4107                    if let Some(parent_names) = &self.parent_names {
4108                        ::fidl_next::WireEnvelope::encode_value(
4109                            parent_names,
4110                            preallocated.encoder,
4111                            &mut out,
4112                        )?;
4113                    } else {
4114                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4115                    }
4116                }
4117
4118                1 => {
4119                    if let Some(composite_driver) = &self.composite_driver {
4120                        ::fidl_next::WireEnvelope::encode_value(
4121                            composite_driver,
4122                            preallocated.encoder,
4123                            &mut out,
4124                        )?;
4125                    } else {
4126                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4127                    }
4128                }
4129
4130                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4131            }
4132            unsafe {
4133                preallocated.write_next(out.assume_init_ref());
4134            }
4135        }
4136
4137        ::fidl_next::WireTable::encode_len(table, max_ord);
4138
4139        Ok(())
4140    }
4141}
4142
4143impl<'de> ::fidl_next::FromWire<WireCompositeDriverMatch<'de>> for CompositeDriverMatch {
4144    #[inline]
4145    fn from_wire(wire: WireCompositeDriverMatch<'de>) -> Self {
4146        let wire = ::core::mem::ManuallyDrop::new(wire);
4147
4148        let composite_driver = wire.table.get(1);
4149
4150        let parent_names = wire.table.get(2);
4151
4152        let primary_parent_index = wire.table.get(3);
4153
4154        Self {
4155
4156
4157                composite_driver: composite_driver.map(|envelope| ::fidl_next::FromWire::from_wire(
4158                    unsafe { envelope.read_unchecked::<crate::WireCompositeDriverInfo<'de>>() }
4159                )),
4160
4161
4162                parent_names: parent_names.map(|envelope| ::fidl_next::FromWire::from_wire(
4163                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>() }
4164                )),
4165
4166
4167                primary_parent_index: primary_parent_index.map(|envelope| ::fidl_next::FromWire::from_wire(
4168                    unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() }
4169                )),
4170
4171        }
4172    }
4173}
4174
4175impl<'de> ::fidl_next::FromWireRef<WireCompositeDriverMatch<'de>> for CompositeDriverMatch {
4176    #[inline]
4177    fn from_wire_ref(wire: &WireCompositeDriverMatch<'de>) -> Self {
4178        Self {
4179
4180
4181                composite_driver: wire.table.get(1)
4182                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
4183                        unsafe { envelope.deref_unchecked::<crate::WireCompositeDriverInfo<'de>>() }
4184                    )),
4185
4186
4187                parent_names: wire.table.get(2)
4188                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
4189                        unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>() }
4190                    )),
4191
4192
4193                primary_parent_index: wire.table.get(3)
4194                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
4195                        unsafe { envelope.deref_unchecked::<::fidl_next::WireU32>() }
4196                    )),
4197
4198        }
4199    }
4200}
4201
4202/// The wire type corresponding to [`CompositeDriverMatch`].
4203#[repr(C)]
4204pub struct WireCompositeDriverMatch<'de> {
4205    table: ::fidl_next::WireTable<'de>,
4206}
4207
4208impl<'de> Drop for WireCompositeDriverMatch<'de> {
4209    fn drop(&mut self) {
4210        let _ = self.table.get(1).map(|envelope| unsafe {
4211            envelope.read_unchecked::<crate::WireCompositeDriverInfo<'de>>()
4212        });
4213
4214        let _ = self.table.get(2).map(|envelope| unsafe {
4215            envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
4216        });
4217
4218        let _ = self
4219            .table
4220            .get(3)
4221            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
4222    }
4223}
4224
4225unsafe impl ::fidl_next::Wire for WireCompositeDriverMatch<'static> {
4226    type Decoded<'de> = WireCompositeDriverMatch<'de>;
4227
4228    #[inline]
4229    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4230        ::fidl_next::munge!(let Self { table } = out);
4231        ::fidl_next::WireTable::zero_padding(table);
4232    }
4233}
4234
4235unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeDriverMatch<'static>
4236where
4237    ___D: ::fidl_next::Decoder + ?Sized,
4238{
4239    fn decode(
4240        slot: ::fidl_next::Slot<'_, Self>,
4241        decoder: &mut ___D,
4242    ) -> Result<(), ::fidl_next::DecodeError> {
4243        ::fidl_next::munge!(let Self { table } = slot);
4244
4245        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4246            match ordinal {
4247                0 => unsafe { ::core::hint::unreachable_unchecked() },
4248
4249                1 => {
4250                    ::fidl_next::WireEnvelope::decode_as::<
4251                        ___D,
4252                        crate::WireCompositeDriverInfo<'static>,
4253                    >(slot.as_mut(), decoder)?;
4254
4255                    Ok(())
4256                }
4257
4258                2 => {
4259                    ::fidl_next::WireEnvelope::decode_as::<
4260                        ___D,
4261                        ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
4262                    >(slot.as_mut(), decoder)?;
4263
4264                    Ok(())
4265                }
4266
4267                3 => {
4268                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
4269                        slot.as_mut(),
4270                        decoder,
4271                    )?;
4272
4273                    Ok(())
4274                }
4275
4276                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
4277            }
4278        })
4279    }
4280}
4281
4282impl<'de> WireCompositeDriverMatch<'de> {
4283    pub fn composite_driver(&self) -> Option<&crate::WireCompositeDriverInfo<'de>> {
4284        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4285    }
4286
4287    pub fn parent_names(
4288        &self,
4289    ) -> Option<&::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>> {
4290        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4291    }
4292
4293    pub fn primary_parent_index(&self) -> Option<&::fidl_next::WireU32> {
4294        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
4295    }
4296}
4297
4298impl<'de> ::core::fmt::Debug for WireCompositeDriverMatch<'de> {
4299    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
4300        f.debug_struct("CompositeDriverMatch")
4301            .field("composite_driver", &self.composite_driver())
4302            .field("parent_names", &self.parent_names())
4303            .field("primary_parent_index", &self.primary_parent_index())
4304            .finish()
4305    }
4306}
4307
4308#[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"]
4309#[derive(Clone, Debug)]
4310pub struct NodeProperty {
4311    pub key: crate::NodePropertyKey,
4312
4313    pub value: crate::NodePropertyValue,
4314}
4315
4316impl ::fidl_next::Encodable for NodeProperty {
4317    type Encoded = WireNodeProperty<'static>;
4318}
4319
4320unsafe impl<___E> ::fidl_next::Encode<___E> for NodeProperty
4321where
4322    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4323    ___E: ::fidl_next::Encoder,
4324{
4325    #[inline]
4326    fn encode(
4327        self,
4328        encoder: &mut ___E,
4329        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4330    ) -> Result<(), ::fidl_next::EncodeError> {
4331        ::fidl_next::munge! {
4332            let Self::Encoded {
4333                key,
4334                value,
4335
4336            } = out;
4337        }
4338
4339        ::fidl_next::Encode::encode(self.key, encoder, key)?;
4340
4341        ::fidl_next::Encode::encode(self.value, encoder, value)?;
4342
4343        Ok(())
4344    }
4345}
4346
4347unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeProperty
4348where
4349    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4350    ___E: ::fidl_next::Encoder,
4351{
4352    #[inline]
4353    fn encode_ref(
4354        &self,
4355        encoder: &mut ___E,
4356        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4357    ) -> Result<(), ::fidl_next::EncodeError> {
4358        ::fidl_next::munge! {
4359            let Self::Encoded {
4360                key,
4361                value,
4362
4363            } = out;
4364        }
4365
4366        ::fidl_next::EncodeRef::encode_ref(&self.key, encoder, key)?;
4367
4368        ::fidl_next::EncodeRef::encode_ref(&self.value, encoder, value)?;
4369
4370        Ok(())
4371    }
4372}
4373
4374impl ::fidl_next::EncodableOption for NodeProperty {
4375    type EncodedOption = ::fidl_next::WireBox<'static, WireNodeProperty<'static>>;
4376}
4377
4378unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeProperty
4379where
4380    ___E: ::fidl_next::Encoder + ?Sized,
4381    NodeProperty: ::fidl_next::Encode<___E>,
4382{
4383    #[inline]
4384    fn encode_option(
4385        this: Option<Self>,
4386        encoder: &mut ___E,
4387        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4388    ) -> Result<(), ::fidl_next::EncodeError> {
4389        if let Some(inner) = this {
4390            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4391            ::fidl_next::WireBox::encode_present(out);
4392        } else {
4393            ::fidl_next::WireBox::encode_absent(out);
4394        }
4395
4396        Ok(())
4397    }
4398}
4399
4400unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeProperty
4401where
4402    ___E: ::fidl_next::Encoder + ?Sized,
4403    NodeProperty: ::fidl_next::EncodeRef<___E>,
4404{
4405    #[inline]
4406    fn encode_option_ref(
4407        this: Option<&Self>,
4408        encoder: &mut ___E,
4409        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4410    ) -> Result<(), ::fidl_next::EncodeError> {
4411        if let Some(inner) = this {
4412            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4413            ::fidl_next::WireBox::encode_present(out);
4414        } else {
4415            ::fidl_next::WireBox::encode_absent(out);
4416        }
4417
4418        Ok(())
4419    }
4420}
4421
4422impl<'de> ::fidl_next::FromWire<WireNodeProperty<'de>> for NodeProperty {
4423    #[inline]
4424    fn from_wire(wire: WireNodeProperty<'de>) -> Self {
4425        Self {
4426            key: ::fidl_next::FromWire::from_wire(wire.key),
4427
4428            value: ::fidl_next::FromWire::from_wire(wire.value),
4429        }
4430    }
4431}
4432
4433impl<'de> ::fidl_next::FromWireRef<WireNodeProperty<'de>> for NodeProperty {
4434    #[inline]
4435    fn from_wire_ref(wire: &WireNodeProperty<'de>) -> Self {
4436        Self {
4437            key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
4438
4439            value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value),
4440        }
4441    }
4442}
4443
4444/// The wire type corresponding to [`NodeProperty`].
4445#[derive(Debug)]
4446#[repr(C)]
4447pub struct WireNodeProperty<'de> {
4448    pub key: crate::WireNodePropertyKey<'de>,
4449
4450    pub value: crate::WireNodePropertyValue<'de>,
4451}
4452
4453unsafe impl ::fidl_next::Wire for WireNodeProperty<'static> {
4454    type Decoded<'de> = WireNodeProperty<'de>;
4455
4456    #[inline]
4457    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4458}
4459
4460unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeProperty<'static>
4461where
4462    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4463    ___D: ::fidl_next::Decoder,
4464{
4465    fn decode(
4466        slot: ::fidl_next::Slot<'_, Self>,
4467        decoder: &mut ___D,
4468    ) -> Result<(), ::fidl_next::DecodeError> {
4469        ::fidl_next::munge! {
4470            let Self {
4471                mut key,
4472                mut value,
4473
4474            } = slot;
4475        }
4476
4477        ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
4478
4479        ::fidl_next::Decode::decode(value.as_mut(), decoder)?;
4480
4481        Ok(())
4482    }
4483}
4484
4485#[doc = " Specification for a node that parents the composite node created from the\n composite node specification.\n"]
4486#[derive(Clone, Debug)]
4487pub struct ParentSpec {
4488    pub bind_rules: Vec<crate::BindRule>,
4489
4490    pub properties: Vec<crate::NodeProperty>,
4491}
4492
4493impl ::fidl_next::Encodable for ParentSpec {
4494    type Encoded = WireParentSpec<'static>;
4495}
4496
4497unsafe impl<___E> ::fidl_next::Encode<___E> for ParentSpec
4498where
4499    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4500    ___E: ::fidl_next::Encoder,
4501{
4502    #[inline]
4503    fn encode(
4504        self,
4505        encoder: &mut ___E,
4506        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4507    ) -> Result<(), ::fidl_next::EncodeError> {
4508        ::fidl_next::munge! {
4509            let Self::Encoded {
4510                bind_rules,
4511                properties,
4512
4513            } = out;
4514        }
4515
4516        ::fidl_next::Encode::encode(self.bind_rules, encoder, bind_rules)?;
4517
4518        ::fidl_next::Encode::encode(self.properties, encoder, properties)?;
4519
4520        Ok(())
4521    }
4522}
4523
4524unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ParentSpec
4525where
4526    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4527    ___E: ::fidl_next::Encoder,
4528{
4529    #[inline]
4530    fn encode_ref(
4531        &self,
4532        encoder: &mut ___E,
4533        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4534    ) -> Result<(), ::fidl_next::EncodeError> {
4535        ::fidl_next::munge! {
4536            let Self::Encoded {
4537                bind_rules,
4538                properties,
4539
4540            } = out;
4541        }
4542
4543        ::fidl_next::EncodeRef::encode_ref(&self.bind_rules, encoder, bind_rules)?;
4544
4545        ::fidl_next::EncodeRef::encode_ref(&self.properties, encoder, properties)?;
4546
4547        Ok(())
4548    }
4549}
4550
4551impl ::fidl_next::EncodableOption for ParentSpec {
4552    type EncodedOption = ::fidl_next::WireBox<'static, WireParentSpec<'static>>;
4553}
4554
4555unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ParentSpec
4556where
4557    ___E: ::fidl_next::Encoder + ?Sized,
4558    ParentSpec: ::fidl_next::Encode<___E>,
4559{
4560    #[inline]
4561    fn encode_option(
4562        this: Option<Self>,
4563        encoder: &mut ___E,
4564        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4565    ) -> Result<(), ::fidl_next::EncodeError> {
4566        if let Some(inner) = this {
4567            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4568            ::fidl_next::WireBox::encode_present(out);
4569        } else {
4570            ::fidl_next::WireBox::encode_absent(out);
4571        }
4572
4573        Ok(())
4574    }
4575}
4576
4577unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ParentSpec
4578where
4579    ___E: ::fidl_next::Encoder + ?Sized,
4580    ParentSpec: ::fidl_next::EncodeRef<___E>,
4581{
4582    #[inline]
4583    fn encode_option_ref(
4584        this: Option<&Self>,
4585        encoder: &mut ___E,
4586        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4587    ) -> Result<(), ::fidl_next::EncodeError> {
4588        if let Some(inner) = this {
4589            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4590            ::fidl_next::WireBox::encode_present(out);
4591        } else {
4592            ::fidl_next::WireBox::encode_absent(out);
4593        }
4594
4595        Ok(())
4596    }
4597}
4598
4599impl<'de> ::fidl_next::FromWire<WireParentSpec<'de>> for ParentSpec {
4600    #[inline]
4601    fn from_wire(wire: WireParentSpec<'de>) -> Self {
4602        Self {
4603            bind_rules: ::fidl_next::FromWire::from_wire(wire.bind_rules),
4604
4605            properties: ::fidl_next::FromWire::from_wire(wire.properties),
4606        }
4607    }
4608}
4609
4610impl<'de> ::fidl_next::FromWireRef<WireParentSpec<'de>> for ParentSpec {
4611    #[inline]
4612    fn from_wire_ref(wire: &WireParentSpec<'de>) -> Self {
4613        Self {
4614            bind_rules: ::fidl_next::FromWireRef::from_wire_ref(&wire.bind_rules),
4615
4616            properties: ::fidl_next::FromWireRef::from_wire_ref(&wire.properties),
4617        }
4618    }
4619}
4620
4621/// The wire type corresponding to [`ParentSpec`].
4622#[derive(Debug)]
4623#[repr(C)]
4624pub struct WireParentSpec<'de> {
4625    pub bind_rules: ::fidl_next::WireVector<'de, crate::WireBindRule<'de>>,
4626
4627    pub properties: ::fidl_next::WireVector<'de, crate::WireNodeProperty<'de>>,
4628}
4629
4630unsafe impl ::fidl_next::Wire for WireParentSpec<'static> {
4631    type Decoded<'de> = WireParentSpec<'de>;
4632
4633    #[inline]
4634    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4635}
4636
4637unsafe impl<___D> ::fidl_next::Decode<___D> for WireParentSpec<'static>
4638where
4639    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4640    ___D: ::fidl_next::Decoder,
4641{
4642    fn decode(
4643        slot: ::fidl_next::Slot<'_, Self>,
4644        decoder: &mut ___D,
4645    ) -> Result<(), ::fidl_next::DecodeError> {
4646        ::fidl_next::munge! {
4647            let Self {
4648                mut bind_rules,
4649                mut properties,
4650
4651            } = slot;
4652        }
4653
4654        ::fidl_next::Decode::decode(bind_rules.as_mut(), decoder)?;
4655
4656        let bind_rules = unsafe { bind_rules.deref_unchecked() };
4657
4658        if bind_rules.len() > 64 {
4659            return Err(::fidl_next::DecodeError::VectorTooLong {
4660                size: bind_rules.len() as u64,
4661                limit: 64,
4662            });
4663        }
4664
4665        ::fidl_next::Decode::decode(properties.as_mut(), decoder)?;
4666
4667        let properties = unsafe { properties.deref_unchecked() };
4668
4669        if properties.len() > 64 {
4670            return Err(::fidl_next::DecodeError::VectorTooLong {
4671                size: properties.len() as u64,
4672                limit: 64,
4673            });
4674        }
4675
4676        Ok(())
4677    }
4678}
4679
4680#[derive(Clone, Debug)]
4681pub struct NodeProperty2 {
4682    pub key: String,
4683
4684    pub value: crate::NodePropertyValue,
4685}
4686
4687impl ::fidl_next::Encodable for NodeProperty2 {
4688    type Encoded = WireNodeProperty2<'static>;
4689}
4690
4691unsafe impl<___E> ::fidl_next::Encode<___E> for NodeProperty2
4692where
4693    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4694    ___E: ::fidl_next::Encoder,
4695{
4696    #[inline]
4697    fn encode(
4698        self,
4699        encoder: &mut ___E,
4700        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4701    ) -> Result<(), ::fidl_next::EncodeError> {
4702        ::fidl_next::munge! {
4703            let Self::Encoded {
4704                key,
4705                value,
4706
4707            } = out;
4708        }
4709
4710        ::fidl_next::Encode::encode(self.key, encoder, key)?;
4711
4712        ::fidl_next::Encode::encode(self.value, encoder, value)?;
4713
4714        Ok(())
4715    }
4716}
4717
4718unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeProperty2
4719where
4720    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4721    ___E: ::fidl_next::Encoder,
4722{
4723    #[inline]
4724    fn encode_ref(
4725        &self,
4726        encoder: &mut ___E,
4727        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4728    ) -> Result<(), ::fidl_next::EncodeError> {
4729        ::fidl_next::munge! {
4730            let Self::Encoded {
4731                key,
4732                value,
4733
4734            } = out;
4735        }
4736
4737        ::fidl_next::EncodeRef::encode_ref(&self.key, encoder, key)?;
4738
4739        ::fidl_next::EncodeRef::encode_ref(&self.value, encoder, value)?;
4740
4741        Ok(())
4742    }
4743}
4744
4745impl ::fidl_next::EncodableOption for NodeProperty2 {
4746    type EncodedOption = ::fidl_next::WireBox<'static, WireNodeProperty2<'static>>;
4747}
4748
4749unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeProperty2
4750where
4751    ___E: ::fidl_next::Encoder + ?Sized,
4752    NodeProperty2: ::fidl_next::Encode<___E>,
4753{
4754    #[inline]
4755    fn encode_option(
4756        this: Option<Self>,
4757        encoder: &mut ___E,
4758        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4759    ) -> Result<(), ::fidl_next::EncodeError> {
4760        if let Some(inner) = this {
4761            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4762            ::fidl_next::WireBox::encode_present(out);
4763        } else {
4764            ::fidl_next::WireBox::encode_absent(out);
4765        }
4766
4767        Ok(())
4768    }
4769}
4770
4771unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeProperty2
4772where
4773    ___E: ::fidl_next::Encoder + ?Sized,
4774    NodeProperty2: ::fidl_next::EncodeRef<___E>,
4775{
4776    #[inline]
4777    fn encode_option_ref(
4778        this: Option<&Self>,
4779        encoder: &mut ___E,
4780        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4781    ) -> Result<(), ::fidl_next::EncodeError> {
4782        if let Some(inner) = this {
4783            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4784            ::fidl_next::WireBox::encode_present(out);
4785        } else {
4786            ::fidl_next::WireBox::encode_absent(out);
4787        }
4788
4789        Ok(())
4790    }
4791}
4792
4793impl<'de> ::fidl_next::FromWire<WireNodeProperty2<'de>> for NodeProperty2 {
4794    #[inline]
4795    fn from_wire(wire: WireNodeProperty2<'de>) -> Self {
4796        Self {
4797            key: ::fidl_next::FromWire::from_wire(wire.key),
4798
4799            value: ::fidl_next::FromWire::from_wire(wire.value),
4800        }
4801    }
4802}
4803
4804impl<'de> ::fidl_next::FromWireRef<WireNodeProperty2<'de>> for NodeProperty2 {
4805    #[inline]
4806    fn from_wire_ref(wire: &WireNodeProperty2<'de>) -> Self {
4807        Self {
4808            key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
4809
4810            value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value),
4811        }
4812    }
4813}
4814
4815/// The wire type corresponding to [`NodeProperty2`].
4816#[derive(Debug)]
4817#[repr(C)]
4818pub struct WireNodeProperty2<'de> {
4819    pub key: ::fidl_next::WireString<'de>,
4820
4821    pub value: crate::WireNodePropertyValue<'de>,
4822}
4823
4824unsafe impl ::fidl_next::Wire for WireNodeProperty2<'static> {
4825    type Decoded<'de> = WireNodeProperty2<'de>;
4826
4827    #[inline]
4828    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4829}
4830
4831unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeProperty2<'static>
4832where
4833    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4834    ___D: ::fidl_next::Decoder,
4835{
4836    fn decode(
4837        slot: ::fidl_next::Slot<'_, Self>,
4838        decoder: &mut ___D,
4839    ) -> Result<(), ::fidl_next::DecodeError> {
4840        ::fidl_next::munge! {
4841            let Self {
4842                mut key,
4843                mut value,
4844
4845            } = slot;
4846        }
4847
4848        ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
4849
4850        let key = unsafe { key.deref_unchecked() };
4851
4852        if key.len() > 256 {
4853            return Err(::fidl_next::DecodeError::VectorTooLong {
4854                size: key.len() as u64,
4855                limit: 256,
4856            });
4857        }
4858
4859        ::fidl_next::Decode::decode(value.as_mut(), decoder)?;
4860
4861        Ok(())
4862    }
4863}
4864
4865#[doc = " Specification for a node that parents the composite node created from the\n composite node specification.\n"]
4866#[derive(Clone, Debug)]
4867pub struct ParentSpec2 {
4868    pub bind_rules: Vec<crate::BindRule2>,
4869
4870    pub properties: Vec<crate::NodeProperty2>,
4871}
4872
4873impl ::fidl_next::Encodable for ParentSpec2 {
4874    type Encoded = WireParentSpec2<'static>;
4875}
4876
4877unsafe impl<___E> ::fidl_next::Encode<___E> for ParentSpec2
4878where
4879    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4880    ___E: ::fidl_next::Encoder,
4881{
4882    #[inline]
4883    fn encode(
4884        self,
4885        encoder: &mut ___E,
4886        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4887    ) -> Result<(), ::fidl_next::EncodeError> {
4888        ::fidl_next::munge! {
4889            let Self::Encoded {
4890                bind_rules,
4891                properties,
4892
4893            } = out;
4894        }
4895
4896        ::fidl_next::Encode::encode(self.bind_rules, encoder, bind_rules)?;
4897
4898        ::fidl_next::Encode::encode(self.properties, encoder, properties)?;
4899
4900        Ok(())
4901    }
4902}
4903
4904unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ParentSpec2
4905where
4906    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4907    ___E: ::fidl_next::Encoder,
4908{
4909    #[inline]
4910    fn encode_ref(
4911        &self,
4912        encoder: &mut ___E,
4913        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4914    ) -> Result<(), ::fidl_next::EncodeError> {
4915        ::fidl_next::munge! {
4916            let Self::Encoded {
4917                bind_rules,
4918                properties,
4919
4920            } = out;
4921        }
4922
4923        ::fidl_next::EncodeRef::encode_ref(&self.bind_rules, encoder, bind_rules)?;
4924
4925        ::fidl_next::EncodeRef::encode_ref(&self.properties, encoder, properties)?;
4926
4927        Ok(())
4928    }
4929}
4930
4931impl ::fidl_next::EncodableOption for ParentSpec2 {
4932    type EncodedOption = ::fidl_next::WireBox<'static, WireParentSpec2<'static>>;
4933}
4934
4935unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ParentSpec2
4936where
4937    ___E: ::fidl_next::Encoder + ?Sized,
4938    ParentSpec2: ::fidl_next::Encode<___E>,
4939{
4940    #[inline]
4941    fn encode_option(
4942        this: Option<Self>,
4943        encoder: &mut ___E,
4944        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4945    ) -> Result<(), ::fidl_next::EncodeError> {
4946        if let Some(inner) = this {
4947            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4948            ::fidl_next::WireBox::encode_present(out);
4949        } else {
4950            ::fidl_next::WireBox::encode_absent(out);
4951        }
4952
4953        Ok(())
4954    }
4955}
4956
4957unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ParentSpec2
4958where
4959    ___E: ::fidl_next::Encoder + ?Sized,
4960    ParentSpec2: ::fidl_next::EncodeRef<___E>,
4961{
4962    #[inline]
4963    fn encode_option_ref(
4964        this: Option<&Self>,
4965        encoder: &mut ___E,
4966        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4967    ) -> Result<(), ::fidl_next::EncodeError> {
4968        if let Some(inner) = this {
4969            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4970            ::fidl_next::WireBox::encode_present(out);
4971        } else {
4972            ::fidl_next::WireBox::encode_absent(out);
4973        }
4974
4975        Ok(())
4976    }
4977}
4978
4979impl<'de> ::fidl_next::FromWire<WireParentSpec2<'de>> for ParentSpec2 {
4980    #[inline]
4981    fn from_wire(wire: WireParentSpec2<'de>) -> Self {
4982        Self {
4983            bind_rules: ::fidl_next::FromWire::from_wire(wire.bind_rules),
4984
4985            properties: ::fidl_next::FromWire::from_wire(wire.properties),
4986        }
4987    }
4988}
4989
4990impl<'de> ::fidl_next::FromWireRef<WireParentSpec2<'de>> for ParentSpec2 {
4991    #[inline]
4992    fn from_wire_ref(wire: &WireParentSpec2<'de>) -> Self {
4993        Self {
4994            bind_rules: ::fidl_next::FromWireRef::from_wire_ref(&wire.bind_rules),
4995
4996            properties: ::fidl_next::FromWireRef::from_wire_ref(&wire.properties),
4997        }
4998    }
4999}
5000
5001/// The wire type corresponding to [`ParentSpec2`].
5002#[derive(Debug)]
5003#[repr(C)]
5004pub struct WireParentSpec2<'de> {
5005    pub bind_rules: ::fidl_next::WireVector<'de, crate::WireBindRule2<'de>>,
5006
5007    pub properties: ::fidl_next::WireVector<'de, crate::WireNodeProperty2<'de>>,
5008}
5009
5010unsafe impl ::fidl_next::Wire for WireParentSpec2<'static> {
5011    type Decoded<'de> = WireParentSpec2<'de>;
5012
5013    #[inline]
5014    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5015}
5016
5017unsafe impl<___D> ::fidl_next::Decode<___D> for WireParentSpec2<'static>
5018where
5019    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5020    ___D: ::fidl_next::Decoder,
5021{
5022    fn decode(
5023        slot: ::fidl_next::Slot<'_, Self>,
5024        decoder: &mut ___D,
5025    ) -> Result<(), ::fidl_next::DecodeError> {
5026        ::fidl_next::munge! {
5027            let Self {
5028                mut bind_rules,
5029                mut properties,
5030
5031            } = slot;
5032        }
5033
5034        ::fidl_next::Decode::decode(bind_rules.as_mut(), decoder)?;
5035
5036        let bind_rules = unsafe { bind_rules.deref_unchecked() };
5037
5038        if bind_rules.len() > 64 {
5039            return Err(::fidl_next::DecodeError::VectorTooLong {
5040                size: bind_rules.len() as u64,
5041                limit: 64,
5042            });
5043        }
5044
5045        ::fidl_next::Decode::decode(properties.as_mut(), decoder)?;
5046
5047        let properties = unsafe { properties.deref_unchecked() };
5048
5049        if properties.len() > 64 {
5050            return Err(::fidl_next::DecodeError::VectorTooLong {
5051                size: properties.len() as u64,
5052                limit: 64,
5053            });
5054        }
5055
5056        Ok(())
5057    }
5058}
5059
5060#[doc = " Struct that represents a composite node specification.\n"]
5061#[derive(Clone, Debug, Default)]
5062pub struct CompositeNodeSpec {
5063    pub name: Option<String>,
5064
5065    pub parents: Option<Vec<crate::ParentSpec>>,
5066
5067    pub parents2: Option<Vec<crate::ParentSpec2>>,
5068}
5069
5070impl CompositeNodeSpec {
5071    fn __max_ordinal(&self) -> usize {
5072        if self.parents2.is_some() {
5073            return 3;
5074        }
5075
5076        if self.parents.is_some() {
5077            return 2;
5078        }
5079
5080        if self.name.is_some() {
5081            return 1;
5082        }
5083
5084        0
5085    }
5086}
5087
5088impl ::fidl_next::Encodable for CompositeNodeSpec {
5089    type Encoded = WireCompositeNodeSpec<'static>;
5090}
5091
5092unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeNodeSpec
5093where
5094    ___E: ::fidl_next::Encoder + ?Sized,
5095{
5096    #[inline]
5097    fn encode(
5098        mut self,
5099        encoder: &mut ___E,
5100        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5101    ) -> Result<(), ::fidl_next::EncodeError> {
5102        ::fidl_next::munge!(let WireCompositeNodeSpec { table } = out);
5103
5104        let max_ord = self.__max_ordinal();
5105
5106        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5107        ::fidl_next::Wire::zero_padding(&mut out);
5108
5109        let mut preallocated =
5110            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5111
5112        for i in 1..=max_ord {
5113            match i {
5114                3 => {
5115                    if let Some(parents2) = self.parents2.take() {
5116                        ::fidl_next::WireEnvelope::encode_value(
5117                            parents2,
5118                            preallocated.encoder,
5119                            &mut out,
5120                        )?;
5121                    } else {
5122                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5123                    }
5124                }
5125
5126                2 => {
5127                    if let Some(parents) = self.parents.take() {
5128                        ::fidl_next::WireEnvelope::encode_value(
5129                            parents,
5130                            preallocated.encoder,
5131                            &mut out,
5132                        )?;
5133                    } else {
5134                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5135                    }
5136                }
5137
5138                1 => {
5139                    if let Some(name) = self.name.take() {
5140                        ::fidl_next::WireEnvelope::encode_value(
5141                            name,
5142                            preallocated.encoder,
5143                            &mut out,
5144                        )?;
5145                    } else {
5146                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5147                    }
5148                }
5149
5150                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5151            }
5152            unsafe {
5153                preallocated.write_next(out.assume_init_ref());
5154            }
5155        }
5156
5157        ::fidl_next::WireTable::encode_len(table, max_ord);
5158
5159        Ok(())
5160    }
5161}
5162
5163unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CompositeNodeSpec
5164where
5165    ___E: ::fidl_next::Encoder + ?Sized,
5166{
5167    #[inline]
5168    fn encode_ref(
5169        &self,
5170        encoder: &mut ___E,
5171        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5172    ) -> Result<(), ::fidl_next::EncodeError> {
5173        ::fidl_next::munge!(let WireCompositeNodeSpec { table } = out);
5174
5175        let max_ord = self.__max_ordinal();
5176
5177        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5178        ::fidl_next::Wire::zero_padding(&mut out);
5179
5180        let mut preallocated =
5181            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5182
5183        for i in 1..=max_ord {
5184            match i {
5185                3 => {
5186                    if let Some(parents2) = &self.parents2 {
5187                        ::fidl_next::WireEnvelope::encode_value(
5188                            parents2,
5189                            preallocated.encoder,
5190                            &mut out,
5191                        )?;
5192                    } else {
5193                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5194                    }
5195                }
5196
5197                2 => {
5198                    if let Some(parents) = &self.parents {
5199                        ::fidl_next::WireEnvelope::encode_value(
5200                            parents,
5201                            preallocated.encoder,
5202                            &mut out,
5203                        )?;
5204                    } else {
5205                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5206                    }
5207                }
5208
5209                1 => {
5210                    if let Some(name) = &self.name {
5211                        ::fidl_next::WireEnvelope::encode_value(
5212                            name,
5213                            preallocated.encoder,
5214                            &mut out,
5215                        )?;
5216                    } else {
5217                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5218                    }
5219                }
5220
5221                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5222            }
5223            unsafe {
5224                preallocated.write_next(out.assume_init_ref());
5225            }
5226        }
5227
5228        ::fidl_next::WireTable::encode_len(table, max_ord);
5229
5230        Ok(())
5231    }
5232}
5233
5234impl<'de> ::fidl_next::FromWire<WireCompositeNodeSpec<'de>> for CompositeNodeSpec {
5235    #[inline]
5236    fn from_wire(wire: WireCompositeNodeSpec<'de>) -> Self {
5237        let wire = ::core::mem::ManuallyDrop::new(wire);
5238
5239        let name = wire.table.get(1);
5240
5241        let parents = wire.table.get(2);
5242
5243        let parents2 = wire.table.get(3);
5244
5245        Self {
5246
5247
5248                name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
5249                    unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
5250                )),
5251
5252
5253                parents: parents.map(|envelope| ::fidl_next::FromWire::from_wire(
5254                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireParentSpec<'de>>>() }
5255                )),
5256
5257
5258                parents2: parents2.map(|envelope| ::fidl_next::FromWire::from_wire(
5259                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireParentSpec2<'de>>>() }
5260                )),
5261
5262        }
5263    }
5264}
5265
5266impl<'de> ::fidl_next::FromWireRef<WireCompositeNodeSpec<'de>> for CompositeNodeSpec {
5267    #[inline]
5268    fn from_wire_ref(wire: &WireCompositeNodeSpec<'de>) -> Self {
5269        Self {
5270
5271
5272                name: wire.table.get(1)
5273                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5274                        unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
5275                    )),
5276
5277
5278                parents: wire.table.get(2)
5279                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5280                        unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireParentSpec<'de>>>() }
5281                    )),
5282
5283
5284                parents2: wire.table.get(3)
5285                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5286                        unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireParentSpec2<'de>>>() }
5287                    )),
5288
5289        }
5290    }
5291}
5292
5293/// The wire type corresponding to [`CompositeNodeSpec`].
5294#[repr(C)]
5295pub struct WireCompositeNodeSpec<'de> {
5296    table: ::fidl_next::WireTable<'de>,
5297}
5298
5299impl<'de> Drop for WireCompositeNodeSpec<'de> {
5300    fn drop(&mut self) {
5301        let _ = self
5302            .table
5303            .get(1)
5304            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
5305
5306        let _ = self.table.get(2).map(|envelope| unsafe {
5307            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireParentSpec<'de>>>()
5308        });
5309
5310        let _ = self.table.get(3).map(|envelope| unsafe {
5311            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireParentSpec2<'de>>>()
5312        });
5313    }
5314}
5315
5316unsafe impl ::fidl_next::Wire for WireCompositeNodeSpec<'static> {
5317    type Decoded<'de> = WireCompositeNodeSpec<'de>;
5318
5319    #[inline]
5320    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5321        ::fidl_next::munge!(let Self { table } = out);
5322        ::fidl_next::WireTable::zero_padding(table);
5323    }
5324}
5325
5326unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeNodeSpec<'static>
5327where
5328    ___D: ::fidl_next::Decoder + ?Sized,
5329{
5330    fn decode(
5331        slot: ::fidl_next::Slot<'_, Self>,
5332        decoder: &mut ___D,
5333    ) -> Result<(), ::fidl_next::DecodeError> {
5334        ::fidl_next::munge!(let Self { table } = slot);
5335
5336        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5337            match ordinal {
5338                0 => unsafe { ::core::hint::unreachable_unchecked() },
5339
5340                1 => {
5341                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
5342                        slot.as_mut(),
5343                        decoder,
5344                    )?;
5345
5346                    Ok(())
5347                }
5348
5349                2 => {
5350                    ::fidl_next::WireEnvelope::decode_as::<
5351                        ___D,
5352                        ::fidl_next::WireVector<'static, crate::WireParentSpec<'static>>,
5353                    >(slot.as_mut(), decoder)?;
5354
5355                    Ok(())
5356                }
5357
5358                3 => {
5359                    ::fidl_next::WireEnvelope::decode_as::<
5360                        ___D,
5361                        ::fidl_next::WireVector<'static, crate::WireParentSpec2<'static>>,
5362                    >(slot.as_mut(), decoder)?;
5363
5364                    Ok(())
5365                }
5366
5367                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
5368            }
5369        })
5370    }
5371}
5372
5373impl<'de> WireCompositeNodeSpec<'de> {
5374    pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
5375        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5376    }
5377
5378    pub fn parents(&self) -> Option<&::fidl_next::WireVector<'de, crate::WireParentSpec<'de>>> {
5379        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5380    }
5381
5382    pub fn parents2(&self) -> Option<&::fidl_next::WireVector<'de, crate::WireParentSpec2<'de>>> {
5383        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
5384    }
5385}
5386
5387impl<'de> ::core::fmt::Debug for WireCompositeNodeSpec<'de> {
5388    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
5389        f.debug_struct("CompositeNodeSpec")
5390            .field("name", &self.name())
5391            .field("parents", &self.parents())
5392            .field("parents2", &self.parents2())
5393            .finish()
5394    }
5395}
5396
5397#[doc = " Information for a composite that is defined by a composite node spec.\n"]
5398#[derive(Clone, Debug, Default)]
5399pub struct CompositeInfo {
5400    pub spec: Option<crate::CompositeNodeSpec>,
5401
5402    pub matched_driver: Option<crate::CompositeDriverMatch>,
5403}
5404
5405impl CompositeInfo {
5406    fn __max_ordinal(&self) -> usize {
5407        if self.matched_driver.is_some() {
5408            return 2;
5409        }
5410
5411        if self.spec.is_some() {
5412            return 1;
5413        }
5414
5415        0
5416    }
5417}
5418
5419impl ::fidl_next::Encodable for CompositeInfo {
5420    type Encoded = WireCompositeInfo<'static>;
5421}
5422
5423unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeInfo
5424where
5425    ___E: ::fidl_next::Encoder + ?Sized,
5426{
5427    #[inline]
5428    fn encode(
5429        mut self,
5430        encoder: &mut ___E,
5431        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5432    ) -> Result<(), ::fidl_next::EncodeError> {
5433        ::fidl_next::munge!(let WireCompositeInfo { table } = out);
5434
5435        let max_ord = self.__max_ordinal();
5436
5437        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5438        ::fidl_next::Wire::zero_padding(&mut out);
5439
5440        let mut preallocated =
5441            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5442
5443        for i in 1..=max_ord {
5444            match i {
5445                2 => {
5446                    if let Some(matched_driver) = self.matched_driver.take() {
5447                        ::fidl_next::WireEnvelope::encode_value(
5448                            matched_driver,
5449                            preallocated.encoder,
5450                            &mut out,
5451                        )?;
5452                    } else {
5453                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5454                    }
5455                }
5456
5457                1 => {
5458                    if let Some(spec) = self.spec.take() {
5459                        ::fidl_next::WireEnvelope::encode_value(
5460                            spec,
5461                            preallocated.encoder,
5462                            &mut out,
5463                        )?;
5464                    } else {
5465                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5466                    }
5467                }
5468
5469                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5470            }
5471            unsafe {
5472                preallocated.write_next(out.assume_init_ref());
5473            }
5474        }
5475
5476        ::fidl_next::WireTable::encode_len(table, max_ord);
5477
5478        Ok(())
5479    }
5480}
5481
5482unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CompositeInfo
5483where
5484    ___E: ::fidl_next::Encoder + ?Sized,
5485{
5486    #[inline]
5487    fn encode_ref(
5488        &self,
5489        encoder: &mut ___E,
5490        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5491    ) -> Result<(), ::fidl_next::EncodeError> {
5492        ::fidl_next::munge!(let WireCompositeInfo { table } = out);
5493
5494        let max_ord = self.__max_ordinal();
5495
5496        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5497        ::fidl_next::Wire::zero_padding(&mut out);
5498
5499        let mut preallocated =
5500            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5501
5502        for i in 1..=max_ord {
5503            match i {
5504                2 => {
5505                    if let Some(matched_driver) = &self.matched_driver {
5506                        ::fidl_next::WireEnvelope::encode_value(
5507                            matched_driver,
5508                            preallocated.encoder,
5509                            &mut out,
5510                        )?;
5511                    } else {
5512                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5513                    }
5514                }
5515
5516                1 => {
5517                    if let Some(spec) = &self.spec {
5518                        ::fidl_next::WireEnvelope::encode_value(
5519                            spec,
5520                            preallocated.encoder,
5521                            &mut out,
5522                        )?;
5523                    } else {
5524                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5525                    }
5526                }
5527
5528                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5529            }
5530            unsafe {
5531                preallocated.write_next(out.assume_init_ref());
5532            }
5533        }
5534
5535        ::fidl_next::WireTable::encode_len(table, max_ord);
5536
5537        Ok(())
5538    }
5539}
5540
5541impl<'de> ::fidl_next::FromWire<WireCompositeInfo<'de>> for CompositeInfo {
5542    #[inline]
5543    fn from_wire(wire: WireCompositeInfo<'de>) -> Self {
5544        let wire = ::core::mem::ManuallyDrop::new(wire);
5545
5546        let spec = wire.table.get(1);
5547
5548        let matched_driver = wire.table.get(2);
5549
5550        Self {
5551            spec: spec.map(|envelope| {
5552                ::fidl_next::FromWire::from_wire(unsafe {
5553                    envelope.read_unchecked::<crate::WireCompositeNodeSpec<'de>>()
5554                })
5555            }),
5556
5557            matched_driver: matched_driver.map(|envelope| {
5558                ::fidl_next::FromWire::from_wire(unsafe {
5559                    envelope.read_unchecked::<crate::WireCompositeDriverMatch<'de>>()
5560                })
5561            }),
5562        }
5563    }
5564}
5565
5566impl<'de> ::fidl_next::FromWireRef<WireCompositeInfo<'de>> for CompositeInfo {
5567    #[inline]
5568    fn from_wire_ref(wire: &WireCompositeInfo<'de>) -> Self {
5569        Self {
5570            spec: wire.table.get(1).map(|envelope| {
5571                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5572                    envelope.deref_unchecked::<crate::WireCompositeNodeSpec<'de>>()
5573                })
5574            }),
5575
5576            matched_driver: wire.table.get(2).map(|envelope| {
5577                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5578                    envelope.deref_unchecked::<crate::WireCompositeDriverMatch<'de>>()
5579                })
5580            }),
5581        }
5582    }
5583}
5584
5585/// The wire type corresponding to [`CompositeInfo`].
5586#[repr(C)]
5587pub struct WireCompositeInfo<'de> {
5588    table: ::fidl_next::WireTable<'de>,
5589}
5590
5591impl<'de> Drop for WireCompositeInfo<'de> {
5592    fn drop(&mut self) {
5593        let _ = self.table.get(1).map(|envelope| unsafe {
5594            envelope.read_unchecked::<crate::WireCompositeNodeSpec<'de>>()
5595        });
5596
5597        let _ = self.table.get(2).map(|envelope| unsafe {
5598            envelope.read_unchecked::<crate::WireCompositeDriverMatch<'de>>()
5599        });
5600    }
5601}
5602
5603unsafe impl ::fidl_next::Wire for WireCompositeInfo<'static> {
5604    type Decoded<'de> = WireCompositeInfo<'de>;
5605
5606    #[inline]
5607    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5608        ::fidl_next::munge!(let Self { table } = out);
5609        ::fidl_next::WireTable::zero_padding(table);
5610    }
5611}
5612
5613unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeInfo<'static>
5614where
5615    ___D: ::fidl_next::Decoder + ?Sized,
5616{
5617    fn decode(
5618        slot: ::fidl_next::Slot<'_, Self>,
5619        decoder: &mut ___D,
5620    ) -> Result<(), ::fidl_next::DecodeError> {
5621        ::fidl_next::munge!(let Self { table } = slot);
5622
5623        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5624            match ordinal {
5625                0 => unsafe { ::core::hint::unreachable_unchecked() },
5626
5627                1 => {
5628                    ::fidl_next::WireEnvelope::decode_as::<
5629                        ___D,
5630                        crate::WireCompositeNodeSpec<'static>,
5631                    >(slot.as_mut(), decoder)?;
5632
5633                    Ok(())
5634                }
5635
5636                2 => {
5637                    ::fidl_next::WireEnvelope::decode_as::<
5638                        ___D,
5639                        crate::WireCompositeDriverMatch<'static>,
5640                    >(slot.as_mut(), decoder)?;
5641
5642                    Ok(())
5643                }
5644
5645                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
5646            }
5647        })
5648    }
5649}
5650
5651impl<'de> WireCompositeInfo<'de> {
5652    pub fn spec(&self) -> Option<&crate::WireCompositeNodeSpec<'de>> {
5653        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5654    }
5655
5656    pub fn matched_driver(&self) -> Option<&crate::WireCompositeDriverMatch<'de>> {
5657        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5658    }
5659}
5660
5661impl<'de> ::core::fmt::Debug for WireCompositeInfo<'de> {
5662    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
5663        f.debug_struct("CompositeInfo")
5664            .field("spec", &self.spec())
5665            .field("matched_driver", &self.matched_driver())
5666            .finish()
5667    }
5668}
5669
5670pub type CompositeNodeManagerAddSpecResponse = ();
5671
5672/// The wire type corresponding to [`CompositeNodeManagerAddSpecResponse`].
5673pub type WireCompositeNodeManagerAddSpecResponse = ();
5674
5675#[doc = " Error codes for the CompositeNodeManager protocol.\n"]
5676#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5677#[repr(u32)]
5678pub enum CompositeNodeSpecError {
5679    MissingArgs = 1,
5680    EmptyNodes = 2,
5681    AlreadyExists = 3,
5682    DriverIndexFailure = 4,
5683    DuplicateParents = 5,
5684    UnknownOrdinal_(u32),
5685}
5686
5687impl ::fidl_next::Encodable for CompositeNodeSpecError {
5688    type Encoded = WireCompositeNodeSpecError;
5689}
5690impl ::std::convert::From<u32> for CompositeNodeSpecError {
5691    fn from(value: u32) -> Self {
5692        match value {
5693            1 => Self::MissingArgs,
5694            2 => Self::EmptyNodes,
5695            3 => Self::AlreadyExists,
5696            4 => Self::DriverIndexFailure,
5697            5 => Self::DuplicateParents,
5698
5699            _ => Self::UnknownOrdinal_(value),
5700        }
5701    }
5702}
5703
5704unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeNodeSpecError
5705where
5706    ___E: ?Sized,
5707{
5708    #[inline]
5709    fn encode(
5710        self,
5711        encoder: &mut ___E,
5712        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5713    ) -> Result<(), ::fidl_next::EncodeError> {
5714        ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
5715    }
5716}
5717
5718unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CompositeNodeSpecError
5719where
5720    ___E: ?Sized,
5721{
5722    #[inline]
5723    fn encode_ref(
5724        &self,
5725        encoder: &mut ___E,
5726        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5727    ) -> Result<(), ::fidl_next::EncodeError> {
5728        ::fidl_next::munge!(let WireCompositeNodeSpecError { value } = out);
5729        let _ = value.write(::fidl_next::WireU32::from(match *self {
5730            Self::MissingArgs => 1,
5731
5732            Self::EmptyNodes => 2,
5733
5734            Self::AlreadyExists => 3,
5735
5736            Self::DriverIndexFailure => 4,
5737
5738            Self::DuplicateParents => 5,
5739
5740            Self::UnknownOrdinal_(value) => value,
5741        }));
5742
5743        Ok(())
5744    }
5745}
5746
5747impl ::core::convert::From<WireCompositeNodeSpecError> for CompositeNodeSpecError {
5748    fn from(wire: WireCompositeNodeSpecError) -> Self {
5749        match u32::from(wire.value) {
5750            1 => Self::MissingArgs,
5751
5752            2 => Self::EmptyNodes,
5753
5754            3 => Self::AlreadyExists,
5755
5756            4 => Self::DriverIndexFailure,
5757
5758            5 => Self::DuplicateParents,
5759
5760            value => Self::UnknownOrdinal_(value),
5761        }
5762    }
5763}
5764
5765impl ::fidl_next::FromWire<WireCompositeNodeSpecError> for CompositeNodeSpecError {
5766    #[inline]
5767    fn from_wire(wire: WireCompositeNodeSpecError) -> Self {
5768        Self::from(wire)
5769    }
5770}
5771
5772impl ::fidl_next::FromWireRef<WireCompositeNodeSpecError> for CompositeNodeSpecError {
5773    #[inline]
5774    fn from_wire_ref(wire: &WireCompositeNodeSpecError) -> Self {
5775        Self::from(*wire)
5776    }
5777}
5778
5779/// The wire type corresponding to [`CompositeNodeSpecError`].
5780#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5781#[repr(transparent)]
5782pub struct WireCompositeNodeSpecError {
5783    value: ::fidl_next::WireU32,
5784}
5785
5786unsafe impl ::fidl_next::Wire for WireCompositeNodeSpecError {
5787    type Decoded<'de> = Self;
5788
5789    #[inline]
5790    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5791        // Wire enums have no padding
5792    }
5793}
5794
5795impl WireCompositeNodeSpecError {
5796    pub const MISSING_ARGS: WireCompositeNodeSpecError =
5797        WireCompositeNodeSpecError { value: ::fidl_next::WireU32(1) };
5798
5799    pub const EMPTY_NODES: WireCompositeNodeSpecError =
5800        WireCompositeNodeSpecError { value: ::fidl_next::WireU32(2) };
5801
5802    pub const ALREADY_EXISTS: WireCompositeNodeSpecError =
5803        WireCompositeNodeSpecError { value: ::fidl_next::WireU32(3) };
5804
5805    pub const DRIVER_INDEX_FAILURE: WireCompositeNodeSpecError =
5806        WireCompositeNodeSpecError { value: ::fidl_next::WireU32(4) };
5807
5808    pub const DUPLICATE_PARENTS: WireCompositeNodeSpecError =
5809        WireCompositeNodeSpecError { value: ::fidl_next::WireU32(5) };
5810}
5811
5812unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeNodeSpecError
5813where
5814    ___D: ?Sized,
5815{
5816    fn decode(
5817        slot: ::fidl_next::Slot<'_, Self>,
5818        _: &mut ___D,
5819    ) -> Result<(), ::fidl_next::DecodeError> {
5820        Ok(())
5821    }
5822}
5823
5824impl ::core::convert::From<CompositeNodeSpecError> for WireCompositeNodeSpecError {
5825    fn from(natural: CompositeNodeSpecError) -> Self {
5826        match natural {
5827            CompositeNodeSpecError::MissingArgs => WireCompositeNodeSpecError::MISSING_ARGS,
5828
5829            CompositeNodeSpecError::EmptyNodes => WireCompositeNodeSpecError::EMPTY_NODES,
5830
5831            CompositeNodeSpecError::AlreadyExists => WireCompositeNodeSpecError::ALREADY_EXISTS,
5832
5833            CompositeNodeSpecError::DriverIndexFailure => {
5834                WireCompositeNodeSpecError::DRIVER_INDEX_FAILURE
5835            }
5836
5837            CompositeNodeSpecError::DuplicateParents => {
5838                WireCompositeNodeSpecError::DUPLICATE_PARENTS
5839            }
5840
5841            CompositeNodeSpecError::UnknownOrdinal_(value) => {
5842                WireCompositeNodeSpecError { value: ::fidl_next::WireU32::from(value) }
5843            }
5844        }
5845    }
5846}
5847
5848/// The type corresponding to the CompositeNodeManager protocol.
5849#[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"]
5850#[derive(Debug)]
5851pub struct CompositeNodeManager;
5852
5853impl ::fidl_next::Discoverable for CompositeNodeManager {
5854    const PROTOCOL_NAME: &'static str = "fuchsia.driver.framework.CompositeNodeManager";
5855}
5856
5857pub mod composite_node_manager {
5858    pub mod prelude {
5859        pub use crate::{
5860            CompositeNodeManager, CompositeNodeManagerClientHandler,
5861            CompositeNodeManagerServerHandler, composite_node_manager,
5862        };
5863
5864        pub use crate::CompositeNodeManagerAddSpecResponse;
5865
5866        pub use crate::CompositeNodeSpec;
5867
5868        pub use crate::CompositeNodeSpecError;
5869    }
5870
5871    pub struct AddSpec;
5872
5873    impl ::fidl_next::Method for AddSpec {
5874        const ORDINAL: u64 = 5930736293275290740;
5875
5876        type Protocol = crate::CompositeNodeManager;
5877
5878        type Request = crate::WireCompositeNodeSpec<'static>;
5879
5880        type Response = ::fidl_next::WireFlexibleResult<
5881            'static,
5882            crate::WireCompositeNodeManagerAddSpecResponse,
5883            crate::WireCompositeNodeSpecError,
5884        >;
5885    }
5886
5887    mod ___detail {
5888
5889        unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::CompositeNodeManager
5890        where
5891            ___T: ::fidl_next::Transport,
5892        {
5893            type ClientSender = CompositeNodeManagerClientSender<___T>;
5894            type ServerSender = CompositeNodeManagerServerSender<___T>;
5895        }
5896
5897        /// The client sender for the `CompositeNodeManager` protocol.
5898        #[repr(transparent)]
5899        pub struct CompositeNodeManagerClientSender<___T: ::fidl_next::Transport> {
5900            #[allow(dead_code)]
5901            sender: ::fidl_next::protocol::ClientSender<___T>,
5902        }
5903
5904        impl<___T> CompositeNodeManagerClientSender<___T>
5905        where
5906            ___T: ::fidl_next::Transport,
5907        {
5908            #[doc = " Adds the given composite node specification to the driver framework.\n"]
5909            pub fn add_spec_with<___R>(
5910                &self,
5911                request: ___R,
5912            ) -> ::fidl_next::TwoWayFuture<'_, super::AddSpec, ___T>
5913            where
5914                ___R: ::fidl_next::Encode<
5915                        <___T as ::fidl_next::Transport>::SendBuffer,
5916                        Encoded = crate::WireCompositeNodeSpec<'static>,
5917                    >,
5918            {
5919                ::fidl_next::TwoWayFuture::from_untyped(
5920                    self.sender.send_two_way(5930736293275290740, request),
5921                )
5922            }
5923        }
5924
5925        /// The server sender for the `CompositeNodeManager` protocol.
5926        #[repr(transparent)]
5927        pub struct CompositeNodeManagerServerSender<___T: ::fidl_next::Transport> {
5928            sender: ::fidl_next::protocol::ServerSender<___T>,
5929        }
5930
5931        impl<___T> CompositeNodeManagerServerSender<___T> where ___T: ::fidl_next::Transport {}
5932    }
5933}
5934
5935/// A client handler for the CompositeNodeManager protocol.
5936///
5937/// See [`CompositeNodeManager`] for more details.
5938pub trait CompositeNodeManagerClientHandler<
5939    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
5940    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5941>
5942{
5943    fn on_unknown_interaction(
5944        &mut self,
5945        sender: &::fidl_next::ClientSender<CompositeNodeManager, ___T>,
5946        ordinal: u64,
5947    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
5948        sender.close();
5949        ::core::future::ready(())
5950    }
5951}
5952
5953impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for CompositeNodeManager
5954where
5955    ___H: CompositeNodeManagerClientHandler<___T> + ::core::marker::Send,
5956    ___T: ::fidl_next::Transport,
5957    <composite_node_manager::AddSpec as ::fidl_next::Method>::Response:
5958        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
5959{
5960    async fn on_event(
5961        handler: &mut ___H,
5962        sender: &::fidl_next::ClientSender<Self, ___T>,
5963        ordinal: u64,
5964        buffer: ___T::RecvBuffer,
5965    ) {
5966        match ordinal {
5967            ordinal => handler.on_unknown_interaction(sender, ordinal).await,
5968        }
5969    }
5970}
5971
5972/// A server handler for the CompositeNodeManager protocol.
5973///
5974/// See [`CompositeNodeManager`] for more details.
5975pub trait CompositeNodeManagerServerHandler<
5976    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
5977    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5978>
5979{
5980    #[doc = " Adds the given composite node specification to the driver framework.\n"]
5981    fn add_spec(
5982        &mut self,
5983        sender: &::fidl_next::ServerSender<CompositeNodeManager, ___T>,
5984
5985        request: ::fidl_next::Request<composite_node_manager::AddSpec, ___T>,
5986
5987        responder: ::fidl_next::Responder<composite_node_manager::AddSpec>,
5988    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
5989
5990    fn on_unknown_interaction(
5991        &mut self,
5992        sender: &::fidl_next::ServerSender<CompositeNodeManager, ___T>,
5993        ordinal: u64,
5994    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
5995        sender.close();
5996        ::core::future::ready(())
5997    }
5998}
5999
6000impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for CompositeNodeManager
6001where
6002    ___H: CompositeNodeManagerServerHandler<___T> + ::core::marker::Send,
6003    ___T: ::fidl_next::Transport,
6004    <composite_node_manager::AddSpec as ::fidl_next::Method>::Request:
6005        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6006{
6007    async fn on_one_way(
6008        handler: &mut ___H,
6009        sender: &::fidl_next::ServerSender<Self, ___T>,
6010        ordinal: u64,
6011        buffer: ___T::RecvBuffer,
6012    ) {
6013        match ordinal {
6014            ordinal => handler.on_unknown_interaction(sender, ordinal).await,
6015        }
6016    }
6017
6018    async fn on_two_way(
6019        handler: &mut ___H,
6020        sender: &::fidl_next::ServerSender<Self, ___T>,
6021        ordinal: u64,
6022        buffer: ___T::RecvBuffer,
6023        responder: ::fidl_next::protocol::Responder,
6024    ) {
6025        match ordinal {
6026            5930736293275290740 => {
6027                let responder = ::fidl_next::Responder::from_untyped(responder);
6028
6029                match ::fidl_next::DecoderExt::decode(buffer) {
6030                    Ok(decoded) => handler.add_spec(sender, decoded, responder).await,
6031                    Err(e) => sender.close(),
6032                }
6033            }
6034
6035            ordinal => handler.on_unknown_interaction(sender, ordinal).await,
6036        }
6037    }
6038}
6039
6040#[doc = " A parent to a composite that is defined by a composite node spec.\n"]
6041#[derive(Clone, Debug, Default)]
6042pub struct CompositeParent {
6043    pub composite: Option<crate::CompositeInfo>,
6044
6045    pub index: Option<u32>,
6046}
6047
6048impl CompositeParent {
6049    fn __max_ordinal(&self) -> usize {
6050        if self.index.is_some() {
6051            return 2;
6052        }
6053
6054        if self.composite.is_some() {
6055            return 1;
6056        }
6057
6058        0
6059    }
6060}
6061
6062impl ::fidl_next::Encodable for CompositeParent {
6063    type Encoded = WireCompositeParent<'static>;
6064}
6065
6066unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeParent
6067where
6068    ___E: ::fidl_next::Encoder + ?Sized,
6069{
6070    #[inline]
6071    fn encode(
6072        mut self,
6073        encoder: &mut ___E,
6074        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6075    ) -> Result<(), ::fidl_next::EncodeError> {
6076        ::fidl_next::munge!(let WireCompositeParent { table } = out);
6077
6078        let max_ord = self.__max_ordinal();
6079
6080        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
6081        ::fidl_next::Wire::zero_padding(&mut out);
6082
6083        let mut preallocated =
6084            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
6085
6086        for i in 1..=max_ord {
6087            match i {
6088                2 => {
6089                    if let Some(index) = self.index.take() {
6090                        ::fidl_next::WireEnvelope::encode_value(
6091                            index,
6092                            preallocated.encoder,
6093                            &mut out,
6094                        )?;
6095                    } else {
6096                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6097                    }
6098                }
6099
6100                1 => {
6101                    if let Some(composite) = self.composite.take() {
6102                        ::fidl_next::WireEnvelope::encode_value(
6103                            composite,
6104                            preallocated.encoder,
6105                            &mut out,
6106                        )?;
6107                    } else {
6108                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6109                    }
6110                }
6111
6112                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
6113            }
6114            unsafe {
6115                preallocated.write_next(out.assume_init_ref());
6116            }
6117        }
6118
6119        ::fidl_next::WireTable::encode_len(table, max_ord);
6120
6121        Ok(())
6122    }
6123}
6124
6125unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CompositeParent
6126where
6127    ___E: ::fidl_next::Encoder + ?Sized,
6128{
6129    #[inline]
6130    fn encode_ref(
6131        &self,
6132        encoder: &mut ___E,
6133        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6134    ) -> Result<(), ::fidl_next::EncodeError> {
6135        ::fidl_next::munge!(let WireCompositeParent { table } = out);
6136
6137        let max_ord = self.__max_ordinal();
6138
6139        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
6140        ::fidl_next::Wire::zero_padding(&mut out);
6141
6142        let mut preallocated =
6143            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
6144
6145        for i in 1..=max_ord {
6146            match i {
6147                2 => {
6148                    if let Some(index) = &self.index {
6149                        ::fidl_next::WireEnvelope::encode_value(
6150                            index,
6151                            preallocated.encoder,
6152                            &mut out,
6153                        )?;
6154                    } else {
6155                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6156                    }
6157                }
6158
6159                1 => {
6160                    if let Some(composite) = &self.composite {
6161                        ::fidl_next::WireEnvelope::encode_value(
6162                            composite,
6163                            preallocated.encoder,
6164                            &mut out,
6165                        )?;
6166                    } else {
6167                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6168                    }
6169                }
6170
6171                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
6172            }
6173            unsafe {
6174                preallocated.write_next(out.assume_init_ref());
6175            }
6176        }
6177
6178        ::fidl_next::WireTable::encode_len(table, max_ord);
6179
6180        Ok(())
6181    }
6182}
6183
6184impl<'de> ::fidl_next::FromWire<WireCompositeParent<'de>> for CompositeParent {
6185    #[inline]
6186    fn from_wire(wire: WireCompositeParent<'de>) -> Self {
6187        let wire = ::core::mem::ManuallyDrop::new(wire);
6188
6189        let composite = wire.table.get(1);
6190
6191        let index = wire.table.get(2);
6192
6193        Self {
6194            composite: composite.map(|envelope| {
6195                ::fidl_next::FromWire::from_wire(unsafe {
6196                    envelope.read_unchecked::<crate::WireCompositeInfo<'de>>()
6197                })
6198            }),
6199
6200            index: index.map(|envelope| {
6201                ::fidl_next::FromWire::from_wire(unsafe {
6202                    envelope.read_unchecked::<::fidl_next::WireU32>()
6203                })
6204            }),
6205        }
6206    }
6207}
6208
6209impl<'de> ::fidl_next::FromWireRef<WireCompositeParent<'de>> for CompositeParent {
6210    #[inline]
6211    fn from_wire_ref(wire: &WireCompositeParent<'de>) -> Self {
6212        Self {
6213            composite: wire.table.get(1).map(|envelope| {
6214                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6215                    envelope.deref_unchecked::<crate::WireCompositeInfo<'de>>()
6216                })
6217            }),
6218
6219            index: wire.table.get(2).map(|envelope| {
6220                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6221                    envelope.deref_unchecked::<::fidl_next::WireU32>()
6222                })
6223            }),
6224        }
6225    }
6226}
6227
6228/// The wire type corresponding to [`CompositeParent`].
6229#[repr(C)]
6230pub struct WireCompositeParent<'de> {
6231    table: ::fidl_next::WireTable<'de>,
6232}
6233
6234impl<'de> Drop for WireCompositeParent<'de> {
6235    fn drop(&mut self) {
6236        let _ = self
6237            .table
6238            .get(1)
6239            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireCompositeInfo<'de>>() });
6240
6241        let _ = self
6242            .table
6243            .get(2)
6244            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
6245    }
6246}
6247
6248unsafe impl ::fidl_next::Wire for WireCompositeParent<'static> {
6249    type Decoded<'de> = WireCompositeParent<'de>;
6250
6251    #[inline]
6252    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6253        ::fidl_next::munge!(let Self { table } = out);
6254        ::fidl_next::WireTable::zero_padding(table);
6255    }
6256}
6257
6258unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeParent<'static>
6259where
6260    ___D: ::fidl_next::Decoder + ?Sized,
6261{
6262    fn decode(
6263        slot: ::fidl_next::Slot<'_, Self>,
6264        decoder: &mut ___D,
6265    ) -> Result<(), ::fidl_next::DecodeError> {
6266        ::fidl_next::munge!(let Self { table } = slot);
6267
6268        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6269            match ordinal {
6270                0 => unsafe { ::core::hint::unreachable_unchecked() },
6271
6272                1 => {
6273                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireCompositeInfo<'static>>(
6274                        slot.as_mut(),
6275                        decoder,
6276                    )?;
6277
6278                    Ok(())
6279                }
6280
6281                2 => {
6282                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
6283                        slot.as_mut(),
6284                        decoder,
6285                    )?;
6286
6287                    Ok(())
6288                }
6289
6290                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
6291            }
6292        })
6293    }
6294}
6295
6296impl<'de> WireCompositeParent<'de> {
6297    pub fn composite(&self) -> Option<&crate::WireCompositeInfo<'de>> {
6298        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6299    }
6300
6301    pub fn index(&self) -> Option<&::fidl_next::WireU32> {
6302        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
6303    }
6304}
6305
6306impl<'de> ::core::fmt::Debug for WireCompositeParent<'de> {
6307    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
6308        f.debug_struct("CompositeParent")
6309            .field("composite", &self.composite())
6310            .field("index", &self.index())
6311            .finish()
6312    }
6313}
6314
6315#[derive(Debug, Default)]
6316pub struct DevfsAddArgs {
6317    pub connector: Option<
6318        ::fidl_next::ClientEnd<
6319            ::fidl_next_fuchsia_device_fs::Connector,
6320            ::fidl_next::fuchsia::zx::Channel,
6321        >,
6322    >,
6323
6324    pub class_name: Option<String>,
6325
6326    pub inspect: Option<::fidl_next::fuchsia::zx::Vmo>,
6327
6328    pub connector_supports: Option<::fidl_next_fuchsia_device_fs::ConnectionType>,
6329
6330    pub controller_connector: Option<
6331        ::fidl_next::ClientEnd<
6332            ::fidl_next_fuchsia_device_fs::Connector,
6333            ::fidl_next::fuchsia::zx::Channel,
6334        >,
6335    >,
6336}
6337
6338impl DevfsAddArgs {
6339    fn __max_ordinal(&self) -> usize {
6340        if self.controller_connector.is_some() {
6341            return 5;
6342        }
6343
6344        if self.connector_supports.is_some() {
6345            return 4;
6346        }
6347
6348        if self.inspect.is_some() {
6349            return 3;
6350        }
6351
6352        if self.class_name.is_some() {
6353            return 2;
6354        }
6355
6356        if self.connector.is_some() {
6357            return 1;
6358        }
6359
6360        0
6361    }
6362}
6363
6364impl ::fidl_next::Encodable for DevfsAddArgs {
6365    type Encoded = WireDevfsAddArgs<'static>;
6366}
6367
6368unsafe impl<___E> ::fidl_next::Encode<___E> for DevfsAddArgs
6369where
6370    ___E: ::fidl_next::Encoder + ?Sized,
6371    ___E: ::fidl_next::fuchsia::HandleEncoder,
6372{
6373    #[inline]
6374    fn encode(
6375        mut self,
6376        encoder: &mut ___E,
6377        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6378    ) -> Result<(), ::fidl_next::EncodeError> {
6379        ::fidl_next::munge!(let WireDevfsAddArgs { table } = out);
6380
6381        let max_ord = self.__max_ordinal();
6382
6383        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
6384        ::fidl_next::Wire::zero_padding(&mut out);
6385
6386        let mut preallocated =
6387            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
6388
6389        for i in 1..=max_ord {
6390            match i {
6391                5 => {
6392                    if let Some(controller_connector) = self.controller_connector.take() {
6393                        ::fidl_next::WireEnvelope::encode_value(
6394                            controller_connector,
6395                            preallocated.encoder,
6396                            &mut out,
6397                        )?;
6398                    } else {
6399                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6400                    }
6401                }
6402
6403                4 => {
6404                    if let Some(connector_supports) = self.connector_supports.take() {
6405                        ::fidl_next::WireEnvelope::encode_value(
6406                            connector_supports,
6407                            preallocated.encoder,
6408                            &mut out,
6409                        )?;
6410                    } else {
6411                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6412                    }
6413                }
6414
6415                3 => {
6416                    if let Some(inspect) = self.inspect.take() {
6417                        ::fidl_next::WireEnvelope::encode_value(
6418                            inspect,
6419                            preallocated.encoder,
6420                            &mut out,
6421                        )?;
6422                    } else {
6423                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6424                    }
6425                }
6426
6427                2 => {
6428                    if let Some(class_name) = self.class_name.take() {
6429                        ::fidl_next::WireEnvelope::encode_value(
6430                            class_name,
6431                            preallocated.encoder,
6432                            &mut out,
6433                        )?;
6434                    } else {
6435                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6436                    }
6437                }
6438
6439                1 => {
6440                    if let Some(connector) = self.connector.take() {
6441                        ::fidl_next::WireEnvelope::encode_value(
6442                            connector,
6443                            preallocated.encoder,
6444                            &mut out,
6445                        )?;
6446                    } else {
6447                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6448                    }
6449                }
6450
6451                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
6452            }
6453            unsafe {
6454                preallocated.write_next(out.assume_init_ref());
6455            }
6456        }
6457
6458        ::fidl_next::WireTable::encode_len(table, max_ord);
6459
6460        Ok(())
6461    }
6462}
6463
6464impl<'de> ::fidl_next::FromWire<WireDevfsAddArgs<'de>> for DevfsAddArgs {
6465    #[inline]
6466    fn from_wire(wire: WireDevfsAddArgs<'de>) -> Self {
6467        let wire = ::core::mem::ManuallyDrop::new(wire);
6468
6469        let connector = wire.table.get(1);
6470
6471        let class_name = wire.table.get(2);
6472
6473        let inspect = wire.table.get(3);
6474
6475        let connector_supports = wire.table.get(4);
6476
6477        let controller_connector = wire.table.get(5);
6478
6479        Self {
6480            connector: connector.map(|envelope| {
6481                ::fidl_next::FromWire::from_wire(unsafe {
6482                    envelope.read_unchecked::<::fidl_next::ClientEnd<
6483                        ::fidl_next_fuchsia_device_fs::Connector,
6484                        ::fidl_next::fuchsia::WireChannel,
6485                    >>()
6486                })
6487            }),
6488
6489            class_name: class_name.map(|envelope| {
6490                ::fidl_next::FromWire::from_wire(unsafe {
6491                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
6492                })
6493            }),
6494
6495            inspect: inspect.map(|envelope| {
6496                ::fidl_next::FromWire::from_wire(unsafe {
6497                    envelope.read_unchecked::<::fidl_next::fuchsia::WireVmo>()
6498                })
6499            }),
6500
6501            connector_supports: connector_supports.map(|envelope| {
6502                ::fidl_next::FromWire::from_wire(unsafe {
6503                    envelope.read_unchecked::<::fidl_next_fuchsia_device_fs::WireConnectionType>()
6504                })
6505            }),
6506
6507            controller_connector: controller_connector.map(|envelope| {
6508                ::fidl_next::FromWire::from_wire(unsafe {
6509                    envelope.read_unchecked::<::fidl_next::ClientEnd<
6510                        ::fidl_next_fuchsia_device_fs::Connector,
6511                        ::fidl_next::fuchsia::WireChannel,
6512                    >>()
6513                })
6514            }),
6515        }
6516    }
6517}
6518
6519/// The wire type corresponding to [`DevfsAddArgs`].
6520#[repr(C)]
6521pub struct WireDevfsAddArgs<'de> {
6522    table: ::fidl_next::WireTable<'de>,
6523}
6524
6525impl<'de> Drop for WireDevfsAddArgs<'de> {
6526    fn drop(&mut self) {
6527        let _ = self.table.get(1).map(|envelope| unsafe {
6528            envelope.read_unchecked::<::fidl_next::ClientEnd<
6529                ::fidl_next_fuchsia_device_fs::Connector,
6530                ::fidl_next::fuchsia::WireChannel,
6531            >>()
6532        });
6533
6534        let _ = self
6535            .table
6536            .get(2)
6537            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
6538
6539        let _ = self
6540            .table
6541            .get(3)
6542            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::fuchsia::WireVmo>() });
6543
6544        let _ = self.table.get(4).map(|envelope| unsafe {
6545            envelope.read_unchecked::<::fidl_next_fuchsia_device_fs::WireConnectionType>()
6546        });
6547
6548        let _ = self.table.get(5).map(|envelope| unsafe {
6549            envelope.read_unchecked::<::fidl_next::ClientEnd<
6550                ::fidl_next_fuchsia_device_fs::Connector,
6551                ::fidl_next::fuchsia::WireChannel,
6552            >>()
6553        });
6554    }
6555}
6556
6557unsafe impl ::fidl_next::Wire for WireDevfsAddArgs<'static> {
6558    type Decoded<'de> = WireDevfsAddArgs<'de>;
6559
6560    #[inline]
6561    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6562        ::fidl_next::munge!(let Self { table } = out);
6563        ::fidl_next::WireTable::zero_padding(table);
6564    }
6565}
6566
6567unsafe impl<___D> ::fidl_next::Decode<___D> for WireDevfsAddArgs<'static>
6568where
6569    ___D: ::fidl_next::Decoder + ?Sized,
6570    ___D: ::fidl_next::fuchsia::HandleDecoder,
6571{
6572    fn decode(
6573        slot: ::fidl_next::Slot<'_, Self>,
6574        decoder: &mut ___D,
6575    ) -> Result<(), ::fidl_next::DecodeError> {
6576        ::fidl_next::munge!(let Self { table } = slot);
6577
6578        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6579            match ordinal {
6580                0 => unsafe { ::core::hint::unreachable_unchecked() },
6581
6582                1 => {
6583                    ::fidl_next::WireEnvelope::decode_as::<
6584                        ___D,
6585                        ::fidl_next::ClientEnd<
6586                            ::fidl_next_fuchsia_device_fs::Connector,
6587                            ::fidl_next::fuchsia::WireChannel,
6588                        >,
6589                    >(slot.as_mut(), decoder)?;
6590
6591                    Ok(())
6592                }
6593
6594                2 => {
6595                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
6596                        slot.as_mut(),
6597                        decoder,
6598                    )?;
6599
6600                    let class_name = unsafe {
6601                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
6602                    };
6603
6604                    if class_name.len() > 255 {
6605                        return Err(::fidl_next::DecodeError::VectorTooLong {
6606                            size: class_name.len() as u64,
6607                            limit: 255,
6608                        });
6609                    }
6610
6611                    Ok(())
6612                }
6613
6614                3 => {
6615                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireVmo>(
6616                        slot.as_mut(),
6617                        decoder,
6618                    )?;
6619
6620                    Ok(())
6621                }
6622
6623                4 => {
6624                    ::fidl_next::WireEnvelope::decode_as::<
6625                        ___D,
6626                        ::fidl_next_fuchsia_device_fs::WireConnectionType,
6627                    >(slot.as_mut(), decoder)?;
6628
6629                    Ok(())
6630                }
6631
6632                5 => {
6633                    ::fidl_next::WireEnvelope::decode_as::<
6634                        ___D,
6635                        ::fidl_next::ClientEnd<
6636                            ::fidl_next_fuchsia_device_fs::Connector,
6637                            ::fidl_next::fuchsia::WireChannel,
6638                        >,
6639                    >(slot.as_mut(), decoder)?;
6640
6641                    Ok(())
6642                }
6643
6644                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
6645            }
6646        })
6647    }
6648}
6649
6650impl<'de> WireDevfsAddArgs<'de> {
6651    pub fn connector(
6652        &self,
6653    ) -> Option<
6654        &::fidl_next::ClientEnd<
6655            ::fidl_next_fuchsia_device_fs::Connector,
6656            ::fidl_next::fuchsia::WireChannel,
6657        >,
6658    > {
6659        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6660    }
6661
6662    pub fn class_name(&self) -> Option<&::fidl_next::WireString<'de>> {
6663        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
6664    }
6665
6666    pub fn inspect(&self) -> Option<&::fidl_next::fuchsia::WireVmo> {
6667        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
6668    }
6669
6670    pub fn connector_supports(&self) -> Option<&::fidl_next_fuchsia_device_fs::WireConnectionType> {
6671        unsafe { Some(self.table.get(4)?.deref_unchecked()) }
6672    }
6673
6674    pub fn controller_connector(
6675        &self,
6676    ) -> Option<
6677        &::fidl_next::ClientEnd<
6678            ::fidl_next_fuchsia_device_fs::Connector,
6679            ::fidl_next::fuchsia::WireChannel,
6680        >,
6681    > {
6682        unsafe { Some(self.table.get(5)?.deref_unchecked()) }
6683    }
6684}
6685
6686impl<'de> ::core::fmt::Debug for WireDevfsAddArgs<'de> {
6687    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
6688        f.debug_struct("DevfsAddArgs")
6689            .field("connector", &self.connector())
6690            .field("class_name", &self.class_name())
6691            .field("inspect", &self.inspect())
6692            .field("connector_supports", &self.connector_supports())
6693            .field("controller_connector", &self.controller_connector())
6694            .finish()
6695    }
6696}
6697
6698pub const MAX_SYMBOL_NAME_LENGTH: u8 = 128;
6699
6700pub const MAX_SYMBOL_COUNT: u8 = 64;
6701
6702pub const MAX_NAMESPACE_COUNT: u32 = 32;
6703
6704pub type DriverStartResponse = ();
6705
6706/// The wire type corresponding to [`DriverStartResponse`].
6707pub type WireDriverStartResponse = ();
6708
6709pub const MAX_NODE_NAME_LENGTH: u8 = 128;
6710
6711pub type NodeName = String;
6712
6713/// The wire type corresponding to [`NodeName`].
6714pub type WireNodeName<'de> = ::fidl_next::WireString<'de>;
6715
6716pub type NodePropertyVector = Vec<crate::NodeProperty>;
6717
6718/// The wire type corresponding to [`NodePropertyVector`].
6719pub type WireNodePropertyVector<'de> = ::fidl_next::WireVector<'de, crate::WireNodeProperty<'de>>;
6720
6721pub const MAX_OFFER_COUNT: u32 = 128;
6722
6723#[doc = " Contains the node properties that belong to a node.\n"]
6724#[derive(Clone, Debug)]
6725pub struct NodePropertyEntry {
6726    pub name: String,
6727
6728    pub properties: Vec<crate::NodeProperty>,
6729}
6730
6731impl ::fidl_next::Encodable for NodePropertyEntry {
6732    type Encoded = WireNodePropertyEntry<'static>;
6733}
6734
6735unsafe impl<___E> ::fidl_next::Encode<___E> for NodePropertyEntry
6736where
6737    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6738    ___E: ::fidl_next::Encoder,
6739{
6740    #[inline]
6741    fn encode(
6742        self,
6743        encoder: &mut ___E,
6744        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6745    ) -> Result<(), ::fidl_next::EncodeError> {
6746        ::fidl_next::munge! {
6747            let Self::Encoded {
6748                name,
6749                properties,
6750
6751            } = out;
6752        }
6753
6754        ::fidl_next::Encode::encode(self.name, encoder, name)?;
6755
6756        ::fidl_next::Encode::encode(self.properties, encoder, properties)?;
6757
6758        Ok(())
6759    }
6760}
6761
6762unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodePropertyEntry
6763where
6764    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6765    ___E: ::fidl_next::Encoder,
6766{
6767    #[inline]
6768    fn encode_ref(
6769        &self,
6770        encoder: &mut ___E,
6771        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6772    ) -> Result<(), ::fidl_next::EncodeError> {
6773        ::fidl_next::munge! {
6774            let Self::Encoded {
6775                name,
6776                properties,
6777
6778            } = out;
6779        }
6780
6781        ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
6782
6783        ::fidl_next::EncodeRef::encode_ref(&self.properties, encoder, properties)?;
6784
6785        Ok(())
6786    }
6787}
6788
6789impl ::fidl_next::EncodableOption for NodePropertyEntry {
6790    type EncodedOption = ::fidl_next::WireBox<'static, WireNodePropertyEntry<'static>>;
6791}
6792
6793unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodePropertyEntry
6794where
6795    ___E: ::fidl_next::Encoder + ?Sized,
6796    NodePropertyEntry: ::fidl_next::Encode<___E>,
6797{
6798    #[inline]
6799    fn encode_option(
6800        this: Option<Self>,
6801        encoder: &mut ___E,
6802        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6803    ) -> Result<(), ::fidl_next::EncodeError> {
6804        if let Some(inner) = this {
6805            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6806            ::fidl_next::WireBox::encode_present(out);
6807        } else {
6808            ::fidl_next::WireBox::encode_absent(out);
6809        }
6810
6811        Ok(())
6812    }
6813}
6814
6815unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodePropertyEntry
6816where
6817    ___E: ::fidl_next::Encoder + ?Sized,
6818    NodePropertyEntry: ::fidl_next::EncodeRef<___E>,
6819{
6820    #[inline]
6821    fn encode_option_ref(
6822        this: Option<&Self>,
6823        encoder: &mut ___E,
6824        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6825    ) -> Result<(), ::fidl_next::EncodeError> {
6826        if let Some(inner) = this {
6827            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6828            ::fidl_next::WireBox::encode_present(out);
6829        } else {
6830            ::fidl_next::WireBox::encode_absent(out);
6831        }
6832
6833        Ok(())
6834    }
6835}
6836
6837impl<'de> ::fidl_next::FromWire<WireNodePropertyEntry<'de>> for NodePropertyEntry {
6838    #[inline]
6839    fn from_wire(wire: WireNodePropertyEntry<'de>) -> Self {
6840        Self {
6841            name: ::fidl_next::FromWire::from_wire(wire.name),
6842
6843            properties: ::fidl_next::FromWire::from_wire(wire.properties),
6844        }
6845    }
6846}
6847
6848impl<'de> ::fidl_next::FromWireRef<WireNodePropertyEntry<'de>> for NodePropertyEntry {
6849    #[inline]
6850    fn from_wire_ref(wire: &WireNodePropertyEntry<'de>) -> Self {
6851        Self {
6852            name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
6853
6854            properties: ::fidl_next::FromWireRef::from_wire_ref(&wire.properties),
6855        }
6856    }
6857}
6858
6859/// The wire type corresponding to [`NodePropertyEntry`].
6860#[derive(Debug)]
6861#[repr(C)]
6862pub struct WireNodePropertyEntry<'de> {
6863    pub name: ::fidl_next::WireString<'de>,
6864
6865    pub properties: ::fidl_next::WireVector<'de, crate::WireNodeProperty<'de>>,
6866}
6867
6868unsafe impl ::fidl_next::Wire for WireNodePropertyEntry<'static> {
6869    type Decoded<'de> = WireNodePropertyEntry<'de>;
6870
6871    #[inline]
6872    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6873}
6874
6875unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodePropertyEntry<'static>
6876where
6877    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6878    ___D: ::fidl_next::Decoder,
6879{
6880    fn decode(
6881        slot: ::fidl_next::Slot<'_, Self>,
6882        decoder: &mut ___D,
6883    ) -> Result<(), ::fidl_next::DecodeError> {
6884        ::fidl_next::munge! {
6885            let Self {
6886                mut name,
6887                mut properties,
6888
6889            } = slot;
6890        }
6891
6892        ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
6893
6894        let name = unsafe { name.deref_unchecked() };
6895
6896        if name.len() > 128 {
6897            return Err(::fidl_next::DecodeError::VectorTooLong {
6898                size: name.len() as u64,
6899                limit: 128,
6900            });
6901        }
6902
6903        ::fidl_next::Decode::decode(properties.as_mut(), decoder)?;
6904
6905        let properties = unsafe { properties.deref_unchecked() };
6906
6907        if properties.len() > 64 {
6908            return Err(::fidl_next::DecodeError::VectorTooLong {
6909                size: properties.len() as u64,
6910                limit: 64,
6911            });
6912        }
6913
6914        Ok(())
6915    }
6916}
6917
6918pub type NodePropertyDictionary = Vec<crate::NodePropertyEntry>;
6919
6920/// The wire type corresponding to [`NodePropertyDictionary`].
6921pub type WireNodePropertyDictionary<'de> =
6922    ::fidl_next::WireVector<'de, crate::WireNodePropertyEntry<'de>>;
6923
6924pub type NodeProperties = Vec<crate::NodeProperty2>;
6925
6926/// The wire type corresponding to [`NodeProperties`].
6927pub type WireNodeProperties<'de> = ::fidl_next::WireVector<'de, crate::WireNodeProperty2<'de>>;
6928
6929#[doc = " Contains the node properties that belong to a node.\n"]
6930#[derive(Clone, Debug)]
6931pub struct NodePropertyEntry2 {
6932    pub name: String,
6933
6934    pub properties: Vec<crate::NodeProperty2>,
6935}
6936
6937impl ::fidl_next::Encodable for NodePropertyEntry2 {
6938    type Encoded = WireNodePropertyEntry2<'static>;
6939}
6940
6941unsafe impl<___E> ::fidl_next::Encode<___E> for NodePropertyEntry2
6942where
6943    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6944    ___E: ::fidl_next::Encoder,
6945{
6946    #[inline]
6947    fn encode(
6948        self,
6949        encoder: &mut ___E,
6950        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6951    ) -> Result<(), ::fidl_next::EncodeError> {
6952        ::fidl_next::munge! {
6953            let Self::Encoded {
6954                name,
6955                properties,
6956
6957            } = out;
6958        }
6959
6960        ::fidl_next::Encode::encode(self.name, encoder, name)?;
6961
6962        ::fidl_next::Encode::encode(self.properties, encoder, properties)?;
6963
6964        Ok(())
6965    }
6966}
6967
6968unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodePropertyEntry2
6969where
6970    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6971    ___E: ::fidl_next::Encoder,
6972{
6973    #[inline]
6974    fn encode_ref(
6975        &self,
6976        encoder: &mut ___E,
6977        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6978    ) -> Result<(), ::fidl_next::EncodeError> {
6979        ::fidl_next::munge! {
6980            let Self::Encoded {
6981                name,
6982                properties,
6983
6984            } = out;
6985        }
6986
6987        ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
6988
6989        ::fidl_next::EncodeRef::encode_ref(&self.properties, encoder, properties)?;
6990
6991        Ok(())
6992    }
6993}
6994
6995impl ::fidl_next::EncodableOption for NodePropertyEntry2 {
6996    type EncodedOption = ::fidl_next::WireBox<'static, WireNodePropertyEntry2<'static>>;
6997}
6998
6999unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodePropertyEntry2
7000where
7001    ___E: ::fidl_next::Encoder + ?Sized,
7002    NodePropertyEntry2: ::fidl_next::Encode<___E>,
7003{
7004    #[inline]
7005    fn encode_option(
7006        this: Option<Self>,
7007        encoder: &mut ___E,
7008        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7009    ) -> Result<(), ::fidl_next::EncodeError> {
7010        if let Some(inner) = this {
7011            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7012            ::fidl_next::WireBox::encode_present(out);
7013        } else {
7014            ::fidl_next::WireBox::encode_absent(out);
7015        }
7016
7017        Ok(())
7018    }
7019}
7020
7021unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodePropertyEntry2
7022where
7023    ___E: ::fidl_next::Encoder + ?Sized,
7024    NodePropertyEntry2: ::fidl_next::EncodeRef<___E>,
7025{
7026    #[inline]
7027    fn encode_option_ref(
7028        this: Option<&Self>,
7029        encoder: &mut ___E,
7030        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7031    ) -> Result<(), ::fidl_next::EncodeError> {
7032        if let Some(inner) = this {
7033            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7034            ::fidl_next::WireBox::encode_present(out);
7035        } else {
7036            ::fidl_next::WireBox::encode_absent(out);
7037        }
7038
7039        Ok(())
7040    }
7041}
7042
7043impl<'de> ::fidl_next::FromWire<WireNodePropertyEntry2<'de>> for NodePropertyEntry2 {
7044    #[inline]
7045    fn from_wire(wire: WireNodePropertyEntry2<'de>) -> Self {
7046        Self {
7047            name: ::fidl_next::FromWire::from_wire(wire.name),
7048
7049            properties: ::fidl_next::FromWire::from_wire(wire.properties),
7050        }
7051    }
7052}
7053
7054impl<'de> ::fidl_next::FromWireRef<WireNodePropertyEntry2<'de>> for NodePropertyEntry2 {
7055    #[inline]
7056    fn from_wire_ref(wire: &WireNodePropertyEntry2<'de>) -> Self {
7057        Self {
7058            name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
7059
7060            properties: ::fidl_next::FromWireRef::from_wire_ref(&wire.properties),
7061        }
7062    }
7063}
7064
7065/// The wire type corresponding to [`NodePropertyEntry2`].
7066#[derive(Debug)]
7067#[repr(C)]
7068pub struct WireNodePropertyEntry2<'de> {
7069    pub name: ::fidl_next::WireString<'de>,
7070
7071    pub properties: ::fidl_next::WireVector<'de, crate::WireNodeProperty2<'de>>,
7072}
7073
7074unsafe impl ::fidl_next::Wire for WireNodePropertyEntry2<'static> {
7075    type Decoded<'de> = WireNodePropertyEntry2<'de>;
7076
7077    #[inline]
7078    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
7079}
7080
7081unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodePropertyEntry2<'static>
7082where
7083    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7084    ___D: ::fidl_next::Decoder,
7085{
7086    fn decode(
7087        slot: ::fidl_next::Slot<'_, Self>,
7088        decoder: &mut ___D,
7089    ) -> Result<(), ::fidl_next::DecodeError> {
7090        ::fidl_next::munge! {
7091            let Self {
7092                mut name,
7093                mut properties,
7094
7095            } = slot;
7096        }
7097
7098        ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
7099
7100        let name = unsafe { name.deref_unchecked() };
7101
7102        if name.len() > 128 {
7103            return Err(::fidl_next::DecodeError::VectorTooLong {
7104                size: name.len() as u64,
7105                limit: 128,
7106            });
7107        }
7108
7109        ::fidl_next::Decode::decode(properties.as_mut(), decoder)?;
7110
7111        let properties = unsafe { properties.deref_unchecked() };
7112
7113        if properties.len() > 64 {
7114            return Err(::fidl_next::DecodeError::VectorTooLong {
7115                size: properties.len() as u64,
7116                limit: 64,
7117            });
7118        }
7119
7120        Ok(())
7121    }
7122}
7123
7124pub type NodePropertyDictionary2 = Vec<crate::NodePropertyEntry2>;
7125
7126/// The wire type corresponding to [`NodePropertyDictionary2`].
7127pub type WireNodePropertyDictionary2<'de> =
7128    ::fidl_next::WireVector<'de, crate::WireNodePropertyEntry2<'de>>;
7129
7130pub const MAX_MODULE_NAME_LENGTH: u8 = 128;
7131
7132#[doc = " Definition of a symbol provided by a driver for a node. A symbol is local to\n a driver host.\n"]
7133#[derive(Clone, Debug, Default)]
7134pub struct NodeSymbol {
7135    pub name: Option<String>,
7136
7137    pub address: Option<u64>,
7138
7139    pub module_name: Option<String>,
7140}
7141
7142impl NodeSymbol {
7143    fn __max_ordinal(&self) -> usize {
7144        if self.module_name.is_some() {
7145            return 3;
7146        }
7147
7148        if self.address.is_some() {
7149            return 2;
7150        }
7151
7152        if self.name.is_some() {
7153            return 1;
7154        }
7155
7156        0
7157    }
7158}
7159
7160impl ::fidl_next::Encodable for NodeSymbol {
7161    type Encoded = WireNodeSymbol<'static>;
7162}
7163
7164unsafe impl<___E> ::fidl_next::Encode<___E> for NodeSymbol
7165where
7166    ___E: ::fidl_next::Encoder + ?Sized,
7167{
7168    #[inline]
7169    fn encode(
7170        mut self,
7171        encoder: &mut ___E,
7172        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7173    ) -> Result<(), ::fidl_next::EncodeError> {
7174        ::fidl_next::munge!(let WireNodeSymbol { table } = out);
7175
7176        let max_ord = self.__max_ordinal();
7177
7178        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7179        ::fidl_next::Wire::zero_padding(&mut out);
7180
7181        let mut preallocated =
7182            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7183
7184        for i in 1..=max_ord {
7185            match i {
7186                3 => {
7187                    if let Some(module_name) = self.module_name.take() {
7188                        ::fidl_next::WireEnvelope::encode_value(
7189                            module_name,
7190                            preallocated.encoder,
7191                            &mut out,
7192                        )?;
7193                    } else {
7194                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
7195                    }
7196                }
7197
7198                2 => {
7199                    if let Some(address) = self.address.take() {
7200                        ::fidl_next::WireEnvelope::encode_value(
7201                            address,
7202                            preallocated.encoder,
7203                            &mut out,
7204                        )?;
7205                    } else {
7206                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
7207                    }
7208                }
7209
7210                1 => {
7211                    if let Some(name) = self.name.take() {
7212                        ::fidl_next::WireEnvelope::encode_value(
7213                            name,
7214                            preallocated.encoder,
7215                            &mut out,
7216                        )?;
7217                    } else {
7218                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
7219                    }
7220                }
7221
7222                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7223            }
7224            unsafe {
7225                preallocated.write_next(out.assume_init_ref());
7226            }
7227        }
7228
7229        ::fidl_next::WireTable::encode_len(table, max_ord);
7230
7231        Ok(())
7232    }
7233}
7234
7235unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeSymbol
7236where
7237    ___E: ::fidl_next::Encoder + ?Sized,
7238{
7239    #[inline]
7240    fn encode_ref(
7241        &self,
7242        encoder: &mut ___E,
7243        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7244    ) -> Result<(), ::fidl_next::EncodeError> {
7245        ::fidl_next::munge!(let WireNodeSymbol { table } = out);
7246
7247        let max_ord = self.__max_ordinal();
7248
7249        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7250        ::fidl_next::Wire::zero_padding(&mut out);
7251
7252        let mut preallocated =
7253            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7254
7255        for i in 1..=max_ord {
7256            match i {
7257                3 => {
7258                    if let Some(module_name) = &self.module_name {
7259                        ::fidl_next::WireEnvelope::encode_value(
7260                            module_name,
7261                            preallocated.encoder,
7262                            &mut out,
7263                        )?;
7264                    } else {
7265                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
7266                    }
7267                }
7268
7269                2 => {
7270                    if let Some(address) = &self.address {
7271                        ::fidl_next::WireEnvelope::encode_value(
7272                            address,
7273                            preallocated.encoder,
7274                            &mut out,
7275                        )?;
7276                    } else {
7277                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
7278                    }
7279                }
7280
7281                1 => {
7282                    if let Some(name) = &self.name {
7283                        ::fidl_next::WireEnvelope::encode_value(
7284                            name,
7285                            preallocated.encoder,
7286                            &mut out,
7287                        )?;
7288                    } else {
7289                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
7290                    }
7291                }
7292
7293                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7294            }
7295            unsafe {
7296                preallocated.write_next(out.assume_init_ref());
7297            }
7298        }
7299
7300        ::fidl_next::WireTable::encode_len(table, max_ord);
7301
7302        Ok(())
7303    }
7304}
7305
7306impl<'de> ::fidl_next::FromWire<WireNodeSymbol<'de>> for NodeSymbol {
7307    #[inline]
7308    fn from_wire(wire: WireNodeSymbol<'de>) -> Self {
7309        let wire = ::core::mem::ManuallyDrop::new(wire);
7310
7311        let name = wire.table.get(1);
7312
7313        let address = wire.table.get(2);
7314
7315        let module_name = wire.table.get(3);
7316
7317        Self {
7318            name: name.map(|envelope| {
7319                ::fidl_next::FromWire::from_wire(unsafe {
7320                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7321                })
7322            }),
7323
7324            address: address.map(|envelope| {
7325                ::fidl_next::FromWire::from_wire(unsafe {
7326                    envelope.read_unchecked::<::fidl_next::WireU64>()
7327                })
7328            }),
7329
7330            module_name: module_name.map(|envelope| {
7331                ::fidl_next::FromWire::from_wire(unsafe {
7332                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7333                })
7334            }),
7335        }
7336    }
7337}
7338
7339impl<'de> ::fidl_next::FromWireRef<WireNodeSymbol<'de>> for NodeSymbol {
7340    #[inline]
7341    fn from_wire_ref(wire: &WireNodeSymbol<'de>) -> Self {
7342        Self {
7343            name: wire.table.get(1).map(|envelope| {
7344                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7345                    envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7346                })
7347            }),
7348
7349            address: wire.table.get(2).map(|envelope| {
7350                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7351                    envelope.deref_unchecked::<::fidl_next::WireU64>()
7352                })
7353            }),
7354
7355            module_name: wire.table.get(3).map(|envelope| {
7356                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7357                    envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7358                })
7359            }),
7360        }
7361    }
7362}
7363
7364/// The wire type corresponding to [`NodeSymbol`].
7365#[repr(C)]
7366pub struct WireNodeSymbol<'de> {
7367    table: ::fidl_next::WireTable<'de>,
7368}
7369
7370impl<'de> Drop for WireNodeSymbol<'de> {
7371    fn drop(&mut self) {
7372        let _ = self
7373            .table
7374            .get(1)
7375            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
7376
7377        let _ = self
7378            .table
7379            .get(2)
7380            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
7381
7382        let _ = self
7383            .table
7384            .get(3)
7385            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
7386    }
7387}
7388
7389unsafe impl ::fidl_next::Wire for WireNodeSymbol<'static> {
7390    type Decoded<'de> = WireNodeSymbol<'de>;
7391
7392    #[inline]
7393    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7394        ::fidl_next::munge!(let Self { table } = out);
7395        ::fidl_next::WireTable::zero_padding(table);
7396    }
7397}
7398
7399unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeSymbol<'static>
7400where
7401    ___D: ::fidl_next::Decoder + ?Sized,
7402{
7403    fn decode(
7404        slot: ::fidl_next::Slot<'_, Self>,
7405        decoder: &mut ___D,
7406    ) -> Result<(), ::fidl_next::DecodeError> {
7407        ::fidl_next::munge!(let Self { table } = slot);
7408
7409        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
7410            match ordinal {
7411                0 => unsafe { ::core::hint::unreachable_unchecked() },
7412
7413                1 => {
7414                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
7415                        slot.as_mut(),
7416                        decoder,
7417                    )?;
7418
7419                    let name = unsafe {
7420                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
7421                    };
7422
7423                    if name.len() > 128 {
7424                        return Err(::fidl_next::DecodeError::VectorTooLong {
7425                            size: name.len() as u64,
7426                            limit: 128,
7427                        });
7428                    }
7429
7430                    Ok(())
7431                }
7432
7433                2 => {
7434                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
7435                        slot.as_mut(),
7436                        decoder,
7437                    )?;
7438
7439                    Ok(())
7440                }
7441
7442                3 => {
7443                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
7444                        slot.as_mut(),
7445                        decoder,
7446                    )?;
7447
7448                    let module_name = unsafe {
7449                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
7450                    };
7451
7452                    if module_name.len() > 128 {
7453                        return Err(::fidl_next::DecodeError::VectorTooLong {
7454                            size: module_name.len() as u64,
7455                            limit: 128,
7456                        });
7457                    }
7458
7459                    Ok(())
7460                }
7461
7462                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
7463            }
7464        })
7465    }
7466}
7467
7468impl<'de> WireNodeSymbol<'de> {
7469    pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
7470        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
7471    }
7472
7473    pub fn address(&self) -> Option<&::fidl_next::WireU64> {
7474        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
7475    }
7476
7477    pub fn module_name(&self) -> Option<&::fidl_next::WireString<'de>> {
7478        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
7479    }
7480}
7481
7482impl<'de> ::core::fmt::Debug for WireNodeSymbol<'de> {
7483    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
7484        f.debug_struct("NodeSymbol")
7485            .field("name", &self.name())
7486            .field("address", &self.address())
7487            .field("module_name", &self.module_name())
7488            .finish()
7489    }
7490}
7491
7492#[derive(Clone, Debug)]
7493pub enum Offer {
7494    ZirconTransport(::fidl_next_fuchsia_component_decl::Offer),
7495
7496    DriverTransport(::fidl_next_fuchsia_component_decl::Offer),
7497
7498    UnknownOrdinal_(u64),
7499}
7500
7501impl ::fidl_next::Encodable for Offer {
7502    type Encoded = WireOffer<'static>;
7503}
7504
7505unsafe impl<___E> ::fidl_next::Encode<___E> for Offer
7506where
7507    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7508    ___E: ::fidl_next::Encoder,
7509{
7510    #[inline]
7511    fn encode(
7512        self,
7513        encoder: &mut ___E,
7514        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7515    ) -> Result<(), ::fidl_next::EncodeError> {
7516        ::fidl_next::munge!(let WireOffer { raw, _phantom: _ } = out);
7517
7518        match self {
7519            Self::ZirconTransport(value) => ::fidl_next::RawWireUnion::encode_as::<
7520                ___E,
7521                ::fidl_next_fuchsia_component_decl::Offer,
7522            >(value, 1, encoder, raw)?,
7523
7524            Self::DriverTransport(value) => ::fidl_next::RawWireUnion::encode_as::<
7525                ___E,
7526                ::fidl_next_fuchsia_component_decl::Offer,
7527            >(value, 2, encoder, raw)?,
7528
7529            Self::UnknownOrdinal_(ordinal) => {
7530                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
7531            }
7532        }
7533
7534        Ok(())
7535    }
7536}
7537
7538unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Offer
7539where
7540    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7541    ___E: ::fidl_next::Encoder,
7542{
7543    #[inline]
7544    fn encode_ref(
7545        &self,
7546        encoder: &mut ___E,
7547        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7548    ) -> Result<(), ::fidl_next::EncodeError> {
7549        ::fidl_next::munge!(let WireOffer { raw, _phantom: _ } = out);
7550
7551        match self {
7552            Self::ZirconTransport(value) => ::fidl_next::RawWireUnion::encode_as::<
7553                ___E,
7554                &::fidl_next_fuchsia_component_decl::Offer,
7555            >(value, 1, encoder, raw)?,
7556
7557            Self::DriverTransport(value) => ::fidl_next::RawWireUnion::encode_as::<
7558                ___E,
7559                &::fidl_next_fuchsia_component_decl::Offer,
7560            >(value, 2, encoder, raw)?,
7561
7562            Self::UnknownOrdinal_(ordinal) => {
7563                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
7564            }
7565        }
7566
7567        Ok(())
7568    }
7569}
7570
7571impl ::fidl_next::EncodableOption for Offer {
7572    type EncodedOption = WireOptionalOffer<'static>;
7573}
7574
7575unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Offer
7576where
7577    ___E: ?Sized,
7578    Offer: ::fidl_next::Encode<___E>,
7579{
7580    #[inline]
7581    fn encode_option(
7582        this: Option<Self>,
7583        encoder: &mut ___E,
7584        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7585    ) -> Result<(), ::fidl_next::EncodeError> {
7586        ::fidl_next::munge!(let WireOptionalOffer { raw, _phantom: _ } = &mut *out);
7587
7588        if let Some(inner) = this {
7589            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7590            ::fidl_next::Encode::encode(inner, encoder, value_out)?;
7591        } else {
7592            ::fidl_next::RawWireUnion::encode_absent(raw);
7593        }
7594
7595        Ok(())
7596    }
7597}
7598
7599unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Offer
7600where
7601    ___E: ?Sized,
7602    Offer: ::fidl_next::EncodeRef<___E>,
7603{
7604    #[inline]
7605    fn encode_option_ref(
7606        this: Option<&Self>,
7607        encoder: &mut ___E,
7608        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7609    ) -> Result<(), ::fidl_next::EncodeError> {
7610        ::fidl_next::munge!(let WireOptionalOffer { raw, _phantom: _ } = &mut *out);
7611
7612        if let Some(inner) = this {
7613            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7614            ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
7615        } else {
7616            ::fidl_next::RawWireUnion::encode_absent(raw);
7617        }
7618
7619        Ok(())
7620    }
7621}
7622
7623impl<'de> ::fidl_next::FromWire<WireOffer<'de>> for Offer {
7624    #[inline]
7625    fn from_wire(wire: WireOffer<'de>) -> Self {
7626        let wire = ::core::mem::ManuallyDrop::new(wire);
7627        match wire.raw.ordinal() {
7628            1 => Self::ZirconTransport(::fidl_next::FromWire::from_wire(unsafe {
7629                wire.raw
7630                    .get()
7631                    .read_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'de>>()
7632            })),
7633
7634            2 => Self::DriverTransport(::fidl_next::FromWire::from_wire(unsafe {
7635                wire.raw
7636                    .get()
7637                    .read_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'de>>()
7638            })),
7639
7640            _ => unsafe { ::core::hint::unreachable_unchecked() },
7641        }
7642    }
7643}
7644
7645impl<'de> ::fidl_next::FromWireRef<WireOffer<'de>> for Offer {
7646    #[inline]
7647    fn from_wire_ref(wire: &WireOffer<'de>) -> Self {
7648        match wire.raw.ordinal() {
7649            1 => Self::ZirconTransport(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7650                wire.raw
7651                    .get()
7652                    .deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'de>>()
7653            })),
7654
7655            2 => Self::DriverTransport(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7656                wire.raw
7657                    .get()
7658                    .deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'de>>()
7659            })),
7660
7661            _ => unsafe { ::core::hint::unreachable_unchecked() },
7662        }
7663    }
7664}
7665
7666impl<'de> ::fidl_next::FromWireOption<WireOptionalOffer<'de>> for Box<Offer> {
7667    #[inline]
7668    fn from_wire_option(wire: WireOptionalOffer<'de>) -> Option<Self> {
7669        if let Some(inner) = wire.into_option() {
7670            Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
7671        } else {
7672            None
7673        }
7674    }
7675}
7676
7677impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalOffer<'de>> for Box<Offer> {
7678    #[inline]
7679    fn from_wire_option_ref(wire: &WireOptionalOffer<'de>) -> Option<Self> {
7680        if let Some(inner) = wire.as_ref() {
7681            Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
7682        } else {
7683            None
7684        }
7685    }
7686}
7687
7688/// The wire type corresponding to [`Offer`].
7689#[repr(transparent)]
7690pub struct WireOffer<'de> {
7691    raw: ::fidl_next::RawWireUnion,
7692    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
7693}
7694
7695impl<'de> Drop for WireOffer<'de> {
7696    fn drop(&mut self) {
7697        match self.raw.ordinal() {
7698            1 => {
7699                let _ = unsafe {
7700                    self.raw
7701                        .get()
7702                        .read_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'de>>()
7703                };
7704            }
7705
7706            2 => {
7707                let _ = unsafe {
7708                    self.raw
7709                        .get()
7710                        .read_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'de>>()
7711                };
7712            }
7713
7714            _ => (),
7715        }
7716    }
7717}
7718
7719unsafe impl ::fidl_next::Wire for WireOffer<'static> {
7720    type Decoded<'de> = WireOffer<'de>;
7721
7722    #[inline]
7723    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7724        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7725        ::fidl_next::RawWireUnion::zero_padding(raw);
7726    }
7727}
7728
7729pub mod offer {
7730    pub enum Ref<'de> {
7731        ZirconTransport(&'de ::fidl_next_fuchsia_component_decl::WireOffer<'de>),
7732
7733        DriverTransport(&'de ::fidl_next_fuchsia_component_decl::WireOffer<'de>),
7734
7735        UnknownOrdinal_(u64),
7736    }
7737}
7738
7739impl<'de> WireOffer<'de> {
7740    pub fn as_ref(&self) -> crate::offer::Ref<'_> {
7741        match self.raw.ordinal() {
7742            1 => crate::offer::Ref::ZirconTransport(unsafe {
7743                self.raw
7744                    .get()
7745                    .deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'_>>()
7746            }),
7747
7748            2 => crate::offer::Ref::DriverTransport(unsafe {
7749                self.raw
7750                    .get()
7751                    .deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'_>>()
7752            }),
7753
7754            unknown => crate::offer::Ref::UnknownOrdinal_(unknown),
7755        }
7756    }
7757}
7758
7759unsafe impl<___D> ::fidl_next::Decode<___D> for WireOffer<'static>
7760where
7761    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7762    ___D: ::fidl_next::Decoder,
7763{
7764    fn decode(
7765        mut slot: ::fidl_next::Slot<'_, Self>,
7766        decoder: &mut ___D,
7767    ) -> Result<(), ::fidl_next::DecodeError> {
7768        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7769        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7770            1 => ::fidl_next::RawWireUnion::decode_as::<
7771                ___D,
7772                ::fidl_next_fuchsia_component_decl::WireOffer<'static>,
7773            >(raw, decoder)?,
7774
7775            2 => ::fidl_next::RawWireUnion::decode_as::<
7776                ___D,
7777                ::fidl_next_fuchsia_component_decl::WireOffer<'static>,
7778            >(raw, decoder)?,
7779
7780            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
7781        }
7782
7783        Ok(())
7784    }
7785}
7786
7787impl<'de> ::core::fmt::Debug for WireOffer<'de> {
7788    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7789        match self.raw.ordinal() {
7790            1 => unsafe {
7791                self.raw
7792                    .get()
7793                    .deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'_>>()
7794                    .fmt(f)
7795            },
7796            2 => unsafe {
7797                self.raw
7798                    .get()
7799                    .deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer<'_>>()
7800                    .fmt(f)
7801            },
7802            _ => unsafe { ::core::hint::unreachable_unchecked() },
7803        }
7804    }
7805}
7806
7807#[repr(transparent)]
7808pub struct WireOptionalOffer<'de> {
7809    raw: ::fidl_next::RawWireUnion,
7810    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
7811}
7812
7813unsafe impl ::fidl_next::Wire for WireOptionalOffer<'static> {
7814    type Decoded<'de> = WireOptionalOffer<'de>;
7815
7816    #[inline]
7817    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7818        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7819        ::fidl_next::RawWireUnion::zero_padding(raw);
7820    }
7821}
7822
7823impl<'de> WireOptionalOffer<'de> {
7824    pub fn is_some(&self) -> bool {
7825        self.raw.is_some()
7826    }
7827
7828    pub fn is_none(&self) -> bool {
7829        self.raw.is_none()
7830    }
7831
7832    pub fn as_ref(&self) -> Option<&WireOffer<'de>> {
7833        if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
7834    }
7835
7836    pub fn into_option(self) -> Option<WireOffer<'de>> {
7837        if self.is_some() {
7838            Some(WireOffer { raw: self.raw, _phantom: ::core::marker::PhantomData })
7839        } else {
7840            None
7841        }
7842    }
7843}
7844
7845unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalOffer<'static>
7846where
7847    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7848    ___D: ::fidl_next::Decoder,
7849{
7850    fn decode(
7851        mut slot: ::fidl_next::Slot<'_, Self>,
7852        decoder: &mut ___D,
7853    ) -> Result<(), ::fidl_next::DecodeError> {
7854        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7855        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7856            1 => ::fidl_next::RawWireUnion::decode_as::<
7857                ___D,
7858                ::fidl_next_fuchsia_component_decl::WireOffer<'static>,
7859            >(raw, decoder)?,
7860
7861            2 => ::fidl_next::RawWireUnion::decode_as::<
7862                ___D,
7863                ::fidl_next_fuchsia_component_decl::WireOffer<'static>,
7864            >(raw, decoder)?,
7865
7866            0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
7867            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
7868        }
7869
7870        Ok(())
7871    }
7872}
7873
7874impl<'de> ::core::fmt::Debug for WireOptionalOffer<'de> {
7875    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7876        self.as_ref().fmt(f)
7877    }
7878}
7879
7880pub type NodeOffersVector = Vec<crate::Offer>;
7881
7882/// The wire type corresponding to [`NodeOffersVector`].
7883pub type WireNodeOffersVector<'de> = ::fidl_next::WireVector<'de, crate::WireOffer<'de>>;
7884
7885#[doc = " Arguments for starting a driver.\n"]
7886#[derive(Debug, Default)]
7887pub struct DriverStartArgs {
7888    pub node: Option<::fidl_next::ClientEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel>>,
7889
7890    pub symbols: Option<Vec<crate::NodeSymbol>>,
7891
7892    pub url: Option<String>,
7893
7894    pub program: Option<::fidl_next_fuchsia_data::Dictionary>,
7895
7896    pub incoming: Option<Vec<::fidl_next_fuchsia_component_runner::ComponentNamespaceEntry>>,
7897
7898    pub outgoing_dir: Option<
7899        ::fidl_next::ServerEnd<
7900            ::fidl_next_fuchsia_io::Directory,
7901            ::fidl_next::fuchsia::zx::Channel,
7902        >,
7903    >,
7904
7905    pub config: Option<::fidl_next::fuchsia::zx::Vmo>,
7906
7907    pub node_name: Option<String>,
7908
7909    pub node_properties: Option<Vec<crate::NodePropertyEntry>>,
7910
7911    pub node_offers: Option<Vec<crate::Offer>>,
7912
7913    pub node_token: Option<::fidl_next::fuchsia::zx::Event>,
7914
7915    pub node_properties_2: Option<Vec<crate::NodePropertyEntry2>>,
7916}
7917
7918impl DriverStartArgs {
7919    fn __max_ordinal(&self) -> usize {
7920        if self.node_properties_2.is_some() {
7921            return 12;
7922        }
7923
7924        if self.node_token.is_some() {
7925            return 11;
7926        }
7927
7928        if self.node_offers.is_some() {
7929            return 10;
7930        }
7931
7932        if self.node_properties.is_some() {
7933            return 9;
7934        }
7935
7936        if self.node_name.is_some() {
7937            return 8;
7938        }
7939
7940        if self.config.is_some() {
7941            return 7;
7942        }
7943
7944        if self.outgoing_dir.is_some() {
7945            return 6;
7946        }
7947
7948        if self.incoming.is_some() {
7949            return 5;
7950        }
7951
7952        if self.program.is_some() {
7953            return 4;
7954        }
7955
7956        if self.url.is_some() {
7957            return 3;
7958        }
7959
7960        if self.symbols.is_some() {
7961            return 2;
7962        }
7963
7964        if self.node.is_some() {
7965            return 1;
7966        }
7967
7968        0
7969    }
7970}
7971
7972impl ::fidl_next::Encodable for DriverStartArgs {
7973    type Encoded = WireDriverStartArgs<'static>;
7974}
7975
7976unsafe impl<___E> ::fidl_next::Encode<___E> for DriverStartArgs
7977where
7978    ___E: ::fidl_next::Encoder + ?Sized,
7979    ___E: ::fidl_next::fuchsia::HandleEncoder,
7980{
7981    #[inline]
7982    fn encode(
7983        mut self,
7984        encoder: &mut ___E,
7985        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7986    ) -> Result<(), ::fidl_next::EncodeError> {
7987        ::fidl_next::munge!(let WireDriverStartArgs { table } = out);
7988
7989        let max_ord = self.__max_ordinal();
7990
7991        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7992        ::fidl_next::Wire::zero_padding(&mut out);
7993
7994        let mut preallocated =
7995            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7996
7997        for i in 1..=max_ord {
7998            match i {
7999                12 => {
8000                    if let Some(node_properties_2) = self.node_properties_2.take() {
8001                        ::fidl_next::WireEnvelope::encode_value(
8002                            node_properties_2,
8003                            preallocated.encoder,
8004                            &mut out,
8005                        )?;
8006                    } else {
8007                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8008                    }
8009                }
8010
8011                11 => {
8012                    if let Some(node_token) = self.node_token.take() {
8013                        ::fidl_next::WireEnvelope::encode_value(
8014                            node_token,
8015                            preallocated.encoder,
8016                            &mut out,
8017                        )?;
8018                    } else {
8019                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8020                    }
8021                }
8022
8023                10 => {
8024                    if let Some(node_offers) = self.node_offers.take() {
8025                        ::fidl_next::WireEnvelope::encode_value(
8026                            node_offers,
8027                            preallocated.encoder,
8028                            &mut out,
8029                        )?;
8030                    } else {
8031                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8032                    }
8033                }
8034
8035                9 => {
8036                    if let Some(node_properties) = self.node_properties.take() {
8037                        ::fidl_next::WireEnvelope::encode_value(
8038                            node_properties,
8039                            preallocated.encoder,
8040                            &mut out,
8041                        )?;
8042                    } else {
8043                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8044                    }
8045                }
8046
8047                8 => {
8048                    if let Some(node_name) = self.node_name.take() {
8049                        ::fidl_next::WireEnvelope::encode_value(
8050                            node_name,
8051                            preallocated.encoder,
8052                            &mut out,
8053                        )?;
8054                    } else {
8055                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8056                    }
8057                }
8058
8059                7 => {
8060                    if let Some(config) = self.config.take() {
8061                        ::fidl_next::WireEnvelope::encode_value(
8062                            config,
8063                            preallocated.encoder,
8064                            &mut out,
8065                        )?;
8066                    } else {
8067                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8068                    }
8069                }
8070
8071                6 => {
8072                    if let Some(outgoing_dir) = self.outgoing_dir.take() {
8073                        ::fidl_next::WireEnvelope::encode_value(
8074                            outgoing_dir,
8075                            preallocated.encoder,
8076                            &mut out,
8077                        )?;
8078                    } else {
8079                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8080                    }
8081                }
8082
8083                5 => {
8084                    if let Some(incoming) = self.incoming.take() {
8085                        ::fidl_next::WireEnvelope::encode_value(
8086                            incoming,
8087                            preallocated.encoder,
8088                            &mut out,
8089                        )?;
8090                    } else {
8091                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8092                    }
8093                }
8094
8095                4 => {
8096                    if let Some(program) = self.program.take() {
8097                        ::fidl_next::WireEnvelope::encode_value(
8098                            program,
8099                            preallocated.encoder,
8100                            &mut out,
8101                        )?;
8102                    } else {
8103                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8104                    }
8105                }
8106
8107                3 => {
8108                    if let Some(url) = self.url.take() {
8109                        ::fidl_next::WireEnvelope::encode_value(
8110                            url,
8111                            preallocated.encoder,
8112                            &mut out,
8113                        )?;
8114                    } else {
8115                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8116                    }
8117                }
8118
8119                2 => {
8120                    if let Some(symbols) = self.symbols.take() {
8121                        ::fidl_next::WireEnvelope::encode_value(
8122                            symbols,
8123                            preallocated.encoder,
8124                            &mut out,
8125                        )?;
8126                    } else {
8127                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8128                    }
8129                }
8130
8131                1 => {
8132                    if let Some(node) = self.node.take() {
8133                        ::fidl_next::WireEnvelope::encode_value(
8134                            node,
8135                            preallocated.encoder,
8136                            &mut out,
8137                        )?;
8138                    } else {
8139                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
8140                    }
8141                }
8142
8143                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8144            }
8145            unsafe {
8146                preallocated.write_next(out.assume_init_ref());
8147            }
8148        }
8149
8150        ::fidl_next::WireTable::encode_len(table, max_ord);
8151
8152        Ok(())
8153    }
8154}
8155
8156impl<'de> ::fidl_next::FromWire<WireDriverStartArgs<'de>> for DriverStartArgs {
8157    #[inline]
8158    fn from_wire(wire: WireDriverStartArgs<'de>) -> Self {
8159        let wire = ::core::mem::ManuallyDrop::new(wire);
8160
8161        let node = wire.table.get(1);
8162
8163        let symbols = wire.table.get(2);
8164
8165        let url = wire.table.get(3);
8166
8167        let program = wire.table.get(4);
8168
8169        let incoming = wire.table.get(5);
8170
8171        let outgoing_dir = wire.table.get(6);
8172
8173        let config = wire.table.get(7);
8174
8175        let node_name = wire.table.get(8);
8176
8177        let node_properties = wire.table.get(9);
8178
8179        let node_offers = wire.table.get(10);
8180
8181        let node_token = wire.table.get(11);
8182
8183        let node_properties_2 = wire.table.get(12);
8184
8185        Self {
8186
8187
8188                node: node.map(|envelope| ::fidl_next::FromWire::from_wire(
8189                    unsafe { envelope.read_unchecked::<::fidl_next::ClientEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>>() }
8190                )),
8191
8192
8193                symbols: symbols.map(|envelope| ::fidl_next::FromWire::from_wire(
8194                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeSymbol<'de>>>() }
8195                )),
8196
8197
8198                url: url.map(|envelope| ::fidl_next::FromWire::from_wire(
8199                    unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
8200                )),
8201
8202
8203                program: program.map(|envelope| ::fidl_next::FromWire::from_wire(
8204                    unsafe { envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>() }
8205                )),
8206
8207
8208                incoming: incoming.map(|envelope| ::fidl_next::FromWire::from_wire(
8209                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next_fuchsia_component_runner::WireComponentNamespaceEntry<'de>>>() }
8210                )),
8211
8212
8213                outgoing_dir: outgoing_dir.map(|envelope| ::fidl_next::FromWire::from_wire(
8214                    unsafe { envelope.read_unchecked::<::fidl_next::ServerEnd<::fidl_next_fuchsia_io::Directory, ::fidl_next::fuchsia::WireChannel>>() }
8215                )),
8216
8217
8218                config: config.map(|envelope| ::fidl_next::FromWire::from_wire(
8219                    unsafe { envelope.read_unchecked::<::fidl_next::fuchsia::WireVmo>() }
8220                )),
8221
8222
8223                node_name: node_name.map(|envelope| ::fidl_next::FromWire::from_wire(
8224                    unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
8225                )),
8226
8227
8228                node_properties: node_properties.map(|envelope| ::fidl_next::FromWire::from_wire(
8229                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodePropertyEntry<'de>>>() }
8230                )),
8231
8232
8233                node_offers: node_offers.map(|envelope| ::fidl_next::FromWire::from_wire(
8234                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireOffer<'de>>>() }
8235                )),
8236
8237
8238                node_token: node_token.map(|envelope| ::fidl_next::FromWire::from_wire(
8239                    unsafe { envelope.read_unchecked::<::fidl_next::fuchsia::WireEvent>() }
8240                )),
8241
8242
8243                node_properties_2: node_properties_2.map(|envelope| ::fidl_next::FromWire::from_wire(
8244                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodePropertyEntry2<'de>>>() }
8245                )),
8246
8247        }
8248    }
8249}
8250
8251/// The wire type corresponding to [`DriverStartArgs`].
8252#[repr(C)]
8253pub struct WireDriverStartArgs<'de> {
8254    table: ::fidl_next::WireTable<'de>,
8255}
8256
8257impl<'de> Drop for WireDriverStartArgs<'de> {
8258    fn drop(&mut self) {
8259        let _ = self.table.get(1)
8260                .map(|envelope| unsafe {
8261                    envelope.read_unchecked::<::fidl_next::ClientEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>>()
8262                });
8263
8264        let _ = self.table.get(2).map(|envelope| unsafe {
8265            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeSymbol<'de>>>()
8266        });
8267
8268        let _ = self
8269            .table
8270            .get(3)
8271            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
8272
8273        let _ = self.table.get(4).map(|envelope| unsafe {
8274            envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
8275        });
8276
8277        let _ = self.table.get(5).map(|envelope| unsafe {
8278            envelope.read_unchecked::<::fidl_next::WireVector<
8279                'de,
8280                ::fidl_next_fuchsia_component_runner::WireComponentNamespaceEntry<'de>,
8281            >>()
8282        });
8283
8284        let _ = self.table.get(6).map(|envelope| unsafe {
8285            envelope.read_unchecked::<::fidl_next::ServerEnd<
8286                ::fidl_next_fuchsia_io::Directory,
8287                ::fidl_next::fuchsia::WireChannel,
8288            >>()
8289        });
8290
8291        let _ = self
8292            .table
8293            .get(7)
8294            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::fuchsia::WireVmo>() });
8295
8296        let _ = self
8297            .table
8298            .get(8)
8299            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
8300
8301        let _ = self.table.get(9)
8302                .map(|envelope| unsafe {
8303                    envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodePropertyEntry<'de>>>()
8304                });
8305
8306        let _ = self.table.get(10).map(|envelope| unsafe {
8307            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireOffer<'de>>>()
8308        });
8309
8310        let _ = self.table.get(11).map(|envelope| unsafe {
8311            envelope.read_unchecked::<::fidl_next::fuchsia::WireEvent>()
8312        });
8313
8314        let _ = self.table.get(12).map(|envelope| unsafe {
8315            envelope
8316                .read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodePropertyEntry2<'de>>>(
8317                )
8318        });
8319    }
8320}
8321
8322unsafe impl ::fidl_next::Wire for WireDriverStartArgs<'static> {
8323    type Decoded<'de> = WireDriverStartArgs<'de>;
8324
8325    #[inline]
8326    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8327        ::fidl_next::munge!(let Self { table } = out);
8328        ::fidl_next::WireTable::zero_padding(table);
8329    }
8330}
8331
8332unsafe impl<___D> ::fidl_next::Decode<___D> for WireDriverStartArgs<'static>
8333where
8334    ___D: ::fidl_next::Decoder + ?Sized,
8335    ___D: ::fidl_next::fuchsia::HandleDecoder,
8336{
8337    fn decode(
8338        slot: ::fidl_next::Slot<'_, Self>,
8339        decoder: &mut ___D,
8340    ) -> Result<(), ::fidl_next::DecodeError> {
8341        ::fidl_next::munge!(let Self { table } = slot);
8342
8343        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8344            match ordinal {
8345                0 => unsafe { ::core::hint::unreachable_unchecked() },
8346
8347                1 => {
8348                    ::fidl_next::WireEnvelope::decode_as::<
8349                        ___D,
8350                        ::fidl_next::ClientEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
8351                    >(slot.as_mut(), decoder)?;
8352
8353                    Ok(())
8354                }
8355
8356                2 => {
8357                    ::fidl_next::WireEnvelope::decode_as::<
8358                        ___D,
8359                        ::fidl_next::WireVector<'static, crate::WireNodeSymbol<'static>>,
8360                    >(slot.as_mut(), decoder)?;
8361
8362                    let symbols = unsafe {
8363                        slot
8364                                            .deref_unchecked()
8365                                            .deref_unchecked::<
8366                                                ::fidl_next::WireVector<'_, crate::WireNodeSymbol<'_>>
8367                                            >()
8368                    };
8369
8370                    if symbols.len() > 64 {
8371                        return Err(::fidl_next::DecodeError::VectorTooLong {
8372                            size: symbols.len() as u64,
8373                            limit: 64,
8374                        });
8375                    }
8376
8377                    Ok(())
8378                }
8379
8380                3 => {
8381                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
8382                        slot.as_mut(),
8383                        decoder,
8384                    )?;
8385
8386                    let url = unsafe {
8387                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
8388                    };
8389
8390                    if url.len() > 4096 {
8391                        return Err(::fidl_next::DecodeError::VectorTooLong {
8392                            size: url.len() as u64,
8393                            limit: 4096,
8394                        });
8395                    }
8396
8397                    Ok(())
8398                }
8399
8400                4 => {
8401                    ::fidl_next::WireEnvelope::decode_as::<
8402                        ___D,
8403                        ::fidl_next_fuchsia_data::WireDictionary<'static>,
8404                    >(slot.as_mut(), decoder)?;
8405
8406                    Ok(())
8407                }
8408
8409                5 => {
8410                    ::fidl_next::WireEnvelope::decode_as::<
8411                        ___D,
8412                        ::fidl_next::WireVector<
8413                            'static,
8414                            ::fidl_next_fuchsia_component_runner::WireComponentNamespaceEntry<
8415                                'static,
8416                            >,
8417                        >,
8418                    >(slot.as_mut(), decoder)?;
8419
8420                    let incoming = unsafe {
8421                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<
8422                            '_,
8423                            ::fidl_next_fuchsia_component_runner::WireComponentNamespaceEntry<'_>,
8424                        >>()
8425                    };
8426
8427                    if incoming.len() > 32 {
8428                        return Err(::fidl_next::DecodeError::VectorTooLong {
8429                            size: incoming.len() as u64,
8430                            limit: 32,
8431                        });
8432                    }
8433
8434                    Ok(())
8435                }
8436
8437                6 => {
8438                    ::fidl_next::WireEnvelope::decode_as::<
8439                        ___D,
8440                        ::fidl_next::ServerEnd<
8441                            ::fidl_next_fuchsia_io::Directory,
8442                            ::fidl_next::fuchsia::WireChannel,
8443                        >,
8444                    >(slot.as_mut(), decoder)?;
8445
8446                    Ok(())
8447                }
8448
8449                7 => {
8450                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireVmo>(
8451                        slot.as_mut(),
8452                        decoder,
8453                    )?;
8454
8455                    Ok(())
8456                }
8457
8458                8 => {
8459                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
8460                        slot.as_mut(),
8461                        decoder,
8462                    )?;
8463
8464                    Ok(())
8465                }
8466
8467                9 => {
8468                    ::fidl_next::WireEnvelope::decode_as::<
8469                        ___D,
8470                        ::fidl_next::WireVector<'static, crate::WireNodePropertyEntry<'static>>,
8471                    >(slot.as_mut(), decoder)?;
8472
8473                    Ok(())
8474                }
8475
8476                10 => {
8477                    ::fidl_next::WireEnvelope::decode_as::<
8478                        ___D,
8479                        ::fidl_next::WireVector<'static, crate::WireOffer<'static>>,
8480                    >(slot.as_mut(), decoder)?;
8481
8482                    let node_offers = unsafe {
8483                        slot.deref_unchecked()
8484                            .deref_unchecked::<::fidl_next::WireVector<'_, crate::WireOffer<'_>>>()
8485                    };
8486
8487                    if node_offers.len() > 128 {
8488                        return Err(::fidl_next::DecodeError::VectorTooLong {
8489                            size: node_offers.len() as u64,
8490                            limit: 128,
8491                        });
8492                    }
8493
8494                    Ok(())
8495                }
8496
8497                11 => {
8498                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireEvent>(
8499                        slot.as_mut(),
8500                        decoder,
8501                    )?;
8502
8503                    Ok(())
8504                }
8505
8506                12 => {
8507                    ::fidl_next::WireEnvelope::decode_as::<
8508                        ___D,
8509                        ::fidl_next::WireVector<'static, crate::WireNodePropertyEntry2<'static>>,
8510                    >(slot.as_mut(), decoder)?;
8511
8512                    Ok(())
8513                }
8514
8515                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
8516            }
8517        })
8518    }
8519}
8520
8521impl<'de> WireDriverStartArgs<'de> {
8522    pub fn node(
8523        &self,
8524    ) -> Option<&::fidl_next::ClientEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>> {
8525        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8526    }
8527
8528    pub fn symbols(&self) -> Option<&::fidl_next::WireVector<'de, crate::WireNodeSymbol<'de>>> {
8529        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
8530    }
8531
8532    pub fn url(&self) -> Option<&::fidl_next::WireString<'de>> {
8533        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
8534    }
8535
8536    pub fn program(&self) -> Option<&::fidl_next_fuchsia_data::WireDictionary<'de>> {
8537        unsafe { Some(self.table.get(4)?.deref_unchecked()) }
8538    }
8539
8540    pub fn incoming(
8541        &self,
8542    ) -> Option<
8543        &::fidl_next::WireVector<
8544            'de,
8545            ::fidl_next_fuchsia_component_runner::WireComponentNamespaceEntry<'de>,
8546        >,
8547    > {
8548        unsafe { Some(self.table.get(5)?.deref_unchecked()) }
8549    }
8550
8551    pub fn outgoing_dir(
8552        &self,
8553    ) -> Option<
8554        &::fidl_next::ServerEnd<
8555            ::fidl_next_fuchsia_io::Directory,
8556            ::fidl_next::fuchsia::WireChannel,
8557        >,
8558    > {
8559        unsafe { Some(self.table.get(6)?.deref_unchecked()) }
8560    }
8561
8562    pub fn config(&self) -> Option<&::fidl_next::fuchsia::WireVmo> {
8563        unsafe { Some(self.table.get(7)?.deref_unchecked()) }
8564    }
8565
8566    pub fn node_name(&self) -> Option<&::fidl_next::WireString<'de>> {
8567        unsafe { Some(self.table.get(8)?.deref_unchecked()) }
8568    }
8569
8570    pub fn node_properties(
8571        &self,
8572    ) -> Option<&::fidl_next::WireVector<'de, crate::WireNodePropertyEntry<'de>>> {
8573        unsafe { Some(self.table.get(9)?.deref_unchecked()) }
8574    }
8575
8576    pub fn node_offers(&self) -> Option<&::fidl_next::WireVector<'de, crate::WireOffer<'de>>> {
8577        unsafe { Some(self.table.get(10)?.deref_unchecked()) }
8578    }
8579
8580    pub fn node_token(&self) -> Option<&::fidl_next::fuchsia::WireEvent> {
8581        unsafe { Some(self.table.get(11)?.deref_unchecked()) }
8582    }
8583
8584    pub fn node_properties_2(
8585        &self,
8586    ) -> Option<&::fidl_next::WireVector<'de, crate::WireNodePropertyEntry2<'de>>> {
8587        unsafe { Some(self.table.get(12)?.deref_unchecked()) }
8588    }
8589}
8590
8591impl<'de> ::core::fmt::Debug for WireDriverStartArgs<'de> {
8592    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
8593        f.debug_struct("DriverStartArgs")
8594            .field("node", &self.node())
8595            .field("symbols", &self.symbols())
8596            .field("url", &self.url())
8597            .field("program", &self.program())
8598            .field("incoming", &self.incoming())
8599            .field("outgoing_dir", &self.outgoing_dir())
8600            .field("config", &self.config())
8601            .field("node_name", &self.node_name())
8602            .field("node_properties", &self.node_properties())
8603            .field("node_offers", &self.node_offers())
8604            .field("node_token", &self.node_token())
8605            .field("node_properties_2", &self.node_properties_2())
8606            .finish()
8607    }
8608}
8609
8610#[derive(Debug)]
8611pub struct DriverStartRequest {
8612    pub start_args: crate::DriverStartArgs,
8613}
8614
8615impl ::fidl_next::Encodable for DriverStartRequest {
8616    type Encoded = WireDriverStartRequest<'static>;
8617}
8618
8619unsafe impl<___E> ::fidl_next::Encode<___E> for DriverStartRequest
8620where
8621    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8622    ___E: ::fidl_next::Encoder,
8623    ___E: ::fidl_next::fuchsia::HandleEncoder,
8624{
8625    #[inline]
8626    fn encode(
8627        self,
8628        encoder: &mut ___E,
8629        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8630    ) -> Result<(), ::fidl_next::EncodeError> {
8631        ::fidl_next::munge! {
8632            let Self::Encoded {
8633                start_args,
8634
8635            } = out;
8636        }
8637
8638        ::fidl_next::Encode::encode(self.start_args, encoder, start_args)?;
8639
8640        Ok(())
8641    }
8642}
8643
8644impl ::fidl_next::EncodableOption for DriverStartRequest {
8645    type EncodedOption = ::fidl_next::WireBox<'static, WireDriverStartRequest<'static>>;
8646}
8647
8648unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DriverStartRequest
8649where
8650    ___E: ::fidl_next::Encoder + ?Sized,
8651    DriverStartRequest: ::fidl_next::Encode<___E>,
8652{
8653    #[inline]
8654    fn encode_option(
8655        this: Option<Self>,
8656        encoder: &mut ___E,
8657        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8658    ) -> Result<(), ::fidl_next::EncodeError> {
8659        if let Some(inner) = this {
8660            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8661            ::fidl_next::WireBox::encode_present(out);
8662        } else {
8663            ::fidl_next::WireBox::encode_absent(out);
8664        }
8665
8666        Ok(())
8667    }
8668}
8669
8670impl<'de> ::fidl_next::FromWire<WireDriverStartRequest<'de>> for DriverStartRequest {
8671    #[inline]
8672    fn from_wire(wire: WireDriverStartRequest<'de>) -> Self {
8673        Self { start_args: ::fidl_next::FromWire::from_wire(wire.start_args) }
8674    }
8675}
8676
8677/// The wire type corresponding to [`DriverStartRequest`].
8678#[derive(Debug)]
8679#[repr(C)]
8680pub struct WireDriverStartRequest<'de> {
8681    pub start_args: crate::WireDriverStartArgs<'de>,
8682}
8683
8684unsafe impl ::fidl_next::Wire for WireDriverStartRequest<'static> {
8685    type Decoded<'de> = WireDriverStartRequest<'de>;
8686
8687    #[inline]
8688    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
8689}
8690
8691unsafe impl<___D> ::fidl_next::Decode<___D> for WireDriverStartRequest<'static>
8692where
8693    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8694    ___D: ::fidl_next::Decoder,
8695    ___D: ::fidl_next::fuchsia::HandleDecoder,
8696{
8697    fn decode(
8698        slot: ::fidl_next::Slot<'_, Self>,
8699        decoder: &mut ___D,
8700    ) -> Result<(), ::fidl_next::DecodeError> {
8701        ::fidl_next::munge! {
8702            let Self {
8703                mut start_args,
8704
8705            } = slot;
8706        }
8707
8708        ::fidl_next::Decode::decode(start_args.as_mut(), decoder)?;
8709
8710        Ok(())
8711    }
8712}
8713
8714/// The type corresponding to the Driver protocol.
8715#[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"]
8716#[derive(Debug)]
8717pub struct Driver;
8718
8719pub mod driver {
8720    pub mod prelude {
8721        pub use crate::{Driver, DriverClientHandler, DriverServerHandler, driver};
8722
8723        pub use crate::DriverStartRequest;
8724
8725        pub use crate::DriverStartResponse;
8726    }
8727
8728    pub struct Start;
8729
8730    impl ::fidl_next::Method for Start {
8731        const ORDINAL: u64 = 2863727161496985794;
8732
8733        type Protocol = crate::Driver;
8734
8735        type Request = crate::WireDriverStartRequest<'static>;
8736
8737        type Response = ::fidl_next::WireFlexibleResult<
8738            'static,
8739            crate::WireDriverStartResponse,
8740            ::fidl_next::WireI32,
8741        >;
8742    }
8743
8744    pub struct Stop;
8745
8746    impl ::fidl_next::Method for Stop {
8747        const ORDINAL: u64 = 5446759044519003197;
8748
8749        type Protocol = crate::Driver;
8750
8751        type Request = ();
8752
8753        type Response = ::fidl_next::Never;
8754    }
8755
8756    mod ___detail {
8757
8758        pub struct Start<T0> {
8759            start_args: T0,
8760        }
8761
8762        impl<T0> ::fidl_next::Encodable for Start<T0>
8763        where
8764            T0: ::fidl_next::Encodable<Encoded = crate::WireDriverStartArgs<'static>>,
8765        {
8766            type Encoded = crate::WireDriverStartRequest<'static>;
8767        }
8768
8769        unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Start<T0>
8770        where
8771            ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8772            ___E: ::fidl_next::Encoder,
8773            ___E: ::fidl_next::fuchsia::HandleEncoder,
8774            T0: ::fidl_next::Encode<___E, Encoded = crate::WireDriverStartArgs<'static>>,
8775        {
8776            #[inline]
8777            fn encode(
8778                self,
8779                encoder: &mut ___E,
8780                out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8781            ) -> Result<(), ::fidl_next::EncodeError> {
8782                ::fidl_next::munge! {
8783                    let Self::Encoded {
8784                        start_args,
8785
8786                    } = out;
8787                }
8788
8789                ::fidl_next::Encode::encode(self.start_args, encoder, start_args)?;
8790
8791                Ok(())
8792            }
8793        }
8794
8795        unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Driver
8796        where
8797            ___T: ::fidl_next::Transport,
8798        {
8799            type ClientSender = DriverClientSender<___T>;
8800            type ServerSender = DriverServerSender<___T>;
8801        }
8802
8803        /// The client sender for the `Driver` protocol.
8804        #[repr(transparent)]
8805        pub struct DriverClientSender<___T: ::fidl_next::Transport> {
8806            #[allow(dead_code)]
8807            sender: ::fidl_next::protocol::ClientSender<___T>,
8808        }
8809
8810        impl<___T> DriverClientSender<___T>
8811        where
8812            ___T: ::fidl_next::Transport,
8813        {
8814            #[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"]
8815            pub fn start(
8816                &self,
8817
8818                start_args: impl ::fidl_next::Encode<
8819                    <___T as ::fidl_next::Transport>::SendBuffer,
8820                    Encoded = crate::WireDriverStartArgs<'static>,
8821                >,
8822            ) -> ::fidl_next::TwoWayFuture<'_, super::Start, ___T>
8823            where
8824                <___T as ::fidl_next::Transport>::SendBuffer:
8825                    ::fidl_next::encoder::InternalHandleEncoder,
8826                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
8827                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
8828            {
8829                self.start_with(Start { start_args })
8830            }
8831
8832            #[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"]
8833            pub fn start_with<___R>(
8834                &self,
8835                request: ___R,
8836            ) -> ::fidl_next::TwoWayFuture<'_, super::Start, ___T>
8837            where
8838                ___R: ::fidl_next::Encode<
8839                        <___T as ::fidl_next::Transport>::SendBuffer,
8840                        Encoded = crate::WireDriverStartRequest<'static>,
8841                    >,
8842            {
8843                ::fidl_next::TwoWayFuture::from_untyped(
8844                    self.sender.send_two_way(2863727161496985794, request),
8845                )
8846            }
8847
8848            #[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"]
8849            pub fn stop(&self) -> ::fidl_next::SendFuture<'_, ___T> {
8850                ::fidl_next::SendFuture::from_untyped(
8851                    self.sender.send_one_way(5446759044519003197, ()),
8852                )
8853            }
8854        }
8855
8856        /// The server sender for the `Driver` protocol.
8857        #[repr(transparent)]
8858        pub struct DriverServerSender<___T: ::fidl_next::Transport> {
8859            sender: ::fidl_next::protocol::ServerSender<___T>,
8860        }
8861
8862        impl<___T> DriverServerSender<___T> where ___T: ::fidl_next::Transport {}
8863    }
8864}
8865
8866/// A client handler for the Driver protocol.
8867///
8868/// See [`Driver`] for more details.
8869pub trait DriverClientHandler<
8870    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
8871    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
8872>
8873{
8874    fn on_unknown_interaction(
8875        &mut self,
8876        sender: &::fidl_next::ClientSender<Driver, ___T>,
8877        ordinal: u64,
8878    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
8879        sender.close();
8880        ::core::future::ready(())
8881    }
8882}
8883
8884impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Driver
8885where
8886    ___H: DriverClientHandler<___T> + ::core::marker::Send,
8887    ___T: ::fidl_next::Transport,
8888    <driver::Start as ::fidl_next::Method>::Response:
8889        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
8890{
8891    async fn on_event(
8892        handler: &mut ___H,
8893        sender: &::fidl_next::ClientSender<Self, ___T>,
8894        ordinal: u64,
8895        buffer: ___T::RecvBuffer,
8896    ) {
8897        match ordinal {
8898            ordinal => handler.on_unknown_interaction(sender, ordinal).await,
8899        }
8900    }
8901}
8902
8903/// A server handler for the Driver protocol.
8904///
8905/// See [`Driver`] for more details.
8906pub trait DriverServerHandler<
8907    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
8908    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
8909>
8910{
8911    #[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"]
8912    fn start(
8913        &mut self,
8914        sender: &::fidl_next::ServerSender<Driver, ___T>,
8915
8916        request: ::fidl_next::Request<driver::Start, ___T>,
8917
8918        responder: ::fidl_next::Responder<driver::Start>,
8919    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
8920
8921    #[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"]
8922    fn stop(
8923        &mut self,
8924        sender: &::fidl_next::ServerSender<Driver, ___T>,
8925    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
8926
8927    fn on_unknown_interaction(
8928        &mut self,
8929        sender: &::fidl_next::ServerSender<Driver, ___T>,
8930        ordinal: u64,
8931    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
8932        sender.close();
8933        ::core::future::ready(())
8934    }
8935}
8936
8937impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Driver
8938where
8939    ___H: DriverServerHandler<___T> + ::core::marker::Send,
8940    ___T: ::fidl_next::Transport,
8941    <driver::Start as ::fidl_next::Method>::Request:
8942        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
8943{
8944    async fn on_one_way(
8945        handler: &mut ___H,
8946        sender: &::fidl_next::ServerSender<Self, ___T>,
8947        ordinal: u64,
8948        buffer: ___T::RecvBuffer,
8949    ) {
8950        match ordinal {
8951            5446759044519003197 => {
8952                handler.stop(sender).await;
8953            }
8954
8955            ordinal => handler.on_unknown_interaction(sender, ordinal).await,
8956        }
8957    }
8958
8959    async fn on_two_way(
8960        handler: &mut ___H,
8961        sender: &::fidl_next::ServerSender<Self, ___T>,
8962        ordinal: u64,
8963        buffer: ___T::RecvBuffer,
8964        responder: ::fidl_next::protocol::Responder,
8965    ) {
8966        match ordinal {
8967            2863727161496985794 => {
8968                let responder = ::fidl_next::Responder::from_untyped(responder);
8969
8970                match ::fidl_next::DecoderExt::decode(buffer) {
8971                    Ok(decoded) => handler.start(sender, decoded, responder).await,
8972                    Err(e) => sender.close(),
8973                }
8974            }
8975
8976            ordinal => handler.on_unknown_interaction(sender, ordinal).await,
8977        }
8978    }
8979}
8980
8981#[derive(Debug)]
8982pub enum DriverResult {
8983    DriverStartedNodeToken(::fidl_next::fuchsia::zx::Event),
8984
8985    MatchError(i32),
8986
8987    StartError(i32),
8988
8989    UnknownOrdinal_(u64),
8990}
8991
8992impl ::fidl_next::Encodable for DriverResult {
8993    type Encoded = WireDriverResult;
8994}
8995
8996unsafe impl<___E> ::fidl_next::Encode<___E> for DriverResult
8997where
8998    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8999    ___E: ::fidl_next::fuchsia::HandleEncoder,
9000{
9001    #[inline]
9002    fn encode(
9003        self,
9004        encoder: &mut ___E,
9005        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9006    ) -> Result<(), ::fidl_next::EncodeError> {
9007        ::fidl_next::munge!(let WireDriverResult { raw, _phantom: _ } = out);
9008
9009        match self {
9010            Self::DriverStartedNodeToken(value) => ::fidl_next::RawWireUnion::encode_as_static::<
9011                ___E,
9012                ::fidl_next::fuchsia::zx::Event,
9013            >(value, 1, encoder, raw)?,
9014
9015            Self::MatchError(value) => {
9016                ::fidl_next::RawWireUnion::encode_as_static::<___E, i32>(value, 2, encoder, raw)?
9017            }
9018
9019            Self::StartError(value) => {
9020                ::fidl_next::RawWireUnion::encode_as_static::<___E, i32>(value, 3, encoder, raw)?
9021            }
9022
9023            Self::UnknownOrdinal_(ordinal) => {
9024                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
9025            }
9026        }
9027
9028        Ok(())
9029    }
9030}
9031
9032impl ::fidl_next::EncodableOption for DriverResult {
9033    type EncodedOption = WireOptionalDriverResult;
9034}
9035
9036unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DriverResult
9037where
9038    ___E: ?Sized,
9039    DriverResult: ::fidl_next::Encode<___E>,
9040{
9041    #[inline]
9042    fn encode_option(
9043        this: Option<Self>,
9044        encoder: &mut ___E,
9045        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
9046    ) -> Result<(), ::fidl_next::EncodeError> {
9047        ::fidl_next::munge!(let WireOptionalDriverResult { raw, _phantom: _ } = &mut *out);
9048
9049        if let Some(inner) = this {
9050            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
9051            ::fidl_next::Encode::encode(inner, encoder, value_out)?;
9052        } else {
9053            ::fidl_next::RawWireUnion::encode_absent(raw);
9054        }
9055
9056        Ok(())
9057    }
9058}
9059
9060impl ::fidl_next::FromWire<WireDriverResult> for DriverResult {
9061    #[inline]
9062    fn from_wire(wire: WireDriverResult) -> Self {
9063        let wire = ::core::mem::ManuallyDrop::new(wire);
9064        match wire.raw.ordinal() {
9065            1 => Self::DriverStartedNodeToken(::fidl_next::FromWire::from_wire(unsafe {
9066                wire.raw.get().read_unchecked::<::fidl_next::fuchsia::WireEvent>()
9067            })),
9068
9069            2 => Self::MatchError(::fidl_next::FromWire::from_wire(unsafe {
9070                wire.raw.get().read_unchecked::<::fidl_next::WireI32>()
9071            })),
9072
9073            3 => Self::StartError(::fidl_next::FromWire::from_wire(unsafe {
9074                wire.raw.get().read_unchecked::<::fidl_next::WireI32>()
9075            })),
9076
9077            _ => unsafe { ::core::hint::unreachable_unchecked() },
9078        }
9079    }
9080}
9081
9082impl ::fidl_next::FromWireOption<WireOptionalDriverResult> for Box<DriverResult> {
9083    #[inline]
9084    fn from_wire_option(wire: WireOptionalDriverResult) -> Option<Self> {
9085        if let Some(inner) = wire.into_option() {
9086            Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
9087        } else {
9088            None
9089        }
9090    }
9091}
9092
9093/// The wire type corresponding to [`DriverResult`].
9094#[repr(transparent)]
9095pub struct WireDriverResult {
9096    raw: ::fidl_next::RawWireUnion,
9097    _phantom: ::core::marker::PhantomData<()>,
9098}
9099
9100impl Drop for WireDriverResult {
9101    fn drop(&mut self) {
9102        match self.raw.ordinal() {
9103            1 => {
9104                let _ =
9105                    unsafe { self.raw.get().read_unchecked::<::fidl_next::fuchsia::WireEvent>() };
9106            }
9107
9108            2 => {
9109                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireI32>() };
9110            }
9111
9112            3 => {
9113                let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireI32>() };
9114            }
9115
9116            _ => (),
9117        }
9118    }
9119}
9120
9121unsafe impl ::fidl_next::Wire for WireDriverResult {
9122    type Decoded<'de> = WireDriverResult;
9123
9124    #[inline]
9125    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9126        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
9127        ::fidl_next::RawWireUnion::zero_padding(raw);
9128    }
9129}
9130
9131pub mod driver_result {
9132    pub enum Ref<'de> {
9133        DriverStartedNodeToken(&'de ::fidl_next::fuchsia::WireEvent),
9134
9135        MatchError(&'de ::fidl_next::WireI32),
9136
9137        StartError(&'de ::fidl_next::WireI32),
9138
9139        UnknownOrdinal_(u64),
9140    }
9141}
9142
9143impl WireDriverResult {
9144    pub fn as_ref(&self) -> crate::driver_result::Ref<'_> {
9145        match self.raw.ordinal() {
9146            1 => crate::driver_result::Ref::DriverStartedNodeToken(unsafe {
9147                self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireEvent>()
9148            }),
9149
9150            2 => crate::driver_result::Ref::MatchError(unsafe {
9151                self.raw.get().deref_unchecked::<::fidl_next::WireI32>()
9152            }),
9153
9154            3 => crate::driver_result::Ref::StartError(unsafe {
9155                self.raw.get().deref_unchecked::<::fidl_next::WireI32>()
9156            }),
9157
9158            unknown => crate::driver_result::Ref::UnknownOrdinal_(unknown),
9159        }
9160    }
9161}
9162
9163unsafe impl<___D> ::fidl_next::Decode<___D> for WireDriverResult
9164where
9165    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
9166    ___D: ::fidl_next::fuchsia::HandleDecoder,
9167{
9168    fn decode(
9169        mut slot: ::fidl_next::Slot<'_, Self>,
9170        decoder: &mut ___D,
9171    ) -> Result<(), ::fidl_next::DecodeError> {
9172        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
9173        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
9174            1 => ::fidl_next::RawWireUnion::decode_as_static::<
9175                ___D,
9176                ::fidl_next::fuchsia::WireEvent,
9177            >(raw, decoder)?,
9178
9179            2 => ::fidl_next::RawWireUnion::decode_as_static::<___D, ::fidl_next::WireI32>(
9180                raw, decoder,
9181            )?,
9182
9183            3 => ::fidl_next::RawWireUnion::decode_as_static::<___D, ::fidl_next::WireI32>(
9184                raw, decoder,
9185            )?,
9186
9187            _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
9188        }
9189
9190        Ok(())
9191    }
9192}
9193
9194impl ::core::fmt::Debug for WireDriverResult {
9195    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
9196        match self.raw.ordinal() {
9197            1 => unsafe {
9198                self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireEvent>().fmt(f)
9199            },
9200            2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI32>().fmt(f) },
9201            3 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI32>().fmt(f) },
9202            _ => unsafe { ::core::hint::unreachable_unchecked() },
9203        }
9204    }
9205}
9206
9207#[repr(transparent)]
9208pub struct WireOptionalDriverResult {
9209    raw: ::fidl_next::RawWireUnion,
9210    _phantom: ::core::marker::PhantomData<()>,
9211}
9212
9213unsafe impl ::fidl_next::Wire for WireOptionalDriverResult {
9214    type Decoded<'de> = WireOptionalDriverResult;
9215
9216    #[inline]
9217    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9218        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
9219        ::fidl_next::RawWireUnion::zero_padding(raw);
9220    }
9221}
9222
9223impl WireOptionalDriverResult {
9224    pub fn is_some(&self) -> bool {
9225        self.raw.is_some()
9226    }
9227
9228    pub fn is_none(&self) -> bool {
9229        self.raw.is_none()
9230    }
9231
9232    pub fn as_ref(&self) -> Option<&WireDriverResult> {
9233        if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
9234    }
9235
9236    pub fn into_option(self) -> Option<WireDriverResult> {
9237        if self.is_some() {
9238            Some(WireDriverResult { raw: self.raw, _phantom: ::core::marker::PhantomData })
9239        } else {
9240            None
9241        }
9242    }
9243}
9244
9245unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDriverResult
9246where
9247    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
9248    ___D: ::fidl_next::fuchsia::HandleDecoder,
9249{
9250    fn decode(
9251        mut slot: ::fidl_next::Slot<'_, Self>,
9252        decoder: &mut ___D,
9253    ) -> Result<(), ::fidl_next::DecodeError> {
9254        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
9255        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
9256            1 => ::fidl_next::RawWireUnion::decode_as_static::<
9257                ___D,
9258                ::fidl_next::fuchsia::WireEvent,
9259            >(raw, decoder)?,
9260
9261            2 => ::fidl_next::RawWireUnion::decode_as_static::<___D, ::fidl_next::WireI32>(
9262                raw, decoder,
9263            )?,
9264
9265            3 => ::fidl_next::RawWireUnion::decode_as_static::<___D, ::fidl_next::WireI32>(
9266                raw, decoder,
9267            )?,
9268
9269            0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
9270            _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
9271        }
9272
9273        Ok(())
9274    }
9275}
9276
9277impl ::core::fmt::Debug for WireOptionalDriverResult {
9278    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
9279        self.as_ref().fmt(f)
9280    }
9281}
9282
9283pub const MAX_RESOURCE_NAME_LENGTH: u8 = 128;
9284
9285pub type NodeAddChildResponse = ();
9286
9287/// The wire type corresponding to [`NodeAddChildResponse`].
9288pub type WireNodeAddChildResponse = ();
9289
9290#[doc = " Error codes for the Node protocol.\n"]
9291#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9292#[repr(u32)]
9293pub enum NodeError {
9294    Internal = 1,
9295    NodeRemoved = 2,
9296    NameMissing = 3,
9297    NameInvalid = 4,
9298    NameAlreadyExists = 5,
9299    OfferSourceNameMissing = 6,
9300    OfferRefExists = 7,
9301    SymbolNameMissing = 8,
9302    SymbolAddressMissing = 9,
9303    SymbolAlreadyExists = 10,
9304    UnbindChildrenInProgress = 11,
9305    UnsupportedArgs = 12,
9306    DuplicatePropertyKeys = 13,
9307    OfferSourceInstanceFilterMissing = 14,
9308    OfferRenamedInstancesMissing = 15,
9309    UnknownOrdinal_(u32),
9310}
9311
9312impl ::fidl_next::Encodable for NodeError {
9313    type Encoded = WireNodeError;
9314}
9315impl ::std::convert::From<u32> for NodeError {
9316    fn from(value: u32) -> Self {
9317        match value {
9318            1 => Self::Internal,
9319            2 => Self::NodeRemoved,
9320            3 => Self::NameMissing,
9321            4 => Self::NameInvalid,
9322            5 => Self::NameAlreadyExists,
9323            6 => Self::OfferSourceNameMissing,
9324            7 => Self::OfferRefExists,
9325            8 => Self::SymbolNameMissing,
9326            9 => Self::SymbolAddressMissing,
9327            10 => Self::SymbolAlreadyExists,
9328            11 => Self::UnbindChildrenInProgress,
9329            12 => Self::UnsupportedArgs,
9330            13 => Self::DuplicatePropertyKeys,
9331            14 => Self::OfferSourceInstanceFilterMissing,
9332            15 => Self::OfferRenamedInstancesMissing,
9333
9334            _ => Self::UnknownOrdinal_(value),
9335        }
9336    }
9337}
9338
9339unsafe impl<___E> ::fidl_next::Encode<___E> for NodeError
9340where
9341    ___E: ?Sized,
9342{
9343    #[inline]
9344    fn encode(
9345        self,
9346        encoder: &mut ___E,
9347        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9348    ) -> Result<(), ::fidl_next::EncodeError> {
9349        ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
9350    }
9351}
9352
9353unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeError
9354where
9355    ___E: ?Sized,
9356{
9357    #[inline]
9358    fn encode_ref(
9359        &self,
9360        encoder: &mut ___E,
9361        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9362    ) -> Result<(), ::fidl_next::EncodeError> {
9363        ::fidl_next::munge!(let WireNodeError { value } = out);
9364        let _ = value.write(::fidl_next::WireU32::from(match *self {
9365            Self::Internal => 1,
9366
9367            Self::NodeRemoved => 2,
9368
9369            Self::NameMissing => 3,
9370
9371            Self::NameInvalid => 4,
9372
9373            Self::NameAlreadyExists => 5,
9374
9375            Self::OfferSourceNameMissing => 6,
9376
9377            Self::OfferRefExists => 7,
9378
9379            Self::SymbolNameMissing => 8,
9380
9381            Self::SymbolAddressMissing => 9,
9382
9383            Self::SymbolAlreadyExists => 10,
9384
9385            Self::UnbindChildrenInProgress => 11,
9386
9387            Self::UnsupportedArgs => 12,
9388
9389            Self::DuplicatePropertyKeys => 13,
9390
9391            Self::OfferSourceInstanceFilterMissing => 14,
9392
9393            Self::OfferRenamedInstancesMissing => 15,
9394
9395            Self::UnknownOrdinal_(value) => value,
9396        }));
9397
9398        Ok(())
9399    }
9400}
9401
9402impl ::core::convert::From<WireNodeError> for NodeError {
9403    fn from(wire: WireNodeError) -> Self {
9404        match u32::from(wire.value) {
9405            1 => Self::Internal,
9406
9407            2 => Self::NodeRemoved,
9408
9409            3 => Self::NameMissing,
9410
9411            4 => Self::NameInvalid,
9412
9413            5 => Self::NameAlreadyExists,
9414
9415            6 => Self::OfferSourceNameMissing,
9416
9417            7 => Self::OfferRefExists,
9418
9419            8 => Self::SymbolNameMissing,
9420
9421            9 => Self::SymbolAddressMissing,
9422
9423            10 => Self::SymbolAlreadyExists,
9424
9425            11 => Self::UnbindChildrenInProgress,
9426
9427            12 => Self::UnsupportedArgs,
9428
9429            13 => Self::DuplicatePropertyKeys,
9430
9431            14 => Self::OfferSourceInstanceFilterMissing,
9432
9433            15 => Self::OfferRenamedInstancesMissing,
9434
9435            value => Self::UnknownOrdinal_(value),
9436        }
9437    }
9438}
9439
9440impl ::fidl_next::FromWire<WireNodeError> for NodeError {
9441    #[inline]
9442    fn from_wire(wire: WireNodeError) -> Self {
9443        Self::from(wire)
9444    }
9445}
9446
9447impl ::fidl_next::FromWireRef<WireNodeError> for NodeError {
9448    #[inline]
9449    fn from_wire_ref(wire: &WireNodeError) -> Self {
9450        Self::from(*wire)
9451    }
9452}
9453
9454/// The wire type corresponding to [`NodeError`].
9455#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9456#[repr(transparent)]
9457pub struct WireNodeError {
9458    value: ::fidl_next::WireU32,
9459}
9460
9461unsafe impl ::fidl_next::Wire for WireNodeError {
9462    type Decoded<'de> = Self;
9463
9464    #[inline]
9465    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
9466        // Wire enums have no padding
9467    }
9468}
9469
9470impl WireNodeError {
9471    pub const INTERNAL: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(1) };
9472
9473    pub const NODE_REMOVED: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(2) };
9474
9475    pub const NAME_MISSING: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(3) };
9476
9477    pub const NAME_INVALID: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(4) };
9478
9479    pub const NAME_ALREADY_EXISTS: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(5) };
9480
9481    pub const OFFER_SOURCE_NAME_MISSING: WireNodeError =
9482        WireNodeError { value: ::fidl_next::WireU32(6) };
9483
9484    pub const OFFER_REF_EXISTS: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(7) };
9485
9486    pub const SYMBOL_NAME_MISSING: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(8) };
9487
9488    pub const SYMBOL_ADDRESS_MISSING: WireNodeError =
9489        WireNodeError { value: ::fidl_next::WireU32(9) };
9490
9491    pub const SYMBOL_ALREADY_EXISTS: WireNodeError =
9492        WireNodeError { value: ::fidl_next::WireU32(10) };
9493
9494    pub const UNBIND_CHILDREN_IN_PROGRESS: WireNodeError =
9495        WireNodeError { value: ::fidl_next::WireU32(11) };
9496
9497    pub const UNSUPPORTED_ARGS: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(12) };
9498
9499    pub const DUPLICATE_PROPERTY_KEYS: WireNodeError =
9500        WireNodeError { value: ::fidl_next::WireU32(13) };
9501
9502    pub const OFFER_SOURCE_INSTANCE_FILTER_MISSING: WireNodeError =
9503        WireNodeError { value: ::fidl_next::WireU32(14) };
9504
9505    pub const OFFER_RENAMED_INSTANCES_MISSING: WireNodeError =
9506        WireNodeError { value: ::fidl_next::WireU32(15) };
9507}
9508
9509unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeError
9510where
9511    ___D: ?Sized,
9512{
9513    fn decode(
9514        slot: ::fidl_next::Slot<'_, Self>,
9515        _: &mut ___D,
9516    ) -> Result<(), ::fidl_next::DecodeError> {
9517        Ok(())
9518    }
9519}
9520
9521impl ::core::convert::From<NodeError> for WireNodeError {
9522    fn from(natural: NodeError) -> Self {
9523        match natural {
9524            NodeError::Internal => WireNodeError::INTERNAL,
9525
9526            NodeError::NodeRemoved => WireNodeError::NODE_REMOVED,
9527
9528            NodeError::NameMissing => WireNodeError::NAME_MISSING,
9529
9530            NodeError::NameInvalid => WireNodeError::NAME_INVALID,
9531
9532            NodeError::NameAlreadyExists => WireNodeError::NAME_ALREADY_EXISTS,
9533
9534            NodeError::OfferSourceNameMissing => WireNodeError::OFFER_SOURCE_NAME_MISSING,
9535
9536            NodeError::OfferRefExists => WireNodeError::OFFER_REF_EXISTS,
9537
9538            NodeError::SymbolNameMissing => WireNodeError::SYMBOL_NAME_MISSING,
9539
9540            NodeError::SymbolAddressMissing => WireNodeError::SYMBOL_ADDRESS_MISSING,
9541
9542            NodeError::SymbolAlreadyExists => WireNodeError::SYMBOL_ALREADY_EXISTS,
9543
9544            NodeError::UnbindChildrenInProgress => WireNodeError::UNBIND_CHILDREN_IN_PROGRESS,
9545
9546            NodeError::UnsupportedArgs => WireNodeError::UNSUPPORTED_ARGS,
9547
9548            NodeError::DuplicatePropertyKeys => WireNodeError::DUPLICATE_PROPERTY_KEYS,
9549
9550            NodeError::OfferSourceInstanceFilterMissing => {
9551                WireNodeError::OFFER_SOURCE_INSTANCE_FILTER_MISSING
9552            }
9553
9554            NodeError::OfferRenamedInstancesMissing => {
9555                WireNodeError::OFFER_RENAMED_INSTANCES_MISSING
9556            }
9557
9558            NodeError::UnknownOrdinal_(value) => {
9559                WireNodeError { value: ::fidl_next::WireU32::from(value) }
9560            }
9561        }
9562    }
9563}
9564
9565#[doc = " Arguments for adding a node.\n"]
9566#[derive(Debug, Default)]
9567pub struct NodeAddArgs {
9568    pub name: Option<String>,
9569
9570    pub symbols: Option<Vec<crate::NodeSymbol>>,
9571
9572    pub properties: Option<Vec<crate::NodeProperty>>,
9573
9574    pub devfs_args: Option<crate::DevfsAddArgs>,
9575
9576    pub offers2: Option<Vec<crate::Offer>>,
9577
9578    pub bus_info: Option<crate::BusInfo>,
9579
9580    pub properties2: Option<Vec<crate::NodeProperty2>>,
9581}
9582
9583impl NodeAddArgs {
9584    fn __max_ordinal(&self) -> usize {
9585        if self.properties2.is_some() {
9586            return 8;
9587        }
9588
9589        if self.bus_info.is_some() {
9590            return 7;
9591        }
9592
9593        if self.offers2.is_some() {
9594            return 6;
9595        }
9596
9597        if self.devfs_args.is_some() {
9598            return 5;
9599        }
9600
9601        if self.properties.is_some() {
9602            return 4;
9603        }
9604
9605        if self.symbols.is_some() {
9606            return 3;
9607        }
9608
9609        if self.name.is_some() {
9610            return 1;
9611        }
9612
9613        0
9614    }
9615}
9616
9617impl ::fidl_next::Encodable for NodeAddArgs {
9618    type Encoded = WireNodeAddArgs<'static>;
9619}
9620
9621unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAddArgs
9622where
9623    ___E: ::fidl_next::Encoder + ?Sized,
9624    ___E: ::fidl_next::fuchsia::HandleEncoder,
9625{
9626    #[inline]
9627    fn encode(
9628        mut self,
9629        encoder: &mut ___E,
9630        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9631    ) -> Result<(), ::fidl_next::EncodeError> {
9632        ::fidl_next::munge!(let WireNodeAddArgs { table } = out);
9633
9634        let max_ord = self.__max_ordinal();
9635
9636        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9637        ::fidl_next::Wire::zero_padding(&mut out);
9638
9639        let mut preallocated =
9640            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9641
9642        for i in 1..=max_ord {
9643            match i {
9644                8 => {
9645                    if let Some(properties2) = self.properties2.take() {
9646                        ::fidl_next::WireEnvelope::encode_value(
9647                            properties2,
9648                            preallocated.encoder,
9649                            &mut out,
9650                        )?;
9651                    } else {
9652                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
9653                    }
9654                }
9655
9656                7 => {
9657                    if let Some(bus_info) = self.bus_info.take() {
9658                        ::fidl_next::WireEnvelope::encode_value(
9659                            bus_info,
9660                            preallocated.encoder,
9661                            &mut out,
9662                        )?;
9663                    } else {
9664                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
9665                    }
9666                }
9667
9668                6 => {
9669                    if let Some(offers2) = self.offers2.take() {
9670                        ::fidl_next::WireEnvelope::encode_value(
9671                            offers2,
9672                            preallocated.encoder,
9673                            &mut out,
9674                        )?;
9675                    } else {
9676                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
9677                    }
9678                }
9679
9680                5 => {
9681                    if let Some(devfs_args) = self.devfs_args.take() {
9682                        ::fidl_next::WireEnvelope::encode_value(
9683                            devfs_args,
9684                            preallocated.encoder,
9685                            &mut out,
9686                        )?;
9687                    } else {
9688                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
9689                    }
9690                }
9691
9692                4 => {
9693                    if let Some(properties) = self.properties.take() {
9694                        ::fidl_next::WireEnvelope::encode_value(
9695                            properties,
9696                            preallocated.encoder,
9697                            &mut out,
9698                        )?;
9699                    } else {
9700                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
9701                    }
9702                }
9703
9704                3 => {
9705                    if let Some(symbols) = self.symbols.take() {
9706                        ::fidl_next::WireEnvelope::encode_value(
9707                            symbols,
9708                            preallocated.encoder,
9709                            &mut out,
9710                        )?;
9711                    } else {
9712                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
9713                    }
9714                }
9715
9716                1 => {
9717                    if let Some(name) = self.name.take() {
9718                        ::fidl_next::WireEnvelope::encode_value(
9719                            name,
9720                            preallocated.encoder,
9721                            &mut out,
9722                        )?;
9723                    } else {
9724                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
9725                    }
9726                }
9727
9728                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9729            }
9730            unsafe {
9731                preallocated.write_next(out.assume_init_ref());
9732            }
9733        }
9734
9735        ::fidl_next::WireTable::encode_len(table, max_ord);
9736
9737        Ok(())
9738    }
9739}
9740
9741impl<'de> ::fidl_next::FromWire<WireNodeAddArgs<'de>> for NodeAddArgs {
9742    #[inline]
9743    fn from_wire(wire: WireNodeAddArgs<'de>) -> Self {
9744        let wire = ::core::mem::ManuallyDrop::new(wire);
9745
9746        let name = wire.table.get(1);
9747
9748        let symbols = wire.table.get(3);
9749
9750        let properties = wire.table.get(4);
9751
9752        let devfs_args = wire.table.get(5);
9753
9754        let offers2 = wire.table.get(6);
9755
9756        let bus_info = wire.table.get(7);
9757
9758        let properties2 = wire.table.get(8);
9759
9760        Self {
9761
9762
9763                name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
9764                    unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
9765                )),
9766
9767
9768                symbols: symbols.map(|envelope| ::fidl_next::FromWire::from_wire(
9769                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeSymbol<'de>>>() }
9770                )),
9771
9772
9773                properties: properties.map(|envelope| ::fidl_next::FromWire::from_wire(
9774                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeProperty<'de>>>() }
9775                )),
9776
9777
9778                devfs_args: devfs_args.map(|envelope| ::fidl_next::FromWire::from_wire(
9779                    unsafe { envelope.read_unchecked::<crate::WireDevfsAddArgs<'de>>() }
9780                )),
9781
9782
9783                offers2: offers2.map(|envelope| ::fidl_next::FromWire::from_wire(
9784                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireOffer<'de>>>() }
9785                )),
9786
9787
9788                bus_info: bus_info.map(|envelope| ::fidl_next::FromWire::from_wire(
9789                    unsafe { envelope.read_unchecked::<crate::WireBusInfo<'de>>() }
9790                )),
9791
9792
9793                properties2: properties2.map(|envelope| ::fidl_next::FromWire::from_wire(
9794                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeProperty2<'de>>>() }
9795                )),
9796
9797        }
9798    }
9799}
9800
9801/// The wire type corresponding to [`NodeAddArgs`].
9802#[repr(C)]
9803pub struct WireNodeAddArgs<'de> {
9804    table: ::fidl_next::WireTable<'de>,
9805}
9806
9807impl<'de> Drop for WireNodeAddArgs<'de> {
9808    fn drop(&mut self) {
9809        let _ = self
9810            .table
9811            .get(1)
9812            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
9813
9814        let _ = self.table.get(3).map(|envelope| unsafe {
9815            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeSymbol<'de>>>()
9816        });
9817
9818        let _ = self.table.get(4).map(|envelope| unsafe {
9819            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeProperty<'de>>>()
9820        });
9821
9822        let _ = self
9823            .table
9824            .get(5)
9825            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDevfsAddArgs<'de>>() });
9826
9827        let _ = self.table.get(6).map(|envelope| unsafe {
9828            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireOffer<'de>>>()
9829        });
9830
9831        let _ = self
9832            .table
9833            .get(7)
9834            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireBusInfo<'de>>() });
9835
9836        let _ = self.table.get(8).map(|envelope| unsafe {
9837            envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNodeProperty2<'de>>>()
9838        });
9839    }
9840}
9841
9842unsafe impl ::fidl_next::Wire for WireNodeAddArgs<'static> {
9843    type Decoded<'de> = WireNodeAddArgs<'de>;
9844
9845    #[inline]
9846    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9847        ::fidl_next::munge!(let Self { table } = out);
9848        ::fidl_next::WireTable::zero_padding(table);
9849    }
9850}
9851
9852unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAddArgs<'static>
9853where
9854    ___D: ::fidl_next::Decoder + ?Sized,
9855    ___D: ::fidl_next::fuchsia::HandleDecoder,
9856{
9857    fn decode(
9858        slot: ::fidl_next::Slot<'_, Self>,
9859        decoder: &mut ___D,
9860    ) -> Result<(), ::fidl_next::DecodeError> {
9861        ::fidl_next::munge!(let Self { table } = slot);
9862
9863        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9864            match ordinal {
9865                0 => unsafe { ::core::hint::unreachable_unchecked() },
9866
9867                1 => {
9868                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
9869                        slot.as_mut(),
9870                        decoder,
9871                    )?;
9872
9873                    let name = unsafe {
9874                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
9875                    };
9876
9877                    if name.len() > 128 {
9878                        return Err(::fidl_next::DecodeError::VectorTooLong {
9879                            size: name.len() as u64,
9880                            limit: 128,
9881                        });
9882                    }
9883
9884                    Ok(())
9885                }
9886
9887                3 => {
9888                    ::fidl_next::WireEnvelope::decode_as::<
9889                        ___D,
9890                        ::fidl_next::WireVector<'static, crate::WireNodeSymbol<'static>>,
9891                    >(slot.as_mut(), decoder)?;
9892
9893                    let symbols = unsafe {
9894                        slot
9895                                            .deref_unchecked()
9896                                            .deref_unchecked::<
9897                                                ::fidl_next::WireVector<'_, crate::WireNodeSymbol<'_>>
9898                                            >()
9899                    };
9900
9901                    if symbols.len() > 64 {
9902                        return Err(::fidl_next::DecodeError::VectorTooLong {
9903                            size: symbols.len() as u64,
9904                            limit: 64,
9905                        });
9906                    }
9907
9908                    Ok(())
9909                }
9910
9911                4 => {
9912                    ::fidl_next::WireEnvelope::decode_as::<
9913                        ___D,
9914                        ::fidl_next::WireVector<'static, crate::WireNodeProperty<'static>>,
9915                    >(slot.as_mut(), decoder)?;
9916
9917                    let properties = unsafe {
9918                        slot
9919                                            .deref_unchecked()
9920                                            .deref_unchecked::<
9921                                                ::fidl_next::WireVector<'_, crate::WireNodeProperty<'_>>
9922                                            >()
9923                    };
9924
9925                    if properties.len() > 64 {
9926                        return Err(::fidl_next::DecodeError::VectorTooLong {
9927                            size: properties.len() as u64,
9928                            limit: 64,
9929                        });
9930                    }
9931
9932                    Ok(())
9933                }
9934
9935                5 => {
9936                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDevfsAddArgs<'static>>(
9937                        slot.as_mut(),
9938                        decoder,
9939                    )?;
9940
9941                    Ok(())
9942                }
9943
9944                6 => {
9945                    ::fidl_next::WireEnvelope::decode_as::<
9946                        ___D,
9947                        ::fidl_next::WireVector<'static, crate::WireOffer<'static>>,
9948                    >(slot.as_mut(), decoder)?;
9949
9950                    let offers2 = unsafe {
9951                        slot.deref_unchecked()
9952                            .deref_unchecked::<::fidl_next::WireVector<'_, crate::WireOffer<'_>>>()
9953                    };
9954
9955                    if offers2.len() > 128 {
9956                        return Err(::fidl_next::DecodeError::VectorTooLong {
9957                            size: offers2.len() as u64,
9958                            limit: 128,
9959                        });
9960                    }
9961
9962                    Ok(())
9963                }
9964
9965                7 => {
9966                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireBusInfo<'static>>(
9967                        slot.as_mut(),
9968                        decoder,
9969                    )?;
9970
9971                    Ok(())
9972                }
9973
9974                8 => {
9975                    ::fidl_next::WireEnvelope::decode_as::<
9976                        ___D,
9977                        ::fidl_next::WireVector<'static, crate::WireNodeProperty2<'static>>,
9978                    >(slot.as_mut(), decoder)?;
9979
9980                    let properties2 = unsafe {
9981                        slot
9982                                            .deref_unchecked()
9983                                            .deref_unchecked::<
9984                                                ::fidl_next::WireVector<'_, crate::WireNodeProperty2<'_>>
9985                                            >()
9986                    };
9987
9988                    if properties2.len() > 64 {
9989                        return Err(::fidl_next::DecodeError::VectorTooLong {
9990                            size: properties2.len() as u64,
9991                            limit: 64,
9992                        });
9993                    }
9994
9995                    Ok(())
9996                }
9997
9998                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9999            }
10000        })
10001    }
10002}
10003
10004impl<'de> WireNodeAddArgs<'de> {
10005    pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
10006        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10007    }
10008
10009    pub fn symbols(&self) -> Option<&::fidl_next::WireVector<'de, crate::WireNodeSymbol<'de>>> {
10010        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10011    }
10012
10013    pub fn properties(
10014        &self,
10015    ) -> Option<&::fidl_next::WireVector<'de, crate::WireNodeProperty<'de>>> {
10016        unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10017    }
10018
10019    pub fn devfs_args(&self) -> Option<&crate::WireDevfsAddArgs<'de>> {
10020        unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10021    }
10022
10023    pub fn offers2(&self) -> Option<&::fidl_next::WireVector<'de, crate::WireOffer<'de>>> {
10024        unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10025    }
10026
10027    pub fn bus_info(&self) -> Option<&crate::WireBusInfo<'de>> {
10028        unsafe { Some(self.table.get(7)?.deref_unchecked()) }
10029    }
10030
10031    pub fn properties2(
10032        &self,
10033    ) -> Option<&::fidl_next::WireVector<'de, crate::WireNodeProperty2<'de>>> {
10034        unsafe { Some(self.table.get(8)?.deref_unchecked()) }
10035    }
10036}
10037
10038impl<'de> ::core::fmt::Debug for WireNodeAddArgs<'de> {
10039    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
10040        f.debug_struct("NodeAddArgs")
10041            .field("name", &self.name())
10042            .field("symbols", &self.symbols())
10043            .field("properties", &self.properties())
10044            .field("devfs_args", &self.devfs_args())
10045            .field("offers2", &self.offers2())
10046            .field("bus_info", &self.bus_info())
10047            .field("properties2", &self.properties2())
10048            .finish()
10049    }
10050}
10051
10052#[derive(Debug)]
10053pub struct NodeAddChildRequest {
10054    pub args: crate::NodeAddArgs,
10055
10056    pub controller:
10057        ::fidl_next::ServerEnd<crate::NodeController, ::fidl_next::fuchsia::zx::Channel>,
10058
10059    pub node: Option<::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel>>,
10060}
10061
10062impl ::fidl_next::Encodable for NodeAddChildRequest {
10063    type Encoded = WireNodeAddChildRequest<'static>;
10064}
10065
10066unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAddChildRequest
10067where
10068    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10069    ___E: ::fidl_next::Encoder,
10070    ___E: ::fidl_next::fuchsia::HandleEncoder,
10071{
10072    #[inline]
10073    fn encode(
10074        self,
10075        encoder: &mut ___E,
10076        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10077    ) -> Result<(), ::fidl_next::EncodeError> {
10078        ::fidl_next::munge! {
10079            let Self::Encoded {
10080                args,
10081                controller,
10082                node,
10083
10084            } = out;
10085        }
10086
10087        ::fidl_next::Encode::encode(self.args, encoder, args)?;
10088
10089        ::fidl_next::Encode::encode(self.controller, encoder, controller)?;
10090
10091        ::fidl_next::Encode::encode(self.node, encoder, node)?;
10092
10093        Ok(())
10094    }
10095}
10096
10097impl ::fidl_next::EncodableOption for NodeAddChildRequest {
10098    type EncodedOption = ::fidl_next::WireBox<'static, WireNodeAddChildRequest<'static>>;
10099}
10100
10101unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeAddChildRequest
10102where
10103    ___E: ::fidl_next::Encoder + ?Sized,
10104    NodeAddChildRequest: ::fidl_next::Encode<___E>,
10105{
10106    #[inline]
10107    fn encode_option(
10108        this: Option<Self>,
10109        encoder: &mut ___E,
10110        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10111    ) -> Result<(), ::fidl_next::EncodeError> {
10112        if let Some(inner) = this {
10113            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10114            ::fidl_next::WireBox::encode_present(out);
10115        } else {
10116            ::fidl_next::WireBox::encode_absent(out);
10117        }
10118
10119        Ok(())
10120    }
10121}
10122
10123impl<'de> ::fidl_next::FromWire<WireNodeAddChildRequest<'de>> for NodeAddChildRequest {
10124    #[inline]
10125    fn from_wire(wire: WireNodeAddChildRequest<'de>) -> Self {
10126        Self {
10127            args: ::fidl_next::FromWire::from_wire(wire.args),
10128
10129            controller: ::fidl_next::FromWire::from_wire(wire.controller),
10130
10131            node: ::fidl_next::FromWire::from_wire(wire.node),
10132        }
10133    }
10134}
10135
10136/// The wire type corresponding to [`NodeAddChildRequest`].
10137#[derive(Debug)]
10138#[repr(C)]
10139pub struct WireNodeAddChildRequest<'de> {
10140    pub args: crate::WireNodeAddArgs<'de>,
10141
10142    pub controller:
10143        ::fidl_next::ServerEnd<crate::NodeController, ::fidl_next::fuchsia::WireChannel>,
10144
10145    pub node: ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireOptionalChannel>,
10146}
10147
10148unsafe impl ::fidl_next::Wire for WireNodeAddChildRequest<'static> {
10149    type Decoded<'de> = WireNodeAddChildRequest<'de>;
10150
10151    #[inline]
10152    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
10153}
10154
10155unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAddChildRequest<'static>
10156where
10157    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10158    ___D: ::fidl_next::Decoder,
10159    ___D: ::fidl_next::fuchsia::HandleDecoder,
10160{
10161    fn decode(
10162        slot: ::fidl_next::Slot<'_, Self>,
10163        decoder: &mut ___D,
10164    ) -> Result<(), ::fidl_next::DecodeError> {
10165        ::fidl_next::munge! {
10166            let Self {
10167                mut args,
10168                mut controller,
10169                mut node,
10170
10171            } = slot;
10172        }
10173
10174        ::fidl_next::Decode::decode(args.as_mut(), decoder)?;
10175
10176        ::fidl_next::Decode::decode(controller.as_mut(), decoder)?;
10177
10178        ::fidl_next::Decode::decode(node.as_mut(), decoder)?;
10179
10180        Ok(())
10181    }
10182}
10183
10184/// The type corresponding to the Node protocol.
10185#[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"]
10186#[derive(Debug)]
10187pub struct Node;
10188
10189pub mod node {
10190    pub mod prelude {
10191        pub use crate::{Node, NodeClientHandler, NodeServerHandler, node};
10192
10193        pub use crate::NodeAddChildRequest;
10194
10195        pub use crate::NodeError;
10196
10197        pub use crate::NodeAddChildResponse;
10198    }
10199
10200    pub struct AddChild;
10201
10202    impl ::fidl_next::Method for AddChild {
10203        const ORDINAL: u64 = 8633697350522413353;
10204
10205        type Protocol = crate::Node;
10206
10207        type Request = crate::WireNodeAddChildRequest<'static>;
10208
10209        type Response = ::fidl_next::WireFlexibleResult<
10210            'static,
10211            crate::WireNodeAddChildResponse,
10212            crate::WireNodeError,
10213        >;
10214    }
10215
10216    mod ___detail {
10217
10218        pub struct AddChild<T0, T1, T2> {
10219            args: T0,
10220
10221            controller: T1,
10222
10223            node: T2,
10224        }
10225
10226        impl<T0, T1, T2> ::fidl_next::Encodable for AddChild<T0, T1, T2>
10227        where
10228            T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAddArgs<'static>>,
10229            T1: ::fidl_next::Encodable<
10230                    Encoded = ::fidl_next::ServerEnd<
10231                        crate::NodeController,
10232                        ::fidl_next::fuchsia::WireChannel,
10233                    >,
10234                >,
10235            T2: ::fidl_next::Encodable<
10236                    Encoded = ::fidl_next::ServerEnd<
10237                        crate::Node,
10238                        ::fidl_next::fuchsia::WireOptionalChannel,
10239                    >,
10240                >,
10241        {
10242            type Encoded = crate::WireNodeAddChildRequest<'static>;
10243        }
10244
10245        unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for AddChild<T0, T1, T2>
10246        where
10247            ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10248            ___E: ::fidl_next::Encoder,
10249            ___E: ::fidl_next::fuchsia::HandleEncoder,
10250            T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAddArgs<'static>>,
10251            T1: ::fidl_next::Encode<
10252                    ___E,
10253                    Encoded = ::fidl_next::ServerEnd<
10254                        crate::NodeController,
10255                        ::fidl_next::fuchsia::WireChannel,
10256                    >,
10257                >,
10258            T2: ::fidl_next::Encode<
10259                    ___E,
10260                    Encoded = ::fidl_next::ServerEnd<
10261                        crate::Node,
10262                        ::fidl_next::fuchsia::WireOptionalChannel,
10263                    >,
10264                >,
10265        {
10266            #[inline]
10267            fn encode(
10268                self,
10269                encoder: &mut ___E,
10270                out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10271            ) -> Result<(), ::fidl_next::EncodeError> {
10272                ::fidl_next::munge! {
10273                    let Self::Encoded {
10274                        args,
10275                        controller,
10276                        node,
10277
10278                    } = out;
10279                }
10280
10281                ::fidl_next::Encode::encode(self.args, encoder, args)?;
10282
10283                ::fidl_next::Encode::encode(self.controller, encoder, controller)?;
10284
10285                ::fidl_next::Encode::encode(self.node, encoder, node)?;
10286
10287                Ok(())
10288            }
10289        }
10290
10291        unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Node
10292        where
10293            ___T: ::fidl_next::Transport,
10294        {
10295            type ClientSender = NodeClientSender<___T>;
10296            type ServerSender = NodeServerSender<___T>;
10297        }
10298
10299        /// The client sender for the `Node` protocol.
10300        #[repr(transparent)]
10301        pub struct NodeClientSender<___T: ::fidl_next::Transport> {
10302            #[allow(dead_code)]
10303            sender: ::fidl_next::protocol::ClientSender<___T>,
10304        }
10305
10306        impl<___T> NodeClientSender<___T>
10307        where
10308            ___T: ::fidl_next::Transport,
10309        {
10310            #[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"]
10311            pub fn add_child(
10312                &self,
10313
10314                args: impl ::fidl_next::Encode<
10315                    <___T as ::fidl_next::Transport>::SendBuffer,
10316                    Encoded = crate::WireNodeAddArgs<'static>,
10317                >,
10318
10319                controller: impl ::fidl_next::Encode<
10320                    <___T as ::fidl_next::Transport>::SendBuffer,
10321                    Encoded = ::fidl_next::ServerEnd<
10322                        crate::NodeController,
10323                        ::fidl_next::fuchsia::WireChannel,
10324                    >,
10325                >,
10326
10327                node: impl ::fidl_next::Encode<
10328                    <___T as ::fidl_next::Transport>::SendBuffer,
10329                    Encoded = ::fidl_next::ServerEnd<
10330                        crate::Node,
10331                        ::fidl_next::fuchsia::WireOptionalChannel,
10332                    >,
10333                >,
10334            ) -> ::fidl_next::TwoWayFuture<'_, super::AddChild, ___T>
10335            where
10336                <___T as ::fidl_next::Transport>::SendBuffer:
10337                    ::fidl_next::encoder::InternalHandleEncoder,
10338                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
10339                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
10340            {
10341                self.add_child_with(AddChild { args, controller, node })
10342            }
10343
10344            #[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"]
10345            pub fn add_child_with<___R>(
10346                &self,
10347                request: ___R,
10348            ) -> ::fidl_next::TwoWayFuture<'_, super::AddChild, ___T>
10349            where
10350                ___R: ::fidl_next::Encode<
10351                        <___T as ::fidl_next::Transport>::SendBuffer,
10352                        Encoded = crate::WireNodeAddChildRequest<'static>,
10353                    >,
10354            {
10355                ::fidl_next::TwoWayFuture::from_untyped(
10356                    self.sender.send_two_way(8633697350522413353, request),
10357                )
10358            }
10359        }
10360
10361        /// The server sender for the `Node` protocol.
10362        #[repr(transparent)]
10363        pub struct NodeServerSender<___T: ::fidl_next::Transport> {
10364            sender: ::fidl_next::protocol::ServerSender<___T>,
10365        }
10366
10367        impl<___T> NodeServerSender<___T> where ___T: ::fidl_next::Transport {}
10368    }
10369}
10370
10371/// A client handler for the Node protocol.
10372///
10373/// See [`Node`] for more details.
10374pub trait NodeClientHandler<
10375    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
10376    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
10377>
10378{
10379    fn on_unknown_interaction(
10380        &mut self,
10381        sender: &::fidl_next::ClientSender<Node, ___T>,
10382        ordinal: u64,
10383    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
10384        sender.close();
10385        ::core::future::ready(())
10386    }
10387}
10388
10389impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Node
10390where
10391    ___H: NodeClientHandler<___T> + ::core::marker::Send,
10392    ___T: ::fidl_next::Transport,
10393    <node::AddChild as ::fidl_next::Method>::Response:
10394        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
10395{
10396    async fn on_event(
10397        handler: &mut ___H,
10398        sender: &::fidl_next::ClientSender<Self, ___T>,
10399        ordinal: u64,
10400        buffer: ___T::RecvBuffer,
10401    ) {
10402        match ordinal {
10403            ordinal => handler.on_unknown_interaction(sender, ordinal).await,
10404        }
10405    }
10406}
10407
10408/// A server handler for the Node protocol.
10409///
10410/// See [`Node`] for more details.
10411pub trait NodeServerHandler<
10412    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
10413    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
10414>
10415{
10416    #[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"]
10417    fn add_child(
10418        &mut self,
10419        sender: &::fidl_next::ServerSender<Node, ___T>,
10420
10421        request: ::fidl_next::Request<node::AddChild, ___T>,
10422
10423        responder: ::fidl_next::Responder<node::AddChild>,
10424    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
10425
10426    fn on_unknown_interaction(
10427        &mut self,
10428        sender: &::fidl_next::ServerSender<Node, ___T>,
10429        ordinal: u64,
10430    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
10431        sender.close();
10432        ::core::future::ready(())
10433    }
10434}
10435
10436impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Node
10437where
10438    ___H: NodeServerHandler<___T> + ::core::marker::Send,
10439    ___T: ::fidl_next::Transport,
10440    <node::AddChild as ::fidl_next::Method>::Request:
10441        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
10442{
10443    async fn on_one_way(
10444        handler: &mut ___H,
10445        sender: &::fidl_next::ServerSender<Self, ___T>,
10446        ordinal: u64,
10447        buffer: ___T::RecvBuffer,
10448    ) {
10449        match ordinal {
10450            ordinal => handler.on_unknown_interaction(sender, ordinal).await,
10451        }
10452    }
10453
10454    async fn on_two_way(
10455        handler: &mut ___H,
10456        sender: &::fidl_next::ServerSender<Self, ___T>,
10457        ordinal: u64,
10458        buffer: ___T::RecvBuffer,
10459        responder: ::fidl_next::protocol::Responder,
10460    ) {
10461        match ordinal {
10462            8633697350522413353 => {
10463                let responder = ::fidl_next::Responder::from_untyped(responder);
10464
10465                match ::fidl_next::DecoderExt::decode(buffer) {
10466                    Ok(decoded) => handler.add_child(sender, decoded, responder).await,
10467                    Err(e) => sender.close(),
10468                }
10469            }
10470
10471            ordinal => handler.on_unknown_interaction(sender, ordinal).await,
10472        }
10473    }
10474}
10475
10476#[derive(Clone, Debug, Default)]
10477pub struct NodeControllerRequestBindRequest {
10478    pub force_rebind: Option<bool>,
10479
10480    pub driver_url_suffix: Option<String>,
10481}
10482
10483impl NodeControllerRequestBindRequest {
10484    fn __max_ordinal(&self) -> usize {
10485        if self.driver_url_suffix.is_some() {
10486            return 2;
10487        }
10488
10489        if self.force_rebind.is_some() {
10490            return 1;
10491        }
10492
10493        0
10494    }
10495}
10496
10497impl ::fidl_next::Encodable for NodeControllerRequestBindRequest {
10498    type Encoded = WireNodeControllerRequestBindRequest<'static>;
10499}
10500
10501unsafe impl<___E> ::fidl_next::Encode<___E> for NodeControllerRequestBindRequest
10502where
10503    ___E: ::fidl_next::Encoder + ?Sized,
10504{
10505    #[inline]
10506    fn encode(
10507        mut self,
10508        encoder: &mut ___E,
10509        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10510    ) -> Result<(), ::fidl_next::EncodeError> {
10511        ::fidl_next::munge!(let WireNodeControllerRequestBindRequest { table } = out);
10512
10513        let max_ord = self.__max_ordinal();
10514
10515        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10516        ::fidl_next::Wire::zero_padding(&mut out);
10517
10518        let mut preallocated =
10519            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10520
10521        for i in 1..=max_ord {
10522            match i {
10523                2 => {
10524                    if let Some(driver_url_suffix) = self.driver_url_suffix.take() {
10525                        ::fidl_next::WireEnvelope::encode_value(
10526                            driver_url_suffix,
10527                            preallocated.encoder,
10528                            &mut out,
10529                        )?;
10530                    } else {
10531                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
10532                    }
10533                }
10534
10535                1 => {
10536                    if let Some(force_rebind) = self.force_rebind.take() {
10537                        ::fidl_next::WireEnvelope::encode_value(
10538                            force_rebind,
10539                            preallocated.encoder,
10540                            &mut out,
10541                        )?;
10542                    } else {
10543                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
10544                    }
10545                }
10546
10547                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10548            }
10549            unsafe {
10550                preallocated.write_next(out.assume_init_ref());
10551            }
10552        }
10553
10554        ::fidl_next::WireTable::encode_len(table, max_ord);
10555
10556        Ok(())
10557    }
10558}
10559
10560unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeControllerRequestBindRequest
10561where
10562    ___E: ::fidl_next::Encoder + ?Sized,
10563{
10564    #[inline]
10565    fn encode_ref(
10566        &self,
10567        encoder: &mut ___E,
10568        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10569    ) -> Result<(), ::fidl_next::EncodeError> {
10570        ::fidl_next::munge!(let WireNodeControllerRequestBindRequest { table } = out);
10571
10572        let max_ord = self.__max_ordinal();
10573
10574        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10575        ::fidl_next::Wire::zero_padding(&mut out);
10576
10577        let mut preallocated =
10578            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10579
10580        for i in 1..=max_ord {
10581            match i {
10582                2 => {
10583                    if let Some(driver_url_suffix) = &self.driver_url_suffix {
10584                        ::fidl_next::WireEnvelope::encode_value(
10585                            driver_url_suffix,
10586                            preallocated.encoder,
10587                            &mut out,
10588                        )?;
10589                    } else {
10590                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
10591                    }
10592                }
10593
10594                1 => {
10595                    if let Some(force_rebind) = &self.force_rebind {
10596                        ::fidl_next::WireEnvelope::encode_value(
10597                            force_rebind,
10598                            preallocated.encoder,
10599                            &mut out,
10600                        )?;
10601                    } else {
10602                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
10603                    }
10604                }
10605
10606                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10607            }
10608            unsafe {
10609                preallocated.write_next(out.assume_init_ref());
10610            }
10611        }
10612
10613        ::fidl_next::WireTable::encode_len(table, max_ord);
10614
10615        Ok(())
10616    }
10617}
10618
10619impl<'de> ::fidl_next::FromWire<WireNodeControllerRequestBindRequest<'de>>
10620    for NodeControllerRequestBindRequest
10621{
10622    #[inline]
10623    fn from_wire(wire: WireNodeControllerRequestBindRequest<'de>) -> Self {
10624        let wire = ::core::mem::ManuallyDrop::new(wire);
10625
10626        let force_rebind = wire.table.get(1);
10627
10628        let driver_url_suffix = wire.table.get(2);
10629
10630        Self {
10631            force_rebind: force_rebind.map(|envelope| {
10632                ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
10633            }),
10634
10635            driver_url_suffix: driver_url_suffix.map(|envelope| {
10636                ::fidl_next::FromWire::from_wire(unsafe {
10637                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
10638                })
10639            }),
10640        }
10641    }
10642}
10643
10644impl<'de> ::fidl_next::FromWireRef<WireNodeControllerRequestBindRequest<'de>>
10645    for NodeControllerRequestBindRequest
10646{
10647    #[inline]
10648    fn from_wire_ref(wire: &WireNodeControllerRequestBindRequest<'de>) -> Self {
10649        Self {
10650            force_rebind: wire.table.get(1).map(|envelope| {
10651                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10652                    envelope.deref_unchecked::<bool>()
10653                })
10654            }),
10655
10656            driver_url_suffix: wire.table.get(2).map(|envelope| {
10657                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10658                    envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
10659                })
10660            }),
10661        }
10662    }
10663}
10664
10665/// The wire type corresponding to [`NodeControllerRequestBindRequest`].
10666#[repr(C)]
10667pub struct WireNodeControllerRequestBindRequest<'de> {
10668    table: ::fidl_next::WireTable<'de>,
10669}
10670
10671impl<'de> Drop for WireNodeControllerRequestBindRequest<'de> {
10672    fn drop(&mut self) {
10673        let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
10674
10675        let _ = self
10676            .table
10677            .get(2)
10678            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
10679    }
10680}
10681
10682unsafe impl ::fidl_next::Wire for WireNodeControllerRequestBindRequest<'static> {
10683    type Decoded<'de> = WireNodeControllerRequestBindRequest<'de>;
10684
10685    #[inline]
10686    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10687        ::fidl_next::munge!(let Self { table } = out);
10688        ::fidl_next::WireTable::zero_padding(table);
10689    }
10690}
10691
10692unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeControllerRequestBindRequest<'static>
10693where
10694    ___D: ::fidl_next::Decoder + ?Sized,
10695{
10696    fn decode(
10697        slot: ::fidl_next::Slot<'_, Self>,
10698        decoder: &mut ___D,
10699    ) -> Result<(), ::fidl_next::DecodeError> {
10700        ::fidl_next::munge!(let Self { table } = slot);
10701
10702        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10703            match ordinal {
10704                0 => unsafe { ::core::hint::unreachable_unchecked() },
10705
10706                1 => {
10707                    ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
10708
10709                    Ok(())
10710                }
10711
10712                2 => {
10713                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
10714                        slot.as_mut(),
10715                        decoder,
10716                    )?;
10717
10718                    Ok(())
10719                }
10720
10721                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
10722            }
10723        })
10724    }
10725}
10726
10727impl<'de> WireNodeControllerRequestBindRequest<'de> {
10728    pub fn force_rebind(&self) -> Option<&bool> {
10729        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10730    }
10731
10732    pub fn driver_url_suffix(&self) -> Option<&::fidl_next::WireString<'de>> {
10733        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10734    }
10735}
10736
10737impl<'de> ::core::fmt::Debug for WireNodeControllerRequestBindRequest<'de> {
10738    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
10739        f.debug_struct("NodeControllerRequestBindRequest")
10740            .field("force_rebind", &self.force_rebind())
10741            .field("driver_url_suffix", &self.driver_url_suffix())
10742            .finish()
10743    }
10744}
10745
10746pub type NodeControllerRequestBindResponse = ();
10747
10748/// The wire type corresponding to [`NodeControllerRequestBindResponse`].
10749pub type WireNodeControllerRequestBindResponse = ();
10750
10751#[derive(Debug, Default)]
10752pub struct NodeControllerOnBindRequest {
10753    pub node_token: Option<::fidl_next::fuchsia::zx::Event>,
10754}
10755
10756impl NodeControllerOnBindRequest {
10757    fn __max_ordinal(&self) -> usize {
10758        if self.node_token.is_some() {
10759            return 1;
10760        }
10761
10762        0
10763    }
10764}
10765
10766impl ::fidl_next::Encodable for NodeControllerOnBindRequest {
10767    type Encoded = WireNodeControllerOnBindRequest<'static>;
10768}
10769
10770unsafe impl<___E> ::fidl_next::Encode<___E> for NodeControllerOnBindRequest
10771where
10772    ___E: ::fidl_next::Encoder + ?Sized,
10773    ___E: ::fidl_next::fuchsia::HandleEncoder,
10774{
10775    #[inline]
10776    fn encode(
10777        mut self,
10778        encoder: &mut ___E,
10779        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10780    ) -> Result<(), ::fidl_next::EncodeError> {
10781        ::fidl_next::munge!(let WireNodeControllerOnBindRequest { table } = out);
10782
10783        let max_ord = self.__max_ordinal();
10784
10785        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10786        ::fidl_next::Wire::zero_padding(&mut out);
10787
10788        let mut preallocated =
10789            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10790
10791        for i in 1..=max_ord {
10792            match i {
10793                1 => {
10794                    if let Some(node_token) = self.node_token.take() {
10795                        ::fidl_next::WireEnvelope::encode_value(
10796                            node_token,
10797                            preallocated.encoder,
10798                            &mut out,
10799                        )?;
10800                    } else {
10801                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
10802                    }
10803                }
10804
10805                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10806            }
10807            unsafe {
10808                preallocated.write_next(out.assume_init_ref());
10809            }
10810        }
10811
10812        ::fidl_next::WireTable::encode_len(table, max_ord);
10813
10814        Ok(())
10815    }
10816}
10817
10818impl<'de> ::fidl_next::FromWire<WireNodeControllerOnBindRequest<'de>>
10819    for NodeControllerOnBindRequest
10820{
10821    #[inline]
10822    fn from_wire(wire: WireNodeControllerOnBindRequest<'de>) -> Self {
10823        let wire = ::core::mem::ManuallyDrop::new(wire);
10824
10825        let node_token = wire.table.get(1);
10826
10827        Self {
10828            node_token: node_token.map(|envelope| {
10829                ::fidl_next::FromWire::from_wire(unsafe {
10830                    envelope.read_unchecked::<::fidl_next::fuchsia::WireEvent>()
10831                })
10832            }),
10833        }
10834    }
10835}
10836
10837/// The wire type corresponding to [`NodeControllerOnBindRequest`].
10838#[repr(C)]
10839pub struct WireNodeControllerOnBindRequest<'de> {
10840    table: ::fidl_next::WireTable<'de>,
10841}
10842
10843impl<'de> Drop for WireNodeControllerOnBindRequest<'de> {
10844    fn drop(&mut self) {
10845        let _ = self.table.get(1).map(|envelope| unsafe {
10846            envelope.read_unchecked::<::fidl_next::fuchsia::WireEvent>()
10847        });
10848    }
10849}
10850
10851unsafe impl ::fidl_next::Wire for WireNodeControllerOnBindRequest<'static> {
10852    type Decoded<'de> = WireNodeControllerOnBindRequest<'de>;
10853
10854    #[inline]
10855    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10856        ::fidl_next::munge!(let Self { table } = out);
10857        ::fidl_next::WireTable::zero_padding(table);
10858    }
10859}
10860
10861unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeControllerOnBindRequest<'static>
10862where
10863    ___D: ::fidl_next::Decoder + ?Sized,
10864    ___D: ::fidl_next::fuchsia::HandleDecoder,
10865{
10866    fn decode(
10867        slot: ::fidl_next::Slot<'_, Self>,
10868        decoder: &mut ___D,
10869    ) -> Result<(), ::fidl_next::DecodeError> {
10870        ::fidl_next::munge!(let Self { table } = slot);
10871
10872        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10873            match ordinal {
10874                0 => unsafe { ::core::hint::unreachable_unchecked() },
10875
10876                1 => {
10877                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireEvent>(
10878                        slot.as_mut(),
10879                        decoder,
10880                    )?;
10881
10882                    Ok(())
10883                }
10884
10885                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
10886            }
10887        })
10888    }
10889}
10890
10891impl<'de> WireNodeControllerOnBindRequest<'de> {
10892    pub fn node_token(&self) -> Option<&::fidl_next::fuchsia::WireEvent> {
10893        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10894    }
10895}
10896
10897impl<'de> ::core::fmt::Debug for WireNodeControllerOnBindRequest<'de> {
10898    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
10899        f.debug_struct("NodeControllerOnBindRequest")
10900            .field("node_token", &self.node_token())
10901            .finish()
10902    }
10903}
10904
10905/// The type corresponding to the NodeController protocol.
10906#[doc = " Protocol through which a parent node controls one of its children.\n"]
10907#[derive(Debug)]
10908pub struct NodeController;
10909
10910pub mod node_controller {
10911    pub mod prelude {
10912        pub use crate::{
10913            NodeController, NodeControllerClientHandler, NodeControllerServerHandler,
10914            node_controller,
10915        };
10916
10917        pub use crate::DriverResult;
10918
10919        pub use crate::NodeControllerOnBindRequest;
10920
10921        pub use crate::NodeControllerRequestBindRequest;
10922
10923        pub use crate::NodeControllerRequestBindResponse;
10924    }
10925
10926    pub struct Remove;
10927
10928    impl ::fidl_next::Method for Remove {
10929        const ORDINAL: u64 = 6123359741742396225;
10930
10931        type Protocol = crate::NodeController;
10932
10933        type Request = ();
10934
10935        type Response = ::fidl_next::Never;
10936    }
10937
10938    pub struct RequestBind;
10939
10940    impl ::fidl_next::Method for RequestBind {
10941        const ORDINAL: u64 = 4735909333556220047;
10942
10943        type Protocol = crate::NodeController;
10944
10945        type Request = crate::WireNodeControllerRequestBindRequest<'static>;
10946
10947        type Response = ::fidl_next::WireFlexibleResult<
10948            'static,
10949            crate::WireNodeControllerRequestBindResponse,
10950            ::fidl_next::WireI32,
10951        >;
10952    }
10953
10954    pub struct OnBind;
10955
10956    impl ::fidl_next::Method for OnBind {
10957        const ORDINAL: u64 = 5905369594807853098;
10958
10959        type Protocol = crate::NodeController;
10960
10961        type Request = ::fidl_next::Never;
10962
10963        type Response = crate::WireNodeControllerOnBindRequest<'static>;
10964    }
10965
10966    pub struct WaitForDriver;
10967
10968    impl ::fidl_next::Method for WaitForDriver {
10969        const ORDINAL: u64 = 7635589759067755399;
10970
10971        type Protocol = crate::NodeController;
10972
10973        type Request = ();
10974
10975        type Response =
10976            ::fidl_next::WireFlexibleResult<'static, crate::WireDriverResult, ::fidl_next::WireI32>;
10977    }
10978
10979    mod ___detail {
10980
10981        unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::NodeController
10982        where
10983            ___T: ::fidl_next::Transport,
10984        {
10985            type ClientSender = NodeControllerClientSender<___T>;
10986            type ServerSender = NodeControllerServerSender<___T>;
10987        }
10988
10989        /// The client sender for the `NodeController` protocol.
10990        #[repr(transparent)]
10991        pub struct NodeControllerClientSender<___T: ::fidl_next::Transport> {
10992            #[allow(dead_code)]
10993            sender: ::fidl_next::protocol::ClientSender<___T>,
10994        }
10995
10996        impl<___T> NodeControllerClientSender<___T>
10997        where
10998            ___T: ::fidl_next::Transport,
10999        {
11000            #[doc = " Removes the node and all of its children.\n"]
11001            pub fn remove(&self) -> ::fidl_next::SendFuture<'_, ___T> {
11002                ::fidl_next::SendFuture::from_untyped(
11003                    self.sender.send_one_way(6123359741742396225, ()),
11004                )
11005            }
11006
11007            #[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"]
11008            pub fn request_bind_with<___R>(
11009                &self,
11010                request: ___R,
11011            ) -> ::fidl_next::TwoWayFuture<'_, super::RequestBind, ___T>
11012            where
11013                ___R: ::fidl_next::Encode<
11014                        <___T as ::fidl_next::Transport>::SendBuffer,
11015                        Encoded = crate::WireNodeControllerRequestBindRequest<'static>,
11016                    >,
11017            {
11018                ::fidl_next::TwoWayFuture::from_untyped(
11019                    self.sender.send_two_way(4735909333556220047, request),
11020                )
11021            }
11022
11023            #[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"]
11024            pub fn wait_for_driver(
11025                &self,
11026            ) -> ::fidl_next::TwoWayFuture<'_, super::WaitForDriver, ___T> {
11027                ::fidl_next::TwoWayFuture::from_untyped(
11028                    self.sender.send_two_way(7635589759067755399, ()),
11029                )
11030            }
11031        }
11032
11033        /// The server sender for the `NodeController` protocol.
11034        #[repr(transparent)]
11035        pub struct NodeControllerServerSender<___T: ::fidl_next::Transport> {
11036            sender: ::fidl_next::protocol::ServerSender<___T>,
11037        }
11038
11039        impl<___T> NodeControllerServerSender<___T>
11040        where
11041            ___T: ::fidl_next::Transport,
11042        {
11043            #[doc = " Event that is triggered when the associated `Node` is bound to a driver.\n Replaced with WaitForDriver.\n"]
11044
11045            pub fn on_bind_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
11046            where
11047                ___R: ::fidl_next::Encode<
11048                        <___T as ::fidl_next::Transport>::SendBuffer,
11049                        Encoded = <super::OnBind as ::fidl_next::Method>::Response,
11050                    >,
11051            {
11052                ::fidl_next::SendFuture::from_untyped(
11053                    self.sender.send_event(5905369594807853098, request),
11054                )
11055            }
11056        }
11057    }
11058}
11059
11060/// A client handler for the NodeController protocol.
11061///
11062/// See [`NodeController`] for more details.
11063pub trait NodeControllerClientHandler<
11064    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
11065    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
11066>
11067{
11068    #[doc = " Event that is triggered when the associated `Node` is bound to a driver.\n Replaced with WaitForDriver.\n"]
11069    fn on_bind(
11070        &mut self,
11071        sender: &::fidl_next::ClientSender<NodeController, ___T>,
11072
11073        event: ::fidl_next::Response<node_controller::OnBind, ___T>,
11074    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
11075
11076    fn on_unknown_interaction(
11077        &mut self,
11078        sender: &::fidl_next::ClientSender<NodeController, ___T>,
11079        ordinal: u64,
11080    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
11081        sender.close();
11082        ::core::future::ready(())
11083    }
11084}
11085
11086impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for NodeController
11087where
11088    ___H: NodeControllerClientHandler<___T> + ::core::marker::Send,
11089    ___T: ::fidl_next::Transport,
11090    <node_controller::RequestBind as ::fidl_next::Method>::Response:
11091        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11092    <node_controller::OnBind as ::fidl_next::Method>::Response:
11093        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11094    <node_controller::WaitForDriver as ::fidl_next::Method>::Response:
11095        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11096{
11097    async fn on_event(
11098        handler: &mut ___H,
11099        sender: &::fidl_next::ClientSender<Self, ___T>,
11100        ordinal: u64,
11101        buffer: ___T::RecvBuffer,
11102    ) {
11103        match ordinal {
11104            5905369594807853098 => match ::fidl_next::DecoderExt::decode(buffer) {
11105                Ok(decoded) => handler.on_bind(sender, decoded).await,
11106                Err(e) => sender.close(),
11107            },
11108
11109            ordinal => handler.on_unknown_interaction(sender, ordinal).await,
11110        }
11111    }
11112}
11113
11114/// A server handler for the NodeController protocol.
11115///
11116/// See [`NodeController`] for more details.
11117pub trait NodeControllerServerHandler<
11118    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
11119    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
11120>
11121{
11122    #[doc = " Removes the node and all of its children.\n"]
11123    fn remove(
11124        &mut self,
11125        sender: &::fidl_next::ServerSender<NodeController, ___T>,
11126    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
11127
11128    #[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"]
11129    fn request_bind(
11130        &mut self,
11131        sender: &::fidl_next::ServerSender<NodeController, ___T>,
11132
11133        request: ::fidl_next::Request<node_controller::RequestBind, ___T>,
11134
11135        responder: ::fidl_next::Responder<node_controller::RequestBind>,
11136    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
11137
11138    #[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"]
11139    fn wait_for_driver(
11140        &mut self,
11141        sender: &::fidl_next::ServerSender<NodeController, ___T>,
11142
11143        responder: ::fidl_next::Responder<node_controller::WaitForDriver>,
11144    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
11145
11146    fn on_unknown_interaction(
11147        &mut self,
11148        sender: &::fidl_next::ServerSender<NodeController, ___T>,
11149        ordinal: u64,
11150    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
11151        sender.close();
11152        ::core::future::ready(())
11153    }
11154}
11155
11156impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for NodeController
11157where
11158    ___H: NodeControllerServerHandler<___T> + ::core::marker::Send,
11159    ___T: ::fidl_next::Transport,
11160    <node_controller::RequestBind as ::fidl_next::Method>::Request:
11161        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11162{
11163    async fn on_one_way(
11164        handler: &mut ___H,
11165        sender: &::fidl_next::ServerSender<Self, ___T>,
11166        ordinal: u64,
11167        buffer: ___T::RecvBuffer,
11168    ) {
11169        match ordinal {
11170            6123359741742396225 => {
11171                handler.remove(sender).await;
11172            }
11173
11174            ordinal => handler.on_unknown_interaction(sender, ordinal).await,
11175        }
11176    }
11177
11178    async fn on_two_way(
11179        handler: &mut ___H,
11180        sender: &::fidl_next::ServerSender<Self, ___T>,
11181        ordinal: u64,
11182        buffer: ___T::RecvBuffer,
11183        responder: ::fidl_next::protocol::Responder,
11184    ) {
11185        match ordinal {
11186            4735909333556220047 => {
11187                let responder = ::fidl_next::Responder::from_untyped(responder);
11188
11189                match ::fidl_next::DecoderExt::decode(buffer) {
11190                    Ok(decoded) => handler.request_bind(sender, decoded, responder).await,
11191                    Err(e) => sender.close(),
11192                }
11193            }
11194
11195            7635589759067755399 => {
11196                let responder = ::fidl_next::Responder::from_untyped(responder);
11197
11198                handler.wait_for_driver(sender, responder).await;
11199            }
11200
11201            ordinal => handler.on_unknown_interaction(sender, ordinal).await,
11202        }
11203    }
11204}
11205
11206/// Compatibility shims which mimic some API surfaces of the current Rust bindings.
11207pub mod compat {
11208
11209    impl ::fidl_next::CompatFrom<crate::NodePropertyKey>
11210        for ::fidl_fuchsia_driver_framework::NodePropertyKey
11211    {
11212        fn compat_from(value: crate::NodePropertyKey) -> Self {
11213            match value {
11214                crate::NodePropertyKey::IntValue(value) => {
11215                    Self::IntValue(::fidl_next::CompatFrom::compat_from(value))
11216                }
11217
11218                crate::NodePropertyKey::StringValue(value) => {
11219                    Self::StringValue(::fidl_next::CompatFrom::compat_from(value))
11220                }
11221            }
11222        }
11223    }
11224
11225    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodePropertyKey>
11226        for crate::NodePropertyKey
11227    {
11228        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodePropertyKey) -> Self {
11229            match value {
11230                ::fidl_fuchsia_driver_framework::NodePropertyKey::IntValue(value) => {
11231                    Self::IntValue(::fidl_next::CompatFrom::compat_from(value))
11232                }
11233
11234                ::fidl_fuchsia_driver_framework::NodePropertyKey::StringValue(value) => {
11235                    Self::StringValue(::fidl_next::CompatFrom::compat_from(value))
11236                }
11237            }
11238        }
11239    }
11240
11241    impl ::fidl_next::CompatFrom<crate::Condition> for ::fidl_fuchsia_driver_framework::Condition {
11242        fn compat_from(value: crate::Condition) -> Self {
11243            match value {
11244                crate::Condition::Unknown => Self::Unknown,
11245
11246                crate::Condition::Accept => Self::Accept,
11247
11248                crate::Condition::Reject => Self::Reject,
11249            }
11250        }
11251    }
11252
11253    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::Condition> for crate::Condition {
11254        fn compat_from(value: ::fidl_fuchsia_driver_framework::Condition) -> Self {
11255            match value {
11256                ::fidl_fuchsia_driver_framework::Condition::Unknown => Self::Unknown,
11257
11258                ::fidl_fuchsia_driver_framework::Condition::Accept => Self::Accept,
11259
11260                ::fidl_fuchsia_driver_framework::Condition::Reject => Self::Reject,
11261            }
11262        }
11263    }
11264
11265    impl ::fidl_next::CompatFrom<crate::NodePropertyValue>
11266        for ::fidl_fuchsia_driver_framework::NodePropertyValue
11267    {
11268        fn compat_from(value: crate::NodePropertyValue) -> Self {
11269            match value {
11270                crate::NodePropertyValue::IntValue(value) => {
11271                    Self::IntValue(::fidl_next::CompatFrom::compat_from(value))
11272                }
11273
11274                crate::NodePropertyValue::StringValue(value) => {
11275                    Self::StringValue(::fidl_next::CompatFrom::compat_from(value))
11276                }
11277
11278                crate::NodePropertyValue::BoolValue(value) => {
11279                    Self::BoolValue(::fidl_next::CompatFrom::compat_from(value))
11280                }
11281
11282                crate::NodePropertyValue::EnumValue(value) => {
11283                    Self::EnumValue(::fidl_next::CompatFrom::compat_from(value))
11284                }
11285
11286                crate::NodePropertyValue::UnknownOrdinal_(unknown_ordinal) => {
11287                    Self::__SourceBreaking { unknown_ordinal }
11288                }
11289            }
11290        }
11291    }
11292
11293    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodePropertyValue>
11294        for crate::NodePropertyValue
11295    {
11296        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodePropertyValue) -> Self {
11297            match value {
11298                ::fidl_fuchsia_driver_framework::NodePropertyValue::IntValue(value) => {
11299                    Self::IntValue(::fidl_next::CompatFrom::compat_from(value))
11300                }
11301
11302                ::fidl_fuchsia_driver_framework::NodePropertyValue::StringValue(value) => {
11303                    Self::StringValue(::fidl_next::CompatFrom::compat_from(value))
11304                }
11305
11306                ::fidl_fuchsia_driver_framework::NodePropertyValue::BoolValue(value) => {
11307                    Self::BoolValue(::fidl_next::CompatFrom::compat_from(value))
11308                }
11309
11310                ::fidl_fuchsia_driver_framework::NodePropertyValue::EnumValue(value) => {
11311                    Self::EnumValue(::fidl_next::CompatFrom::compat_from(value))
11312                }
11313
11314                ::fidl_fuchsia_driver_framework::NodePropertyValue::__SourceBreaking {
11315                    unknown_ordinal,
11316                } => Self::UnknownOrdinal_(unknown_ordinal),
11317            }
11318        }
11319    }
11320
11321    impl ::fidl_next::CompatFrom<crate::BindRule> for ::fidl_fuchsia_driver_framework::BindRule {
11322        #[inline]
11323        fn compat_from(value: crate::BindRule) -> Self {
11324            Self {
11325                key: ::fidl_next::CompatFrom::compat_from(value.key),
11326
11327                condition: ::fidl_next::CompatFrom::compat_from(value.condition),
11328
11329                values: ::fidl_next::CompatFrom::compat_from(value.values),
11330            }
11331        }
11332    }
11333
11334    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::BindRule> for crate::BindRule {
11335        #[inline]
11336        fn compat_from(value: ::fidl_fuchsia_driver_framework::BindRule) -> Self {
11337            Self {
11338                key: ::fidl_next::CompatFrom::compat_from(value.key),
11339
11340                condition: ::fidl_next::CompatFrom::compat_from(value.condition),
11341
11342                values: ::fidl_next::CompatFrom::compat_from(value.values),
11343            }
11344        }
11345    }
11346
11347    impl ::fidl_next::CompatFrom<crate::BindRule2> for ::fidl_fuchsia_driver_framework::BindRule2 {
11348        #[inline]
11349        fn compat_from(value: crate::BindRule2) -> Self {
11350            Self {
11351                key: ::fidl_next::CompatFrom::compat_from(value.key),
11352
11353                condition: ::fidl_next::CompatFrom::compat_from(value.condition),
11354
11355                values: ::fidl_next::CompatFrom::compat_from(value.values),
11356            }
11357        }
11358    }
11359
11360    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::BindRule2> for crate::BindRule2 {
11361        #[inline]
11362        fn compat_from(value: ::fidl_fuchsia_driver_framework::BindRule2) -> Self {
11363            Self {
11364                key: ::fidl_next::CompatFrom::compat_from(value.key),
11365
11366                condition: ::fidl_next::CompatFrom::compat_from(value.condition),
11367
11368                values: ::fidl_next::CompatFrom::compat_from(value.values),
11369            }
11370        }
11371    }
11372
11373    impl ::fidl_next::CompatFrom<crate::BusType> for ::fidl_fuchsia_driver_framework::BusType {
11374        fn compat_from(value: crate::BusType) -> Self {
11375            match value {
11376                crate::BusType::Platform => Self::Platform,
11377
11378                crate::BusType::Acpi => Self::Acpi,
11379
11380                crate::BusType::DeviceTree => Self::DeviceTree,
11381
11382                crate::BusType::Pci => Self::Pci,
11383
11384                crate::BusType::Usb => Self::Usb,
11385
11386                crate::BusType::Gpio => Self::Gpio,
11387
11388                crate::BusType::I2C => Self::I2C,
11389
11390                crate::BusType::Spi => Self::Spi,
11391
11392                crate::BusType::Sdio => Self::Sdio,
11393
11394                crate::BusType::Uart => Self::Uart,
11395
11396                crate::BusType::Spmi => Self::Spmi,
11397
11398                crate::BusType::UnknownOrdinal_(unknown_ordinal) => {
11399                    Self::__SourceBreaking { unknown_ordinal }
11400                }
11401            }
11402        }
11403    }
11404
11405    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::BusType> for crate::BusType {
11406        fn compat_from(value: ::fidl_fuchsia_driver_framework::BusType) -> Self {
11407            match value {
11408                ::fidl_fuchsia_driver_framework::BusType::Platform => Self::Platform,
11409
11410                ::fidl_fuchsia_driver_framework::BusType::Acpi => Self::Acpi,
11411
11412                ::fidl_fuchsia_driver_framework::BusType::DeviceTree => Self::DeviceTree,
11413
11414                ::fidl_fuchsia_driver_framework::BusType::Pci => Self::Pci,
11415
11416                ::fidl_fuchsia_driver_framework::BusType::Usb => Self::Usb,
11417
11418                ::fidl_fuchsia_driver_framework::BusType::Gpio => Self::Gpio,
11419
11420                ::fidl_fuchsia_driver_framework::BusType::I2C => Self::I2C,
11421
11422                ::fidl_fuchsia_driver_framework::BusType::Spi => Self::Spi,
11423
11424                ::fidl_fuchsia_driver_framework::BusType::Sdio => Self::Sdio,
11425
11426                ::fidl_fuchsia_driver_framework::BusType::Uart => Self::Uart,
11427
11428                ::fidl_fuchsia_driver_framework::BusType::Spmi => Self::Spmi,
11429
11430                ::fidl_fuchsia_driver_framework::BusType::__SourceBreaking {
11431                    unknown_ordinal: value,
11432                } => Self::UnknownOrdinal_(value),
11433            }
11434        }
11435    }
11436
11437    impl ::fidl_next::CompatFrom<crate::DeviceAddress>
11438        for ::fidl_fuchsia_driver_framework::DeviceAddress
11439    {
11440        fn compat_from(value: crate::DeviceAddress) -> Self {
11441            match value {
11442                crate::DeviceAddress::IntValue(value) => {
11443                    Self::IntValue(::fidl_next::CompatFrom::compat_from(value))
11444                }
11445
11446                crate::DeviceAddress::ArrayIntValue(value) => {
11447                    Self::ArrayIntValue(::fidl_next::CompatFrom::compat_from(value))
11448                }
11449
11450                crate::DeviceAddress::CharIntValue(value) => {
11451                    Self::CharIntValue(::fidl_next::CompatFrom::compat_from(value))
11452                }
11453
11454                crate::DeviceAddress::ArrayCharIntValue(value) => {
11455                    Self::ArrayCharIntValue(::fidl_next::CompatFrom::compat_from(value))
11456                }
11457
11458                crate::DeviceAddress::StringValue(value) => {
11459                    Self::StringValue(::fidl_next::CompatFrom::compat_from(value))
11460                }
11461
11462                crate::DeviceAddress::UnknownOrdinal_(unknown_ordinal) => {
11463                    Self::__SourceBreaking { unknown_ordinal }
11464                }
11465            }
11466        }
11467    }
11468
11469    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DeviceAddress>
11470        for crate::DeviceAddress
11471    {
11472        fn compat_from(value: ::fidl_fuchsia_driver_framework::DeviceAddress) -> Self {
11473            match value {
11474                ::fidl_fuchsia_driver_framework::DeviceAddress::IntValue(value) => {
11475                    Self::IntValue(::fidl_next::CompatFrom::compat_from(value))
11476                }
11477
11478                ::fidl_fuchsia_driver_framework::DeviceAddress::ArrayIntValue(value) => {
11479                    Self::ArrayIntValue(::fidl_next::CompatFrom::compat_from(value))
11480                }
11481
11482                ::fidl_fuchsia_driver_framework::DeviceAddress::CharIntValue(value) => {
11483                    Self::CharIntValue(::fidl_next::CompatFrom::compat_from(value))
11484                }
11485
11486                ::fidl_fuchsia_driver_framework::DeviceAddress::ArrayCharIntValue(value) => {
11487                    Self::ArrayCharIntValue(::fidl_next::CompatFrom::compat_from(value))
11488                }
11489
11490                ::fidl_fuchsia_driver_framework::DeviceAddress::StringValue(value) => {
11491                    Self::StringValue(::fidl_next::CompatFrom::compat_from(value))
11492                }
11493
11494                ::fidl_fuchsia_driver_framework::DeviceAddress::__SourceBreaking {
11495                    unknown_ordinal,
11496                } => Self::UnknownOrdinal_(unknown_ordinal),
11497            }
11498        }
11499    }
11500
11501    impl ::fidl_next::CompatFrom<crate::DeviceAddressStability>
11502        for ::fidl_fuchsia_driver_framework::DeviceAddressStability
11503    {
11504        fn compat_from(value: crate::DeviceAddressStability) -> Self {
11505            match value {
11506                crate::DeviceAddressStability::UnstableBetweenDriverRestart => {
11507                    Self::UnstableBetweenDriverRestart
11508                }
11509
11510                crate::DeviceAddressStability::UnstableBetweenBoot => Self::UnstableBetweenBoot,
11511
11512                crate::DeviceAddressStability::UnstableBetweenSoftwareUpdate => {
11513                    Self::UnstableBetweenSoftwareUpdate
11514                }
11515
11516                crate::DeviceAddressStability::Stable => Self::Stable,
11517
11518                crate::DeviceAddressStability::UnknownOrdinal_(unknown_ordinal) => {
11519                    Self::__SourceBreaking { unknown_ordinal }
11520                }
11521            }
11522        }
11523    }
11524
11525    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DeviceAddressStability>
11526        for crate::DeviceAddressStability
11527    {
11528        fn compat_from(value: ::fidl_fuchsia_driver_framework::DeviceAddressStability) -> Self {
11529            match value {
11530
11531                ::fidl_fuchsia_driver_framework::DeviceAddressStability::UnstableBetweenDriverRestart =>
11532                    Self::UnstableBetweenDriverRestart,
11533
11534                ::fidl_fuchsia_driver_framework::DeviceAddressStability::UnstableBetweenBoot =>
11535                    Self::UnstableBetweenBoot,
11536
11537                ::fidl_fuchsia_driver_framework::DeviceAddressStability::UnstableBetweenSoftwareUpdate =>
11538                    Self::UnstableBetweenSoftwareUpdate,
11539
11540                ::fidl_fuchsia_driver_framework::DeviceAddressStability::Stable =>
11541                    Self::Stable,
11542
11543
11544                ::fidl_fuchsia_driver_framework::DeviceAddressStability::__SourceBreaking { unknown_ordinal: value } =>
11545                    Self::UnknownOrdinal_(value),
11546
11547        }
11548        }
11549    }
11550
11551    impl ::fidl_next::CompatFrom<crate::BusInfo> for ::fidl_fuchsia_driver_framework::BusInfo {
11552        fn compat_from(value: crate::BusInfo) -> Self {
11553            Self {
11554                bus: ::fidl_next::CompatFrom::compat_from(value.bus),
11555
11556                address: ::fidl_next::CompatFrom::compat_from(value.address),
11557
11558                address_stability: ::fidl_next::CompatFrom::compat_from(value.address_stability),
11559
11560                __source_breaking: ::fidl::marker::SourceBreaking,
11561            }
11562        }
11563    }
11564
11565    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::BusInfo> for crate::BusInfo {
11566        fn compat_from(value: ::fidl_fuchsia_driver_framework::BusInfo) -> Self {
11567            Self {
11568                bus: ::fidl_next::CompatFrom::compat_from(value.bus),
11569
11570                address: ::fidl_next::CompatFrom::compat_from(value.address),
11571
11572                address_stability: ::fidl_next::CompatFrom::compat_from(value.address_stability),
11573            }
11574        }
11575    }
11576
11577    impl ::fidl_next::CompatFrom<crate::DriverPackageType>
11578        for ::fidl_fuchsia_driver_framework::DriverPackageType
11579    {
11580        fn compat_from(value: crate::DriverPackageType) -> Self {
11581            match value {
11582                crate::DriverPackageType::Boot => Self::Boot,
11583
11584                crate::DriverPackageType::Base => Self::Base,
11585
11586                crate::DriverPackageType::Cached => Self::Cached,
11587
11588                crate::DriverPackageType::Universe => Self::Universe,
11589
11590                crate::DriverPackageType::UnknownOrdinal_(unknown_ordinal) => {
11591                    Self::__SourceBreaking { unknown_ordinal }
11592                }
11593            }
11594        }
11595    }
11596
11597    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DriverPackageType>
11598        for crate::DriverPackageType
11599    {
11600        fn compat_from(value: ::fidl_fuchsia_driver_framework::DriverPackageType) -> Self {
11601            match value {
11602                ::fidl_fuchsia_driver_framework::DriverPackageType::Boot => Self::Boot,
11603
11604                ::fidl_fuchsia_driver_framework::DriverPackageType::Base => Self::Base,
11605
11606                ::fidl_fuchsia_driver_framework::DriverPackageType::Cached => Self::Cached,
11607
11608                ::fidl_fuchsia_driver_framework::DriverPackageType::Universe => Self::Universe,
11609
11610                ::fidl_fuchsia_driver_framework::DriverPackageType::__SourceBreaking {
11611                    unknown_ordinal: value,
11612                } => Self::UnknownOrdinal_(value),
11613            }
11614        }
11615    }
11616
11617    impl ::fidl_next::CompatFrom<crate::DeviceCategory>
11618        for ::fidl_fuchsia_driver_framework::DeviceCategory
11619    {
11620        fn compat_from(value: crate::DeviceCategory) -> Self {
11621            Self {
11622                category: ::fidl_next::CompatFrom::compat_from(value.category),
11623
11624                subcategory: ::fidl_next::CompatFrom::compat_from(value.subcategory),
11625
11626                __source_breaking: ::fidl::marker::SourceBreaking,
11627            }
11628        }
11629    }
11630
11631    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DeviceCategory>
11632        for crate::DeviceCategory
11633    {
11634        fn compat_from(value: ::fidl_fuchsia_driver_framework::DeviceCategory) -> Self {
11635            Self {
11636                category: ::fidl_next::CompatFrom::compat_from(value.category),
11637
11638                subcategory: ::fidl_next::CompatFrom::compat_from(value.subcategory),
11639            }
11640        }
11641    }
11642
11643    impl ::fidl_next::CompatFrom<crate::DriverInfo> for ::fidl_fuchsia_driver_framework::DriverInfo {
11644        fn compat_from(value: crate::DriverInfo) -> Self {
11645            Self {
11646                url: ::fidl_next::CompatFrom::compat_from(value.url),
11647
11648                name: ::fidl_next::CompatFrom::compat_from(value.name),
11649
11650                colocate: ::fidl_next::CompatFrom::compat_from(value.colocate),
11651
11652                package_type: ::fidl_next::CompatFrom::compat_from(value.package_type),
11653
11654                is_fallback: ::fidl_next::CompatFrom::compat_from(value.is_fallback),
11655
11656                device_categories: ::fidl_next::CompatFrom::compat_from(value.device_categories),
11657
11658                bind_rules_bytecode: ::fidl_next::CompatFrom::compat_from(
11659                    value.bind_rules_bytecode,
11660                ),
11661
11662                driver_framework_version: ::fidl_next::CompatFrom::compat_from(
11663                    value.driver_framework_version,
11664                ),
11665
11666                is_disabled: ::fidl_next::CompatFrom::compat_from(value.is_disabled),
11667
11668                __source_breaking: ::fidl::marker::SourceBreaking,
11669            }
11670        }
11671    }
11672
11673    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DriverInfo> for crate::DriverInfo {
11674        fn compat_from(value: ::fidl_fuchsia_driver_framework::DriverInfo) -> Self {
11675            Self {
11676                url: ::fidl_next::CompatFrom::compat_from(value.url),
11677
11678                name: ::fidl_next::CompatFrom::compat_from(value.name),
11679
11680                colocate: ::fidl_next::CompatFrom::compat_from(value.colocate),
11681
11682                package_type: ::fidl_next::CompatFrom::compat_from(value.package_type),
11683
11684                is_fallback: ::fidl_next::CompatFrom::compat_from(value.is_fallback),
11685
11686                device_categories: ::fidl_next::CompatFrom::compat_from(value.device_categories),
11687
11688                bind_rules_bytecode: ::fidl_next::CompatFrom::compat_from(
11689                    value.bind_rules_bytecode,
11690                ),
11691
11692                driver_framework_version: ::fidl_next::CompatFrom::compat_from(
11693                    value.driver_framework_version,
11694                ),
11695
11696                is_disabled: ::fidl_next::CompatFrom::compat_from(value.is_disabled),
11697            }
11698        }
11699    }
11700
11701    impl ::fidl_next::CompatFrom<crate::CompositeDriverInfo>
11702        for ::fidl_fuchsia_driver_framework::CompositeDriverInfo
11703    {
11704        fn compat_from(value: crate::CompositeDriverInfo) -> Self {
11705            Self {
11706                composite_name: ::fidl_next::CompatFrom::compat_from(value.composite_name),
11707
11708                driver_info: ::fidl_next::CompatFrom::compat_from(value.driver_info),
11709
11710                __source_breaking: ::fidl::marker::SourceBreaking,
11711            }
11712        }
11713    }
11714
11715    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::CompositeDriverInfo>
11716        for crate::CompositeDriverInfo
11717    {
11718        fn compat_from(value: ::fidl_fuchsia_driver_framework::CompositeDriverInfo) -> Self {
11719            Self {
11720                composite_name: ::fidl_next::CompatFrom::compat_from(value.composite_name),
11721
11722                driver_info: ::fidl_next::CompatFrom::compat_from(value.driver_info),
11723            }
11724        }
11725    }
11726
11727    impl ::fidl_next::CompatFrom<crate::CompositeDriverMatch>
11728        for ::fidl_fuchsia_driver_framework::CompositeDriverMatch
11729    {
11730        fn compat_from(value: crate::CompositeDriverMatch) -> Self {
11731            Self {
11732                composite_driver: ::fidl_next::CompatFrom::compat_from(value.composite_driver),
11733
11734                parent_names: ::fidl_next::CompatFrom::compat_from(value.parent_names),
11735
11736                primary_parent_index: ::fidl_next::CompatFrom::compat_from(
11737                    value.primary_parent_index,
11738                ),
11739
11740                __source_breaking: ::fidl::marker::SourceBreaking,
11741            }
11742        }
11743    }
11744
11745    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::CompositeDriverMatch>
11746        for crate::CompositeDriverMatch
11747    {
11748        fn compat_from(value: ::fidl_fuchsia_driver_framework::CompositeDriverMatch) -> Self {
11749            Self {
11750                composite_driver: ::fidl_next::CompatFrom::compat_from(value.composite_driver),
11751
11752                parent_names: ::fidl_next::CompatFrom::compat_from(value.parent_names),
11753
11754                primary_parent_index: ::fidl_next::CompatFrom::compat_from(
11755                    value.primary_parent_index,
11756                ),
11757            }
11758        }
11759    }
11760
11761    impl ::fidl_next::CompatFrom<crate::NodeProperty>
11762        for ::fidl_fuchsia_driver_framework::NodeProperty
11763    {
11764        #[inline]
11765        fn compat_from(value: crate::NodeProperty) -> Self {
11766            Self {
11767                key: ::fidl_next::CompatFrom::compat_from(value.key),
11768
11769                value: ::fidl_next::CompatFrom::compat_from(value.value),
11770            }
11771        }
11772    }
11773
11774    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeProperty>
11775        for crate::NodeProperty
11776    {
11777        #[inline]
11778        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodeProperty) -> Self {
11779            Self {
11780                key: ::fidl_next::CompatFrom::compat_from(value.key),
11781
11782                value: ::fidl_next::CompatFrom::compat_from(value.value),
11783            }
11784        }
11785    }
11786
11787    impl ::fidl_next::CompatFrom<crate::ParentSpec> for ::fidl_fuchsia_driver_framework::ParentSpec {
11788        #[inline]
11789        fn compat_from(value: crate::ParentSpec) -> Self {
11790            Self {
11791                bind_rules: ::fidl_next::CompatFrom::compat_from(value.bind_rules),
11792
11793                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
11794            }
11795        }
11796    }
11797
11798    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::ParentSpec> for crate::ParentSpec {
11799        #[inline]
11800        fn compat_from(value: ::fidl_fuchsia_driver_framework::ParentSpec) -> Self {
11801            Self {
11802                bind_rules: ::fidl_next::CompatFrom::compat_from(value.bind_rules),
11803
11804                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
11805            }
11806        }
11807    }
11808
11809    impl ::fidl_next::CompatFrom<crate::NodeProperty2>
11810        for ::fidl_fuchsia_driver_framework::NodeProperty2
11811    {
11812        #[inline]
11813        fn compat_from(value: crate::NodeProperty2) -> Self {
11814            Self {
11815                key: ::fidl_next::CompatFrom::compat_from(value.key),
11816
11817                value: ::fidl_next::CompatFrom::compat_from(value.value),
11818            }
11819        }
11820    }
11821
11822    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeProperty2>
11823        for crate::NodeProperty2
11824    {
11825        #[inline]
11826        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodeProperty2) -> Self {
11827            Self {
11828                key: ::fidl_next::CompatFrom::compat_from(value.key),
11829
11830                value: ::fidl_next::CompatFrom::compat_from(value.value),
11831            }
11832        }
11833    }
11834
11835    impl ::fidl_next::CompatFrom<crate::ParentSpec2> for ::fidl_fuchsia_driver_framework::ParentSpec2 {
11836        #[inline]
11837        fn compat_from(value: crate::ParentSpec2) -> Self {
11838            Self {
11839                bind_rules: ::fidl_next::CompatFrom::compat_from(value.bind_rules),
11840
11841                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
11842            }
11843        }
11844    }
11845
11846    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::ParentSpec2> for crate::ParentSpec2 {
11847        #[inline]
11848        fn compat_from(value: ::fidl_fuchsia_driver_framework::ParentSpec2) -> Self {
11849            Self {
11850                bind_rules: ::fidl_next::CompatFrom::compat_from(value.bind_rules),
11851
11852                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
11853            }
11854        }
11855    }
11856
11857    impl ::fidl_next::CompatFrom<crate::CompositeNodeSpec>
11858        for ::fidl_fuchsia_driver_framework::CompositeNodeSpec
11859    {
11860        fn compat_from(value: crate::CompositeNodeSpec) -> Self {
11861            Self {
11862                name: ::fidl_next::CompatFrom::compat_from(value.name),
11863
11864                parents: ::fidl_next::CompatFrom::compat_from(value.parents),
11865
11866                parents2: ::fidl_next::CompatFrom::compat_from(value.parents2),
11867
11868                __source_breaking: ::fidl::marker::SourceBreaking,
11869            }
11870        }
11871    }
11872
11873    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::CompositeNodeSpec>
11874        for crate::CompositeNodeSpec
11875    {
11876        fn compat_from(value: ::fidl_fuchsia_driver_framework::CompositeNodeSpec) -> Self {
11877            Self {
11878                name: ::fidl_next::CompatFrom::compat_from(value.name),
11879
11880                parents: ::fidl_next::CompatFrom::compat_from(value.parents),
11881
11882                parents2: ::fidl_next::CompatFrom::compat_from(value.parents2),
11883            }
11884        }
11885    }
11886
11887    impl ::fidl_next::CompatFrom<crate::CompositeInfo>
11888        for ::fidl_fuchsia_driver_framework::CompositeInfo
11889    {
11890        fn compat_from(value: crate::CompositeInfo) -> Self {
11891            Self {
11892                spec: ::fidl_next::CompatFrom::compat_from(value.spec),
11893
11894                matched_driver: ::fidl_next::CompatFrom::compat_from(value.matched_driver),
11895
11896                __source_breaking: ::fidl::marker::SourceBreaking,
11897            }
11898        }
11899    }
11900
11901    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::CompositeInfo>
11902        for crate::CompositeInfo
11903    {
11904        fn compat_from(value: ::fidl_fuchsia_driver_framework::CompositeInfo) -> Self {
11905            Self {
11906                spec: ::fidl_next::CompatFrom::compat_from(value.spec),
11907
11908                matched_driver: ::fidl_next::CompatFrom::compat_from(value.matched_driver),
11909            }
11910        }
11911    }
11912
11913    impl ::fidl_next::CompatFrom<crate::CompositeNodeSpecError>
11914        for ::fidl_fuchsia_driver_framework::CompositeNodeSpecError
11915    {
11916        fn compat_from(value: crate::CompositeNodeSpecError) -> Self {
11917            match value {
11918                crate::CompositeNodeSpecError::MissingArgs => Self::MissingArgs,
11919
11920                crate::CompositeNodeSpecError::EmptyNodes => Self::EmptyNodes,
11921
11922                crate::CompositeNodeSpecError::AlreadyExists => Self::AlreadyExists,
11923
11924                crate::CompositeNodeSpecError::DriverIndexFailure => Self::DriverIndexFailure,
11925
11926                crate::CompositeNodeSpecError::DuplicateParents => Self::DuplicateParents,
11927
11928                crate::CompositeNodeSpecError::UnknownOrdinal_(unknown_ordinal) => {
11929                    Self::__SourceBreaking { unknown_ordinal }
11930                }
11931            }
11932        }
11933    }
11934
11935    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::CompositeNodeSpecError>
11936        for crate::CompositeNodeSpecError
11937    {
11938        fn compat_from(value: ::fidl_fuchsia_driver_framework::CompositeNodeSpecError) -> Self {
11939            match value {
11940                ::fidl_fuchsia_driver_framework::CompositeNodeSpecError::MissingArgs => {
11941                    Self::MissingArgs
11942                }
11943
11944                ::fidl_fuchsia_driver_framework::CompositeNodeSpecError::EmptyNodes => {
11945                    Self::EmptyNodes
11946                }
11947
11948                ::fidl_fuchsia_driver_framework::CompositeNodeSpecError::AlreadyExists => {
11949                    Self::AlreadyExists
11950                }
11951
11952                ::fidl_fuchsia_driver_framework::CompositeNodeSpecError::DriverIndexFailure => {
11953                    Self::DriverIndexFailure
11954                }
11955
11956                ::fidl_fuchsia_driver_framework::CompositeNodeSpecError::DuplicateParents => {
11957                    Self::DuplicateParents
11958                }
11959
11960                ::fidl_fuchsia_driver_framework::CompositeNodeSpecError::__SourceBreaking {
11961                    unknown_ordinal: value,
11962                } => Self::UnknownOrdinal_(value),
11963            }
11964        }
11965    }
11966
11967    #[cfg(target_os = "fuchsia")]
11968    /// An alias for a client sender over `zx::Channel` for the `CompositeNodeManager`
11969    /// protocol.
11970    pub type CompositeNodeManagerProxy = ::fidl_next::ClientSender<crate::CompositeNodeManager>;
11971
11972    impl ::fidl_next::CompatFrom<crate::CompositeNodeManager>
11973        for ::fidl_fuchsia_driver_framework::CompositeNodeManagerMarker
11974    {
11975        fn compat_from(_: crate::CompositeNodeManager) -> Self {
11976            Self
11977        }
11978    }
11979
11980    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::CompositeNodeManagerMarker>
11981        for crate::CompositeNodeManager
11982    {
11983        fn compat_from(_: ::fidl_fuchsia_driver_framework::CompositeNodeManagerMarker) -> Self {
11984            Self
11985        }
11986    }
11987
11988    #[cfg(target_os = "fuchsia")]
11989
11990    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_driver_framework::CompositeNodeManagerProxy>
11991        for crate::CompositeNodeManager
11992    {
11993        fn client_compat_from(
11994            proxy: ::fidl_fuchsia_driver_framework::CompositeNodeManagerProxy,
11995        ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
11996            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
11997            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
11998            ::fidl_next::Client::new(client_end)
11999        }
12000    }
12001
12002    impl ::fidl_next::CompatFrom<crate::CompositeParent>
12003        for ::fidl_fuchsia_driver_framework::CompositeParent
12004    {
12005        fn compat_from(value: crate::CompositeParent) -> Self {
12006            Self {
12007                composite: ::fidl_next::CompatFrom::compat_from(value.composite),
12008
12009                index: ::fidl_next::CompatFrom::compat_from(value.index),
12010
12011                __source_breaking: ::fidl::marker::SourceBreaking,
12012            }
12013        }
12014    }
12015
12016    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::CompositeParent>
12017        for crate::CompositeParent
12018    {
12019        fn compat_from(value: ::fidl_fuchsia_driver_framework::CompositeParent) -> Self {
12020            Self {
12021                composite: ::fidl_next::CompatFrom::compat_from(value.composite),
12022
12023                index: ::fidl_next::CompatFrom::compat_from(value.index),
12024            }
12025        }
12026    }
12027
12028    impl ::fidl_next::CompatFrom<crate::DevfsAddArgs>
12029        for ::fidl_fuchsia_driver_framework::DevfsAddArgs
12030    {
12031        fn compat_from(value: crate::DevfsAddArgs) -> Self {
12032            Self {
12033                connector: ::fidl_next::CompatFrom::compat_from(value.connector),
12034
12035                class_name: ::fidl_next::CompatFrom::compat_from(value.class_name),
12036
12037                inspect: ::fidl_next::CompatFrom::compat_from(value.inspect),
12038
12039                connector_supports: ::fidl_next::CompatFrom::compat_from(value.connector_supports),
12040
12041                controller_connector: ::fidl_next::CompatFrom::compat_from(
12042                    value.controller_connector,
12043                ),
12044
12045                __source_breaking: ::fidl::marker::SourceBreaking,
12046            }
12047        }
12048    }
12049
12050    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DevfsAddArgs>
12051        for crate::DevfsAddArgs
12052    {
12053        fn compat_from(value: ::fidl_fuchsia_driver_framework::DevfsAddArgs) -> Self {
12054            Self {
12055                connector: ::fidl_next::CompatFrom::compat_from(value.connector),
12056
12057                class_name: ::fidl_next::CompatFrom::compat_from(value.class_name),
12058
12059                inspect: ::fidl_next::CompatFrom::compat_from(value.inspect),
12060
12061                connector_supports: ::fidl_next::CompatFrom::compat_from(value.connector_supports),
12062
12063                controller_connector: ::fidl_next::CompatFrom::compat_from(
12064                    value.controller_connector,
12065                ),
12066            }
12067        }
12068    }
12069
12070    impl ::fidl_next::CompatFrom<crate::NodePropertyEntry>
12071        for ::fidl_fuchsia_driver_framework::NodePropertyEntry
12072    {
12073        #[inline]
12074        fn compat_from(value: crate::NodePropertyEntry) -> Self {
12075            Self {
12076                name: ::fidl_next::CompatFrom::compat_from(value.name),
12077
12078                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
12079            }
12080        }
12081    }
12082
12083    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodePropertyEntry>
12084        for crate::NodePropertyEntry
12085    {
12086        #[inline]
12087        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodePropertyEntry) -> Self {
12088            Self {
12089                name: ::fidl_next::CompatFrom::compat_from(value.name),
12090
12091                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
12092            }
12093        }
12094    }
12095
12096    impl ::fidl_next::CompatFrom<crate::NodePropertyEntry2>
12097        for ::fidl_fuchsia_driver_framework::NodePropertyEntry2
12098    {
12099        #[inline]
12100        fn compat_from(value: crate::NodePropertyEntry2) -> Self {
12101            Self {
12102                name: ::fidl_next::CompatFrom::compat_from(value.name),
12103
12104                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
12105            }
12106        }
12107    }
12108
12109    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodePropertyEntry2>
12110        for crate::NodePropertyEntry2
12111    {
12112        #[inline]
12113        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodePropertyEntry2) -> Self {
12114            Self {
12115                name: ::fidl_next::CompatFrom::compat_from(value.name),
12116
12117                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
12118            }
12119        }
12120    }
12121
12122    impl ::fidl_next::CompatFrom<crate::NodeSymbol> for ::fidl_fuchsia_driver_framework::NodeSymbol {
12123        fn compat_from(value: crate::NodeSymbol) -> Self {
12124            Self {
12125                name: ::fidl_next::CompatFrom::compat_from(value.name),
12126
12127                address: ::fidl_next::CompatFrom::compat_from(value.address),
12128
12129                module_name: ::fidl_next::CompatFrom::compat_from(value.module_name),
12130
12131                __source_breaking: ::fidl::marker::SourceBreaking,
12132            }
12133        }
12134    }
12135
12136    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeSymbol> for crate::NodeSymbol {
12137        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodeSymbol) -> Self {
12138            Self {
12139                name: ::fidl_next::CompatFrom::compat_from(value.name),
12140
12141                address: ::fidl_next::CompatFrom::compat_from(value.address),
12142
12143                module_name: ::fidl_next::CompatFrom::compat_from(value.module_name),
12144            }
12145        }
12146    }
12147
12148    impl ::fidl_next::CompatFrom<crate::Offer> for ::fidl_fuchsia_driver_framework::Offer {
12149        fn compat_from(value: crate::Offer) -> Self {
12150            match value {
12151                crate::Offer::ZirconTransport(value) => {
12152                    Self::ZirconTransport(::fidl_next::CompatFrom::compat_from(value))
12153                }
12154
12155                crate::Offer::DriverTransport(value) => {
12156                    Self::DriverTransport(::fidl_next::CompatFrom::compat_from(value))
12157                }
12158
12159                crate::Offer::UnknownOrdinal_(unknown_ordinal) => {
12160                    Self::__SourceBreaking { unknown_ordinal }
12161                }
12162            }
12163        }
12164    }
12165
12166    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::Offer> for crate::Offer {
12167        fn compat_from(value: ::fidl_fuchsia_driver_framework::Offer) -> Self {
12168            match value {
12169                ::fidl_fuchsia_driver_framework::Offer::ZirconTransport(value) => {
12170                    Self::ZirconTransport(::fidl_next::CompatFrom::compat_from(value))
12171                }
12172
12173                ::fidl_fuchsia_driver_framework::Offer::DriverTransport(value) => {
12174                    Self::DriverTransport(::fidl_next::CompatFrom::compat_from(value))
12175                }
12176
12177                ::fidl_fuchsia_driver_framework::Offer::__SourceBreaking { unknown_ordinal } => {
12178                    Self::UnknownOrdinal_(unknown_ordinal)
12179                }
12180            }
12181        }
12182    }
12183
12184    impl ::fidl_next::CompatFrom<crate::DriverStartArgs>
12185        for ::fidl_fuchsia_driver_framework::DriverStartArgs
12186    {
12187        fn compat_from(value: crate::DriverStartArgs) -> Self {
12188            Self {
12189                node: ::fidl_next::CompatFrom::compat_from(value.node),
12190
12191                symbols: ::fidl_next::CompatFrom::compat_from(value.symbols),
12192
12193                url: ::fidl_next::CompatFrom::compat_from(value.url),
12194
12195                program: ::fidl_next::CompatFrom::compat_from(value.program),
12196
12197                incoming: ::fidl_next::CompatFrom::compat_from(value.incoming),
12198
12199                outgoing_dir: ::fidl_next::CompatFrom::compat_from(value.outgoing_dir),
12200
12201                config: ::fidl_next::CompatFrom::compat_from(value.config),
12202
12203                node_name: ::fidl_next::CompatFrom::compat_from(value.node_name),
12204
12205                node_properties: ::fidl_next::CompatFrom::compat_from(value.node_properties),
12206
12207                node_offers: ::fidl_next::CompatFrom::compat_from(value.node_offers),
12208
12209                node_token: ::fidl_next::CompatFrom::compat_from(value.node_token),
12210
12211                node_properties_2: ::fidl_next::CompatFrom::compat_from(value.node_properties_2),
12212
12213                __source_breaking: ::fidl::marker::SourceBreaking,
12214            }
12215        }
12216    }
12217
12218    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DriverStartArgs>
12219        for crate::DriverStartArgs
12220    {
12221        fn compat_from(value: ::fidl_fuchsia_driver_framework::DriverStartArgs) -> Self {
12222            Self {
12223                node: ::fidl_next::CompatFrom::compat_from(value.node),
12224
12225                symbols: ::fidl_next::CompatFrom::compat_from(value.symbols),
12226
12227                url: ::fidl_next::CompatFrom::compat_from(value.url),
12228
12229                program: ::fidl_next::CompatFrom::compat_from(value.program),
12230
12231                incoming: ::fidl_next::CompatFrom::compat_from(value.incoming),
12232
12233                outgoing_dir: ::fidl_next::CompatFrom::compat_from(value.outgoing_dir),
12234
12235                config: ::fidl_next::CompatFrom::compat_from(value.config),
12236
12237                node_name: ::fidl_next::CompatFrom::compat_from(value.node_name),
12238
12239                node_properties: ::fidl_next::CompatFrom::compat_from(value.node_properties),
12240
12241                node_offers: ::fidl_next::CompatFrom::compat_from(value.node_offers),
12242
12243                node_token: ::fidl_next::CompatFrom::compat_from(value.node_token),
12244
12245                node_properties_2: ::fidl_next::CompatFrom::compat_from(value.node_properties_2),
12246            }
12247        }
12248    }
12249
12250    #[cfg(feature = "driver")]
12251    impl ::fidl_next::CompatFrom<crate::DriverStartRequest>
12252        for ::fidl_fuchsia_driver_framework::DriverStartRequest
12253    {
12254        #[inline]
12255        fn compat_from(value: crate::DriverStartRequest) -> Self {
12256            Self { start_args: ::fidl_next::CompatFrom::compat_from(value.start_args) }
12257        }
12258    }
12259
12260    #[cfg(feature = "driver")]
12261    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DriverStartRequest>
12262        for crate::DriverStartRequest
12263    {
12264        #[inline]
12265        fn compat_from(value: ::fidl_fuchsia_driver_framework::DriverStartRequest) -> Self {
12266            Self { start_args: ::fidl_next::CompatFrom::compat_from(value.start_args) }
12267        }
12268    }
12269
12270    #[cfg(target_os = "fuchsia")]
12271    /// An alias for a client sender over `zx::Channel` for the `Driver`
12272    /// protocol.
12273    pub type DriverProxy = ::fidl_next::ClientSender<crate::Driver>;
12274
12275    #[cfg(feature = "driver")]
12276    impl ::fidl_next::CompatFrom<crate::Driver> for ::fidl_fuchsia_driver_framework::DriverMarker {
12277        fn compat_from(_: crate::Driver) -> Self {
12278            Self
12279        }
12280    }
12281
12282    #[cfg(feature = "driver")]
12283    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DriverMarker> for crate::Driver {
12284        fn compat_from(_: ::fidl_fuchsia_driver_framework::DriverMarker) -> Self {
12285            Self
12286        }
12287    }
12288
12289    impl ::fidl_next::CompatFrom<crate::DriverResult>
12290        for ::fidl_fuchsia_driver_framework::DriverResult
12291    {
12292        fn compat_from(value: crate::DriverResult) -> Self {
12293            match value {
12294                crate::DriverResult::DriverStartedNodeToken(value) => {
12295                    Self::DriverStartedNodeToken(::fidl_next::CompatFrom::compat_from(value))
12296                }
12297
12298                crate::DriverResult::MatchError(value) => {
12299                    Self::MatchError(::fidl_next::CompatFrom::compat_from(value))
12300                }
12301
12302                crate::DriverResult::StartError(value) => {
12303                    Self::StartError(::fidl_next::CompatFrom::compat_from(value))
12304                }
12305
12306                crate::DriverResult::UnknownOrdinal_(unknown_ordinal) => {
12307                    Self::__SourceBreaking { unknown_ordinal }
12308                }
12309            }
12310        }
12311    }
12312
12313    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::DriverResult>
12314        for crate::DriverResult
12315    {
12316        fn compat_from(value: ::fidl_fuchsia_driver_framework::DriverResult) -> Self {
12317            match value {
12318                ::fidl_fuchsia_driver_framework::DriverResult::DriverStartedNodeToken(value) => {
12319                    Self::DriverStartedNodeToken(::fidl_next::CompatFrom::compat_from(value))
12320                }
12321
12322                ::fidl_fuchsia_driver_framework::DriverResult::MatchError(value) => {
12323                    Self::MatchError(::fidl_next::CompatFrom::compat_from(value))
12324                }
12325
12326                ::fidl_fuchsia_driver_framework::DriverResult::StartError(value) => {
12327                    Self::StartError(::fidl_next::CompatFrom::compat_from(value))
12328                }
12329
12330                ::fidl_fuchsia_driver_framework::DriverResult::__SourceBreaking {
12331                    unknown_ordinal,
12332                } => Self::UnknownOrdinal_(unknown_ordinal),
12333            }
12334        }
12335    }
12336
12337    impl ::fidl_next::CompatFrom<crate::NodeError> for ::fidl_fuchsia_driver_framework::NodeError {
12338        fn compat_from(value: crate::NodeError) -> Self {
12339            match value {
12340                crate::NodeError::Internal => Self::Internal,
12341
12342                crate::NodeError::NodeRemoved => Self::NodeRemoved,
12343
12344                crate::NodeError::NameMissing => Self::NameMissing,
12345
12346                crate::NodeError::NameInvalid => Self::NameInvalid,
12347
12348                crate::NodeError::NameAlreadyExists => Self::NameAlreadyExists,
12349
12350                crate::NodeError::OfferSourceNameMissing => Self::OfferSourceNameMissing,
12351
12352                crate::NodeError::OfferRefExists => Self::OfferRefExists,
12353
12354                crate::NodeError::SymbolNameMissing => Self::SymbolNameMissing,
12355
12356                crate::NodeError::SymbolAddressMissing => Self::SymbolAddressMissing,
12357
12358                crate::NodeError::SymbolAlreadyExists => Self::SymbolAlreadyExists,
12359
12360                crate::NodeError::UnbindChildrenInProgress => Self::UnbindChildrenInProgress,
12361
12362                crate::NodeError::UnsupportedArgs => Self::UnsupportedArgs,
12363
12364                crate::NodeError::DuplicatePropertyKeys => Self::DuplicatePropertyKeys,
12365
12366                crate::NodeError::OfferSourceInstanceFilterMissing => {
12367                    Self::OfferSourceInstanceFilterMissing
12368                }
12369
12370                crate::NodeError::OfferRenamedInstancesMissing => {
12371                    Self::OfferRenamedInstancesMissing
12372                }
12373
12374                crate::NodeError::UnknownOrdinal_(unknown_ordinal) => {
12375                    Self::__SourceBreaking { unknown_ordinal }
12376                }
12377            }
12378        }
12379    }
12380
12381    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeError> for crate::NodeError {
12382        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodeError) -> Self {
12383            match value {
12384                ::fidl_fuchsia_driver_framework::NodeError::Internal => Self::Internal,
12385
12386                ::fidl_fuchsia_driver_framework::NodeError::NodeRemoved => Self::NodeRemoved,
12387
12388                ::fidl_fuchsia_driver_framework::NodeError::NameMissing => Self::NameMissing,
12389
12390                ::fidl_fuchsia_driver_framework::NodeError::NameInvalid => Self::NameInvalid,
12391
12392                ::fidl_fuchsia_driver_framework::NodeError::NameAlreadyExists => {
12393                    Self::NameAlreadyExists
12394                }
12395
12396                ::fidl_fuchsia_driver_framework::NodeError::OfferSourceNameMissing => {
12397                    Self::OfferSourceNameMissing
12398                }
12399
12400                ::fidl_fuchsia_driver_framework::NodeError::OfferRefExists => Self::OfferRefExists,
12401
12402                ::fidl_fuchsia_driver_framework::NodeError::SymbolNameMissing => {
12403                    Self::SymbolNameMissing
12404                }
12405
12406                ::fidl_fuchsia_driver_framework::NodeError::SymbolAddressMissing => {
12407                    Self::SymbolAddressMissing
12408                }
12409
12410                ::fidl_fuchsia_driver_framework::NodeError::SymbolAlreadyExists => {
12411                    Self::SymbolAlreadyExists
12412                }
12413
12414                ::fidl_fuchsia_driver_framework::NodeError::UnbindChildrenInProgress => {
12415                    Self::UnbindChildrenInProgress
12416                }
12417
12418                ::fidl_fuchsia_driver_framework::NodeError::UnsupportedArgs => {
12419                    Self::UnsupportedArgs
12420                }
12421
12422                ::fidl_fuchsia_driver_framework::NodeError::DuplicatePropertyKeys => {
12423                    Self::DuplicatePropertyKeys
12424                }
12425
12426                ::fidl_fuchsia_driver_framework::NodeError::OfferSourceInstanceFilterMissing => {
12427                    Self::OfferSourceInstanceFilterMissing
12428                }
12429
12430                ::fidl_fuchsia_driver_framework::NodeError::OfferRenamedInstancesMissing => {
12431                    Self::OfferRenamedInstancesMissing
12432                }
12433
12434                ::fidl_fuchsia_driver_framework::NodeError::__SourceBreaking {
12435                    unknown_ordinal: value,
12436                } => Self::UnknownOrdinal_(value),
12437            }
12438        }
12439    }
12440
12441    impl ::fidl_next::CompatFrom<crate::NodeAddArgs> for ::fidl_fuchsia_driver_framework::NodeAddArgs {
12442        fn compat_from(value: crate::NodeAddArgs) -> Self {
12443            Self {
12444                name: ::fidl_next::CompatFrom::compat_from(value.name),
12445
12446                symbols: ::fidl_next::CompatFrom::compat_from(value.symbols),
12447
12448                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
12449
12450                devfs_args: ::fidl_next::CompatFrom::compat_from(value.devfs_args),
12451
12452                offers2: ::fidl_next::CompatFrom::compat_from(value.offers2),
12453
12454                bus_info: ::fidl_next::CompatFrom::compat_from(value.bus_info),
12455
12456                properties2: ::fidl_next::CompatFrom::compat_from(value.properties2),
12457
12458                __source_breaking: ::fidl::marker::SourceBreaking,
12459            }
12460        }
12461    }
12462
12463    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeAddArgs> for crate::NodeAddArgs {
12464        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodeAddArgs) -> Self {
12465            Self {
12466                name: ::fidl_next::CompatFrom::compat_from(value.name),
12467
12468                symbols: ::fidl_next::CompatFrom::compat_from(value.symbols),
12469
12470                properties: ::fidl_next::CompatFrom::compat_from(value.properties),
12471
12472                devfs_args: ::fidl_next::CompatFrom::compat_from(value.devfs_args),
12473
12474                offers2: ::fidl_next::CompatFrom::compat_from(value.offers2),
12475
12476                bus_info: ::fidl_next::CompatFrom::compat_from(value.bus_info),
12477
12478                properties2: ::fidl_next::CompatFrom::compat_from(value.properties2),
12479            }
12480        }
12481    }
12482
12483    impl ::fidl_next::CompatFrom<crate::NodeAddChildRequest>
12484        for ::fidl_fuchsia_driver_framework::NodeAddChildRequest
12485    {
12486        #[inline]
12487        fn compat_from(value: crate::NodeAddChildRequest) -> Self {
12488            Self {
12489                args: ::fidl_next::CompatFrom::compat_from(value.args),
12490
12491                controller: ::fidl_next::CompatFrom::compat_from(value.controller),
12492
12493                node: ::fidl_next::CompatFrom::compat_from(value.node),
12494            }
12495        }
12496    }
12497
12498    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeAddChildRequest>
12499        for crate::NodeAddChildRequest
12500    {
12501        #[inline]
12502        fn compat_from(value: ::fidl_fuchsia_driver_framework::NodeAddChildRequest) -> Self {
12503            Self {
12504                args: ::fidl_next::CompatFrom::compat_from(value.args),
12505
12506                controller: ::fidl_next::CompatFrom::compat_from(value.controller),
12507
12508                node: ::fidl_next::CompatFrom::compat_from(value.node),
12509            }
12510        }
12511    }
12512
12513    #[cfg(target_os = "fuchsia")]
12514    /// An alias for a client sender over `zx::Channel` for the `Node`
12515    /// protocol.
12516    pub type NodeProxy = ::fidl_next::ClientSender<crate::Node>;
12517
12518    impl ::fidl_next::CompatFrom<crate::Node> for ::fidl_fuchsia_driver_framework::NodeMarker {
12519        fn compat_from(_: crate::Node) -> Self {
12520            Self
12521        }
12522    }
12523
12524    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeMarker> for crate::Node {
12525        fn compat_from(_: ::fidl_fuchsia_driver_framework::NodeMarker) -> Self {
12526            Self
12527        }
12528    }
12529
12530    #[cfg(target_os = "fuchsia")]
12531
12532    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_driver_framework::NodeProxy> for crate::Node {
12533        fn client_compat_from(
12534            proxy: ::fidl_fuchsia_driver_framework::NodeProxy,
12535        ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
12536            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
12537            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
12538            ::fidl_next::Client::new(client_end)
12539        }
12540    }
12541
12542    impl ::fidl_next::CompatFrom<crate::NodeControllerRequestBindRequest>
12543        for ::fidl_fuchsia_driver_framework::NodeControllerRequestBindRequest
12544    {
12545        fn compat_from(value: crate::NodeControllerRequestBindRequest) -> Self {
12546            Self {
12547                force_rebind: ::fidl_next::CompatFrom::compat_from(value.force_rebind),
12548
12549                driver_url_suffix: ::fidl_next::CompatFrom::compat_from(value.driver_url_suffix),
12550
12551                __source_breaking: ::fidl::marker::SourceBreaking,
12552            }
12553        }
12554    }
12555
12556    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeControllerRequestBindRequest>
12557        for crate::NodeControllerRequestBindRequest
12558    {
12559        fn compat_from(
12560            value: ::fidl_fuchsia_driver_framework::NodeControllerRequestBindRequest,
12561        ) -> Self {
12562            Self {
12563                force_rebind: ::fidl_next::CompatFrom::compat_from(value.force_rebind),
12564
12565                driver_url_suffix: ::fidl_next::CompatFrom::compat_from(value.driver_url_suffix),
12566            }
12567        }
12568    }
12569
12570    impl ::fidl_next::CompatFrom<crate::NodeControllerOnBindRequest>
12571        for ::fidl_fuchsia_driver_framework::NodeControllerOnBindRequest
12572    {
12573        fn compat_from(value: crate::NodeControllerOnBindRequest) -> Self {
12574            Self {
12575                node_token: ::fidl_next::CompatFrom::compat_from(value.node_token),
12576
12577                __source_breaking: ::fidl::marker::SourceBreaking,
12578            }
12579        }
12580    }
12581
12582    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeControllerOnBindRequest>
12583        for crate::NodeControllerOnBindRequest
12584    {
12585        fn compat_from(
12586            value: ::fidl_fuchsia_driver_framework::NodeControllerOnBindRequest,
12587        ) -> Self {
12588            Self { node_token: ::fidl_next::CompatFrom::compat_from(value.node_token) }
12589        }
12590    }
12591
12592    #[cfg(target_os = "fuchsia")]
12593    /// An alias for a client sender over `zx::Channel` for the `NodeController`
12594    /// protocol.
12595    pub type NodeControllerProxy = ::fidl_next::ClientSender<crate::NodeController>;
12596
12597    impl ::fidl_next::CompatFrom<crate::NodeController>
12598        for ::fidl_fuchsia_driver_framework::NodeControllerMarker
12599    {
12600        fn compat_from(_: crate::NodeController) -> Self {
12601            Self
12602        }
12603    }
12604
12605    impl ::fidl_next::CompatFrom<::fidl_fuchsia_driver_framework::NodeControllerMarker>
12606        for crate::NodeController
12607    {
12608        fn compat_from(_: ::fidl_fuchsia_driver_framework::NodeControllerMarker) -> Self {
12609            Self
12610        }
12611    }
12612
12613    #[cfg(target_os = "fuchsia")]
12614
12615    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_driver_framework::NodeControllerProxy>
12616        for crate::NodeController
12617    {
12618        fn client_compat_from(
12619            proxy: ::fidl_fuchsia_driver_framework::NodeControllerProxy,
12620        ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
12621            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
12622            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
12623            ::fidl_next::Client::new(client_end)
12624        }
12625    }
12626}