fidl_fuchsia_driver_development_common/
fidl_fuchsia_driver_development_common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const BINDING_RESULT_MAX: u8 = 10;
12
13pub const HASH_LENGTH: u8 = 64;
14
15pub const MAX_SEGMENTS: u32 = 20;
16
17pub const NODE_MONIKER_MAX: u32 = 1024;
18
19bitflags! {
20    /// These flags indicate when a |fuchsia.driver.index.DriverIndex::MatchDriver| call should be
21    /// made for a node that is restarting in order to find a new driver, instead of reusing the driver
22    /// that was previously bound to the node.
23    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
24    pub struct RestartRematchFlags: u32 {
25        /// Rematch nodes that are currently bound to the requested driver. The requested driver is
26        /// the driver url that the restart operation was initiated for.
27        const REQUESTED = 1;
28        /// Rematch nodes that are currently bound to a driver other than the requested driver. These
29        /// are nodes that are affected by the restart of the requested driver, for example when
30        /// it is a colocated parent.
31        const NON_REQUESTED = 2;
32        /// Rematch nodes that are created as part of a completed composite spec.
33        const COMPOSITE_SPEC = 8;
34    }
35}
36
37impl RestartRematchFlags {
38    #[inline(always)]
39    pub fn from_bits_allow_unknown(bits: u32) -> Self {
40        Self::from_bits_retain(bits)
41    }
42
43    #[inline(always)]
44    pub fn has_unknown_bits(&self) -> bool {
45        self.get_unknown_bits() != 0
46    }
47
48    #[inline(always)]
49    pub fn get_unknown_bits(&self) -> u32 {
50        self.bits() & !Self::all().bits()
51    }
52}
53
54#[derive(Clone, Debug, PartialEq)]
55pub struct CompositeInfoIteratorGetNextResponse {
56    pub composites: Vec<CompositeNodeInfo>,
57}
58
59impl fidl::Persistable for CompositeInfoIteratorGetNextResponse {}
60
61#[derive(Clone, Debug, PartialEq)]
62pub struct CompositeNodeSpecIteratorGetNextResponse {
63    pub specs: Vec<fidl_fuchsia_driver_framework::CompositeInfo>,
64}
65
66impl fidl::Persistable for CompositeNodeSpecIteratorGetNextResponse {}
67
68#[derive(Clone, Debug, PartialEq)]
69pub struct DriverHostInfoIteratorGetNextResponse {
70    pub driver_hosts: Vec<DriverHostInfo>,
71}
72
73impl fidl::Persistable for DriverHostInfoIteratorGetNextResponse {}
74
75#[derive(Clone, Debug, PartialEq)]
76pub struct DriverInfoIteratorGetNextResponse {
77    pub drivers: Vec<fidl_fuchsia_driver_framework::DriverInfo>,
78}
79
80impl fidl::Persistable for DriverInfoIteratorGetNextResponse {}
81
82#[derive(Clone, Debug, PartialEq)]
83pub struct ManagerAddTestNodeRequest {
84    pub args: TestNodeAddArgs,
85}
86
87impl fidl::Persistable for ManagerAddTestNodeRequest {}
88
89#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
90pub struct ManagerDisableDriverRequest {
91    pub driver_url: String,
92    pub package_hash: Option<String>,
93}
94
95impl fidl::Persistable for ManagerDisableDriverRequest {}
96
97#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
98pub struct ManagerEnableDriverRequest {
99    pub driver_url: String,
100    pub package_hash: Option<String>,
101}
102
103impl fidl::Persistable for ManagerEnableDriverRequest {}
104
105#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
106pub struct ManagerRebindCompositesWithDriverRequest {
107    pub driver_url: String,
108}
109
110impl fidl::Persistable for ManagerRebindCompositesWithDriverRequest {}
111
112#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
113pub struct ManagerRemoveTestNodeRequest {
114    pub name: String,
115}
116
117impl fidl::Persistable for ManagerRemoveTestNodeRequest {}
118
119#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
120pub struct ManagerRestartDriverHostsRequest {
121    pub driver_url: String,
122    pub rematch_flags: RestartRematchFlags,
123}
124
125impl fidl::Persistable for ManagerRestartDriverHostsRequest {}
126
127#[derive(Clone, Debug, PartialEq)]
128pub struct ManagerBindAllUnboundNodesResponse {
129    /// List of new bindings that happened as a result of this.
130    pub binding_result: Vec<NodeBindingInfo>,
131}
132
133impl fidl::Persistable for ManagerBindAllUnboundNodesResponse {}
134
135#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
136#[repr(C)]
137pub struct ManagerRebindCompositesWithDriverResponse {
138    pub count: u32,
139}
140
141impl fidl::Persistable for ManagerRebindCompositesWithDriverResponse {}
142
143#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
144#[repr(C)]
145pub struct ManagerRestartDriverHostsResponse {
146    pub count: u32,
147}
148
149impl fidl::Persistable for ManagerRestartDriverHostsResponse {}
150
151#[derive(Clone, Debug, PartialEq)]
152pub struct NodeInfoIteratorGetNextResponse {
153    pub nodes: Vec<NodeInfo>,
154}
155
156impl fidl::Persistable for NodeInfoIteratorGetNextResponse {}
157
158/// Contains information for a composite node.
159#[derive(Clone, Debug, Default, PartialEq)]
160pub struct CompositeNodeInfo {
161    /// The topological paths of the parent nodes of this composite, ordered by index.
162    pub parent_topological_paths: Option<Vec<Option<String>>>,
163    /// The topological path of the created composite node. Empty if not created.
164    pub topological_path: Option<String>,
165    pub composite: Option<CompositeInfo>,
166    #[doc(hidden)]
167    pub __source_breaking: fidl::marker::SourceBreaking,
168}
169
170impl fidl::Persistable for CompositeNodeInfo {}
171
172/// Contains information for a dispatcher.
173#[derive(Clone, Debug, Default, PartialEq)]
174pub struct DispatcherInfo {
175    /// The driver which created this dispatcher.
176    pub driver: Option<String>,
177    /// The name of the dispatcher.
178    pub name: Option<String>,
179    /// The options the dispatcher was created with.
180    pub options: Option<u32>,
181    /// The scheduler role of the dispatcher.
182    pub scheduler_role: Option<String>,
183    #[doc(hidden)]
184    pub __source_breaking: fidl::marker::SourceBreaking,
185}
186
187impl fidl::Persistable for DispatcherInfo {}
188
189/// Contains information for a driver host.
190#[derive(Clone, Debug, Default, PartialEq)]
191pub struct DriverHostInfo {
192    /// The process KOID of the driver host.
193    pub process_koid: Option<u64>,
194    /// The list of threads of the driver host.
195    pub threads: Option<Vec<ThreadInfo>>,
196    /// List of drivers loaded into this driver host.
197    pub drivers: Option<Vec<String>>,
198    /// List of dispatchers .
199    pub dispatchers: Option<Vec<DispatcherInfo>>,
200    #[doc(hidden)]
201    pub __source_breaking: fidl::marker::SourceBreaking,
202}
203
204impl fidl::Persistable for DriverHostInfo {}
205
206/// Information about a node binding to either a driver or a composite.
207#[derive(Clone, Debug, Default, PartialEq)]
208pub struct NodeBindingInfo {
209    /// Full topological name of the node.
210    pub node_name: Option<String>,
211    /// This is the component url for the driver that bound to the node.
212    /// If this is present, then |composite_parents| must not be.
213    pub driver_url: Option<String>,
214    /// The composite parents that this node binded to.
215    /// If this is present, then |driver_url| must not be.
216    pub composite_parents: Option<Vec<fidl_fuchsia_driver_framework::CompositeParent>>,
217    #[doc(hidden)]
218    pub __source_breaking: fidl::marker::SourceBreaking,
219}
220
221impl fidl::Persistable for NodeBindingInfo {}
222
223#[derive(Clone, Debug, Default, PartialEq)]
224pub struct NodeInfo {
225    /// Unique ID identifying the node.
226    pub id: Option<u64>,
227    /// List of ids representing parents. If more than one, this is a composite node.
228    pub parent_ids: Option<Vec<u64>>,
229    /// List of ids representing children.
230    pub child_ids: Option<Vec<u64>>,
231    /// The process KOID of the driver host the driver resides within.
232    pub driver_host_koid: Option<u64>,
233    /// URL to the driver component manifest
234    pub bound_driver_url: Option<String>,
235    /// The collection-relative moniker of the node.
236    pub moniker: Option<String>,
237    /// Properties of the node.
238    pub node_property_list: Option<Vec<fidl_fuchsia_driver_framework::NodeProperty>>,
239    /// Component offers to the node.
240    pub offer_list: Option<Vec<fidl_fuchsia_component_decl::Offer>>,
241    /// Whether the node is in a quarantined state. That is, the |bound_driver_url| has failed to
242    /// start, and the node is no longer running its driver instance.
243    pub quarantined: Option<bool>,
244    /// Information about the node's bus topology.
245    pub bus_topology: Option<Vec<fidl_fuchsia_driver_framework::BusInfo>>,
246    #[doc(hidden)]
247    pub __source_breaking: fidl::marker::SourceBreaking,
248}
249
250impl fidl::Persistable for NodeInfo {}
251
252#[derive(Clone, Debug, Default, PartialEq)]
253pub struct TestNodeAddArgs {
254    /// Name of the node.
255    pub name: Option<String>,
256    /// Properties of the node.
257    pub properties: Option<Vec<fidl_fuchsia_driver_framework::NodeProperty>>,
258    #[doc(hidden)]
259    pub __source_breaking: fidl::marker::SourceBreaking,
260}
261
262impl fidl::Persistable for TestNodeAddArgs {}
263
264/// Contains information for a thread.
265#[derive(Clone, Debug, Default, PartialEq)]
266pub struct ThreadInfo {
267    /// The koid for the thread.
268    pub koid: Option<u64>,
269    /// The name of the thread.
270    pub name: Option<String>,
271    /// The scheduler role of the thread.
272    pub scheduler_role: Option<String>,
273    #[doc(hidden)]
274    pub __source_breaking: fidl::marker::SourceBreaking,
275}
276
277impl fidl::Persistable for ThreadInfo {}
278
279/// Contains information for a composite.
280#[derive(Clone, Debug, PartialEq)]
281pub enum CompositeInfo {
282    Composite(fidl_fuchsia_driver_framework::CompositeInfo),
283}
284
285impl CompositeInfo {
286    #[inline]
287    pub fn ordinal(&self) -> u64 {
288        match *self {
289            Self::Composite(_) => 2,
290        }
291    }
292
293    #[deprecated = "Strict unions should not use `is_unknown`"]
294    #[inline]
295    pub fn is_unknown(&self) -> bool {
296        false
297    }
298}
299
300impl fidl::Persistable for CompositeInfo {}
301
302mod internal {
303    use super::*;
304    unsafe impl fidl::encoding::TypeMarker for RestartRematchFlags {
305        type Owned = Self;
306
307        #[inline(always)]
308        fn inline_align(_context: fidl::encoding::Context) -> usize {
309            4
310        }
311
312        #[inline(always)]
313        fn inline_size(_context: fidl::encoding::Context) -> usize {
314            4
315        }
316    }
317
318    impl fidl::encoding::ValueTypeMarker for RestartRematchFlags {
319        type Borrowed<'a> = Self;
320        #[inline(always)]
321        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
322            *value
323        }
324    }
325
326    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
327        for RestartRematchFlags
328    {
329        #[inline]
330        unsafe fn encode(
331            self,
332            encoder: &mut fidl::encoding::Encoder<'_, D>,
333            offset: usize,
334            _depth: fidl::encoding::Depth,
335        ) -> fidl::Result<()> {
336            encoder.debug_check_bounds::<Self>(offset);
337            encoder.write_num(self.bits(), offset);
338            Ok(())
339        }
340    }
341
342    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RestartRematchFlags {
343        #[inline(always)]
344        fn new_empty() -> Self {
345            Self::empty()
346        }
347
348        #[inline]
349        unsafe fn decode(
350            &mut self,
351            decoder: &mut fidl::encoding::Decoder<'_, D>,
352            offset: usize,
353            _depth: fidl::encoding::Depth,
354        ) -> fidl::Result<()> {
355            decoder.debug_check_bounds::<Self>(offset);
356            let prim = decoder.read_num::<u32>(offset);
357            *self = Self::from_bits_allow_unknown(prim);
358            Ok(())
359        }
360    }
361
362    impl fidl::encoding::ValueTypeMarker for CompositeInfoIteratorGetNextResponse {
363        type Borrowed<'a> = &'a Self;
364        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
365            value
366        }
367    }
368
369    unsafe impl fidl::encoding::TypeMarker for CompositeInfoIteratorGetNextResponse {
370        type Owned = Self;
371
372        #[inline(always)]
373        fn inline_align(_context: fidl::encoding::Context) -> usize {
374            8
375        }
376
377        #[inline(always)]
378        fn inline_size(_context: fidl::encoding::Context) -> usize {
379            16
380        }
381    }
382
383    unsafe impl<D: fidl::encoding::ResourceDialect>
384        fidl::encoding::Encode<CompositeInfoIteratorGetNextResponse, D>
385        for &CompositeInfoIteratorGetNextResponse
386    {
387        #[inline]
388        unsafe fn encode(
389            self,
390            encoder: &mut fidl::encoding::Encoder<'_, D>,
391            offset: usize,
392            _depth: fidl::encoding::Depth,
393        ) -> fidl::Result<()> {
394            encoder.debug_check_bounds::<CompositeInfoIteratorGetNextResponse>(offset);
395            // Delegate to tuple encoding.
396            fidl::encoding::Encode::<CompositeInfoIteratorGetNextResponse, D>::encode(
397                (
398                    <fidl::encoding::UnboundedVector<CompositeNodeInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.composites),
399                ),
400                encoder, offset, _depth
401            )
402        }
403    }
404    unsafe impl<
405            D: fidl::encoding::ResourceDialect,
406            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<CompositeNodeInfo>, D>,
407        > fidl::encoding::Encode<CompositeInfoIteratorGetNextResponse, D> for (T0,)
408    {
409        #[inline]
410        unsafe fn encode(
411            self,
412            encoder: &mut fidl::encoding::Encoder<'_, D>,
413            offset: usize,
414            depth: fidl::encoding::Depth,
415        ) -> fidl::Result<()> {
416            encoder.debug_check_bounds::<CompositeInfoIteratorGetNextResponse>(offset);
417            // Zero out padding regions. There's no need to apply masks
418            // because the unmasked parts will be overwritten by fields.
419            // Write the fields.
420            self.0.encode(encoder, offset + 0, depth)?;
421            Ok(())
422        }
423    }
424
425    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
426        for CompositeInfoIteratorGetNextResponse
427    {
428        #[inline(always)]
429        fn new_empty() -> Self {
430            Self {
431                composites: fidl::new_empty!(fidl::encoding::UnboundedVector<CompositeNodeInfo>, D),
432            }
433        }
434
435        #[inline]
436        unsafe fn decode(
437            &mut self,
438            decoder: &mut fidl::encoding::Decoder<'_, D>,
439            offset: usize,
440            _depth: fidl::encoding::Depth,
441        ) -> fidl::Result<()> {
442            decoder.debug_check_bounds::<Self>(offset);
443            // Verify that padding bytes are zero.
444            fidl::decode!(
445                fidl::encoding::UnboundedVector<CompositeNodeInfo>,
446                D,
447                &mut self.composites,
448                decoder,
449                offset + 0,
450                _depth
451            )?;
452            Ok(())
453        }
454    }
455
456    impl fidl::encoding::ValueTypeMarker for CompositeNodeSpecIteratorGetNextResponse {
457        type Borrowed<'a> = &'a Self;
458        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
459            value
460        }
461    }
462
463    unsafe impl fidl::encoding::TypeMarker for CompositeNodeSpecIteratorGetNextResponse {
464        type Owned = Self;
465
466        #[inline(always)]
467        fn inline_align(_context: fidl::encoding::Context) -> usize {
468            8
469        }
470
471        #[inline(always)]
472        fn inline_size(_context: fidl::encoding::Context) -> usize {
473            16
474        }
475    }
476
477    unsafe impl<D: fidl::encoding::ResourceDialect>
478        fidl::encoding::Encode<CompositeNodeSpecIteratorGetNextResponse, D>
479        for &CompositeNodeSpecIteratorGetNextResponse
480    {
481        #[inline]
482        unsafe fn encode(
483            self,
484            encoder: &mut fidl::encoding::Encoder<'_, D>,
485            offset: usize,
486            _depth: fidl::encoding::Depth,
487        ) -> fidl::Result<()> {
488            encoder.debug_check_bounds::<CompositeNodeSpecIteratorGetNextResponse>(offset);
489            // Delegate to tuple encoding.
490            fidl::encoding::Encode::<CompositeNodeSpecIteratorGetNextResponse, D>::encode(
491                (
492                    <fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::CompositeInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.specs),
493                ),
494                encoder, offset, _depth
495            )
496        }
497    }
498    unsafe impl<
499            D: fidl::encoding::ResourceDialect,
500            T0: fidl::encoding::Encode<
501                fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::CompositeInfo>,
502                D,
503            >,
504        > fidl::encoding::Encode<CompositeNodeSpecIteratorGetNextResponse, D> for (T0,)
505    {
506        #[inline]
507        unsafe fn encode(
508            self,
509            encoder: &mut fidl::encoding::Encoder<'_, D>,
510            offset: usize,
511            depth: fidl::encoding::Depth,
512        ) -> fidl::Result<()> {
513            encoder.debug_check_bounds::<CompositeNodeSpecIteratorGetNextResponse>(offset);
514            // Zero out padding regions. There's no need to apply masks
515            // because the unmasked parts will be overwritten by fields.
516            // Write the fields.
517            self.0.encode(encoder, offset + 0, depth)?;
518            Ok(())
519        }
520    }
521
522    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
523        for CompositeNodeSpecIteratorGetNextResponse
524    {
525        #[inline(always)]
526        fn new_empty() -> Self {
527            Self {
528                specs: fidl::new_empty!(
529                    fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::CompositeInfo>,
530                    D
531                ),
532            }
533        }
534
535        #[inline]
536        unsafe fn decode(
537            &mut self,
538            decoder: &mut fidl::encoding::Decoder<'_, D>,
539            offset: usize,
540            _depth: fidl::encoding::Depth,
541        ) -> fidl::Result<()> {
542            decoder.debug_check_bounds::<Self>(offset);
543            // Verify that padding bytes are zero.
544            fidl::decode!(
545                fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::CompositeInfo>,
546                D,
547                &mut self.specs,
548                decoder,
549                offset + 0,
550                _depth
551            )?;
552            Ok(())
553        }
554    }
555
556    impl fidl::encoding::ValueTypeMarker for DriverHostInfoIteratorGetNextResponse {
557        type Borrowed<'a> = &'a Self;
558        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
559            value
560        }
561    }
562
563    unsafe impl fidl::encoding::TypeMarker for DriverHostInfoIteratorGetNextResponse {
564        type Owned = Self;
565
566        #[inline(always)]
567        fn inline_align(_context: fidl::encoding::Context) -> usize {
568            8
569        }
570
571        #[inline(always)]
572        fn inline_size(_context: fidl::encoding::Context) -> usize {
573            16
574        }
575    }
576
577    unsafe impl<D: fidl::encoding::ResourceDialect>
578        fidl::encoding::Encode<DriverHostInfoIteratorGetNextResponse, D>
579        for &DriverHostInfoIteratorGetNextResponse
580    {
581        #[inline]
582        unsafe fn encode(
583            self,
584            encoder: &mut fidl::encoding::Encoder<'_, D>,
585            offset: usize,
586            _depth: fidl::encoding::Depth,
587        ) -> fidl::Result<()> {
588            encoder.debug_check_bounds::<DriverHostInfoIteratorGetNextResponse>(offset);
589            // Delegate to tuple encoding.
590            fidl::encoding::Encode::<DriverHostInfoIteratorGetNextResponse, D>::encode(
591                (
592                    <fidl::encoding::UnboundedVector<DriverHostInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.driver_hosts),
593                ),
594                encoder, offset, _depth
595            )
596        }
597    }
598    unsafe impl<
599            D: fidl::encoding::ResourceDialect,
600            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<DriverHostInfo>, D>,
601        > fidl::encoding::Encode<DriverHostInfoIteratorGetNextResponse, D> for (T0,)
602    {
603        #[inline]
604        unsafe fn encode(
605            self,
606            encoder: &mut fidl::encoding::Encoder<'_, D>,
607            offset: usize,
608            depth: fidl::encoding::Depth,
609        ) -> fidl::Result<()> {
610            encoder.debug_check_bounds::<DriverHostInfoIteratorGetNextResponse>(offset);
611            // Zero out padding regions. There's no need to apply masks
612            // because the unmasked parts will be overwritten by fields.
613            // Write the fields.
614            self.0.encode(encoder, offset + 0, depth)?;
615            Ok(())
616        }
617    }
618
619    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
620        for DriverHostInfoIteratorGetNextResponse
621    {
622        #[inline(always)]
623        fn new_empty() -> Self {
624            Self {
625                driver_hosts: fidl::new_empty!(fidl::encoding::UnboundedVector<DriverHostInfo>, D),
626            }
627        }
628
629        #[inline]
630        unsafe fn decode(
631            &mut self,
632            decoder: &mut fidl::encoding::Decoder<'_, D>,
633            offset: usize,
634            _depth: fidl::encoding::Depth,
635        ) -> fidl::Result<()> {
636            decoder.debug_check_bounds::<Self>(offset);
637            // Verify that padding bytes are zero.
638            fidl::decode!(
639                fidl::encoding::UnboundedVector<DriverHostInfo>,
640                D,
641                &mut self.driver_hosts,
642                decoder,
643                offset + 0,
644                _depth
645            )?;
646            Ok(())
647        }
648    }
649
650    impl fidl::encoding::ValueTypeMarker for DriverInfoIteratorGetNextResponse {
651        type Borrowed<'a> = &'a Self;
652        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
653            value
654        }
655    }
656
657    unsafe impl fidl::encoding::TypeMarker for DriverInfoIteratorGetNextResponse {
658        type Owned = Self;
659
660        #[inline(always)]
661        fn inline_align(_context: fidl::encoding::Context) -> usize {
662            8
663        }
664
665        #[inline(always)]
666        fn inline_size(_context: fidl::encoding::Context) -> usize {
667            16
668        }
669    }
670
671    unsafe impl<D: fidl::encoding::ResourceDialect>
672        fidl::encoding::Encode<DriverInfoIteratorGetNextResponse, D>
673        for &DriverInfoIteratorGetNextResponse
674    {
675        #[inline]
676        unsafe fn encode(
677            self,
678            encoder: &mut fidl::encoding::Encoder<'_, D>,
679            offset: usize,
680            _depth: fidl::encoding::Depth,
681        ) -> fidl::Result<()> {
682            encoder.debug_check_bounds::<DriverInfoIteratorGetNextResponse>(offset);
683            // Delegate to tuple encoding.
684            fidl::encoding::Encode::<DriverInfoIteratorGetNextResponse, D>::encode(
685                (
686                    <fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::DriverInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.drivers),
687                ),
688                encoder, offset, _depth
689            )
690        }
691    }
692    unsafe impl<
693            D: fidl::encoding::ResourceDialect,
694            T0: fidl::encoding::Encode<
695                fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::DriverInfo>,
696                D,
697            >,
698        > fidl::encoding::Encode<DriverInfoIteratorGetNextResponse, D> for (T0,)
699    {
700        #[inline]
701        unsafe fn encode(
702            self,
703            encoder: &mut fidl::encoding::Encoder<'_, D>,
704            offset: usize,
705            depth: fidl::encoding::Depth,
706        ) -> fidl::Result<()> {
707            encoder.debug_check_bounds::<DriverInfoIteratorGetNextResponse>(offset);
708            // Zero out padding regions. There's no need to apply masks
709            // because the unmasked parts will be overwritten by fields.
710            // Write the fields.
711            self.0.encode(encoder, offset + 0, depth)?;
712            Ok(())
713        }
714    }
715
716    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
717        for DriverInfoIteratorGetNextResponse
718    {
719        #[inline(always)]
720        fn new_empty() -> Self {
721            Self {
722                drivers: fidl::new_empty!(
723                    fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::DriverInfo>,
724                    D
725                ),
726            }
727        }
728
729        #[inline]
730        unsafe fn decode(
731            &mut self,
732            decoder: &mut fidl::encoding::Decoder<'_, D>,
733            offset: usize,
734            _depth: fidl::encoding::Depth,
735        ) -> fidl::Result<()> {
736            decoder.debug_check_bounds::<Self>(offset);
737            // Verify that padding bytes are zero.
738            fidl::decode!(
739                fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::DriverInfo>,
740                D,
741                &mut self.drivers,
742                decoder,
743                offset + 0,
744                _depth
745            )?;
746            Ok(())
747        }
748    }
749
750    impl fidl::encoding::ValueTypeMarker for ManagerAddTestNodeRequest {
751        type Borrowed<'a> = &'a Self;
752        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
753            value
754        }
755    }
756
757    unsafe impl fidl::encoding::TypeMarker for ManagerAddTestNodeRequest {
758        type Owned = Self;
759
760        #[inline(always)]
761        fn inline_align(_context: fidl::encoding::Context) -> usize {
762            8
763        }
764
765        #[inline(always)]
766        fn inline_size(_context: fidl::encoding::Context) -> usize {
767            16
768        }
769    }
770
771    unsafe impl<D: fidl::encoding::ResourceDialect>
772        fidl::encoding::Encode<ManagerAddTestNodeRequest, D> for &ManagerAddTestNodeRequest
773    {
774        #[inline]
775        unsafe fn encode(
776            self,
777            encoder: &mut fidl::encoding::Encoder<'_, D>,
778            offset: usize,
779            _depth: fidl::encoding::Depth,
780        ) -> fidl::Result<()> {
781            encoder.debug_check_bounds::<ManagerAddTestNodeRequest>(offset);
782            // Delegate to tuple encoding.
783            fidl::encoding::Encode::<ManagerAddTestNodeRequest, D>::encode(
784                (<TestNodeAddArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
785                encoder,
786                offset,
787                _depth,
788            )
789        }
790    }
791    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TestNodeAddArgs, D>>
792        fidl::encoding::Encode<ManagerAddTestNodeRequest, D> for (T0,)
793    {
794        #[inline]
795        unsafe fn encode(
796            self,
797            encoder: &mut fidl::encoding::Encoder<'_, D>,
798            offset: usize,
799            depth: fidl::encoding::Depth,
800        ) -> fidl::Result<()> {
801            encoder.debug_check_bounds::<ManagerAddTestNodeRequest>(offset);
802            // Zero out padding regions. There's no need to apply masks
803            // because the unmasked parts will be overwritten by fields.
804            // Write the fields.
805            self.0.encode(encoder, offset + 0, depth)?;
806            Ok(())
807        }
808    }
809
810    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
811        for ManagerAddTestNodeRequest
812    {
813        #[inline(always)]
814        fn new_empty() -> Self {
815            Self { args: fidl::new_empty!(TestNodeAddArgs, D) }
816        }
817
818        #[inline]
819        unsafe fn decode(
820            &mut self,
821            decoder: &mut fidl::encoding::Decoder<'_, D>,
822            offset: usize,
823            _depth: fidl::encoding::Depth,
824        ) -> fidl::Result<()> {
825            decoder.debug_check_bounds::<Self>(offset);
826            // Verify that padding bytes are zero.
827            fidl::decode!(TestNodeAddArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
828            Ok(())
829        }
830    }
831
832    impl fidl::encoding::ValueTypeMarker for ManagerDisableDriverRequest {
833        type Borrowed<'a> = &'a Self;
834        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
835            value
836        }
837    }
838
839    unsafe impl fidl::encoding::TypeMarker for ManagerDisableDriverRequest {
840        type Owned = Self;
841
842        #[inline(always)]
843        fn inline_align(_context: fidl::encoding::Context) -> usize {
844            8
845        }
846
847        #[inline(always)]
848        fn inline_size(_context: fidl::encoding::Context) -> usize {
849            32
850        }
851    }
852
853    unsafe impl<D: fidl::encoding::ResourceDialect>
854        fidl::encoding::Encode<ManagerDisableDriverRequest, D> for &ManagerDisableDriverRequest
855    {
856        #[inline]
857        unsafe fn encode(
858            self,
859            encoder: &mut fidl::encoding::Encoder<'_, D>,
860            offset: usize,
861            _depth: fidl::encoding::Depth,
862        ) -> fidl::Result<()> {
863            encoder.debug_check_bounds::<ManagerDisableDriverRequest>(offset);
864            // Delegate to tuple encoding.
865            fidl::encoding::Encode::<ManagerDisableDriverRequest, D>::encode(
866                (
867                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.driver_url),
868                    <fidl::encoding::Optional<fidl::encoding::BoundedString<64>> as fidl::encoding::ValueTypeMarker>::borrow(&self.package_hash),
869                ),
870                encoder, offset, _depth
871            )
872        }
873    }
874    unsafe impl<
875            D: fidl::encoding::ResourceDialect,
876            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
877            T1: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<64>>, D>,
878        > fidl::encoding::Encode<ManagerDisableDriverRequest, D> for (T0, T1)
879    {
880        #[inline]
881        unsafe fn encode(
882            self,
883            encoder: &mut fidl::encoding::Encoder<'_, D>,
884            offset: usize,
885            depth: fidl::encoding::Depth,
886        ) -> fidl::Result<()> {
887            encoder.debug_check_bounds::<ManagerDisableDriverRequest>(offset);
888            // Zero out padding regions. There's no need to apply masks
889            // because the unmasked parts will be overwritten by fields.
890            // Write the fields.
891            self.0.encode(encoder, offset + 0, depth)?;
892            self.1.encode(encoder, offset + 16, depth)?;
893            Ok(())
894        }
895    }
896
897    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
898        for ManagerDisableDriverRequest
899    {
900        #[inline(always)]
901        fn new_empty() -> Self {
902            Self {
903                driver_url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
904                package_hash: fidl::new_empty!(
905                    fidl::encoding::Optional<fidl::encoding::BoundedString<64>>,
906                    D
907                ),
908            }
909        }
910
911        #[inline]
912        unsafe fn decode(
913            &mut self,
914            decoder: &mut fidl::encoding::Decoder<'_, D>,
915            offset: usize,
916            _depth: fidl::encoding::Depth,
917        ) -> fidl::Result<()> {
918            decoder.debug_check_bounds::<Self>(offset);
919            // Verify that padding bytes are zero.
920            fidl::decode!(
921                fidl::encoding::BoundedString<4096>,
922                D,
923                &mut self.driver_url,
924                decoder,
925                offset + 0,
926                _depth
927            )?;
928            fidl::decode!(
929                fidl::encoding::Optional<fidl::encoding::BoundedString<64>>,
930                D,
931                &mut self.package_hash,
932                decoder,
933                offset + 16,
934                _depth
935            )?;
936            Ok(())
937        }
938    }
939
940    impl fidl::encoding::ValueTypeMarker for ManagerEnableDriverRequest {
941        type Borrowed<'a> = &'a Self;
942        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
943            value
944        }
945    }
946
947    unsafe impl fidl::encoding::TypeMarker for ManagerEnableDriverRequest {
948        type Owned = Self;
949
950        #[inline(always)]
951        fn inline_align(_context: fidl::encoding::Context) -> usize {
952            8
953        }
954
955        #[inline(always)]
956        fn inline_size(_context: fidl::encoding::Context) -> usize {
957            32
958        }
959    }
960
961    unsafe impl<D: fidl::encoding::ResourceDialect>
962        fidl::encoding::Encode<ManagerEnableDriverRequest, D> for &ManagerEnableDriverRequest
963    {
964        #[inline]
965        unsafe fn encode(
966            self,
967            encoder: &mut fidl::encoding::Encoder<'_, D>,
968            offset: usize,
969            _depth: fidl::encoding::Depth,
970        ) -> fidl::Result<()> {
971            encoder.debug_check_bounds::<ManagerEnableDriverRequest>(offset);
972            // Delegate to tuple encoding.
973            fidl::encoding::Encode::<ManagerEnableDriverRequest, D>::encode(
974                (
975                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.driver_url),
976                    <fidl::encoding::Optional<fidl::encoding::BoundedString<64>> as fidl::encoding::ValueTypeMarker>::borrow(&self.package_hash),
977                ),
978                encoder, offset, _depth
979            )
980        }
981    }
982    unsafe impl<
983            D: fidl::encoding::ResourceDialect,
984            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
985            T1: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<64>>, D>,
986        > fidl::encoding::Encode<ManagerEnableDriverRequest, D> for (T0, T1)
987    {
988        #[inline]
989        unsafe fn encode(
990            self,
991            encoder: &mut fidl::encoding::Encoder<'_, D>,
992            offset: usize,
993            depth: fidl::encoding::Depth,
994        ) -> fidl::Result<()> {
995            encoder.debug_check_bounds::<ManagerEnableDriverRequest>(offset);
996            // Zero out padding regions. There's no need to apply masks
997            // because the unmasked parts will be overwritten by fields.
998            // Write the fields.
999            self.0.encode(encoder, offset + 0, depth)?;
1000            self.1.encode(encoder, offset + 16, depth)?;
1001            Ok(())
1002        }
1003    }
1004
1005    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1006        for ManagerEnableDriverRequest
1007    {
1008        #[inline(always)]
1009        fn new_empty() -> Self {
1010            Self {
1011                driver_url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
1012                package_hash: fidl::new_empty!(
1013                    fidl::encoding::Optional<fidl::encoding::BoundedString<64>>,
1014                    D
1015                ),
1016            }
1017        }
1018
1019        #[inline]
1020        unsafe fn decode(
1021            &mut self,
1022            decoder: &mut fidl::encoding::Decoder<'_, D>,
1023            offset: usize,
1024            _depth: fidl::encoding::Depth,
1025        ) -> fidl::Result<()> {
1026            decoder.debug_check_bounds::<Self>(offset);
1027            // Verify that padding bytes are zero.
1028            fidl::decode!(
1029                fidl::encoding::BoundedString<4096>,
1030                D,
1031                &mut self.driver_url,
1032                decoder,
1033                offset + 0,
1034                _depth
1035            )?;
1036            fidl::decode!(
1037                fidl::encoding::Optional<fidl::encoding::BoundedString<64>>,
1038                D,
1039                &mut self.package_hash,
1040                decoder,
1041                offset + 16,
1042                _depth
1043            )?;
1044            Ok(())
1045        }
1046    }
1047
1048    impl fidl::encoding::ValueTypeMarker for ManagerRebindCompositesWithDriverRequest {
1049        type Borrowed<'a> = &'a Self;
1050        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1051            value
1052        }
1053    }
1054
1055    unsafe impl fidl::encoding::TypeMarker for ManagerRebindCompositesWithDriverRequest {
1056        type Owned = Self;
1057
1058        #[inline(always)]
1059        fn inline_align(_context: fidl::encoding::Context) -> usize {
1060            8
1061        }
1062
1063        #[inline(always)]
1064        fn inline_size(_context: fidl::encoding::Context) -> usize {
1065            16
1066        }
1067    }
1068
1069    unsafe impl<D: fidl::encoding::ResourceDialect>
1070        fidl::encoding::Encode<ManagerRebindCompositesWithDriverRequest, D>
1071        for &ManagerRebindCompositesWithDriverRequest
1072    {
1073        #[inline]
1074        unsafe fn encode(
1075            self,
1076            encoder: &mut fidl::encoding::Encoder<'_, D>,
1077            offset: usize,
1078            _depth: fidl::encoding::Depth,
1079        ) -> fidl::Result<()> {
1080            encoder.debug_check_bounds::<ManagerRebindCompositesWithDriverRequest>(offset);
1081            // Delegate to tuple encoding.
1082            fidl::encoding::Encode::<ManagerRebindCompositesWithDriverRequest, D>::encode(
1083                (<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
1084                    &self.driver_url,
1085                ),),
1086                encoder,
1087                offset,
1088                _depth,
1089            )
1090        }
1091    }
1092    unsafe impl<
1093            D: fidl::encoding::ResourceDialect,
1094            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
1095        > fidl::encoding::Encode<ManagerRebindCompositesWithDriverRequest, D> for (T0,)
1096    {
1097        #[inline]
1098        unsafe fn encode(
1099            self,
1100            encoder: &mut fidl::encoding::Encoder<'_, D>,
1101            offset: usize,
1102            depth: fidl::encoding::Depth,
1103        ) -> fidl::Result<()> {
1104            encoder.debug_check_bounds::<ManagerRebindCompositesWithDriverRequest>(offset);
1105            // Zero out padding regions. There's no need to apply masks
1106            // because the unmasked parts will be overwritten by fields.
1107            // Write the fields.
1108            self.0.encode(encoder, offset + 0, depth)?;
1109            Ok(())
1110        }
1111    }
1112
1113    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1114        for ManagerRebindCompositesWithDriverRequest
1115    {
1116        #[inline(always)]
1117        fn new_empty() -> Self {
1118            Self { driver_url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
1119        }
1120
1121        #[inline]
1122        unsafe fn decode(
1123            &mut self,
1124            decoder: &mut fidl::encoding::Decoder<'_, D>,
1125            offset: usize,
1126            _depth: fidl::encoding::Depth,
1127        ) -> fidl::Result<()> {
1128            decoder.debug_check_bounds::<Self>(offset);
1129            // Verify that padding bytes are zero.
1130            fidl::decode!(
1131                fidl::encoding::BoundedString<4096>,
1132                D,
1133                &mut self.driver_url,
1134                decoder,
1135                offset + 0,
1136                _depth
1137            )?;
1138            Ok(())
1139        }
1140    }
1141
1142    impl fidl::encoding::ValueTypeMarker for ManagerRemoveTestNodeRequest {
1143        type Borrowed<'a> = &'a Self;
1144        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1145            value
1146        }
1147    }
1148
1149    unsafe impl fidl::encoding::TypeMarker for ManagerRemoveTestNodeRequest {
1150        type Owned = Self;
1151
1152        #[inline(always)]
1153        fn inline_align(_context: fidl::encoding::Context) -> usize {
1154            8
1155        }
1156
1157        #[inline(always)]
1158        fn inline_size(_context: fidl::encoding::Context) -> usize {
1159            16
1160        }
1161    }
1162
1163    unsafe impl<D: fidl::encoding::ResourceDialect>
1164        fidl::encoding::Encode<ManagerRemoveTestNodeRequest, D> for &ManagerRemoveTestNodeRequest
1165    {
1166        #[inline]
1167        unsafe fn encode(
1168            self,
1169            encoder: &mut fidl::encoding::Encoder<'_, D>,
1170            offset: usize,
1171            _depth: fidl::encoding::Depth,
1172        ) -> fidl::Result<()> {
1173            encoder.debug_check_bounds::<ManagerRemoveTestNodeRequest>(offset);
1174            // Delegate to tuple encoding.
1175            fidl::encoding::Encode::<ManagerRemoveTestNodeRequest, D>::encode(
1176                (<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(
1177                    &self.name,
1178                ),),
1179                encoder,
1180                offset,
1181                _depth,
1182            )
1183        }
1184    }
1185    unsafe impl<
1186            D: fidl::encoding::ResourceDialect,
1187            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>, D>,
1188        > fidl::encoding::Encode<ManagerRemoveTestNodeRequest, D> for (T0,)
1189    {
1190        #[inline]
1191        unsafe fn encode(
1192            self,
1193            encoder: &mut fidl::encoding::Encoder<'_, D>,
1194            offset: usize,
1195            depth: fidl::encoding::Depth,
1196        ) -> fidl::Result<()> {
1197            encoder.debug_check_bounds::<ManagerRemoveTestNodeRequest>(offset);
1198            // Zero out padding regions. There's no need to apply masks
1199            // because the unmasked parts will be overwritten by fields.
1200            // Write the fields.
1201            self.0.encode(encoder, offset + 0, depth)?;
1202            Ok(())
1203        }
1204    }
1205
1206    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1207        for ManagerRemoveTestNodeRequest
1208    {
1209        #[inline(always)]
1210        fn new_empty() -> Self {
1211            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<1024>, D) }
1212        }
1213
1214        #[inline]
1215        unsafe fn decode(
1216            &mut self,
1217            decoder: &mut fidl::encoding::Decoder<'_, D>,
1218            offset: usize,
1219            _depth: fidl::encoding::Depth,
1220        ) -> fidl::Result<()> {
1221            decoder.debug_check_bounds::<Self>(offset);
1222            // Verify that padding bytes are zero.
1223            fidl::decode!(
1224                fidl::encoding::BoundedString<1024>,
1225                D,
1226                &mut self.name,
1227                decoder,
1228                offset + 0,
1229                _depth
1230            )?;
1231            Ok(())
1232        }
1233    }
1234
1235    impl fidl::encoding::ValueTypeMarker for ManagerRestartDriverHostsRequest {
1236        type Borrowed<'a> = &'a Self;
1237        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1238            value
1239        }
1240    }
1241
1242    unsafe impl fidl::encoding::TypeMarker for ManagerRestartDriverHostsRequest {
1243        type Owned = Self;
1244
1245        #[inline(always)]
1246        fn inline_align(_context: fidl::encoding::Context) -> usize {
1247            8
1248        }
1249
1250        #[inline(always)]
1251        fn inline_size(_context: fidl::encoding::Context) -> usize {
1252            24
1253        }
1254    }
1255
1256    unsafe impl<D: fidl::encoding::ResourceDialect>
1257        fidl::encoding::Encode<ManagerRestartDriverHostsRequest, D>
1258        for &ManagerRestartDriverHostsRequest
1259    {
1260        #[inline]
1261        unsafe fn encode(
1262            self,
1263            encoder: &mut fidl::encoding::Encoder<'_, D>,
1264            offset: usize,
1265            _depth: fidl::encoding::Depth,
1266        ) -> fidl::Result<()> {
1267            encoder.debug_check_bounds::<ManagerRestartDriverHostsRequest>(offset);
1268            // Delegate to tuple encoding.
1269            fidl::encoding::Encode::<ManagerRestartDriverHostsRequest, D>::encode(
1270                (
1271                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.driver_url),
1272                    <RestartRematchFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.rematch_flags),
1273                ),
1274                encoder, offset, _depth
1275            )
1276        }
1277    }
1278    unsafe impl<
1279            D: fidl::encoding::ResourceDialect,
1280            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
1281            T1: fidl::encoding::Encode<RestartRematchFlags, D>,
1282        > fidl::encoding::Encode<ManagerRestartDriverHostsRequest, D> for (T0, T1)
1283    {
1284        #[inline]
1285        unsafe fn encode(
1286            self,
1287            encoder: &mut fidl::encoding::Encoder<'_, D>,
1288            offset: usize,
1289            depth: fidl::encoding::Depth,
1290        ) -> fidl::Result<()> {
1291            encoder.debug_check_bounds::<ManagerRestartDriverHostsRequest>(offset);
1292            // Zero out padding regions. There's no need to apply masks
1293            // because the unmasked parts will be overwritten by fields.
1294            unsafe {
1295                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
1296                (ptr as *mut u64).write_unaligned(0);
1297            }
1298            // Write the fields.
1299            self.0.encode(encoder, offset + 0, depth)?;
1300            self.1.encode(encoder, offset + 16, depth)?;
1301            Ok(())
1302        }
1303    }
1304
1305    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1306        for ManagerRestartDriverHostsRequest
1307    {
1308        #[inline(always)]
1309        fn new_empty() -> Self {
1310            Self {
1311                driver_url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
1312                rematch_flags: fidl::new_empty!(RestartRematchFlags, D),
1313            }
1314        }
1315
1316        #[inline]
1317        unsafe fn decode(
1318            &mut self,
1319            decoder: &mut fidl::encoding::Decoder<'_, D>,
1320            offset: usize,
1321            _depth: fidl::encoding::Depth,
1322        ) -> fidl::Result<()> {
1323            decoder.debug_check_bounds::<Self>(offset);
1324            // Verify that padding bytes are zero.
1325            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1326            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1327            let mask = 0xffffffff00000000u64;
1328            let maskedval = padval & mask;
1329            if maskedval != 0 {
1330                return Err(fidl::Error::NonZeroPadding {
1331                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1332                });
1333            }
1334            fidl::decode!(
1335                fidl::encoding::BoundedString<4096>,
1336                D,
1337                &mut self.driver_url,
1338                decoder,
1339                offset + 0,
1340                _depth
1341            )?;
1342            fidl::decode!(
1343                RestartRematchFlags,
1344                D,
1345                &mut self.rematch_flags,
1346                decoder,
1347                offset + 16,
1348                _depth
1349            )?;
1350            Ok(())
1351        }
1352    }
1353
1354    impl fidl::encoding::ValueTypeMarker for ManagerBindAllUnboundNodesResponse {
1355        type Borrowed<'a> = &'a Self;
1356        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1357            value
1358        }
1359    }
1360
1361    unsafe impl fidl::encoding::TypeMarker for ManagerBindAllUnboundNodesResponse {
1362        type Owned = Self;
1363
1364        #[inline(always)]
1365        fn inline_align(_context: fidl::encoding::Context) -> usize {
1366            8
1367        }
1368
1369        #[inline(always)]
1370        fn inline_size(_context: fidl::encoding::Context) -> usize {
1371            16
1372        }
1373    }
1374
1375    unsafe impl<D: fidl::encoding::ResourceDialect>
1376        fidl::encoding::Encode<ManagerBindAllUnboundNodesResponse, D>
1377        for &ManagerBindAllUnboundNodesResponse
1378    {
1379        #[inline]
1380        unsafe fn encode(
1381            self,
1382            encoder: &mut fidl::encoding::Encoder<'_, D>,
1383            offset: usize,
1384            _depth: fidl::encoding::Depth,
1385        ) -> fidl::Result<()> {
1386            encoder.debug_check_bounds::<ManagerBindAllUnboundNodesResponse>(offset);
1387            // Delegate to tuple encoding.
1388            fidl::encoding::Encode::<ManagerBindAllUnboundNodesResponse, D>::encode(
1389                (
1390                    <fidl::encoding::Vector<NodeBindingInfo, 10> as fidl::encoding::ValueTypeMarker>::borrow(&self.binding_result),
1391                ),
1392                encoder, offset, _depth
1393            )
1394        }
1395    }
1396    unsafe impl<
1397            D: fidl::encoding::ResourceDialect,
1398            T0: fidl::encoding::Encode<fidl::encoding::Vector<NodeBindingInfo, 10>, D>,
1399        > fidl::encoding::Encode<ManagerBindAllUnboundNodesResponse, D> for (T0,)
1400    {
1401        #[inline]
1402        unsafe fn encode(
1403            self,
1404            encoder: &mut fidl::encoding::Encoder<'_, D>,
1405            offset: usize,
1406            depth: fidl::encoding::Depth,
1407        ) -> fidl::Result<()> {
1408            encoder.debug_check_bounds::<ManagerBindAllUnboundNodesResponse>(offset);
1409            // Zero out padding regions. There's no need to apply masks
1410            // because the unmasked parts will be overwritten by fields.
1411            // Write the fields.
1412            self.0.encode(encoder, offset + 0, depth)?;
1413            Ok(())
1414        }
1415    }
1416
1417    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1418        for ManagerBindAllUnboundNodesResponse
1419    {
1420        #[inline(always)]
1421        fn new_empty() -> Self {
1422            Self {
1423                binding_result: fidl::new_empty!(fidl::encoding::Vector<NodeBindingInfo, 10>, D),
1424            }
1425        }
1426
1427        #[inline]
1428        unsafe fn decode(
1429            &mut self,
1430            decoder: &mut fidl::encoding::Decoder<'_, D>,
1431            offset: usize,
1432            _depth: fidl::encoding::Depth,
1433        ) -> fidl::Result<()> {
1434            decoder.debug_check_bounds::<Self>(offset);
1435            // Verify that padding bytes are zero.
1436            fidl::decode!(fidl::encoding::Vector<NodeBindingInfo, 10>, D, &mut self.binding_result, decoder, offset + 0, _depth)?;
1437            Ok(())
1438        }
1439    }
1440
1441    impl fidl::encoding::ValueTypeMarker for ManagerRebindCompositesWithDriverResponse {
1442        type Borrowed<'a> = &'a Self;
1443        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1444            value
1445        }
1446    }
1447
1448    unsafe impl fidl::encoding::TypeMarker for ManagerRebindCompositesWithDriverResponse {
1449        type Owned = Self;
1450
1451        #[inline(always)]
1452        fn inline_align(_context: fidl::encoding::Context) -> usize {
1453            4
1454        }
1455
1456        #[inline(always)]
1457        fn inline_size(_context: fidl::encoding::Context) -> usize {
1458            4
1459        }
1460        #[inline(always)]
1461        fn encode_is_copy() -> bool {
1462            true
1463        }
1464
1465        #[inline(always)]
1466        fn decode_is_copy() -> bool {
1467            true
1468        }
1469    }
1470
1471    unsafe impl<D: fidl::encoding::ResourceDialect>
1472        fidl::encoding::Encode<ManagerRebindCompositesWithDriverResponse, D>
1473        for &ManagerRebindCompositesWithDriverResponse
1474    {
1475        #[inline]
1476        unsafe fn encode(
1477            self,
1478            encoder: &mut fidl::encoding::Encoder<'_, D>,
1479            offset: usize,
1480            _depth: fidl::encoding::Depth,
1481        ) -> fidl::Result<()> {
1482            encoder.debug_check_bounds::<ManagerRebindCompositesWithDriverResponse>(offset);
1483            unsafe {
1484                // Copy the object into the buffer.
1485                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1486                (buf_ptr as *mut ManagerRebindCompositesWithDriverResponse).write_unaligned(
1487                    (self as *const ManagerRebindCompositesWithDriverResponse).read(),
1488                );
1489                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1490                // done second because the memcpy will write garbage to these bytes.
1491            }
1492            Ok(())
1493        }
1494    }
1495    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1496        fidl::encoding::Encode<ManagerRebindCompositesWithDriverResponse, D> for (T0,)
1497    {
1498        #[inline]
1499        unsafe fn encode(
1500            self,
1501            encoder: &mut fidl::encoding::Encoder<'_, D>,
1502            offset: usize,
1503            depth: fidl::encoding::Depth,
1504        ) -> fidl::Result<()> {
1505            encoder.debug_check_bounds::<ManagerRebindCompositesWithDriverResponse>(offset);
1506            // Zero out padding regions. There's no need to apply masks
1507            // because the unmasked parts will be overwritten by fields.
1508            // Write the fields.
1509            self.0.encode(encoder, offset + 0, depth)?;
1510            Ok(())
1511        }
1512    }
1513
1514    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1515        for ManagerRebindCompositesWithDriverResponse
1516    {
1517        #[inline(always)]
1518        fn new_empty() -> Self {
1519            Self { count: fidl::new_empty!(u32, D) }
1520        }
1521
1522        #[inline]
1523        unsafe fn decode(
1524            &mut self,
1525            decoder: &mut fidl::encoding::Decoder<'_, D>,
1526            offset: usize,
1527            _depth: fidl::encoding::Depth,
1528        ) -> fidl::Result<()> {
1529            decoder.debug_check_bounds::<Self>(offset);
1530            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1531            // Verify that padding bytes are zero.
1532            // Copy from the buffer into the object.
1533            unsafe {
1534                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1535            }
1536            Ok(())
1537        }
1538    }
1539
1540    impl fidl::encoding::ValueTypeMarker for ManagerRestartDriverHostsResponse {
1541        type Borrowed<'a> = &'a Self;
1542        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1543            value
1544        }
1545    }
1546
1547    unsafe impl fidl::encoding::TypeMarker for ManagerRestartDriverHostsResponse {
1548        type Owned = Self;
1549
1550        #[inline(always)]
1551        fn inline_align(_context: fidl::encoding::Context) -> usize {
1552            4
1553        }
1554
1555        #[inline(always)]
1556        fn inline_size(_context: fidl::encoding::Context) -> usize {
1557            4
1558        }
1559        #[inline(always)]
1560        fn encode_is_copy() -> bool {
1561            true
1562        }
1563
1564        #[inline(always)]
1565        fn decode_is_copy() -> bool {
1566            true
1567        }
1568    }
1569
1570    unsafe impl<D: fidl::encoding::ResourceDialect>
1571        fidl::encoding::Encode<ManagerRestartDriverHostsResponse, D>
1572        for &ManagerRestartDriverHostsResponse
1573    {
1574        #[inline]
1575        unsafe fn encode(
1576            self,
1577            encoder: &mut fidl::encoding::Encoder<'_, D>,
1578            offset: usize,
1579            _depth: fidl::encoding::Depth,
1580        ) -> fidl::Result<()> {
1581            encoder.debug_check_bounds::<ManagerRestartDriverHostsResponse>(offset);
1582            unsafe {
1583                // Copy the object into the buffer.
1584                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1585                (buf_ptr as *mut ManagerRestartDriverHostsResponse)
1586                    .write_unaligned((self as *const ManagerRestartDriverHostsResponse).read());
1587                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1588                // done second because the memcpy will write garbage to these bytes.
1589            }
1590            Ok(())
1591        }
1592    }
1593    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1594        fidl::encoding::Encode<ManagerRestartDriverHostsResponse, D> for (T0,)
1595    {
1596        #[inline]
1597        unsafe fn encode(
1598            self,
1599            encoder: &mut fidl::encoding::Encoder<'_, D>,
1600            offset: usize,
1601            depth: fidl::encoding::Depth,
1602        ) -> fidl::Result<()> {
1603            encoder.debug_check_bounds::<ManagerRestartDriverHostsResponse>(offset);
1604            // Zero out padding regions. There's no need to apply masks
1605            // because the unmasked parts will be overwritten by fields.
1606            // Write the fields.
1607            self.0.encode(encoder, offset + 0, depth)?;
1608            Ok(())
1609        }
1610    }
1611
1612    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1613        for ManagerRestartDriverHostsResponse
1614    {
1615        #[inline(always)]
1616        fn new_empty() -> Self {
1617            Self { count: fidl::new_empty!(u32, D) }
1618        }
1619
1620        #[inline]
1621        unsafe fn decode(
1622            &mut self,
1623            decoder: &mut fidl::encoding::Decoder<'_, D>,
1624            offset: usize,
1625            _depth: fidl::encoding::Depth,
1626        ) -> fidl::Result<()> {
1627            decoder.debug_check_bounds::<Self>(offset);
1628            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1629            // Verify that padding bytes are zero.
1630            // Copy from the buffer into the object.
1631            unsafe {
1632                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1633            }
1634            Ok(())
1635        }
1636    }
1637
1638    impl fidl::encoding::ValueTypeMarker for NodeInfoIteratorGetNextResponse {
1639        type Borrowed<'a> = &'a Self;
1640        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1641            value
1642        }
1643    }
1644
1645    unsafe impl fidl::encoding::TypeMarker for NodeInfoIteratorGetNextResponse {
1646        type Owned = Self;
1647
1648        #[inline(always)]
1649        fn inline_align(_context: fidl::encoding::Context) -> usize {
1650            8
1651        }
1652
1653        #[inline(always)]
1654        fn inline_size(_context: fidl::encoding::Context) -> usize {
1655            16
1656        }
1657    }
1658
1659    unsafe impl<D: fidl::encoding::ResourceDialect>
1660        fidl::encoding::Encode<NodeInfoIteratorGetNextResponse, D>
1661        for &NodeInfoIteratorGetNextResponse
1662    {
1663        #[inline]
1664        unsafe fn encode(
1665            self,
1666            encoder: &mut fidl::encoding::Encoder<'_, D>,
1667            offset: usize,
1668            _depth: fidl::encoding::Depth,
1669        ) -> fidl::Result<()> {
1670            encoder.debug_check_bounds::<NodeInfoIteratorGetNextResponse>(offset);
1671            // Delegate to tuple encoding.
1672            fidl::encoding::Encode::<NodeInfoIteratorGetNextResponse, D>::encode(
1673                (
1674                    <fidl::encoding::UnboundedVector<NodeInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.nodes),
1675                ),
1676                encoder, offset, _depth
1677            )
1678        }
1679    }
1680    unsafe impl<
1681            D: fidl::encoding::ResourceDialect,
1682            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<NodeInfo>, D>,
1683        > fidl::encoding::Encode<NodeInfoIteratorGetNextResponse, D> for (T0,)
1684    {
1685        #[inline]
1686        unsafe fn encode(
1687            self,
1688            encoder: &mut fidl::encoding::Encoder<'_, D>,
1689            offset: usize,
1690            depth: fidl::encoding::Depth,
1691        ) -> fidl::Result<()> {
1692            encoder.debug_check_bounds::<NodeInfoIteratorGetNextResponse>(offset);
1693            // Zero out padding regions. There's no need to apply masks
1694            // because the unmasked parts will be overwritten by fields.
1695            // Write the fields.
1696            self.0.encode(encoder, offset + 0, depth)?;
1697            Ok(())
1698        }
1699    }
1700
1701    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1702        for NodeInfoIteratorGetNextResponse
1703    {
1704        #[inline(always)]
1705        fn new_empty() -> Self {
1706            Self { nodes: fidl::new_empty!(fidl::encoding::UnboundedVector<NodeInfo>, D) }
1707        }
1708
1709        #[inline]
1710        unsafe fn decode(
1711            &mut self,
1712            decoder: &mut fidl::encoding::Decoder<'_, D>,
1713            offset: usize,
1714            _depth: fidl::encoding::Depth,
1715        ) -> fidl::Result<()> {
1716            decoder.debug_check_bounds::<Self>(offset);
1717            // Verify that padding bytes are zero.
1718            fidl::decode!(
1719                fidl::encoding::UnboundedVector<NodeInfo>,
1720                D,
1721                &mut self.nodes,
1722                decoder,
1723                offset + 0,
1724                _depth
1725            )?;
1726            Ok(())
1727        }
1728    }
1729
1730    impl CompositeNodeInfo {
1731        #[inline(always)]
1732        fn max_ordinal_present(&self) -> u64 {
1733            if let Some(_) = self.composite {
1734                return 3;
1735            }
1736            if let Some(_) = self.topological_path {
1737                return 2;
1738            }
1739            if let Some(_) = self.parent_topological_paths {
1740                return 1;
1741            }
1742            0
1743        }
1744    }
1745
1746    impl fidl::encoding::ValueTypeMarker for CompositeNodeInfo {
1747        type Borrowed<'a> = &'a Self;
1748        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1749            value
1750        }
1751    }
1752
1753    unsafe impl fidl::encoding::TypeMarker for CompositeNodeInfo {
1754        type Owned = Self;
1755
1756        #[inline(always)]
1757        fn inline_align(_context: fidl::encoding::Context) -> usize {
1758            8
1759        }
1760
1761        #[inline(always)]
1762        fn inline_size(_context: fidl::encoding::Context) -> usize {
1763            16
1764        }
1765    }
1766
1767    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CompositeNodeInfo, D>
1768        for &CompositeNodeInfo
1769    {
1770        unsafe fn encode(
1771            self,
1772            encoder: &mut fidl::encoding::Encoder<'_, D>,
1773            offset: usize,
1774            mut depth: fidl::encoding::Depth,
1775        ) -> fidl::Result<()> {
1776            encoder.debug_check_bounds::<CompositeNodeInfo>(offset);
1777            // Vector header
1778            let max_ordinal: u64 = self.max_ordinal_present();
1779            encoder.write_num(max_ordinal, offset);
1780            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1781            // Calling encoder.out_of_line_offset(0) is not allowed.
1782            if max_ordinal == 0 {
1783                return Ok(());
1784            }
1785            depth.increment()?;
1786            let envelope_size = 8;
1787            let bytes_len = max_ordinal as usize * envelope_size;
1788            #[allow(unused_variables)]
1789            let offset = encoder.out_of_line_offset(bytes_len);
1790            let mut _prev_end_offset: usize = 0;
1791            if 1 > max_ordinal {
1792                return Ok(());
1793            }
1794
1795            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1796            // are envelope_size bytes.
1797            let cur_offset: usize = (1 - 1) * envelope_size;
1798
1799            // Zero reserved fields.
1800            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1801
1802            // Safety:
1803            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1804            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1805            //   envelope_size bytes, there is always sufficient room.
1806            fidl::encoding::encode_in_envelope_optional::<
1807                fidl::encoding::UnboundedVector<
1808                    fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1809                >,
1810                D,
1811            >(
1812                self.parent_topological_paths.as_ref().map(
1813                    <fidl::encoding::UnboundedVector<
1814                        fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1815                    > as fidl::encoding::ValueTypeMarker>::borrow,
1816                ),
1817                encoder,
1818                offset + cur_offset,
1819                depth,
1820            )?;
1821
1822            _prev_end_offset = cur_offset + envelope_size;
1823            if 2 > max_ordinal {
1824                return Ok(());
1825            }
1826
1827            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1828            // are envelope_size bytes.
1829            let cur_offset: usize = (2 - 1) * envelope_size;
1830
1831            // Zero reserved fields.
1832            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1833
1834            // Safety:
1835            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1836            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1837            //   envelope_size bytes, there is always sufficient room.
1838            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
1839                self.topological_path.as_ref().map(
1840                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
1841                ),
1842                encoder,
1843                offset + cur_offset,
1844                depth,
1845            )?;
1846
1847            _prev_end_offset = cur_offset + envelope_size;
1848            if 3 > max_ordinal {
1849                return Ok(());
1850            }
1851
1852            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1853            // are envelope_size bytes.
1854            let cur_offset: usize = (3 - 1) * envelope_size;
1855
1856            // Zero reserved fields.
1857            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1858
1859            // Safety:
1860            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1861            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1862            //   envelope_size bytes, there is always sufficient room.
1863            fidl::encoding::encode_in_envelope_optional::<CompositeInfo, D>(
1864                self.composite
1865                    .as_ref()
1866                    .map(<CompositeInfo as fidl::encoding::ValueTypeMarker>::borrow),
1867                encoder,
1868                offset + cur_offset,
1869                depth,
1870            )?;
1871
1872            _prev_end_offset = cur_offset + envelope_size;
1873
1874            Ok(())
1875        }
1876    }
1877
1878    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CompositeNodeInfo {
1879        #[inline(always)]
1880        fn new_empty() -> Self {
1881            Self::default()
1882        }
1883
1884        unsafe fn decode(
1885            &mut self,
1886            decoder: &mut fidl::encoding::Decoder<'_, D>,
1887            offset: usize,
1888            mut depth: fidl::encoding::Depth,
1889        ) -> fidl::Result<()> {
1890            decoder.debug_check_bounds::<Self>(offset);
1891            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1892                None => return Err(fidl::Error::NotNullable),
1893                Some(len) => len,
1894            };
1895            // Calling decoder.out_of_line_offset(0) is not allowed.
1896            if len == 0 {
1897                return Ok(());
1898            };
1899            depth.increment()?;
1900            let envelope_size = 8;
1901            let bytes_len = len * envelope_size;
1902            let offset = decoder.out_of_line_offset(bytes_len)?;
1903            // Decode the envelope for each type.
1904            let mut _next_ordinal_to_read = 0;
1905            let mut next_offset = offset;
1906            let end_offset = offset + bytes_len;
1907            _next_ordinal_to_read += 1;
1908            if next_offset >= end_offset {
1909                return Ok(());
1910            }
1911
1912            // Decode unknown envelopes for gaps in ordinals.
1913            while _next_ordinal_to_read < 1 {
1914                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1915                _next_ordinal_to_read += 1;
1916                next_offset += envelope_size;
1917            }
1918
1919            let next_out_of_line = decoder.next_out_of_line();
1920            let handles_before = decoder.remaining_handles();
1921            if let Some((inlined, num_bytes, num_handles)) =
1922                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1923            {
1924                let member_inline_size = <fidl::encoding::UnboundedVector<
1925                    fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1926                > as fidl::encoding::TypeMarker>::inline_size(
1927                    decoder.context
1928                );
1929                if inlined != (member_inline_size <= 4) {
1930                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1931                }
1932                let inner_offset;
1933                let mut inner_depth = depth.clone();
1934                if inlined {
1935                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1936                    inner_offset = next_offset;
1937                } else {
1938                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1939                    inner_depth.increment()?;
1940                }
1941                let val_ref = self.parent_topological_paths.get_or_insert_with(|| {
1942                    fidl::new_empty!(
1943                        fidl::encoding::UnboundedVector<
1944                            fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1945                        >,
1946                        D
1947                    )
1948                });
1949                fidl::decode!(
1950                    fidl::encoding::UnboundedVector<
1951                        fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1952                    >,
1953                    D,
1954                    val_ref,
1955                    decoder,
1956                    inner_offset,
1957                    inner_depth
1958                )?;
1959                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1960                {
1961                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1962                }
1963                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1964                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1965                }
1966            }
1967
1968            next_offset += envelope_size;
1969            _next_ordinal_to_read += 1;
1970            if next_offset >= end_offset {
1971                return Ok(());
1972            }
1973
1974            // Decode unknown envelopes for gaps in ordinals.
1975            while _next_ordinal_to_read < 2 {
1976                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1977                _next_ordinal_to_read += 1;
1978                next_offset += envelope_size;
1979            }
1980
1981            let next_out_of_line = decoder.next_out_of_line();
1982            let handles_before = decoder.remaining_handles();
1983            if let Some((inlined, num_bytes, num_handles)) =
1984                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1985            {
1986                let member_inline_size =
1987                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
1988                        decoder.context,
1989                    );
1990                if inlined != (member_inline_size <= 4) {
1991                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1992                }
1993                let inner_offset;
1994                let mut inner_depth = depth.clone();
1995                if inlined {
1996                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1997                    inner_offset = next_offset;
1998                } else {
1999                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2000                    inner_depth.increment()?;
2001                }
2002                let val_ref = self
2003                    .topological_path
2004                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2005                fidl::decode!(
2006                    fidl::encoding::UnboundedString,
2007                    D,
2008                    val_ref,
2009                    decoder,
2010                    inner_offset,
2011                    inner_depth
2012                )?;
2013                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2014                {
2015                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2016                }
2017                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2018                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2019                }
2020            }
2021
2022            next_offset += envelope_size;
2023            _next_ordinal_to_read += 1;
2024            if next_offset >= end_offset {
2025                return Ok(());
2026            }
2027
2028            // Decode unknown envelopes for gaps in ordinals.
2029            while _next_ordinal_to_read < 3 {
2030                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2031                _next_ordinal_to_read += 1;
2032                next_offset += envelope_size;
2033            }
2034
2035            let next_out_of_line = decoder.next_out_of_line();
2036            let handles_before = decoder.remaining_handles();
2037            if let Some((inlined, num_bytes, num_handles)) =
2038                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2039            {
2040                let member_inline_size =
2041                    <CompositeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2042                if inlined != (member_inline_size <= 4) {
2043                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2044                }
2045                let inner_offset;
2046                let mut inner_depth = depth.clone();
2047                if inlined {
2048                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2049                    inner_offset = next_offset;
2050                } else {
2051                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2052                    inner_depth.increment()?;
2053                }
2054                let val_ref =
2055                    self.composite.get_or_insert_with(|| fidl::new_empty!(CompositeInfo, D));
2056                fidl::decode!(CompositeInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
2057                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2058                {
2059                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2060                }
2061                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2062                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2063                }
2064            }
2065
2066            next_offset += envelope_size;
2067
2068            // Decode the remaining unknown envelopes.
2069            while next_offset < end_offset {
2070                _next_ordinal_to_read += 1;
2071                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2072                next_offset += envelope_size;
2073            }
2074
2075            Ok(())
2076        }
2077    }
2078
2079    impl DispatcherInfo {
2080        #[inline(always)]
2081        fn max_ordinal_present(&self) -> u64 {
2082            if let Some(_) = self.scheduler_role {
2083                return 4;
2084            }
2085            if let Some(_) = self.options {
2086                return 3;
2087            }
2088            if let Some(_) = self.name {
2089                return 2;
2090            }
2091            if let Some(_) = self.driver {
2092                return 1;
2093            }
2094            0
2095        }
2096    }
2097
2098    impl fidl::encoding::ValueTypeMarker for DispatcherInfo {
2099        type Borrowed<'a> = &'a Self;
2100        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2101            value
2102        }
2103    }
2104
2105    unsafe impl fidl::encoding::TypeMarker for DispatcherInfo {
2106        type Owned = Self;
2107
2108        #[inline(always)]
2109        fn inline_align(_context: fidl::encoding::Context) -> usize {
2110            8
2111        }
2112
2113        #[inline(always)]
2114        fn inline_size(_context: fidl::encoding::Context) -> usize {
2115            16
2116        }
2117    }
2118
2119    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DispatcherInfo, D>
2120        for &DispatcherInfo
2121    {
2122        unsafe fn encode(
2123            self,
2124            encoder: &mut fidl::encoding::Encoder<'_, D>,
2125            offset: usize,
2126            mut depth: fidl::encoding::Depth,
2127        ) -> fidl::Result<()> {
2128            encoder.debug_check_bounds::<DispatcherInfo>(offset);
2129            // Vector header
2130            let max_ordinal: u64 = self.max_ordinal_present();
2131            encoder.write_num(max_ordinal, offset);
2132            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2133            // Calling encoder.out_of_line_offset(0) is not allowed.
2134            if max_ordinal == 0 {
2135                return Ok(());
2136            }
2137            depth.increment()?;
2138            let envelope_size = 8;
2139            let bytes_len = max_ordinal as usize * envelope_size;
2140            #[allow(unused_variables)]
2141            let offset = encoder.out_of_line_offset(bytes_len);
2142            let mut _prev_end_offset: usize = 0;
2143            if 1 > max_ordinal {
2144                return Ok(());
2145            }
2146
2147            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2148            // are envelope_size bytes.
2149            let cur_offset: usize = (1 - 1) * envelope_size;
2150
2151            // Zero reserved fields.
2152            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2153
2154            // Safety:
2155            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2156            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2157            //   envelope_size bytes, there is always sufficient room.
2158            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
2159            self.driver.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
2160            encoder, offset + cur_offset, depth
2161        )?;
2162
2163            _prev_end_offset = cur_offset + envelope_size;
2164            if 2 > max_ordinal {
2165                return Ok(());
2166            }
2167
2168            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2169            // are envelope_size bytes.
2170            let cur_offset: usize = (2 - 1) * envelope_size;
2171
2172            // Zero reserved fields.
2173            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2174
2175            // Safety:
2176            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2177            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2178            //   envelope_size bytes, there is always sufficient room.
2179            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2180                self.name.as_ref().map(
2181                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2182                ),
2183                encoder,
2184                offset + cur_offset,
2185                depth,
2186            )?;
2187
2188            _prev_end_offset = cur_offset + envelope_size;
2189            if 3 > max_ordinal {
2190                return Ok(());
2191            }
2192
2193            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2194            // are envelope_size bytes.
2195            let cur_offset: usize = (3 - 1) * envelope_size;
2196
2197            // Zero reserved fields.
2198            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2199
2200            // Safety:
2201            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2202            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2203            //   envelope_size bytes, there is always sufficient room.
2204            fidl::encoding::encode_in_envelope_optional::<u32, D>(
2205                self.options.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
2206                encoder,
2207                offset + cur_offset,
2208                depth,
2209            )?;
2210
2211            _prev_end_offset = cur_offset + envelope_size;
2212            if 4 > max_ordinal {
2213                return Ok(());
2214            }
2215
2216            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2217            // are envelope_size bytes.
2218            let cur_offset: usize = (4 - 1) * envelope_size;
2219
2220            // Zero reserved fields.
2221            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2222
2223            // Safety:
2224            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2225            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2226            //   envelope_size bytes, there is always sufficient room.
2227            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2228                self.scheduler_role.as_ref().map(
2229                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2230                ),
2231                encoder,
2232                offset + cur_offset,
2233                depth,
2234            )?;
2235
2236            _prev_end_offset = cur_offset + envelope_size;
2237
2238            Ok(())
2239        }
2240    }
2241
2242    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DispatcherInfo {
2243        #[inline(always)]
2244        fn new_empty() -> Self {
2245            Self::default()
2246        }
2247
2248        unsafe fn decode(
2249            &mut self,
2250            decoder: &mut fidl::encoding::Decoder<'_, D>,
2251            offset: usize,
2252            mut depth: fidl::encoding::Depth,
2253        ) -> fidl::Result<()> {
2254            decoder.debug_check_bounds::<Self>(offset);
2255            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2256                None => return Err(fidl::Error::NotNullable),
2257                Some(len) => len,
2258            };
2259            // Calling decoder.out_of_line_offset(0) is not allowed.
2260            if len == 0 {
2261                return Ok(());
2262            };
2263            depth.increment()?;
2264            let envelope_size = 8;
2265            let bytes_len = len * envelope_size;
2266            let offset = decoder.out_of_line_offset(bytes_len)?;
2267            // Decode the envelope for each type.
2268            let mut _next_ordinal_to_read = 0;
2269            let mut next_offset = offset;
2270            let end_offset = offset + bytes_len;
2271            _next_ordinal_to_read += 1;
2272            if next_offset >= end_offset {
2273                return Ok(());
2274            }
2275
2276            // Decode unknown envelopes for gaps in ordinals.
2277            while _next_ordinal_to_read < 1 {
2278                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2279                _next_ordinal_to_read += 1;
2280                next_offset += envelope_size;
2281            }
2282
2283            let next_out_of_line = decoder.next_out_of_line();
2284            let handles_before = decoder.remaining_handles();
2285            if let Some((inlined, num_bytes, num_handles)) =
2286                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2287            {
2288                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2289                if inlined != (member_inline_size <= 4) {
2290                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2291                }
2292                let inner_offset;
2293                let mut inner_depth = depth.clone();
2294                if inlined {
2295                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2296                    inner_offset = next_offset;
2297                } else {
2298                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2299                    inner_depth.increment()?;
2300                }
2301                let val_ref = self.driver.get_or_insert_with(|| {
2302                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
2303                });
2304                fidl::decode!(
2305                    fidl::encoding::BoundedString<4096>,
2306                    D,
2307                    val_ref,
2308                    decoder,
2309                    inner_offset,
2310                    inner_depth
2311                )?;
2312                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2313                {
2314                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2315                }
2316                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2317                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2318                }
2319            }
2320
2321            next_offset += envelope_size;
2322            _next_ordinal_to_read += 1;
2323            if next_offset >= end_offset {
2324                return Ok(());
2325            }
2326
2327            // Decode unknown envelopes for gaps in ordinals.
2328            while _next_ordinal_to_read < 2 {
2329                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2330                _next_ordinal_to_read += 1;
2331                next_offset += envelope_size;
2332            }
2333
2334            let next_out_of_line = decoder.next_out_of_line();
2335            let handles_before = decoder.remaining_handles();
2336            if let Some((inlined, num_bytes, num_handles)) =
2337                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2338            {
2339                let member_inline_size =
2340                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2341                        decoder.context,
2342                    );
2343                if inlined != (member_inline_size <= 4) {
2344                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2345                }
2346                let inner_offset;
2347                let mut inner_depth = depth.clone();
2348                if inlined {
2349                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2350                    inner_offset = next_offset;
2351                } else {
2352                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2353                    inner_depth.increment()?;
2354                }
2355                let val_ref = self
2356                    .name
2357                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2358                fidl::decode!(
2359                    fidl::encoding::UnboundedString,
2360                    D,
2361                    val_ref,
2362                    decoder,
2363                    inner_offset,
2364                    inner_depth
2365                )?;
2366                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2367                {
2368                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2369                }
2370                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2371                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2372                }
2373            }
2374
2375            next_offset += envelope_size;
2376            _next_ordinal_to_read += 1;
2377            if next_offset >= end_offset {
2378                return Ok(());
2379            }
2380
2381            // Decode unknown envelopes for gaps in ordinals.
2382            while _next_ordinal_to_read < 3 {
2383                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2384                _next_ordinal_to_read += 1;
2385                next_offset += envelope_size;
2386            }
2387
2388            let next_out_of_line = decoder.next_out_of_line();
2389            let handles_before = decoder.remaining_handles();
2390            if let Some((inlined, num_bytes, num_handles)) =
2391                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2392            {
2393                let member_inline_size =
2394                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2395                if inlined != (member_inline_size <= 4) {
2396                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2397                }
2398                let inner_offset;
2399                let mut inner_depth = depth.clone();
2400                if inlined {
2401                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2402                    inner_offset = next_offset;
2403                } else {
2404                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2405                    inner_depth.increment()?;
2406                }
2407                let val_ref = self.options.get_or_insert_with(|| fidl::new_empty!(u32, D));
2408                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
2409                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2410                {
2411                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2412                }
2413                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2414                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2415                }
2416            }
2417
2418            next_offset += envelope_size;
2419            _next_ordinal_to_read += 1;
2420            if next_offset >= end_offset {
2421                return Ok(());
2422            }
2423
2424            // Decode unknown envelopes for gaps in ordinals.
2425            while _next_ordinal_to_read < 4 {
2426                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2427                _next_ordinal_to_read += 1;
2428                next_offset += envelope_size;
2429            }
2430
2431            let next_out_of_line = decoder.next_out_of_line();
2432            let handles_before = decoder.remaining_handles();
2433            if let Some((inlined, num_bytes, num_handles)) =
2434                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2435            {
2436                let member_inline_size =
2437                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2438                        decoder.context,
2439                    );
2440                if inlined != (member_inline_size <= 4) {
2441                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2442                }
2443                let inner_offset;
2444                let mut inner_depth = depth.clone();
2445                if inlined {
2446                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2447                    inner_offset = next_offset;
2448                } else {
2449                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2450                    inner_depth.increment()?;
2451                }
2452                let val_ref = self
2453                    .scheduler_role
2454                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2455                fidl::decode!(
2456                    fidl::encoding::UnboundedString,
2457                    D,
2458                    val_ref,
2459                    decoder,
2460                    inner_offset,
2461                    inner_depth
2462                )?;
2463                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2464                {
2465                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2466                }
2467                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2468                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2469                }
2470            }
2471
2472            next_offset += envelope_size;
2473
2474            // Decode the remaining unknown envelopes.
2475            while next_offset < end_offset {
2476                _next_ordinal_to_read += 1;
2477                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2478                next_offset += envelope_size;
2479            }
2480
2481            Ok(())
2482        }
2483    }
2484
2485    impl DriverHostInfo {
2486        #[inline(always)]
2487        fn max_ordinal_present(&self) -> u64 {
2488            if let Some(_) = self.dispatchers {
2489                return 4;
2490            }
2491            if let Some(_) = self.drivers {
2492                return 3;
2493            }
2494            if let Some(_) = self.threads {
2495                return 2;
2496            }
2497            if let Some(_) = self.process_koid {
2498                return 1;
2499            }
2500            0
2501        }
2502    }
2503
2504    impl fidl::encoding::ValueTypeMarker for DriverHostInfo {
2505        type Borrowed<'a> = &'a Self;
2506        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2507            value
2508        }
2509    }
2510
2511    unsafe impl fidl::encoding::TypeMarker for DriverHostInfo {
2512        type Owned = Self;
2513
2514        #[inline(always)]
2515        fn inline_align(_context: fidl::encoding::Context) -> usize {
2516            8
2517        }
2518
2519        #[inline(always)]
2520        fn inline_size(_context: fidl::encoding::Context) -> usize {
2521            16
2522        }
2523    }
2524
2525    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DriverHostInfo, D>
2526        for &DriverHostInfo
2527    {
2528        unsafe fn encode(
2529            self,
2530            encoder: &mut fidl::encoding::Encoder<'_, D>,
2531            offset: usize,
2532            mut depth: fidl::encoding::Depth,
2533        ) -> fidl::Result<()> {
2534            encoder.debug_check_bounds::<DriverHostInfo>(offset);
2535            // Vector header
2536            let max_ordinal: u64 = self.max_ordinal_present();
2537            encoder.write_num(max_ordinal, offset);
2538            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2539            // Calling encoder.out_of_line_offset(0) is not allowed.
2540            if max_ordinal == 0 {
2541                return Ok(());
2542            }
2543            depth.increment()?;
2544            let envelope_size = 8;
2545            let bytes_len = max_ordinal as usize * envelope_size;
2546            #[allow(unused_variables)]
2547            let offset = encoder.out_of_line_offset(bytes_len);
2548            let mut _prev_end_offset: usize = 0;
2549            if 1 > max_ordinal {
2550                return Ok(());
2551            }
2552
2553            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2554            // are envelope_size bytes.
2555            let cur_offset: usize = (1 - 1) * envelope_size;
2556
2557            // Zero reserved fields.
2558            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2559
2560            // Safety:
2561            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2562            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2563            //   envelope_size bytes, there is always sufficient room.
2564            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2565                self.process_koid.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2566                encoder,
2567                offset + cur_offset,
2568                depth,
2569            )?;
2570
2571            _prev_end_offset = cur_offset + envelope_size;
2572            if 2 > max_ordinal {
2573                return Ok(());
2574            }
2575
2576            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2577            // are envelope_size bytes.
2578            let cur_offset: usize = (2 - 1) * envelope_size;
2579
2580            // Zero reserved fields.
2581            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2582
2583            // Safety:
2584            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2585            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2586            //   envelope_size bytes, there is always sufficient room.
2587            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<ThreadInfo>, D>(
2588            self.threads.as_ref().map(<fidl::encoding::UnboundedVector<ThreadInfo> as fidl::encoding::ValueTypeMarker>::borrow),
2589            encoder, offset + cur_offset, depth
2590        )?;
2591
2592            _prev_end_offset = cur_offset + envelope_size;
2593            if 3 > max_ordinal {
2594                return Ok(());
2595            }
2596
2597            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2598            // are envelope_size bytes.
2599            let cur_offset: usize = (3 - 1) * envelope_size;
2600
2601            // Zero reserved fields.
2602            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2603
2604            // Safety:
2605            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2606            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2607            //   envelope_size bytes, there is always sufficient room.
2608            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>, D>(
2609            self.drivers.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>> as fidl::encoding::ValueTypeMarker>::borrow),
2610            encoder, offset + cur_offset, depth
2611        )?;
2612
2613            _prev_end_offset = cur_offset + envelope_size;
2614            if 4 > max_ordinal {
2615                return Ok(());
2616            }
2617
2618            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2619            // are envelope_size bytes.
2620            let cur_offset: usize = (4 - 1) * envelope_size;
2621
2622            // Zero reserved fields.
2623            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2624
2625            // Safety:
2626            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2627            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2628            //   envelope_size bytes, there is always sufficient room.
2629            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<DispatcherInfo>, D>(
2630            self.dispatchers.as_ref().map(<fidl::encoding::UnboundedVector<DispatcherInfo> as fidl::encoding::ValueTypeMarker>::borrow),
2631            encoder, offset + cur_offset, depth
2632        )?;
2633
2634            _prev_end_offset = cur_offset + envelope_size;
2635
2636            Ok(())
2637        }
2638    }
2639
2640    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DriverHostInfo {
2641        #[inline(always)]
2642        fn new_empty() -> Self {
2643            Self::default()
2644        }
2645
2646        unsafe fn decode(
2647            &mut self,
2648            decoder: &mut fidl::encoding::Decoder<'_, D>,
2649            offset: usize,
2650            mut depth: fidl::encoding::Depth,
2651        ) -> fidl::Result<()> {
2652            decoder.debug_check_bounds::<Self>(offset);
2653            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2654                None => return Err(fidl::Error::NotNullable),
2655                Some(len) => len,
2656            };
2657            // Calling decoder.out_of_line_offset(0) is not allowed.
2658            if len == 0 {
2659                return Ok(());
2660            };
2661            depth.increment()?;
2662            let envelope_size = 8;
2663            let bytes_len = len * envelope_size;
2664            let offset = decoder.out_of_line_offset(bytes_len)?;
2665            // Decode the envelope for each type.
2666            let mut _next_ordinal_to_read = 0;
2667            let mut next_offset = offset;
2668            let end_offset = offset + bytes_len;
2669            _next_ordinal_to_read += 1;
2670            if next_offset >= end_offset {
2671                return Ok(());
2672            }
2673
2674            // Decode unknown envelopes for gaps in ordinals.
2675            while _next_ordinal_to_read < 1 {
2676                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2677                _next_ordinal_to_read += 1;
2678                next_offset += envelope_size;
2679            }
2680
2681            let next_out_of_line = decoder.next_out_of_line();
2682            let handles_before = decoder.remaining_handles();
2683            if let Some((inlined, num_bytes, num_handles)) =
2684                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2685            {
2686                let member_inline_size =
2687                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2688                if inlined != (member_inline_size <= 4) {
2689                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2690                }
2691                let inner_offset;
2692                let mut inner_depth = depth.clone();
2693                if inlined {
2694                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2695                    inner_offset = next_offset;
2696                } else {
2697                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2698                    inner_depth.increment()?;
2699                }
2700                let val_ref = self.process_koid.get_or_insert_with(|| fidl::new_empty!(u64, D));
2701                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2702                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2703                {
2704                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2705                }
2706                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2707                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2708                }
2709            }
2710
2711            next_offset += envelope_size;
2712            _next_ordinal_to_read += 1;
2713            if next_offset >= end_offset {
2714                return Ok(());
2715            }
2716
2717            // Decode unknown envelopes for gaps in ordinals.
2718            while _next_ordinal_to_read < 2 {
2719                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2720                _next_ordinal_to_read += 1;
2721                next_offset += envelope_size;
2722            }
2723
2724            let next_out_of_line = decoder.next_out_of_line();
2725            let handles_before = decoder.remaining_handles();
2726            if let Some((inlined, num_bytes, num_handles)) =
2727                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2728            {
2729                let member_inline_size = <fidl::encoding::UnboundedVector<ThreadInfo> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2730                if inlined != (member_inline_size <= 4) {
2731                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2732                }
2733                let inner_offset;
2734                let mut inner_depth = depth.clone();
2735                if inlined {
2736                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2737                    inner_offset = next_offset;
2738                } else {
2739                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2740                    inner_depth.increment()?;
2741                }
2742                let val_ref = self.threads.get_or_insert_with(|| {
2743                    fidl::new_empty!(fidl::encoding::UnboundedVector<ThreadInfo>, D)
2744                });
2745                fidl::decode!(
2746                    fidl::encoding::UnboundedVector<ThreadInfo>,
2747                    D,
2748                    val_ref,
2749                    decoder,
2750                    inner_offset,
2751                    inner_depth
2752                )?;
2753                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2754                {
2755                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2756                }
2757                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2758                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2759                }
2760            }
2761
2762            next_offset += envelope_size;
2763            _next_ordinal_to_read += 1;
2764            if next_offset >= end_offset {
2765                return Ok(());
2766            }
2767
2768            // Decode unknown envelopes for gaps in ordinals.
2769            while _next_ordinal_to_read < 3 {
2770                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2771                _next_ordinal_to_read += 1;
2772                next_offset += envelope_size;
2773            }
2774
2775            let next_out_of_line = decoder.next_out_of_line();
2776            let handles_before = decoder.remaining_handles();
2777            if let Some((inlined, num_bytes, num_handles)) =
2778                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2779            {
2780                let member_inline_size = <fidl::encoding::UnboundedVector<
2781                    fidl::encoding::BoundedString<4096>,
2782                > as fidl::encoding::TypeMarker>::inline_size(
2783                    decoder.context
2784                );
2785                if inlined != (member_inline_size <= 4) {
2786                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2787                }
2788                let inner_offset;
2789                let mut inner_depth = depth.clone();
2790                if inlined {
2791                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2792                    inner_offset = next_offset;
2793                } else {
2794                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2795                    inner_depth.increment()?;
2796                }
2797                let val_ref = self.drivers.get_or_insert_with(|| {
2798                    fidl::new_empty!(
2799                        fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
2800                        D
2801                    )
2802                });
2803                fidl::decode!(
2804                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
2805                    D,
2806                    val_ref,
2807                    decoder,
2808                    inner_offset,
2809                    inner_depth
2810                )?;
2811                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2812                {
2813                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2814                }
2815                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2816                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2817                }
2818            }
2819
2820            next_offset += envelope_size;
2821            _next_ordinal_to_read += 1;
2822            if next_offset >= end_offset {
2823                return Ok(());
2824            }
2825
2826            // Decode unknown envelopes for gaps in ordinals.
2827            while _next_ordinal_to_read < 4 {
2828                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2829                _next_ordinal_to_read += 1;
2830                next_offset += envelope_size;
2831            }
2832
2833            let next_out_of_line = decoder.next_out_of_line();
2834            let handles_before = decoder.remaining_handles();
2835            if let Some((inlined, num_bytes, num_handles)) =
2836                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2837            {
2838                let member_inline_size = <fidl::encoding::UnboundedVector<DispatcherInfo> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2839                if inlined != (member_inline_size <= 4) {
2840                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2841                }
2842                let inner_offset;
2843                let mut inner_depth = depth.clone();
2844                if inlined {
2845                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2846                    inner_offset = next_offset;
2847                } else {
2848                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2849                    inner_depth.increment()?;
2850                }
2851                let val_ref = self.dispatchers.get_or_insert_with(|| {
2852                    fidl::new_empty!(fidl::encoding::UnboundedVector<DispatcherInfo>, D)
2853                });
2854                fidl::decode!(
2855                    fidl::encoding::UnboundedVector<DispatcherInfo>,
2856                    D,
2857                    val_ref,
2858                    decoder,
2859                    inner_offset,
2860                    inner_depth
2861                )?;
2862                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2863                {
2864                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2865                }
2866                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2867                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2868                }
2869            }
2870
2871            next_offset += envelope_size;
2872
2873            // Decode the remaining unknown envelopes.
2874            while next_offset < end_offset {
2875                _next_ordinal_to_read += 1;
2876                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2877                next_offset += envelope_size;
2878            }
2879
2880            Ok(())
2881        }
2882    }
2883
2884    impl NodeBindingInfo {
2885        #[inline(always)]
2886        fn max_ordinal_present(&self) -> u64 {
2887            if let Some(_) = self.composite_parents {
2888                return 3;
2889            }
2890            if let Some(_) = self.driver_url {
2891                return 2;
2892            }
2893            if let Some(_) = self.node_name {
2894                return 1;
2895            }
2896            0
2897        }
2898    }
2899
2900    impl fidl::encoding::ValueTypeMarker for NodeBindingInfo {
2901        type Borrowed<'a> = &'a Self;
2902        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2903            value
2904        }
2905    }
2906
2907    unsafe impl fidl::encoding::TypeMarker for NodeBindingInfo {
2908        type Owned = Self;
2909
2910        #[inline(always)]
2911        fn inline_align(_context: fidl::encoding::Context) -> usize {
2912            8
2913        }
2914
2915        #[inline(always)]
2916        fn inline_size(_context: fidl::encoding::Context) -> usize {
2917            16
2918        }
2919    }
2920
2921    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeBindingInfo, D>
2922        for &NodeBindingInfo
2923    {
2924        unsafe fn encode(
2925            self,
2926            encoder: &mut fidl::encoding::Encoder<'_, D>,
2927            offset: usize,
2928            mut depth: fidl::encoding::Depth,
2929        ) -> fidl::Result<()> {
2930            encoder.debug_check_bounds::<NodeBindingInfo>(offset);
2931            // Vector header
2932            let max_ordinal: u64 = self.max_ordinal_present();
2933            encoder.write_num(max_ordinal, offset);
2934            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2935            // Calling encoder.out_of_line_offset(0) is not allowed.
2936            if max_ordinal == 0 {
2937                return Ok(());
2938            }
2939            depth.increment()?;
2940            let envelope_size = 8;
2941            let bytes_len = max_ordinal as usize * envelope_size;
2942            #[allow(unused_variables)]
2943            let offset = encoder.out_of_line_offset(bytes_len);
2944            let mut _prev_end_offset: usize = 0;
2945            if 1 > max_ordinal {
2946                return Ok(());
2947            }
2948
2949            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2950            // are envelope_size bytes.
2951            let cur_offset: usize = (1 - 1) * envelope_size;
2952
2953            // Zero reserved fields.
2954            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2955
2956            // Safety:
2957            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2958            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2959            //   envelope_size bytes, there is always sufficient room.
2960            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
2961            self.node_name.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
2962            encoder, offset + cur_offset, depth
2963        )?;
2964
2965            _prev_end_offset = cur_offset + envelope_size;
2966            if 2 > max_ordinal {
2967                return Ok(());
2968            }
2969
2970            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2971            // are envelope_size bytes.
2972            let cur_offset: usize = (2 - 1) * envelope_size;
2973
2974            // Zero reserved fields.
2975            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2976
2977            // Safety:
2978            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2979            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2980            //   envelope_size bytes, there is always sufficient room.
2981            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
2982            self.driver_url.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
2983            encoder, offset + cur_offset, depth
2984        )?;
2985
2986            _prev_end_offset = cur_offset + envelope_size;
2987            if 3 > max_ordinal {
2988                return Ok(());
2989            }
2990
2991            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2992            // are envelope_size bytes.
2993            let cur_offset: usize = (3 - 1) * envelope_size;
2994
2995            // Zero reserved fields.
2996            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2997
2998            // Safety:
2999            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3000            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3001            //   envelope_size bytes, there is always sufficient room.
3002            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::CompositeParent>, D>(
3003            self.composite_parents.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::CompositeParent> as fidl::encoding::ValueTypeMarker>::borrow),
3004            encoder, offset + cur_offset, depth
3005        )?;
3006
3007            _prev_end_offset = cur_offset + envelope_size;
3008
3009            Ok(())
3010        }
3011    }
3012
3013    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeBindingInfo {
3014        #[inline(always)]
3015        fn new_empty() -> Self {
3016            Self::default()
3017        }
3018
3019        unsafe fn decode(
3020            &mut self,
3021            decoder: &mut fidl::encoding::Decoder<'_, D>,
3022            offset: usize,
3023            mut depth: fidl::encoding::Depth,
3024        ) -> fidl::Result<()> {
3025            decoder.debug_check_bounds::<Self>(offset);
3026            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3027                None => return Err(fidl::Error::NotNullable),
3028                Some(len) => len,
3029            };
3030            // Calling decoder.out_of_line_offset(0) is not allowed.
3031            if len == 0 {
3032                return Ok(());
3033            };
3034            depth.increment()?;
3035            let envelope_size = 8;
3036            let bytes_len = len * envelope_size;
3037            let offset = decoder.out_of_line_offset(bytes_len)?;
3038            // Decode the envelope for each type.
3039            let mut _next_ordinal_to_read = 0;
3040            let mut next_offset = offset;
3041            let end_offset = offset + bytes_len;
3042            _next_ordinal_to_read += 1;
3043            if next_offset >= end_offset {
3044                return Ok(());
3045            }
3046
3047            // Decode unknown envelopes for gaps in ordinals.
3048            while _next_ordinal_to_read < 1 {
3049                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3050                _next_ordinal_to_read += 1;
3051                next_offset += envelope_size;
3052            }
3053
3054            let next_out_of_line = decoder.next_out_of_line();
3055            let handles_before = decoder.remaining_handles();
3056            if let Some((inlined, num_bytes, num_handles)) =
3057                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3058            {
3059                let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3060                if inlined != (member_inline_size <= 4) {
3061                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3062                }
3063                let inner_offset;
3064                let mut inner_depth = depth.clone();
3065                if inlined {
3066                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3067                    inner_offset = next_offset;
3068                } else {
3069                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3070                    inner_depth.increment()?;
3071                }
3072                let val_ref = self.node_name.get_or_insert_with(|| {
3073                    fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
3074                });
3075                fidl::decode!(
3076                    fidl::encoding::BoundedString<1024>,
3077                    D,
3078                    val_ref,
3079                    decoder,
3080                    inner_offset,
3081                    inner_depth
3082                )?;
3083                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3084                {
3085                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3086                }
3087                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3088                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3089                }
3090            }
3091
3092            next_offset += envelope_size;
3093            _next_ordinal_to_read += 1;
3094            if next_offset >= end_offset {
3095                return Ok(());
3096            }
3097
3098            // Decode unknown envelopes for gaps in ordinals.
3099            while _next_ordinal_to_read < 2 {
3100                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3101                _next_ordinal_to_read += 1;
3102                next_offset += envelope_size;
3103            }
3104
3105            let next_out_of_line = decoder.next_out_of_line();
3106            let handles_before = decoder.remaining_handles();
3107            if let Some((inlined, num_bytes, num_handles)) =
3108                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3109            {
3110                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3111                if inlined != (member_inline_size <= 4) {
3112                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3113                }
3114                let inner_offset;
3115                let mut inner_depth = depth.clone();
3116                if inlined {
3117                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3118                    inner_offset = next_offset;
3119                } else {
3120                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3121                    inner_depth.increment()?;
3122                }
3123                let val_ref = self.driver_url.get_or_insert_with(|| {
3124                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
3125                });
3126                fidl::decode!(
3127                    fidl::encoding::BoundedString<4096>,
3128                    D,
3129                    val_ref,
3130                    decoder,
3131                    inner_offset,
3132                    inner_depth
3133                )?;
3134                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3135                {
3136                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3137                }
3138                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3139                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3140                }
3141            }
3142
3143            next_offset += envelope_size;
3144            _next_ordinal_to_read += 1;
3145            if next_offset >= end_offset {
3146                return Ok(());
3147            }
3148
3149            // Decode unknown envelopes for gaps in ordinals.
3150            while _next_ordinal_to_read < 3 {
3151                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3152                _next_ordinal_to_read += 1;
3153                next_offset += envelope_size;
3154            }
3155
3156            let next_out_of_line = decoder.next_out_of_line();
3157            let handles_before = decoder.remaining_handles();
3158            if let Some((inlined, num_bytes, num_handles)) =
3159                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3160            {
3161                let member_inline_size = <fidl::encoding::UnboundedVector<
3162                    fidl_fuchsia_driver_framework::CompositeParent,
3163                > as fidl::encoding::TypeMarker>::inline_size(
3164                    decoder.context
3165                );
3166                if inlined != (member_inline_size <= 4) {
3167                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3168                }
3169                let inner_offset;
3170                let mut inner_depth = depth.clone();
3171                if inlined {
3172                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3173                    inner_offset = next_offset;
3174                } else {
3175                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3176                    inner_depth.increment()?;
3177                }
3178                let val_ref = self.composite_parents.get_or_insert_with(|| {
3179                    fidl::new_empty!(
3180                        fidl::encoding::UnboundedVector<
3181                            fidl_fuchsia_driver_framework::CompositeParent,
3182                        >,
3183                        D
3184                    )
3185                });
3186                fidl::decode!(
3187                    fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::CompositeParent>,
3188                    D,
3189                    val_ref,
3190                    decoder,
3191                    inner_offset,
3192                    inner_depth
3193                )?;
3194                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3195                {
3196                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3197                }
3198                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3199                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3200                }
3201            }
3202
3203            next_offset += envelope_size;
3204
3205            // Decode the remaining unknown envelopes.
3206            while next_offset < end_offset {
3207                _next_ordinal_to_read += 1;
3208                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3209                next_offset += envelope_size;
3210            }
3211
3212            Ok(())
3213        }
3214    }
3215
3216    impl NodeInfo {
3217        #[inline(always)]
3218        fn max_ordinal_present(&self) -> u64 {
3219            if let Some(_) = self.bus_topology {
3220                return 11;
3221            }
3222            if let Some(_) = self.quarantined {
3223                return 10;
3224            }
3225            if let Some(_) = self.offer_list {
3226                return 9;
3227            }
3228            if let Some(_) = self.node_property_list {
3229                return 8;
3230            }
3231            if let Some(_) = self.moniker {
3232                return 7;
3233            }
3234            if let Some(_) = self.bound_driver_url {
3235                return 5;
3236            }
3237            if let Some(_) = self.driver_host_koid {
3238                return 4;
3239            }
3240            if let Some(_) = self.child_ids {
3241                return 3;
3242            }
3243            if let Some(_) = self.parent_ids {
3244                return 2;
3245            }
3246            if let Some(_) = self.id {
3247                return 1;
3248            }
3249            0
3250        }
3251    }
3252
3253    impl fidl::encoding::ValueTypeMarker for NodeInfo {
3254        type Borrowed<'a> = &'a Self;
3255        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3256            value
3257        }
3258    }
3259
3260    unsafe impl fidl::encoding::TypeMarker for NodeInfo {
3261        type Owned = Self;
3262
3263        #[inline(always)]
3264        fn inline_align(_context: fidl::encoding::Context) -> usize {
3265            8
3266        }
3267
3268        #[inline(always)]
3269        fn inline_size(_context: fidl::encoding::Context) -> usize {
3270            16
3271        }
3272    }
3273
3274    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeInfo, D> for &NodeInfo {
3275        unsafe fn encode(
3276            self,
3277            encoder: &mut fidl::encoding::Encoder<'_, D>,
3278            offset: usize,
3279            mut depth: fidl::encoding::Depth,
3280        ) -> fidl::Result<()> {
3281            encoder.debug_check_bounds::<NodeInfo>(offset);
3282            // Vector header
3283            let max_ordinal: u64 = self.max_ordinal_present();
3284            encoder.write_num(max_ordinal, offset);
3285            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3286            // Calling encoder.out_of_line_offset(0) is not allowed.
3287            if max_ordinal == 0 {
3288                return Ok(());
3289            }
3290            depth.increment()?;
3291            let envelope_size = 8;
3292            let bytes_len = max_ordinal as usize * envelope_size;
3293            #[allow(unused_variables)]
3294            let offset = encoder.out_of_line_offset(bytes_len);
3295            let mut _prev_end_offset: usize = 0;
3296            if 1 > max_ordinal {
3297                return Ok(());
3298            }
3299
3300            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3301            // are envelope_size bytes.
3302            let cur_offset: usize = (1 - 1) * envelope_size;
3303
3304            // Zero reserved fields.
3305            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3306
3307            // Safety:
3308            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3309            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3310            //   envelope_size bytes, there is always sufficient room.
3311            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3312                self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3313                encoder,
3314                offset + cur_offset,
3315                depth,
3316            )?;
3317
3318            _prev_end_offset = cur_offset + envelope_size;
3319            if 2 > max_ordinal {
3320                return Ok(());
3321            }
3322
3323            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3324            // are envelope_size bytes.
3325            let cur_offset: usize = (2 - 1) * envelope_size;
3326
3327            // Zero reserved fields.
3328            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3329
3330            // Safety:
3331            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3332            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3333            //   envelope_size bytes, there is always sufficient room.
3334            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u64>, D>(
3335            self.parent_ids.as_ref().map(<fidl::encoding::UnboundedVector<u64> as fidl::encoding::ValueTypeMarker>::borrow),
3336            encoder, offset + cur_offset, depth
3337        )?;
3338
3339            _prev_end_offset = cur_offset + envelope_size;
3340            if 3 > max_ordinal {
3341                return Ok(());
3342            }
3343
3344            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3345            // are envelope_size bytes.
3346            let cur_offset: usize = (3 - 1) * envelope_size;
3347
3348            // Zero reserved fields.
3349            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3350
3351            // Safety:
3352            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3353            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3354            //   envelope_size bytes, there is always sufficient room.
3355            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u64>, D>(
3356            self.child_ids.as_ref().map(<fidl::encoding::UnboundedVector<u64> as fidl::encoding::ValueTypeMarker>::borrow),
3357            encoder, offset + cur_offset, depth
3358        )?;
3359
3360            _prev_end_offset = cur_offset + envelope_size;
3361            if 4 > max_ordinal {
3362                return Ok(());
3363            }
3364
3365            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3366            // are envelope_size bytes.
3367            let cur_offset: usize = (4 - 1) * envelope_size;
3368
3369            // Zero reserved fields.
3370            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3371
3372            // Safety:
3373            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3374            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3375            //   envelope_size bytes, there is always sufficient room.
3376            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3377                self.driver_host_koid
3378                    .as_ref()
3379                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3380                encoder,
3381                offset + cur_offset,
3382                depth,
3383            )?;
3384
3385            _prev_end_offset = cur_offset + envelope_size;
3386            if 5 > max_ordinal {
3387                return Ok(());
3388            }
3389
3390            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3391            // are envelope_size bytes.
3392            let cur_offset: usize = (5 - 1) * envelope_size;
3393
3394            // Zero reserved fields.
3395            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3396
3397            // Safety:
3398            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3399            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3400            //   envelope_size bytes, there is always sufficient room.
3401            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
3402            self.bound_driver_url.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
3403            encoder, offset + cur_offset, depth
3404        )?;
3405
3406            _prev_end_offset = cur_offset + envelope_size;
3407            if 7 > max_ordinal {
3408                return Ok(());
3409            }
3410
3411            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3412            // are envelope_size bytes.
3413            let cur_offset: usize = (7 - 1) * envelope_size;
3414
3415            // Zero reserved fields.
3416            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3417
3418            // Safety:
3419            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3420            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3421            //   envelope_size bytes, there is always sufficient room.
3422            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
3423            self.moniker.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
3424            encoder, offset + cur_offset, depth
3425        )?;
3426
3427            _prev_end_offset = cur_offset + envelope_size;
3428            if 8 > max_ordinal {
3429                return Ok(());
3430            }
3431
3432            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3433            // are envelope_size bytes.
3434            let cur_offset: usize = (8 - 1) * envelope_size;
3435
3436            // Zero reserved fields.
3437            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3438
3439            // Safety:
3440            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3441            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3442            //   envelope_size bytes, there is always sufficient room.
3443            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64>, D>(
3444            self.node_property_list.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64> as fidl::encoding::ValueTypeMarker>::borrow),
3445            encoder, offset + cur_offset, depth
3446        )?;
3447
3448            _prev_end_offset = cur_offset + envelope_size;
3449            if 9 > max_ordinal {
3450                return Ok(());
3451            }
3452
3453            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3454            // are envelope_size bytes.
3455            let cur_offset: usize = (9 - 1) * envelope_size;
3456
3457            // Zero reserved fields.
3458            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3459
3460            // Safety:
3461            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3462            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3463            //   envelope_size bytes, there is always sufficient room.
3464            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>, D>(
3465            self.offer_list.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer> as fidl::encoding::ValueTypeMarker>::borrow),
3466            encoder, offset + cur_offset, depth
3467        )?;
3468
3469            _prev_end_offset = cur_offset + envelope_size;
3470            if 10 > max_ordinal {
3471                return Ok(());
3472            }
3473
3474            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3475            // are envelope_size bytes.
3476            let cur_offset: usize = (10 - 1) * envelope_size;
3477
3478            // Zero reserved fields.
3479            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3480
3481            // Safety:
3482            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3483            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3484            //   envelope_size bytes, there is always sufficient room.
3485            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3486                self.quarantined.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3487                encoder,
3488                offset + cur_offset,
3489                depth,
3490            )?;
3491
3492            _prev_end_offset = cur_offset + envelope_size;
3493            if 11 > max_ordinal {
3494                return Ok(());
3495            }
3496
3497            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3498            // are envelope_size bytes.
3499            let cur_offset: usize = (11 - 1) * envelope_size;
3500
3501            // Zero reserved fields.
3502            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3503
3504            // Safety:
3505            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3506            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3507            //   envelope_size bytes, there is always sufficient room.
3508            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_driver_framework::BusInfo, 20>, D>(
3509            self.bus_topology.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_driver_framework::BusInfo, 20> as fidl::encoding::ValueTypeMarker>::borrow),
3510            encoder, offset + cur_offset, depth
3511        )?;
3512
3513            _prev_end_offset = cur_offset + envelope_size;
3514
3515            Ok(())
3516        }
3517    }
3518
3519    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeInfo {
3520        #[inline(always)]
3521        fn new_empty() -> Self {
3522            Self::default()
3523        }
3524
3525        unsafe fn decode(
3526            &mut self,
3527            decoder: &mut fidl::encoding::Decoder<'_, D>,
3528            offset: usize,
3529            mut depth: fidl::encoding::Depth,
3530        ) -> fidl::Result<()> {
3531            decoder.debug_check_bounds::<Self>(offset);
3532            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3533                None => return Err(fidl::Error::NotNullable),
3534                Some(len) => len,
3535            };
3536            // Calling decoder.out_of_line_offset(0) is not allowed.
3537            if len == 0 {
3538                return Ok(());
3539            };
3540            depth.increment()?;
3541            let envelope_size = 8;
3542            let bytes_len = len * envelope_size;
3543            let offset = decoder.out_of_line_offset(bytes_len)?;
3544            // Decode the envelope for each type.
3545            let mut _next_ordinal_to_read = 0;
3546            let mut next_offset = offset;
3547            let end_offset = offset + bytes_len;
3548            _next_ordinal_to_read += 1;
3549            if next_offset >= end_offset {
3550                return Ok(());
3551            }
3552
3553            // Decode unknown envelopes for gaps in ordinals.
3554            while _next_ordinal_to_read < 1 {
3555                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3556                _next_ordinal_to_read += 1;
3557                next_offset += envelope_size;
3558            }
3559
3560            let next_out_of_line = decoder.next_out_of_line();
3561            let handles_before = decoder.remaining_handles();
3562            if let Some((inlined, num_bytes, num_handles)) =
3563                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3564            {
3565                let member_inline_size =
3566                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3567                if inlined != (member_inline_size <= 4) {
3568                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3569                }
3570                let inner_offset;
3571                let mut inner_depth = depth.clone();
3572                if inlined {
3573                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3574                    inner_offset = next_offset;
3575                } else {
3576                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3577                    inner_depth.increment()?;
3578                }
3579                let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(u64, D));
3580                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3581                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3582                {
3583                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3584                }
3585                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3586                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3587                }
3588            }
3589
3590            next_offset += envelope_size;
3591            _next_ordinal_to_read += 1;
3592            if next_offset >= end_offset {
3593                return Ok(());
3594            }
3595
3596            // Decode unknown envelopes for gaps in ordinals.
3597            while _next_ordinal_to_read < 2 {
3598                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3599                _next_ordinal_to_read += 1;
3600                next_offset += envelope_size;
3601            }
3602
3603            let next_out_of_line = decoder.next_out_of_line();
3604            let handles_before = decoder.remaining_handles();
3605            if let Some((inlined, num_bytes, num_handles)) =
3606                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3607            {
3608                let member_inline_size = <fidl::encoding::UnboundedVector<u64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3609                if inlined != (member_inline_size <= 4) {
3610                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3611                }
3612                let inner_offset;
3613                let mut inner_depth = depth.clone();
3614                if inlined {
3615                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3616                    inner_offset = next_offset;
3617                } else {
3618                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3619                    inner_depth.increment()?;
3620                }
3621                let val_ref = self.parent_ids.get_or_insert_with(|| {
3622                    fidl::new_empty!(fidl::encoding::UnboundedVector<u64>, D)
3623                });
3624                fidl::decode!(
3625                    fidl::encoding::UnboundedVector<u64>,
3626                    D,
3627                    val_ref,
3628                    decoder,
3629                    inner_offset,
3630                    inner_depth
3631                )?;
3632                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3633                {
3634                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3635                }
3636                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3637                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3638                }
3639            }
3640
3641            next_offset += envelope_size;
3642            _next_ordinal_to_read += 1;
3643            if next_offset >= end_offset {
3644                return Ok(());
3645            }
3646
3647            // Decode unknown envelopes for gaps in ordinals.
3648            while _next_ordinal_to_read < 3 {
3649                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3650                _next_ordinal_to_read += 1;
3651                next_offset += envelope_size;
3652            }
3653
3654            let next_out_of_line = decoder.next_out_of_line();
3655            let handles_before = decoder.remaining_handles();
3656            if let Some((inlined, num_bytes, num_handles)) =
3657                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3658            {
3659                let member_inline_size = <fidl::encoding::UnboundedVector<u64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3660                if inlined != (member_inline_size <= 4) {
3661                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3662                }
3663                let inner_offset;
3664                let mut inner_depth = depth.clone();
3665                if inlined {
3666                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3667                    inner_offset = next_offset;
3668                } else {
3669                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3670                    inner_depth.increment()?;
3671                }
3672                let val_ref = self.child_ids.get_or_insert_with(|| {
3673                    fidl::new_empty!(fidl::encoding::UnboundedVector<u64>, D)
3674                });
3675                fidl::decode!(
3676                    fidl::encoding::UnboundedVector<u64>,
3677                    D,
3678                    val_ref,
3679                    decoder,
3680                    inner_offset,
3681                    inner_depth
3682                )?;
3683                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3684                {
3685                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3686                }
3687                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3688                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3689                }
3690            }
3691
3692            next_offset += envelope_size;
3693            _next_ordinal_to_read += 1;
3694            if next_offset >= end_offset {
3695                return Ok(());
3696            }
3697
3698            // Decode unknown envelopes for gaps in ordinals.
3699            while _next_ordinal_to_read < 4 {
3700                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3701                _next_ordinal_to_read += 1;
3702                next_offset += envelope_size;
3703            }
3704
3705            let next_out_of_line = decoder.next_out_of_line();
3706            let handles_before = decoder.remaining_handles();
3707            if let Some((inlined, num_bytes, num_handles)) =
3708                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3709            {
3710                let member_inline_size =
3711                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3712                if inlined != (member_inline_size <= 4) {
3713                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3714                }
3715                let inner_offset;
3716                let mut inner_depth = depth.clone();
3717                if inlined {
3718                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3719                    inner_offset = next_offset;
3720                } else {
3721                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3722                    inner_depth.increment()?;
3723                }
3724                let val_ref = self.driver_host_koid.get_or_insert_with(|| fidl::new_empty!(u64, D));
3725                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3726                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3727                {
3728                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3729                }
3730                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3731                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3732                }
3733            }
3734
3735            next_offset += envelope_size;
3736            _next_ordinal_to_read += 1;
3737            if next_offset >= end_offset {
3738                return Ok(());
3739            }
3740
3741            // Decode unknown envelopes for gaps in ordinals.
3742            while _next_ordinal_to_read < 5 {
3743                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3744                _next_ordinal_to_read += 1;
3745                next_offset += envelope_size;
3746            }
3747
3748            let next_out_of_line = decoder.next_out_of_line();
3749            let handles_before = decoder.remaining_handles();
3750            if let Some((inlined, num_bytes, num_handles)) =
3751                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3752            {
3753                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3754                if inlined != (member_inline_size <= 4) {
3755                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3756                }
3757                let inner_offset;
3758                let mut inner_depth = depth.clone();
3759                if inlined {
3760                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3761                    inner_offset = next_offset;
3762                } else {
3763                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3764                    inner_depth.increment()?;
3765                }
3766                let val_ref = self.bound_driver_url.get_or_insert_with(|| {
3767                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
3768                });
3769                fidl::decode!(
3770                    fidl::encoding::BoundedString<4096>,
3771                    D,
3772                    val_ref,
3773                    decoder,
3774                    inner_offset,
3775                    inner_depth
3776                )?;
3777                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3778                {
3779                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3780                }
3781                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3782                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3783                }
3784            }
3785
3786            next_offset += envelope_size;
3787            _next_ordinal_to_read += 1;
3788            if next_offset >= end_offset {
3789                return Ok(());
3790            }
3791
3792            // Decode unknown envelopes for gaps in ordinals.
3793            while _next_ordinal_to_read < 7 {
3794                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3795                _next_ordinal_to_read += 1;
3796                next_offset += envelope_size;
3797            }
3798
3799            let next_out_of_line = decoder.next_out_of_line();
3800            let handles_before = decoder.remaining_handles();
3801            if let Some((inlined, num_bytes, num_handles)) =
3802                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3803            {
3804                let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3805                if inlined != (member_inline_size <= 4) {
3806                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3807                }
3808                let inner_offset;
3809                let mut inner_depth = depth.clone();
3810                if inlined {
3811                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3812                    inner_offset = next_offset;
3813                } else {
3814                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3815                    inner_depth.increment()?;
3816                }
3817                let val_ref = self.moniker.get_or_insert_with(|| {
3818                    fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
3819                });
3820                fidl::decode!(
3821                    fidl::encoding::BoundedString<1024>,
3822                    D,
3823                    val_ref,
3824                    decoder,
3825                    inner_offset,
3826                    inner_depth
3827                )?;
3828                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3829                {
3830                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3831                }
3832                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3833                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3834                }
3835            }
3836
3837            next_offset += envelope_size;
3838            _next_ordinal_to_read += 1;
3839            if next_offset >= end_offset {
3840                return Ok(());
3841            }
3842
3843            // Decode unknown envelopes for gaps in ordinals.
3844            while _next_ordinal_to_read < 8 {
3845                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3846                _next_ordinal_to_read += 1;
3847                next_offset += envelope_size;
3848            }
3849
3850            let next_out_of_line = decoder.next_out_of_line();
3851            let handles_before = decoder.remaining_handles();
3852            if let Some((inlined, num_bytes, num_handles)) =
3853                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3854            {
3855                let member_inline_size = <fidl::encoding::Vector<
3856                    fidl_fuchsia_driver_framework::NodeProperty,
3857                    64,
3858                > as fidl::encoding::TypeMarker>::inline_size(
3859                    decoder.context
3860                );
3861                if inlined != (member_inline_size <= 4) {
3862                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3863                }
3864                let inner_offset;
3865                let mut inner_depth = depth.clone();
3866                if inlined {
3867                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3868                    inner_offset = next_offset;
3869                } else {
3870                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3871                    inner_depth.increment()?;
3872                }
3873                let val_ref =
3874                self.node_property_list.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64>, D));
3875                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
3876                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3877                {
3878                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3879                }
3880                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3881                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3882                }
3883            }
3884
3885            next_offset += envelope_size;
3886            _next_ordinal_to_read += 1;
3887            if next_offset >= end_offset {
3888                return Ok(());
3889            }
3890
3891            // Decode unknown envelopes for gaps in ordinals.
3892            while _next_ordinal_to_read < 9 {
3893                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3894                _next_ordinal_to_read += 1;
3895                next_offset += envelope_size;
3896            }
3897
3898            let next_out_of_line = decoder.next_out_of_line();
3899            let handles_before = decoder.remaining_handles();
3900            if let Some((inlined, num_bytes, num_handles)) =
3901                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3902            {
3903                let member_inline_size = <fidl::encoding::UnboundedVector<
3904                    fidl_fuchsia_component_decl::Offer,
3905                > as fidl::encoding::TypeMarker>::inline_size(
3906                    decoder.context
3907                );
3908                if inlined != (member_inline_size <= 4) {
3909                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3910                }
3911                let inner_offset;
3912                let mut inner_depth = depth.clone();
3913                if inlined {
3914                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3915                    inner_offset = next_offset;
3916                } else {
3917                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3918                    inner_depth.increment()?;
3919                }
3920                let val_ref = self.offer_list.get_or_insert_with(|| {
3921                    fidl::new_empty!(
3922                        fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
3923                        D
3924                    )
3925                });
3926                fidl::decode!(
3927                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
3928                    D,
3929                    val_ref,
3930                    decoder,
3931                    inner_offset,
3932                    inner_depth
3933                )?;
3934                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3935                {
3936                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3937                }
3938                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3939                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3940                }
3941            }
3942
3943            next_offset += envelope_size;
3944            _next_ordinal_to_read += 1;
3945            if next_offset >= end_offset {
3946                return Ok(());
3947            }
3948
3949            // Decode unknown envelopes for gaps in ordinals.
3950            while _next_ordinal_to_read < 10 {
3951                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3952                _next_ordinal_to_read += 1;
3953                next_offset += envelope_size;
3954            }
3955
3956            let next_out_of_line = decoder.next_out_of_line();
3957            let handles_before = decoder.remaining_handles();
3958            if let Some((inlined, num_bytes, num_handles)) =
3959                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3960            {
3961                let member_inline_size =
3962                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3963                if inlined != (member_inline_size <= 4) {
3964                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3965                }
3966                let inner_offset;
3967                let mut inner_depth = depth.clone();
3968                if inlined {
3969                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3970                    inner_offset = next_offset;
3971                } else {
3972                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3973                    inner_depth.increment()?;
3974                }
3975                let val_ref = self.quarantined.get_or_insert_with(|| fidl::new_empty!(bool, D));
3976                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3977                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3978                {
3979                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3980                }
3981                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3982                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3983                }
3984            }
3985
3986            next_offset += envelope_size;
3987            _next_ordinal_to_read += 1;
3988            if next_offset >= end_offset {
3989                return Ok(());
3990            }
3991
3992            // Decode unknown envelopes for gaps in ordinals.
3993            while _next_ordinal_to_read < 11 {
3994                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3995                _next_ordinal_to_read += 1;
3996                next_offset += envelope_size;
3997            }
3998
3999            let next_out_of_line = decoder.next_out_of_line();
4000            let handles_before = decoder.remaining_handles();
4001            if let Some((inlined, num_bytes, num_handles)) =
4002                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4003            {
4004                let member_inline_size = <fidl::encoding::Vector<
4005                    fidl_fuchsia_driver_framework::BusInfo,
4006                    20,
4007                > as fidl::encoding::TypeMarker>::inline_size(
4008                    decoder.context
4009                );
4010                if inlined != (member_inline_size <= 4) {
4011                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4012                }
4013                let inner_offset;
4014                let mut inner_depth = depth.clone();
4015                if inlined {
4016                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4017                    inner_offset = next_offset;
4018                } else {
4019                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4020                    inner_depth.increment()?;
4021                }
4022                let val_ref =
4023                self.bus_topology.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_driver_framework::BusInfo, 20>, D));
4024                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_driver_framework::BusInfo, 20>, D, val_ref, decoder, inner_offset, inner_depth)?;
4025                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4026                {
4027                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4028                }
4029                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4030                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4031                }
4032            }
4033
4034            next_offset += envelope_size;
4035
4036            // Decode the remaining unknown envelopes.
4037            while next_offset < end_offset {
4038                _next_ordinal_to_read += 1;
4039                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4040                next_offset += envelope_size;
4041            }
4042
4043            Ok(())
4044        }
4045    }
4046
4047    impl TestNodeAddArgs {
4048        #[inline(always)]
4049        fn max_ordinal_present(&self) -> u64 {
4050            if let Some(_) = self.properties {
4051                return 2;
4052            }
4053            if let Some(_) = self.name {
4054                return 1;
4055            }
4056            0
4057        }
4058    }
4059
4060    impl fidl::encoding::ValueTypeMarker for TestNodeAddArgs {
4061        type Borrowed<'a> = &'a Self;
4062        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4063            value
4064        }
4065    }
4066
4067    unsafe impl fidl::encoding::TypeMarker for TestNodeAddArgs {
4068        type Owned = Self;
4069
4070        #[inline(always)]
4071        fn inline_align(_context: fidl::encoding::Context) -> usize {
4072            8
4073        }
4074
4075        #[inline(always)]
4076        fn inline_size(_context: fidl::encoding::Context) -> usize {
4077            16
4078        }
4079    }
4080
4081    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TestNodeAddArgs, D>
4082        for &TestNodeAddArgs
4083    {
4084        unsafe fn encode(
4085            self,
4086            encoder: &mut fidl::encoding::Encoder<'_, D>,
4087            offset: usize,
4088            mut depth: fidl::encoding::Depth,
4089        ) -> fidl::Result<()> {
4090            encoder.debug_check_bounds::<TestNodeAddArgs>(offset);
4091            // Vector header
4092            let max_ordinal: u64 = self.max_ordinal_present();
4093            encoder.write_num(max_ordinal, offset);
4094            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4095            // Calling encoder.out_of_line_offset(0) is not allowed.
4096            if max_ordinal == 0 {
4097                return Ok(());
4098            }
4099            depth.increment()?;
4100            let envelope_size = 8;
4101            let bytes_len = max_ordinal as usize * envelope_size;
4102            #[allow(unused_variables)]
4103            let offset = encoder.out_of_line_offset(bytes_len);
4104            let mut _prev_end_offset: usize = 0;
4105            if 1 > max_ordinal {
4106                return Ok(());
4107            }
4108
4109            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4110            // are envelope_size bytes.
4111            let cur_offset: usize = (1 - 1) * envelope_size;
4112
4113            // Zero reserved fields.
4114            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4115
4116            // Safety:
4117            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4118            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4119            //   envelope_size bytes, there is always sufficient room.
4120            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
4121            self.name.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
4122            encoder, offset + cur_offset, depth
4123        )?;
4124
4125            _prev_end_offset = cur_offset + envelope_size;
4126            if 2 > max_ordinal {
4127                return Ok(());
4128            }
4129
4130            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4131            // are envelope_size bytes.
4132            let cur_offset: usize = (2 - 1) * envelope_size;
4133
4134            // Zero reserved fields.
4135            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4136
4137            // Safety:
4138            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4139            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4140            //   envelope_size bytes, there is always sufficient room.
4141            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64>, D>(
4142            self.properties.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64> as fidl::encoding::ValueTypeMarker>::borrow),
4143            encoder, offset + cur_offset, depth
4144        )?;
4145
4146            _prev_end_offset = cur_offset + envelope_size;
4147
4148            Ok(())
4149        }
4150    }
4151
4152    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TestNodeAddArgs {
4153        #[inline(always)]
4154        fn new_empty() -> Self {
4155            Self::default()
4156        }
4157
4158        unsafe fn decode(
4159            &mut self,
4160            decoder: &mut fidl::encoding::Decoder<'_, D>,
4161            offset: usize,
4162            mut depth: fidl::encoding::Depth,
4163        ) -> fidl::Result<()> {
4164            decoder.debug_check_bounds::<Self>(offset);
4165            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4166                None => return Err(fidl::Error::NotNullable),
4167                Some(len) => len,
4168            };
4169            // Calling decoder.out_of_line_offset(0) is not allowed.
4170            if len == 0 {
4171                return Ok(());
4172            };
4173            depth.increment()?;
4174            let envelope_size = 8;
4175            let bytes_len = len * envelope_size;
4176            let offset = decoder.out_of_line_offset(bytes_len)?;
4177            // Decode the envelope for each type.
4178            let mut _next_ordinal_to_read = 0;
4179            let mut next_offset = offset;
4180            let end_offset = offset + bytes_len;
4181            _next_ordinal_to_read += 1;
4182            if next_offset >= end_offset {
4183                return Ok(());
4184            }
4185
4186            // Decode unknown envelopes for gaps in ordinals.
4187            while _next_ordinal_to_read < 1 {
4188                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4189                _next_ordinal_to_read += 1;
4190                next_offset += envelope_size;
4191            }
4192
4193            let next_out_of_line = decoder.next_out_of_line();
4194            let handles_before = decoder.remaining_handles();
4195            if let Some((inlined, num_bytes, num_handles)) =
4196                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4197            {
4198                let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4199                if inlined != (member_inline_size <= 4) {
4200                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4201                }
4202                let inner_offset;
4203                let mut inner_depth = depth.clone();
4204                if inlined {
4205                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4206                    inner_offset = next_offset;
4207                } else {
4208                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4209                    inner_depth.increment()?;
4210                }
4211                let val_ref = self.name.get_or_insert_with(|| {
4212                    fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
4213                });
4214                fidl::decode!(
4215                    fidl::encoding::BoundedString<1024>,
4216                    D,
4217                    val_ref,
4218                    decoder,
4219                    inner_offset,
4220                    inner_depth
4221                )?;
4222                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4223                {
4224                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4225                }
4226                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4227                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4228                }
4229            }
4230
4231            next_offset += envelope_size;
4232            _next_ordinal_to_read += 1;
4233            if next_offset >= end_offset {
4234                return Ok(());
4235            }
4236
4237            // Decode unknown envelopes for gaps in ordinals.
4238            while _next_ordinal_to_read < 2 {
4239                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4240                _next_ordinal_to_read += 1;
4241                next_offset += envelope_size;
4242            }
4243
4244            let next_out_of_line = decoder.next_out_of_line();
4245            let handles_before = decoder.remaining_handles();
4246            if let Some((inlined, num_bytes, num_handles)) =
4247                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4248            {
4249                let member_inline_size = <fidl::encoding::Vector<
4250                    fidl_fuchsia_driver_framework::NodeProperty,
4251                    64,
4252                > as fidl::encoding::TypeMarker>::inline_size(
4253                    decoder.context
4254                );
4255                if inlined != (member_inline_size <= 4) {
4256                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4257                }
4258                let inner_offset;
4259                let mut inner_depth = depth.clone();
4260                if inlined {
4261                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4262                    inner_offset = next_offset;
4263                } else {
4264                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4265                    inner_depth.increment()?;
4266                }
4267                let val_ref =
4268                self.properties.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64>, D));
4269                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
4270                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4271                {
4272                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4273                }
4274                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4275                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4276                }
4277            }
4278
4279            next_offset += envelope_size;
4280
4281            // Decode the remaining unknown envelopes.
4282            while next_offset < end_offset {
4283                _next_ordinal_to_read += 1;
4284                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4285                next_offset += envelope_size;
4286            }
4287
4288            Ok(())
4289        }
4290    }
4291
4292    impl ThreadInfo {
4293        #[inline(always)]
4294        fn max_ordinal_present(&self) -> u64 {
4295            if let Some(_) = self.scheduler_role {
4296                return 3;
4297            }
4298            if let Some(_) = self.name {
4299                return 2;
4300            }
4301            if let Some(_) = self.koid {
4302                return 1;
4303            }
4304            0
4305        }
4306    }
4307
4308    impl fidl::encoding::ValueTypeMarker for ThreadInfo {
4309        type Borrowed<'a> = &'a Self;
4310        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4311            value
4312        }
4313    }
4314
4315    unsafe impl fidl::encoding::TypeMarker for ThreadInfo {
4316        type Owned = Self;
4317
4318        #[inline(always)]
4319        fn inline_align(_context: fidl::encoding::Context) -> usize {
4320            8
4321        }
4322
4323        #[inline(always)]
4324        fn inline_size(_context: fidl::encoding::Context) -> usize {
4325            16
4326        }
4327    }
4328
4329    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ThreadInfo, D>
4330        for &ThreadInfo
4331    {
4332        unsafe fn encode(
4333            self,
4334            encoder: &mut fidl::encoding::Encoder<'_, D>,
4335            offset: usize,
4336            mut depth: fidl::encoding::Depth,
4337        ) -> fidl::Result<()> {
4338            encoder.debug_check_bounds::<ThreadInfo>(offset);
4339            // Vector header
4340            let max_ordinal: u64 = self.max_ordinal_present();
4341            encoder.write_num(max_ordinal, offset);
4342            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4343            // Calling encoder.out_of_line_offset(0) is not allowed.
4344            if max_ordinal == 0 {
4345                return Ok(());
4346            }
4347            depth.increment()?;
4348            let envelope_size = 8;
4349            let bytes_len = max_ordinal as usize * envelope_size;
4350            #[allow(unused_variables)]
4351            let offset = encoder.out_of_line_offset(bytes_len);
4352            let mut _prev_end_offset: usize = 0;
4353            if 1 > max_ordinal {
4354                return Ok(());
4355            }
4356
4357            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4358            // are envelope_size bytes.
4359            let cur_offset: usize = (1 - 1) * envelope_size;
4360
4361            // Zero reserved fields.
4362            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4363
4364            // Safety:
4365            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4366            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4367            //   envelope_size bytes, there is always sufficient room.
4368            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4369                self.koid.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4370                encoder,
4371                offset + cur_offset,
4372                depth,
4373            )?;
4374
4375            _prev_end_offset = cur_offset + envelope_size;
4376            if 2 > max_ordinal {
4377                return Ok(());
4378            }
4379
4380            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4381            // are envelope_size bytes.
4382            let cur_offset: usize = (2 - 1) * envelope_size;
4383
4384            // Zero reserved fields.
4385            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4386
4387            // Safety:
4388            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4389            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4390            //   envelope_size bytes, there is always sufficient room.
4391            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
4392                self.name.as_ref().map(
4393                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
4394                ),
4395                encoder,
4396                offset + cur_offset,
4397                depth,
4398            )?;
4399
4400            _prev_end_offset = cur_offset + envelope_size;
4401            if 3 > max_ordinal {
4402                return Ok(());
4403            }
4404
4405            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4406            // are envelope_size bytes.
4407            let cur_offset: usize = (3 - 1) * envelope_size;
4408
4409            // Zero reserved fields.
4410            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4411
4412            // Safety:
4413            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4414            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4415            //   envelope_size bytes, there is always sufficient room.
4416            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
4417                self.scheduler_role.as_ref().map(
4418                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
4419                ),
4420                encoder,
4421                offset + cur_offset,
4422                depth,
4423            )?;
4424
4425            _prev_end_offset = cur_offset + envelope_size;
4426
4427            Ok(())
4428        }
4429    }
4430
4431    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThreadInfo {
4432        #[inline(always)]
4433        fn new_empty() -> Self {
4434            Self::default()
4435        }
4436
4437        unsafe fn decode(
4438            &mut self,
4439            decoder: &mut fidl::encoding::Decoder<'_, D>,
4440            offset: usize,
4441            mut depth: fidl::encoding::Depth,
4442        ) -> fidl::Result<()> {
4443            decoder.debug_check_bounds::<Self>(offset);
4444            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4445                None => return Err(fidl::Error::NotNullable),
4446                Some(len) => len,
4447            };
4448            // Calling decoder.out_of_line_offset(0) is not allowed.
4449            if len == 0 {
4450                return Ok(());
4451            };
4452            depth.increment()?;
4453            let envelope_size = 8;
4454            let bytes_len = len * envelope_size;
4455            let offset = decoder.out_of_line_offset(bytes_len)?;
4456            // Decode the envelope for each type.
4457            let mut _next_ordinal_to_read = 0;
4458            let mut next_offset = offset;
4459            let end_offset = offset + bytes_len;
4460            _next_ordinal_to_read += 1;
4461            if next_offset >= end_offset {
4462                return Ok(());
4463            }
4464
4465            // Decode unknown envelopes for gaps in ordinals.
4466            while _next_ordinal_to_read < 1 {
4467                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4468                _next_ordinal_to_read += 1;
4469                next_offset += envelope_size;
4470            }
4471
4472            let next_out_of_line = decoder.next_out_of_line();
4473            let handles_before = decoder.remaining_handles();
4474            if let Some((inlined, num_bytes, num_handles)) =
4475                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4476            {
4477                let member_inline_size =
4478                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4479                if inlined != (member_inline_size <= 4) {
4480                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4481                }
4482                let inner_offset;
4483                let mut inner_depth = depth.clone();
4484                if inlined {
4485                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4486                    inner_offset = next_offset;
4487                } else {
4488                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4489                    inner_depth.increment()?;
4490                }
4491                let val_ref = self.koid.get_or_insert_with(|| fidl::new_empty!(u64, D));
4492                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4493                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4494                {
4495                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4496                }
4497                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4498                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4499                }
4500            }
4501
4502            next_offset += envelope_size;
4503            _next_ordinal_to_read += 1;
4504            if next_offset >= end_offset {
4505                return Ok(());
4506            }
4507
4508            // Decode unknown envelopes for gaps in ordinals.
4509            while _next_ordinal_to_read < 2 {
4510                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4511                _next_ordinal_to_read += 1;
4512                next_offset += envelope_size;
4513            }
4514
4515            let next_out_of_line = decoder.next_out_of_line();
4516            let handles_before = decoder.remaining_handles();
4517            if let Some((inlined, num_bytes, num_handles)) =
4518                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4519            {
4520                let member_inline_size =
4521                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4522                        decoder.context,
4523                    );
4524                if inlined != (member_inline_size <= 4) {
4525                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4526                }
4527                let inner_offset;
4528                let mut inner_depth = depth.clone();
4529                if inlined {
4530                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4531                    inner_offset = next_offset;
4532                } else {
4533                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4534                    inner_depth.increment()?;
4535                }
4536                let val_ref = self
4537                    .name
4538                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
4539                fidl::decode!(
4540                    fidl::encoding::UnboundedString,
4541                    D,
4542                    val_ref,
4543                    decoder,
4544                    inner_offset,
4545                    inner_depth
4546                )?;
4547                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4548                {
4549                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4550                }
4551                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4552                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4553                }
4554            }
4555
4556            next_offset += envelope_size;
4557            _next_ordinal_to_read += 1;
4558            if next_offset >= end_offset {
4559                return Ok(());
4560            }
4561
4562            // Decode unknown envelopes for gaps in ordinals.
4563            while _next_ordinal_to_read < 3 {
4564                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4565                _next_ordinal_to_read += 1;
4566                next_offset += envelope_size;
4567            }
4568
4569            let next_out_of_line = decoder.next_out_of_line();
4570            let handles_before = decoder.remaining_handles();
4571            if let Some((inlined, num_bytes, num_handles)) =
4572                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4573            {
4574                let member_inline_size =
4575                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4576                        decoder.context,
4577                    );
4578                if inlined != (member_inline_size <= 4) {
4579                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4580                }
4581                let inner_offset;
4582                let mut inner_depth = depth.clone();
4583                if inlined {
4584                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4585                    inner_offset = next_offset;
4586                } else {
4587                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4588                    inner_depth.increment()?;
4589                }
4590                let val_ref = self
4591                    .scheduler_role
4592                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
4593                fidl::decode!(
4594                    fidl::encoding::UnboundedString,
4595                    D,
4596                    val_ref,
4597                    decoder,
4598                    inner_offset,
4599                    inner_depth
4600                )?;
4601                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4602                {
4603                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4604                }
4605                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4606                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4607                }
4608            }
4609
4610            next_offset += envelope_size;
4611
4612            // Decode the remaining unknown envelopes.
4613            while next_offset < end_offset {
4614                _next_ordinal_to_read += 1;
4615                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4616                next_offset += envelope_size;
4617            }
4618
4619            Ok(())
4620        }
4621    }
4622
4623    impl fidl::encoding::ValueTypeMarker for CompositeInfo {
4624        type Borrowed<'a> = &'a Self;
4625        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4626            value
4627        }
4628    }
4629
4630    unsafe impl fidl::encoding::TypeMarker for CompositeInfo {
4631        type Owned = Self;
4632
4633        #[inline(always)]
4634        fn inline_align(_context: fidl::encoding::Context) -> usize {
4635            8
4636        }
4637
4638        #[inline(always)]
4639        fn inline_size(_context: fidl::encoding::Context) -> usize {
4640            16
4641        }
4642    }
4643
4644    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CompositeInfo, D>
4645        for &CompositeInfo
4646    {
4647        #[inline]
4648        unsafe fn encode(
4649            self,
4650            encoder: &mut fidl::encoding::Encoder<'_, D>,
4651            offset: usize,
4652            _depth: fidl::encoding::Depth,
4653        ) -> fidl::Result<()> {
4654            encoder.debug_check_bounds::<CompositeInfo>(offset);
4655            encoder.write_num::<u64>(self.ordinal(), offset);
4656            match self {
4657            CompositeInfo::Composite(ref val) => {
4658                fidl::encoding::encode_in_envelope::<fidl_fuchsia_driver_framework::CompositeInfo, D>(
4659                    <fidl_fuchsia_driver_framework::CompositeInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
4660                    encoder, offset + 8, _depth
4661                )
4662            }
4663        }
4664        }
4665    }
4666
4667    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CompositeInfo {
4668        #[inline(always)]
4669        fn new_empty() -> Self {
4670            Self::Composite(fidl::new_empty!(fidl_fuchsia_driver_framework::CompositeInfo, D))
4671        }
4672
4673        #[inline]
4674        unsafe fn decode(
4675            &mut self,
4676            decoder: &mut fidl::encoding::Decoder<'_, D>,
4677            offset: usize,
4678            mut depth: fidl::encoding::Depth,
4679        ) -> fidl::Result<()> {
4680            decoder.debug_check_bounds::<Self>(offset);
4681            #[allow(unused_variables)]
4682            let next_out_of_line = decoder.next_out_of_line();
4683            let handles_before = decoder.remaining_handles();
4684            let (ordinal, inlined, num_bytes, num_handles) =
4685                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
4686
4687            let member_inline_size = match ordinal {
4688            2 => <fidl_fuchsia_driver_framework::CompositeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4689            _ => return Err(fidl::Error::UnknownUnionTag),
4690        };
4691
4692            if inlined != (member_inline_size <= 4) {
4693                return Err(fidl::Error::InvalidInlineBitInEnvelope);
4694            }
4695            let _inner_offset;
4696            if inlined {
4697                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
4698                _inner_offset = offset + 8;
4699            } else {
4700                depth.increment()?;
4701                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4702            }
4703            match ordinal {
4704                2 => {
4705                    #[allow(irrefutable_let_patterns)]
4706                    if let CompositeInfo::Composite(_) = self {
4707                        // Do nothing, read the value into the object
4708                    } else {
4709                        // Initialize `self` to the right variant
4710                        *self = CompositeInfo::Composite(fidl::new_empty!(
4711                            fidl_fuchsia_driver_framework::CompositeInfo,
4712                            D
4713                        ));
4714                    }
4715                    #[allow(irrefutable_let_patterns)]
4716                    if let CompositeInfo::Composite(ref mut val) = self {
4717                        fidl::decode!(
4718                            fidl_fuchsia_driver_framework::CompositeInfo,
4719                            D,
4720                            val,
4721                            decoder,
4722                            _inner_offset,
4723                            depth
4724                        )?;
4725                    } else {
4726                        unreachable!()
4727                    }
4728                }
4729                ordinal => panic!("unexpected ordinal {:?}", ordinal),
4730            }
4731            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
4732                return Err(fidl::Error::InvalidNumBytesInEnvelope);
4733            }
4734            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4735                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4736            }
4737            Ok(())
4738        }
4739    }
4740}