fidl_fuchsia_component_common/
fidl_fuchsia_component_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 type ChildName = String;
12
13pub type Name = String;
14
15pub type UrlScheme = String;
16
17/// The maximum string length of a capability ID.
18/// This value is currently set arbitrarily.
19pub const MAX_CAPABILITY_ID_LENGTH: u64 = 50;
20
21/// The maximum number of children that the a call `ChildIterator.Next`
22/// can return.
23/// Note, this is not a limit on the number of children that can be added
24/// to a component. This is merely a limit for a single invocation of the
25/// `Next` method.
26pub const MAX_CHILD_COUNT: u32 = 128;
27
28pub const MAX_CHILD_NAME_LENGTH: u32 = 1024;
29
30/// The maximum number of dynamic offers that can target a created component.
31pub const MAX_DYNAMIC_OFFER_COUNT: u32 = 128;
32
33/// The maximum string length of an error description.
34pub const MAX_ERROR_DESCRIPTION_LENGTH: u64 = 100;
35
36/// The maximum number of handles that can be passed to a created component.
37pub const MAX_HANDLE_COUNT: u32 = 128;
38
39pub const MAX_MONIKER_LENGTH: u32 = 4096;
40
41pub const MAX_NAMESPACE_COUNT: u32 = 32;
42
43pub const MAX_NAME_LENGTH: u64 = fidl_fuchsia_io::MAX_NAME_LENGTH as u64;
44
45/// The maximum number of events that a receiver can listen to.
46pub const MAX_NUM_EVENTS_RECEIVED: u64 = 100;
47
48pub const MAX_PATH_LENGTH: u64 = fidl_fuchsia_io::MAX_PATH_LENGTH as u64;
49
50/// The maximum number of requests per event subscription.
51pub const MAX_SUBSCRIPTION_REQUESTS: u32 = 2;
52
53pub const MAX_URL_SCHEME_LENGTH: u64 = MAX_NAME_LENGTH as u64;
54
55/// Standard error codes for component framework protocols.
56#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
57pub enum Error {
58    /// Component manager encountered an otherwise unspecified error while
59    /// performing the operation.
60    Internal,
61    /// At least one argument had an invalid format.
62    InvalidArguments,
63    /// The feature is not yet supported.
64    Unsupported,
65    /// The caller did not have permission to perform the specified operation,
66    /// or one of the handles provided to the call had insufficient rights.
67    AccessDenied,
68    /// The component instance was not found.
69    InstanceNotFound,
70    /// The component instance already exists.
71    InstanceAlreadyExists,
72    /// The component instance could not be started.
73    InstanceCannotStart,
74    /// Failed to resolve the component's declaration.
75    InstanceCannotResolve,
76    /// The component collection was not found.
77    CollectionNotFound,
78    /// There were insufficient resources to perform the operation.
79    ResourceUnavailable,
80    /// The component instance died unexpectedly.
81    InstanceDied,
82    /// The requested resource does not exist.
83    ResourceNotFound,
84    /// Failed to unresolve the component.
85    InstanceCannotUnresolve,
86    /// The component instance has already been started.
87    InstanceAlreadyStarted,
88    #[doc(hidden)]
89    __SourceBreaking { unknown_ordinal: u32 },
90}
91
92/// Pattern that matches an unknown `Error` member.
93#[macro_export]
94macro_rules! ErrorUnknown {
95    () => {
96        _
97    };
98}
99
100impl Error {
101    #[inline]
102    pub fn from_primitive(prim: u32) -> Option<Self> {
103        match prim {
104            1 => Some(Self::Internal),
105            2 => Some(Self::InvalidArguments),
106            3 => Some(Self::Unsupported),
107            4 => Some(Self::AccessDenied),
108            5 => Some(Self::InstanceNotFound),
109            6 => Some(Self::InstanceAlreadyExists),
110            7 => Some(Self::InstanceCannotStart),
111            8 => Some(Self::InstanceCannotResolve),
112            9 => Some(Self::CollectionNotFound),
113            10 => Some(Self::ResourceUnavailable),
114            11 => Some(Self::InstanceDied),
115            12 => Some(Self::ResourceNotFound),
116            13 => Some(Self::InstanceCannotUnresolve),
117            14 => Some(Self::InstanceAlreadyStarted),
118            _ => None,
119        }
120    }
121
122    #[inline]
123    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
124        match prim {
125            1 => Self::Internal,
126            2 => Self::InvalidArguments,
127            3 => Self::Unsupported,
128            4 => Self::AccessDenied,
129            5 => Self::InstanceNotFound,
130            6 => Self::InstanceAlreadyExists,
131            7 => Self::InstanceCannotStart,
132            8 => Self::InstanceCannotResolve,
133            9 => Self::CollectionNotFound,
134            10 => Self::ResourceUnavailable,
135            11 => Self::InstanceDied,
136            12 => Self::ResourceNotFound,
137            13 => Self::InstanceCannotUnresolve,
138            14 => Self::InstanceAlreadyStarted,
139            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
140        }
141    }
142
143    #[inline]
144    pub fn unknown() -> Self {
145        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
146    }
147
148    #[inline]
149    pub const fn into_primitive(self) -> u32 {
150        match self {
151            Self::Internal => 1,
152            Self::InvalidArguments => 2,
153            Self::Unsupported => 3,
154            Self::AccessDenied => 4,
155            Self::InstanceNotFound => 5,
156            Self::InstanceAlreadyExists => 6,
157            Self::InstanceCannotStart => 7,
158            Self::InstanceCannotResolve => 8,
159            Self::CollectionNotFound => 9,
160            Self::ResourceUnavailable => 10,
161            Self::InstanceDied => 11,
162            Self::ResourceNotFound => 12,
163            Self::InstanceCannotUnresolve => 13,
164            Self::InstanceAlreadyStarted => 14,
165            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
166        }
167    }
168
169    #[inline]
170    pub fn is_unknown(&self) -> bool {
171        match self {
172            Self::__SourceBreaking { unknown_ordinal: _ } => true,
173            _ => false,
174        }
175    }
176}
177
178/// These EventTypes are used for the EventStream protocol.
179/// They are FIDL versions of the EventType enum in hooks.rs and have
180/// the same meaning.
181#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
182#[repr(u32)]
183pub enum EventType {
184    /// A capability provided by this component has been requested. The event
185    /// payload carries the request channel.
186    CapabilityRequested = 1,
187    /// A directory exposed to the framework by a component is available.
188    DirectoryReady = 2,
189    /// A component instance was discovered. This is the first stage in the lifecycle
190    /// of components. Dispatched for dynamic children when they're created, for static
191    /// children when their parent is resolved, and for the root when the component manager
192    /// starts.
193    Discovered = 3,
194    /// The instance is destroyed and no longer exists.
195    Destroyed = 4,
196    /// An instance's declaration was resolved successfully for the first time.
197    Resolved = 5,
198    /// This instance has started, according to component manager. However, if this is an
199    /// executable component, the runner has further work to do to launch the component.
200    Started = 6,
201    /// An instance was stopped successfully.
202    Stopped = 7,
203    /// Similar to STARTED, except the payload will carry an eventpair that the subscriber
204    /// could use to defer the launch of the component. This allows, e.g., a debugger to
205    /// perform some setup before any processes are created.
206    DebugStarted = 8,
207    /// An instance was unresolved successfully.
208    Unresolved = 9,
209}
210
211impl EventType {
212    #[inline]
213    pub fn from_primitive(prim: u32) -> Option<Self> {
214        match prim {
215            1 => Some(Self::CapabilityRequested),
216            2 => Some(Self::DirectoryReady),
217            3 => Some(Self::Discovered),
218            4 => Some(Self::Destroyed),
219            5 => Some(Self::Resolved),
220            6 => Some(Self::Started),
221            7 => Some(Self::Stopped),
222            8 => Some(Self::DebugStarted),
223            9 => Some(Self::Unresolved),
224            _ => None,
225        }
226    }
227
228    #[inline]
229    pub const fn into_primitive(self) -> u32 {
230        self as u32
231    }
232}
233
234/// Error returned from methods in [`Namespace`].
235#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
236pub enum NamespaceError {
237    /// The parent of a parent shares a prefix with another namespace entry
238    Shadow,
239    /// Two entries have the same namespace path.
240    Duplicate,
241    /// Failed to convert a namespace dictionary to a directory.
242    Conversion,
243    /// A namespace entry was invalid.
244    BadEntry,
245    /// There was an error reading from one of the dictionaries.
246    DictionaryRead,
247    #[doc(hidden)]
248    __SourceBreaking { unknown_ordinal: u32 },
249}
250
251/// Pattern that matches an unknown `NamespaceError` member.
252#[macro_export]
253macro_rules! NamespaceErrorUnknown {
254    () => {
255        _
256    };
257}
258
259impl NamespaceError {
260    #[inline]
261    pub fn from_primitive(prim: u32) -> Option<Self> {
262        match prim {
263            1 => Some(Self::Shadow),
264            2 => Some(Self::Duplicate),
265            3 => Some(Self::Conversion),
266            4 => Some(Self::BadEntry),
267            5 => Some(Self::DictionaryRead),
268            _ => None,
269        }
270    }
271
272    #[inline]
273    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
274        match prim {
275            1 => Self::Shadow,
276            2 => Self::Duplicate,
277            3 => Self::Conversion,
278            4 => Self::BadEntry,
279            5 => Self::DictionaryRead,
280            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
281        }
282    }
283
284    #[inline]
285    pub fn unknown() -> Self {
286        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
287    }
288
289    #[inline]
290    pub const fn into_primitive(self) -> u32 {
291        match self {
292            Self::Shadow => 1,
293            Self::Duplicate => 2,
294            Self::Conversion => 3,
295            Self::BadEntry => 4,
296            Self::DictionaryRead => 5,
297            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
298        }
299    }
300
301    #[inline]
302    pub fn is_unknown(&self) -> bool {
303        match self {
304            Self::__SourceBreaking { unknown_ordinal: _ } => true,
305            _ => false,
306        }
307    }
308}
309
310#[derive(Clone, Debug, PartialEq)]
311pub struct ChildIteratorNextResponse {
312    pub children: Vec<fidl_fuchsia_component_decl::ChildRef>,
313}
314
315impl fidl::Persistable for ChildIteratorNextResponse {}
316
317#[derive(Clone, Debug, PartialEq)]
318pub struct ExecutionControllerOnStopRequest {
319    pub stopped_payload: StoppedPayload,
320}
321
322impl fidl::Persistable for ExecutionControllerOnStopRequest {}
323
324#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
325pub struct IntrospectorGetMonikerResponse {
326    pub moniker: String,
327}
328
329impl fidl::Persistable for IntrospectorGetMonikerResponse {}
330
331#[derive(Clone, Debug, PartialEq)]
332pub struct RealmDestroyChildRequest {
333    pub child: fidl_fuchsia_component_decl::ChildRef,
334}
335
336impl fidl::Persistable for RealmDestroyChildRequest {}
337
338/// Payload for Destroyed events.
339#[derive(Clone, Debug, Default, PartialEq)]
340pub struct DestroyedPayload {
341    #[doc(hidden)]
342    pub __source_breaking: fidl::marker::SourceBreaking,
343}
344
345impl fidl::Persistable for DestroyedPayload {}
346
347/// Payload for Discovered events.
348#[derive(Clone, Debug, Default, PartialEq)]
349pub struct DiscoveredPayload {
350    #[doc(hidden)]
351    pub __source_breaking: fidl::marker::SourceBreaking,
352}
353
354impl fidl::Persistable for DiscoveredPayload {}
355
356/// A head providing metadata about a target component instance.
357#[derive(Clone, Debug, Default, PartialEq)]
358pub struct EventHeader {
359    /// Event type corresponding to the event
360    pub event_type: Option<EventType>,
361    /// Relative moniker identifying the component instance. Relative to the scope of the event.
362    pub moniker: Option<String>,
363    /// URL used to resolve the component.
364    pub component_url: Option<String>,
365    /// Boot time when the event occurred.
366    pub timestamp: Option<fidl::BootInstant>,
367    #[doc(hidden)]
368    pub __source_breaking: fidl::marker::SourceBreaking,
369}
370
371impl fidl::Persistable for EventHeader {}
372
373/// Payload for Purged events.
374#[derive(Clone, Debug, Default, PartialEq)]
375pub struct PurgedPayload {
376    #[doc(hidden)]
377    pub __source_breaking: fidl::marker::SourceBreaking,
378}
379
380impl fidl::Persistable for PurgedPayload {}
381
382/// Payload for Resolved events.
383#[derive(Clone, Debug, Default, PartialEq)]
384pub struct ResolvedPayload {
385    #[doc(hidden)]
386    pub __source_breaking: fidl::marker::SourceBreaking,
387}
388
389impl fidl::Persistable for ResolvedPayload {}
390
391/// Payload for Started events.
392#[derive(Clone, Debug, Default, PartialEq)]
393pub struct StartedPayload {
394    #[doc(hidden)]
395    pub __source_breaking: fidl::marker::SourceBreaking,
396}
397
398impl fidl::Persistable for StartedPayload {}
399
400/// Payload for Stopped events.
401#[derive(Clone, Debug, Default, PartialEq)]
402pub struct StoppedPayload {
403    /// The epitaph set on the fuchsia.component.runner/ComponentController
404    /// protocol channel. This is the exit status of the component. The
405    /// possible status values and their meaning are described in the definition
406    /// of the ComponentController protocol.
407    pub status: Option<i32>,
408    /// The exit code of the component instance. Note that not all components
409    /// will stop with an exit code.
410    ///
411    /// Many program runtimes have the concept of an exit code. Runners may map
412    /// that value to this field when applicable. For example, the ELF runner
413    /// will publish the Zircon process return code here.
414    pub exit_code: Option<i64>,
415    #[doc(hidden)]
416    pub __source_breaking: fidl::marker::SourceBreaking,
417}
418
419impl fidl::Persistable for StoppedPayload {}
420
421/// Payload for Unresolved events.
422#[derive(Clone, Debug, Default, PartialEq)]
423pub struct UnresolvedPayload {
424    #[doc(hidden)]
425    pub __source_breaking: fidl::marker::SourceBreaking,
426}
427
428impl fidl::Persistable for UnresolvedPayload {}
429
430mod internal {
431    use super::*;
432    unsafe impl fidl::encoding::TypeMarker for Error {
433        type Owned = Self;
434
435        #[inline(always)]
436        fn inline_align(_context: fidl::encoding::Context) -> usize {
437            std::mem::align_of::<u32>()
438        }
439
440        #[inline(always)]
441        fn inline_size(_context: fidl::encoding::Context) -> usize {
442            std::mem::size_of::<u32>()
443        }
444
445        #[inline(always)]
446        fn encode_is_copy() -> bool {
447            false
448        }
449
450        #[inline(always)]
451        fn decode_is_copy() -> bool {
452            false
453        }
454    }
455
456    impl fidl::encoding::ValueTypeMarker for Error {
457        type Borrowed<'a> = Self;
458        #[inline(always)]
459        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
460            *value
461        }
462    }
463
464    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Error {
465        #[inline]
466        unsafe fn encode(
467            self,
468            encoder: &mut fidl::encoding::Encoder<'_, D>,
469            offset: usize,
470            _depth: fidl::encoding::Depth,
471        ) -> fidl::Result<()> {
472            encoder.debug_check_bounds::<Self>(offset);
473            encoder.write_num(self.into_primitive(), offset);
474            Ok(())
475        }
476    }
477
478    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Error {
479        #[inline(always)]
480        fn new_empty() -> Self {
481            Self::unknown()
482        }
483
484        #[inline]
485        unsafe fn decode(
486            &mut self,
487            decoder: &mut fidl::encoding::Decoder<'_, D>,
488            offset: usize,
489            _depth: fidl::encoding::Depth,
490        ) -> fidl::Result<()> {
491            decoder.debug_check_bounds::<Self>(offset);
492            let prim = decoder.read_num::<u32>(offset);
493
494            *self = Self::from_primitive_allow_unknown(prim);
495            Ok(())
496        }
497    }
498    unsafe impl fidl::encoding::TypeMarker for EventType {
499        type Owned = Self;
500
501        #[inline(always)]
502        fn inline_align(_context: fidl::encoding::Context) -> usize {
503            std::mem::align_of::<u32>()
504        }
505
506        #[inline(always)]
507        fn inline_size(_context: fidl::encoding::Context) -> usize {
508            std::mem::size_of::<u32>()
509        }
510
511        #[inline(always)]
512        fn encode_is_copy() -> bool {
513            true
514        }
515
516        #[inline(always)]
517        fn decode_is_copy() -> bool {
518            false
519        }
520    }
521
522    impl fidl::encoding::ValueTypeMarker for EventType {
523        type Borrowed<'a> = Self;
524        #[inline(always)]
525        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
526            *value
527        }
528    }
529
530    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for EventType {
531        #[inline]
532        unsafe fn encode(
533            self,
534            encoder: &mut fidl::encoding::Encoder<'_, D>,
535            offset: usize,
536            _depth: fidl::encoding::Depth,
537        ) -> fidl::Result<()> {
538            encoder.debug_check_bounds::<Self>(offset);
539            encoder.write_num(self.into_primitive(), offset);
540            Ok(())
541        }
542    }
543
544    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EventType {
545        #[inline(always)]
546        fn new_empty() -> Self {
547            Self::CapabilityRequested
548        }
549
550        #[inline]
551        unsafe fn decode(
552            &mut self,
553            decoder: &mut fidl::encoding::Decoder<'_, D>,
554            offset: usize,
555            _depth: fidl::encoding::Depth,
556        ) -> fidl::Result<()> {
557            decoder.debug_check_bounds::<Self>(offset);
558            let prim = decoder.read_num::<u32>(offset);
559
560            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
561            Ok(())
562        }
563    }
564    unsafe impl fidl::encoding::TypeMarker for NamespaceError {
565        type Owned = Self;
566
567        #[inline(always)]
568        fn inline_align(_context: fidl::encoding::Context) -> usize {
569            std::mem::align_of::<u32>()
570        }
571
572        #[inline(always)]
573        fn inline_size(_context: fidl::encoding::Context) -> usize {
574            std::mem::size_of::<u32>()
575        }
576
577        #[inline(always)]
578        fn encode_is_copy() -> bool {
579            false
580        }
581
582        #[inline(always)]
583        fn decode_is_copy() -> bool {
584            false
585        }
586    }
587
588    impl fidl::encoding::ValueTypeMarker for NamespaceError {
589        type Borrowed<'a> = Self;
590        #[inline(always)]
591        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
592            *value
593        }
594    }
595
596    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for NamespaceError {
597        #[inline]
598        unsafe fn encode(
599            self,
600            encoder: &mut fidl::encoding::Encoder<'_, D>,
601            offset: usize,
602            _depth: fidl::encoding::Depth,
603        ) -> fidl::Result<()> {
604            encoder.debug_check_bounds::<Self>(offset);
605            encoder.write_num(self.into_primitive(), offset);
606            Ok(())
607        }
608    }
609
610    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NamespaceError {
611        #[inline(always)]
612        fn new_empty() -> Self {
613            Self::unknown()
614        }
615
616        #[inline]
617        unsafe fn decode(
618            &mut self,
619            decoder: &mut fidl::encoding::Decoder<'_, D>,
620            offset: usize,
621            _depth: fidl::encoding::Depth,
622        ) -> fidl::Result<()> {
623            decoder.debug_check_bounds::<Self>(offset);
624            let prim = decoder.read_num::<u32>(offset);
625
626            *self = Self::from_primitive_allow_unknown(prim);
627            Ok(())
628        }
629    }
630
631    impl fidl::encoding::ValueTypeMarker for ChildIteratorNextResponse {
632        type Borrowed<'a> = &'a Self;
633        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
634            value
635        }
636    }
637
638    unsafe impl fidl::encoding::TypeMarker for ChildIteratorNextResponse {
639        type Owned = Self;
640
641        #[inline(always)]
642        fn inline_align(_context: fidl::encoding::Context) -> usize {
643            8
644        }
645
646        #[inline(always)]
647        fn inline_size(_context: fidl::encoding::Context) -> usize {
648            16
649        }
650    }
651
652    unsafe impl<D: fidl::encoding::ResourceDialect>
653        fidl::encoding::Encode<ChildIteratorNextResponse, D> for &ChildIteratorNextResponse
654    {
655        #[inline]
656        unsafe fn encode(
657            self,
658            encoder: &mut fidl::encoding::Encoder<'_, D>,
659            offset: usize,
660            _depth: fidl::encoding::Depth,
661        ) -> fidl::Result<()> {
662            encoder.debug_check_bounds::<ChildIteratorNextResponse>(offset);
663            // Delegate to tuple encoding.
664            fidl::encoding::Encode::<ChildIteratorNextResponse, D>::encode(
665                (
666                    <fidl::encoding::Vector<fidl_fuchsia_component_decl::ChildRef, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.children),
667                ),
668                encoder, offset, _depth
669            )
670        }
671    }
672    unsafe impl<
673            D: fidl::encoding::ResourceDialect,
674            T0: fidl::encoding::Encode<
675                fidl::encoding::Vector<fidl_fuchsia_component_decl::ChildRef, 128>,
676                D,
677            >,
678        > fidl::encoding::Encode<ChildIteratorNextResponse, D> for (T0,)
679    {
680        #[inline]
681        unsafe fn encode(
682            self,
683            encoder: &mut fidl::encoding::Encoder<'_, D>,
684            offset: usize,
685            depth: fidl::encoding::Depth,
686        ) -> fidl::Result<()> {
687            encoder.debug_check_bounds::<ChildIteratorNextResponse>(offset);
688            // Zero out padding regions. There's no need to apply masks
689            // because the unmasked parts will be overwritten by fields.
690            // Write the fields.
691            self.0.encode(encoder, offset + 0, depth)?;
692            Ok(())
693        }
694    }
695
696    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
697        for ChildIteratorNextResponse
698    {
699        #[inline(always)]
700        fn new_empty() -> Self {
701            Self {
702                children: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_component_decl::ChildRef, 128>, D),
703            }
704        }
705
706        #[inline]
707        unsafe fn decode(
708            &mut self,
709            decoder: &mut fidl::encoding::Decoder<'_, D>,
710            offset: usize,
711            _depth: fidl::encoding::Depth,
712        ) -> fidl::Result<()> {
713            decoder.debug_check_bounds::<Self>(offset);
714            // Verify that padding bytes are zero.
715            fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_component_decl::ChildRef, 128>, D, &mut self.children, decoder, offset + 0, _depth)?;
716            Ok(())
717        }
718    }
719
720    impl fidl::encoding::ValueTypeMarker for ExecutionControllerOnStopRequest {
721        type Borrowed<'a> = &'a Self;
722        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
723            value
724        }
725    }
726
727    unsafe impl fidl::encoding::TypeMarker for ExecutionControllerOnStopRequest {
728        type Owned = Self;
729
730        #[inline(always)]
731        fn inline_align(_context: fidl::encoding::Context) -> usize {
732            8
733        }
734
735        #[inline(always)]
736        fn inline_size(_context: fidl::encoding::Context) -> usize {
737            16
738        }
739    }
740
741    unsafe impl<D: fidl::encoding::ResourceDialect>
742        fidl::encoding::Encode<ExecutionControllerOnStopRequest, D>
743        for &ExecutionControllerOnStopRequest
744    {
745        #[inline]
746        unsafe fn encode(
747            self,
748            encoder: &mut fidl::encoding::Encoder<'_, D>,
749            offset: usize,
750            _depth: fidl::encoding::Depth,
751        ) -> fidl::Result<()> {
752            encoder.debug_check_bounds::<ExecutionControllerOnStopRequest>(offset);
753            // Delegate to tuple encoding.
754            fidl::encoding::Encode::<ExecutionControllerOnStopRequest, D>::encode(
755                (<StoppedPayload as fidl::encoding::ValueTypeMarker>::borrow(
756                    &self.stopped_payload,
757                ),),
758                encoder,
759                offset,
760                _depth,
761            )
762        }
763    }
764    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StoppedPayload, D>>
765        fidl::encoding::Encode<ExecutionControllerOnStopRequest, D> for (T0,)
766    {
767        #[inline]
768        unsafe fn encode(
769            self,
770            encoder: &mut fidl::encoding::Encoder<'_, D>,
771            offset: usize,
772            depth: fidl::encoding::Depth,
773        ) -> fidl::Result<()> {
774            encoder.debug_check_bounds::<ExecutionControllerOnStopRequest>(offset);
775            // Zero out padding regions. There's no need to apply masks
776            // because the unmasked parts will be overwritten by fields.
777            // Write the fields.
778            self.0.encode(encoder, offset + 0, depth)?;
779            Ok(())
780        }
781    }
782
783    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
784        for ExecutionControllerOnStopRequest
785    {
786        #[inline(always)]
787        fn new_empty() -> Self {
788            Self { stopped_payload: fidl::new_empty!(StoppedPayload, D) }
789        }
790
791        #[inline]
792        unsafe fn decode(
793            &mut self,
794            decoder: &mut fidl::encoding::Decoder<'_, D>,
795            offset: usize,
796            _depth: fidl::encoding::Depth,
797        ) -> fidl::Result<()> {
798            decoder.debug_check_bounds::<Self>(offset);
799            // Verify that padding bytes are zero.
800            fidl::decode!(
801                StoppedPayload,
802                D,
803                &mut self.stopped_payload,
804                decoder,
805                offset + 0,
806                _depth
807            )?;
808            Ok(())
809        }
810    }
811
812    impl fidl::encoding::ValueTypeMarker for IntrospectorGetMonikerResponse {
813        type Borrowed<'a> = &'a Self;
814        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
815            value
816        }
817    }
818
819    unsafe impl fidl::encoding::TypeMarker for IntrospectorGetMonikerResponse {
820        type Owned = Self;
821
822        #[inline(always)]
823        fn inline_align(_context: fidl::encoding::Context) -> usize {
824            8
825        }
826
827        #[inline(always)]
828        fn inline_size(_context: fidl::encoding::Context) -> usize {
829            16
830        }
831    }
832
833    unsafe impl<D: fidl::encoding::ResourceDialect>
834        fidl::encoding::Encode<IntrospectorGetMonikerResponse, D>
835        for &IntrospectorGetMonikerResponse
836    {
837        #[inline]
838        unsafe fn encode(
839            self,
840            encoder: &mut fidl::encoding::Encoder<'_, D>,
841            offset: usize,
842            _depth: fidl::encoding::Depth,
843        ) -> fidl::Result<()> {
844            encoder.debug_check_bounds::<IntrospectorGetMonikerResponse>(offset);
845            // Delegate to tuple encoding.
846            fidl::encoding::Encode::<IntrospectorGetMonikerResponse, D>::encode(
847                (<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
848                    &self.moniker,
849                ),),
850                encoder,
851                offset,
852                _depth,
853            )
854        }
855    }
856    unsafe impl<
857            D: fidl::encoding::ResourceDialect,
858            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
859        > fidl::encoding::Encode<IntrospectorGetMonikerResponse, D> for (T0,)
860    {
861        #[inline]
862        unsafe fn encode(
863            self,
864            encoder: &mut fidl::encoding::Encoder<'_, D>,
865            offset: usize,
866            depth: fidl::encoding::Depth,
867        ) -> fidl::Result<()> {
868            encoder.debug_check_bounds::<IntrospectorGetMonikerResponse>(offset);
869            // Zero out padding regions. There's no need to apply masks
870            // because the unmasked parts will be overwritten by fields.
871            // Write the fields.
872            self.0.encode(encoder, offset + 0, depth)?;
873            Ok(())
874        }
875    }
876
877    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
878        for IntrospectorGetMonikerResponse
879    {
880        #[inline(always)]
881        fn new_empty() -> Self {
882            Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
883        }
884
885        #[inline]
886        unsafe fn decode(
887            &mut self,
888            decoder: &mut fidl::encoding::Decoder<'_, D>,
889            offset: usize,
890            _depth: fidl::encoding::Depth,
891        ) -> fidl::Result<()> {
892            decoder.debug_check_bounds::<Self>(offset);
893            // Verify that padding bytes are zero.
894            fidl::decode!(
895                fidl::encoding::BoundedString<4096>,
896                D,
897                &mut self.moniker,
898                decoder,
899                offset + 0,
900                _depth
901            )?;
902            Ok(())
903        }
904    }
905
906    impl fidl::encoding::ValueTypeMarker for RealmDestroyChildRequest {
907        type Borrowed<'a> = &'a Self;
908        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
909            value
910        }
911    }
912
913    unsafe impl fidl::encoding::TypeMarker for RealmDestroyChildRequest {
914        type Owned = Self;
915
916        #[inline(always)]
917        fn inline_align(_context: fidl::encoding::Context) -> usize {
918            8
919        }
920
921        #[inline(always)]
922        fn inline_size(_context: fidl::encoding::Context) -> usize {
923            32
924        }
925    }
926
927    unsafe impl<D: fidl::encoding::ResourceDialect>
928        fidl::encoding::Encode<RealmDestroyChildRequest, D> for &RealmDestroyChildRequest
929    {
930        #[inline]
931        unsafe fn encode(
932            self,
933            encoder: &mut fidl::encoding::Encoder<'_, D>,
934            offset: usize,
935            _depth: fidl::encoding::Depth,
936        ) -> fidl::Result<()> {
937            encoder.debug_check_bounds::<RealmDestroyChildRequest>(offset);
938            // Delegate to tuple encoding.
939            fidl::encoding::Encode::<RealmDestroyChildRequest, D>::encode(
940                (
941                    <fidl_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
942                ),
943                encoder, offset, _depth
944            )
945        }
946    }
947    unsafe impl<
948            D: fidl::encoding::ResourceDialect,
949            T0: fidl::encoding::Encode<fidl_fuchsia_component_decl::ChildRef, D>,
950        > fidl::encoding::Encode<RealmDestroyChildRequest, D> for (T0,)
951    {
952        #[inline]
953        unsafe fn encode(
954            self,
955            encoder: &mut fidl::encoding::Encoder<'_, D>,
956            offset: usize,
957            depth: fidl::encoding::Depth,
958        ) -> fidl::Result<()> {
959            encoder.debug_check_bounds::<RealmDestroyChildRequest>(offset);
960            // Zero out padding regions. There's no need to apply masks
961            // because the unmasked parts will be overwritten by fields.
962            // Write the fields.
963            self.0.encode(encoder, offset + 0, depth)?;
964            Ok(())
965        }
966    }
967
968    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
969        for RealmDestroyChildRequest
970    {
971        #[inline(always)]
972        fn new_empty() -> Self {
973            Self { child: fidl::new_empty!(fidl_fuchsia_component_decl::ChildRef, D) }
974        }
975
976        #[inline]
977        unsafe fn decode(
978            &mut self,
979            decoder: &mut fidl::encoding::Decoder<'_, D>,
980            offset: usize,
981            _depth: fidl::encoding::Depth,
982        ) -> fidl::Result<()> {
983            decoder.debug_check_bounds::<Self>(offset);
984            // Verify that padding bytes are zero.
985            fidl::decode!(
986                fidl_fuchsia_component_decl::ChildRef,
987                D,
988                &mut self.child,
989                decoder,
990                offset + 0,
991                _depth
992            )?;
993            Ok(())
994        }
995    }
996
997    impl DestroyedPayload {
998        #[inline(always)]
999        fn max_ordinal_present(&self) -> u64 {
1000            0
1001        }
1002    }
1003
1004    impl fidl::encoding::ValueTypeMarker for DestroyedPayload {
1005        type Borrowed<'a> = &'a Self;
1006        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1007            value
1008        }
1009    }
1010
1011    unsafe impl fidl::encoding::TypeMarker for DestroyedPayload {
1012        type Owned = Self;
1013
1014        #[inline(always)]
1015        fn inline_align(_context: fidl::encoding::Context) -> usize {
1016            8
1017        }
1018
1019        #[inline(always)]
1020        fn inline_size(_context: fidl::encoding::Context) -> usize {
1021            16
1022        }
1023    }
1024
1025    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DestroyedPayload, D>
1026        for &DestroyedPayload
1027    {
1028        unsafe fn encode(
1029            self,
1030            encoder: &mut fidl::encoding::Encoder<'_, D>,
1031            offset: usize,
1032            mut depth: fidl::encoding::Depth,
1033        ) -> fidl::Result<()> {
1034            encoder.debug_check_bounds::<DestroyedPayload>(offset);
1035            // Vector header
1036            let max_ordinal: u64 = self.max_ordinal_present();
1037            encoder.write_num(max_ordinal, offset);
1038            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1039            // Calling encoder.out_of_line_offset(0) is not allowed.
1040            if max_ordinal == 0 {
1041                return Ok(());
1042            }
1043            depth.increment()?;
1044            let envelope_size = 8;
1045            let bytes_len = max_ordinal as usize * envelope_size;
1046            #[allow(unused_variables)]
1047            let offset = encoder.out_of_line_offset(bytes_len);
1048            let mut _prev_end_offset: usize = 0;
1049
1050            Ok(())
1051        }
1052    }
1053
1054    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DestroyedPayload {
1055        #[inline(always)]
1056        fn new_empty() -> Self {
1057            Self::default()
1058        }
1059
1060        unsafe fn decode(
1061            &mut self,
1062            decoder: &mut fidl::encoding::Decoder<'_, D>,
1063            offset: usize,
1064            mut depth: fidl::encoding::Depth,
1065        ) -> fidl::Result<()> {
1066            decoder.debug_check_bounds::<Self>(offset);
1067            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1068                None => return Err(fidl::Error::NotNullable),
1069                Some(len) => len,
1070            };
1071            // Calling decoder.out_of_line_offset(0) is not allowed.
1072            if len == 0 {
1073                return Ok(());
1074            };
1075            depth.increment()?;
1076            let envelope_size = 8;
1077            let bytes_len = len * envelope_size;
1078            let offset = decoder.out_of_line_offset(bytes_len)?;
1079            // Decode the envelope for each type.
1080            let mut _next_ordinal_to_read = 0;
1081            let mut next_offset = offset;
1082            let end_offset = offset + bytes_len;
1083
1084            // Decode the remaining unknown envelopes.
1085            while next_offset < end_offset {
1086                _next_ordinal_to_read += 1;
1087                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1088                next_offset += envelope_size;
1089            }
1090
1091            Ok(())
1092        }
1093    }
1094
1095    impl DiscoveredPayload {
1096        #[inline(always)]
1097        fn max_ordinal_present(&self) -> u64 {
1098            0
1099        }
1100    }
1101
1102    impl fidl::encoding::ValueTypeMarker for DiscoveredPayload {
1103        type Borrowed<'a> = &'a Self;
1104        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1105            value
1106        }
1107    }
1108
1109    unsafe impl fidl::encoding::TypeMarker for DiscoveredPayload {
1110        type Owned = Self;
1111
1112        #[inline(always)]
1113        fn inline_align(_context: fidl::encoding::Context) -> usize {
1114            8
1115        }
1116
1117        #[inline(always)]
1118        fn inline_size(_context: fidl::encoding::Context) -> usize {
1119            16
1120        }
1121    }
1122
1123    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DiscoveredPayload, D>
1124        for &DiscoveredPayload
1125    {
1126        unsafe fn encode(
1127            self,
1128            encoder: &mut fidl::encoding::Encoder<'_, D>,
1129            offset: usize,
1130            mut depth: fidl::encoding::Depth,
1131        ) -> fidl::Result<()> {
1132            encoder.debug_check_bounds::<DiscoveredPayload>(offset);
1133            // Vector header
1134            let max_ordinal: u64 = self.max_ordinal_present();
1135            encoder.write_num(max_ordinal, offset);
1136            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1137            // Calling encoder.out_of_line_offset(0) is not allowed.
1138            if max_ordinal == 0 {
1139                return Ok(());
1140            }
1141            depth.increment()?;
1142            let envelope_size = 8;
1143            let bytes_len = max_ordinal as usize * envelope_size;
1144            #[allow(unused_variables)]
1145            let offset = encoder.out_of_line_offset(bytes_len);
1146            let mut _prev_end_offset: usize = 0;
1147
1148            Ok(())
1149        }
1150    }
1151
1152    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DiscoveredPayload {
1153        #[inline(always)]
1154        fn new_empty() -> Self {
1155            Self::default()
1156        }
1157
1158        unsafe fn decode(
1159            &mut self,
1160            decoder: &mut fidl::encoding::Decoder<'_, D>,
1161            offset: usize,
1162            mut depth: fidl::encoding::Depth,
1163        ) -> fidl::Result<()> {
1164            decoder.debug_check_bounds::<Self>(offset);
1165            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1166                None => return Err(fidl::Error::NotNullable),
1167                Some(len) => len,
1168            };
1169            // Calling decoder.out_of_line_offset(0) is not allowed.
1170            if len == 0 {
1171                return Ok(());
1172            };
1173            depth.increment()?;
1174            let envelope_size = 8;
1175            let bytes_len = len * envelope_size;
1176            let offset = decoder.out_of_line_offset(bytes_len)?;
1177            // Decode the envelope for each type.
1178            let mut _next_ordinal_to_read = 0;
1179            let mut next_offset = offset;
1180            let end_offset = offset + bytes_len;
1181
1182            // Decode the remaining unknown envelopes.
1183            while next_offset < end_offset {
1184                _next_ordinal_to_read += 1;
1185                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1186                next_offset += envelope_size;
1187            }
1188
1189            Ok(())
1190        }
1191    }
1192
1193    impl EventHeader {
1194        #[inline(always)]
1195        fn max_ordinal_present(&self) -> u64 {
1196            if let Some(_) = self.timestamp {
1197                return 4;
1198            }
1199            if let Some(_) = self.component_url {
1200                return 3;
1201            }
1202            if let Some(_) = self.moniker {
1203                return 2;
1204            }
1205            if let Some(_) = self.event_type {
1206                return 1;
1207            }
1208            0
1209        }
1210    }
1211
1212    impl fidl::encoding::ValueTypeMarker for EventHeader {
1213        type Borrowed<'a> = &'a Self;
1214        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1215            value
1216        }
1217    }
1218
1219    unsafe impl fidl::encoding::TypeMarker for EventHeader {
1220        type Owned = Self;
1221
1222        #[inline(always)]
1223        fn inline_align(_context: fidl::encoding::Context) -> usize {
1224            8
1225        }
1226
1227        #[inline(always)]
1228        fn inline_size(_context: fidl::encoding::Context) -> usize {
1229            16
1230        }
1231    }
1232
1233    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EventHeader, D>
1234        for &EventHeader
1235    {
1236        unsafe fn encode(
1237            self,
1238            encoder: &mut fidl::encoding::Encoder<'_, D>,
1239            offset: usize,
1240            mut depth: fidl::encoding::Depth,
1241        ) -> fidl::Result<()> {
1242            encoder.debug_check_bounds::<EventHeader>(offset);
1243            // Vector header
1244            let max_ordinal: u64 = self.max_ordinal_present();
1245            encoder.write_num(max_ordinal, offset);
1246            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1247            // Calling encoder.out_of_line_offset(0) is not allowed.
1248            if max_ordinal == 0 {
1249                return Ok(());
1250            }
1251            depth.increment()?;
1252            let envelope_size = 8;
1253            let bytes_len = max_ordinal as usize * envelope_size;
1254            #[allow(unused_variables)]
1255            let offset = encoder.out_of_line_offset(bytes_len);
1256            let mut _prev_end_offset: usize = 0;
1257            if 1 > max_ordinal {
1258                return Ok(());
1259            }
1260
1261            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1262            // are envelope_size bytes.
1263            let cur_offset: usize = (1 - 1) * envelope_size;
1264
1265            // Zero reserved fields.
1266            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1267
1268            // Safety:
1269            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1270            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1271            //   envelope_size bytes, there is always sufficient room.
1272            fidl::encoding::encode_in_envelope_optional::<EventType, D>(
1273                self.event_type
1274                    .as_ref()
1275                    .map(<EventType as fidl::encoding::ValueTypeMarker>::borrow),
1276                encoder,
1277                offset + cur_offset,
1278                depth,
1279            )?;
1280
1281            _prev_end_offset = cur_offset + envelope_size;
1282            if 2 > max_ordinal {
1283                return Ok(());
1284            }
1285
1286            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1287            // are envelope_size bytes.
1288            let cur_offset: usize = (2 - 1) * envelope_size;
1289
1290            // Zero reserved fields.
1291            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1292
1293            // Safety:
1294            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1295            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1296            //   envelope_size bytes, there is always sufficient room.
1297            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
1298            self.moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
1299            encoder, offset + cur_offset, depth
1300        )?;
1301
1302            _prev_end_offset = cur_offset + envelope_size;
1303            if 3 > max_ordinal {
1304                return Ok(());
1305            }
1306
1307            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1308            // are envelope_size bytes.
1309            let cur_offset: usize = (3 - 1) * envelope_size;
1310
1311            // Zero reserved fields.
1312            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1313
1314            // Safety:
1315            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1316            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1317            //   envelope_size bytes, there is always sufficient room.
1318            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
1319            self.component_url.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
1320            encoder, offset + cur_offset, depth
1321        )?;
1322
1323            _prev_end_offset = cur_offset + envelope_size;
1324            if 4 > max_ordinal {
1325                return Ok(());
1326            }
1327
1328            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1329            // are envelope_size bytes.
1330            let cur_offset: usize = (4 - 1) * envelope_size;
1331
1332            // Zero reserved fields.
1333            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1334
1335            // Safety:
1336            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1337            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1338            //   envelope_size bytes, there is always sufficient room.
1339            fidl::encoding::encode_in_envelope_optional::<fidl::BootInstant, D>(
1340                self.timestamp
1341                    .as_ref()
1342                    .map(<fidl::BootInstant as fidl::encoding::ValueTypeMarker>::borrow),
1343                encoder,
1344                offset + cur_offset,
1345                depth,
1346            )?;
1347
1348            _prev_end_offset = cur_offset + envelope_size;
1349
1350            Ok(())
1351        }
1352    }
1353
1354    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EventHeader {
1355        #[inline(always)]
1356        fn new_empty() -> Self {
1357            Self::default()
1358        }
1359
1360        unsafe fn decode(
1361            &mut self,
1362            decoder: &mut fidl::encoding::Decoder<'_, D>,
1363            offset: usize,
1364            mut depth: fidl::encoding::Depth,
1365        ) -> fidl::Result<()> {
1366            decoder.debug_check_bounds::<Self>(offset);
1367            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1368                None => return Err(fidl::Error::NotNullable),
1369                Some(len) => len,
1370            };
1371            // Calling decoder.out_of_line_offset(0) is not allowed.
1372            if len == 0 {
1373                return Ok(());
1374            };
1375            depth.increment()?;
1376            let envelope_size = 8;
1377            let bytes_len = len * envelope_size;
1378            let offset = decoder.out_of_line_offset(bytes_len)?;
1379            // Decode the envelope for each type.
1380            let mut _next_ordinal_to_read = 0;
1381            let mut next_offset = offset;
1382            let end_offset = offset + bytes_len;
1383            _next_ordinal_to_read += 1;
1384            if next_offset >= end_offset {
1385                return Ok(());
1386            }
1387
1388            // Decode unknown envelopes for gaps in ordinals.
1389            while _next_ordinal_to_read < 1 {
1390                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1391                _next_ordinal_to_read += 1;
1392                next_offset += envelope_size;
1393            }
1394
1395            let next_out_of_line = decoder.next_out_of_line();
1396            let handles_before = decoder.remaining_handles();
1397            if let Some((inlined, num_bytes, num_handles)) =
1398                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1399            {
1400                let member_inline_size =
1401                    <EventType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1402                if inlined != (member_inline_size <= 4) {
1403                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1404                }
1405                let inner_offset;
1406                let mut inner_depth = depth.clone();
1407                if inlined {
1408                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1409                    inner_offset = next_offset;
1410                } else {
1411                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1412                    inner_depth.increment()?;
1413                }
1414                let val_ref = self.event_type.get_or_insert_with(|| fidl::new_empty!(EventType, D));
1415                fidl::decode!(EventType, D, val_ref, decoder, inner_offset, inner_depth)?;
1416                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1417                {
1418                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1419                }
1420                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1421                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1422                }
1423            }
1424
1425            next_offset += envelope_size;
1426            _next_ordinal_to_read += 1;
1427            if next_offset >= end_offset {
1428                return Ok(());
1429            }
1430
1431            // Decode unknown envelopes for gaps in ordinals.
1432            while _next_ordinal_to_read < 2 {
1433                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1434                _next_ordinal_to_read += 1;
1435                next_offset += envelope_size;
1436            }
1437
1438            let next_out_of_line = decoder.next_out_of_line();
1439            let handles_before = decoder.remaining_handles();
1440            if let Some((inlined, num_bytes, num_handles)) =
1441                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1442            {
1443                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1444                if inlined != (member_inline_size <= 4) {
1445                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1446                }
1447                let inner_offset;
1448                let mut inner_depth = depth.clone();
1449                if inlined {
1450                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1451                    inner_offset = next_offset;
1452                } else {
1453                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1454                    inner_depth.increment()?;
1455                }
1456                let val_ref = self.moniker.get_or_insert_with(|| {
1457                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
1458                });
1459                fidl::decode!(
1460                    fidl::encoding::BoundedString<4096>,
1461                    D,
1462                    val_ref,
1463                    decoder,
1464                    inner_offset,
1465                    inner_depth
1466                )?;
1467                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1468                {
1469                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1470                }
1471                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1472                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1473                }
1474            }
1475
1476            next_offset += envelope_size;
1477            _next_ordinal_to_read += 1;
1478            if next_offset >= end_offset {
1479                return Ok(());
1480            }
1481
1482            // Decode unknown envelopes for gaps in ordinals.
1483            while _next_ordinal_to_read < 3 {
1484                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1485                _next_ordinal_to_read += 1;
1486                next_offset += envelope_size;
1487            }
1488
1489            let next_out_of_line = decoder.next_out_of_line();
1490            let handles_before = decoder.remaining_handles();
1491            if let Some((inlined, num_bytes, num_handles)) =
1492                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1493            {
1494                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1495                if inlined != (member_inline_size <= 4) {
1496                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1497                }
1498                let inner_offset;
1499                let mut inner_depth = depth.clone();
1500                if inlined {
1501                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1502                    inner_offset = next_offset;
1503                } else {
1504                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1505                    inner_depth.increment()?;
1506                }
1507                let val_ref = self.component_url.get_or_insert_with(|| {
1508                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
1509                });
1510                fidl::decode!(
1511                    fidl::encoding::BoundedString<4096>,
1512                    D,
1513                    val_ref,
1514                    decoder,
1515                    inner_offset,
1516                    inner_depth
1517                )?;
1518                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1519                {
1520                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1521                }
1522                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1523                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1524                }
1525            }
1526
1527            next_offset += envelope_size;
1528            _next_ordinal_to_read += 1;
1529            if next_offset >= end_offset {
1530                return Ok(());
1531            }
1532
1533            // Decode unknown envelopes for gaps in ordinals.
1534            while _next_ordinal_to_read < 4 {
1535                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1536                _next_ordinal_to_read += 1;
1537                next_offset += envelope_size;
1538            }
1539
1540            let next_out_of_line = decoder.next_out_of_line();
1541            let handles_before = decoder.remaining_handles();
1542            if let Some((inlined, num_bytes, num_handles)) =
1543                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1544            {
1545                let member_inline_size =
1546                    <fidl::BootInstant as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1547                if inlined != (member_inline_size <= 4) {
1548                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1549                }
1550                let inner_offset;
1551                let mut inner_depth = depth.clone();
1552                if inlined {
1553                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1554                    inner_offset = next_offset;
1555                } else {
1556                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1557                    inner_depth.increment()?;
1558                }
1559                let val_ref =
1560                    self.timestamp.get_or_insert_with(|| fidl::new_empty!(fidl::BootInstant, D));
1561                fidl::decode!(fidl::BootInstant, D, val_ref, decoder, inner_offset, inner_depth)?;
1562                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1563                {
1564                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1565                }
1566                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1567                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1568                }
1569            }
1570
1571            next_offset += envelope_size;
1572
1573            // Decode the remaining unknown envelopes.
1574            while next_offset < end_offset {
1575                _next_ordinal_to_read += 1;
1576                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1577                next_offset += envelope_size;
1578            }
1579
1580            Ok(())
1581        }
1582    }
1583
1584    impl PurgedPayload {
1585        #[inline(always)]
1586        fn max_ordinal_present(&self) -> u64 {
1587            0
1588        }
1589    }
1590
1591    impl fidl::encoding::ValueTypeMarker for PurgedPayload {
1592        type Borrowed<'a> = &'a Self;
1593        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1594            value
1595        }
1596    }
1597
1598    unsafe impl fidl::encoding::TypeMarker for PurgedPayload {
1599        type Owned = Self;
1600
1601        #[inline(always)]
1602        fn inline_align(_context: fidl::encoding::Context) -> usize {
1603            8
1604        }
1605
1606        #[inline(always)]
1607        fn inline_size(_context: fidl::encoding::Context) -> usize {
1608            16
1609        }
1610    }
1611
1612    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PurgedPayload, D>
1613        for &PurgedPayload
1614    {
1615        unsafe fn encode(
1616            self,
1617            encoder: &mut fidl::encoding::Encoder<'_, D>,
1618            offset: usize,
1619            mut depth: fidl::encoding::Depth,
1620        ) -> fidl::Result<()> {
1621            encoder.debug_check_bounds::<PurgedPayload>(offset);
1622            // Vector header
1623            let max_ordinal: u64 = self.max_ordinal_present();
1624            encoder.write_num(max_ordinal, offset);
1625            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1626            // Calling encoder.out_of_line_offset(0) is not allowed.
1627            if max_ordinal == 0 {
1628                return Ok(());
1629            }
1630            depth.increment()?;
1631            let envelope_size = 8;
1632            let bytes_len = max_ordinal as usize * envelope_size;
1633            #[allow(unused_variables)]
1634            let offset = encoder.out_of_line_offset(bytes_len);
1635            let mut _prev_end_offset: usize = 0;
1636
1637            Ok(())
1638        }
1639    }
1640
1641    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PurgedPayload {
1642        #[inline(always)]
1643        fn new_empty() -> Self {
1644            Self::default()
1645        }
1646
1647        unsafe fn decode(
1648            &mut self,
1649            decoder: &mut fidl::encoding::Decoder<'_, D>,
1650            offset: usize,
1651            mut depth: fidl::encoding::Depth,
1652        ) -> fidl::Result<()> {
1653            decoder.debug_check_bounds::<Self>(offset);
1654            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1655                None => return Err(fidl::Error::NotNullable),
1656                Some(len) => len,
1657            };
1658            // Calling decoder.out_of_line_offset(0) is not allowed.
1659            if len == 0 {
1660                return Ok(());
1661            };
1662            depth.increment()?;
1663            let envelope_size = 8;
1664            let bytes_len = len * envelope_size;
1665            let offset = decoder.out_of_line_offset(bytes_len)?;
1666            // Decode the envelope for each type.
1667            let mut _next_ordinal_to_read = 0;
1668            let mut next_offset = offset;
1669            let end_offset = offset + bytes_len;
1670
1671            // Decode the remaining unknown envelopes.
1672            while next_offset < end_offset {
1673                _next_ordinal_to_read += 1;
1674                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1675                next_offset += envelope_size;
1676            }
1677
1678            Ok(())
1679        }
1680    }
1681
1682    impl ResolvedPayload {
1683        #[inline(always)]
1684        fn max_ordinal_present(&self) -> u64 {
1685            0
1686        }
1687    }
1688
1689    impl fidl::encoding::ValueTypeMarker for ResolvedPayload {
1690        type Borrowed<'a> = &'a Self;
1691        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1692            value
1693        }
1694    }
1695
1696    unsafe impl fidl::encoding::TypeMarker for ResolvedPayload {
1697        type Owned = Self;
1698
1699        #[inline(always)]
1700        fn inline_align(_context: fidl::encoding::Context) -> usize {
1701            8
1702        }
1703
1704        #[inline(always)]
1705        fn inline_size(_context: fidl::encoding::Context) -> usize {
1706            16
1707        }
1708    }
1709
1710    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResolvedPayload, D>
1711        for &ResolvedPayload
1712    {
1713        unsafe fn encode(
1714            self,
1715            encoder: &mut fidl::encoding::Encoder<'_, D>,
1716            offset: usize,
1717            mut depth: fidl::encoding::Depth,
1718        ) -> fidl::Result<()> {
1719            encoder.debug_check_bounds::<ResolvedPayload>(offset);
1720            // Vector header
1721            let max_ordinal: u64 = self.max_ordinal_present();
1722            encoder.write_num(max_ordinal, offset);
1723            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1724            // Calling encoder.out_of_line_offset(0) is not allowed.
1725            if max_ordinal == 0 {
1726                return Ok(());
1727            }
1728            depth.increment()?;
1729            let envelope_size = 8;
1730            let bytes_len = max_ordinal as usize * envelope_size;
1731            #[allow(unused_variables)]
1732            let offset = encoder.out_of_line_offset(bytes_len);
1733            let mut _prev_end_offset: usize = 0;
1734
1735            Ok(())
1736        }
1737    }
1738
1739    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolvedPayload {
1740        #[inline(always)]
1741        fn new_empty() -> Self {
1742            Self::default()
1743        }
1744
1745        unsafe fn decode(
1746            &mut self,
1747            decoder: &mut fidl::encoding::Decoder<'_, D>,
1748            offset: usize,
1749            mut depth: fidl::encoding::Depth,
1750        ) -> fidl::Result<()> {
1751            decoder.debug_check_bounds::<Self>(offset);
1752            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1753                None => return Err(fidl::Error::NotNullable),
1754                Some(len) => len,
1755            };
1756            // Calling decoder.out_of_line_offset(0) is not allowed.
1757            if len == 0 {
1758                return Ok(());
1759            };
1760            depth.increment()?;
1761            let envelope_size = 8;
1762            let bytes_len = len * envelope_size;
1763            let offset = decoder.out_of_line_offset(bytes_len)?;
1764            // Decode the envelope for each type.
1765            let mut _next_ordinal_to_read = 0;
1766            let mut next_offset = offset;
1767            let end_offset = offset + bytes_len;
1768
1769            // Decode the remaining unknown envelopes.
1770            while next_offset < end_offset {
1771                _next_ordinal_to_read += 1;
1772                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1773                next_offset += envelope_size;
1774            }
1775
1776            Ok(())
1777        }
1778    }
1779
1780    impl StartedPayload {
1781        #[inline(always)]
1782        fn max_ordinal_present(&self) -> u64 {
1783            0
1784        }
1785    }
1786
1787    impl fidl::encoding::ValueTypeMarker for StartedPayload {
1788        type Borrowed<'a> = &'a Self;
1789        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1790            value
1791        }
1792    }
1793
1794    unsafe impl fidl::encoding::TypeMarker for StartedPayload {
1795        type Owned = Self;
1796
1797        #[inline(always)]
1798        fn inline_align(_context: fidl::encoding::Context) -> usize {
1799            8
1800        }
1801
1802        #[inline(always)]
1803        fn inline_size(_context: fidl::encoding::Context) -> usize {
1804            16
1805        }
1806    }
1807
1808    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StartedPayload, D>
1809        for &StartedPayload
1810    {
1811        unsafe fn encode(
1812            self,
1813            encoder: &mut fidl::encoding::Encoder<'_, D>,
1814            offset: usize,
1815            mut depth: fidl::encoding::Depth,
1816        ) -> fidl::Result<()> {
1817            encoder.debug_check_bounds::<StartedPayload>(offset);
1818            // Vector header
1819            let max_ordinal: u64 = self.max_ordinal_present();
1820            encoder.write_num(max_ordinal, offset);
1821            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1822            // Calling encoder.out_of_line_offset(0) is not allowed.
1823            if max_ordinal == 0 {
1824                return Ok(());
1825            }
1826            depth.increment()?;
1827            let envelope_size = 8;
1828            let bytes_len = max_ordinal as usize * envelope_size;
1829            #[allow(unused_variables)]
1830            let offset = encoder.out_of_line_offset(bytes_len);
1831            let mut _prev_end_offset: usize = 0;
1832
1833            Ok(())
1834        }
1835    }
1836
1837    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StartedPayload {
1838        #[inline(always)]
1839        fn new_empty() -> Self {
1840            Self::default()
1841        }
1842
1843        unsafe fn decode(
1844            &mut self,
1845            decoder: &mut fidl::encoding::Decoder<'_, D>,
1846            offset: usize,
1847            mut depth: fidl::encoding::Depth,
1848        ) -> fidl::Result<()> {
1849            decoder.debug_check_bounds::<Self>(offset);
1850            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1851                None => return Err(fidl::Error::NotNullable),
1852                Some(len) => len,
1853            };
1854            // Calling decoder.out_of_line_offset(0) is not allowed.
1855            if len == 0 {
1856                return Ok(());
1857            };
1858            depth.increment()?;
1859            let envelope_size = 8;
1860            let bytes_len = len * envelope_size;
1861            let offset = decoder.out_of_line_offset(bytes_len)?;
1862            // Decode the envelope for each type.
1863            let mut _next_ordinal_to_read = 0;
1864            let mut next_offset = offset;
1865            let end_offset = offset + bytes_len;
1866
1867            // Decode the remaining unknown envelopes.
1868            while next_offset < end_offset {
1869                _next_ordinal_to_read += 1;
1870                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1871                next_offset += envelope_size;
1872            }
1873
1874            Ok(())
1875        }
1876    }
1877
1878    impl StoppedPayload {
1879        #[inline(always)]
1880        fn max_ordinal_present(&self) -> u64 {
1881            if let Some(_) = self.exit_code {
1882                return 2;
1883            }
1884            if let Some(_) = self.status {
1885                return 1;
1886            }
1887            0
1888        }
1889    }
1890
1891    impl fidl::encoding::ValueTypeMarker for StoppedPayload {
1892        type Borrowed<'a> = &'a Self;
1893        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1894            value
1895        }
1896    }
1897
1898    unsafe impl fidl::encoding::TypeMarker for StoppedPayload {
1899        type Owned = Self;
1900
1901        #[inline(always)]
1902        fn inline_align(_context: fidl::encoding::Context) -> usize {
1903            8
1904        }
1905
1906        #[inline(always)]
1907        fn inline_size(_context: fidl::encoding::Context) -> usize {
1908            16
1909        }
1910    }
1911
1912    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StoppedPayload, D>
1913        for &StoppedPayload
1914    {
1915        unsafe fn encode(
1916            self,
1917            encoder: &mut fidl::encoding::Encoder<'_, D>,
1918            offset: usize,
1919            mut depth: fidl::encoding::Depth,
1920        ) -> fidl::Result<()> {
1921            encoder.debug_check_bounds::<StoppedPayload>(offset);
1922            // Vector header
1923            let max_ordinal: u64 = self.max_ordinal_present();
1924            encoder.write_num(max_ordinal, offset);
1925            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1926            // Calling encoder.out_of_line_offset(0) is not allowed.
1927            if max_ordinal == 0 {
1928                return Ok(());
1929            }
1930            depth.increment()?;
1931            let envelope_size = 8;
1932            let bytes_len = max_ordinal as usize * envelope_size;
1933            #[allow(unused_variables)]
1934            let offset = encoder.out_of_line_offset(bytes_len);
1935            let mut _prev_end_offset: usize = 0;
1936            if 1 > max_ordinal {
1937                return Ok(());
1938            }
1939
1940            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1941            // are envelope_size bytes.
1942            let cur_offset: usize = (1 - 1) * envelope_size;
1943
1944            // Zero reserved fields.
1945            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1946
1947            // Safety:
1948            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1949            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1950            //   envelope_size bytes, there is always sufficient room.
1951            fidl::encoding::encode_in_envelope_optional::<i32, D>(
1952                self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
1953                encoder,
1954                offset + cur_offset,
1955                depth,
1956            )?;
1957
1958            _prev_end_offset = cur_offset + envelope_size;
1959            if 2 > max_ordinal {
1960                return Ok(());
1961            }
1962
1963            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1964            // are envelope_size bytes.
1965            let cur_offset: usize = (2 - 1) * envelope_size;
1966
1967            // Zero reserved fields.
1968            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1969
1970            // Safety:
1971            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1972            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1973            //   envelope_size bytes, there is always sufficient room.
1974            fidl::encoding::encode_in_envelope_optional::<i64, D>(
1975                self.exit_code.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
1976                encoder,
1977                offset + cur_offset,
1978                depth,
1979            )?;
1980
1981            _prev_end_offset = cur_offset + envelope_size;
1982
1983            Ok(())
1984        }
1985    }
1986
1987    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StoppedPayload {
1988        #[inline(always)]
1989        fn new_empty() -> Self {
1990            Self::default()
1991        }
1992
1993        unsafe fn decode(
1994            &mut self,
1995            decoder: &mut fidl::encoding::Decoder<'_, D>,
1996            offset: usize,
1997            mut depth: fidl::encoding::Depth,
1998        ) -> fidl::Result<()> {
1999            decoder.debug_check_bounds::<Self>(offset);
2000            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2001                None => return Err(fidl::Error::NotNullable),
2002                Some(len) => len,
2003            };
2004            // Calling decoder.out_of_line_offset(0) is not allowed.
2005            if len == 0 {
2006                return Ok(());
2007            };
2008            depth.increment()?;
2009            let envelope_size = 8;
2010            let bytes_len = len * envelope_size;
2011            let offset = decoder.out_of_line_offset(bytes_len)?;
2012            // Decode the envelope for each type.
2013            let mut _next_ordinal_to_read = 0;
2014            let mut next_offset = offset;
2015            let end_offset = offset + bytes_len;
2016            _next_ordinal_to_read += 1;
2017            if next_offset >= end_offset {
2018                return Ok(());
2019            }
2020
2021            // Decode unknown envelopes for gaps in ordinals.
2022            while _next_ordinal_to_read < 1 {
2023                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2024                _next_ordinal_to_read += 1;
2025                next_offset += envelope_size;
2026            }
2027
2028            let next_out_of_line = decoder.next_out_of_line();
2029            let handles_before = decoder.remaining_handles();
2030            if let Some((inlined, num_bytes, num_handles)) =
2031                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2032            {
2033                let member_inline_size =
2034                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2035                if inlined != (member_inline_size <= 4) {
2036                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2037                }
2038                let inner_offset;
2039                let mut inner_depth = depth.clone();
2040                if inlined {
2041                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2042                    inner_offset = next_offset;
2043                } else {
2044                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2045                    inner_depth.increment()?;
2046                }
2047                let val_ref = self.status.get_or_insert_with(|| fidl::new_empty!(i32, D));
2048                fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
2049                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2050                {
2051                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2052                }
2053                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2054                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2055                }
2056            }
2057
2058            next_offset += envelope_size;
2059            _next_ordinal_to_read += 1;
2060            if next_offset >= end_offset {
2061                return Ok(());
2062            }
2063
2064            // Decode unknown envelopes for gaps in ordinals.
2065            while _next_ordinal_to_read < 2 {
2066                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2067                _next_ordinal_to_read += 1;
2068                next_offset += envelope_size;
2069            }
2070
2071            let next_out_of_line = decoder.next_out_of_line();
2072            let handles_before = decoder.remaining_handles();
2073            if let Some((inlined, num_bytes, num_handles)) =
2074                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2075            {
2076                let member_inline_size =
2077                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2078                if inlined != (member_inline_size <= 4) {
2079                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2080                }
2081                let inner_offset;
2082                let mut inner_depth = depth.clone();
2083                if inlined {
2084                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2085                    inner_offset = next_offset;
2086                } else {
2087                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2088                    inner_depth.increment()?;
2089                }
2090                let val_ref = self.exit_code.get_or_insert_with(|| fidl::new_empty!(i64, D));
2091                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
2092                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2093                {
2094                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2095                }
2096                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2097                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2098                }
2099            }
2100
2101            next_offset += envelope_size;
2102
2103            // Decode the remaining unknown envelopes.
2104            while next_offset < end_offset {
2105                _next_ordinal_to_read += 1;
2106                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2107                next_offset += envelope_size;
2108            }
2109
2110            Ok(())
2111        }
2112    }
2113
2114    impl UnresolvedPayload {
2115        #[inline(always)]
2116        fn max_ordinal_present(&self) -> u64 {
2117            0
2118        }
2119    }
2120
2121    impl fidl::encoding::ValueTypeMarker for UnresolvedPayload {
2122        type Borrowed<'a> = &'a Self;
2123        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2124            value
2125        }
2126    }
2127
2128    unsafe impl fidl::encoding::TypeMarker for UnresolvedPayload {
2129        type Owned = Self;
2130
2131        #[inline(always)]
2132        fn inline_align(_context: fidl::encoding::Context) -> usize {
2133            8
2134        }
2135
2136        #[inline(always)]
2137        fn inline_size(_context: fidl::encoding::Context) -> usize {
2138            16
2139        }
2140    }
2141
2142    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UnresolvedPayload, D>
2143        for &UnresolvedPayload
2144    {
2145        unsafe fn encode(
2146            self,
2147            encoder: &mut fidl::encoding::Encoder<'_, D>,
2148            offset: usize,
2149            mut depth: fidl::encoding::Depth,
2150        ) -> fidl::Result<()> {
2151            encoder.debug_check_bounds::<UnresolvedPayload>(offset);
2152            // Vector header
2153            let max_ordinal: u64 = self.max_ordinal_present();
2154            encoder.write_num(max_ordinal, offset);
2155            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2156            // Calling encoder.out_of_line_offset(0) is not allowed.
2157            if max_ordinal == 0 {
2158                return Ok(());
2159            }
2160            depth.increment()?;
2161            let envelope_size = 8;
2162            let bytes_len = max_ordinal as usize * envelope_size;
2163            #[allow(unused_variables)]
2164            let offset = encoder.out_of_line_offset(bytes_len);
2165            let mut _prev_end_offset: usize = 0;
2166
2167            Ok(())
2168        }
2169    }
2170
2171    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UnresolvedPayload {
2172        #[inline(always)]
2173        fn new_empty() -> Self {
2174            Self::default()
2175        }
2176
2177        unsafe fn decode(
2178            &mut self,
2179            decoder: &mut fidl::encoding::Decoder<'_, D>,
2180            offset: usize,
2181            mut depth: fidl::encoding::Depth,
2182        ) -> fidl::Result<()> {
2183            decoder.debug_check_bounds::<Self>(offset);
2184            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2185                None => return Err(fidl::Error::NotNullable),
2186                Some(len) => len,
2187            };
2188            // Calling decoder.out_of_line_offset(0) is not allowed.
2189            if len == 0 {
2190                return Ok(());
2191            };
2192            depth.increment()?;
2193            let envelope_size = 8;
2194            let bytes_len = len * envelope_size;
2195            let offset = decoder.out_of_line_offset(bytes_len)?;
2196            // Decode the envelope for each type.
2197            let mut _next_ordinal_to_read = 0;
2198            let mut next_offset = offset;
2199            let end_offset = offset + bytes_len;
2200
2201            // Decode the remaining unknown envelopes.
2202            while next_offset < end_offset {
2203                _next_ordinal_to_read += 1;
2204                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2205                next_offset += envelope_size;
2206            }
2207
2208            Ok(())
2209        }
2210    }
2211}