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