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