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 = ::fidl_next::WireString;
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;
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        &mut 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 } = 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
54impl ::fidl_next::EncodableOption for Box<NodePropertyKey> {
55    type EncodedOption = WireOptionalNodePropertyKey;
56}
57
58unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodePropertyKey>
59where
60    ___E: ?Sized,
61    NodePropertyKey: ::fidl_next::Encode<___E>,
62{
63    #[inline]
64    fn encode_option(
65        this: Option<&mut Self>,
66        encoder: &mut ___E,
67        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
68    ) -> Result<(), ::fidl_next::EncodeError> {
69        ::fidl_next::munge!(let WireOptionalNodePropertyKey { raw } = &mut *out);
70
71        if let Some(inner) = this {
72            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
73            ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
74        } else {
75            ::fidl_next::RawWireUnion::encode_absent(raw);
76        }
77
78        Ok(())
79    }
80}
81
82impl ::fidl_next::TakeFrom<WireNodePropertyKey> for NodePropertyKey {
83    #[inline]
84    fn take_from(from: &WireNodePropertyKey) -> Self {
85        match from.raw.ordinal() {
86            1 => Self::IntValue(::fidl_next::TakeFrom::take_from(unsafe {
87                from.raw.get().deref_unchecked::<::fidl_next::WireU32>()
88            })),
89
90            2 => Self::StringValue(::fidl_next::TakeFrom::take_from(unsafe {
91                from.raw.get().deref_unchecked::<::fidl_next::WireString>()
92            })),
93
94            _ => unsafe { ::core::hint::unreachable_unchecked() },
95        }
96    }
97}
98
99impl ::fidl_next::TakeFrom<WireOptionalNodePropertyKey> for Option<Box<NodePropertyKey>> {
100    #[inline]
101    fn take_from(from: &WireOptionalNodePropertyKey) -> Self {
102        if let Some(inner) = from.as_ref() {
103            Some(::fidl_next::TakeFrom::take_from(inner))
104        } else {
105            None
106        }
107    }
108}
109
110/// The wire type corresponding to [`NodePropertyKey`].
111#[repr(transparent)]
112pub struct WireNodePropertyKey {
113    raw: ::fidl_next::RawWireUnion,
114}
115
116unsafe impl ::fidl_next::ZeroPadding for WireNodePropertyKey {
117    #[inline]
118    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
119        ::fidl_next::munge!(let Self { raw } = out);
120        ::fidl_next::RawWireUnion::zero_padding(raw);
121    }
122}
123
124pub mod node_property_key {
125    pub enum Ref<'union> {
126        IntValue(&'union ::fidl_next::WireU32),
127
128        StringValue(&'union ::fidl_next::WireString),
129    }
130}
131
132impl WireNodePropertyKey {
133    pub fn as_ref(&self) -> crate::node_property_key::Ref<'_> {
134        match self.raw.ordinal() {
135            1 => crate::node_property_key::Ref::IntValue(unsafe {
136                self.raw.get().deref_unchecked::<::fidl_next::WireU32>()
137            }),
138
139            2 => crate::node_property_key::Ref::StringValue(unsafe {
140                self.raw.get().deref_unchecked::<::fidl_next::WireString>()
141            }),
142
143            _ => unsafe { ::core::hint::unreachable_unchecked() },
144        }
145    }
146}
147
148unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodePropertyKey
149where
150    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
151
152    ___D: ::fidl_next::Decoder,
153{
154    fn decode(
155        mut slot: ::fidl_next::Slot<'_, Self>,
156        decoder: &mut ___D,
157    ) -> Result<(), ::fidl_next::DecodeError> {
158        ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
159        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
160            1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
161
162            2 => {
163                ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString>(raw, decoder)?
164            }
165
166            ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
167        }
168
169        Ok(())
170    }
171}
172
173impl ::core::fmt::Debug for WireNodePropertyKey {
174    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
175        match self.raw.ordinal() {
176            1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU32>().fmt(f) },
177            2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString>().fmt(f) },
178            _ => unsafe { ::core::hint::unreachable_unchecked() },
179        }
180    }
181}
182
183#[repr(transparent)]
184pub struct WireOptionalNodePropertyKey {
185    raw: ::fidl_next::RawWireUnion,
186}
187
188unsafe impl ::fidl_next::ZeroPadding for WireOptionalNodePropertyKey {
189    #[inline]
190    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
191        ::fidl_next::munge!(let Self { raw } = out);
192        ::fidl_next::RawWireUnion::zero_padding(raw);
193    }
194}
195
196impl WireOptionalNodePropertyKey {
197    pub fn is_some(&self) -> bool {
198        self.raw.is_some()
199    }
200
201    pub fn is_none(&self) -> bool {
202        self.raw.is_none()
203    }
204
205    pub fn as_ref(&self) -> Option<&WireNodePropertyKey> {
206        if self.is_some() {
207            Some(unsafe { &*(self as *const Self).cast() })
208        } else {
209            None
210        }
211    }
212}
213
214unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalNodePropertyKey
215where
216    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
217
218    ___D: ::fidl_next::Decoder,
219{
220    fn decode(
221        mut slot: ::fidl_next::Slot<'_, Self>,
222        decoder: &mut ___D,
223    ) -> Result<(), ::fidl_next::DecodeError> {
224        ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
225        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
226            1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
227
228            2 => {
229                ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString>(raw, decoder)?
230            }
231
232            0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
233            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
234        }
235
236        Ok(())
237    }
238}
239
240impl ::core::fmt::Debug for WireOptionalNodePropertyKey {
241    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
242        self.as_ref().fmt(f)
243    }
244}
245
246#[doc = " Represents a bind rule condition.\n"]
247#[derive(Clone, Copy, Debug, PartialEq, Eq)]
248#[repr(u32)]
249pub enum Condition {
250    Unknown = 0,
251    Accept = 1,
252    Reject = 2,
253}
254
255impl ::fidl_next::Encodable for Condition {
256    type Encoded = WireCondition;
257}
258impl ::std::convert::TryFrom<u32> for Condition {
259    type Error = ::fidl_next::UnknownStrictEnumMemberError;
260    fn try_from(value: u32) -> Result<Self, Self::Error> {
261        match value {
262            0 => Ok(Self::Unknown),
263            1 => Ok(Self::Accept),
264            2 => Ok(Self::Reject),
265
266            _ => Err(Self::Error::new(value.into())),
267        }
268    }
269}
270
271unsafe impl<___E> ::fidl_next::Encode<___E> for Condition
272where
273    ___E: ?Sized,
274{
275    #[inline]
276    fn encode(
277        &mut self,
278        _: &mut ___E,
279        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
280    ) -> Result<(), ::fidl_next::EncodeError> {
281        ::fidl_next::munge!(let WireCondition { value } = out);
282        let _ = value.write(::fidl_next::WireU32::from(match *self {
283            Self::Unknown => 0,
284
285            Self::Accept => 1,
286
287            Self::Reject => 2,
288        }));
289
290        Ok(())
291    }
292}
293
294impl ::core::convert::From<WireCondition> for Condition {
295    fn from(wire: WireCondition) -> Self {
296        match u32::from(wire.value) {
297            0 => Self::Unknown,
298
299            1 => Self::Accept,
300
301            2 => Self::Reject,
302
303            _ => unsafe { ::core::hint::unreachable_unchecked() },
304        }
305    }
306}
307
308impl ::fidl_next::TakeFrom<WireCondition> for Condition {
309    #[inline]
310    fn take_from(from: &WireCondition) -> Self {
311        Self::from(*from)
312    }
313}
314
315/// The wire type corresponding to [`Condition`].
316#[derive(Clone, Copy, Debug, PartialEq, Eq)]
317#[repr(transparent)]
318pub struct WireCondition {
319    value: ::fidl_next::WireU32,
320}
321
322unsafe impl ::fidl_next::ZeroPadding for WireCondition {
323    #[inline]
324    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
325        // Wire enums have no padding
326    }
327}
328
329impl WireCondition {
330    pub const UNKNOWN: WireCondition = WireCondition { value: ::fidl_next::WireU32(0) };
331
332    pub const ACCEPT: WireCondition = WireCondition { value: ::fidl_next::WireU32(1) };
333
334    pub const REJECT: WireCondition = WireCondition { value: ::fidl_next::WireU32(2) };
335}
336
337unsafe impl<___D> ::fidl_next::Decode<___D> for WireCondition
338where
339    ___D: ?Sized,
340{
341    fn decode(
342        slot: ::fidl_next::Slot<'_, Self>,
343        _: &mut ___D,
344    ) -> Result<(), ::fidl_next::DecodeError> {
345        ::fidl_next::munge!(let Self { value } = slot);
346
347        match u32::from(*value) {
348            0 | 1 | 2 => (),
349            unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
350        }
351
352        Ok(())
353    }
354}
355
356impl ::core::convert::From<Condition> for WireCondition {
357    fn from(natural: Condition) -> Self {
358        match natural {
359            Condition::Unknown => WireCondition::UNKNOWN,
360
361            Condition::Accept => WireCondition::ACCEPT,
362
363            Condition::Reject => WireCondition::REJECT,
364        }
365    }
366}
367
368pub type NodePropertyValueUint = u32;
369
370/// The wire type corresponding to [`NodePropertyValueUint`].
371pub type WireNodePropertyValueUint = ::fidl_next::WireU32;
372
373pub type NodePropertyValueString = String;
374
375/// The wire type corresponding to [`NodePropertyValueString`].
376pub type WireNodePropertyValueString = ::fidl_next::WireString;
377
378pub type NodePropertyValueBool = bool;
379
380/// The wire type corresponding to [`NodePropertyValueBool`].
381pub type WireNodePropertyValueBool = bool;
382
383pub type NodePropertyValueEnum = String;
384
385/// The wire type corresponding to [`NodePropertyValueEnum`].
386pub type WireNodePropertyValueEnum = ::fidl_next::WireString;
387
388#[derive(Clone, Debug)]
389pub enum NodePropertyValue {
390    IntValue(u32),
391
392    StringValue(String),
393
394    BoolValue(bool),
395
396    EnumValue(String),
397
398    UnknownOrdinal_(u64),
399}
400
401impl ::fidl_next::Encodable for NodePropertyValue {
402    type Encoded = WireNodePropertyValue;
403}
404
405unsafe impl<___E> ::fidl_next::Encode<___E> for NodePropertyValue
406where
407    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
408
409    ___E: ::fidl_next::Encoder,
410{
411    #[inline]
412    fn encode(
413        &mut self,
414        encoder: &mut ___E,
415        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
416    ) -> Result<(), ::fidl_next::EncodeError> {
417        ::fidl_next::munge!(let WireNodePropertyValue { raw } = out);
418
419        match self {
420            Self::IntValue(value) => {
421                ::fidl_next::RawWireUnion::encode_as::<___E, u32>(value, 1, encoder, raw)?
422            }
423
424            Self::StringValue(value) => {
425                ::fidl_next::RawWireUnion::encode_as::<___E, String>(value, 2, encoder, raw)?
426            }
427
428            Self::BoolValue(value) => {
429                ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 3, encoder, raw)?
430            }
431
432            Self::EnumValue(value) => {
433                ::fidl_next::RawWireUnion::encode_as::<___E, String>(value, 4, encoder, raw)?
434            }
435
436            Self::UnknownOrdinal_(ordinal) => {
437                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
438            }
439        }
440
441        Ok(())
442    }
443}
444
445impl ::fidl_next::EncodableOption for Box<NodePropertyValue> {
446    type EncodedOption = WireOptionalNodePropertyValue;
447}
448
449unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodePropertyValue>
450where
451    ___E: ?Sized,
452    NodePropertyValue: ::fidl_next::Encode<___E>,
453{
454    #[inline]
455    fn encode_option(
456        this: Option<&mut Self>,
457        encoder: &mut ___E,
458        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
459    ) -> Result<(), ::fidl_next::EncodeError> {
460        ::fidl_next::munge!(let WireOptionalNodePropertyValue { raw } = &mut *out);
461
462        if let Some(inner) = this {
463            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
464            ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
465        } else {
466            ::fidl_next::RawWireUnion::encode_absent(raw);
467        }
468
469        Ok(())
470    }
471}
472
473impl ::fidl_next::TakeFrom<WireNodePropertyValue> for NodePropertyValue {
474    #[inline]
475    fn take_from(from: &WireNodePropertyValue) -> Self {
476        match from.raw.ordinal() {
477            1 => Self::IntValue(::fidl_next::TakeFrom::take_from(unsafe {
478                from.raw.get().deref_unchecked::<::fidl_next::WireU32>()
479            })),
480
481            2 => Self::StringValue(::fidl_next::TakeFrom::take_from(unsafe {
482                from.raw.get().deref_unchecked::<::fidl_next::WireString>()
483            })),
484
485            3 => Self::BoolValue(::fidl_next::TakeFrom::take_from(unsafe {
486                from.raw.get().deref_unchecked::<bool>()
487            })),
488
489            4 => Self::EnumValue(::fidl_next::TakeFrom::take_from(unsafe {
490                from.raw.get().deref_unchecked::<::fidl_next::WireString>()
491            })),
492
493            _ => unsafe { ::core::hint::unreachable_unchecked() },
494        }
495    }
496}
497
498impl ::fidl_next::TakeFrom<WireOptionalNodePropertyValue> for Option<Box<NodePropertyValue>> {
499    #[inline]
500    fn take_from(from: &WireOptionalNodePropertyValue) -> Self {
501        if let Some(inner) = from.as_ref() {
502            Some(::fidl_next::TakeFrom::take_from(inner))
503        } else {
504            None
505        }
506    }
507}
508
509/// The wire type corresponding to [`NodePropertyValue`].
510#[repr(transparent)]
511pub struct WireNodePropertyValue {
512    raw: ::fidl_next::RawWireUnion,
513}
514
515unsafe impl ::fidl_next::ZeroPadding for WireNodePropertyValue {
516    #[inline]
517    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
518        ::fidl_next::munge!(let Self { raw } = out);
519        ::fidl_next::RawWireUnion::zero_padding(raw);
520    }
521}
522
523pub mod node_property_value {
524    pub enum Ref<'union> {
525        IntValue(&'union ::fidl_next::WireU32),
526
527        StringValue(&'union ::fidl_next::WireString),
528
529        BoolValue(&'union bool),
530
531        EnumValue(&'union ::fidl_next::WireString),
532
533        UnknownOrdinal_(u64),
534    }
535}
536
537impl WireNodePropertyValue {
538    pub fn as_ref(&self) -> crate::node_property_value::Ref<'_> {
539        match self.raw.ordinal() {
540            1 => crate::node_property_value::Ref::IntValue(unsafe {
541                self.raw.get().deref_unchecked::<::fidl_next::WireU32>()
542            }),
543
544            2 => crate::node_property_value::Ref::StringValue(unsafe {
545                self.raw.get().deref_unchecked::<::fidl_next::WireString>()
546            }),
547
548            3 => crate::node_property_value::Ref::BoolValue(unsafe {
549                self.raw.get().deref_unchecked::<bool>()
550            }),
551
552            4 => crate::node_property_value::Ref::EnumValue(unsafe {
553                self.raw.get().deref_unchecked::<::fidl_next::WireString>()
554            }),
555
556            unknown => crate::node_property_value::Ref::UnknownOrdinal_(unknown),
557        }
558    }
559}
560
561unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodePropertyValue
562where
563    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
564
565    ___D: ::fidl_next::Decoder,
566{
567    fn decode(
568        mut slot: ::fidl_next::Slot<'_, Self>,
569        decoder: &mut ___D,
570    ) -> Result<(), ::fidl_next::DecodeError> {
571        ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
572        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
573            1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
574
575            2 => {
576                ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString>(raw, decoder)?
577            }
578
579            3 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder)?,
580
581            4 => {
582                ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString>(raw, decoder)?
583            }
584
585            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
586        }
587
588        Ok(())
589    }
590}
591
592impl ::core::fmt::Debug for WireNodePropertyValue {
593    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
594        match self.raw.ordinal() {
595            1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU32>().fmt(f) },
596            2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString>().fmt(f) },
597            3 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) },
598            4 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString>().fmt(f) },
599            _ => unsafe { ::core::hint::unreachable_unchecked() },
600        }
601    }
602}
603
604#[repr(transparent)]
605pub struct WireOptionalNodePropertyValue {
606    raw: ::fidl_next::RawWireUnion,
607}
608
609unsafe impl ::fidl_next::ZeroPadding for WireOptionalNodePropertyValue {
610    #[inline]
611    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
612        ::fidl_next::munge!(let Self { raw } = out);
613        ::fidl_next::RawWireUnion::zero_padding(raw);
614    }
615}
616
617impl WireOptionalNodePropertyValue {
618    pub fn is_some(&self) -> bool {
619        self.raw.is_some()
620    }
621
622    pub fn is_none(&self) -> bool {
623        self.raw.is_none()
624    }
625
626    pub fn as_ref(&self) -> Option<&WireNodePropertyValue> {
627        if self.is_some() {
628            Some(unsafe { &*(self as *const Self).cast() })
629        } else {
630            None
631        }
632    }
633}
634
635unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalNodePropertyValue
636where
637    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
638
639    ___D: ::fidl_next::Decoder,
640{
641    fn decode(
642        mut slot: ::fidl_next::Slot<'_, Self>,
643        decoder: &mut ___D,
644    ) -> Result<(), ::fidl_next::DecodeError> {
645        ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
646        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
647            1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
648
649            2 => {
650                ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString>(raw, decoder)?
651            }
652
653            3 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder)?,
654
655            4 => {
656                ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString>(raw, decoder)?
657            }
658
659            0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
660            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
661        }
662
663        Ok(())
664    }
665}
666
667impl ::core::fmt::Debug for WireOptionalNodePropertyValue {
668    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
669        self.as_ref().fmt(f)
670    }
671}
672
673pub const MAX_PROPERTY_COUNT: u8 = 64;
674
675#[doc = " Represents a bind rule in a parent specification.\n"]
676#[derive(Clone, Debug)]
677pub struct BindRule {
678    pub key: crate::NodePropertyKey,
679
680    pub condition: crate::Condition,
681
682    pub values: Vec<crate::NodePropertyValue>,
683}
684
685impl ::fidl_next::Encodable for BindRule {
686    type Encoded = WireBindRule;
687}
688
689unsafe impl<___E> ::fidl_next::Encode<___E> for BindRule
690where
691    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
692
693    ___E: ::fidl_next::Encoder,
694{
695    #[inline]
696    fn encode(
697        &mut self,
698        encoder: &mut ___E,
699        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
700    ) -> Result<(), ::fidl_next::EncodeError> {
701        ::fidl_next::munge! {
702            let Self::Encoded {
703                key,
704                condition,
705                values,
706
707            } = out;
708        }
709
710        ::fidl_next::Encode::encode(&mut self.key, encoder, key)?;
711
712        ::fidl_next::Encode::encode(&mut self.condition, encoder, condition)?;
713
714        ::fidl_next::Encode::encode(&mut self.values, encoder, values)?;
715
716        Ok(())
717    }
718}
719
720impl ::fidl_next::EncodableOption for Box<BindRule> {
721    type EncodedOption = ::fidl_next::WireBox<WireBindRule>;
722}
723
724unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<BindRule>
725where
726    ___E: ::fidl_next::Encoder + ?Sized,
727    BindRule: ::fidl_next::Encode<___E>,
728{
729    #[inline]
730    fn encode_option(
731        this: Option<&mut Self>,
732        encoder: &mut ___E,
733        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
734    ) -> Result<(), ::fidl_next::EncodeError> {
735        if let Some(inner) = this {
736            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
737            ::fidl_next::WireBox::encode_present(out);
738        } else {
739            ::fidl_next::WireBox::encode_absent(out);
740        }
741
742        Ok(())
743    }
744}
745
746impl ::fidl_next::TakeFrom<WireBindRule> for BindRule {
747    #[inline]
748    fn take_from(from: &WireBindRule) -> Self {
749        Self {
750            key: ::fidl_next::TakeFrom::take_from(&from.key),
751
752            condition: ::fidl_next::TakeFrom::take_from(&from.condition),
753
754            values: ::fidl_next::TakeFrom::take_from(&from.values),
755        }
756    }
757}
758
759/// The wire type corresponding to [`BindRule`].
760#[derive(Debug)]
761#[repr(C)]
762pub struct WireBindRule {
763    pub key: crate::WireNodePropertyKey,
764
765    pub condition: crate::WireCondition,
766
767    pub values: ::fidl_next::WireVector<crate::WireNodePropertyValue>,
768}
769
770unsafe impl ::fidl_next::ZeroPadding for WireBindRule {
771    #[inline]
772    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
773        unsafe {
774            out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
775        }
776    }
777}
778
779unsafe impl<___D> ::fidl_next::Decode<___D> for WireBindRule
780where
781    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
782
783    ___D: ::fidl_next::Decoder,
784{
785    fn decode(
786        slot: ::fidl_next::Slot<'_, Self>,
787        decoder: &mut ___D,
788    ) -> Result<(), ::fidl_next::DecodeError> {
789        ::fidl_next::munge! {
790            let Self {
791                mut key,
792                mut condition,
793                mut values,
794
795            } = slot;
796        }
797
798        ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
799
800        ::fidl_next::Decode::decode(condition.as_mut(), decoder)?;
801
802        ::fidl_next::Decode::decode(values.as_mut(), decoder)?;
803
804        let values = unsafe { values.deref_unchecked() };
805
806        if values.len() > 64 {
807            return Err(::fidl_next::DecodeError::VectorTooLong {
808                size: values.len() as u64,
809                limit: 64,
810            });
811        }
812
813        Ok(())
814    }
815}
816
817#[doc = " Represents a bind rule in a parent specification.\n"]
818#[derive(Clone, Debug)]
819pub struct BindRule2 {
820    pub key: String,
821
822    pub condition: crate::Condition,
823
824    pub values: Vec<crate::NodePropertyValue>,
825}
826
827impl ::fidl_next::Encodable for BindRule2 {
828    type Encoded = WireBindRule2;
829}
830
831unsafe impl<___E> ::fidl_next::Encode<___E> for BindRule2
832where
833    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
834
835    ___E: ::fidl_next::Encoder,
836{
837    #[inline]
838    fn encode(
839        &mut self,
840        encoder: &mut ___E,
841        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
842    ) -> Result<(), ::fidl_next::EncodeError> {
843        ::fidl_next::munge! {
844            let Self::Encoded {
845                key,
846                condition,
847                values,
848
849            } = out;
850        }
851
852        ::fidl_next::Encode::encode(&mut self.key, encoder, key)?;
853
854        ::fidl_next::Encode::encode(&mut self.condition, encoder, condition)?;
855
856        ::fidl_next::Encode::encode(&mut self.values, encoder, values)?;
857
858        Ok(())
859    }
860}
861
862impl ::fidl_next::EncodableOption for Box<BindRule2> {
863    type EncodedOption = ::fidl_next::WireBox<WireBindRule2>;
864}
865
866unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<BindRule2>
867where
868    ___E: ::fidl_next::Encoder + ?Sized,
869    BindRule2: ::fidl_next::Encode<___E>,
870{
871    #[inline]
872    fn encode_option(
873        this: Option<&mut Self>,
874        encoder: &mut ___E,
875        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
876    ) -> Result<(), ::fidl_next::EncodeError> {
877        if let Some(inner) = this {
878            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
879            ::fidl_next::WireBox::encode_present(out);
880        } else {
881            ::fidl_next::WireBox::encode_absent(out);
882        }
883
884        Ok(())
885    }
886}
887
888impl ::fidl_next::TakeFrom<WireBindRule2> for BindRule2 {
889    #[inline]
890    fn take_from(from: &WireBindRule2) -> Self {
891        Self {
892            key: ::fidl_next::TakeFrom::take_from(&from.key),
893
894            condition: ::fidl_next::TakeFrom::take_from(&from.condition),
895
896            values: ::fidl_next::TakeFrom::take_from(&from.values),
897        }
898    }
899}
900
901/// The wire type corresponding to [`BindRule2`].
902#[derive(Debug)]
903#[repr(C)]
904pub struct WireBindRule2 {
905    pub key: ::fidl_next::WireString,
906
907    pub condition: crate::WireCondition,
908
909    pub values: ::fidl_next::WireVector<crate::WireNodePropertyValue>,
910}
911
912unsafe impl ::fidl_next::ZeroPadding for WireBindRule2 {
913    #[inline]
914    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
915        unsafe {
916            out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
917        }
918    }
919}
920
921unsafe impl<___D> ::fidl_next::Decode<___D> for WireBindRule2
922where
923    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
924
925    ___D: ::fidl_next::Decoder,
926{
927    fn decode(
928        slot: ::fidl_next::Slot<'_, Self>,
929        decoder: &mut ___D,
930    ) -> Result<(), ::fidl_next::DecodeError> {
931        ::fidl_next::munge! {
932            let Self {
933                mut key,
934                mut condition,
935                mut values,
936
937            } = slot;
938        }
939
940        ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
941
942        let key = unsafe { key.deref_unchecked() };
943
944        if key.len() > 256 {
945            return Err(::fidl_next::DecodeError::VectorTooLong {
946                size: key.len() as u64,
947                limit: 256,
948            });
949        }
950
951        ::fidl_next::Decode::decode(condition.as_mut(), decoder)?;
952
953        ::fidl_next::Decode::decode(values.as_mut(), decoder)?;
954
955        let values = unsafe { values.deref_unchecked() };
956
957        if values.len() > 64 {
958            return Err(::fidl_next::DecodeError::VectorTooLong {
959                size: values.len() as u64,
960                limit: 64,
961            });
962        }
963
964        Ok(())
965    }
966}
967
968#[derive(Clone, Copy, Debug, PartialEq, Eq)]
969#[repr(u32)]
970pub enum BusType {
971    Platform = 1,
972    Acpi = 2,
973    DeviceTree = 3,
974    Pci = 4,
975    Usb = 5,
976    Gpio = 6,
977    I2C = 7,
978    Spi = 8,
979    Sdio = 9,
980    Uart = 10,
981    Spmi = 11,
982    UnknownOrdinal_(u32),
983}
984
985impl ::fidl_next::Encodable for BusType {
986    type Encoded = WireBusType;
987}
988impl ::std::convert::From<u32> for BusType {
989    fn from(value: u32) -> Self {
990        match value {
991            1 => Self::Platform,
992            2 => Self::Acpi,
993            3 => Self::DeviceTree,
994            4 => Self::Pci,
995            5 => Self::Usb,
996            6 => Self::Gpio,
997            7 => Self::I2C,
998            8 => Self::Spi,
999            9 => Self::Sdio,
1000            10 => Self::Uart,
1001            11 => Self::Spmi,
1002
1003            _ => Self::UnknownOrdinal_(value),
1004        }
1005    }
1006}
1007
1008unsafe impl<___E> ::fidl_next::Encode<___E> for BusType
1009where
1010    ___E: ?Sized,
1011{
1012    #[inline]
1013    fn encode(
1014        &mut self,
1015        _: &mut ___E,
1016        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1017    ) -> Result<(), ::fidl_next::EncodeError> {
1018        ::fidl_next::munge!(let WireBusType { value } = out);
1019        let _ = value.write(::fidl_next::WireU32::from(match *self {
1020            Self::Platform => 1,
1021
1022            Self::Acpi => 2,
1023
1024            Self::DeviceTree => 3,
1025
1026            Self::Pci => 4,
1027
1028            Self::Usb => 5,
1029
1030            Self::Gpio => 6,
1031
1032            Self::I2C => 7,
1033
1034            Self::Spi => 8,
1035
1036            Self::Sdio => 9,
1037
1038            Self::Uart => 10,
1039
1040            Self::Spmi => 11,
1041
1042            Self::UnknownOrdinal_(value) => value,
1043        }));
1044
1045        Ok(())
1046    }
1047}
1048
1049impl ::core::convert::From<WireBusType> for BusType {
1050    fn from(wire: WireBusType) -> Self {
1051        match u32::from(wire.value) {
1052            1 => Self::Platform,
1053
1054            2 => Self::Acpi,
1055
1056            3 => Self::DeviceTree,
1057
1058            4 => Self::Pci,
1059
1060            5 => Self::Usb,
1061
1062            6 => Self::Gpio,
1063
1064            7 => Self::I2C,
1065
1066            8 => Self::Spi,
1067
1068            9 => Self::Sdio,
1069
1070            10 => Self::Uart,
1071
1072            11 => Self::Spmi,
1073
1074            value => Self::UnknownOrdinal_(value),
1075        }
1076    }
1077}
1078
1079impl ::fidl_next::TakeFrom<WireBusType> for BusType {
1080    #[inline]
1081    fn take_from(from: &WireBusType) -> Self {
1082        Self::from(*from)
1083    }
1084}
1085
1086/// The wire type corresponding to [`BusType`].
1087#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1088#[repr(transparent)]
1089pub struct WireBusType {
1090    value: ::fidl_next::WireU32,
1091}
1092
1093unsafe impl ::fidl_next::ZeroPadding for WireBusType {
1094    #[inline]
1095    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1096        // Wire enums have no padding
1097    }
1098}
1099
1100impl WireBusType {
1101    pub const PLATFORM: WireBusType = WireBusType { value: ::fidl_next::WireU32(1) };
1102
1103    pub const ACPI: WireBusType = WireBusType { value: ::fidl_next::WireU32(2) };
1104
1105    pub const DEVICE_TREE: WireBusType = WireBusType { value: ::fidl_next::WireU32(3) };
1106
1107    pub const PCI: WireBusType = WireBusType { value: ::fidl_next::WireU32(4) };
1108
1109    pub const USB: WireBusType = WireBusType { value: ::fidl_next::WireU32(5) };
1110
1111    pub const GPIO: WireBusType = WireBusType { value: ::fidl_next::WireU32(6) };
1112
1113    pub const I2_C: WireBusType = WireBusType { value: ::fidl_next::WireU32(7) };
1114
1115    pub const SPI: WireBusType = WireBusType { value: ::fidl_next::WireU32(8) };
1116
1117    pub const SDIO: WireBusType = WireBusType { value: ::fidl_next::WireU32(9) };
1118
1119    pub const UART: WireBusType = WireBusType { value: ::fidl_next::WireU32(10) };
1120
1121    pub const SPMI: WireBusType = WireBusType { value: ::fidl_next::WireU32(11) };
1122}
1123
1124unsafe impl<___D> ::fidl_next::Decode<___D> for WireBusType
1125where
1126    ___D: ?Sized,
1127{
1128    fn decode(
1129        slot: ::fidl_next::Slot<'_, Self>,
1130        _: &mut ___D,
1131    ) -> Result<(), ::fidl_next::DecodeError> {
1132        Ok(())
1133    }
1134}
1135
1136impl ::core::convert::From<BusType> for WireBusType {
1137    fn from(natural: BusType) -> Self {
1138        match natural {
1139            BusType::Platform => WireBusType::PLATFORM,
1140
1141            BusType::Acpi => WireBusType::ACPI,
1142
1143            BusType::DeviceTree => WireBusType::DEVICE_TREE,
1144
1145            BusType::Pci => WireBusType::PCI,
1146
1147            BusType::Usb => WireBusType::USB,
1148
1149            BusType::Gpio => WireBusType::GPIO,
1150
1151            BusType::I2C => WireBusType::I2_C,
1152
1153            BusType::Spi => WireBusType::SPI,
1154
1155            BusType::Sdio => WireBusType::SDIO,
1156
1157            BusType::Uart => WireBusType::UART,
1158
1159            BusType::Spmi => WireBusType::SPMI,
1160
1161            BusType::UnknownOrdinal_(value) => {
1162                WireBusType { value: ::fidl_next::WireU32::from(value) }
1163            }
1164        }
1165    }
1166}
1167
1168pub const MAX_DEVICE_ADDRESS_ARRAY_LEN: u32 = 10;
1169
1170pub const MAX_DEVICE_ADDRESS_STR_LEN: u32 = 32;
1171
1172#[derive(Clone, Debug)]
1173pub enum DeviceAddress {
1174    IntValue(u8),
1175
1176    ArrayIntValue(Vec<u8>),
1177
1178    CharIntValue(String),
1179
1180    ArrayCharIntValue(Vec<String>),
1181
1182    StringValue(String),
1183
1184    UnknownOrdinal_(u64),
1185}
1186
1187impl ::fidl_next::Encodable for DeviceAddress {
1188    type Encoded = WireDeviceAddress;
1189}
1190
1191unsafe impl<___E> ::fidl_next::Encode<___E> for DeviceAddress
1192where
1193    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1194
1195    ___E: ::fidl_next::Encoder,
1196{
1197    #[inline]
1198    fn encode(
1199        &mut self,
1200        encoder: &mut ___E,
1201        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1202    ) -> Result<(), ::fidl_next::EncodeError> {
1203        ::fidl_next::munge!(let WireDeviceAddress { raw } = out);
1204
1205        match self {
1206            Self::IntValue(value) => {
1207                ::fidl_next::RawWireUnion::encode_as::<___E, u8>(value, 1, encoder, raw)?
1208            }
1209
1210            Self::ArrayIntValue(value) => {
1211                ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u8>>(value, 2, encoder, raw)?
1212            }
1213
1214            Self::CharIntValue(value) => {
1215                ::fidl_next::RawWireUnion::encode_as::<___E, String>(value, 3, encoder, raw)?
1216            }
1217
1218            Self::ArrayCharIntValue(value) => {
1219                ::fidl_next::RawWireUnion::encode_as::<___E, Vec<String>>(value, 4, encoder, raw)?
1220            }
1221
1222            Self::StringValue(value) => {
1223                ::fidl_next::RawWireUnion::encode_as::<___E, String>(value, 5, encoder, raw)?
1224            }
1225
1226            Self::UnknownOrdinal_(ordinal) => {
1227                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
1228            }
1229        }
1230
1231        Ok(())
1232    }
1233}
1234
1235impl ::fidl_next::EncodableOption for Box<DeviceAddress> {
1236    type EncodedOption = WireOptionalDeviceAddress;
1237}
1238
1239unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DeviceAddress>
1240where
1241    ___E: ?Sized,
1242    DeviceAddress: ::fidl_next::Encode<___E>,
1243{
1244    #[inline]
1245    fn encode_option(
1246        this: Option<&mut Self>,
1247        encoder: &mut ___E,
1248        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1249    ) -> Result<(), ::fidl_next::EncodeError> {
1250        ::fidl_next::munge!(let WireOptionalDeviceAddress { raw } = &mut *out);
1251
1252        if let Some(inner) = this {
1253            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1254            ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
1255        } else {
1256            ::fidl_next::RawWireUnion::encode_absent(raw);
1257        }
1258
1259        Ok(())
1260    }
1261}
1262
1263impl ::fidl_next::TakeFrom<WireDeviceAddress> for DeviceAddress {
1264    #[inline]
1265    fn take_from(from: &WireDeviceAddress) -> Self {
1266        match from.raw.ordinal() {
1267            1 => Self::IntValue(::fidl_next::TakeFrom::take_from(unsafe {
1268                from.raw.get().deref_unchecked::<u8>()
1269            })),
1270
1271            2 => Self::ArrayIntValue(::fidl_next::TakeFrom::take_from(unsafe {
1272                from.raw.get().deref_unchecked::<::fidl_next::WireVector<u8>>()
1273            })),
1274
1275            3 => Self::CharIntValue(::fidl_next::TakeFrom::take_from(unsafe {
1276                from.raw.get().deref_unchecked::<::fidl_next::WireString>()
1277            })),
1278
1279            4 => Self::ArrayCharIntValue(::fidl_next::TakeFrom::take_from(unsafe {
1280                from.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireString>>()
1281            })),
1282
1283            5 => Self::StringValue(::fidl_next::TakeFrom::take_from(unsafe {
1284                from.raw.get().deref_unchecked::<::fidl_next::WireString>()
1285            })),
1286
1287            _ => unsafe { ::core::hint::unreachable_unchecked() },
1288        }
1289    }
1290}
1291
1292impl ::fidl_next::TakeFrom<WireOptionalDeviceAddress> for Option<Box<DeviceAddress>> {
1293    #[inline]
1294    fn take_from(from: &WireOptionalDeviceAddress) -> Self {
1295        if let Some(inner) = from.as_ref() {
1296            Some(::fidl_next::TakeFrom::take_from(inner))
1297        } else {
1298            None
1299        }
1300    }
1301}
1302
1303/// The wire type corresponding to [`DeviceAddress`].
1304#[repr(transparent)]
1305pub struct WireDeviceAddress {
1306    raw: ::fidl_next::RawWireUnion,
1307}
1308
1309unsafe impl ::fidl_next::ZeroPadding for WireDeviceAddress {
1310    #[inline]
1311    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1312        ::fidl_next::munge!(let Self { raw } = out);
1313        ::fidl_next::RawWireUnion::zero_padding(raw);
1314    }
1315}
1316
1317pub mod device_address {
1318    pub enum Ref<'union> {
1319        IntValue(&'union u8),
1320
1321        ArrayIntValue(&'union ::fidl_next::WireVector<u8>),
1322
1323        CharIntValue(&'union ::fidl_next::WireString),
1324
1325        ArrayCharIntValue(&'union ::fidl_next::WireVector<::fidl_next::WireString>),
1326
1327        StringValue(&'union ::fidl_next::WireString),
1328
1329        UnknownOrdinal_(u64),
1330    }
1331}
1332
1333impl WireDeviceAddress {
1334    pub fn as_ref(&self) -> crate::device_address::Ref<'_> {
1335        match self.raw.ordinal() {
1336            1 => crate::device_address::Ref::IntValue(unsafe {
1337                self.raw.get().deref_unchecked::<u8>()
1338            }),
1339
1340            2 => crate::device_address::Ref::ArrayIntValue(unsafe {
1341                self.raw.get().deref_unchecked::<::fidl_next::WireVector<u8>>()
1342            }),
1343
1344            3 => crate::device_address::Ref::CharIntValue(unsafe {
1345                self.raw.get().deref_unchecked::<::fidl_next::WireString>()
1346            }),
1347
1348            4 => crate::device_address::Ref::ArrayCharIntValue(unsafe {
1349                self.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireString>>()
1350            }),
1351
1352            5 => crate::device_address::Ref::StringValue(unsafe {
1353                self.raw.get().deref_unchecked::<::fidl_next::WireString>()
1354            }),
1355
1356            unknown => crate::device_address::Ref::UnknownOrdinal_(unknown),
1357        }
1358    }
1359}
1360
1361unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeviceAddress
1362where
1363    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1364
1365    ___D: ::fidl_next::Decoder,
1366{
1367    fn decode(
1368        mut slot: ::fidl_next::Slot<'_, Self>,
1369        decoder: &mut ___D,
1370    ) -> Result<(), ::fidl_next::DecodeError> {
1371        ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
1372        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1373            1 => ::fidl_next::RawWireUnion::decode_as::<___D, u8>(raw, decoder)?,
1374
1375            2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<u8>>(
1376                raw, decoder,
1377            )?,
1378
1379            3 => {
1380                ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString>(raw, decoder)?
1381            }
1382
1383            4 => ::fidl_next::RawWireUnion::decode_as::<
1384                ___D,
1385                ::fidl_next::WireVector<::fidl_next::WireString>,
1386            >(raw, decoder)?,
1387
1388            5 => {
1389                ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString>(raw, decoder)?
1390            }
1391
1392            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
1393        }
1394
1395        Ok(())
1396    }
1397}
1398
1399impl ::core::fmt::Debug for WireDeviceAddress {
1400    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1401        match self.raw.ordinal() {
1402            1 => unsafe { self.raw.get().deref_unchecked::<u8>().fmt(f) },
1403            2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireVector<u8>>().fmt(f) },
1404            3 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString>().fmt(f) },
1405            4 => unsafe {
1406                self.raw
1407                    .get()
1408                    .deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireString>>()
1409                    .fmt(f)
1410            },
1411            5 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString>().fmt(f) },
1412            _ => unsafe { ::core::hint::unreachable_unchecked() },
1413        }
1414    }
1415}
1416
1417#[repr(transparent)]
1418pub struct WireOptionalDeviceAddress {
1419    raw: ::fidl_next::RawWireUnion,
1420}
1421
1422unsafe impl ::fidl_next::ZeroPadding for WireOptionalDeviceAddress {
1423    #[inline]
1424    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1425        ::fidl_next::munge!(let Self { raw } = out);
1426        ::fidl_next::RawWireUnion::zero_padding(raw);
1427    }
1428}
1429
1430impl WireOptionalDeviceAddress {
1431    pub fn is_some(&self) -> bool {
1432        self.raw.is_some()
1433    }
1434
1435    pub fn is_none(&self) -> bool {
1436        self.raw.is_none()
1437    }
1438
1439    pub fn as_ref(&self) -> Option<&WireDeviceAddress> {
1440        if self.is_some() {
1441            Some(unsafe { &*(self as *const Self).cast() })
1442        } else {
1443            None
1444        }
1445    }
1446}
1447
1448unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDeviceAddress
1449where
1450    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1451
1452    ___D: ::fidl_next::Decoder,
1453{
1454    fn decode(
1455        mut slot: ::fidl_next::Slot<'_, Self>,
1456        decoder: &mut ___D,
1457    ) -> Result<(), ::fidl_next::DecodeError> {
1458        ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
1459        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1460            1 => ::fidl_next::RawWireUnion::decode_as::<___D, u8>(raw, decoder)?,
1461
1462            2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<u8>>(
1463                raw, decoder,
1464            )?,
1465
1466            3 => {
1467                ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString>(raw, decoder)?
1468            }
1469
1470            4 => ::fidl_next::RawWireUnion::decode_as::<
1471                ___D,
1472                ::fidl_next::WireVector<::fidl_next::WireString>,
1473            >(raw, decoder)?,
1474
1475            5 => {
1476                ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString>(raw, decoder)?
1477            }
1478
1479            0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
1480            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
1481        }
1482
1483        Ok(())
1484    }
1485}
1486
1487impl ::core::fmt::Debug for WireOptionalDeviceAddress {
1488    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1489        self.as_ref().fmt(f)
1490    }
1491}
1492
1493#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1494#[repr(u32)]
1495pub enum DeviceAddressStability {
1496    UnstableBetweenDriverRestart = 0,
1497    UnstableBetweenBoot = 1,
1498    UnstableBetweenSoftwareUpdate = 2,
1499    Stable = 3,
1500    UnknownOrdinal_(u32),
1501}
1502
1503impl ::fidl_next::Encodable for DeviceAddressStability {
1504    type Encoded = WireDeviceAddressStability;
1505}
1506impl ::std::convert::From<u32> for DeviceAddressStability {
1507    fn from(value: u32) -> Self {
1508        match value {
1509            0 => Self::UnstableBetweenDriverRestart,
1510            1 => Self::UnstableBetweenBoot,
1511            2 => Self::UnstableBetweenSoftwareUpdate,
1512            3 => Self::Stable,
1513
1514            _ => Self::UnknownOrdinal_(value),
1515        }
1516    }
1517}
1518
1519unsafe impl<___E> ::fidl_next::Encode<___E> for DeviceAddressStability
1520where
1521    ___E: ?Sized,
1522{
1523    #[inline]
1524    fn encode(
1525        &mut self,
1526        _: &mut ___E,
1527        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1528    ) -> Result<(), ::fidl_next::EncodeError> {
1529        ::fidl_next::munge!(let WireDeviceAddressStability { value } = out);
1530        let _ = value.write(::fidl_next::WireU32::from(match *self {
1531            Self::UnstableBetweenDriverRestart => 0,
1532
1533            Self::UnstableBetweenBoot => 1,
1534
1535            Self::UnstableBetweenSoftwareUpdate => 2,
1536
1537            Self::Stable => 3,
1538
1539            Self::UnknownOrdinal_(value) => value,
1540        }));
1541
1542        Ok(())
1543    }
1544}
1545
1546impl ::core::convert::From<WireDeviceAddressStability> for DeviceAddressStability {
1547    fn from(wire: WireDeviceAddressStability) -> Self {
1548        match u32::from(wire.value) {
1549            0 => Self::UnstableBetweenDriverRestart,
1550
1551            1 => Self::UnstableBetweenBoot,
1552
1553            2 => Self::UnstableBetweenSoftwareUpdate,
1554
1555            3 => Self::Stable,
1556
1557            value => Self::UnknownOrdinal_(value),
1558        }
1559    }
1560}
1561
1562impl ::fidl_next::TakeFrom<WireDeviceAddressStability> for DeviceAddressStability {
1563    #[inline]
1564    fn take_from(from: &WireDeviceAddressStability) -> Self {
1565        Self::from(*from)
1566    }
1567}
1568
1569/// The wire type corresponding to [`DeviceAddressStability`].
1570#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1571#[repr(transparent)]
1572pub struct WireDeviceAddressStability {
1573    value: ::fidl_next::WireU32,
1574}
1575
1576unsafe impl ::fidl_next::ZeroPadding for WireDeviceAddressStability {
1577    #[inline]
1578    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1579        // Wire enums have no padding
1580    }
1581}
1582
1583impl WireDeviceAddressStability {
1584    pub const UNSTABLE_BETWEEN_DRIVER_RESTART: WireDeviceAddressStability =
1585        WireDeviceAddressStability { value: ::fidl_next::WireU32(0) };
1586
1587    pub const UNSTABLE_BETWEEN_BOOT: WireDeviceAddressStability =
1588        WireDeviceAddressStability { value: ::fidl_next::WireU32(1) };
1589
1590    pub const UNSTABLE_BETWEEN_SOFTWARE_UPDATE: WireDeviceAddressStability =
1591        WireDeviceAddressStability { value: ::fidl_next::WireU32(2) };
1592
1593    pub const STABLE: WireDeviceAddressStability =
1594        WireDeviceAddressStability { value: ::fidl_next::WireU32(3) };
1595}
1596
1597unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeviceAddressStability
1598where
1599    ___D: ?Sized,
1600{
1601    fn decode(
1602        slot: ::fidl_next::Slot<'_, Self>,
1603        _: &mut ___D,
1604    ) -> Result<(), ::fidl_next::DecodeError> {
1605        Ok(())
1606    }
1607}
1608
1609impl ::core::convert::From<DeviceAddressStability> for WireDeviceAddressStability {
1610    fn from(natural: DeviceAddressStability) -> Self {
1611        match natural {
1612            DeviceAddressStability::UnstableBetweenDriverRestart => {
1613                WireDeviceAddressStability::UNSTABLE_BETWEEN_DRIVER_RESTART
1614            }
1615
1616            DeviceAddressStability::UnstableBetweenBoot => {
1617                WireDeviceAddressStability::UNSTABLE_BETWEEN_BOOT
1618            }
1619
1620            DeviceAddressStability::UnstableBetweenSoftwareUpdate => {
1621                WireDeviceAddressStability::UNSTABLE_BETWEEN_SOFTWARE_UPDATE
1622            }
1623
1624            DeviceAddressStability::Stable => WireDeviceAddressStability::STABLE,
1625
1626            DeviceAddressStability::UnknownOrdinal_(value) => {
1627                WireDeviceAddressStability { value: ::fidl_next::WireU32::from(value) }
1628            }
1629        }
1630    }
1631}
1632
1633#[derive(Clone, Debug, Default)]
1634pub struct BusInfo {
1635    pub bus: Option<crate::BusType>,
1636
1637    pub address: Option<crate::DeviceAddress>,
1638
1639    pub address_stability: Option<crate::DeviceAddressStability>,
1640}
1641
1642impl BusInfo {
1643    fn __max_ordinal(&self) -> usize {
1644        if self.bus.is_some() {
1645            return 1;
1646        }
1647
1648        if self.address.is_some() {
1649            return 2;
1650        }
1651
1652        if self.address_stability.is_some() {
1653            return 3;
1654        }
1655
1656        0
1657    }
1658}
1659
1660impl ::fidl_next::Encodable for BusInfo {
1661    type Encoded = WireBusInfo;
1662}
1663
1664unsafe impl<___E> ::fidl_next::Encode<___E> for BusInfo
1665where
1666    ___E: ::fidl_next::Encoder + ?Sized,
1667{
1668    #[inline]
1669    fn encode(
1670        &mut self,
1671        encoder: &mut ___E,
1672        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1673    ) -> Result<(), ::fidl_next::EncodeError> {
1674        ::fidl_next::munge!(let WireBusInfo { table } = out);
1675
1676        let max_ord = self.__max_ordinal();
1677
1678        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1679        ::fidl_next::ZeroPadding::zero_padding(&mut out);
1680
1681        let mut preallocated =
1682            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1683
1684        for i in 1..=max_ord {
1685            match i {
1686                3 => {
1687                    if let Some(address_stability) = &mut self.address_stability {
1688                        ::fidl_next::WireEnvelope::encode_value(
1689                            address_stability,
1690                            preallocated.encoder,
1691                            &mut out,
1692                        )?;
1693                    } else {
1694                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
1695                    }
1696                }
1697
1698                2 => {
1699                    if let Some(address) = &mut self.address {
1700                        ::fidl_next::WireEnvelope::encode_value(
1701                            address,
1702                            preallocated.encoder,
1703                            &mut out,
1704                        )?;
1705                    } else {
1706                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
1707                    }
1708                }
1709
1710                1 => {
1711                    if let Some(bus) = &mut self.bus {
1712                        ::fidl_next::WireEnvelope::encode_value(
1713                            bus,
1714                            preallocated.encoder,
1715                            &mut out,
1716                        )?;
1717                    } else {
1718                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
1719                    }
1720                }
1721
1722                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1723            }
1724            unsafe {
1725                preallocated.write_next(out.assume_init_ref());
1726            }
1727        }
1728
1729        ::fidl_next::WireTable::encode_len(table, max_ord);
1730
1731        Ok(())
1732    }
1733}
1734
1735impl ::fidl_next::TakeFrom<WireBusInfo> for BusInfo {
1736    #[inline]
1737    fn take_from(from: &WireBusInfo) -> Self {
1738        Self {
1739            bus: from.bus().map(::fidl_next::TakeFrom::take_from),
1740
1741            address: from.address().map(::fidl_next::TakeFrom::take_from),
1742
1743            address_stability: from.address_stability().map(::fidl_next::TakeFrom::take_from),
1744        }
1745    }
1746}
1747
1748/// The wire type corresponding to [`BusInfo`].
1749#[repr(C)]
1750pub struct WireBusInfo {
1751    table: ::fidl_next::WireTable,
1752}
1753
1754unsafe impl ::fidl_next::ZeroPadding for WireBusInfo {
1755    #[inline]
1756    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1757        ::fidl_next::munge!(let Self { table } = out);
1758        ::fidl_next::WireTable::zero_padding(table);
1759    }
1760}
1761
1762unsafe impl<___D> ::fidl_next::Decode<___D> for WireBusInfo
1763where
1764    ___D: ::fidl_next::Decoder + ?Sized,
1765{
1766    fn decode(
1767        slot: ::fidl_next::Slot<'_, Self>,
1768        decoder: &mut ___D,
1769    ) -> Result<(), ::fidl_next::DecodeError> {
1770        ::fidl_next::munge!(let Self { table } = slot);
1771
1772        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1773            match ordinal {
1774                0 => unsafe { ::core::hint::unreachable_unchecked() },
1775
1776                1 => {
1777                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireBusType>(
1778                        slot.as_mut(),
1779                        decoder,
1780                    )?;
1781
1782                    Ok(())
1783                }
1784
1785                2 => {
1786                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDeviceAddress>(
1787                        slot.as_mut(),
1788                        decoder,
1789                    )?;
1790
1791                    Ok(())
1792                }
1793
1794                3 => {
1795                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDeviceAddressStability>(
1796                        slot.as_mut(),
1797                        decoder,
1798                    )?;
1799
1800                    Ok(())
1801                }
1802
1803                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1804            }
1805        })
1806    }
1807}
1808
1809impl WireBusInfo {
1810    pub fn bus(&self) -> Option<&crate::WireBusType> {
1811        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1812    }
1813
1814    pub fn address(&self) -> Option<&crate::WireDeviceAddress> {
1815        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1816    }
1817
1818    pub fn address_stability(&self) -> Option<&crate::WireDeviceAddressStability> {
1819        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
1820    }
1821}
1822
1823impl ::core::fmt::Debug for WireBusInfo {
1824    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
1825        f.debug_struct("BusInfo")
1826            .field("bus", &self.bus())
1827            .field("address", &self.address())
1828            .field("address_stability", &self.address_stability())
1829            .finish()
1830    }
1831}
1832
1833#[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"]
1834#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1835#[repr(u8)]
1836pub enum DriverPackageType {
1837    Boot = 0,
1838    Base = 1,
1839    Cached = 2,
1840    Universe = 3,
1841    UnknownOrdinal_(u8),
1842}
1843
1844impl ::fidl_next::Encodable for DriverPackageType {
1845    type Encoded = WireDriverPackageType;
1846}
1847impl ::std::convert::From<u8> for DriverPackageType {
1848    fn from(value: u8) -> Self {
1849        match value {
1850            0 => Self::Boot,
1851            1 => Self::Base,
1852            2 => Self::Cached,
1853            3 => Self::Universe,
1854
1855            _ => Self::UnknownOrdinal_(value),
1856        }
1857    }
1858}
1859
1860unsafe impl<___E> ::fidl_next::Encode<___E> for DriverPackageType
1861where
1862    ___E: ?Sized,
1863{
1864    #[inline]
1865    fn encode(
1866        &mut self,
1867        _: &mut ___E,
1868        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1869    ) -> Result<(), ::fidl_next::EncodeError> {
1870        ::fidl_next::munge!(let WireDriverPackageType { value } = out);
1871        let _ = value.write(u8::from(match *self {
1872            Self::Boot => 0,
1873
1874            Self::Base => 1,
1875
1876            Self::Cached => 2,
1877
1878            Self::Universe => 3,
1879
1880            Self::UnknownOrdinal_(value) => value,
1881        }));
1882
1883        Ok(())
1884    }
1885}
1886
1887impl ::core::convert::From<WireDriverPackageType> for DriverPackageType {
1888    fn from(wire: WireDriverPackageType) -> Self {
1889        match u8::from(wire.value) {
1890            0 => Self::Boot,
1891
1892            1 => Self::Base,
1893
1894            2 => Self::Cached,
1895
1896            3 => Self::Universe,
1897
1898            value => Self::UnknownOrdinal_(value),
1899        }
1900    }
1901}
1902
1903impl ::fidl_next::TakeFrom<WireDriverPackageType> for DriverPackageType {
1904    #[inline]
1905    fn take_from(from: &WireDriverPackageType) -> Self {
1906        Self::from(*from)
1907    }
1908}
1909
1910/// The wire type corresponding to [`DriverPackageType`].
1911#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1912#[repr(transparent)]
1913pub struct WireDriverPackageType {
1914    value: u8,
1915}
1916
1917unsafe impl ::fidl_next::ZeroPadding for WireDriverPackageType {
1918    #[inline]
1919    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1920        // Wire enums have no padding
1921    }
1922}
1923
1924impl WireDriverPackageType {
1925    pub const BOOT: WireDriverPackageType = WireDriverPackageType { value: 0 };
1926
1927    pub const BASE: WireDriverPackageType = WireDriverPackageType { value: 1 };
1928
1929    pub const CACHED: WireDriverPackageType = WireDriverPackageType { value: 2 };
1930
1931    pub const UNIVERSE: WireDriverPackageType = WireDriverPackageType { value: 3 };
1932}
1933
1934unsafe impl<___D> ::fidl_next::Decode<___D> for WireDriverPackageType
1935where
1936    ___D: ?Sized,
1937{
1938    fn decode(
1939        slot: ::fidl_next::Slot<'_, Self>,
1940        _: &mut ___D,
1941    ) -> Result<(), ::fidl_next::DecodeError> {
1942        Ok(())
1943    }
1944}
1945
1946impl ::core::convert::From<DriverPackageType> for WireDriverPackageType {
1947    fn from(natural: DriverPackageType) -> Self {
1948        match natural {
1949            DriverPackageType::Boot => WireDriverPackageType::BOOT,
1950
1951            DriverPackageType::Base => WireDriverPackageType::BASE,
1952
1953            DriverPackageType::Cached => WireDriverPackageType::CACHED,
1954
1955            DriverPackageType::Universe => WireDriverPackageType::UNIVERSE,
1956
1957            DriverPackageType::UnknownOrdinal_(value) => {
1958                WireDriverPackageType { value: u8::from(value) }
1959            }
1960        }
1961    }
1962}
1963
1964#[doc = " Device categories as provided in the driver\'s component manifest.\n"]
1965#[derive(Clone, Debug, Default)]
1966pub struct DeviceCategory {
1967    pub category: Option<String>,
1968
1969    pub subcategory: Option<String>,
1970}
1971
1972impl DeviceCategory {
1973    fn __max_ordinal(&self) -> usize {
1974        if self.category.is_some() {
1975            return 1;
1976        }
1977
1978        if self.subcategory.is_some() {
1979            return 2;
1980        }
1981
1982        0
1983    }
1984}
1985
1986impl ::fidl_next::Encodable for DeviceCategory {
1987    type Encoded = WireDeviceCategory;
1988}
1989
1990unsafe impl<___E> ::fidl_next::Encode<___E> for DeviceCategory
1991where
1992    ___E: ::fidl_next::Encoder + ?Sized,
1993{
1994    #[inline]
1995    fn encode(
1996        &mut self,
1997        encoder: &mut ___E,
1998        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1999    ) -> Result<(), ::fidl_next::EncodeError> {
2000        ::fidl_next::munge!(let WireDeviceCategory { table } = out);
2001
2002        let max_ord = self.__max_ordinal();
2003
2004        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2005        ::fidl_next::ZeroPadding::zero_padding(&mut out);
2006
2007        let mut preallocated =
2008            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2009
2010        for i in 1..=max_ord {
2011            match i {
2012                2 => {
2013                    if let Some(subcategory) = &mut self.subcategory {
2014                        ::fidl_next::WireEnvelope::encode_value(
2015                            subcategory,
2016                            preallocated.encoder,
2017                            &mut out,
2018                        )?;
2019                    } else {
2020                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2021                    }
2022                }
2023
2024                1 => {
2025                    if let Some(category) = &mut self.category {
2026                        ::fidl_next::WireEnvelope::encode_value(
2027                            category,
2028                            preallocated.encoder,
2029                            &mut out,
2030                        )?;
2031                    } else {
2032                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2033                    }
2034                }
2035
2036                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2037            }
2038            unsafe {
2039                preallocated.write_next(out.assume_init_ref());
2040            }
2041        }
2042
2043        ::fidl_next::WireTable::encode_len(table, max_ord);
2044
2045        Ok(())
2046    }
2047}
2048
2049impl ::fidl_next::TakeFrom<WireDeviceCategory> for DeviceCategory {
2050    #[inline]
2051    fn take_from(from: &WireDeviceCategory) -> Self {
2052        Self {
2053            category: from.category().map(::fidl_next::TakeFrom::take_from),
2054
2055            subcategory: from.subcategory().map(::fidl_next::TakeFrom::take_from),
2056        }
2057    }
2058}
2059
2060/// The wire type corresponding to [`DeviceCategory`].
2061#[repr(C)]
2062pub struct WireDeviceCategory {
2063    table: ::fidl_next::WireTable,
2064}
2065
2066unsafe impl ::fidl_next::ZeroPadding for WireDeviceCategory {
2067    #[inline]
2068    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2069        ::fidl_next::munge!(let Self { table } = out);
2070        ::fidl_next::WireTable::zero_padding(table);
2071    }
2072}
2073
2074unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeviceCategory
2075where
2076    ___D: ::fidl_next::Decoder + ?Sized,
2077{
2078    fn decode(
2079        slot: ::fidl_next::Slot<'_, Self>,
2080        decoder: &mut ___D,
2081    ) -> Result<(), ::fidl_next::DecodeError> {
2082        ::fidl_next::munge!(let Self { table } = slot);
2083
2084        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2085            match ordinal {
2086                0 => unsafe { ::core::hint::unreachable_unchecked() },
2087
2088                1 => {
2089                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
2090                        slot.as_mut(),
2091                        decoder,
2092                    )?;
2093
2094                    Ok(())
2095                }
2096
2097                2 => {
2098                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
2099                        slot.as_mut(),
2100                        decoder,
2101                    )?;
2102
2103                    Ok(())
2104                }
2105
2106                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2107            }
2108        })
2109    }
2110}
2111
2112impl WireDeviceCategory {
2113    pub fn category(&self) -> Option<&::fidl_next::WireString> {
2114        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2115    }
2116
2117    pub fn subcategory(&self) -> Option<&::fidl_next::WireString> {
2118        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2119    }
2120}
2121
2122impl ::core::fmt::Debug for WireDeviceCategory {
2123    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2124        f.debug_struct("DeviceCategory")
2125            .field("category", &self.category())
2126            .field("subcategory", &self.subcategory())
2127            .finish()
2128    }
2129}
2130
2131#[doc = " General information for a driver, used with both composite and normal drivers.\n"]
2132#[derive(Clone, Debug, Default)]
2133pub struct DriverInfo {
2134    pub url: Option<String>,
2135
2136    pub name: Option<String>,
2137
2138    pub colocate: Option<bool>,
2139
2140    pub package_type: Option<crate::DriverPackageType>,
2141
2142    pub is_fallback: Option<bool>,
2143
2144    pub device_categories: Option<Vec<crate::DeviceCategory>>,
2145
2146    pub bind_rules_bytecode: Option<Vec<u8>>,
2147
2148    pub driver_framework_version: Option<u8>,
2149
2150    pub is_disabled: Option<bool>,
2151}
2152
2153impl DriverInfo {
2154    fn __max_ordinal(&self) -> usize {
2155        if self.url.is_some() {
2156            return 1;
2157        }
2158
2159        if self.name.is_some() {
2160            return 2;
2161        }
2162
2163        if self.colocate.is_some() {
2164            return 3;
2165        }
2166
2167        if self.package_type.is_some() {
2168            return 4;
2169        }
2170
2171        if self.is_fallback.is_some() {
2172            return 5;
2173        }
2174
2175        if self.device_categories.is_some() {
2176            return 6;
2177        }
2178
2179        if self.bind_rules_bytecode.is_some() {
2180            return 7;
2181        }
2182
2183        if self.driver_framework_version.is_some() {
2184            return 8;
2185        }
2186
2187        if self.is_disabled.is_some() {
2188            return 9;
2189        }
2190
2191        0
2192    }
2193}
2194
2195impl ::fidl_next::Encodable for DriverInfo {
2196    type Encoded = WireDriverInfo;
2197}
2198
2199unsafe impl<___E> ::fidl_next::Encode<___E> for DriverInfo
2200where
2201    ___E: ::fidl_next::Encoder + ?Sized,
2202{
2203    #[inline]
2204    fn encode(
2205        &mut self,
2206        encoder: &mut ___E,
2207        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2208    ) -> Result<(), ::fidl_next::EncodeError> {
2209        ::fidl_next::munge!(let WireDriverInfo { table } = out);
2210
2211        let max_ord = self.__max_ordinal();
2212
2213        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2214        ::fidl_next::ZeroPadding::zero_padding(&mut out);
2215
2216        let mut preallocated =
2217            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2218
2219        for i in 1..=max_ord {
2220            match i {
2221                9 => {
2222                    if let Some(is_disabled) = &mut self.is_disabled {
2223                        ::fidl_next::WireEnvelope::encode_value(
2224                            is_disabled,
2225                            preallocated.encoder,
2226                            &mut out,
2227                        )?;
2228                    } else {
2229                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2230                    }
2231                }
2232
2233                8 => {
2234                    if let Some(driver_framework_version) = &mut self.driver_framework_version {
2235                        ::fidl_next::WireEnvelope::encode_value(
2236                            driver_framework_version,
2237                            preallocated.encoder,
2238                            &mut out,
2239                        )?;
2240                    } else {
2241                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2242                    }
2243                }
2244
2245                7 => {
2246                    if let Some(bind_rules_bytecode) = &mut self.bind_rules_bytecode {
2247                        ::fidl_next::WireEnvelope::encode_value(
2248                            bind_rules_bytecode,
2249                            preallocated.encoder,
2250                            &mut out,
2251                        )?;
2252                    } else {
2253                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2254                    }
2255                }
2256
2257                6 => {
2258                    if let Some(device_categories) = &mut self.device_categories {
2259                        ::fidl_next::WireEnvelope::encode_value(
2260                            device_categories,
2261                            preallocated.encoder,
2262                            &mut out,
2263                        )?;
2264                    } else {
2265                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2266                    }
2267                }
2268
2269                5 => {
2270                    if let Some(is_fallback) = &mut self.is_fallback {
2271                        ::fidl_next::WireEnvelope::encode_value(
2272                            is_fallback,
2273                            preallocated.encoder,
2274                            &mut out,
2275                        )?;
2276                    } else {
2277                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2278                    }
2279                }
2280
2281                4 => {
2282                    if let Some(package_type) = &mut self.package_type {
2283                        ::fidl_next::WireEnvelope::encode_value(
2284                            package_type,
2285                            preallocated.encoder,
2286                            &mut out,
2287                        )?;
2288                    } else {
2289                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2290                    }
2291                }
2292
2293                3 => {
2294                    if let Some(colocate) = &mut self.colocate {
2295                        ::fidl_next::WireEnvelope::encode_value(
2296                            colocate,
2297                            preallocated.encoder,
2298                            &mut out,
2299                        )?;
2300                    } else {
2301                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2302                    }
2303                }
2304
2305                2 => {
2306                    if let Some(name) = &mut self.name {
2307                        ::fidl_next::WireEnvelope::encode_value(
2308                            name,
2309                            preallocated.encoder,
2310                            &mut out,
2311                        )?;
2312                    } else {
2313                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2314                    }
2315                }
2316
2317                1 => {
2318                    if let Some(url) = &mut self.url {
2319                        ::fidl_next::WireEnvelope::encode_value(
2320                            url,
2321                            preallocated.encoder,
2322                            &mut out,
2323                        )?;
2324                    } else {
2325                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2326                    }
2327                }
2328
2329                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2330            }
2331            unsafe {
2332                preallocated.write_next(out.assume_init_ref());
2333            }
2334        }
2335
2336        ::fidl_next::WireTable::encode_len(table, max_ord);
2337
2338        Ok(())
2339    }
2340}
2341
2342impl ::fidl_next::TakeFrom<WireDriverInfo> for DriverInfo {
2343    #[inline]
2344    fn take_from(from: &WireDriverInfo) -> Self {
2345        Self {
2346            url: from.url().map(::fidl_next::TakeFrom::take_from),
2347
2348            name: from.name().map(::fidl_next::TakeFrom::take_from),
2349
2350            colocate: from.colocate().map(::fidl_next::TakeFrom::take_from),
2351
2352            package_type: from.package_type().map(::fidl_next::TakeFrom::take_from),
2353
2354            is_fallback: from.is_fallback().map(::fidl_next::TakeFrom::take_from),
2355
2356            device_categories: from.device_categories().map(::fidl_next::TakeFrom::take_from),
2357
2358            bind_rules_bytecode: from.bind_rules_bytecode().map(::fidl_next::TakeFrom::take_from),
2359
2360            driver_framework_version: from
2361                .driver_framework_version()
2362                .map(::fidl_next::TakeFrom::take_from),
2363
2364            is_disabled: from.is_disabled().map(::fidl_next::TakeFrom::take_from),
2365        }
2366    }
2367}
2368
2369/// The wire type corresponding to [`DriverInfo`].
2370#[repr(C)]
2371pub struct WireDriverInfo {
2372    table: ::fidl_next::WireTable,
2373}
2374
2375unsafe impl ::fidl_next::ZeroPadding for WireDriverInfo {
2376    #[inline]
2377    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2378        ::fidl_next::munge!(let Self { table } = out);
2379        ::fidl_next::WireTable::zero_padding(table);
2380    }
2381}
2382
2383unsafe impl<___D> ::fidl_next::Decode<___D> for WireDriverInfo
2384where
2385    ___D: ::fidl_next::Decoder + ?Sized,
2386{
2387    fn decode(
2388        slot: ::fidl_next::Slot<'_, Self>,
2389        decoder: &mut ___D,
2390    ) -> Result<(), ::fidl_next::DecodeError> {
2391        ::fidl_next::munge!(let Self { table } = slot);
2392
2393        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2394            match ordinal {
2395                0 => unsafe { ::core::hint::unreachable_unchecked() },
2396
2397                1 => {
2398                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
2399                        slot.as_mut(),
2400                        decoder,
2401                    )?;
2402
2403                    let url = unsafe {
2404                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
2405                    };
2406
2407                    if url.len() > 4096 {
2408                        return Err(::fidl_next::DecodeError::VectorTooLong {
2409                            size: url.len() as u64,
2410                            limit: 4096,
2411                        });
2412                    }
2413
2414                    Ok(())
2415                }
2416
2417                2 => {
2418                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
2419                        slot.as_mut(),
2420                        decoder,
2421                    )?;
2422
2423                    Ok(())
2424                }
2425
2426                3 => {
2427                    ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
2428
2429                    Ok(())
2430                }
2431
2432                4 => {
2433                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDriverPackageType>(
2434                        slot.as_mut(),
2435                        decoder,
2436                    )?;
2437
2438                    Ok(())
2439                }
2440
2441                5 => {
2442                    ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
2443
2444                    Ok(())
2445                }
2446
2447                6 => {
2448                    ::fidl_next::WireEnvelope::decode_as::<
2449                        ___D,
2450                        ::fidl_next::WireVector<crate::WireDeviceCategory>,
2451                    >(slot.as_mut(), decoder)?;
2452
2453                    Ok(())
2454                }
2455
2456                7 => {
2457                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireVector<u8>>(
2458                        slot.as_mut(),
2459                        decoder,
2460                    )?;
2461
2462                    Ok(())
2463                }
2464
2465                8 => {
2466                    ::fidl_next::WireEnvelope::decode_as::<___D, u8>(slot.as_mut(), decoder)?;
2467
2468                    Ok(())
2469                }
2470
2471                9 => {
2472                    ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
2473
2474                    Ok(())
2475                }
2476
2477                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2478            }
2479        })
2480    }
2481}
2482
2483impl WireDriverInfo {
2484    pub fn url(&self) -> Option<&::fidl_next::WireString> {
2485        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2486    }
2487
2488    pub fn name(&self) -> Option<&::fidl_next::WireString> {
2489        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2490    }
2491
2492    pub fn colocate(&self) -> Option<&bool> {
2493        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2494    }
2495
2496    pub fn package_type(&self) -> Option<&crate::WireDriverPackageType> {
2497        unsafe { Some(self.table.get(4)?.deref_unchecked()) }
2498    }
2499
2500    pub fn is_fallback(&self) -> Option<&bool> {
2501        unsafe { Some(self.table.get(5)?.deref_unchecked()) }
2502    }
2503
2504    pub fn device_categories(&self) -> Option<&::fidl_next::WireVector<crate::WireDeviceCategory>> {
2505        unsafe { Some(self.table.get(6)?.deref_unchecked()) }
2506    }
2507
2508    pub fn bind_rules_bytecode(&self) -> Option<&::fidl_next::WireVector<u8>> {
2509        unsafe { Some(self.table.get(7)?.deref_unchecked()) }
2510    }
2511
2512    pub fn driver_framework_version(&self) -> Option<&u8> {
2513        unsafe { Some(self.table.get(8)?.deref_unchecked()) }
2514    }
2515
2516    pub fn is_disabled(&self) -> Option<&bool> {
2517        unsafe { Some(self.table.get(9)?.deref_unchecked()) }
2518    }
2519}
2520
2521impl ::core::fmt::Debug for WireDriverInfo {
2522    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2523        f.debug_struct("DriverInfo")
2524            .field("url", &self.url())
2525            .field("name", &self.name())
2526            .field("colocate", &self.colocate())
2527            .field("package_type", &self.package_type())
2528            .field("is_fallback", &self.is_fallback())
2529            .field("device_categories", &self.device_categories())
2530            .field("bind_rules_bytecode", &self.bind_rules_bytecode())
2531            .field("driver_framework_version", &self.driver_framework_version())
2532            .field("is_disabled", &self.is_disabled())
2533            .finish()
2534    }
2535}
2536
2537#[doc = " Information for a composite driver.\n"]
2538#[derive(Clone, Debug, Default)]
2539pub struct CompositeDriverInfo {
2540    pub composite_name: Option<String>,
2541
2542    pub driver_info: Option<crate::DriverInfo>,
2543}
2544
2545impl CompositeDriverInfo {
2546    fn __max_ordinal(&self) -> usize {
2547        if self.composite_name.is_some() {
2548            return 1;
2549        }
2550
2551        if self.driver_info.is_some() {
2552            return 2;
2553        }
2554
2555        0
2556    }
2557}
2558
2559impl ::fidl_next::Encodable for CompositeDriverInfo {
2560    type Encoded = WireCompositeDriverInfo;
2561}
2562
2563unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeDriverInfo
2564where
2565    ___E: ::fidl_next::Encoder + ?Sized,
2566{
2567    #[inline]
2568    fn encode(
2569        &mut self,
2570        encoder: &mut ___E,
2571        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2572    ) -> Result<(), ::fidl_next::EncodeError> {
2573        ::fidl_next::munge!(let WireCompositeDriverInfo { table } = out);
2574
2575        let max_ord = self.__max_ordinal();
2576
2577        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2578        ::fidl_next::ZeroPadding::zero_padding(&mut out);
2579
2580        let mut preallocated =
2581            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2582
2583        for i in 1..=max_ord {
2584            match i {
2585                2 => {
2586                    if let Some(driver_info) = &mut self.driver_info {
2587                        ::fidl_next::WireEnvelope::encode_value(
2588                            driver_info,
2589                            preallocated.encoder,
2590                            &mut out,
2591                        )?;
2592                    } else {
2593                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2594                    }
2595                }
2596
2597                1 => {
2598                    if let Some(composite_name) = &mut self.composite_name {
2599                        ::fidl_next::WireEnvelope::encode_value(
2600                            composite_name,
2601                            preallocated.encoder,
2602                            &mut out,
2603                        )?;
2604                    } else {
2605                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2606                    }
2607                }
2608
2609                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2610            }
2611            unsafe {
2612                preallocated.write_next(out.assume_init_ref());
2613            }
2614        }
2615
2616        ::fidl_next::WireTable::encode_len(table, max_ord);
2617
2618        Ok(())
2619    }
2620}
2621
2622impl ::fidl_next::TakeFrom<WireCompositeDriverInfo> for CompositeDriverInfo {
2623    #[inline]
2624    fn take_from(from: &WireCompositeDriverInfo) -> Self {
2625        Self {
2626            composite_name: from.composite_name().map(::fidl_next::TakeFrom::take_from),
2627
2628            driver_info: from.driver_info().map(::fidl_next::TakeFrom::take_from),
2629        }
2630    }
2631}
2632
2633/// The wire type corresponding to [`CompositeDriverInfo`].
2634#[repr(C)]
2635pub struct WireCompositeDriverInfo {
2636    table: ::fidl_next::WireTable,
2637}
2638
2639unsafe impl ::fidl_next::ZeroPadding for WireCompositeDriverInfo {
2640    #[inline]
2641    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2642        ::fidl_next::munge!(let Self { table } = out);
2643        ::fidl_next::WireTable::zero_padding(table);
2644    }
2645}
2646
2647unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeDriverInfo
2648where
2649    ___D: ::fidl_next::Decoder + ?Sized,
2650{
2651    fn decode(
2652        slot: ::fidl_next::Slot<'_, Self>,
2653        decoder: &mut ___D,
2654    ) -> Result<(), ::fidl_next::DecodeError> {
2655        ::fidl_next::munge!(let Self { table } = slot);
2656
2657        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2658            match ordinal {
2659                0 => unsafe { ::core::hint::unreachable_unchecked() },
2660
2661                1 => {
2662                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
2663                        slot.as_mut(),
2664                        decoder,
2665                    )?;
2666
2667                    Ok(())
2668                }
2669
2670                2 => {
2671                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDriverInfo>(
2672                        slot.as_mut(),
2673                        decoder,
2674                    )?;
2675
2676                    Ok(())
2677                }
2678
2679                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2680            }
2681        })
2682    }
2683}
2684
2685impl WireCompositeDriverInfo {
2686    pub fn composite_name(&self) -> Option<&::fidl_next::WireString> {
2687        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2688    }
2689
2690    pub fn driver_info(&self) -> Option<&crate::WireDriverInfo> {
2691        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2692    }
2693}
2694
2695impl ::core::fmt::Debug for WireCompositeDriverInfo {
2696    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2697        f.debug_struct("CompositeDriverInfo")
2698            .field("composite_name", &self.composite_name())
2699            .field("driver_info", &self.driver_info())
2700            .finish()
2701    }
2702}
2703
2704#[doc = " Information for a composite driver that has matched with a composite.\n"]
2705#[derive(Clone, Debug, Default)]
2706pub struct CompositeDriverMatch {
2707    pub composite_driver: Option<crate::CompositeDriverInfo>,
2708
2709    pub parent_names: Option<Vec<String>>,
2710
2711    pub primary_parent_index: Option<u32>,
2712}
2713
2714impl CompositeDriverMatch {
2715    fn __max_ordinal(&self) -> usize {
2716        if self.composite_driver.is_some() {
2717            return 1;
2718        }
2719
2720        if self.parent_names.is_some() {
2721            return 2;
2722        }
2723
2724        if self.primary_parent_index.is_some() {
2725            return 3;
2726        }
2727
2728        0
2729    }
2730}
2731
2732impl ::fidl_next::Encodable for CompositeDriverMatch {
2733    type Encoded = WireCompositeDriverMatch;
2734}
2735
2736unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeDriverMatch
2737where
2738    ___E: ::fidl_next::Encoder + ?Sized,
2739{
2740    #[inline]
2741    fn encode(
2742        &mut self,
2743        encoder: &mut ___E,
2744        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2745    ) -> Result<(), ::fidl_next::EncodeError> {
2746        ::fidl_next::munge!(let WireCompositeDriverMatch { table } = out);
2747
2748        let max_ord = self.__max_ordinal();
2749
2750        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2751        ::fidl_next::ZeroPadding::zero_padding(&mut out);
2752
2753        let mut preallocated =
2754            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2755
2756        for i in 1..=max_ord {
2757            match i {
2758                3 => {
2759                    if let Some(primary_parent_index) = &mut self.primary_parent_index {
2760                        ::fidl_next::WireEnvelope::encode_value(
2761                            primary_parent_index,
2762                            preallocated.encoder,
2763                            &mut out,
2764                        )?;
2765                    } else {
2766                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2767                    }
2768                }
2769
2770                2 => {
2771                    if let Some(parent_names) = &mut self.parent_names {
2772                        ::fidl_next::WireEnvelope::encode_value(
2773                            parent_names,
2774                            preallocated.encoder,
2775                            &mut out,
2776                        )?;
2777                    } else {
2778                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2779                    }
2780                }
2781
2782                1 => {
2783                    if let Some(composite_driver) = &mut self.composite_driver {
2784                        ::fidl_next::WireEnvelope::encode_value(
2785                            composite_driver,
2786                            preallocated.encoder,
2787                            &mut out,
2788                        )?;
2789                    } else {
2790                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2791                    }
2792                }
2793
2794                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2795            }
2796            unsafe {
2797                preallocated.write_next(out.assume_init_ref());
2798            }
2799        }
2800
2801        ::fidl_next::WireTable::encode_len(table, max_ord);
2802
2803        Ok(())
2804    }
2805}
2806
2807impl ::fidl_next::TakeFrom<WireCompositeDriverMatch> for CompositeDriverMatch {
2808    #[inline]
2809    fn take_from(from: &WireCompositeDriverMatch) -> Self {
2810        Self {
2811            composite_driver: from.composite_driver().map(::fidl_next::TakeFrom::take_from),
2812
2813            parent_names: from.parent_names().map(::fidl_next::TakeFrom::take_from),
2814
2815            primary_parent_index: from.primary_parent_index().map(::fidl_next::TakeFrom::take_from),
2816        }
2817    }
2818}
2819
2820/// The wire type corresponding to [`CompositeDriverMatch`].
2821#[repr(C)]
2822pub struct WireCompositeDriverMatch {
2823    table: ::fidl_next::WireTable,
2824}
2825
2826unsafe impl ::fidl_next::ZeroPadding for WireCompositeDriverMatch {
2827    #[inline]
2828    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2829        ::fidl_next::munge!(let Self { table } = out);
2830        ::fidl_next::WireTable::zero_padding(table);
2831    }
2832}
2833
2834unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeDriverMatch
2835where
2836    ___D: ::fidl_next::Decoder + ?Sized,
2837{
2838    fn decode(
2839        slot: ::fidl_next::Slot<'_, Self>,
2840        decoder: &mut ___D,
2841    ) -> Result<(), ::fidl_next::DecodeError> {
2842        ::fidl_next::munge!(let Self { table } = slot);
2843
2844        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2845            match ordinal {
2846                0 => unsafe { ::core::hint::unreachable_unchecked() },
2847
2848                1 => {
2849                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireCompositeDriverInfo>(
2850                        slot.as_mut(),
2851                        decoder,
2852                    )?;
2853
2854                    Ok(())
2855                }
2856
2857                2 => {
2858                    ::fidl_next::WireEnvelope::decode_as::<
2859                        ___D,
2860                        ::fidl_next::WireVector<::fidl_next::WireString>,
2861                    >(slot.as_mut(), decoder)?;
2862
2863                    Ok(())
2864                }
2865
2866                3 => {
2867                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
2868                        slot.as_mut(),
2869                        decoder,
2870                    )?;
2871
2872                    Ok(())
2873                }
2874
2875                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2876            }
2877        })
2878    }
2879}
2880
2881impl WireCompositeDriverMatch {
2882    pub fn composite_driver(&self) -> Option<&crate::WireCompositeDriverInfo> {
2883        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2884    }
2885
2886    pub fn parent_names(&self) -> Option<&::fidl_next::WireVector<::fidl_next::WireString>> {
2887        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2888    }
2889
2890    pub fn primary_parent_index(&self) -> Option<&::fidl_next::WireU32> {
2891        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2892    }
2893}
2894
2895impl ::core::fmt::Debug for WireCompositeDriverMatch {
2896    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2897        f.debug_struct("CompositeDriverMatch")
2898            .field("composite_driver", &self.composite_driver())
2899            .field("parent_names", &self.parent_names())
2900            .field("primary_parent_index", &self.primary_parent_index())
2901            .finish()
2902    }
2903}
2904
2905#[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"]
2906#[derive(Clone, Debug)]
2907pub struct NodeProperty {
2908    pub key: crate::NodePropertyKey,
2909
2910    pub value: crate::NodePropertyValue,
2911}
2912
2913impl ::fidl_next::Encodable for NodeProperty {
2914    type Encoded = WireNodeProperty;
2915}
2916
2917unsafe impl<___E> ::fidl_next::Encode<___E> for NodeProperty
2918where
2919    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2920
2921    ___E: ::fidl_next::Encoder,
2922{
2923    #[inline]
2924    fn encode(
2925        &mut self,
2926        encoder: &mut ___E,
2927        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2928    ) -> Result<(), ::fidl_next::EncodeError> {
2929        ::fidl_next::munge! {
2930            let Self::Encoded {
2931                key,
2932                value,
2933
2934            } = out;
2935        }
2936
2937        ::fidl_next::Encode::encode(&mut self.key, encoder, key)?;
2938
2939        ::fidl_next::Encode::encode(&mut self.value, encoder, value)?;
2940
2941        Ok(())
2942    }
2943}
2944
2945impl ::fidl_next::EncodableOption for Box<NodeProperty> {
2946    type EncodedOption = ::fidl_next::WireBox<WireNodeProperty>;
2947}
2948
2949unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeProperty>
2950where
2951    ___E: ::fidl_next::Encoder + ?Sized,
2952    NodeProperty: ::fidl_next::Encode<___E>,
2953{
2954    #[inline]
2955    fn encode_option(
2956        this: Option<&mut Self>,
2957        encoder: &mut ___E,
2958        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2959    ) -> Result<(), ::fidl_next::EncodeError> {
2960        if let Some(inner) = this {
2961            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2962            ::fidl_next::WireBox::encode_present(out);
2963        } else {
2964            ::fidl_next::WireBox::encode_absent(out);
2965        }
2966
2967        Ok(())
2968    }
2969}
2970
2971impl ::fidl_next::TakeFrom<WireNodeProperty> for NodeProperty {
2972    #[inline]
2973    fn take_from(from: &WireNodeProperty) -> Self {
2974        Self {
2975            key: ::fidl_next::TakeFrom::take_from(&from.key),
2976
2977            value: ::fidl_next::TakeFrom::take_from(&from.value),
2978        }
2979    }
2980}
2981
2982/// The wire type corresponding to [`NodeProperty`].
2983#[derive(Debug)]
2984#[repr(C)]
2985pub struct WireNodeProperty {
2986    pub key: crate::WireNodePropertyKey,
2987
2988    pub value: crate::WireNodePropertyValue,
2989}
2990
2991unsafe impl ::fidl_next::ZeroPadding for WireNodeProperty {
2992    #[inline]
2993    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2994}
2995
2996unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeProperty
2997where
2998    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2999
3000    ___D: ::fidl_next::Decoder,
3001{
3002    fn decode(
3003        slot: ::fidl_next::Slot<'_, Self>,
3004        decoder: &mut ___D,
3005    ) -> Result<(), ::fidl_next::DecodeError> {
3006        ::fidl_next::munge! {
3007            let Self {
3008                mut key,
3009                mut value,
3010
3011            } = slot;
3012        }
3013
3014        ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
3015
3016        ::fidl_next::Decode::decode(value.as_mut(), decoder)?;
3017
3018        Ok(())
3019    }
3020}
3021
3022#[doc = " Specification for a node that parents the composite node created from the\n composite node specification.\n"]
3023#[derive(Clone, Debug)]
3024pub struct ParentSpec {
3025    pub bind_rules: Vec<crate::BindRule>,
3026
3027    pub properties: Vec<crate::NodeProperty>,
3028}
3029
3030impl ::fidl_next::Encodable for ParentSpec {
3031    type Encoded = WireParentSpec;
3032}
3033
3034unsafe impl<___E> ::fidl_next::Encode<___E> for ParentSpec
3035where
3036    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3037
3038    ___E: ::fidl_next::Encoder,
3039{
3040    #[inline]
3041    fn encode(
3042        &mut self,
3043        encoder: &mut ___E,
3044        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3045    ) -> Result<(), ::fidl_next::EncodeError> {
3046        ::fidl_next::munge! {
3047            let Self::Encoded {
3048                bind_rules,
3049                properties,
3050
3051            } = out;
3052        }
3053
3054        ::fidl_next::Encode::encode(&mut self.bind_rules, encoder, bind_rules)?;
3055
3056        ::fidl_next::Encode::encode(&mut self.properties, encoder, properties)?;
3057
3058        Ok(())
3059    }
3060}
3061
3062impl ::fidl_next::EncodableOption for Box<ParentSpec> {
3063    type EncodedOption = ::fidl_next::WireBox<WireParentSpec>;
3064}
3065
3066unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ParentSpec>
3067where
3068    ___E: ::fidl_next::Encoder + ?Sized,
3069    ParentSpec: ::fidl_next::Encode<___E>,
3070{
3071    #[inline]
3072    fn encode_option(
3073        this: Option<&mut Self>,
3074        encoder: &mut ___E,
3075        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3076    ) -> Result<(), ::fidl_next::EncodeError> {
3077        if let Some(inner) = this {
3078            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3079            ::fidl_next::WireBox::encode_present(out);
3080        } else {
3081            ::fidl_next::WireBox::encode_absent(out);
3082        }
3083
3084        Ok(())
3085    }
3086}
3087
3088impl ::fidl_next::TakeFrom<WireParentSpec> for ParentSpec {
3089    #[inline]
3090    fn take_from(from: &WireParentSpec) -> Self {
3091        Self {
3092            bind_rules: ::fidl_next::TakeFrom::take_from(&from.bind_rules),
3093
3094            properties: ::fidl_next::TakeFrom::take_from(&from.properties),
3095        }
3096    }
3097}
3098
3099/// The wire type corresponding to [`ParentSpec`].
3100#[derive(Debug)]
3101#[repr(C)]
3102pub struct WireParentSpec {
3103    pub bind_rules: ::fidl_next::WireVector<crate::WireBindRule>,
3104
3105    pub properties: ::fidl_next::WireVector<crate::WireNodeProperty>,
3106}
3107
3108unsafe impl ::fidl_next::ZeroPadding for WireParentSpec {
3109    #[inline]
3110    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3111}
3112
3113unsafe impl<___D> ::fidl_next::Decode<___D> for WireParentSpec
3114where
3115    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3116
3117    ___D: ::fidl_next::Decoder,
3118{
3119    fn decode(
3120        slot: ::fidl_next::Slot<'_, Self>,
3121        decoder: &mut ___D,
3122    ) -> Result<(), ::fidl_next::DecodeError> {
3123        ::fidl_next::munge! {
3124            let Self {
3125                mut bind_rules,
3126                mut properties,
3127
3128            } = slot;
3129        }
3130
3131        ::fidl_next::Decode::decode(bind_rules.as_mut(), decoder)?;
3132
3133        let bind_rules = unsafe { bind_rules.deref_unchecked() };
3134
3135        if bind_rules.len() > 64 {
3136            return Err(::fidl_next::DecodeError::VectorTooLong {
3137                size: bind_rules.len() as u64,
3138                limit: 64,
3139            });
3140        }
3141
3142        ::fidl_next::Decode::decode(properties.as_mut(), decoder)?;
3143
3144        let properties = unsafe { properties.deref_unchecked() };
3145
3146        if properties.len() > 64 {
3147            return Err(::fidl_next::DecodeError::VectorTooLong {
3148                size: properties.len() as u64,
3149                limit: 64,
3150            });
3151        }
3152
3153        Ok(())
3154    }
3155}
3156
3157#[derive(Clone, Debug)]
3158pub struct NodeProperty2 {
3159    pub key: String,
3160
3161    pub value: crate::NodePropertyValue,
3162}
3163
3164impl ::fidl_next::Encodable for NodeProperty2 {
3165    type Encoded = WireNodeProperty2;
3166}
3167
3168unsafe impl<___E> ::fidl_next::Encode<___E> for NodeProperty2
3169where
3170    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3171
3172    ___E: ::fidl_next::Encoder,
3173{
3174    #[inline]
3175    fn encode(
3176        &mut self,
3177        encoder: &mut ___E,
3178        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3179    ) -> Result<(), ::fidl_next::EncodeError> {
3180        ::fidl_next::munge! {
3181            let Self::Encoded {
3182                key,
3183                value,
3184
3185            } = out;
3186        }
3187
3188        ::fidl_next::Encode::encode(&mut self.key, encoder, key)?;
3189
3190        ::fidl_next::Encode::encode(&mut self.value, encoder, value)?;
3191
3192        Ok(())
3193    }
3194}
3195
3196impl ::fidl_next::EncodableOption for Box<NodeProperty2> {
3197    type EncodedOption = ::fidl_next::WireBox<WireNodeProperty2>;
3198}
3199
3200unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeProperty2>
3201where
3202    ___E: ::fidl_next::Encoder + ?Sized,
3203    NodeProperty2: ::fidl_next::Encode<___E>,
3204{
3205    #[inline]
3206    fn encode_option(
3207        this: Option<&mut Self>,
3208        encoder: &mut ___E,
3209        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3210    ) -> Result<(), ::fidl_next::EncodeError> {
3211        if let Some(inner) = this {
3212            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3213            ::fidl_next::WireBox::encode_present(out);
3214        } else {
3215            ::fidl_next::WireBox::encode_absent(out);
3216        }
3217
3218        Ok(())
3219    }
3220}
3221
3222impl ::fidl_next::TakeFrom<WireNodeProperty2> for NodeProperty2 {
3223    #[inline]
3224    fn take_from(from: &WireNodeProperty2) -> Self {
3225        Self {
3226            key: ::fidl_next::TakeFrom::take_from(&from.key),
3227
3228            value: ::fidl_next::TakeFrom::take_from(&from.value),
3229        }
3230    }
3231}
3232
3233/// The wire type corresponding to [`NodeProperty2`].
3234#[derive(Debug)]
3235#[repr(C)]
3236pub struct WireNodeProperty2 {
3237    pub key: ::fidl_next::WireString,
3238
3239    pub value: crate::WireNodePropertyValue,
3240}
3241
3242unsafe impl ::fidl_next::ZeroPadding for WireNodeProperty2 {
3243    #[inline]
3244    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3245}
3246
3247unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeProperty2
3248where
3249    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3250
3251    ___D: ::fidl_next::Decoder,
3252{
3253    fn decode(
3254        slot: ::fidl_next::Slot<'_, Self>,
3255        decoder: &mut ___D,
3256    ) -> Result<(), ::fidl_next::DecodeError> {
3257        ::fidl_next::munge! {
3258            let Self {
3259                mut key,
3260                mut value,
3261
3262            } = slot;
3263        }
3264
3265        ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
3266
3267        let key = unsafe { key.deref_unchecked() };
3268
3269        if key.len() > 256 {
3270            return Err(::fidl_next::DecodeError::VectorTooLong {
3271                size: key.len() as u64,
3272                limit: 256,
3273            });
3274        }
3275
3276        ::fidl_next::Decode::decode(value.as_mut(), decoder)?;
3277
3278        Ok(())
3279    }
3280}
3281
3282#[doc = " Specification for a node that parents the composite node created from the\n composite node specification.\n"]
3283#[derive(Clone, Debug)]
3284pub struct ParentSpec2 {
3285    pub bind_rules: Vec<crate::BindRule2>,
3286
3287    pub properties: Vec<crate::NodeProperty2>,
3288}
3289
3290impl ::fidl_next::Encodable for ParentSpec2 {
3291    type Encoded = WireParentSpec2;
3292}
3293
3294unsafe impl<___E> ::fidl_next::Encode<___E> for ParentSpec2
3295where
3296    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3297
3298    ___E: ::fidl_next::Encoder,
3299{
3300    #[inline]
3301    fn encode(
3302        &mut self,
3303        encoder: &mut ___E,
3304        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3305    ) -> Result<(), ::fidl_next::EncodeError> {
3306        ::fidl_next::munge! {
3307            let Self::Encoded {
3308                bind_rules,
3309                properties,
3310
3311            } = out;
3312        }
3313
3314        ::fidl_next::Encode::encode(&mut self.bind_rules, encoder, bind_rules)?;
3315
3316        ::fidl_next::Encode::encode(&mut self.properties, encoder, properties)?;
3317
3318        Ok(())
3319    }
3320}
3321
3322impl ::fidl_next::EncodableOption for Box<ParentSpec2> {
3323    type EncodedOption = ::fidl_next::WireBox<WireParentSpec2>;
3324}
3325
3326unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ParentSpec2>
3327where
3328    ___E: ::fidl_next::Encoder + ?Sized,
3329    ParentSpec2: ::fidl_next::Encode<___E>,
3330{
3331    #[inline]
3332    fn encode_option(
3333        this: Option<&mut Self>,
3334        encoder: &mut ___E,
3335        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3336    ) -> Result<(), ::fidl_next::EncodeError> {
3337        if let Some(inner) = this {
3338            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3339            ::fidl_next::WireBox::encode_present(out);
3340        } else {
3341            ::fidl_next::WireBox::encode_absent(out);
3342        }
3343
3344        Ok(())
3345    }
3346}
3347
3348impl ::fidl_next::TakeFrom<WireParentSpec2> for ParentSpec2 {
3349    #[inline]
3350    fn take_from(from: &WireParentSpec2) -> Self {
3351        Self {
3352            bind_rules: ::fidl_next::TakeFrom::take_from(&from.bind_rules),
3353
3354            properties: ::fidl_next::TakeFrom::take_from(&from.properties),
3355        }
3356    }
3357}
3358
3359/// The wire type corresponding to [`ParentSpec2`].
3360#[derive(Debug)]
3361#[repr(C)]
3362pub struct WireParentSpec2 {
3363    pub bind_rules: ::fidl_next::WireVector<crate::WireBindRule2>,
3364
3365    pub properties: ::fidl_next::WireVector<crate::WireNodeProperty2>,
3366}
3367
3368unsafe impl ::fidl_next::ZeroPadding for WireParentSpec2 {
3369    #[inline]
3370    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3371}
3372
3373unsafe impl<___D> ::fidl_next::Decode<___D> for WireParentSpec2
3374where
3375    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3376
3377    ___D: ::fidl_next::Decoder,
3378{
3379    fn decode(
3380        slot: ::fidl_next::Slot<'_, Self>,
3381        decoder: &mut ___D,
3382    ) -> Result<(), ::fidl_next::DecodeError> {
3383        ::fidl_next::munge! {
3384            let Self {
3385                mut bind_rules,
3386                mut properties,
3387
3388            } = slot;
3389        }
3390
3391        ::fidl_next::Decode::decode(bind_rules.as_mut(), decoder)?;
3392
3393        let bind_rules = unsafe { bind_rules.deref_unchecked() };
3394
3395        if bind_rules.len() > 64 {
3396            return Err(::fidl_next::DecodeError::VectorTooLong {
3397                size: bind_rules.len() as u64,
3398                limit: 64,
3399            });
3400        }
3401
3402        ::fidl_next::Decode::decode(properties.as_mut(), decoder)?;
3403
3404        let properties = unsafe { properties.deref_unchecked() };
3405
3406        if properties.len() > 64 {
3407            return Err(::fidl_next::DecodeError::VectorTooLong {
3408                size: properties.len() as u64,
3409                limit: 64,
3410            });
3411        }
3412
3413        Ok(())
3414    }
3415}
3416
3417#[doc = " Struct that represents a composite node specification.\n"]
3418#[derive(Clone, Debug, Default)]
3419pub struct CompositeNodeSpec {
3420    pub name: Option<String>,
3421
3422    pub parents: Option<Vec<crate::ParentSpec>>,
3423
3424    pub parents2: Option<Vec<crate::ParentSpec2>>,
3425}
3426
3427impl CompositeNodeSpec {
3428    fn __max_ordinal(&self) -> usize {
3429        if self.name.is_some() {
3430            return 1;
3431        }
3432
3433        if self.parents.is_some() {
3434            return 2;
3435        }
3436
3437        if self.parents2.is_some() {
3438            return 3;
3439        }
3440
3441        0
3442    }
3443}
3444
3445impl ::fidl_next::Encodable for CompositeNodeSpec {
3446    type Encoded = WireCompositeNodeSpec;
3447}
3448
3449unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeNodeSpec
3450where
3451    ___E: ::fidl_next::Encoder + ?Sized,
3452{
3453    #[inline]
3454    fn encode(
3455        &mut self,
3456        encoder: &mut ___E,
3457        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3458    ) -> Result<(), ::fidl_next::EncodeError> {
3459        ::fidl_next::munge!(let WireCompositeNodeSpec { table } = out);
3460
3461        let max_ord = self.__max_ordinal();
3462
3463        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3464        ::fidl_next::ZeroPadding::zero_padding(&mut out);
3465
3466        let mut preallocated =
3467            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3468
3469        for i in 1..=max_ord {
3470            match i {
3471                3 => {
3472                    if let Some(parents2) = &mut self.parents2 {
3473                        ::fidl_next::WireEnvelope::encode_value(
3474                            parents2,
3475                            preallocated.encoder,
3476                            &mut out,
3477                        )?;
3478                    } else {
3479                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3480                    }
3481                }
3482
3483                2 => {
3484                    if let Some(parents) = &mut self.parents {
3485                        ::fidl_next::WireEnvelope::encode_value(
3486                            parents,
3487                            preallocated.encoder,
3488                            &mut out,
3489                        )?;
3490                    } else {
3491                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3492                    }
3493                }
3494
3495                1 => {
3496                    if let Some(name) = &mut self.name {
3497                        ::fidl_next::WireEnvelope::encode_value(
3498                            name,
3499                            preallocated.encoder,
3500                            &mut out,
3501                        )?;
3502                    } else {
3503                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3504                    }
3505                }
3506
3507                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3508            }
3509            unsafe {
3510                preallocated.write_next(out.assume_init_ref());
3511            }
3512        }
3513
3514        ::fidl_next::WireTable::encode_len(table, max_ord);
3515
3516        Ok(())
3517    }
3518}
3519
3520impl ::fidl_next::TakeFrom<WireCompositeNodeSpec> for CompositeNodeSpec {
3521    #[inline]
3522    fn take_from(from: &WireCompositeNodeSpec) -> Self {
3523        Self {
3524            name: from.name().map(::fidl_next::TakeFrom::take_from),
3525
3526            parents: from.parents().map(::fidl_next::TakeFrom::take_from),
3527
3528            parents2: from.parents2().map(::fidl_next::TakeFrom::take_from),
3529        }
3530    }
3531}
3532
3533/// The wire type corresponding to [`CompositeNodeSpec`].
3534#[repr(C)]
3535pub struct WireCompositeNodeSpec {
3536    table: ::fidl_next::WireTable,
3537}
3538
3539unsafe impl ::fidl_next::ZeroPadding for WireCompositeNodeSpec {
3540    #[inline]
3541    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3542        ::fidl_next::munge!(let Self { table } = out);
3543        ::fidl_next::WireTable::zero_padding(table);
3544    }
3545}
3546
3547unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeNodeSpec
3548where
3549    ___D: ::fidl_next::Decoder + ?Sized,
3550{
3551    fn decode(
3552        slot: ::fidl_next::Slot<'_, Self>,
3553        decoder: &mut ___D,
3554    ) -> Result<(), ::fidl_next::DecodeError> {
3555        ::fidl_next::munge!(let Self { table } = slot);
3556
3557        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3558            match ordinal {
3559                0 => unsafe { ::core::hint::unreachable_unchecked() },
3560
3561                1 => {
3562                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
3563                        slot.as_mut(),
3564                        decoder,
3565                    )?;
3566
3567                    Ok(())
3568                }
3569
3570                2 => {
3571                    ::fidl_next::WireEnvelope::decode_as::<
3572                        ___D,
3573                        ::fidl_next::WireVector<crate::WireParentSpec>,
3574                    >(slot.as_mut(), decoder)?;
3575
3576                    Ok(())
3577                }
3578
3579                3 => {
3580                    ::fidl_next::WireEnvelope::decode_as::<
3581                        ___D,
3582                        ::fidl_next::WireVector<crate::WireParentSpec2>,
3583                    >(slot.as_mut(), decoder)?;
3584
3585                    Ok(())
3586                }
3587
3588                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3589            }
3590        })
3591    }
3592}
3593
3594impl WireCompositeNodeSpec {
3595    pub fn name(&self) -> Option<&::fidl_next::WireString> {
3596        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3597    }
3598
3599    pub fn parents(&self) -> Option<&::fidl_next::WireVector<crate::WireParentSpec>> {
3600        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3601    }
3602
3603    pub fn parents2(&self) -> Option<&::fidl_next::WireVector<crate::WireParentSpec2>> {
3604        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
3605    }
3606}
3607
3608impl ::core::fmt::Debug for WireCompositeNodeSpec {
3609    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3610        f.debug_struct("CompositeNodeSpec")
3611            .field("name", &self.name())
3612            .field("parents", &self.parents())
3613            .field("parents2", &self.parents2())
3614            .finish()
3615    }
3616}
3617
3618#[doc = " Information for a composite that is defined by a composite node spec.\n"]
3619#[derive(Clone, Debug, Default)]
3620pub struct CompositeInfo {
3621    pub spec: Option<crate::CompositeNodeSpec>,
3622
3623    pub matched_driver: Option<crate::CompositeDriverMatch>,
3624}
3625
3626impl CompositeInfo {
3627    fn __max_ordinal(&self) -> usize {
3628        if self.spec.is_some() {
3629            return 1;
3630        }
3631
3632        if self.matched_driver.is_some() {
3633            return 2;
3634        }
3635
3636        0
3637    }
3638}
3639
3640impl ::fidl_next::Encodable for CompositeInfo {
3641    type Encoded = WireCompositeInfo;
3642}
3643
3644unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeInfo
3645where
3646    ___E: ::fidl_next::Encoder + ?Sized,
3647{
3648    #[inline]
3649    fn encode(
3650        &mut self,
3651        encoder: &mut ___E,
3652        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3653    ) -> Result<(), ::fidl_next::EncodeError> {
3654        ::fidl_next::munge!(let WireCompositeInfo { table } = out);
3655
3656        let max_ord = self.__max_ordinal();
3657
3658        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3659        ::fidl_next::ZeroPadding::zero_padding(&mut out);
3660
3661        let mut preallocated =
3662            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3663
3664        for i in 1..=max_ord {
3665            match i {
3666                2 => {
3667                    if let Some(matched_driver) = &mut self.matched_driver {
3668                        ::fidl_next::WireEnvelope::encode_value(
3669                            matched_driver,
3670                            preallocated.encoder,
3671                            &mut out,
3672                        )?;
3673                    } else {
3674                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3675                    }
3676                }
3677
3678                1 => {
3679                    if let Some(spec) = &mut self.spec {
3680                        ::fidl_next::WireEnvelope::encode_value(
3681                            spec,
3682                            preallocated.encoder,
3683                            &mut out,
3684                        )?;
3685                    } else {
3686                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3687                    }
3688                }
3689
3690                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3691            }
3692            unsafe {
3693                preallocated.write_next(out.assume_init_ref());
3694            }
3695        }
3696
3697        ::fidl_next::WireTable::encode_len(table, max_ord);
3698
3699        Ok(())
3700    }
3701}
3702
3703impl ::fidl_next::TakeFrom<WireCompositeInfo> for CompositeInfo {
3704    #[inline]
3705    fn take_from(from: &WireCompositeInfo) -> Self {
3706        Self {
3707            spec: from.spec().map(::fidl_next::TakeFrom::take_from),
3708
3709            matched_driver: from.matched_driver().map(::fidl_next::TakeFrom::take_from),
3710        }
3711    }
3712}
3713
3714/// The wire type corresponding to [`CompositeInfo`].
3715#[repr(C)]
3716pub struct WireCompositeInfo {
3717    table: ::fidl_next::WireTable,
3718}
3719
3720unsafe impl ::fidl_next::ZeroPadding for WireCompositeInfo {
3721    #[inline]
3722    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3723        ::fidl_next::munge!(let Self { table } = out);
3724        ::fidl_next::WireTable::zero_padding(table);
3725    }
3726}
3727
3728unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeInfo
3729where
3730    ___D: ::fidl_next::Decoder + ?Sized,
3731{
3732    fn decode(
3733        slot: ::fidl_next::Slot<'_, Self>,
3734        decoder: &mut ___D,
3735    ) -> Result<(), ::fidl_next::DecodeError> {
3736        ::fidl_next::munge!(let Self { table } = slot);
3737
3738        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3739            match ordinal {
3740                0 => unsafe { ::core::hint::unreachable_unchecked() },
3741
3742                1 => {
3743                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireCompositeNodeSpec>(
3744                        slot.as_mut(),
3745                        decoder,
3746                    )?;
3747
3748                    Ok(())
3749                }
3750
3751                2 => {
3752                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireCompositeDriverMatch>(
3753                        slot.as_mut(),
3754                        decoder,
3755                    )?;
3756
3757                    Ok(())
3758                }
3759
3760                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3761            }
3762        })
3763    }
3764}
3765
3766impl WireCompositeInfo {
3767    pub fn spec(&self) -> Option<&crate::WireCompositeNodeSpec> {
3768        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3769    }
3770
3771    pub fn matched_driver(&self) -> Option<&crate::WireCompositeDriverMatch> {
3772        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3773    }
3774}
3775
3776impl ::core::fmt::Debug for WireCompositeInfo {
3777    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3778        f.debug_struct("CompositeInfo")
3779            .field("spec", &self.spec())
3780            .field("matched_driver", &self.matched_driver())
3781            .finish()
3782    }
3783}
3784
3785pub type CompositeNodeManagerAddSpecResponse = ();
3786
3787/// The wire type corresponding to [`CompositeNodeManagerAddSpecResponse`].
3788pub type WireCompositeNodeManagerAddSpecResponse = ();
3789
3790#[doc = " Error codes for the CompositeNodeManager protocol.\n"]
3791#[derive(Clone, Copy, Debug, PartialEq, Eq)]
3792#[repr(u32)]
3793pub enum CompositeNodeSpecError {
3794    MissingArgs = 1,
3795    EmptyNodes = 2,
3796    AlreadyExists = 3,
3797    DriverIndexFailure = 4,
3798    DuplicateParents = 5,
3799    UnknownOrdinal_(u32),
3800}
3801
3802impl ::fidl_next::Encodable for CompositeNodeSpecError {
3803    type Encoded = WireCompositeNodeSpecError;
3804}
3805impl ::std::convert::From<u32> for CompositeNodeSpecError {
3806    fn from(value: u32) -> Self {
3807        match value {
3808            1 => Self::MissingArgs,
3809            2 => Self::EmptyNodes,
3810            3 => Self::AlreadyExists,
3811            4 => Self::DriverIndexFailure,
3812            5 => Self::DuplicateParents,
3813
3814            _ => Self::UnknownOrdinal_(value),
3815        }
3816    }
3817}
3818
3819unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeNodeSpecError
3820where
3821    ___E: ?Sized,
3822{
3823    #[inline]
3824    fn encode(
3825        &mut self,
3826        _: &mut ___E,
3827        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3828    ) -> Result<(), ::fidl_next::EncodeError> {
3829        ::fidl_next::munge!(let WireCompositeNodeSpecError { value } = out);
3830        let _ = value.write(::fidl_next::WireU32::from(match *self {
3831            Self::MissingArgs => 1,
3832
3833            Self::EmptyNodes => 2,
3834
3835            Self::AlreadyExists => 3,
3836
3837            Self::DriverIndexFailure => 4,
3838
3839            Self::DuplicateParents => 5,
3840
3841            Self::UnknownOrdinal_(value) => value,
3842        }));
3843
3844        Ok(())
3845    }
3846}
3847
3848impl ::core::convert::From<WireCompositeNodeSpecError> for CompositeNodeSpecError {
3849    fn from(wire: WireCompositeNodeSpecError) -> Self {
3850        match u32::from(wire.value) {
3851            1 => Self::MissingArgs,
3852
3853            2 => Self::EmptyNodes,
3854
3855            3 => Self::AlreadyExists,
3856
3857            4 => Self::DriverIndexFailure,
3858
3859            5 => Self::DuplicateParents,
3860
3861            value => Self::UnknownOrdinal_(value),
3862        }
3863    }
3864}
3865
3866impl ::fidl_next::TakeFrom<WireCompositeNodeSpecError> for CompositeNodeSpecError {
3867    #[inline]
3868    fn take_from(from: &WireCompositeNodeSpecError) -> Self {
3869        Self::from(*from)
3870    }
3871}
3872
3873/// The wire type corresponding to [`CompositeNodeSpecError`].
3874#[derive(Clone, Copy, Debug, PartialEq, Eq)]
3875#[repr(transparent)]
3876pub struct WireCompositeNodeSpecError {
3877    value: ::fidl_next::WireU32,
3878}
3879
3880unsafe impl ::fidl_next::ZeroPadding for WireCompositeNodeSpecError {
3881    #[inline]
3882    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3883        // Wire enums have no padding
3884    }
3885}
3886
3887impl WireCompositeNodeSpecError {
3888    pub const MISSING_ARGS: WireCompositeNodeSpecError =
3889        WireCompositeNodeSpecError { value: ::fidl_next::WireU32(1) };
3890
3891    pub const EMPTY_NODES: WireCompositeNodeSpecError =
3892        WireCompositeNodeSpecError { value: ::fidl_next::WireU32(2) };
3893
3894    pub const ALREADY_EXISTS: WireCompositeNodeSpecError =
3895        WireCompositeNodeSpecError { value: ::fidl_next::WireU32(3) };
3896
3897    pub const DRIVER_INDEX_FAILURE: WireCompositeNodeSpecError =
3898        WireCompositeNodeSpecError { value: ::fidl_next::WireU32(4) };
3899
3900    pub const DUPLICATE_PARENTS: WireCompositeNodeSpecError =
3901        WireCompositeNodeSpecError { value: ::fidl_next::WireU32(5) };
3902}
3903
3904unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeNodeSpecError
3905where
3906    ___D: ?Sized,
3907{
3908    fn decode(
3909        slot: ::fidl_next::Slot<'_, Self>,
3910        _: &mut ___D,
3911    ) -> Result<(), ::fidl_next::DecodeError> {
3912        Ok(())
3913    }
3914}
3915
3916impl ::core::convert::From<CompositeNodeSpecError> for WireCompositeNodeSpecError {
3917    fn from(natural: CompositeNodeSpecError) -> Self {
3918        match natural {
3919            CompositeNodeSpecError::MissingArgs => WireCompositeNodeSpecError::MISSING_ARGS,
3920
3921            CompositeNodeSpecError::EmptyNodes => WireCompositeNodeSpecError::EMPTY_NODES,
3922
3923            CompositeNodeSpecError::AlreadyExists => WireCompositeNodeSpecError::ALREADY_EXISTS,
3924
3925            CompositeNodeSpecError::DriverIndexFailure => {
3926                WireCompositeNodeSpecError::DRIVER_INDEX_FAILURE
3927            }
3928
3929            CompositeNodeSpecError::DuplicateParents => {
3930                WireCompositeNodeSpecError::DUPLICATE_PARENTS
3931            }
3932
3933            CompositeNodeSpecError::UnknownOrdinal_(value) => {
3934                WireCompositeNodeSpecError { value: ::fidl_next::WireU32::from(value) }
3935            }
3936        }
3937    }
3938}
3939
3940/// The type corresponding to the CompositeNodeManager protocol.
3941#[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"]
3942#[derive(Debug)]
3943pub struct CompositeNodeManager;
3944
3945impl ::fidl_next::Discoverable for CompositeNodeManager {
3946    const PROTOCOL_NAME: &'static str = "composite_node_manager";
3947}
3948
3949pub mod composite_node_manager {
3950    pub mod prelude {
3951        pub use crate::{
3952            composite_node_manager, CompositeNodeManager, CompositeNodeManagerClientHandler,
3953            CompositeNodeManagerClientSender, CompositeNodeManagerServerHandler,
3954            CompositeNodeManagerServerSender,
3955        };
3956
3957        pub use crate::CompositeNodeManagerAddSpecResponse;
3958
3959        pub use crate::CompositeNodeSpec;
3960
3961        pub use crate::CompositeNodeSpecError;
3962    }
3963
3964    pub struct AddSpec;
3965
3966    impl ::fidl_next::Method for AddSpec {
3967        const ORDINAL: u64 = 5930736293275290740;
3968
3969        type Protocol = crate::CompositeNodeManager;
3970
3971        type Request = crate::WireCompositeNodeSpec;
3972
3973        type Response = ::fidl_next::WireFlexibleResult<
3974            crate::WireCompositeNodeManagerAddSpecResponse,
3975            crate::WireCompositeNodeSpecError,
3976        >;
3977    }
3978}
3979
3980/// A helper trait for the `CompositeNodeManager` client sender.
3981pub trait CompositeNodeManagerClientSender {
3982    type Transport: ::fidl_next::Transport;
3983
3984    #[doc = " Adds the given composite node specification to the driver framework.\n"]
3985    fn add_spec<___R>(
3986        &self,
3987        request: &mut ___R,
3988    ) -> Result<
3989        ::fidl_next::ResponseFuture<'_, Self::Transport, composite_node_manager::AddSpec>,
3990        ::fidl_next::EncodeError,
3991    >
3992    where
3993        ___R: ::fidl_next::Encode<
3994            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
3995            Encoded = crate::WireCompositeNodeSpec,
3996        >;
3997}
3998
3999impl<___T> CompositeNodeManagerClientSender
4000    for ::fidl_next::ClientSender<___T, CompositeNodeManager>
4001where
4002    ___T: ::fidl_next::Transport,
4003{
4004    type Transport = ___T;
4005
4006    #[doc = " Adds the given composite node specification to the driver framework.\n"]
4007    fn add_spec<___R>(
4008        &self,
4009        request: &mut ___R,
4010    ) -> Result<
4011        ::fidl_next::ResponseFuture<'_, Self::Transport, composite_node_manager::AddSpec>,
4012        ::fidl_next::EncodeError,
4013    >
4014    where
4015        ___R: ::fidl_next::Encode<
4016            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
4017            Encoded = crate::WireCompositeNodeSpec,
4018        >,
4019    {
4020        self.as_untyped()
4021            .send_two_way(5930736293275290740, request)
4022            .map(::fidl_next::ResponseFuture::from_untyped)
4023    }
4024}
4025
4026/// A client handler for the CompositeNodeManager protocol.
4027///
4028/// See [`CompositeNodeManager`] for more details.
4029pub trait CompositeNodeManagerClientHandler<___T: ::fidl_next::Transport> {
4030    fn on_unknown_interaction(
4031        &mut self,
4032        sender: &::fidl_next::ClientSender<___T, CompositeNodeManager>,
4033        ordinal: u64,
4034    ) {
4035        sender.close();
4036    }
4037}
4038
4039impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for CompositeNodeManager
4040where
4041    ___T: ::fidl_next::Transport,
4042    ___H: CompositeNodeManagerClientHandler<___T>,
4043
4044    <composite_node_manager::AddSpec as ::fidl_next::Method>::Response:
4045        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
4046{
4047    fn on_event(
4048        handler: &mut ___H,
4049        sender: &::fidl_next::ClientSender<___T, Self>,
4050        ordinal: u64,
4051        buffer: ___T::RecvBuffer,
4052    ) {
4053        match ordinal {
4054            ordinal => handler.on_unknown_interaction(sender, ordinal),
4055        }
4056    }
4057}
4058
4059/// A helper trait for the `CompositeNodeManager` server sender.
4060pub trait CompositeNodeManagerServerSender {
4061    type Transport: ::fidl_next::Transport;
4062}
4063
4064impl<___T> CompositeNodeManagerServerSender
4065    for ::fidl_next::ServerSender<___T, CompositeNodeManager>
4066where
4067    ___T: ::fidl_next::Transport,
4068{
4069    type Transport = ___T;
4070}
4071
4072/// A server handler for the CompositeNodeManager protocol.
4073///
4074/// See [`CompositeNodeManager`] for more details.
4075pub trait CompositeNodeManagerServerHandler<___T: ::fidl_next::Transport> {
4076    #[doc = " Adds the given composite node specification to the driver framework.\n"]
4077    fn add_spec(
4078        &mut self,
4079        sender: &::fidl_next::ServerSender<___T, CompositeNodeManager>,
4080
4081        request: ::fidl_next::Request<___T, composite_node_manager::AddSpec>,
4082
4083        responder: ::fidl_next::Responder<composite_node_manager::AddSpec>,
4084    );
4085
4086    fn on_unknown_interaction(
4087        &mut self,
4088        sender: &::fidl_next::ServerSender<___T, CompositeNodeManager>,
4089        ordinal: u64,
4090    ) {
4091        sender.close();
4092    }
4093}
4094
4095impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for CompositeNodeManager
4096where
4097    ___T: ::fidl_next::Transport,
4098    ___H: CompositeNodeManagerServerHandler<___T>,
4099
4100    crate::WireCompositeNodeSpec: ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
4101{
4102    fn on_one_way(
4103        handler: &mut ___H,
4104        sender: &::fidl_next::ServerSender<___T, Self>,
4105        ordinal: u64,
4106        buffer: ___T::RecvBuffer,
4107    ) {
4108        match ordinal {
4109            ordinal => handler.on_unknown_interaction(sender, ordinal),
4110        }
4111    }
4112
4113    fn on_two_way(
4114        handler: &mut ___H,
4115        sender: &::fidl_next::ServerSender<___T, Self>,
4116        ordinal: u64,
4117        buffer: ___T::RecvBuffer,
4118        responder: ::fidl_next::protocol::Responder,
4119    ) {
4120        match ordinal {
4121            5930736293275290740 => {
4122                let responder = ::fidl_next::Responder::from_untyped(responder);
4123
4124                match ::fidl_next::DecoderExt::decode(buffer) {
4125                    Ok(decoded) => handler.add_spec(sender, decoded, responder),
4126                    Err(e) => {
4127                        sender.close();
4128                    }
4129                }
4130            }
4131
4132            ordinal => handler.on_unknown_interaction(sender, ordinal),
4133        }
4134    }
4135}
4136
4137#[doc = " A parent to a composite that is defined by a composite node spec.\n"]
4138#[derive(Clone, Debug, Default)]
4139pub struct CompositeParent {
4140    pub composite: Option<crate::CompositeInfo>,
4141
4142    pub index: Option<u32>,
4143}
4144
4145impl CompositeParent {
4146    fn __max_ordinal(&self) -> usize {
4147        if self.composite.is_some() {
4148            return 1;
4149        }
4150
4151        if self.index.is_some() {
4152            return 2;
4153        }
4154
4155        0
4156    }
4157}
4158
4159impl ::fidl_next::Encodable for CompositeParent {
4160    type Encoded = WireCompositeParent;
4161}
4162
4163unsafe impl<___E> ::fidl_next::Encode<___E> for CompositeParent
4164where
4165    ___E: ::fidl_next::Encoder + ?Sized,
4166{
4167    #[inline]
4168    fn encode(
4169        &mut self,
4170        encoder: &mut ___E,
4171        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4172    ) -> Result<(), ::fidl_next::EncodeError> {
4173        ::fidl_next::munge!(let WireCompositeParent { table } = out);
4174
4175        let max_ord = self.__max_ordinal();
4176
4177        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4178        ::fidl_next::ZeroPadding::zero_padding(&mut out);
4179
4180        let mut preallocated =
4181            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4182
4183        for i in 1..=max_ord {
4184            match i {
4185                2 => {
4186                    if let Some(index) = &mut self.index {
4187                        ::fidl_next::WireEnvelope::encode_value(
4188                            index,
4189                            preallocated.encoder,
4190                            &mut out,
4191                        )?;
4192                    } else {
4193                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4194                    }
4195                }
4196
4197                1 => {
4198                    if let Some(composite) = &mut self.composite {
4199                        ::fidl_next::WireEnvelope::encode_value(
4200                            composite,
4201                            preallocated.encoder,
4202                            &mut out,
4203                        )?;
4204                    } else {
4205                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4206                    }
4207                }
4208
4209                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4210            }
4211            unsafe {
4212                preallocated.write_next(out.assume_init_ref());
4213            }
4214        }
4215
4216        ::fidl_next::WireTable::encode_len(table, max_ord);
4217
4218        Ok(())
4219    }
4220}
4221
4222impl ::fidl_next::TakeFrom<WireCompositeParent> for CompositeParent {
4223    #[inline]
4224    fn take_from(from: &WireCompositeParent) -> Self {
4225        Self {
4226            composite: from.composite().map(::fidl_next::TakeFrom::take_from),
4227
4228            index: from.index().map(::fidl_next::TakeFrom::take_from),
4229        }
4230    }
4231}
4232
4233/// The wire type corresponding to [`CompositeParent`].
4234#[repr(C)]
4235pub struct WireCompositeParent {
4236    table: ::fidl_next::WireTable,
4237}
4238
4239unsafe impl ::fidl_next::ZeroPadding for WireCompositeParent {
4240    #[inline]
4241    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4242        ::fidl_next::munge!(let Self { table } = out);
4243        ::fidl_next::WireTable::zero_padding(table);
4244    }
4245}
4246
4247unsafe impl<___D> ::fidl_next::Decode<___D> for WireCompositeParent
4248where
4249    ___D: ::fidl_next::Decoder + ?Sized,
4250{
4251    fn decode(
4252        slot: ::fidl_next::Slot<'_, Self>,
4253        decoder: &mut ___D,
4254    ) -> Result<(), ::fidl_next::DecodeError> {
4255        ::fidl_next::munge!(let Self { table } = slot);
4256
4257        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4258            match ordinal {
4259                0 => unsafe { ::core::hint::unreachable_unchecked() },
4260
4261                1 => {
4262                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireCompositeInfo>(
4263                        slot.as_mut(),
4264                        decoder,
4265                    )?;
4266
4267                    Ok(())
4268                }
4269
4270                2 => {
4271                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
4272                        slot.as_mut(),
4273                        decoder,
4274                    )?;
4275
4276                    Ok(())
4277                }
4278
4279                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
4280            }
4281        })
4282    }
4283}
4284
4285impl WireCompositeParent {
4286    pub fn composite(&self) -> Option<&crate::WireCompositeInfo> {
4287        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4288    }
4289
4290    pub fn index(&self) -> Option<&::fidl_next::WireU32> {
4291        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4292    }
4293}
4294
4295impl ::core::fmt::Debug for WireCompositeParent {
4296    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
4297        f.debug_struct("CompositeParent")
4298            .field("composite", &self.composite())
4299            .field("index", &self.index())
4300            .finish()
4301    }
4302}
4303
4304#[derive(Debug, Default)]
4305pub struct DevfsAddArgs {
4306    pub connector: Option<
4307        ::fidl_next::ClientEnd<
4308            ::fidl_next::fuchsia::zx::Channel,
4309            ::fidl_next_fuchsia_device_fs::Connector,
4310        >,
4311    >,
4312
4313    pub class_name: Option<String>,
4314
4315    pub inspect: Option<::fidl_next::fuchsia::zx::Handle>,
4316
4317    pub connector_supports: Option<::fidl_next_fuchsia_device_fs::ConnectionType>,
4318
4319    pub controller_connector: Option<
4320        ::fidl_next::ClientEnd<
4321            ::fidl_next::fuchsia::zx::Channel,
4322            ::fidl_next_fuchsia_device_fs::Connector,
4323        >,
4324    >,
4325}
4326
4327impl DevfsAddArgs {
4328    fn __max_ordinal(&self) -> usize {
4329        if self.connector.is_some() {
4330            return 1;
4331        }
4332
4333        if self.class_name.is_some() {
4334            return 2;
4335        }
4336
4337        if self.inspect.is_some() {
4338            return 3;
4339        }
4340
4341        if self.connector_supports.is_some() {
4342            return 4;
4343        }
4344
4345        if self.controller_connector.is_some() {
4346            return 5;
4347        }
4348
4349        0
4350    }
4351}
4352
4353impl ::fidl_next::Encodable for DevfsAddArgs {
4354    type Encoded = WireDevfsAddArgs;
4355}
4356
4357unsafe impl<___E> ::fidl_next::Encode<___E> for DevfsAddArgs
4358where
4359    ___E: ::fidl_next::Encoder + ?Sized,
4360
4361    ___E: ::fidl_next::fuchsia::HandleEncoder,
4362{
4363    #[inline]
4364    fn encode(
4365        &mut self,
4366        encoder: &mut ___E,
4367        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4368    ) -> Result<(), ::fidl_next::EncodeError> {
4369        ::fidl_next::munge!(let WireDevfsAddArgs { table } = out);
4370
4371        let max_ord = self.__max_ordinal();
4372
4373        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4374        ::fidl_next::ZeroPadding::zero_padding(&mut out);
4375
4376        let mut preallocated =
4377            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4378
4379        for i in 1..=max_ord {
4380            match i {
4381                5 => {
4382                    if let Some(controller_connector) = &mut self.controller_connector {
4383                        ::fidl_next::WireEnvelope::encode_value(
4384                            controller_connector,
4385                            preallocated.encoder,
4386                            &mut out,
4387                        )?;
4388                    } else {
4389                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4390                    }
4391                }
4392
4393                4 => {
4394                    if let Some(connector_supports) = &mut self.connector_supports {
4395                        ::fidl_next::WireEnvelope::encode_value(
4396                            connector_supports,
4397                            preallocated.encoder,
4398                            &mut out,
4399                        )?;
4400                    } else {
4401                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4402                    }
4403                }
4404
4405                3 => {
4406                    if let Some(inspect) = &mut self.inspect {
4407                        ::fidl_next::WireEnvelope::encode_value(
4408                            inspect,
4409                            preallocated.encoder,
4410                            &mut out,
4411                        )?;
4412                    } else {
4413                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4414                    }
4415                }
4416
4417                2 => {
4418                    if let Some(class_name) = &mut self.class_name {
4419                        ::fidl_next::WireEnvelope::encode_value(
4420                            class_name,
4421                            preallocated.encoder,
4422                            &mut out,
4423                        )?;
4424                    } else {
4425                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4426                    }
4427                }
4428
4429                1 => {
4430                    if let Some(connector) = &mut self.connector {
4431                        ::fidl_next::WireEnvelope::encode_value(
4432                            connector,
4433                            preallocated.encoder,
4434                            &mut out,
4435                        )?;
4436                    } else {
4437                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4438                    }
4439                }
4440
4441                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4442            }
4443            unsafe {
4444                preallocated.write_next(out.assume_init_ref());
4445            }
4446        }
4447
4448        ::fidl_next::WireTable::encode_len(table, max_ord);
4449
4450        Ok(())
4451    }
4452}
4453
4454impl ::fidl_next::TakeFrom<WireDevfsAddArgs> for DevfsAddArgs {
4455    #[inline]
4456    fn take_from(from: &WireDevfsAddArgs) -> Self {
4457        Self {
4458            connector: from.connector().map(::fidl_next::TakeFrom::take_from),
4459
4460            class_name: from.class_name().map(::fidl_next::TakeFrom::take_from),
4461
4462            inspect: from.inspect().map(::fidl_next::TakeFrom::take_from),
4463
4464            connector_supports: from.connector_supports().map(::fidl_next::TakeFrom::take_from),
4465
4466            controller_connector: from.controller_connector().map(::fidl_next::TakeFrom::take_from),
4467        }
4468    }
4469}
4470
4471/// The wire type corresponding to [`DevfsAddArgs`].
4472#[repr(C)]
4473pub struct WireDevfsAddArgs {
4474    table: ::fidl_next::WireTable,
4475}
4476
4477unsafe impl ::fidl_next::ZeroPadding for WireDevfsAddArgs {
4478    #[inline]
4479    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4480        ::fidl_next::munge!(let Self { table } = out);
4481        ::fidl_next::WireTable::zero_padding(table);
4482    }
4483}
4484
4485unsafe impl<___D> ::fidl_next::Decode<___D> for WireDevfsAddArgs
4486where
4487    ___D: ::fidl_next::Decoder + ?Sized,
4488
4489    ___D: ::fidl_next::fuchsia::HandleDecoder,
4490{
4491    fn decode(
4492        slot: ::fidl_next::Slot<'_, Self>,
4493        decoder: &mut ___D,
4494    ) -> Result<(), ::fidl_next::DecodeError> {
4495        ::fidl_next::munge!(let Self { table } = slot);
4496
4497        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4498            match ordinal {
4499                0 => unsafe { ::core::hint::unreachable_unchecked() },
4500
4501                1 => {
4502                    ::fidl_next::WireEnvelope::decode_as::<
4503                        ___D,
4504                        ::fidl_next::ClientEnd<
4505                            ::fidl_next::fuchsia::WireChannel,
4506                            ::fidl_next_fuchsia_device_fs::Connector,
4507                        >,
4508                    >(slot.as_mut(), decoder)?;
4509
4510                    Ok(())
4511                }
4512
4513                2 => {
4514                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
4515                        slot.as_mut(),
4516                        decoder,
4517                    )?;
4518
4519                    let class_name = unsafe {
4520                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
4521                    };
4522
4523                    if class_name.len() > 255 {
4524                        return Err(::fidl_next::DecodeError::VectorTooLong {
4525                            size: class_name.len() as u64,
4526                            limit: 255,
4527                        });
4528                    }
4529
4530                    Ok(())
4531                }
4532
4533                3 => {
4534                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
4535                        slot.as_mut(),
4536                        decoder,
4537                    )?;
4538
4539                    Ok(())
4540                }
4541
4542                4 => {
4543                    ::fidl_next::WireEnvelope::decode_as::<
4544                        ___D,
4545                        ::fidl_next_fuchsia_device_fs::WireConnectionType,
4546                    >(slot.as_mut(), decoder)?;
4547
4548                    Ok(())
4549                }
4550
4551                5 => {
4552                    ::fidl_next::WireEnvelope::decode_as::<
4553                        ___D,
4554                        ::fidl_next::ClientEnd<
4555                            ::fidl_next::fuchsia::WireChannel,
4556                            ::fidl_next_fuchsia_device_fs::Connector,
4557                        >,
4558                    >(slot.as_mut(), decoder)?;
4559
4560                    Ok(())
4561                }
4562
4563                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
4564            }
4565        })
4566    }
4567}
4568
4569impl WireDevfsAddArgs {
4570    pub fn connector(
4571        &self,
4572    ) -> Option<
4573        &::fidl_next::ClientEnd<
4574            ::fidl_next::fuchsia::WireChannel,
4575            ::fidl_next_fuchsia_device_fs::Connector,
4576        >,
4577    > {
4578        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4579    }
4580
4581    pub fn class_name(&self) -> Option<&::fidl_next::WireString> {
4582        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4583    }
4584
4585    pub fn inspect(&self) -> Option<&::fidl_next::fuchsia::WireHandle> {
4586        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
4587    }
4588
4589    pub fn connector_supports(&self) -> Option<&::fidl_next_fuchsia_device_fs::WireConnectionType> {
4590        unsafe { Some(self.table.get(4)?.deref_unchecked()) }
4591    }
4592
4593    pub fn controller_connector(
4594        &self,
4595    ) -> Option<
4596        &::fidl_next::ClientEnd<
4597            ::fidl_next::fuchsia::WireChannel,
4598            ::fidl_next_fuchsia_device_fs::Connector,
4599        >,
4600    > {
4601        unsafe { Some(self.table.get(5)?.deref_unchecked()) }
4602    }
4603}
4604
4605impl ::core::fmt::Debug for WireDevfsAddArgs {
4606    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
4607        f.debug_struct("DevfsAddArgs")
4608            .field("connector", &self.connector())
4609            .field("class_name", &self.class_name())
4610            .field("inspect", &self.inspect())
4611            .field("connector_supports", &self.connector_supports())
4612            .field("controller_connector", &self.controller_connector())
4613            .finish()
4614    }
4615}
4616
4617pub const MAX_SYMBOL_NAME_LENGTH: u8 = 128;
4618
4619pub const MAX_SYMBOL_COUNT: u8 = 64;
4620
4621pub const MAX_NAMESPACE_COUNT: u32 = 32;
4622
4623pub type DriverStartResponse = ();
4624
4625/// The wire type corresponding to [`DriverStartResponse`].
4626pub type WireDriverStartResponse = ();
4627
4628pub const MAX_NODE_NAME_LENGTH: u8 = 128;
4629
4630pub type NodeName = String;
4631
4632/// The wire type corresponding to [`NodeName`].
4633pub type WireNodeName = ::fidl_next::WireString;
4634
4635pub type NodePropertyVector = Vec<crate::NodeProperty>;
4636
4637/// The wire type corresponding to [`NodePropertyVector`].
4638pub type WireNodePropertyVector = ::fidl_next::WireVector<crate::WireNodeProperty>;
4639
4640pub const MAX_OFFER_COUNT: u32 = 128;
4641
4642#[doc = " Contains the node properties that belong to a node.\n"]
4643#[derive(Clone, Debug)]
4644pub struct NodePropertyEntry {
4645    pub name: String,
4646
4647    pub properties: Vec<crate::NodeProperty>,
4648}
4649
4650impl ::fidl_next::Encodable for NodePropertyEntry {
4651    type Encoded = WireNodePropertyEntry;
4652}
4653
4654unsafe impl<___E> ::fidl_next::Encode<___E> for NodePropertyEntry
4655where
4656    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4657
4658    ___E: ::fidl_next::Encoder,
4659{
4660    #[inline]
4661    fn encode(
4662        &mut self,
4663        encoder: &mut ___E,
4664        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4665    ) -> Result<(), ::fidl_next::EncodeError> {
4666        ::fidl_next::munge! {
4667            let Self::Encoded {
4668                name,
4669                properties,
4670
4671            } = out;
4672        }
4673
4674        ::fidl_next::Encode::encode(&mut self.name, encoder, name)?;
4675
4676        ::fidl_next::Encode::encode(&mut self.properties, encoder, properties)?;
4677
4678        Ok(())
4679    }
4680}
4681
4682impl ::fidl_next::EncodableOption for Box<NodePropertyEntry> {
4683    type EncodedOption = ::fidl_next::WireBox<WireNodePropertyEntry>;
4684}
4685
4686unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodePropertyEntry>
4687where
4688    ___E: ::fidl_next::Encoder + ?Sized,
4689    NodePropertyEntry: ::fidl_next::Encode<___E>,
4690{
4691    #[inline]
4692    fn encode_option(
4693        this: Option<&mut Self>,
4694        encoder: &mut ___E,
4695        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4696    ) -> Result<(), ::fidl_next::EncodeError> {
4697        if let Some(inner) = this {
4698            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4699            ::fidl_next::WireBox::encode_present(out);
4700        } else {
4701            ::fidl_next::WireBox::encode_absent(out);
4702        }
4703
4704        Ok(())
4705    }
4706}
4707
4708impl ::fidl_next::TakeFrom<WireNodePropertyEntry> for NodePropertyEntry {
4709    #[inline]
4710    fn take_from(from: &WireNodePropertyEntry) -> Self {
4711        Self {
4712            name: ::fidl_next::TakeFrom::take_from(&from.name),
4713
4714            properties: ::fidl_next::TakeFrom::take_from(&from.properties),
4715        }
4716    }
4717}
4718
4719/// The wire type corresponding to [`NodePropertyEntry`].
4720#[derive(Debug)]
4721#[repr(C)]
4722pub struct WireNodePropertyEntry {
4723    pub name: ::fidl_next::WireString,
4724
4725    pub properties: ::fidl_next::WireVector<crate::WireNodeProperty>,
4726}
4727
4728unsafe impl ::fidl_next::ZeroPadding for WireNodePropertyEntry {
4729    #[inline]
4730    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4731}
4732
4733unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodePropertyEntry
4734where
4735    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4736
4737    ___D: ::fidl_next::Decoder,
4738{
4739    fn decode(
4740        slot: ::fidl_next::Slot<'_, Self>,
4741        decoder: &mut ___D,
4742    ) -> Result<(), ::fidl_next::DecodeError> {
4743        ::fidl_next::munge! {
4744            let Self {
4745                mut name,
4746                mut properties,
4747
4748            } = slot;
4749        }
4750
4751        ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
4752
4753        let name = unsafe { name.deref_unchecked() };
4754
4755        if name.len() > 128 {
4756            return Err(::fidl_next::DecodeError::VectorTooLong {
4757                size: name.len() as u64,
4758                limit: 128,
4759            });
4760        }
4761
4762        ::fidl_next::Decode::decode(properties.as_mut(), decoder)?;
4763
4764        let properties = unsafe { properties.deref_unchecked() };
4765
4766        if properties.len() > 64 {
4767            return Err(::fidl_next::DecodeError::VectorTooLong {
4768                size: properties.len() as u64,
4769                limit: 64,
4770            });
4771        }
4772
4773        Ok(())
4774    }
4775}
4776
4777pub type NodePropertyDictionary = Vec<crate::NodePropertyEntry>;
4778
4779/// The wire type corresponding to [`NodePropertyDictionary`].
4780pub type WireNodePropertyDictionary = ::fidl_next::WireVector<crate::WireNodePropertyEntry>;
4781
4782pub type NodeProperties = Vec<crate::NodeProperty2>;
4783
4784/// The wire type corresponding to [`NodeProperties`].
4785pub type WireNodeProperties = ::fidl_next::WireVector<crate::WireNodeProperty2>;
4786
4787#[doc = " Contains the node properties that belong to a node.\n"]
4788#[derive(Clone, Debug)]
4789pub struct NodePropertyEntry2 {
4790    pub name: String,
4791
4792    pub properties: Vec<crate::NodeProperty2>,
4793}
4794
4795impl ::fidl_next::Encodable for NodePropertyEntry2 {
4796    type Encoded = WireNodePropertyEntry2;
4797}
4798
4799unsafe impl<___E> ::fidl_next::Encode<___E> for NodePropertyEntry2
4800where
4801    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4802
4803    ___E: ::fidl_next::Encoder,
4804{
4805    #[inline]
4806    fn encode(
4807        &mut self,
4808        encoder: &mut ___E,
4809        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4810    ) -> Result<(), ::fidl_next::EncodeError> {
4811        ::fidl_next::munge! {
4812            let Self::Encoded {
4813                name,
4814                properties,
4815
4816            } = out;
4817        }
4818
4819        ::fidl_next::Encode::encode(&mut self.name, encoder, name)?;
4820
4821        ::fidl_next::Encode::encode(&mut self.properties, encoder, properties)?;
4822
4823        Ok(())
4824    }
4825}
4826
4827impl ::fidl_next::EncodableOption for Box<NodePropertyEntry2> {
4828    type EncodedOption = ::fidl_next::WireBox<WireNodePropertyEntry2>;
4829}
4830
4831unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodePropertyEntry2>
4832where
4833    ___E: ::fidl_next::Encoder + ?Sized,
4834    NodePropertyEntry2: ::fidl_next::Encode<___E>,
4835{
4836    #[inline]
4837    fn encode_option(
4838        this: Option<&mut Self>,
4839        encoder: &mut ___E,
4840        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4841    ) -> Result<(), ::fidl_next::EncodeError> {
4842        if let Some(inner) = this {
4843            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4844            ::fidl_next::WireBox::encode_present(out);
4845        } else {
4846            ::fidl_next::WireBox::encode_absent(out);
4847        }
4848
4849        Ok(())
4850    }
4851}
4852
4853impl ::fidl_next::TakeFrom<WireNodePropertyEntry2> for NodePropertyEntry2 {
4854    #[inline]
4855    fn take_from(from: &WireNodePropertyEntry2) -> Self {
4856        Self {
4857            name: ::fidl_next::TakeFrom::take_from(&from.name),
4858
4859            properties: ::fidl_next::TakeFrom::take_from(&from.properties),
4860        }
4861    }
4862}
4863
4864/// The wire type corresponding to [`NodePropertyEntry2`].
4865#[derive(Debug)]
4866#[repr(C)]
4867pub struct WireNodePropertyEntry2 {
4868    pub name: ::fidl_next::WireString,
4869
4870    pub properties: ::fidl_next::WireVector<crate::WireNodeProperty2>,
4871}
4872
4873unsafe impl ::fidl_next::ZeroPadding for WireNodePropertyEntry2 {
4874    #[inline]
4875    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4876}
4877
4878unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodePropertyEntry2
4879where
4880    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4881
4882    ___D: ::fidl_next::Decoder,
4883{
4884    fn decode(
4885        slot: ::fidl_next::Slot<'_, Self>,
4886        decoder: &mut ___D,
4887    ) -> Result<(), ::fidl_next::DecodeError> {
4888        ::fidl_next::munge! {
4889            let Self {
4890                mut name,
4891                mut properties,
4892
4893            } = slot;
4894        }
4895
4896        ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
4897
4898        let name = unsafe { name.deref_unchecked() };
4899
4900        if name.len() > 128 {
4901            return Err(::fidl_next::DecodeError::VectorTooLong {
4902                size: name.len() as u64,
4903                limit: 128,
4904            });
4905        }
4906
4907        ::fidl_next::Decode::decode(properties.as_mut(), decoder)?;
4908
4909        let properties = unsafe { properties.deref_unchecked() };
4910
4911        if properties.len() > 64 {
4912            return Err(::fidl_next::DecodeError::VectorTooLong {
4913                size: properties.len() as u64,
4914                limit: 64,
4915            });
4916        }
4917
4918        Ok(())
4919    }
4920}
4921
4922pub type NodePropertyDictionary2 = Vec<crate::NodePropertyEntry2>;
4923
4924/// The wire type corresponding to [`NodePropertyDictionary2`].
4925pub type WireNodePropertyDictionary2 = ::fidl_next::WireVector<crate::WireNodePropertyEntry2>;
4926
4927pub const MAX_MODULE_NAME_LENGTH: u8 = 128;
4928
4929#[doc = " Definition of a symbol provided by a driver for a node. A symbol is local to\n a driver host.\n"]
4930#[derive(Clone, Debug, Default)]
4931pub struct NodeSymbol {
4932    pub name: Option<String>,
4933
4934    pub address: Option<u64>,
4935
4936    pub module_name: Option<String>,
4937}
4938
4939impl NodeSymbol {
4940    fn __max_ordinal(&self) -> usize {
4941        if self.name.is_some() {
4942            return 1;
4943        }
4944
4945        if self.address.is_some() {
4946            return 2;
4947        }
4948
4949        if self.module_name.is_some() {
4950            return 3;
4951        }
4952
4953        0
4954    }
4955}
4956
4957impl ::fidl_next::Encodable for NodeSymbol {
4958    type Encoded = WireNodeSymbol;
4959}
4960
4961unsafe impl<___E> ::fidl_next::Encode<___E> for NodeSymbol
4962where
4963    ___E: ::fidl_next::Encoder + ?Sized,
4964{
4965    #[inline]
4966    fn encode(
4967        &mut self,
4968        encoder: &mut ___E,
4969        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4970    ) -> Result<(), ::fidl_next::EncodeError> {
4971        ::fidl_next::munge!(let WireNodeSymbol { table } = out);
4972
4973        let max_ord = self.__max_ordinal();
4974
4975        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4976        ::fidl_next::ZeroPadding::zero_padding(&mut out);
4977
4978        let mut preallocated =
4979            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4980
4981        for i in 1..=max_ord {
4982            match i {
4983                3 => {
4984                    if let Some(module_name) = &mut self.module_name {
4985                        ::fidl_next::WireEnvelope::encode_value(
4986                            module_name,
4987                            preallocated.encoder,
4988                            &mut out,
4989                        )?;
4990                    } else {
4991                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4992                    }
4993                }
4994
4995                2 => {
4996                    if let Some(address) = &mut self.address {
4997                        ::fidl_next::WireEnvelope::encode_value(
4998                            address,
4999                            preallocated.encoder,
5000                            &mut out,
5001                        )?;
5002                    } else {
5003                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5004                    }
5005                }
5006
5007                1 => {
5008                    if let Some(name) = &mut self.name {
5009                        ::fidl_next::WireEnvelope::encode_value(
5010                            name,
5011                            preallocated.encoder,
5012                            &mut out,
5013                        )?;
5014                    } else {
5015                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5016                    }
5017                }
5018
5019                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5020            }
5021            unsafe {
5022                preallocated.write_next(out.assume_init_ref());
5023            }
5024        }
5025
5026        ::fidl_next::WireTable::encode_len(table, max_ord);
5027
5028        Ok(())
5029    }
5030}
5031
5032impl ::fidl_next::TakeFrom<WireNodeSymbol> for NodeSymbol {
5033    #[inline]
5034    fn take_from(from: &WireNodeSymbol) -> Self {
5035        Self {
5036            name: from.name().map(::fidl_next::TakeFrom::take_from),
5037
5038            address: from.address().map(::fidl_next::TakeFrom::take_from),
5039
5040            module_name: from.module_name().map(::fidl_next::TakeFrom::take_from),
5041        }
5042    }
5043}
5044
5045/// The wire type corresponding to [`NodeSymbol`].
5046#[repr(C)]
5047pub struct WireNodeSymbol {
5048    table: ::fidl_next::WireTable,
5049}
5050
5051unsafe impl ::fidl_next::ZeroPadding for WireNodeSymbol {
5052    #[inline]
5053    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5054        ::fidl_next::munge!(let Self { table } = out);
5055        ::fidl_next::WireTable::zero_padding(table);
5056    }
5057}
5058
5059unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeSymbol
5060where
5061    ___D: ::fidl_next::Decoder + ?Sized,
5062{
5063    fn decode(
5064        slot: ::fidl_next::Slot<'_, Self>,
5065        decoder: &mut ___D,
5066    ) -> Result<(), ::fidl_next::DecodeError> {
5067        ::fidl_next::munge!(let Self { table } = slot);
5068
5069        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5070            match ordinal {
5071                0 => unsafe { ::core::hint::unreachable_unchecked() },
5072
5073                1 => {
5074                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
5075                        slot.as_mut(),
5076                        decoder,
5077                    )?;
5078
5079                    let name = unsafe {
5080                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
5081                    };
5082
5083                    if name.len() > 128 {
5084                        return Err(::fidl_next::DecodeError::VectorTooLong {
5085                            size: name.len() as u64,
5086                            limit: 128,
5087                        });
5088                    }
5089
5090                    Ok(())
5091                }
5092
5093                2 => {
5094                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
5095                        slot.as_mut(),
5096                        decoder,
5097                    )?;
5098
5099                    Ok(())
5100                }
5101
5102                3 => {
5103                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
5104                        slot.as_mut(),
5105                        decoder,
5106                    )?;
5107
5108                    let module_name = unsafe {
5109                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
5110                    };
5111
5112                    if module_name.len() > 128 {
5113                        return Err(::fidl_next::DecodeError::VectorTooLong {
5114                            size: module_name.len() as u64,
5115                            limit: 128,
5116                        });
5117                    }
5118
5119                    Ok(())
5120                }
5121
5122                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
5123            }
5124        })
5125    }
5126}
5127
5128impl WireNodeSymbol {
5129    pub fn name(&self) -> Option<&::fidl_next::WireString> {
5130        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5131    }
5132
5133    pub fn address(&self) -> Option<&::fidl_next::WireU64> {
5134        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5135    }
5136
5137    pub fn module_name(&self) -> Option<&::fidl_next::WireString> {
5138        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
5139    }
5140}
5141
5142impl ::core::fmt::Debug for WireNodeSymbol {
5143    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
5144        f.debug_struct("NodeSymbol")
5145            .field("name", &self.name())
5146            .field("address", &self.address())
5147            .field("module_name", &self.module_name())
5148            .finish()
5149    }
5150}
5151
5152#[derive(Clone, Debug)]
5153pub enum Offer {
5154    ZirconTransport(::fidl_next_fuchsia_component_decl::Offer),
5155
5156    DriverTransport(::fidl_next_fuchsia_component_decl::Offer),
5157
5158    UnknownOrdinal_(u64),
5159}
5160
5161impl ::fidl_next::Encodable for Offer {
5162    type Encoded = WireOffer;
5163}
5164
5165unsafe impl<___E> ::fidl_next::Encode<___E> for Offer
5166where
5167    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5168
5169    ___E: ::fidl_next::Encoder,
5170{
5171    #[inline]
5172    fn encode(
5173        &mut self,
5174        encoder: &mut ___E,
5175        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5176    ) -> Result<(), ::fidl_next::EncodeError> {
5177        ::fidl_next::munge!(let WireOffer { raw } = out);
5178
5179        match self {
5180            Self::ZirconTransport(value) => ::fidl_next::RawWireUnion::encode_as::<
5181                ___E,
5182                ::fidl_next_fuchsia_component_decl::Offer,
5183            >(value, 1, encoder, raw)?,
5184
5185            Self::DriverTransport(value) => ::fidl_next::RawWireUnion::encode_as::<
5186                ___E,
5187                ::fidl_next_fuchsia_component_decl::Offer,
5188            >(value, 2, encoder, raw)?,
5189
5190            Self::UnknownOrdinal_(ordinal) => {
5191                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
5192            }
5193        }
5194
5195        Ok(())
5196    }
5197}
5198
5199impl ::fidl_next::EncodableOption for Box<Offer> {
5200    type EncodedOption = WireOptionalOffer;
5201}
5202
5203unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<Offer>
5204where
5205    ___E: ?Sized,
5206    Offer: ::fidl_next::Encode<___E>,
5207{
5208    #[inline]
5209    fn encode_option(
5210        this: Option<&mut Self>,
5211        encoder: &mut ___E,
5212        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5213    ) -> Result<(), ::fidl_next::EncodeError> {
5214        ::fidl_next::munge!(let WireOptionalOffer { raw } = &mut *out);
5215
5216        if let Some(inner) = this {
5217            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
5218            ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
5219        } else {
5220            ::fidl_next::RawWireUnion::encode_absent(raw);
5221        }
5222
5223        Ok(())
5224    }
5225}
5226
5227impl ::fidl_next::TakeFrom<WireOffer> for Offer {
5228    #[inline]
5229    fn take_from(from: &WireOffer) -> Self {
5230        match from.raw.ordinal() {
5231            1 => Self::ZirconTransport(::fidl_next::TakeFrom::take_from(unsafe {
5232                from.raw.get().deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer>()
5233            })),
5234
5235            2 => Self::DriverTransport(::fidl_next::TakeFrom::take_from(unsafe {
5236                from.raw.get().deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer>()
5237            })),
5238
5239            _ => unsafe { ::core::hint::unreachable_unchecked() },
5240        }
5241    }
5242}
5243
5244impl ::fidl_next::TakeFrom<WireOptionalOffer> for Option<Box<Offer>> {
5245    #[inline]
5246    fn take_from(from: &WireOptionalOffer) -> Self {
5247        if let Some(inner) = from.as_ref() {
5248            Some(::fidl_next::TakeFrom::take_from(inner))
5249        } else {
5250            None
5251        }
5252    }
5253}
5254
5255/// The wire type corresponding to [`Offer`].
5256#[repr(transparent)]
5257pub struct WireOffer {
5258    raw: ::fidl_next::RawWireUnion,
5259}
5260
5261unsafe impl ::fidl_next::ZeroPadding for WireOffer {
5262    #[inline]
5263    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5264        ::fidl_next::munge!(let Self { raw } = out);
5265        ::fidl_next::RawWireUnion::zero_padding(raw);
5266    }
5267}
5268
5269pub mod offer {
5270    pub enum Ref<'union> {
5271        ZirconTransport(&'union ::fidl_next_fuchsia_component_decl::WireOffer),
5272
5273        DriverTransport(&'union ::fidl_next_fuchsia_component_decl::WireOffer),
5274
5275        UnknownOrdinal_(u64),
5276    }
5277}
5278
5279impl WireOffer {
5280    pub fn as_ref(&self) -> crate::offer::Ref<'_> {
5281        match self.raw.ordinal() {
5282            1 => crate::offer::Ref::ZirconTransport(unsafe {
5283                self.raw.get().deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer>()
5284            }),
5285
5286            2 => crate::offer::Ref::DriverTransport(unsafe {
5287                self.raw.get().deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer>()
5288            }),
5289
5290            unknown => crate::offer::Ref::UnknownOrdinal_(unknown),
5291        }
5292    }
5293}
5294
5295unsafe impl<___D> ::fidl_next::Decode<___D> for WireOffer
5296where
5297    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5298
5299    ___D: ::fidl_next::Decoder,
5300{
5301    fn decode(
5302        mut slot: ::fidl_next::Slot<'_, Self>,
5303        decoder: &mut ___D,
5304    ) -> Result<(), ::fidl_next::DecodeError> {
5305        ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
5306        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5307            1 => ::fidl_next::RawWireUnion::decode_as::<
5308                ___D,
5309                ::fidl_next_fuchsia_component_decl::WireOffer,
5310            >(raw, decoder)?,
5311
5312            2 => ::fidl_next::RawWireUnion::decode_as::<
5313                ___D,
5314                ::fidl_next_fuchsia_component_decl::WireOffer,
5315            >(raw, decoder)?,
5316
5317            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5318        }
5319
5320        Ok(())
5321    }
5322}
5323
5324impl ::core::fmt::Debug for WireOffer {
5325    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5326        match self.raw.ordinal() {
5327            1 => unsafe {
5328                self.raw
5329                    .get()
5330                    .deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer>()
5331                    .fmt(f)
5332            },
5333            2 => unsafe {
5334                self.raw
5335                    .get()
5336                    .deref_unchecked::<::fidl_next_fuchsia_component_decl::WireOffer>()
5337                    .fmt(f)
5338            },
5339            _ => unsafe { ::core::hint::unreachable_unchecked() },
5340        }
5341    }
5342}
5343
5344#[repr(transparent)]
5345pub struct WireOptionalOffer {
5346    raw: ::fidl_next::RawWireUnion,
5347}
5348
5349unsafe impl ::fidl_next::ZeroPadding for WireOptionalOffer {
5350    #[inline]
5351    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5352        ::fidl_next::munge!(let Self { raw } = out);
5353        ::fidl_next::RawWireUnion::zero_padding(raw);
5354    }
5355}
5356
5357impl WireOptionalOffer {
5358    pub fn is_some(&self) -> bool {
5359        self.raw.is_some()
5360    }
5361
5362    pub fn is_none(&self) -> bool {
5363        self.raw.is_none()
5364    }
5365
5366    pub fn as_ref(&self) -> Option<&WireOffer> {
5367        if self.is_some() {
5368            Some(unsafe { &*(self as *const Self).cast() })
5369        } else {
5370            None
5371        }
5372    }
5373}
5374
5375unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalOffer
5376where
5377    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5378
5379    ___D: ::fidl_next::Decoder,
5380{
5381    fn decode(
5382        mut slot: ::fidl_next::Slot<'_, Self>,
5383        decoder: &mut ___D,
5384    ) -> Result<(), ::fidl_next::DecodeError> {
5385        ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
5386        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5387            1 => ::fidl_next::RawWireUnion::decode_as::<
5388                ___D,
5389                ::fidl_next_fuchsia_component_decl::WireOffer,
5390            >(raw, decoder)?,
5391
5392            2 => ::fidl_next::RawWireUnion::decode_as::<
5393                ___D,
5394                ::fidl_next_fuchsia_component_decl::WireOffer,
5395            >(raw, decoder)?,
5396
5397            0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
5398            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5399        }
5400
5401        Ok(())
5402    }
5403}
5404
5405impl ::core::fmt::Debug for WireOptionalOffer {
5406    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5407        self.as_ref().fmt(f)
5408    }
5409}
5410
5411pub type NodeOffersVector = Vec<crate::Offer>;
5412
5413/// The wire type corresponding to [`NodeOffersVector`].
5414pub type WireNodeOffersVector = ::fidl_next::WireVector<crate::WireOffer>;
5415
5416#[doc = " Arguments for starting a driver.\n"]
5417#[derive(Debug, Default)]
5418pub struct DriverStartArgs {
5419    pub node: Option<::fidl_next::ClientEnd<::fidl_next::fuchsia::zx::Channel, crate::Node>>,
5420
5421    pub symbols: Option<Vec<crate::NodeSymbol>>,
5422
5423    pub url: Option<String>,
5424
5425    pub program: Option<::fidl_next_fuchsia_data::Dictionary>,
5426
5427    pub incoming: Option<Vec<::fidl_next_fuchsia_component_runner::ComponentNamespaceEntry>>,
5428
5429    pub outgoing_dir: Option<
5430        ::fidl_next::ServerEnd<
5431            ::fidl_next::fuchsia::zx::Channel,
5432            ::fidl_next_fuchsia_io::Directory,
5433        >,
5434    >,
5435
5436    pub config: Option<::fidl_next::fuchsia::zx::Handle>,
5437
5438    pub node_name: Option<String>,
5439
5440    pub node_properties: Option<Vec<crate::NodePropertyEntry>>,
5441
5442    pub node_offers: Option<Vec<crate::Offer>>,
5443
5444    pub node_token: Option<::fidl_next::fuchsia::zx::Handle>,
5445
5446    pub node_properties_2: Option<Vec<crate::NodePropertyEntry2>>,
5447}
5448
5449impl DriverStartArgs {
5450    fn __max_ordinal(&self) -> usize {
5451        if self.node.is_some() {
5452            return 1;
5453        }
5454
5455        if self.symbols.is_some() {
5456            return 2;
5457        }
5458
5459        if self.url.is_some() {
5460            return 3;
5461        }
5462
5463        if self.program.is_some() {
5464            return 4;
5465        }
5466
5467        if self.incoming.is_some() {
5468            return 5;
5469        }
5470
5471        if self.outgoing_dir.is_some() {
5472            return 6;
5473        }
5474
5475        if self.config.is_some() {
5476            return 7;
5477        }
5478
5479        if self.node_name.is_some() {
5480            return 8;
5481        }
5482
5483        if self.node_properties.is_some() {
5484            return 9;
5485        }
5486
5487        if self.node_offers.is_some() {
5488            return 10;
5489        }
5490
5491        if self.node_token.is_some() {
5492            return 11;
5493        }
5494
5495        if self.node_properties_2.is_some() {
5496            return 12;
5497        }
5498
5499        0
5500    }
5501}
5502
5503impl ::fidl_next::Encodable for DriverStartArgs {
5504    type Encoded = WireDriverStartArgs;
5505}
5506
5507unsafe impl<___E> ::fidl_next::Encode<___E> for DriverStartArgs
5508where
5509    ___E: ::fidl_next::Encoder + ?Sized,
5510
5511    ___E: ::fidl_next::fuchsia::HandleEncoder,
5512{
5513    #[inline]
5514    fn encode(
5515        &mut self,
5516        encoder: &mut ___E,
5517        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5518    ) -> Result<(), ::fidl_next::EncodeError> {
5519        ::fidl_next::munge!(let WireDriverStartArgs { table } = out);
5520
5521        let max_ord = self.__max_ordinal();
5522
5523        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5524        ::fidl_next::ZeroPadding::zero_padding(&mut out);
5525
5526        let mut preallocated =
5527            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5528
5529        for i in 1..=max_ord {
5530            match i {
5531                12 => {
5532                    if let Some(node_properties_2) = &mut self.node_properties_2 {
5533                        ::fidl_next::WireEnvelope::encode_value(
5534                            node_properties_2,
5535                            preallocated.encoder,
5536                            &mut out,
5537                        )?;
5538                    } else {
5539                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5540                    }
5541                }
5542
5543                11 => {
5544                    if let Some(node_token) = &mut self.node_token {
5545                        ::fidl_next::WireEnvelope::encode_value(
5546                            node_token,
5547                            preallocated.encoder,
5548                            &mut out,
5549                        )?;
5550                    } else {
5551                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5552                    }
5553                }
5554
5555                10 => {
5556                    if let Some(node_offers) = &mut self.node_offers {
5557                        ::fidl_next::WireEnvelope::encode_value(
5558                            node_offers,
5559                            preallocated.encoder,
5560                            &mut out,
5561                        )?;
5562                    } else {
5563                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5564                    }
5565                }
5566
5567                9 => {
5568                    if let Some(node_properties) = &mut self.node_properties {
5569                        ::fidl_next::WireEnvelope::encode_value(
5570                            node_properties,
5571                            preallocated.encoder,
5572                            &mut out,
5573                        )?;
5574                    } else {
5575                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5576                    }
5577                }
5578
5579                8 => {
5580                    if let Some(node_name) = &mut self.node_name {
5581                        ::fidl_next::WireEnvelope::encode_value(
5582                            node_name,
5583                            preallocated.encoder,
5584                            &mut out,
5585                        )?;
5586                    } else {
5587                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5588                    }
5589                }
5590
5591                7 => {
5592                    if let Some(config) = &mut self.config {
5593                        ::fidl_next::WireEnvelope::encode_value(
5594                            config,
5595                            preallocated.encoder,
5596                            &mut out,
5597                        )?;
5598                    } else {
5599                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5600                    }
5601                }
5602
5603                6 => {
5604                    if let Some(outgoing_dir) = &mut self.outgoing_dir {
5605                        ::fidl_next::WireEnvelope::encode_value(
5606                            outgoing_dir,
5607                            preallocated.encoder,
5608                            &mut out,
5609                        )?;
5610                    } else {
5611                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5612                    }
5613                }
5614
5615                5 => {
5616                    if let Some(incoming) = &mut self.incoming {
5617                        ::fidl_next::WireEnvelope::encode_value(
5618                            incoming,
5619                            preallocated.encoder,
5620                            &mut out,
5621                        )?;
5622                    } else {
5623                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5624                    }
5625                }
5626
5627                4 => {
5628                    if let Some(program) = &mut self.program {
5629                        ::fidl_next::WireEnvelope::encode_value(
5630                            program,
5631                            preallocated.encoder,
5632                            &mut out,
5633                        )?;
5634                    } else {
5635                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5636                    }
5637                }
5638
5639                3 => {
5640                    if let Some(url) = &mut self.url {
5641                        ::fidl_next::WireEnvelope::encode_value(
5642                            url,
5643                            preallocated.encoder,
5644                            &mut out,
5645                        )?;
5646                    } else {
5647                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5648                    }
5649                }
5650
5651                2 => {
5652                    if let Some(symbols) = &mut self.symbols {
5653                        ::fidl_next::WireEnvelope::encode_value(
5654                            symbols,
5655                            preallocated.encoder,
5656                            &mut out,
5657                        )?;
5658                    } else {
5659                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5660                    }
5661                }
5662
5663                1 => {
5664                    if let Some(node) = &mut self.node {
5665                        ::fidl_next::WireEnvelope::encode_value(
5666                            node,
5667                            preallocated.encoder,
5668                            &mut out,
5669                        )?;
5670                    } else {
5671                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5672                    }
5673                }
5674
5675                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5676            }
5677            unsafe {
5678                preallocated.write_next(out.assume_init_ref());
5679            }
5680        }
5681
5682        ::fidl_next::WireTable::encode_len(table, max_ord);
5683
5684        Ok(())
5685    }
5686}
5687
5688impl ::fidl_next::TakeFrom<WireDriverStartArgs> for DriverStartArgs {
5689    #[inline]
5690    fn take_from(from: &WireDriverStartArgs) -> Self {
5691        Self {
5692            node: from.node().map(::fidl_next::TakeFrom::take_from),
5693
5694            symbols: from.symbols().map(::fidl_next::TakeFrom::take_from),
5695
5696            url: from.url().map(::fidl_next::TakeFrom::take_from),
5697
5698            program: from.program().map(::fidl_next::TakeFrom::take_from),
5699
5700            incoming: from.incoming().map(::fidl_next::TakeFrom::take_from),
5701
5702            outgoing_dir: from.outgoing_dir().map(::fidl_next::TakeFrom::take_from),
5703
5704            config: from.config().map(::fidl_next::TakeFrom::take_from),
5705
5706            node_name: from.node_name().map(::fidl_next::TakeFrom::take_from),
5707
5708            node_properties: from.node_properties().map(::fidl_next::TakeFrom::take_from),
5709
5710            node_offers: from.node_offers().map(::fidl_next::TakeFrom::take_from),
5711
5712            node_token: from.node_token().map(::fidl_next::TakeFrom::take_from),
5713
5714            node_properties_2: from.node_properties_2().map(::fidl_next::TakeFrom::take_from),
5715        }
5716    }
5717}
5718
5719/// The wire type corresponding to [`DriverStartArgs`].
5720#[repr(C)]
5721pub struct WireDriverStartArgs {
5722    table: ::fidl_next::WireTable,
5723}
5724
5725unsafe impl ::fidl_next::ZeroPadding for WireDriverStartArgs {
5726    #[inline]
5727    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5728        ::fidl_next::munge!(let Self { table } = out);
5729        ::fidl_next::WireTable::zero_padding(table);
5730    }
5731}
5732
5733unsafe impl<___D> ::fidl_next::Decode<___D> for WireDriverStartArgs
5734where
5735    ___D: ::fidl_next::Decoder + ?Sized,
5736
5737    ___D: ::fidl_next::fuchsia::HandleDecoder,
5738{
5739    fn decode(
5740        slot: ::fidl_next::Slot<'_, Self>,
5741        decoder: &mut ___D,
5742    ) -> Result<(), ::fidl_next::DecodeError> {
5743        ::fidl_next::munge!(let Self { table } = slot);
5744
5745        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5746            match ordinal {
5747                0 => unsafe { ::core::hint::unreachable_unchecked() },
5748
5749                1 => {
5750                    ::fidl_next::WireEnvelope::decode_as::<
5751                        ___D,
5752                        ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::Node>,
5753                    >(slot.as_mut(), decoder)?;
5754
5755                    Ok(())
5756                }
5757
5758                2 => {
5759                    ::fidl_next::WireEnvelope::decode_as::<
5760                        ___D,
5761                        ::fidl_next::WireVector<crate::WireNodeSymbol>,
5762                    >(slot.as_mut(), decoder)?;
5763
5764                    let symbols = unsafe {
5765                        slot.deref_unchecked()
5766                            .deref_unchecked::<::fidl_next::WireVector<crate::WireNodeSymbol>>()
5767                    };
5768
5769                    if symbols.len() > 64 {
5770                        return Err(::fidl_next::DecodeError::VectorTooLong {
5771                            size: symbols.len() as u64,
5772                            limit: 64,
5773                        });
5774                    }
5775
5776                    Ok(())
5777                }
5778
5779                3 => {
5780                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
5781                        slot.as_mut(),
5782                        decoder,
5783                    )?;
5784
5785                    let url = unsafe {
5786                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
5787                    };
5788
5789                    if url.len() > 4096 {
5790                        return Err(::fidl_next::DecodeError::VectorTooLong {
5791                            size: url.len() as u64,
5792                            limit: 4096,
5793                        });
5794                    }
5795
5796                    Ok(())
5797                }
5798
5799                4 => {
5800                    ::fidl_next::WireEnvelope::decode_as::<
5801                        ___D,
5802                        ::fidl_next_fuchsia_data::WireDictionary,
5803                    >(slot.as_mut(), decoder)?;
5804
5805                    Ok(())
5806                }
5807
5808                5 => {
5809                    ::fidl_next::WireEnvelope::decode_as::<
5810                        ___D,
5811                        ::fidl_next::WireVector<
5812                            ::fidl_next_fuchsia_component_runner::WireComponentNamespaceEntry,
5813                        >,
5814                    >(slot.as_mut(), decoder)?;
5815
5816                    let incoming = unsafe {
5817                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<
5818                            ::fidl_next_fuchsia_component_runner::WireComponentNamespaceEntry,
5819                        >>()
5820                    };
5821
5822                    if incoming.len() > 32 {
5823                        return Err(::fidl_next::DecodeError::VectorTooLong {
5824                            size: incoming.len() as u64,
5825                            limit: 32,
5826                        });
5827                    }
5828
5829                    Ok(())
5830                }
5831
5832                6 => {
5833                    ::fidl_next::WireEnvelope::decode_as::<
5834                        ___D,
5835                        ::fidl_next::ServerEnd<
5836                            ::fidl_next::fuchsia::WireChannel,
5837                            ::fidl_next_fuchsia_io::Directory,
5838                        >,
5839                    >(slot.as_mut(), decoder)?;
5840
5841                    Ok(())
5842                }
5843
5844                7 => {
5845                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
5846                        slot.as_mut(),
5847                        decoder,
5848                    )?;
5849
5850                    Ok(())
5851                }
5852
5853                8 => {
5854                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
5855                        slot.as_mut(),
5856                        decoder,
5857                    )?;
5858
5859                    Ok(())
5860                }
5861
5862                9 => {
5863                    ::fidl_next::WireEnvelope::decode_as::<
5864                        ___D,
5865                        ::fidl_next::WireVector<crate::WireNodePropertyEntry>,
5866                    >(slot.as_mut(), decoder)?;
5867
5868                    Ok(())
5869                }
5870
5871                10 => {
5872                    ::fidl_next::WireEnvelope::decode_as::<
5873                        ___D,
5874                        ::fidl_next::WireVector<crate::WireOffer>,
5875                    >(slot.as_mut(), decoder)?;
5876
5877                    let node_offers = unsafe {
5878                        slot.deref_unchecked()
5879                            .deref_unchecked::<::fidl_next::WireVector<crate::WireOffer>>()
5880                    };
5881
5882                    if node_offers.len() > 128 {
5883                        return Err(::fidl_next::DecodeError::VectorTooLong {
5884                            size: node_offers.len() as u64,
5885                            limit: 128,
5886                        });
5887                    }
5888
5889                    Ok(())
5890                }
5891
5892                11 => {
5893                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
5894                        slot.as_mut(),
5895                        decoder,
5896                    )?;
5897
5898                    Ok(())
5899                }
5900
5901                12 => {
5902                    ::fidl_next::WireEnvelope::decode_as::<
5903                        ___D,
5904                        ::fidl_next::WireVector<crate::WireNodePropertyEntry2>,
5905                    >(slot.as_mut(), decoder)?;
5906
5907                    Ok(())
5908                }
5909
5910                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
5911            }
5912        })
5913    }
5914}
5915
5916impl WireDriverStartArgs {
5917    pub fn node(
5918        &self,
5919    ) -> Option<&::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::Node>> {
5920        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5921    }
5922
5923    pub fn symbols(&self) -> Option<&::fidl_next::WireVector<crate::WireNodeSymbol>> {
5924        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5925    }
5926
5927    pub fn url(&self) -> Option<&::fidl_next::WireString> {
5928        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
5929    }
5930
5931    pub fn program(&self) -> Option<&::fidl_next_fuchsia_data::WireDictionary> {
5932        unsafe { Some(self.table.get(4)?.deref_unchecked()) }
5933    }
5934
5935    pub fn incoming(
5936        &self,
5937    ) -> Option<
5938        &::fidl_next::WireVector<::fidl_next_fuchsia_component_runner::WireComponentNamespaceEntry>,
5939    > {
5940        unsafe { Some(self.table.get(5)?.deref_unchecked()) }
5941    }
5942
5943    pub fn outgoing_dir(
5944        &self,
5945    ) -> Option<
5946        &::fidl_next::ServerEnd<
5947            ::fidl_next::fuchsia::WireChannel,
5948            ::fidl_next_fuchsia_io::Directory,
5949        >,
5950    > {
5951        unsafe { Some(self.table.get(6)?.deref_unchecked()) }
5952    }
5953
5954    pub fn config(&self) -> Option<&::fidl_next::fuchsia::WireHandle> {
5955        unsafe { Some(self.table.get(7)?.deref_unchecked()) }
5956    }
5957
5958    pub fn node_name(&self) -> Option<&::fidl_next::WireString> {
5959        unsafe { Some(self.table.get(8)?.deref_unchecked()) }
5960    }
5961
5962    pub fn node_properties(
5963        &self,
5964    ) -> Option<&::fidl_next::WireVector<crate::WireNodePropertyEntry>> {
5965        unsafe { Some(self.table.get(9)?.deref_unchecked()) }
5966    }
5967
5968    pub fn node_offers(&self) -> Option<&::fidl_next::WireVector<crate::WireOffer>> {
5969        unsafe { Some(self.table.get(10)?.deref_unchecked()) }
5970    }
5971
5972    pub fn node_token(&self) -> Option<&::fidl_next::fuchsia::WireHandle> {
5973        unsafe { Some(self.table.get(11)?.deref_unchecked()) }
5974    }
5975
5976    pub fn node_properties_2(
5977        &self,
5978    ) -> Option<&::fidl_next::WireVector<crate::WireNodePropertyEntry2>> {
5979        unsafe { Some(self.table.get(12)?.deref_unchecked()) }
5980    }
5981}
5982
5983impl ::core::fmt::Debug for WireDriverStartArgs {
5984    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
5985        f.debug_struct("DriverStartArgs")
5986            .field("node", &self.node())
5987            .field("symbols", &self.symbols())
5988            .field("url", &self.url())
5989            .field("program", &self.program())
5990            .field("incoming", &self.incoming())
5991            .field("outgoing_dir", &self.outgoing_dir())
5992            .field("config", &self.config())
5993            .field("node_name", &self.node_name())
5994            .field("node_properties", &self.node_properties())
5995            .field("node_offers", &self.node_offers())
5996            .field("node_token", &self.node_token())
5997            .field("node_properties_2", &self.node_properties_2())
5998            .finish()
5999    }
6000}
6001
6002#[derive(Debug)]
6003pub struct DriverStartRequest {
6004    pub start_args: crate::DriverStartArgs,
6005}
6006
6007impl ::fidl_next::Encodable for DriverStartRequest {
6008    type Encoded = WireDriverStartRequest;
6009}
6010
6011unsafe impl<___E> ::fidl_next::Encode<___E> for DriverStartRequest
6012where
6013    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6014
6015    ___E: ::fidl_next::Encoder,
6016
6017    ___E: ::fidl_next::fuchsia::HandleEncoder,
6018{
6019    #[inline]
6020    fn encode(
6021        &mut self,
6022        encoder: &mut ___E,
6023        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6024    ) -> Result<(), ::fidl_next::EncodeError> {
6025        ::fidl_next::munge! {
6026            let Self::Encoded {
6027                start_args,
6028
6029            } = out;
6030        }
6031
6032        ::fidl_next::Encode::encode(&mut self.start_args, encoder, start_args)?;
6033
6034        Ok(())
6035    }
6036}
6037
6038impl ::fidl_next::EncodableOption for Box<DriverStartRequest> {
6039    type EncodedOption = ::fidl_next::WireBox<WireDriverStartRequest>;
6040}
6041
6042unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DriverStartRequest>
6043where
6044    ___E: ::fidl_next::Encoder + ?Sized,
6045    DriverStartRequest: ::fidl_next::Encode<___E>,
6046{
6047    #[inline]
6048    fn encode_option(
6049        this: Option<&mut Self>,
6050        encoder: &mut ___E,
6051        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6052    ) -> Result<(), ::fidl_next::EncodeError> {
6053        if let Some(inner) = this {
6054            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6055            ::fidl_next::WireBox::encode_present(out);
6056        } else {
6057            ::fidl_next::WireBox::encode_absent(out);
6058        }
6059
6060        Ok(())
6061    }
6062}
6063
6064impl ::fidl_next::TakeFrom<WireDriverStartRequest> for DriverStartRequest {
6065    #[inline]
6066    fn take_from(from: &WireDriverStartRequest) -> Self {
6067        Self { start_args: ::fidl_next::TakeFrom::take_from(&from.start_args) }
6068    }
6069}
6070
6071/// The wire type corresponding to [`DriverStartRequest`].
6072#[derive(Debug)]
6073#[repr(C)]
6074pub struct WireDriverStartRequest {
6075    pub start_args: crate::WireDriverStartArgs,
6076}
6077
6078unsafe impl ::fidl_next::ZeroPadding for WireDriverStartRequest {
6079    #[inline]
6080    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6081}
6082
6083unsafe impl<___D> ::fidl_next::Decode<___D> for WireDriverStartRequest
6084where
6085    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6086
6087    ___D: ::fidl_next::Decoder,
6088
6089    ___D: ::fidl_next::fuchsia::HandleDecoder,
6090{
6091    fn decode(
6092        slot: ::fidl_next::Slot<'_, Self>,
6093        decoder: &mut ___D,
6094    ) -> Result<(), ::fidl_next::DecodeError> {
6095        ::fidl_next::munge! {
6096            let Self {
6097                mut start_args,
6098
6099            } = slot;
6100        }
6101
6102        ::fidl_next::Decode::decode(start_args.as_mut(), decoder)?;
6103
6104        Ok(())
6105    }
6106}
6107
6108/// The type corresponding to the Driver protocol.
6109#[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"]
6110#[derive(Debug)]
6111pub struct Driver;
6112
6113pub mod driver {
6114    pub mod prelude {
6115        pub use crate::{
6116            driver, Driver, DriverClientHandler, DriverClientSender, DriverServerHandler,
6117            DriverServerSender,
6118        };
6119
6120        pub use crate::DriverStartRequest;
6121
6122        pub use crate::DriverStartResponse;
6123    }
6124
6125    pub struct Start;
6126
6127    impl ::fidl_next::Method for Start {
6128        const ORDINAL: u64 = 2863727161496985794;
6129
6130        type Protocol = crate::Driver;
6131
6132        type Request = crate::WireDriverStartRequest;
6133
6134        type Response =
6135            ::fidl_next::WireFlexibleResult<crate::WireDriverStartResponse, ::fidl_next::WireI32>;
6136    }
6137
6138    pub struct Stop;
6139
6140    impl ::fidl_next::Method for Stop {
6141        const ORDINAL: u64 = 5446759044519003197;
6142
6143        type Protocol = crate::Driver;
6144
6145        type Request = ();
6146
6147        type Response = ::fidl_next::Never;
6148    }
6149}
6150
6151/// A helper trait for the `Driver` client sender.
6152pub trait DriverClientSender {
6153    type Transport: ::fidl_next::Transport;
6154
6155    #[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"]
6156    fn start<___R>(
6157        &self,
6158        request: &mut ___R,
6159    ) -> Result<
6160        ::fidl_next::ResponseFuture<'_, Self::Transport, driver::Start>,
6161        ::fidl_next::EncodeError,
6162    >
6163    where
6164        ___R: ::fidl_next::Encode<
6165            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6166            Encoded = crate::WireDriverStartRequest,
6167        >;
6168
6169    #[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"]
6170    fn stop(
6171        &self,
6172    ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>;
6173}
6174
6175impl<___T> DriverClientSender for ::fidl_next::ClientSender<___T, Driver>
6176where
6177    ___T: ::fidl_next::Transport,
6178{
6179    type Transport = ___T;
6180
6181    #[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"]
6182    fn start<___R>(
6183        &self,
6184        request: &mut ___R,
6185    ) -> Result<
6186        ::fidl_next::ResponseFuture<'_, Self::Transport, driver::Start>,
6187        ::fidl_next::EncodeError,
6188    >
6189    where
6190        ___R: ::fidl_next::Encode<
6191            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6192            Encoded = crate::WireDriverStartRequest,
6193        >,
6194    {
6195        self.as_untyped()
6196            .send_two_way(2863727161496985794, request)
6197            .map(::fidl_next::ResponseFuture::from_untyped)
6198    }
6199
6200    #[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"]
6201    fn stop(
6202        &self,
6203    ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError> {
6204        self.as_untyped().send_one_way(5446759044519003197, &mut ())
6205    }
6206}
6207
6208/// A client handler for the Driver protocol.
6209///
6210/// See [`Driver`] for more details.
6211pub trait DriverClientHandler<___T: ::fidl_next::Transport> {
6212    fn on_unknown_interaction(
6213        &mut self,
6214        sender: &::fidl_next::ClientSender<___T, Driver>,
6215        ordinal: u64,
6216    ) {
6217        sender.close();
6218    }
6219}
6220
6221impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Driver
6222where
6223    ___T: ::fidl_next::Transport,
6224    ___H: DriverClientHandler<___T>,
6225
6226    <driver::Start as ::fidl_next::Method>::Response:
6227        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6228{
6229    fn on_event(
6230        handler: &mut ___H,
6231        sender: &::fidl_next::ClientSender<___T, Self>,
6232        ordinal: u64,
6233        buffer: ___T::RecvBuffer,
6234    ) {
6235        match ordinal {
6236            ordinal => handler.on_unknown_interaction(sender, ordinal),
6237        }
6238    }
6239}
6240
6241/// A helper trait for the `Driver` server sender.
6242pub trait DriverServerSender {
6243    type Transport: ::fidl_next::Transport;
6244}
6245
6246impl<___T> DriverServerSender for ::fidl_next::ServerSender<___T, Driver>
6247where
6248    ___T: ::fidl_next::Transport,
6249{
6250    type Transport = ___T;
6251}
6252
6253/// A server handler for the Driver protocol.
6254///
6255/// See [`Driver`] for more details.
6256pub trait DriverServerHandler<___T: ::fidl_next::Transport> {
6257    #[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"]
6258    fn start(
6259        &mut self,
6260        sender: &::fidl_next::ServerSender<___T, Driver>,
6261
6262        request: ::fidl_next::Request<___T, driver::Start>,
6263
6264        responder: ::fidl_next::Responder<driver::Start>,
6265    );
6266
6267    #[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"]
6268    fn stop(&mut self, sender: &::fidl_next::ServerSender<___T, Driver>);
6269
6270    fn on_unknown_interaction(
6271        &mut self,
6272        sender: &::fidl_next::ServerSender<___T, Driver>,
6273        ordinal: u64,
6274    ) {
6275        sender.close();
6276    }
6277}
6278
6279impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Driver
6280where
6281    ___T: ::fidl_next::Transport,
6282    ___H: DriverServerHandler<___T>,
6283
6284    crate::WireDriverStartRequest:
6285        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6286{
6287    fn on_one_way(
6288        handler: &mut ___H,
6289        sender: &::fidl_next::ServerSender<___T, Self>,
6290        ordinal: u64,
6291        buffer: ___T::RecvBuffer,
6292    ) {
6293        match ordinal {
6294            5446759044519003197 => {
6295                handler.stop(sender);
6296            }
6297
6298            ordinal => handler.on_unknown_interaction(sender, ordinal),
6299        }
6300    }
6301
6302    fn on_two_way(
6303        handler: &mut ___H,
6304        sender: &::fidl_next::ServerSender<___T, Self>,
6305        ordinal: u64,
6306        buffer: ___T::RecvBuffer,
6307        responder: ::fidl_next::protocol::Responder,
6308    ) {
6309        match ordinal {
6310            2863727161496985794 => {
6311                let responder = ::fidl_next::Responder::from_untyped(responder);
6312
6313                match ::fidl_next::DecoderExt::decode(buffer) {
6314                    Ok(decoded) => handler.start(sender, decoded, responder),
6315                    Err(e) => {
6316                        sender.close();
6317                    }
6318                }
6319            }
6320
6321            ordinal => handler.on_unknown_interaction(sender, ordinal),
6322        }
6323    }
6324}
6325
6326pub const MAX_RESOURCE_NAME_LENGTH: u8 = 128;
6327
6328pub type NodeAddChildResponse = ();
6329
6330/// The wire type corresponding to [`NodeAddChildResponse`].
6331pub type WireNodeAddChildResponse = ();
6332
6333#[doc = " Error codes for the Node protocol.\n"]
6334#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6335#[repr(u32)]
6336pub enum NodeError {
6337    Internal = 1,
6338    NodeRemoved = 2,
6339    NameMissing = 3,
6340    NameInvalid = 4,
6341    NameAlreadyExists = 5,
6342    OfferSourceNameMissing = 6,
6343    OfferRefExists = 7,
6344    SymbolNameMissing = 8,
6345    SymbolAddressMissing = 9,
6346    SymbolAlreadyExists = 10,
6347    UnbindChildrenInProgress = 11,
6348    UnsupportedArgs = 12,
6349    UnknownOrdinal_(u32),
6350}
6351
6352impl ::fidl_next::Encodable for NodeError {
6353    type Encoded = WireNodeError;
6354}
6355impl ::std::convert::From<u32> for NodeError {
6356    fn from(value: u32) -> Self {
6357        match value {
6358            1 => Self::Internal,
6359            2 => Self::NodeRemoved,
6360            3 => Self::NameMissing,
6361            4 => Self::NameInvalid,
6362            5 => Self::NameAlreadyExists,
6363            6 => Self::OfferSourceNameMissing,
6364            7 => Self::OfferRefExists,
6365            8 => Self::SymbolNameMissing,
6366            9 => Self::SymbolAddressMissing,
6367            10 => Self::SymbolAlreadyExists,
6368            11 => Self::UnbindChildrenInProgress,
6369            12 => Self::UnsupportedArgs,
6370
6371            _ => Self::UnknownOrdinal_(value),
6372        }
6373    }
6374}
6375
6376unsafe impl<___E> ::fidl_next::Encode<___E> for NodeError
6377where
6378    ___E: ?Sized,
6379{
6380    #[inline]
6381    fn encode(
6382        &mut self,
6383        _: &mut ___E,
6384        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6385    ) -> Result<(), ::fidl_next::EncodeError> {
6386        ::fidl_next::munge!(let WireNodeError { value } = out);
6387        let _ = value.write(::fidl_next::WireU32::from(match *self {
6388            Self::Internal => 1,
6389
6390            Self::NodeRemoved => 2,
6391
6392            Self::NameMissing => 3,
6393
6394            Self::NameInvalid => 4,
6395
6396            Self::NameAlreadyExists => 5,
6397
6398            Self::OfferSourceNameMissing => 6,
6399
6400            Self::OfferRefExists => 7,
6401
6402            Self::SymbolNameMissing => 8,
6403
6404            Self::SymbolAddressMissing => 9,
6405
6406            Self::SymbolAlreadyExists => 10,
6407
6408            Self::UnbindChildrenInProgress => 11,
6409
6410            Self::UnsupportedArgs => 12,
6411
6412            Self::UnknownOrdinal_(value) => value,
6413        }));
6414
6415        Ok(())
6416    }
6417}
6418
6419impl ::core::convert::From<WireNodeError> for NodeError {
6420    fn from(wire: WireNodeError) -> Self {
6421        match u32::from(wire.value) {
6422            1 => Self::Internal,
6423
6424            2 => Self::NodeRemoved,
6425
6426            3 => Self::NameMissing,
6427
6428            4 => Self::NameInvalid,
6429
6430            5 => Self::NameAlreadyExists,
6431
6432            6 => Self::OfferSourceNameMissing,
6433
6434            7 => Self::OfferRefExists,
6435
6436            8 => Self::SymbolNameMissing,
6437
6438            9 => Self::SymbolAddressMissing,
6439
6440            10 => Self::SymbolAlreadyExists,
6441
6442            11 => Self::UnbindChildrenInProgress,
6443
6444            12 => Self::UnsupportedArgs,
6445
6446            value => Self::UnknownOrdinal_(value),
6447        }
6448    }
6449}
6450
6451impl ::fidl_next::TakeFrom<WireNodeError> for NodeError {
6452    #[inline]
6453    fn take_from(from: &WireNodeError) -> Self {
6454        Self::from(*from)
6455    }
6456}
6457
6458/// The wire type corresponding to [`NodeError`].
6459#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6460#[repr(transparent)]
6461pub struct WireNodeError {
6462    value: ::fidl_next::WireU32,
6463}
6464
6465unsafe impl ::fidl_next::ZeroPadding for WireNodeError {
6466    #[inline]
6467    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
6468        // Wire enums have no padding
6469    }
6470}
6471
6472impl WireNodeError {
6473    pub const INTERNAL: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(1) };
6474
6475    pub const NODE_REMOVED: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(2) };
6476
6477    pub const NAME_MISSING: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(3) };
6478
6479    pub const NAME_INVALID: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(4) };
6480
6481    pub const NAME_ALREADY_EXISTS: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(5) };
6482
6483    pub const OFFER_SOURCE_NAME_MISSING: WireNodeError =
6484        WireNodeError { value: ::fidl_next::WireU32(6) };
6485
6486    pub const OFFER_REF_EXISTS: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(7) };
6487
6488    pub const SYMBOL_NAME_MISSING: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(8) };
6489
6490    pub const SYMBOL_ADDRESS_MISSING: WireNodeError =
6491        WireNodeError { value: ::fidl_next::WireU32(9) };
6492
6493    pub const SYMBOL_ALREADY_EXISTS: WireNodeError =
6494        WireNodeError { value: ::fidl_next::WireU32(10) };
6495
6496    pub const UNBIND_CHILDREN_IN_PROGRESS: WireNodeError =
6497        WireNodeError { value: ::fidl_next::WireU32(11) };
6498
6499    pub const UNSUPPORTED_ARGS: WireNodeError = WireNodeError { value: ::fidl_next::WireU32(12) };
6500}
6501
6502unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeError
6503where
6504    ___D: ?Sized,
6505{
6506    fn decode(
6507        slot: ::fidl_next::Slot<'_, Self>,
6508        _: &mut ___D,
6509    ) -> Result<(), ::fidl_next::DecodeError> {
6510        Ok(())
6511    }
6512}
6513
6514impl ::core::convert::From<NodeError> for WireNodeError {
6515    fn from(natural: NodeError) -> Self {
6516        match natural {
6517            NodeError::Internal => WireNodeError::INTERNAL,
6518
6519            NodeError::NodeRemoved => WireNodeError::NODE_REMOVED,
6520
6521            NodeError::NameMissing => WireNodeError::NAME_MISSING,
6522
6523            NodeError::NameInvalid => WireNodeError::NAME_INVALID,
6524
6525            NodeError::NameAlreadyExists => WireNodeError::NAME_ALREADY_EXISTS,
6526
6527            NodeError::OfferSourceNameMissing => WireNodeError::OFFER_SOURCE_NAME_MISSING,
6528
6529            NodeError::OfferRefExists => WireNodeError::OFFER_REF_EXISTS,
6530
6531            NodeError::SymbolNameMissing => WireNodeError::SYMBOL_NAME_MISSING,
6532
6533            NodeError::SymbolAddressMissing => WireNodeError::SYMBOL_ADDRESS_MISSING,
6534
6535            NodeError::SymbolAlreadyExists => WireNodeError::SYMBOL_ALREADY_EXISTS,
6536
6537            NodeError::UnbindChildrenInProgress => WireNodeError::UNBIND_CHILDREN_IN_PROGRESS,
6538
6539            NodeError::UnsupportedArgs => WireNodeError::UNSUPPORTED_ARGS,
6540
6541            NodeError::UnknownOrdinal_(value) => {
6542                WireNodeError { value: ::fidl_next::WireU32::from(value) }
6543            }
6544        }
6545    }
6546}
6547
6548#[doc = " Arguments for adding a node.\n"]
6549#[derive(Debug, Default)]
6550pub struct NodeAddArgs {
6551    pub name: Option<String>,
6552
6553    pub offers: Option<Vec<::fidl_next_fuchsia_component_decl::Offer>>,
6554
6555    pub symbols: Option<Vec<crate::NodeSymbol>>,
6556
6557    pub properties: Option<Vec<crate::NodeProperty>>,
6558
6559    pub devfs_args: Option<crate::DevfsAddArgs>,
6560
6561    pub offers2: Option<Vec<crate::Offer>>,
6562
6563    pub bus_info: Option<crate::BusInfo>,
6564
6565    pub properties2: Option<Vec<crate::NodeProperty2>>,
6566}
6567
6568impl NodeAddArgs {
6569    fn __max_ordinal(&self) -> usize {
6570        if self.name.is_some() {
6571            return 1;
6572        }
6573
6574        if self.offers.is_some() {
6575            return 2;
6576        }
6577
6578        if self.symbols.is_some() {
6579            return 3;
6580        }
6581
6582        if self.properties.is_some() {
6583            return 4;
6584        }
6585
6586        if self.devfs_args.is_some() {
6587            return 5;
6588        }
6589
6590        if self.offers2.is_some() {
6591            return 6;
6592        }
6593
6594        if self.bus_info.is_some() {
6595            return 7;
6596        }
6597
6598        if self.properties2.is_some() {
6599            return 8;
6600        }
6601
6602        0
6603    }
6604}
6605
6606impl ::fidl_next::Encodable for NodeAddArgs {
6607    type Encoded = WireNodeAddArgs;
6608}
6609
6610unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAddArgs
6611where
6612    ___E: ::fidl_next::Encoder + ?Sized,
6613
6614    ___E: ::fidl_next::fuchsia::HandleEncoder,
6615{
6616    #[inline]
6617    fn encode(
6618        &mut self,
6619        encoder: &mut ___E,
6620        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6621    ) -> Result<(), ::fidl_next::EncodeError> {
6622        ::fidl_next::munge!(let WireNodeAddArgs { table } = out);
6623
6624        let max_ord = self.__max_ordinal();
6625
6626        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
6627        ::fidl_next::ZeroPadding::zero_padding(&mut out);
6628
6629        let mut preallocated =
6630            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
6631
6632        for i in 1..=max_ord {
6633            match i {
6634                8 => {
6635                    if let Some(properties2) = &mut self.properties2 {
6636                        ::fidl_next::WireEnvelope::encode_value(
6637                            properties2,
6638                            preallocated.encoder,
6639                            &mut out,
6640                        )?;
6641                    } else {
6642                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6643                    }
6644                }
6645
6646                7 => {
6647                    if let Some(bus_info) = &mut self.bus_info {
6648                        ::fidl_next::WireEnvelope::encode_value(
6649                            bus_info,
6650                            preallocated.encoder,
6651                            &mut out,
6652                        )?;
6653                    } else {
6654                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6655                    }
6656                }
6657
6658                6 => {
6659                    if let Some(offers2) = &mut self.offers2 {
6660                        ::fidl_next::WireEnvelope::encode_value(
6661                            offers2,
6662                            preallocated.encoder,
6663                            &mut out,
6664                        )?;
6665                    } else {
6666                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6667                    }
6668                }
6669
6670                5 => {
6671                    if let Some(devfs_args) = &mut self.devfs_args {
6672                        ::fidl_next::WireEnvelope::encode_value(
6673                            devfs_args,
6674                            preallocated.encoder,
6675                            &mut out,
6676                        )?;
6677                    } else {
6678                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6679                    }
6680                }
6681
6682                4 => {
6683                    if let Some(properties) = &mut self.properties {
6684                        ::fidl_next::WireEnvelope::encode_value(
6685                            properties,
6686                            preallocated.encoder,
6687                            &mut out,
6688                        )?;
6689                    } else {
6690                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6691                    }
6692                }
6693
6694                3 => {
6695                    if let Some(symbols) = &mut self.symbols {
6696                        ::fidl_next::WireEnvelope::encode_value(
6697                            symbols,
6698                            preallocated.encoder,
6699                            &mut out,
6700                        )?;
6701                    } else {
6702                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6703                    }
6704                }
6705
6706                2 => {
6707                    if let Some(offers) = &mut self.offers {
6708                        ::fidl_next::WireEnvelope::encode_value(
6709                            offers,
6710                            preallocated.encoder,
6711                            &mut out,
6712                        )?;
6713                    } else {
6714                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6715                    }
6716                }
6717
6718                1 => {
6719                    if let Some(name) = &mut self.name {
6720                        ::fidl_next::WireEnvelope::encode_value(
6721                            name,
6722                            preallocated.encoder,
6723                            &mut out,
6724                        )?;
6725                    } else {
6726                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
6727                    }
6728                }
6729
6730                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
6731            }
6732            unsafe {
6733                preallocated.write_next(out.assume_init_ref());
6734            }
6735        }
6736
6737        ::fidl_next::WireTable::encode_len(table, max_ord);
6738
6739        Ok(())
6740    }
6741}
6742
6743impl ::fidl_next::TakeFrom<WireNodeAddArgs> for NodeAddArgs {
6744    #[inline]
6745    fn take_from(from: &WireNodeAddArgs) -> Self {
6746        Self {
6747            name: from.name().map(::fidl_next::TakeFrom::take_from),
6748
6749            offers: from.offers().map(::fidl_next::TakeFrom::take_from),
6750
6751            symbols: from.symbols().map(::fidl_next::TakeFrom::take_from),
6752
6753            properties: from.properties().map(::fidl_next::TakeFrom::take_from),
6754
6755            devfs_args: from.devfs_args().map(::fidl_next::TakeFrom::take_from),
6756
6757            offers2: from.offers2().map(::fidl_next::TakeFrom::take_from),
6758
6759            bus_info: from.bus_info().map(::fidl_next::TakeFrom::take_from),
6760
6761            properties2: from.properties2().map(::fidl_next::TakeFrom::take_from),
6762        }
6763    }
6764}
6765
6766/// The wire type corresponding to [`NodeAddArgs`].
6767#[repr(C)]
6768pub struct WireNodeAddArgs {
6769    table: ::fidl_next::WireTable,
6770}
6771
6772unsafe impl ::fidl_next::ZeroPadding for WireNodeAddArgs {
6773    #[inline]
6774    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6775        ::fidl_next::munge!(let Self { table } = out);
6776        ::fidl_next::WireTable::zero_padding(table);
6777    }
6778}
6779
6780unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAddArgs
6781where
6782    ___D: ::fidl_next::Decoder + ?Sized,
6783
6784    ___D: ::fidl_next::fuchsia::HandleDecoder,
6785{
6786    fn decode(
6787        slot: ::fidl_next::Slot<'_, Self>,
6788        decoder: &mut ___D,
6789    ) -> Result<(), ::fidl_next::DecodeError> {
6790        ::fidl_next::munge!(let Self { table } = slot);
6791
6792        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6793            match ordinal {
6794                0 => unsafe { ::core::hint::unreachable_unchecked() },
6795
6796                1 => {
6797                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
6798                        slot.as_mut(),
6799                        decoder,
6800                    )?;
6801
6802                    let name = unsafe {
6803                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
6804                    };
6805
6806                    if name.len() > 128 {
6807                        return Err(::fidl_next::DecodeError::VectorTooLong {
6808                            size: name.len() as u64,
6809                            limit: 128,
6810                        });
6811                    }
6812
6813                    Ok(())
6814                }
6815
6816                2 => {
6817                    ::fidl_next::WireEnvelope::decode_as::<
6818                        ___D,
6819                        ::fidl_next::WireVector<::fidl_next_fuchsia_component_decl::WireOffer>,
6820                    >(slot.as_mut(), decoder)?;
6821
6822                    let offers =
6823                        unsafe {
6824                            slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<
6825                                ::fidl_next_fuchsia_component_decl::WireOffer,
6826                            >>()
6827                        };
6828
6829                    if offers.len() > 128 {
6830                        return Err(::fidl_next::DecodeError::VectorTooLong {
6831                            size: offers.len() as u64,
6832                            limit: 128,
6833                        });
6834                    }
6835
6836                    Ok(())
6837                }
6838
6839                3 => {
6840                    ::fidl_next::WireEnvelope::decode_as::<
6841                        ___D,
6842                        ::fidl_next::WireVector<crate::WireNodeSymbol>,
6843                    >(slot.as_mut(), decoder)?;
6844
6845                    let symbols = unsafe {
6846                        slot.deref_unchecked()
6847                            .deref_unchecked::<::fidl_next::WireVector<crate::WireNodeSymbol>>()
6848                    };
6849
6850                    if symbols.len() > 64 {
6851                        return Err(::fidl_next::DecodeError::VectorTooLong {
6852                            size: symbols.len() as u64,
6853                            limit: 64,
6854                        });
6855                    }
6856
6857                    Ok(())
6858                }
6859
6860                4 => {
6861                    ::fidl_next::WireEnvelope::decode_as::<
6862                        ___D,
6863                        ::fidl_next::WireVector<crate::WireNodeProperty>,
6864                    >(slot.as_mut(), decoder)?;
6865
6866                    let properties = unsafe {
6867                        slot.deref_unchecked()
6868                            .deref_unchecked::<::fidl_next::WireVector<crate::WireNodeProperty>>()
6869                    };
6870
6871                    if properties.len() > 64 {
6872                        return Err(::fidl_next::DecodeError::VectorTooLong {
6873                            size: properties.len() as u64,
6874                            limit: 64,
6875                        });
6876                    }
6877
6878                    Ok(())
6879                }
6880
6881                5 => {
6882                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDevfsAddArgs>(
6883                        slot.as_mut(),
6884                        decoder,
6885                    )?;
6886
6887                    Ok(())
6888                }
6889
6890                6 => {
6891                    ::fidl_next::WireEnvelope::decode_as::<
6892                        ___D,
6893                        ::fidl_next::WireVector<crate::WireOffer>,
6894                    >(slot.as_mut(), decoder)?;
6895
6896                    let offers2 = unsafe {
6897                        slot.deref_unchecked()
6898                            .deref_unchecked::<::fidl_next::WireVector<crate::WireOffer>>()
6899                    };
6900
6901                    if offers2.len() > 128 {
6902                        return Err(::fidl_next::DecodeError::VectorTooLong {
6903                            size: offers2.len() as u64,
6904                            limit: 128,
6905                        });
6906                    }
6907
6908                    Ok(())
6909                }
6910
6911                7 => {
6912                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireBusInfo>(
6913                        slot.as_mut(),
6914                        decoder,
6915                    )?;
6916
6917                    Ok(())
6918                }
6919
6920                8 => {
6921                    ::fidl_next::WireEnvelope::decode_as::<
6922                        ___D,
6923                        ::fidl_next::WireVector<crate::WireNodeProperty2>,
6924                    >(slot.as_mut(), decoder)?;
6925
6926                    let properties2 = unsafe {
6927                        slot.deref_unchecked()
6928                            .deref_unchecked::<::fidl_next::WireVector<crate::WireNodeProperty2>>()
6929                    };
6930
6931                    if properties2.len() > 64 {
6932                        return Err(::fidl_next::DecodeError::VectorTooLong {
6933                            size: properties2.len() as u64,
6934                            limit: 64,
6935                        });
6936                    }
6937
6938                    Ok(())
6939                }
6940
6941                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
6942            }
6943        })
6944    }
6945}
6946
6947impl WireNodeAddArgs {
6948    pub fn name(&self) -> Option<&::fidl_next::WireString> {
6949        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6950    }
6951
6952    pub fn offers(
6953        &self,
6954    ) -> Option<&::fidl_next::WireVector<::fidl_next_fuchsia_component_decl::WireOffer>> {
6955        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
6956    }
6957
6958    pub fn symbols(&self) -> Option<&::fidl_next::WireVector<crate::WireNodeSymbol>> {
6959        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
6960    }
6961
6962    pub fn properties(&self) -> Option<&::fidl_next::WireVector<crate::WireNodeProperty>> {
6963        unsafe { Some(self.table.get(4)?.deref_unchecked()) }
6964    }
6965
6966    pub fn devfs_args(&self) -> Option<&crate::WireDevfsAddArgs> {
6967        unsafe { Some(self.table.get(5)?.deref_unchecked()) }
6968    }
6969
6970    pub fn offers2(&self) -> Option<&::fidl_next::WireVector<crate::WireOffer>> {
6971        unsafe { Some(self.table.get(6)?.deref_unchecked()) }
6972    }
6973
6974    pub fn bus_info(&self) -> Option<&crate::WireBusInfo> {
6975        unsafe { Some(self.table.get(7)?.deref_unchecked()) }
6976    }
6977
6978    pub fn properties2(&self) -> Option<&::fidl_next::WireVector<crate::WireNodeProperty2>> {
6979        unsafe { Some(self.table.get(8)?.deref_unchecked()) }
6980    }
6981}
6982
6983impl ::core::fmt::Debug for WireNodeAddArgs {
6984    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
6985        f.debug_struct("NodeAddArgs")
6986            .field("name", &self.name())
6987            .field("offers", &self.offers())
6988            .field("symbols", &self.symbols())
6989            .field("properties", &self.properties())
6990            .field("devfs_args", &self.devfs_args())
6991            .field("offers2", &self.offers2())
6992            .field("bus_info", &self.bus_info())
6993            .field("properties2", &self.properties2())
6994            .finish()
6995    }
6996}
6997
6998#[derive(Debug)]
6999pub struct NodeAddChildRequest {
7000    pub args: crate::NodeAddArgs,
7001
7002    pub controller:
7003        ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::NodeController>,
7004
7005    pub node: ::fidl_next::ServerEnd<Option<::fidl_next::fuchsia::zx::Channel>, crate::Node>,
7006}
7007
7008impl ::fidl_next::Encodable for NodeAddChildRequest {
7009    type Encoded = WireNodeAddChildRequest;
7010}
7011
7012unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAddChildRequest
7013where
7014    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7015
7016    ___E: ::fidl_next::Encoder,
7017
7018    ___E: ::fidl_next::fuchsia::HandleEncoder,
7019{
7020    #[inline]
7021    fn encode(
7022        &mut self,
7023        encoder: &mut ___E,
7024        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7025    ) -> Result<(), ::fidl_next::EncodeError> {
7026        ::fidl_next::munge! {
7027            let Self::Encoded {
7028                args,
7029                controller,
7030                node,
7031
7032            } = out;
7033        }
7034
7035        ::fidl_next::Encode::encode(&mut self.args, encoder, args)?;
7036
7037        ::fidl_next::Encode::encode(&mut self.controller, encoder, controller)?;
7038
7039        ::fidl_next::Encode::encode(&mut self.node, encoder, node)?;
7040
7041        Ok(())
7042    }
7043}
7044
7045impl ::fidl_next::EncodableOption for Box<NodeAddChildRequest> {
7046    type EncodedOption = ::fidl_next::WireBox<WireNodeAddChildRequest>;
7047}
7048
7049unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeAddChildRequest>
7050where
7051    ___E: ::fidl_next::Encoder + ?Sized,
7052    NodeAddChildRequest: ::fidl_next::Encode<___E>,
7053{
7054    #[inline]
7055    fn encode_option(
7056        this: Option<&mut Self>,
7057        encoder: &mut ___E,
7058        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7059    ) -> Result<(), ::fidl_next::EncodeError> {
7060        if let Some(inner) = this {
7061            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7062            ::fidl_next::WireBox::encode_present(out);
7063        } else {
7064            ::fidl_next::WireBox::encode_absent(out);
7065        }
7066
7067        Ok(())
7068    }
7069}
7070
7071impl ::fidl_next::TakeFrom<WireNodeAddChildRequest> for NodeAddChildRequest {
7072    #[inline]
7073    fn take_from(from: &WireNodeAddChildRequest) -> Self {
7074        Self {
7075            args: ::fidl_next::TakeFrom::take_from(&from.args),
7076
7077            controller: ::fidl_next::TakeFrom::take_from(&from.controller),
7078
7079            node: ::fidl_next::TakeFrom::take_from(&from.node),
7080        }
7081    }
7082}
7083
7084/// The wire type corresponding to [`NodeAddChildRequest`].
7085#[derive(Debug)]
7086#[repr(C)]
7087pub struct WireNodeAddChildRequest {
7088    pub args: crate::WireNodeAddArgs,
7089
7090    pub controller:
7091        ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::NodeController>,
7092
7093    pub node: ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireOptionalChannel, crate::Node>,
7094}
7095
7096unsafe impl ::fidl_next::ZeroPadding for WireNodeAddChildRequest {
7097    #[inline]
7098    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
7099}
7100
7101unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAddChildRequest
7102where
7103    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7104
7105    ___D: ::fidl_next::Decoder,
7106
7107    ___D: ::fidl_next::fuchsia::HandleDecoder,
7108{
7109    fn decode(
7110        slot: ::fidl_next::Slot<'_, Self>,
7111        decoder: &mut ___D,
7112    ) -> Result<(), ::fidl_next::DecodeError> {
7113        ::fidl_next::munge! {
7114            let Self {
7115                mut args,
7116                mut controller,
7117                mut node,
7118
7119            } = slot;
7120        }
7121
7122        ::fidl_next::Decode::decode(args.as_mut(), decoder)?;
7123
7124        ::fidl_next::Decode::decode(controller.as_mut(), decoder)?;
7125
7126        ::fidl_next::Decode::decode(node.as_mut(), decoder)?;
7127
7128        Ok(())
7129    }
7130}
7131
7132/// The type corresponding to the Node protocol.
7133#[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"]
7134#[derive(Debug)]
7135pub struct Node;
7136
7137pub mod node {
7138    pub mod prelude {
7139        pub use crate::{
7140            node, Node, NodeClientHandler, NodeClientSender, NodeServerHandler, NodeServerSender,
7141        };
7142
7143        pub use crate::NodeAddChildRequest;
7144
7145        pub use crate::NodeError;
7146
7147        pub use crate::NodeAddChildResponse;
7148    }
7149
7150    pub struct AddChild;
7151
7152    impl ::fidl_next::Method for AddChild {
7153        const ORDINAL: u64 = 8633697350522413353;
7154
7155        type Protocol = crate::Node;
7156
7157        type Request = crate::WireNodeAddChildRequest;
7158
7159        type Response =
7160            ::fidl_next::WireFlexibleResult<crate::WireNodeAddChildResponse, crate::WireNodeError>;
7161    }
7162}
7163
7164/// A helper trait for the `Node` client sender.
7165pub trait NodeClientSender {
7166    type Transport: ::fidl_next::Transport;
7167
7168    #[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"]
7169    fn add_child<___R>(
7170        &self,
7171        request: &mut ___R,
7172    ) -> Result<
7173        ::fidl_next::ResponseFuture<'_, Self::Transport, node::AddChild>,
7174        ::fidl_next::EncodeError,
7175    >
7176    where
7177        ___R: ::fidl_next::Encode<
7178            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
7179            Encoded = crate::WireNodeAddChildRequest,
7180        >;
7181}
7182
7183impl<___T> NodeClientSender for ::fidl_next::ClientSender<___T, Node>
7184where
7185    ___T: ::fidl_next::Transport,
7186{
7187    type Transport = ___T;
7188
7189    #[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"]
7190    fn add_child<___R>(
7191        &self,
7192        request: &mut ___R,
7193    ) -> Result<
7194        ::fidl_next::ResponseFuture<'_, Self::Transport, node::AddChild>,
7195        ::fidl_next::EncodeError,
7196    >
7197    where
7198        ___R: ::fidl_next::Encode<
7199            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
7200            Encoded = crate::WireNodeAddChildRequest,
7201        >,
7202    {
7203        self.as_untyped()
7204            .send_two_way(8633697350522413353, request)
7205            .map(::fidl_next::ResponseFuture::from_untyped)
7206    }
7207}
7208
7209/// A client handler for the Node protocol.
7210///
7211/// See [`Node`] for more details.
7212pub trait NodeClientHandler<___T: ::fidl_next::Transport> {
7213    fn on_unknown_interaction(
7214        &mut self,
7215        sender: &::fidl_next::ClientSender<___T, Node>,
7216        ordinal: u64,
7217    ) {
7218        sender.close();
7219    }
7220}
7221
7222impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Node
7223where
7224    ___T: ::fidl_next::Transport,
7225    ___H: NodeClientHandler<___T>,
7226
7227    <node::AddChild as ::fidl_next::Method>::Response:
7228        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7229{
7230    fn on_event(
7231        handler: &mut ___H,
7232        sender: &::fidl_next::ClientSender<___T, Self>,
7233        ordinal: u64,
7234        buffer: ___T::RecvBuffer,
7235    ) {
7236        match ordinal {
7237            ordinal => handler.on_unknown_interaction(sender, ordinal),
7238        }
7239    }
7240}
7241
7242/// A helper trait for the `Node` server sender.
7243pub trait NodeServerSender {
7244    type Transport: ::fidl_next::Transport;
7245}
7246
7247impl<___T> NodeServerSender for ::fidl_next::ServerSender<___T, Node>
7248where
7249    ___T: ::fidl_next::Transport,
7250{
7251    type Transport = ___T;
7252}
7253
7254/// A server handler for the Node protocol.
7255///
7256/// See [`Node`] for more details.
7257pub trait NodeServerHandler<___T: ::fidl_next::Transport> {
7258    #[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"]
7259    fn add_child(
7260        &mut self,
7261        sender: &::fidl_next::ServerSender<___T, Node>,
7262
7263        request: ::fidl_next::Request<___T, node::AddChild>,
7264
7265        responder: ::fidl_next::Responder<node::AddChild>,
7266    );
7267
7268    fn on_unknown_interaction(
7269        &mut self,
7270        sender: &::fidl_next::ServerSender<___T, Node>,
7271        ordinal: u64,
7272    ) {
7273        sender.close();
7274    }
7275}
7276
7277impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Node
7278where
7279    ___T: ::fidl_next::Transport,
7280    ___H: NodeServerHandler<___T>,
7281
7282    crate::WireNodeAddChildRequest:
7283        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7284{
7285    fn on_one_way(
7286        handler: &mut ___H,
7287        sender: &::fidl_next::ServerSender<___T, Self>,
7288        ordinal: u64,
7289        buffer: ___T::RecvBuffer,
7290    ) {
7291        match ordinal {
7292            ordinal => handler.on_unknown_interaction(sender, ordinal),
7293        }
7294    }
7295
7296    fn on_two_way(
7297        handler: &mut ___H,
7298        sender: &::fidl_next::ServerSender<___T, Self>,
7299        ordinal: u64,
7300        buffer: ___T::RecvBuffer,
7301        responder: ::fidl_next::protocol::Responder,
7302    ) {
7303        match ordinal {
7304            8633697350522413353 => {
7305                let responder = ::fidl_next::Responder::from_untyped(responder);
7306
7307                match ::fidl_next::DecoderExt::decode(buffer) {
7308                    Ok(decoded) => handler.add_child(sender, decoded, responder),
7309                    Err(e) => {
7310                        sender.close();
7311                    }
7312                }
7313            }
7314
7315            ordinal => handler.on_unknown_interaction(sender, ordinal),
7316        }
7317    }
7318}
7319
7320#[derive(Clone, Debug, Default)]
7321pub struct NodeControllerRequestBindRequest {
7322    pub force_rebind: Option<bool>,
7323
7324    pub driver_url_suffix: Option<String>,
7325}
7326
7327impl NodeControllerRequestBindRequest {
7328    fn __max_ordinal(&self) -> usize {
7329        if self.force_rebind.is_some() {
7330            return 1;
7331        }
7332
7333        if self.driver_url_suffix.is_some() {
7334            return 2;
7335        }
7336
7337        0
7338    }
7339}
7340
7341impl ::fidl_next::Encodable for NodeControllerRequestBindRequest {
7342    type Encoded = WireNodeControllerRequestBindRequest;
7343}
7344
7345unsafe impl<___E> ::fidl_next::Encode<___E> for NodeControllerRequestBindRequest
7346where
7347    ___E: ::fidl_next::Encoder + ?Sized,
7348{
7349    #[inline]
7350    fn encode(
7351        &mut self,
7352        encoder: &mut ___E,
7353        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7354    ) -> Result<(), ::fidl_next::EncodeError> {
7355        ::fidl_next::munge!(let WireNodeControllerRequestBindRequest { table } = out);
7356
7357        let max_ord = self.__max_ordinal();
7358
7359        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7360        ::fidl_next::ZeroPadding::zero_padding(&mut out);
7361
7362        let mut preallocated =
7363            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7364
7365        for i in 1..=max_ord {
7366            match i {
7367                2 => {
7368                    if let Some(driver_url_suffix) = &mut self.driver_url_suffix {
7369                        ::fidl_next::WireEnvelope::encode_value(
7370                            driver_url_suffix,
7371                            preallocated.encoder,
7372                            &mut out,
7373                        )?;
7374                    } else {
7375                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
7376                    }
7377                }
7378
7379                1 => {
7380                    if let Some(force_rebind) = &mut self.force_rebind {
7381                        ::fidl_next::WireEnvelope::encode_value(
7382                            force_rebind,
7383                            preallocated.encoder,
7384                            &mut out,
7385                        )?;
7386                    } else {
7387                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
7388                    }
7389                }
7390
7391                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7392            }
7393            unsafe {
7394                preallocated.write_next(out.assume_init_ref());
7395            }
7396        }
7397
7398        ::fidl_next::WireTable::encode_len(table, max_ord);
7399
7400        Ok(())
7401    }
7402}
7403
7404impl ::fidl_next::TakeFrom<WireNodeControllerRequestBindRequest>
7405    for NodeControllerRequestBindRequest
7406{
7407    #[inline]
7408    fn take_from(from: &WireNodeControllerRequestBindRequest) -> Self {
7409        Self {
7410            force_rebind: from.force_rebind().map(::fidl_next::TakeFrom::take_from),
7411
7412            driver_url_suffix: from.driver_url_suffix().map(::fidl_next::TakeFrom::take_from),
7413        }
7414    }
7415}
7416
7417/// The wire type corresponding to [`NodeControllerRequestBindRequest`].
7418#[repr(C)]
7419pub struct WireNodeControllerRequestBindRequest {
7420    table: ::fidl_next::WireTable,
7421}
7422
7423unsafe impl ::fidl_next::ZeroPadding for WireNodeControllerRequestBindRequest {
7424    #[inline]
7425    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7426        ::fidl_next::munge!(let Self { table } = out);
7427        ::fidl_next::WireTable::zero_padding(table);
7428    }
7429}
7430
7431unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeControllerRequestBindRequest
7432where
7433    ___D: ::fidl_next::Decoder + ?Sized,
7434{
7435    fn decode(
7436        slot: ::fidl_next::Slot<'_, Self>,
7437        decoder: &mut ___D,
7438    ) -> Result<(), ::fidl_next::DecodeError> {
7439        ::fidl_next::munge!(let Self { table } = slot);
7440
7441        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
7442            match ordinal {
7443                0 => unsafe { ::core::hint::unreachable_unchecked() },
7444
7445                1 => {
7446                    ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
7447
7448                    Ok(())
7449                }
7450
7451                2 => {
7452                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
7453                        slot.as_mut(),
7454                        decoder,
7455                    )?;
7456
7457                    Ok(())
7458                }
7459
7460                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
7461            }
7462        })
7463    }
7464}
7465
7466impl WireNodeControllerRequestBindRequest {
7467    pub fn force_rebind(&self) -> Option<&bool> {
7468        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
7469    }
7470
7471    pub fn driver_url_suffix(&self) -> Option<&::fidl_next::WireString> {
7472        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
7473    }
7474}
7475
7476impl ::core::fmt::Debug for WireNodeControllerRequestBindRequest {
7477    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
7478        f.debug_struct("NodeControllerRequestBindRequest")
7479            .field("force_rebind", &self.force_rebind())
7480            .field("driver_url_suffix", &self.driver_url_suffix())
7481            .finish()
7482    }
7483}
7484
7485pub type NodeControllerRequestBindResponse = ();
7486
7487/// The wire type corresponding to [`NodeControllerRequestBindResponse`].
7488pub type WireNodeControllerRequestBindResponse = ();
7489
7490/// The type corresponding to the NodeController protocol.
7491#[doc = " Protocol through which a parent node controls one of its children.\n"]
7492#[derive(Debug)]
7493pub struct NodeController;
7494
7495pub mod node_controller {
7496    pub mod prelude {
7497        pub use crate::{
7498            node_controller, NodeController, NodeControllerClientHandler,
7499            NodeControllerClientSender, NodeControllerServerHandler, NodeControllerServerSender,
7500        };
7501
7502        pub use crate::NodeControllerRequestBindRequest;
7503
7504        pub use crate::NodeControllerRequestBindResponse;
7505    }
7506
7507    pub struct Remove;
7508
7509    impl ::fidl_next::Method for Remove {
7510        const ORDINAL: u64 = 6123359741742396225;
7511
7512        type Protocol = crate::NodeController;
7513
7514        type Request = ();
7515
7516        type Response = ::fidl_next::Never;
7517    }
7518
7519    pub struct RequestBind;
7520
7521    impl ::fidl_next::Method for RequestBind {
7522        const ORDINAL: u64 = 4735909333556220047;
7523
7524        type Protocol = crate::NodeController;
7525
7526        type Request = crate::WireNodeControllerRequestBindRequest;
7527
7528        type Response = ::fidl_next::WireFlexibleResult<
7529            crate::WireNodeControllerRequestBindResponse,
7530            ::fidl_next::WireI32,
7531        >;
7532    }
7533
7534    pub struct OnBind;
7535
7536    impl ::fidl_next::Method for OnBind {
7537        const ORDINAL: u64 = 5905369594807853098;
7538
7539        type Protocol = crate::NodeController;
7540
7541        type Request = ::fidl_next::Never;
7542
7543        type Response = ();
7544    }
7545}
7546
7547/// A helper trait for the `NodeController` client sender.
7548pub trait NodeControllerClientSender {
7549    type Transport: ::fidl_next::Transport;
7550
7551    #[doc = " Removes the node and all of its children.\n"]
7552    fn remove(
7553        &self,
7554    ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>;
7555
7556    #[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"]
7557    fn request_bind<___R>(
7558        &self,
7559        request: &mut ___R,
7560    ) -> Result<
7561        ::fidl_next::ResponseFuture<'_, Self::Transport, node_controller::RequestBind>,
7562        ::fidl_next::EncodeError,
7563    >
7564    where
7565        ___R: ::fidl_next::Encode<
7566            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
7567            Encoded = crate::WireNodeControllerRequestBindRequest,
7568        >;
7569}
7570
7571impl<___T> NodeControllerClientSender for ::fidl_next::ClientSender<___T, NodeController>
7572where
7573    ___T: ::fidl_next::Transport,
7574{
7575    type Transport = ___T;
7576
7577    #[doc = " Removes the node and all of its children.\n"]
7578    fn remove(
7579        &self,
7580    ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError> {
7581        self.as_untyped().send_one_way(6123359741742396225, &mut ())
7582    }
7583
7584    #[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"]
7585    fn request_bind<___R>(
7586        &self,
7587        request: &mut ___R,
7588    ) -> Result<
7589        ::fidl_next::ResponseFuture<'_, Self::Transport, node_controller::RequestBind>,
7590        ::fidl_next::EncodeError,
7591    >
7592    where
7593        ___R: ::fidl_next::Encode<
7594            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
7595            Encoded = crate::WireNodeControllerRequestBindRequest,
7596        >,
7597    {
7598        self.as_untyped()
7599            .send_two_way(4735909333556220047, request)
7600            .map(::fidl_next::ResponseFuture::from_untyped)
7601    }
7602}
7603
7604/// A client handler for the NodeController protocol.
7605///
7606/// See [`NodeController`] for more details.
7607pub trait NodeControllerClientHandler<___T: ::fidl_next::Transport> {
7608    #[doc = " Event that is triggered when the associated `Node` is bound to a driver.\n"]
7609    fn on_bind(&mut self, sender: &::fidl_next::ClientSender<___T, NodeController>);
7610
7611    fn on_unknown_interaction(
7612        &mut self,
7613        sender: &::fidl_next::ClientSender<___T, NodeController>,
7614        ordinal: u64,
7615    ) {
7616        sender.close();
7617    }
7618}
7619
7620impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for NodeController
7621where
7622    ___T: ::fidl_next::Transport,
7623    ___H: NodeControllerClientHandler<___T>,
7624
7625    <node_controller::RequestBind as ::fidl_next::Method>::Response:
7626        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7627{
7628    fn on_event(
7629        handler: &mut ___H,
7630        sender: &::fidl_next::ClientSender<___T, Self>,
7631        ordinal: u64,
7632        buffer: ___T::RecvBuffer,
7633    ) {
7634        match ordinal {
7635            5905369594807853098 => {
7636                handler.on_bind(sender);
7637            }
7638
7639            ordinal => handler.on_unknown_interaction(sender, ordinal),
7640        }
7641    }
7642}
7643
7644/// A helper trait for the `NodeController` server sender.
7645pub trait NodeControllerServerSender {
7646    type Transport: ::fidl_next::Transport;
7647
7648    #[doc = " Event that is triggered when the associated `Node` is bound to a driver.\n"]
7649    fn on_bind(
7650        &self,
7651    ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>;
7652}
7653
7654impl<___T> NodeControllerServerSender for ::fidl_next::ServerSender<___T, NodeController>
7655where
7656    ___T: ::fidl_next::Transport,
7657{
7658    type Transport = ___T;
7659
7660    #[doc = " Event that is triggered when the associated `Node` is bound to a driver.\n"]
7661    fn on_bind(
7662        &self,
7663    ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError> {
7664        self.as_untyped().send_event(5905369594807853098, &mut ())
7665    }
7666}
7667
7668/// A server handler for the NodeController protocol.
7669///
7670/// See [`NodeController`] for more details.
7671pub trait NodeControllerServerHandler<___T: ::fidl_next::Transport> {
7672    #[doc = " Removes the node and all of its children.\n"]
7673    fn remove(&mut self, sender: &::fidl_next::ServerSender<___T, NodeController>);
7674
7675    #[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"]
7676    fn request_bind(
7677        &mut self,
7678        sender: &::fidl_next::ServerSender<___T, NodeController>,
7679
7680        request: ::fidl_next::Request<___T, node_controller::RequestBind>,
7681
7682        responder: ::fidl_next::Responder<node_controller::RequestBind>,
7683    );
7684
7685    fn on_unknown_interaction(
7686        &mut self,
7687        sender: &::fidl_next::ServerSender<___T, NodeController>,
7688        ordinal: u64,
7689    ) {
7690        sender.close();
7691    }
7692}
7693
7694impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for NodeController
7695where
7696    ___T: ::fidl_next::Transport,
7697    ___H: NodeControllerServerHandler<___T>,
7698
7699    crate::WireNodeControllerRequestBindRequest:
7700        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7701{
7702    fn on_one_way(
7703        handler: &mut ___H,
7704        sender: &::fidl_next::ServerSender<___T, Self>,
7705        ordinal: u64,
7706        buffer: ___T::RecvBuffer,
7707    ) {
7708        match ordinal {
7709            6123359741742396225 => {
7710                handler.remove(sender);
7711            }
7712
7713            ordinal => handler.on_unknown_interaction(sender, ordinal),
7714        }
7715    }
7716
7717    fn on_two_way(
7718        handler: &mut ___H,
7719        sender: &::fidl_next::ServerSender<___T, Self>,
7720        ordinal: u64,
7721        buffer: ___T::RecvBuffer,
7722        responder: ::fidl_next::protocol::Responder,
7723    ) {
7724        match ordinal {
7725            4735909333556220047 => {
7726                let responder = ::fidl_next::Responder::from_untyped(responder);
7727
7728                match ::fidl_next::DecoderExt::decode(buffer) {
7729                    Ok(decoded) => handler.request_bind(sender, decoded, responder),
7730                    Err(e) => {
7731                        sender.close();
7732                    }
7733                }
7734            }
7735
7736            ordinal => handler.on_unknown_interaction(sender, ordinal),
7737        }
7738    }
7739}
7740
7741/// Compatibility shims which mimic some API surfaces of the current Rust bindings.
7742pub mod compat {
7743
7744    impl ::fidl_next::TakeFrom<crate::WireNodePropertyKey>
7745        for ::fidl_fuchsia_driver_framework::NodePropertyKey
7746    {
7747        #[inline]
7748        fn take_from(from: &crate::WireNodePropertyKey) -> Self {
7749            match from.as_ref() {
7750                crate::node_property_key::Ref::IntValue(value) => {
7751                    Self::IntValue(::fidl_next::TakeFrom::take_from(value))
7752                }
7753
7754                crate::node_property_key::Ref::StringValue(value) => {
7755                    Self::StringValue(::fidl_next::TakeFrom::take_from(value))
7756                }
7757            }
7758        }
7759    }
7760
7761    impl ::fidl_next::TakeFrom<crate::WireOptionalNodePropertyKey>
7762        for Option<Box<::fidl_fuchsia_driver_framework::NodePropertyKey>>
7763    {
7764        #[inline]
7765        fn take_from(from: &crate::WireOptionalNodePropertyKey) -> Self {
7766            if let Some(inner) = from.as_ref() {
7767                Some(::fidl_next::TakeFrom::take_from(inner))
7768            } else {
7769                None
7770            }
7771        }
7772    }
7773
7774    impl ::fidl_next::TakeFrom<crate::WireCondition> for ::fidl_fuchsia_driver_framework::Condition {
7775        #[inline]
7776        fn take_from(from: &crate::WireCondition) -> Self {
7777            match crate::Condition::from(*from) {
7778                crate::Condition::Unknown => Self::Unknown,
7779
7780                crate::Condition::Accept => Self::Accept,
7781
7782                crate::Condition::Reject => Self::Reject,
7783            }
7784        }
7785    }
7786
7787    impl ::fidl_next::TakeFrom<crate::WireNodePropertyValue>
7788        for ::fidl_fuchsia_driver_framework::NodePropertyValue
7789    {
7790        #[inline]
7791        fn take_from(from: &crate::WireNodePropertyValue) -> Self {
7792            match from.as_ref() {
7793                crate::node_property_value::Ref::IntValue(value) => {
7794                    Self::IntValue(::fidl_next::TakeFrom::take_from(value))
7795                }
7796
7797                crate::node_property_value::Ref::StringValue(value) => {
7798                    Self::StringValue(::fidl_next::TakeFrom::take_from(value))
7799                }
7800
7801                crate::node_property_value::Ref::BoolValue(value) => {
7802                    Self::BoolValue(::fidl_next::TakeFrom::take_from(value))
7803                }
7804
7805                crate::node_property_value::Ref::EnumValue(value) => {
7806                    Self::EnumValue(::fidl_next::TakeFrom::take_from(value))
7807                }
7808
7809                crate::node_property_value::Ref::UnknownOrdinal_(unknown_ordinal) => {
7810                    Self::__SourceBreaking { unknown_ordinal }
7811                }
7812            }
7813        }
7814    }
7815
7816    impl ::fidl_next::TakeFrom<crate::WireOptionalNodePropertyValue>
7817        for Option<Box<::fidl_fuchsia_driver_framework::NodePropertyValue>>
7818    {
7819        #[inline]
7820        fn take_from(from: &crate::WireOptionalNodePropertyValue) -> Self {
7821            if let Some(inner) = from.as_ref() {
7822                Some(::fidl_next::TakeFrom::take_from(inner))
7823            } else {
7824                None
7825            }
7826        }
7827    }
7828
7829    impl ::fidl_next::TakeFrom<crate::WireBindRule> for ::fidl_fuchsia_driver_framework::BindRule {
7830        #[inline]
7831        fn take_from(from: &crate::WireBindRule) -> Self {
7832            Self {
7833                key: ::fidl_next::TakeFrom::take_from(&from.key),
7834
7835                condition: ::fidl_next::TakeFrom::take_from(&from.condition),
7836
7837                values: ::fidl_next::TakeFrom::take_from(&from.values),
7838            }
7839        }
7840    }
7841
7842    impl ::fidl_next::TakeFrom<crate::WireBindRule2> for ::fidl_fuchsia_driver_framework::BindRule2 {
7843        #[inline]
7844        fn take_from(from: &crate::WireBindRule2) -> Self {
7845            Self {
7846                key: ::fidl_next::TakeFrom::take_from(&from.key),
7847
7848                condition: ::fidl_next::TakeFrom::take_from(&from.condition),
7849
7850                values: ::fidl_next::TakeFrom::take_from(&from.values),
7851            }
7852        }
7853    }
7854
7855    impl ::fidl_next::TakeFrom<crate::WireBusType> for ::fidl_fuchsia_driver_framework::BusType {
7856        #[inline]
7857        fn take_from(from: &crate::WireBusType) -> Self {
7858            match crate::BusType::from(*from) {
7859                crate::BusType::Platform => Self::Platform,
7860
7861                crate::BusType::Acpi => Self::Acpi,
7862
7863                crate::BusType::DeviceTree => Self::DeviceTree,
7864
7865                crate::BusType::Pci => Self::Pci,
7866
7867                crate::BusType::Usb => Self::Usb,
7868
7869                crate::BusType::Gpio => Self::Gpio,
7870
7871                crate::BusType::I2C => Self::I2C,
7872
7873                crate::BusType::Spi => Self::Spi,
7874
7875                crate::BusType::Sdio => Self::Sdio,
7876
7877                crate::BusType::Uart => Self::Uart,
7878
7879                crate::BusType::Spmi => Self::Spmi,
7880
7881                crate::BusType::UnknownOrdinal_(value) => {
7882                    Self::__SourceBreaking { unknown_ordinal: value }
7883                }
7884            }
7885        }
7886    }
7887
7888    impl ::fidl_next::TakeFrom<crate::WireDeviceAddress>
7889        for ::fidl_fuchsia_driver_framework::DeviceAddress
7890    {
7891        #[inline]
7892        fn take_from(from: &crate::WireDeviceAddress) -> Self {
7893            match from.as_ref() {
7894                crate::device_address::Ref::IntValue(value) => {
7895                    Self::IntValue(::fidl_next::TakeFrom::take_from(value))
7896                }
7897
7898                crate::device_address::Ref::ArrayIntValue(value) => {
7899                    Self::ArrayIntValue(::fidl_next::TakeFrom::take_from(value))
7900                }
7901
7902                crate::device_address::Ref::CharIntValue(value) => {
7903                    Self::CharIntValue(::fidl_next::TakeFrom::take_from(value))
7904                }
7905
7906                crate::device_address::Ref::ArrayCharIntValue(value) => {
7907                    Self::ArrayCharIntValue(::fidl_next::TakeFrom::take_from(value))
7908                }
7909
7910                crate::device_address::Ref::StringValue(value) => {
7911                    Self::StringValue(::fidl_next::TakeFrom::take_from(value))
7912                }
7913
7914                crate::device_address::Ref::UnknownOrdinal_(unknown_ordinal) => {
7915                    Self::__SourceBreaking { unknown_ordinal }
7916                }
7917            }
7918        }
7919    }
7920
7921    impl ::fidl_next::TakeFrom<crate::WireOptionalDeviceAddress>
7922        for Option<Box<::fidl_fuchsia_driver_framework::DeviceAddress>>
7923    {
7924        #[inline]
7925        fn take_from(from: &crate::WireOptionalDeviceAddress) -> Self {
7926            if let Some(inner) = from.as_ref() {
7927                Some(::fidl_next::TakeFrom::take_from(inner))
7928            } else {
7929                None
7930            }
7931        }
7932    }
7933
7934    impl ::fidl_next::TakeFrom<crate::WireDeviceAddressStability>
7935        for ::fidl_fuchsia_driver_framework::DeviceAddressStability
7936    {
7937        #[inline]
7938        fn take_from(from: &crate::WireDeviceAddressStability) -> Self {
7939            match crate::DeviceAddressStability::from(*from) {
7940                crate::DeviceAddressStability::UnstableBetweenDriverRestart => {
7941                    Self::UnstableBetweenDriverRestart
7942                }
7943
7944                crate::DeviceAddressStability::UnstableBetweenBoot => Self::UnstableBetweenBoot,
7945
7946                crate::DeviceAddressStability::UnstableBetweenSoftwareUpdate => {
7947                    Self::UnstableBetweenSoftwareUpdate
7948                }
7949
7950                crate::DeviceAddressStability::Stable => Self::Stable,
7951
7952                crate::DeviceAddressStability::UnknownOrdinal_(value) => {
7953                    Self::__SourceBreaking { unknown_ordinal: value }
7954                }
7955            }
7956        }
7957    }
7958
7959    impl ::fidl_next::TakeFrom<crate::WireBusInfo> for ::fidl_fuchsia_driver_framework::BusInfo {
7960        #[inline]
7961        fn take_from(from: &crate::WireBusInfo) -> Self {
7962            Self {
7963                bus: from.bus().map(::fidl_next::TakeFrom::take_from),
7964
7965                address: from.address().map(::fidl_next::TakeFrom::take_from),
7966
7967                address_stability: from.address_stability().map(::fidl_next::TakeFrom::take_from),
7968
7969                __source_breaking: ::fidl::marker::SourceBreaking,
7970            }
7971        }
7972    }
7973
7974    impl ::fidl_next::TakeFrom<crate::WireDriverPackageType>
7975        for ::fidl_fuchsia_driver_framework::DriverPackageType
7976    {
7977        #[inline]
7978        fn take_from(from: &crate::WireDriverPackageType) -> Self {
7979            match crate::DriverPackageType::from(*from) {
7980                crate::DriverPackageType::Boot => Self::Boot,
7981
7982                crate::DriverPackageType::Base => Self::Base,
7983
7984                crate::DriverPackageType::Cached => Self::Cached,
7985
7986                crate::DriverPackageType::Universe => Self::Universe,
7987
7988                crate::DriverPackageType::UnknownOrdinal_(value) => {
7989                    Self::__SourceBreaking { unknown_ordinal: value }
7990                }
7991            }
7992        }
7993    }
7994
7995    impl ::fidl_next::TakeFrom<crate::WireDeviceCategory>
7996        for ::fidl_fuchsia_driver_framework::DeviceCategory
7997    {
7998        #[inline]
7999        fn take_from(from: &crate::WireDeviceCategory) -> Self {
8000            Self {
8001                category: from.category().map(::fidl_next::TakeFrom::take_from),
8002
8003                subcategory: from.subcategory().map(::fidl_next::TakeFrom::take_from),
8004
8005                __source_breaking: ::fidl::marker::SourceBreaking,
8006            }
8007        }
8008    }
8009
8010    impl ::fidl_next::TakeFrom<crate::WireDriverInfo> for ::fidl_fuchsia_driver_framework::DriverInfo {
8011        #[inline]
8012        fn take_from(from: &crate::WireDriverInfo) -> Self {
8013            Self {
8014                url: from.url().map(::fidl_next::TakeFrom::take_from),
8015
8016                name: from.name().map(::fidl_next::TakeFrom::take_from),
8017
8018                colocate: from.colocate().map(::fidl_next::TakeFrom::take_from),
8019
8020                package_type: from.package_type().map(::fidl_next::TakeFrom::take_from),
8021
8022                is_fallback: from.is_fallback().map(::fidl_next::TakeFrom::take_from),
8023
8024                device_categories: from.device_categories().map(::fidl_next::TakeFrom::take_from),
8025
8026                bind_rules_bytecode: from
8027                    .bind_rules_bytecode()
8028                    .map(::fidl_next::TakeFrom::take_from),
8029
8030                driver_framework_version: from
8031                    .driver_framework_version()
8032                    .map(::fidl_next::TakeFrom::take_from),
8033
8034                is_disabled: from.is_disabled().map(::fidl_next::TakeFrom::take_from),
8035
8036                __source_breaking: ::fidl::marker::SourceBreaking,
8037            }
8038        }
8039    }
8040
8041    impl ::fidl_next::TakeFrom<crate::WireCompositeDriverInfo>
8042        for ::fidl_fuchsia_driver_framework::CompositeDriverInfo
8043    {
8044        #[inline]
8045        fn take_from(from: &crate::WireCompositeDriverInfo) -> Self {
8046            Self {
8047                composite_name: from.composite_name().map(::fidl_next::TakeFrom::take_from),
8048
8049                driver_info: from.driver_info().map(::fidl_next::TakeFrom::take_from),
8050
8051                __source_breaking: ::fidl::marker::SourceBreaking,
8052            }
8053        }
8054    }
8055
8056    impl ::fidl_next::TakeFrom<crate::WireCompositeDriverMatch>
8057        for ::fidl_fuchsia_driver_framework::CompositeDriverMatch
8058    {
8059        #[inline]
8060        fn take_from(from: &crate::WireCompositeDriverMatch) -> Self {
8061            Self {
8062                composite_driver: from.composite_driver().map(::fidl_next::TakeFrom::take_from),
8063
8064                parent_names: from.parent_names().map(::fidl_next::TakeFrom::take_from),
8065
8066                primary_parent_index: from
8067                    .primary_parent_index()
8068                    .map(::fidl_next::TakeFrom::take_from),
8069
8070                __source_breaking: ::fidl::marker::SourceBreaking,
8071            }
8072        }
8073    }
8074
8075    impl ::fidl_next::TakeFrom<crate::WireNodeProperty>
8076        for ::fidl_fuchsia_driver_framework::NodeProperty
8077    {
8078        #[inline]
8079        fn take_from(from: &crate::WireNodeProperty) -> Self {
8080            Self {
8081                key: ::fidl_next::TakeFrom::take_from(&from.key),
8082
8083                value: ::fidl_next::TakeFrom::take_from(&from.value),
8084            }
8085        }
8086    }
8087
8088    impl ::fidl_next::TakeFrom<crate::WireParentSpec> for ::fidl_fuchsia_driver_framework::ParentSpec {
8089        #[inline]
8090        fn take_from(from: &crate::WireParentSpec) -> Self {
8091            Self {
8092                bind_rules: ::fidl_next::TakeFrom::take_from(&from.bind_rules),
8093
8094                properties: ::fidl_next::TakeFrom::take_from(&from.properties),
8095            }
8096        }
8097    }
8098
8099    impl ::fidl_next::TakeFrom<crate::WireNodeProperty2>
8100        for ::fidl_fuchsia_driver_framework::NodeProperty2
8101    {
8102        #[inline]
8103        fn take_from(from: &crate::WireNodeProperty2) -> Self {
8104            Self {
8105                key: ::fidl_next::TakeFrom::take_from(&from.key),
8106
8107                value: ::fidl_next::TakeFrom::take_from(&from.value),
8108            }
8109        }
8110    }
8111
8112    impl ::fidl_next::TakeFrom<crate::WireParentSpec2>
8113        for ::fidl_fuchsia_driver_framework::ParentSpec2
8114    {
8115        #[inline]
8116        fn take_from(from: &crate::WireParentSpec2) -> Self {
8117            Self {
8118                bind_rules: ::fidl_next::TakeFrom::take_from(&from.bind_rules),
8119
8120                properties: ::fidl_next::TakeFrom::take_from(&from.properties),
8121            }
8122        }
8123    }
8124
8125    impl ::fidl_next::TakeFrom<crate::WireCompositeNodeSpec>
8126        for ::fidl_fuchsia_driver_framework::CompositeNodeSpec
8127    {
8128        #[inline]
8129        fn take_from(from: &crate::WireCompositeNodeSpec) -> Self {
8130            Self {
8131                name: from.name().map(::fidl_next::TakeFrom::take_from),
8132
8133                parents: from.parents().map(::fidl_next::TakeFrom::take_from),
8134
8135                parents2: from.parents2().map(::fidl_next::TakeFrom::take_from),
8136
8137                __source_breaking: ::fidl::marker::SourceBreaking,
8138            }
8139        }
8140    }
8141
8142    impl ::fidl_next::TakeFrom<crate::WireCompositeInfo>
8143        for ::fidl_fuchsia_driver_framework::CompositeInfo
8144    {
8145        #[inline]
8146        fn take_from(from: &crate::WireCompositeInfo) -> Self {
8147            Self {
8148                spec: from.spec().map(::fidl_next::TakeFrom::take_from),
8149
8150                matched_driver: from.matched_driver().map(::fidl_next::TakeFrom::take_from),
8151
8152                __source_breaking: ::fidl::marker::SourceBreaking,
8153            }
8154        }
8155    }
8156
8157    impl ::fidl_next::TakeFrom<crate::WireCompositeNodeSpecError>
8158        for ::fidl_fuchsia_driver_framework::CompositeNodeSpecError
8159    {
8160        #[inline]
8161        fn take_from(from: &crate::WireCompositeNodeSpecError) -> Self {
8162            match crate::CompositeNodeSpecError::from(*from) {
8163                crate::CompositeNodeSpecError::MissingArgs => Self::MissingArgs,
8164
8165                crate::CompositeNodeSpecError::EmptyNodes => Self::EmptyNodes,
8166
8167                crate::CompositeNodeSpecError::AlreadyExists => Self::AlreadyExists,
8168
8169                crate::CompositeNodeSpecError::DriverIndexFailure => Self::DriverIndexFailure,
8170
8171                crate::CompositeNodeSpecError::DuplicateParents => Self::DuplicateParents,
8172
8173                crate::CompositeNodeSpecError::UnknownOrdinal_(value) => {
8174                    Self::__SourceBreaking { unknown_ordinal: value }
8175                }
8176            }
8177        }
8178    }
8179
8180    #[cfg(target_os = "fuchsia")]
8181    /// An alias for a client sender over `zx::Channel` for the `CompositeNodeManager`
8182    /// protocol.
8183    pub type CompositeNodeManagerProxy =
8184        ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::CompositeNodeManager>;
8185
8186    impl ::fidl_next::TakeFrom<crate::CompositeNodeManager>
8187        for ::fidl_fuchsia_driver_framework::CompositeNodeManagerMarker
8188    {
8189        #[inline]
8190        fn take_from(from: &crate::CompositeNodeManager) -> Self {
8191            Self
8192        }
8193    }
8194
8195    impl ::fidl_next::TakeFrom<crate::WireCompositeParent>
8196        for ::fidl_fuchsia_driver_framework::CompositeParent
8197    {
8198        #[inline]
8199        fn take_from(from: &crate::WireCompositeParent) -> Self {
8200            Self {
8201                composite: from.composite().map(::fidl_next::TakeFrom::take_from),
8202
8203                index: from.index().map(::fidl_next::TakeFrom::take_from),
8204
8205                __source_breaking: ::fidl::marker::SourceBreaking,
8206            }
8207        }
8208    }
8209
8210    impl ::fidl_next::TakeFrom<crate::WireDevfsAddArgs>
8211        for ::fidl_fuchsia_driver_framework::DevfsAddArgs
8212    {
8213        #[inline]
8214        fn take_from(from: &crate::WireDevfsAddArgs) -> Self {
8215            Self {
8216                connector: from.connector().map(::fidl_next::TakeFrom::take_from),
8217
8218                class_name: from.class_name().map(::fidl_next::TakeFrom::take_from),
8219
8220                inspect: from.inspect().map(::fidl_next::TakeFrom::take_from),
8221
8222                connector_supports: from.connector_supports().map(::fidl_next::TakeFrom::take_from),
8223
8224                controller_connector: from
8225                    .controller_connector()
8226                    .map(::fidl_next::TakeFrom::take_from),
8227
8228                __source_breaking: ::fidl::marker::SourceBreaking,
8229            }
8230        }
8231    }
8232
8233    impl ::fidl_next::TakeFrom<crate::WireNodePropertyEntry>
8234        for ::fidl_fuchsia_driver_framework::NodePropertyEntry
8235    {
8236        #[inline]
8237        fn take_from(from: &crate::WireNodePropertyEntry) -> Self {
8238            Self {
8239                name: ::fidl_next::TakeFrom::take_from(&from.name),
8240
8241                properties: ::fidl_next::TakeFrom::take_from(&from.properties),
8242            }
8243        }
8244    }
8245
8246    impl ::fidl_next::TakeFrom<crate::WireNodePropertyEntry2>
8247        for ::fidl_fuchsia_driver_framework::NodePropertyEntry2
8248    {
8249        #[inline]
8250        fn take_from(from: &crate::WireNodePropertyEntry2) -> Self {
8251            Self {
8252                name: ::fidl_next::TakeFrom::take_from(&from.name),
8253
8254                properties: ::fidl_next::TakeFrom::take_from(&from.properties),
8255            }
8256        }
8257    }
8258
8259    impl ::fidl_next::TakeFrom<crate::WireNodeSymbol> for ::fidl_fuchsia_driver_framework::NodeSymbol {
8260        #[inline]
8261        fn take_from(from: &crate::WireNodeSymbol) -> Self {
8262            Self {
8263                name: from.name().map(::fidl_next::TakeFrom::take_from),
8264
8265                address: from.address().map(::fidl_next::TakeFrom::take_from),
8266
8267                module_name: from.module_name().map(::fidl_next::TakeFrom::take_from),
8268
8269                __source_breaking: ::fidl::marker::SourceBreaking,
8270            }
8271        }
8272    }
8273
8274    impl ::fidl_next::TakeFrom<crate::WireOffer> for ::fidl_fuchsia_driver_framework::Offer {
8275        #[inline]
8276        fn take_from(from: &crate::WireOffer) -> Self {
8277            match from.as_ref() {
8278                crate::offer::Ref::ZirconTransport(value) => {
8279                    Self::ZirconTransport(::fidl_next::TakeFrom::take_from(value))
8280                }
8281
8282                crate::offer::Ref::DriverTransport(value) => {
8283                    Self::DriverTransport(::fidl_next::TakeFrom::take_from(value))
8284                }
8285
8286                crate::offer::Ref::UnknownOrdinal_(unknown_ordinal) => {
8287                    Self::__SourceBreaking { unknown_ordinal }
8288                }
8289            }
8290        }
8291    }
8292
8293    impl ::fidl_next::TakeFrom<crate::WireOptionalOffer>
8294        for Option<Box<::fidl_fuchsia_driver_framework::Offer>>
8295    {
8296        #[inline]
8297        fn take_from(from: &crate::WireOptionalOffer) -> Self {
8298            if let Some(inner) = from.as_ref() {
8299                Some(::fidl_next::TakeFrom::take_from(inner))
8300            } else {
8301                None
8302            }
8303        }
8304    }
8305
8306    impl ::fidl_next::TakeFrom<crate::WireDriverStartArgs>
8307        for ::fidl_fuchsia_driver_framework::DriverStartArgs
8308    {
8309        #[inline]
8310        fn take_from(from: &crate::WireDriverStartArgs) -> Self {
8311            Self {
8312                node: from.node().map(::fidl_next::TakeFrom::take_from),
8313
8314                symbols: from.symbols().map(::fidl_next::TakeFrom::take_from),
8315
8316                url: from.url().map(::fidl_next::TakeFrom::take_from),
8317
8318                program: from.program().map(::fidl_next::TakeFrom::take_from),
8319
8320                incoming: from.incoming().map(::fidl_next::TakeFrom::take_from),
8321
8322                outgoing_dir: from.outgoing_dir().map(::fidl_next::TakeFrom::take_from),
8323
8324                config: from.config().map(::fidl_next::TakeFrom::take_from),
8325
8326                node_name: from.node_name().map(::fidl_next::TakeFrom::take_from),
8327
8328                node_properties: from.node_properties().map(::fidl_next::TakeFrom::take_from),
8329
8330                node_offers: from.node_offers().map(::fidl_next::TakeFrom::take_from),
8331
8332                node_token: from.node_token().map(::fidl_next::TakeFrom::take_from),
8333
8334                node_properties_2: from.node_properties_2().map(::fidl_next::TakeFrom::take_from),
8335
8336                __source_breaking: ::fidl::marker::SourceBreaking,
8337            }
8338        }
8339    }
8340
8341    #[cfg(feature = "driver")]
8342    impl ::fidl_next::TakeFrom<crate::WireDriverStartRequest>
8343        for ::fidl_fuchsia_driver_framework::DriverStartRequest
8344    {
8345        #[inline]
8346        fn take_from(from: &crate::WireDriverStartRequest) -> Self {
8347            Self { start_args: ::fidl_next::TakeFrom::take_from(&from.start_args) }
8348        }
8349    }
8350
8351    #[cfg(target_os = "fuchsia")]
8352    /// An alias for a client sender over `zx::Channel` for the `Driver`
8353    /// protocol.
8354    pub type DriverProxy =
8355        ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Driver>;
8356
8357    #[cfg(feature = "driver")]
8358    impl ::fidl_next::TakeFrom<crate::Driver> for ::fidl_fuchsia_driver_framework::DriverMarker {
8359        #[inline]
8360        fn take_from(from: &crate::Driver) -> Self {
8361            Self
8362        }
8363    }
8364
8365    impl ::fidl_next::TakeFrom<crate::WireNodeError> for ::fidl_fuchsia_driver_framework::NodeError {
8366        #[inline]
8367        fn take_from(from: &crate::WireNodeError) -> Self {
8368            match crate::NodeError::from(*from) {
8369                crate::NodeError::Internal => Self::Internal,
8370
8371                crate::NodeError::NodeRemoved => Self::NodeRemoved,
8372
8373                crate::NodeError::NameMissing => Self::NameMissing,
8374
8375                crate::NodeError::NameInvalid => Self::NameInvalid,
8376
8377                crate::NodeError::NameAlreadyExists => Self::NameAlreadyExists,
8378
8379                crate::NodeError::OfferSourceNameMissing => Self::OfferSourceNameMissing,
8380
8381                crate::NodeError::OfferRefExists => Self::OfferRefExists,
8382
8383                crate::NodeError::SymbolNameMissing => Self::SymbolNameMissing,
8384
8385                crate::NodeError::SymbolAddressMissing => Self::SymbolAddressMissing,
8386
8387                crate::NodeError::SymbolAlreadyExists => Self::SymbolAlreadyExists,
8388
8389                crate::NodeError::UnbindChildrenInProgress => Self::UnbindChildrenInProgress,
8390
8391                crate::NodeError::UnsupportedArgs => Self::UnsupportedArgs,
8392
8393                crate::NodeError::UnknownOrdinal_(value) => {
8394                    Self::__SourceBreaking { unknown_ordinal: value }
8395                }
8396            }
8397        }
8398    }
8399
8400    impl ::fidl_next::TakeFrom<crate::WireNodeAddArgs>
8401        for ::fidl_fuchsia_driver_framework::NodeAddArgs
8402    {
8403        #[inline]
8404        fn take_from(from: &crate::WireNodeAddArgs) -> Self {
8405            Self {
8406                name: from.name().map(::fidl_next::TakeFrom::take_from),
8407
8408                offers: from.offers().map(::fidl_next::TakeFrom::take_from),
8409
8410                symbols: from.symbols().map(::fidl_next::TakeFrom::take_from),
8411
8412                properties: from.properties().map(::fidl_next::TakeFrom::take_from),
8413
8414                devfs_args: from.devfs_args().map(::fidl_next::TakeFrom::take_from),
8415
8416                offers2: from.offers2().map(::fidl_next::TakeFrom::take_from),
8417
8418                bus_info: from.bus_info().map(::fidl_next::TakeFrom::take_from),
8419
8420                properties2: from.properties2().map(::fidl_next::TakeFrom::take_from),
8421
8422                __source_breaking: ::fidl::marker::SourceBreaking,
8423            }
8424        }
8425    }
8426
8427    impl ::fidl_next::TakeFrom<crate::WireNodeAddChildRequest>
8428        for ::fidl_fuchsia_driver_framework::NodeAddChildRequest
8429    {
8430        #[inline]
8431        fn take_from(from: &crate::WireNodeAddChildRequest) -> Self {
8432            Self {
8433                args: ::fidl_next::TakeFrom::take_from(&from.args),
8434
8435                controller: ::fidl_next::TakeFrom::take_from(&from.controller),
8436
8437                node: ::fidl_next::TakeFrom::take_from(&from.node),
8438            }
8439        }
8440    }
8441
8442    #[cfg(target_os = "fuchsia")]
8443    /// An alias for a client sender over `zx::Channel` for the `Node`
8444    /// protocol.
8445    pub type NodeProxy = ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Node>;
8446
8447    impl ::fidl_next::TakeFrom<crate::Node> for ::fidl_fuchsia_driver_framework::NodeMarker {
8448        #[inline]
8449        fn take_from(from: &crate::Node) -> Self {
8450            Self
8451        }
8452    }
8453
8454    impl ::fidl_next::TakeFrom<crate::WireNodeControllerRequestBindRequest>
8455        for ::fidl_fuchsia_driver_framework::NodeControllerRequestBindRequest
8456    {
8457        #[inline]
8458        fn take_from(from: &crate::WireNodeControllerRequestBindRequest) -> Self {
8459            Self {
8460                force_rebind: from.force_rebind().map(::fidl_next::TakeFrom::take_from),
8461
8462                driver_url_suffix: from.driver_url_suffix().map(::fidl_next::TakeFrom::take_from),
8463
8464                __source_breaking: ::fidl::marker::SourceBreaking,
8465            }
8466        }
8467    }
8468
8469    #[cfg(target_os = "fuchsia")]
8470    /// An alias for a client sender over `zx::Channel` for the `NodeController`
8471    /// protocol.
8472    pub type NodeControllerProxy =
8473        ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::NodeController>;
8474
8475    impl ::fidl_next::TakeFrom<crate::NodeController>
8476        for ::fidl_fuchsia_driver_framework::NodeControllerMarker
8477    {
8478        #[inline]
8479        fn take_from(from: &crate::NodeController) -> Self {
8480            Self
8481        }
8482    }
8483}