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