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__common::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__common::MAX_PATH_LENGTH as u64;
49
50/// The maximum length of a storage instance ID.
51/// A storage instance ID is a 256-bit UUID, which when encoded
52/// in hex notation is 64 characters long.
53pub const MAX_STORAGE_ID_LENGTH: u32 = 64;
54
55/// The maximum number of requests per event subscription.
56pub const MAX_SUBSCRIPTION_REQUESTS: u32 = 2;
57
58pub const MAX_URL_SCHEME_LENGTH: u64 = MAX_NAME_LENGTH as u64;
59
60#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
61#[repr(u32)]
62pub enum DeletionError {
63    /// There was an error sending a request to the storage provider.
64    Connection = 1,
65    /// The storage provider returned an error in response to a protocol
66    /// request.
67    Protocol = 2,
68    /// There was no storage available for deletion.
69    NoneAvailable = 3,
70    /// This call is not supported.
71    Unsupported = 4,
72}
73
74impl DeletionError {
75    #[inline]
76    pub fn from_primitive(prim: u32) -> Option<Self> {
77        match prim {
78            1 => Some(Self::Connection),
79            2 => Some(Self::Protocol),
80            3 => Some(Self::NoneAvailable),
81            4 => Some(Self::Unsupported),
82            _ => None,
83        }
84    }
85
86    #[inline]
87    pub const fn into_primitive(self) -> u32 {
88        self as u32
89    }
90}
91
92/// Standard error codes for component framework protocols.
93#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
94pub enum Error {
95    /// Component manager encountered an otherwise unspecified error while
96    /// performing the operation.
97    Internal,
98    /// At least one argument had an invalid format.
99    InvalidArguments,
100    /// The feature is not yet supported.
101    Unsupported,
102    /// The caller did not have permission to perform the specified operation,
103    /// or one of the handles provided to the call had insufficient rights.
104    AccessDenied,
105    /// The component instance was not found.
106    InstanceNotFound,
107    /// The component instance already exists.
108    InstanceAlreadyExists,
109    /// The component instance could not be started.
110    InstanceCannotStart,
111    /// Failed to resolve the component's declaration.
112    InstanceCannotResolve,
113    /// The component collection was not found.
114    CollectionNotFound,
115    /// There were insufficient resources to perform the operation.
116    ResourceUnavailable,
117    /// The component instance died unexpectedly.
118    InstanceDied,
119    /// The requested resource does not exist.
120    ResourceNotFound,
121    /// Failed to unresolve the component.
122    InstanceCannotUnresolve,
123    /// The component instance has already been started.
124    InstanceAlreadyStarted,
125    /// A capability route would have created a dependency cycle.
126    DependencyCycle,
127    #[doc(hidden)]
128    __SourceBreaking { unknown_ordinal: u32 },
129}
130
131/// Pattern that matches an unknown `Error` member.
132#[macro_export]
133macro_rules! ErrorUnknown {
134    () => {
135        _
136    };
137}
138
139impl Error {
140    #[inline]
141    pub fn from_primitive(prim: u32) -> Option<Self> {
142        match prim {
143            1 => Some(Self::Internal),
144            2 => Some(Self::InvalidArguments),
145            3 => Some(Self::Unsupported),
146            4 => Some(Self::AccessDenied),
147            5 => Some(Self::InstanceNotFound),
148            6 => Some(Self::InstanceAlreadyExists),
149            7 => Some(Self::InstanceCannotStart),
150            8 => Some(Self::InstanceCannotResolve),
151            9 => Some(Self::CollectionNotFound),
152            10 => Some(Self::ResourceUnavailable),
153            11 => Some(Self::InstanceDied),
154            12 => Some(Self::ResourceNotFound),
155            13 => Some(Self::InstanceCannotUnresolve),
156            14 => Some(Self::InstanceAlreadyStarted),
157            15 => Some(Self::DependencyCycle),
158            _ => None,
159        }
160    }
161
162    #[inline]
163    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
164        match prim {
165            1 => Self::Internal,
166            2 => Self::InvalidArguments,
167            3 => Self::Unsupported,
168            4 => Self::AccessDenied,
169            5 => Self::InstanceNotFound,
170            6 => Self::InstanceAlreadyExists,
171            7 => Self::InstanceCannotStart,
172            8 => Self::InstanceCannotResolve,
173            9 => Self::CollectionNotFound,
174            10 => Self::ResourceUnavailable,
175            11 => Self::InstanceDied,
176            12 => Self::ResourceNotFound,
177            13 => Self::InstanceCannotUnresolve,
178            14 => Self::InstanceAlreadyStarted,
179            15 => Self::DependencyCycle,
180            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
181        }
182    }
183
184    #[inline]
185    pub fn unknown() -> Self {
186        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
187    }
188
189    #[inline]
190    pub const fn into_primitive(self) -> u32 {
191        match self {
192            Self::Internal => 1,
193            Self::InvalidArguments => 2,
194            Self::Unsupported => 3,
195            Self::AccessDenied => 4,
196            Self::InstanceNotFound => 5,
197            Self::InstanceAlreadyExists => 6,
198            Self::InstanceCannotStart => 7,
199            Self::InstanceCannotResolve => 8,
200            Self::CollectionNotFound => 9,
201            Self::ResourceUnavailable => 10,
202            Self::InstanceDied => 11,
203            Self::ResourceNotFound => 12,
204            Self::InstanceCannotUnresolve => 13,
205            Self::InstanceAlreadyStarted => 14,
206            Self::DependencyCycle => 15,
207            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
208        }
209    }
210
211    #[inline]
212    pub fn is_unknown(&self) -> bool {
213        match self {
214            Self::__SourceBreaking { unknown_ordinal: _ } => true,
215            _ => false,
216        }
217    }
218}
219
220/// These EventTypes are used for the EventStream protocol.
221/// They are FIDL versions of the EventType enum in hooks.rs and have
222/// the same meaning.
223#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
224#[repr(u32)]
225pub enum EventType {
226    /// A capability provided by this component has been requested. The event
227    /// payload carries the request channel.
228    CapabilityRequested = 1,
229    /// A component instance was discovered. This is the first stage in the lifecycle
230    /// of components. Dispatched for dynamic children when they're created, for static
231    /// children when their parent is resolved, and for the root when the component manager
232    /// starts.
233    Discovered = 3,
234    /// The instance is destroyed and no longer exists.
235    Destroyed = 4,
236    /// An instance's declaration was resolved successfully for the first time.
237    Resolved = 5,
238    /// This instance has started, according to component manager. However, if this is an
239    /// executable component, the runner has further work to do to launch the component.
240    Started = 6,
241    /// An instance was stopped successfully.
242    Stopped = 7,
243    /// Similar to STARTED, except the payload will carry an eventpair that the subscriber
244    /// could use to defer the launch of the component. This allows, e.g., a debugger to
245    /// perform some setup before any processes are created.
246    DebugStarted = 8,
247    /// An instance was unresolved successfully.
248    Unresolved = 9,
249}
250
251impl EventType {
252    #[inline]
253    pub fn from_primitive(prim: u32) -> Option<Self> {
254        match prim {
255            1 => Some(Self::CapabilityRequested),
256            3 => Some(Self::Discovered),
257            4 => Some(Self::Destroyed),
258            5 => Some(Self::Resolved),
259            6 => Some(Self::Started),
260            7 => Some(Self::Stopped),
261            8 => Some(Self::DebugStarted),
262            9 => Some(Self::Unresolved),
263            _ => None,
264        }
265    }
266
267    #[inline]
268    pub const fn into_primitive(self) -> u32 {
269        self as u32
270    }
271}
272
273/// Error returned from methods in [`Namespace`].
274#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
275pub enum NamespaceError {
276    /// The parent of a parent shares a prefix with another namespace entry
277    Shadow,
278    /// Two entries have the same namespace path.
279    Duplicate,
280    /// Failed to convert a namespace dictionary to a directory.
281    Conversion,
282    /// A namespace entry was invalid.
283    BadEntry,
284    /// There was an error reading from one of the dictionaries.
285    DictionaryRead,
286    #[doc(hidden)]
287    __SourceBreaking { unknown_ordinal: u32 },
288}
289
290/// Pattern that matches an unknown `NamespaceError` member.
291#[macro_export]
292macro_rules! NamespaceErrorUnknown {
293    () => {
294        _
295    };
296}
297
298impl NamespaceError {
299    #[inline]
300    pub fn from_primitive(prim: u32) -> Option<Self> {
301        match prim {
302            1 => Some(Self::Shadow),
303            2 => Some(Self::Duplicate),
304            3 => Some(Self::Conversion),
305            4 => Some(Self::BadEntry),
306            5 => Some(Self::DictionaryRead),
307            _ => None,
308        }
309    }
310
311    #[inline]
312    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
313        match prim {
314            1 => Self::Shadow,
315            2 => Self::Duplicate,
316            3 => Self::Conversion,
317            4 => Self::BadEntry,
318            5 => Self::DictionaryRead,
319            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
320        }
321    }
322
323    #[inline]
324    pub fn unknown() -> Self {
325        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
326    }
327
328    #[inline]
329    pub const fn into_primitive(self) -> u32 {
330        match self {
331            Self::Shadow => 1,
332            Self::Duplicate => 2,
333            Self::Conversion => 3,
334            Self::BadEntry => 4,
335            Self::DictionaryRead => 5,
336            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
337        }
338    }
339
340    #[inline]
341    pub fn is_unknown(&self) -> bool {
342        match self {
343            Self::__SourceBreaking { unknown_ordinal: _ } => true,
344            _ => false,
345        }
346    }
347}
348
349#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
350#[repr(u32)]
351pub enum StatusError {
352    /// The storage provider returned an error to a request or the connection
353    /// to the provider unexpectedly closed.
354    Provider = 1,
355    /// Information returned by the storage provider appears to be invalid.
356    ResponseInvalid = 2,
357    /// A call to the storage provider succeeded, but it returned unexpectedly
358    /// empty data.
359    StatusUnknown = 3,
360    /// This call is not supported.
361    Unsupported = 4,
362}
363
364impl StatusError {
365    #[inline]
366    pub fn from_primitive(prim: u32) -> Option<Self> {
367        match prim {
368            1 => Some(Self::Provider),
369            2 => Some(Self::ResponseInvalid),
370            3 => Some(Self::StatusUnknown),
371            4 => Some(Self::Unsupported),
372            _ => None,
373        }
374    }
375
376    #[inline]
377    pub const fn into_primitive(self) -> u32 {
378        self as u32
379    }
380}
381
382#[derive(Clone, Debug, PartialEq)]
383pub struct ChildIteratorNextResponse {
384    pub children: Vec<fidl_fuchsia_component_decl__common::ChildRef>,
385}
386
387impl fidl::Persistable for ChildIteratorNextResponse {}
388
389#[derive(Clone, Debug, PartialEq)]
390pub struct ExecutionControllerOnStopRequest {
391    pub stopped_payload: StoppedPayload,
392}
393
394impl fidl::Persistable for ExecutionControllerOnStopRequest {}
395
396#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
397pub struct IntrospectorGetMonikerResponse {
398    pub moniker: String,
399}
400
401impl fidl::Persistable for IntrospectorGetMonikerResponse {}
402
403#[derive(Clone, Debug, PartialEq)]
404pub struct RealmDestroyChildRequest {
405    pub child: fidl_fuchsia_component_decl__common::ChildRef,
406}
407
408impl fidl::Persistable for RealmDestroyChildRequest {}
409
410#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
411pub struct StorageAdminDeleteComponentStorageRequest {
412    pub relative_moniker: String,
413}
414
415impl fidl::Persistable for StorageAdminDeleteComponentStorageRequest {}
416
417#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
418pub struct StorageIteratorNextResponse {
419    pub relative_monikers: Vec<String>,
420}
421
422impl fidl::Persistable for StorageIteratorNextResponse {}
423
424/// Payload for Destroyed events.
425#[derive(Clone, Debug, Default, PartialEq)]
426pub struct DestroyedPayload {
427    #[doc(hidden)]
428    pub __source_breaking: fidl::marker::SourceBreaking,
429}
430
431impl fidl::Persistable for DestroyedPayload {}
432
433/// Payload for Discovered events.
434#[derive(Clone, Debug, Default, PartialEq)]
435pub struct DiscoveredPayload {
436    #[doc(hidden)]
437    pub __source_breaking: fidl::marker::SourceBreaking,
438}
439
440impl fidl::Persistable for DiscoveredPayload {}
441
442/// A head providing metadata about a target component instance.
443#[derive(Clone, Debug, Default, PartialEq)]
444pub struct EventHeader {
445    /// Event type corresponding to the event
446    pub event_type: Option<EventType>,
447    /// Relative moniker identifying the component instance. Relative to the scope of the event.
448    pub moniker: Option<String>,
449    /// URL used to resolve the component.
450    pub component_url: Option<String>,
451    /// Boot time when the event occurred.
452    pub timestamp: Option<fidl::BootInstant>,
453    #[doc(hidden)]
454    pub __source_breaking: fidl::marker::SourceBreaking,
455}
456
457impl fidl::Persistable for EventHeader {}
458
459/// Payload for Purged events.
460#[derive(Clone, Debug, Default, PartialEq)]
461pub struct PurgedPayload {
462    #[doc(hidden)]
463    pub __source_breaking: fidl::marker::SourceBreaking,
464}
465
466impl fidl::Persistable for PurgedPayload {}
467
468/// Payload for Resolved events.
469#[derive(Clone, Debug, Default, PartialEq)]
470pub struct ResolvedPayload {
471    #[doc(hidden)]
472    pub __source_breaking: fidl::marker::SourceBreaking,
473}
474
475impl fidl::Persistable for ResolvedPayload {}
476
477/// Payload for Started events.
478#[derive(Clone, Debug, Default, PartialEq)]
479pub struct StartedPayload {
480    #[doc(hidden)]
481    pub __source_breaking: fidl::marker::SourceBreaking,
482}
483
484impl fidl::Persistable for StartedPayload {}
485
486/// Payload for Stopped events.
487#[derive(Clone, Debug, Default, PartialEq)]
488pub struct StoppedPayload {
489    /// The epitaph set on the fuchsia.component.runner/ComponentController
490    /// protocol channel. This is the exit status of the component. The
491    /// possible status values and their meaning are described in the definition
492    /// of the ComponentController protocol.
493    pub status: Option<i32>,
494    /// The exit code of the component instance. Note that not all components
495    /// will stop with an exit code.
496    ///
497    /// Many program runtimes have the concept of an exit code. Runners may map
498    /// that value to this field when applicable. For example, the ELF runner
499    /// will publish the Zircon process return code here.
500    pub exit_code: Option<i64>,
501    #[doc(hidden)]
502    pub __source_breaking: fidl::marker::SourceBreaking,
503}
504
505impl fidl::Persistable for StoppedPayload {}
506
507/// Metadata about status of the storage
508#[derive(Clone, Debug, Default, PartialEq)]
509pub struct StorageStatus {
510    pub total_size: Option<u64>,
511    pub used_size: Option<u64>,
512    #[doc(hidden)]
513    pub __source_breaking: fidl::marker::SourceBreaking,
514}
515
516impl fidl::Persistable for StorageStatus {}
517
518/// Payload for Unresolved events.
519#[derive(Clone, Debug, Default, PartialEq)]
520pub struct UnresolvedPayload {
521    #[doc(hidden)]
522    pub __source_breaking: fidl::marker::SourceBreaking,
523}
524
525impl fidl::Persistable for UnresolvedPayload {}
526
527pub mod binder_ordinals {}
528
529pub mod child_iterator_ordinals {
530    pub const NEXT: u64 = 0x40e4c3882b050d08;
531}
532
533pub mod controller_ordinals {
534    pub const START: u64 = 0x68878076b8d2eac5;
535    pub const IS_STARTED: u64 = 0x2155e6e1db2083c3;
536    pub const GET_EXPOSED_DICTIONARY: u64 = 0x7e48373e5eda1f9b;
537    pub const DESTROY: u64 = 0x74529fa68b5c1741;
538}
539
540pub mod event_stream_ordinals {
541    pub const GET_NEXT: u64 = 0x3f24c9495978eb86;
542    pub const WAIT_FOR_READY: u64 = 0x31331f9578d2e682;
543}
544
545pub mod execution_controller_ordinals {
546    pub const STOP: u64 = 0x56d23cec21036117;
547    pub const ON_STOP: u64 = 0x62d5018e2174f57f;
548}
549
550pub mod introspector_ordinals {
551    pub const GET_MONIKER: u64 = 0x2f980ceb37bf458;
552}
553
554pub mod namespace_ordinals {
555    pub const CREATE: u64 = 0x4329fe12b2a790f9;
556}
557
558pub mod realm_ordinals {
559    pub const OPEN_CONTROLLER: u64 = 0x7150b7898d1b1180;
560    pub const OPEN_EXPOSED_DIR: u64 = 0x7f993235ca59f92c;
561    pub const CREATE_CHILD: u64 = 0x43e48ce8483d7560;
562    pub const DESTROY_CHILD: u64 = 0x71d8caf8850c9222;
563    pub const LIST_CHILDREN: u64 = 0x6888a76683efc0a1;
564    pub const GET_RESOLVED_INFO: u64 = 0x734f744cb7d210a2;
565    pub const GET_CHILD_OUTPUT_DICTIONARY: u64 = 0x4259d08d261d5610;
566}
567
568pub mod storage_admin_ordinals {
569    pub const OPEN_STORAGE: u64 = 0x6ceaa5904cfe4377;
570    pub const LIST_STORAGE_IN_REALM: u64 = 0x764f6d1f083e8bfb;
571    pub const OPEN_COMPONENT_STORAGE_BY_ID: u64 = 0x4802102cc55d5df1;
572    pub const DELETE_COMPONENT_STORAGE: u64 = 0x1677c1cdfcdbf45a;
573    pub const GET_STATUS: u64 = 0x7729e325a6c526c8;
574    pub const DELETE_ALL_STORAGE_CONTENTS: u64 = 0x2ee980b4b2d24adb;
575}
576
577pub mod storage_iterator_ordinals {
578    pub const NEXT: u64 = 0x7a6b21f15fd01b72;
579}
580
581mod internal {
582    use super::*;
583    unsafe impl fidl::encoding::TypeMarker for DeletionError {
584        type Owned = Self;
585
586        #[inline(always)]
587        fn inline_align(_context: fidl::encoding::Context) -> usize {
588            std::mem::align_of::<u32>()
589        }
590
591        #[inline(always)]
592        fn inline_size(_context: fidl::encoding::Context) -> usize {
593            std::mem::size_of::<u32>()
594        }
595
596        #[inline(always)]
597        fn encode_is_copy() -> bool {
598            true
599        }
600
601        #[inline(always)]
602        fn decode_is_copy() -> bool {
603            false
604        }
605    }
606
607    impl fidl::encoding::ValueTypeMarker for DeletionError {
608        type Borrowed<'a> = Self;
609        #[inline(always)]
610        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
611            *value
612        }
613    }
614
615    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DeletionError {
616        #[inline]
617        unsafe fn encode(
618            self,
619            encoder: &mut fidl::encoding::Encoder<'_, D>,
620            offset: usize,
621            _depth: fidl::encoding::Depth,
622        ) -> fidl::Result<()> {
623            encoder.debug_check_bounds::<Self>(offset);
624            encoder.write_num(self.into_primitive(), offset);
625            Ok(())
626        }
627    }
628
629    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeletionError {
630        #[inline(always)]
631        fn new_empty() -> Self {
632            Self::Connection
633        }
634
635        #[inline]
636        unsafe fn decode(
637            &mut self,
638            decoder: &mut fidl::encoding::Decoder<'_, D>,
639            offset: usize,
640            _depth: fidl::encoding::Depth,
641        ) -> fidl::Result<()> {
642            decoder.debug_check_bounds::<Self>(offset);
643            let prim = decoder.read_num::<u32>(offset);
644
645            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
646            Ok(())
647        }
648    }
649    unsafe impl fidl::encoding::TypeMarker for Error {
650        type Owned = Self;
651
652        #[inline(always)]
653        fn inline_align(_context: fidl::encoding::Context) -> usize {
654            std::mem::align_of::<u32>()
655        }
656
657        #[inline(always)]
658        fn inline_size(_context: fidl::encoding::Context) -> usize {
659            std::mem::size_of::<u32>()
660        }
661
662        #[inline(always)]
663        fn encode_is_copy() -> bool {
664            false
665        }
666
667        #[inline(always)]
668        fn decode_is_copy() -> bool {
669            false
670        }
671    }
672
673    impl fidl::encoding::ValueTypeMarker for Error {
674        type Borrowed<'a> = Self;
675        #[inline(always)]
676        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
677            *value
678        }
679    }
680
681    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Error {
682        #[inline]
683        unsafe fn encode(
684            self,
685            encoder: &mut fidl::encoding::Encoder<'_, D>,
686            offset: usize,
687            _depth: fidl::encoding::Depth,
688        ) -> fidl::Result<()> {
689            encoder.debug_check_bounds::<Self>(offset);
690            encoder.write_num(self.into_primitive(), offset);
691            Ok(())
692        }
693    }
694
695    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Error {
696        #[inline(always)]
697        fn new_empty() -> Self {
698            Self::unknown()
699        }
700
701        #[inline]
702        unsafe fn decode(
703            &mut self,
704            decoder: &mut fidl::encoding::Decoder<'_, D>,
705            offset: usize,
706            _depth: fidl::encoding::Depth,
707        ) -> fidl::Result<()> {
708            decoder.debug_check_bounds::<Self>(offset);
709            let prim = decoder.read_num::<u32>(offset);
710
711            *self = Self::from_primitive_allow_unknown(prim);
712            Ok(())
713        }
714    }
715    unsafe impl fidl::encoding::TypeMarker for EventType {
716        type Owned = Self;
717
718        #[inline(always)]
719        fn inline_align(_context: fidl::encoding::Context) -> usize {
720            std::mem::align_of::<u32>()
721        }
722
723        #[inline(always)]
724        fn inline_size(_context: fidl::encoding::Context) -> usize {
725            std::mem::size_of::<u32>()
726        }
727
728        #[inline(always)]
729        fn encode_is_copy() -> bool {
730            true
731        }
732
733        #[inline(always)]
734        fn decode_is_copy() -> bool {
735            false
736        }
737    }
738
739    impl fidl::encoding::ValueTypeMarker for EventType {
740        type Borrowed<'a> = Self;
741        #[inline(always)]
742        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
743            *value
744        }
745    }
746
747    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for EventType {
748        #[inline]
749        unsafe fn encode(
750            self,
751            encoder: &mut fidl::encoding::Encoder<'_, D>,
752            offset: usize,
753            _depth: fidl::encoding::Depth,
754        ) -> fidl::Result<()> {
755            encoder.debug_check_bounds::<Self>(offset);
756            encoder.write_num(self.into_primitive(), offset);
757            Ok(())
758        }
759    }
760
761    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EventType {
762        #[inline(always)]
763        fn new_empty() -> Self {
764            Self::CapabilityRequested
765        }
766
767        #[inline]
768        unsafe fn decode(
769            &mut self,
770            decoder: &mut fidl::encoding::Decoder<'_, D>,
771            offset: usize,
772            _depth: fidl::encoding::Depth,
773        ) -> fidl::Result<()> {
774            decoder.debug_check_bounds::<Self>(offset);
775            let prim = decoder.read_num::<u32>(offset);
776
777            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
778            Ok(())
779        }
780    }
781    unsafe impl fidl::encoding::TypeMarker for NamespaceError {
782        type Owned = Self;
783
784        #[inline(always)]
785        fn inline_align(_context: fidl::encoding::Context) -> usize {
786            std::mem::align_of::<u32>()
787        }
788
789        #[inline(always)]
790        fn inline_size(_context: fidl::encoding::Context) -> usize {
791            std::mem::size_of::<u32>()
792        }
793
794        #[inline(always)]
795        fn encode_is_copy() -> bool {
796            false
797        }
798
799        #[inline(always)]
800        fn decode_is_copy() -> bool {
801            false
802        }
803    }
804
805    impl fidl::encoding::ValueTypeMarker for NamespaceError {
806        type Borrowed<'a> = Self;
807        #[inline(always)]
808        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
809            *value
810        }
811    }
812
813    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for NamespaceError {
814        #[inline]
815        unsafe fn encode(
816            self,
817            encoder: &mut fidl::encoding::Encoder<'_, D>,
818            offset: usize,
819            _depth: fidl::encoding::Depth,
820        ) -> fidl::Result<()> {
821            encoder.debug_check_bounds::<Self>(offset);
822            encoder.write_num(self.into_primitive(), offset);
823            Ok(())
824        }
825    }
826
827    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NamespaceError {
828        #[inline(always)]
829        fn new_empty() -> Self {
830            Self::unknown()
831        }
832
833        #[inline]
834        unsafe fn decode(
835            &mut self,
836            decoder: &mut fidl::encoding::Decoder<'_, D>,
837            offset: usize,
838            _depth: fidl::encoding::Depth,
839        ) -> fidl::Result<()> {
840            decoder.debug_check_bounds::<Self>(offset);
841            let prim = decoder.read_num::<u32>(offset);
842
843            *self = Self::from_primitive_allow_unknown(prim);
844            Ok(())
845        }
846    }
847    unsafe impl fidl::encoding::TypeMarker for StatusError {
848        type Owned = Self;
849
850        #[inline(always)]
851        fn inline_align(_context: fidl::encoding::Context) -> usize {
852            std::mem::align_of::<u32>()
853        }
854
855        #[inline(always)]
856        fn inline_size(_context: fidl::encoding::Context) -> usize {
857            std::mem::size_of::<u32>()
858        }
859
860        #[inline(always)]
861        fn encode_is_copy() -> bool {
862            true
863        }
864
865        #[inline(always)]
866        fn decode_is_copy() -> bool {
867            false
868        }
869    }
870
871    impl fidl::encoding::ValueTypeMarker for StatusError {
872        type Borrowed<'a> = Self;
873        #[inline(always)]
874        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
875            *value
876        }
877    }
878
879    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for StatusError {
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::<Self>(offset);
888            encoder.write_num(self.into_primitive(), offset);
889            Ok(())
890        }
891    }
892
893    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StatusError {
894        #[inline(always)]
895        fn new_empty() -> Self {
896            Self::Provider
897        }
898
899        #[inline]
900        unsafe fn decode(
901            &mut self,
902            decoder: &mut fidl::encoding::Decoder<'_, D>,
903            offset: usize,
904            _depth: fidl::encoding::Depth,
905        ) -> fidl::Result<()> {
906            decoder.debug_check_bounds::<Self>(offset);
907            let prim = decoder.read_num::<u32>(offset);
908
909            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
910            Ok(())
911        }
912    }
913
914    impl fidl::encoding::ValueTypeMarker for ChildIteratorNextResponse {
915        type Borrowed<'a> = &'a Self;
916        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
917            value
918        }
919    }
920
921    unsafe impl fidl::encoding::TypeMarker for ChildIteratorNextResponse {
922        type Owned = Self;
923
924        #[inline(always)]
925        fn inline_align(_context: fidl::encoding::Context) -> usize {
926            8
927        }
928
929        #[inline(always)]
930        fn inline_size(_context: fidl::encoding::Context) -> usize {
931            16
932        }
933    }
934
935    unsafe impl<D: fidl::encoding::ResourceDialect>
936        fidl::encoding::Encode<ChildIteratorNextResponse, D> for &ChildIteratorNextResponse
937    {
938        #[inline]
939        unsafe fn encode(
940            self,
941            encoder: &mut fidl::encoding::Encoder<'_, D>,
942            offset: usize,
943            _depth: fidl::encoding::Depth,
944        ) -> fidl::Result<()> {
945            encoder.debug_check_bounds::<ChildIteratorNextResponse>(offset);
946            // Delegate to tuple encoding.
947            fidl::encoding::Encode::<ChildIteratorNextResponse, D>::encode(
948                (
949                    <fidl::encoding::Vector<fidl_fuchsia_component_decl__common::ChildRef, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.children),
950                ),
951                encoder, offset, _depth
952            )
953        }
954    }
955    unsafe impl<
956        D: fidl::encoding::ResourceDialect,
957        T0: fidl::encoding::Encode<
958                fidl::encoding::Vector<fidl_fuchsia_component_decl__common::ChildRef, 128>,
959                D,
960            >,
961    > fidl::encoding::Encode<ChildIteratorNextResponse, D> for (T0,)
962    {
963        #[inline]
964        unsafe fn encode(
965            self,
966            encoder: &mut fidl::encoding::Encoder<'_, D>,
967            offset: usize,
968            depth: fidl::encoding::Depth,
969        ) -> fidl::Result<()> {
970            encoder.debug_check_bounds::<ChildIteratorNextResponse>(offset);
971            // Zero out padding regions. There's no need to apply masks
972            // because the unmasked parts will be overwritten by fields.
973            // Write the fields.
974            self.0.encode(encoder, offset + 0, depth)?;
975            Ok(())
976        }
977    }
978
979    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
980        for ChildIteratorNextResponse
981    {
982        #[inline(always)]
983        fn new_empty() -> Self {
984            Self {
985                children: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_component_decl__common::ChildRef, 128>, D),
986            }
987        }
988
989        #[inline]
990        unsafe fn decode(
991            &mut self,
992            decoder: &mut fidl::encoding::Decoder<'_, D>,
993            offset: usize,
994            _depth: fidl::encoding::Depth,
995        ) -> fidl::Result<()> {
996            decoder.debug_check_bounds::<Self>(offset);
997            // Verify that padding bytes are zero.
998            fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_component_decl__common::ChildRef, 128>, D, &mut self.children, decoder, offset + 0, _depth)?;
999            Ok(())
1000        }
1001    }
1002
1003    impl fidl::encoding::ValueTypeMarker for ExecutionControllerOnStopRequest {
1004        type Borrowed<'a> = &'a Self;
1005        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1006            value
1007        }
1008    }
1009
1010    unsafe impl fidl::encoding::TypeMarker for ExecutionControllerOnStopRequest {
1011        type Owned = Self;
1012
1013        #[inline(always)]
1014        fn inline_align(_context: fidl::encoding::Context) -> usize {
1015            8
1016        }
1017
1018        #[inline(always)]
1019        fn inline_size(_context: fidl::encoding::Context) -> usize {
1020            16
1021        }
1022    }
1023
1024    unsafe impl<D: fidl::encoding::ResourceDialect>
1025        fidl::encoding::Encode<ExecutionControllerOnStopRequest, D>
1026        for &ExecutionControllerOnStopRequest
1027    {
1028        #[inline]
1029        unsafe fn encode(
1030            self,
1031            encoder: &mut fidl::encoding::Encoder<'_, D>,
1032            offset: usize,
1033            _depth: fidl::encoding::Depth,
1034        ) -> fidl::Result<()> {
1035            encoder.debug_check_bounds::<ExecutionControllerOnStopRequest>(offset);
1036            // Delegate to tuple encoding.
1037            fidl::encoding::Encode::<ExecutionControllerOnStopRequest, D>::encode(
1038                (<StoppedPayload as fidl::encoding::ValueTypeMarker>::borrow(
1039                    &self.stopped_payload,
1040                ),),
1041                encoder,
1042                offset,
1043                _depth,
1044            )
1045        }
1046    }
1047    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StoppedPayload, D>>
1048        fidl::encoding::Encode<ExecutionControllerOnStopRequest, D> for (T0,)
1049    {
1050        #[inline]
1051        unsafe fn encode(
1052            self,
1053            encoder: &mut fidl::encoding::Encoder<'_, D>,
1054            offset: usize,
1055            depth: fidl::encoding::Depth,
1056        ) -> fidl::Result<()> {
1057            encoder.debug_check_bounds::<ExecutionControllerOnStopRequest>(offset);
1058            // Zero out padding regions. There's no need to apply masks
1059            // because the unmasked parts will be overwritten by fields.
1060            // Write the fields.
1061            self.0.encode(encoder, offset + 0, depth)?;
1062            Ok(())
1063        }
1064    }
1065
1066    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1067        for ExecutionControllerOnStopRequest
1068    {
1069        #[inline(always)]
1070        fn new_empty() -> Self {
1071            Self { stopped_payload: fidl::new_empty!(StoppedPayload, D) }
1072        }
1073
1074        #[inline]
1075        unsafe fn decode(
1076            &mut self,
1077            decoder: &mut fidl::encoding::Decoder<'_, D>,
1078            offset: usize,
1079            _depth: fidl::encoding::Depth,
1080        ) -> fidl::Result<()> {
1081            decoder.debug_check_bounds::<Self>(offset);
1082            // Verify that padding bytes are zero.
1083            fidl::decode!(
1084                StoppedPayload,
1085                D,
1086                &mut self.stopped_payload,
1087                decoder,
1088                offset + 0,
1089                _depth
1090            )?;
1091            Ok(())
1092        }
1093    }
1094
1095    impl fidl::encoding::ValueTypeMarker for IntrospectorGetMonikerResponse {
1096        type Borrowed<'a> = &'a Self;
1097        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1098            value
1099        }
1100    }
1101
1102    unsafe impl fidl::encoding::TypeMarker for IntrospectorGetMonikerResponse {
1103        type Owned = Self;
1104
1105        #[inline(always)]
1106        fn inline_align(_context: fidl::encoding::Context) -> usize {
1107            8
1108        }
1109
1110        #[inline(always)]
1111        fn inline_size(_context: fidl::encoding::Context) -> usize {
1112            16
1113        }
1114    }
1115
1116    unsafe impl<D: fidl::encoding::ResourceDialect>
1117        fidl::encoding::Encode<IntrospectorGetMonikerResponse, D>
1118        for &IntrospectorGetMonikerResponse
1119    {
1120        #[inline]
1121        unsafe fn encode(
1122            self,
1123            encoder: &mut fidl::encoding::Encoder<'_, D>,
1124            offset: usize,
1125            _depth: fidl::encoding::Depth,
1126        ) -> fidl::Result<()> {
1127            encoder.debug_check_bounds::<IntrospectorGetMonikerResponse>(offset);
1128            // Delegate to tuple encoding.
1129            fidl::encoding::Encode::<IntrospectorGetMonikerResponse, D>::encode(
1130                (<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
1131                    &self.moniker,
1132                ),),
1133                encoder,
1134                offset,
1135                _depth,
1136            )
1137        }
1138    }
1139    unsafe impl<
1140        D: fidl::encoding::ResourceDialect,
1141        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
1142    > fidl::encoding::Encode<IntrospectorGetMonikerResponse, D> for (T0,)
1143    {
1144        #[inline]
1145        unsafe fn encode(
1146            self,
1147            encoder: &mut fidl::encoding::Encoder<'_, D>,
1148            offset: usize,
1149            depth: fidl::encoding::Depth,
1150        ) -> fidl::Result<()> {
1151            encoder.debug_check_bounds::<IntrospectorGetMonikerResponse>(offset);
1152            // Zero out padding regions. There's no need to apply masks
1153            // because the unmasked parts will be overwritten by fields.
1154            // Write the fields.
1155            self.0.encode(encoder, offset + 0, depth)?;
1156            Ok(())
1157        }
1158    }
1159
1160    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1161        for IntrospectorGetMonikerResponse
1162    {
1163        #[inline(always)]
1164        fn new_empty() -> Self {
1165            Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
1166        }
1167
1168        #[inline]
1169        unsafe fn decode(
1170            &mut self,
1171            decoder: &mut fidl::encoding::Decoder<'_, D>,
1172            offset: usize,
1173            _depth: fidl::encoding::Depth,
1174        ) -> fidl::Result<()> {
1175            decoder.debug_check_bounds::<Self>(offset);
1176            // Verify that padding bytes are zero.
1177            fidl::decode!(
1178                fidl::encoding::BoundedString<4096>,
1179                D,
1180                &mut self.moniker,
1181                decoder,
1182                offset + 0,
1183                _depth
1184            )?;
1185            Ok(())
1186        }
1187    }
1188
1189    impl fidl::encoding::ValueTypeMarker for RealmDestroyChildRequest {
1190        type Borrowed<'a> = &'a Self;
1191        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1192            value
1193        }
1194    }
1195
1196    unsafe impl fidl::encoding::TypeMarker for RealmDestroyChildRequest {
1197        type Owned = Self;
1198
1199        #[inline(always)]
1200        fn inline_align(_context: fidl::encoding::Context) -> usize {
1201            8
1202        }
1203
1204        #[inline(always)]
1205        fn inline_size(_context: fidl::encoding::Context) -> usize {
1206            32
1207        }
1208    }
1209
1210    unsafe impl<D: fidl::encoding::ResourceDialect>
1211        fidl::encoding::Encode<RealmDestroyChildRequest, D> for &RealmDestroyChildRequest
1212    {
1213        #[inline]
1214        unsafe fn encode(
1215            self,
1216            encoder: &mut fidl::encoding::Encoder<'_, D>,
1217            offset: usize,
1218            _depth: fidl::encoding::Depth,
1219        ) -> fidl::Result<()> {
1220            encoder.debug_check_bounds::<RealmDestroyChildRequest>(offset);
1221            // Delegate to tuple encoding.
1222            fidl::encoding::Encode::<RealmDestroyChildRequest, D>::encode(
1223                (
1224                    <fidl_fuchsia_component_decl__common::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
1225                ),
1226                encoder, offset, _depth
1227            )
1228        }
1229    }
1230    unsafe impl<
1231        D: fidl::encoding::ResourceDialect,
1232        T0: fidl::encoding::Encode<fidl_fuchsia_component_decl__common::ChildRef, D>,
1233    > fidl::encoding::Encode<RealmDestroyChildRequest, D> for (T0,)
1234    {
1235        #[inline]
1236        unsafe fn encode(
1237            self,
1238            encoder: &mut fidl::encoding::Encoder<'_, D>,
1239            offset: usize,
1240            depth: fidl::encoding::Depth,
1241        ) -> fidl::Result<()> {
1242            encoder.debug_check_bounds::<RealmDestroyChildRequest>(offset);
1243            // Zero out padding regions. There's no need to apply masks
1244            // because the unmasked parts will be overwritten by fields.
1245            // Write the fields.
1246            self.0.encode(encoder, offset + 0, depth)?;
1247            Ok(())
1248        }
1249    }
1250
1251    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1252        for RealmDestroyChildRequest
1253    {
1254        #[inline(always)]
1255        fn new_empty() -> Self {
1256            Self { child: fidl::new_empty!(fidl_fuchsia_component_decl__common::ChildRef, D) }
1257        }
1258
1259        #[inline]
1260        unsafe fn decode(
1261            &mut self,
1262            decoder: &mut fidl::encoding::Decoder<'_, D>,
1263            offset: usize,
1264            _depth: fidl::encoding::Depth,
1265        ) -> fidl::Result<()> {
1266            decoder.debug_check_bounds::<Self>(offset);
1267            // Verify that padding bytes are zero.
1268            fidl::decode!(
1269                fidl_fuchsia_component_decl__common::ChildRef,
1270                D,
1271                &mut self.child,
1272                decoder,
1273                offset + 0,
1274                _depth
1275            )?;
1276            Ok(())
1277        }
1278    }
1279
1280    impl fidl::encoding::ValueTypeMarker for StorageAdminDeleteComponentStorageRequest {
1281        type Borrowed<'a> = &'a Self;
1282        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1283            value
1284        }
1285    }
1286
1287    unsafe impl fidl::encoding::TypeMarker for StorageAdminDeleteComponentStorageRequest {
1288        type Owned = Self;
1289
1290        #[inline(always)]
1291        fn inline_align(_context: fidl::encoding::Context) -> usize {
1292            8
1293        }
1294
1295        #[inline(always)]
1296        fn inline_size(_context: fidl::encoding::Context) -> usize {
1297            16
1298        }
1299    }
1300
1301    unsafe impl<D: fidl::encoding::ResourceDialect>
1302        fidl::encoding::Encode<StorageAdminDeleteComponentStorageRequest, D>
1303        for &StorageAdminDeleteComponentStorageRequest
1304    {
1305        #[inline]
1306        unsafe fn encode(
1307            self,
1308            encoder: &mut fidl::encoding::Encoder<'_, D>,
1309            offset: usize,
1310            _depth: fidl::encoding::Depth,
1311        ) -> fidl::Result<()> {
1312            encoder.debug_check_bounds::<StorageAdminDeleteComponentStorageRequest>(offset);
1313            // Delegate to tuple encoding.
1314            fidl::encoding::Encode::<StorageAdminDeleteComponentStorageRequest, D>::encode(
1315                (<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
1316                    &self.relative_moniker,
1317                ),),
1318                encoder,
1319                offset,
1320                _depth,
1321            )
1322        }
1323    }
1324    unsafe impl<
1325        D: fidl::encoding::ResourceDialect,
1326        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
1327    > fidl::encoding::Encode<StorageAdminDeleteComponentStorageRequest, D> for (T0,)
1328    {
1329        #[inline]
1330        unsafe fn encode(
1331            self,
1332            encoder: &mut fidl::encoding::Encoder<'_, D>,
1333            offset: usize,
1334            depth: fidl::encoding::Depth,
1335        ) -> fidl::Result<()> {
1336            encoder.debug_check_bounds::<StorageAdminDeleteComponentStorageRequest>(offset);
1337            // Zero out padding regions. There's no need to apply masks
1338            // because the unmasked parts will be overwritten by fields.
1339            // Write the fields.
1340            self.0.encode(encoder, offset + 0, depth)?;
1341            Ok(())
1342        }
1343    }
1344
1345    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1346        for StorageAdminDeleteComponentStorageRequest
1347    {
1348        #[inline(always)]
1349        fn new_empty() -> Self {
1350            Self { relative_moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
1351        }
1352
1353        #[inline]
1354        unsafe fn decode(
1355            &mut self,
1356            decoder: &mut fidl::encoding::Decoder<'_, D>,
1357            offset: usize,
1358            _depth: fidl::encoding::Depth,
1359        ) -> fidl::Result<()> {
1360            decoder.debug_check_bounds::<Self>(offset);
1361            // Verify that padding bytes are zero.
1362            fidl::decode!(
1363                fidl::encoding::BoundedString<4096>,
1364                D,
1365                &mut self.relative_moniker,
1366                decoder,
1367                offset + 0,
1368                _depth
1369            )?;
1370            Ok(())
1371        }
1372    }
1373
1374    impl fidl::encoding::ValueTypeMarker for StorageIteratorNextResponse {
1375        type Borrowed<'a> = &'a Self;
1376        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1377            value
1378        }
1379    }
1380
1381    unsafe impl fidl::encoding::TypeMarker for StorageIteratorNextResponse {
1382        type Owned = Self;
1383
1384        #[inline(always)]
1385        fn inline_align(_context: fidl::encoding::Context) -> usize {
1386            8
1387        }
1388
1389        #[inline(always)]
1390        fn inline_size(_context: fidl::encoding::Context) -> usize {
1391            16
1392        }
1393    }
1394
1395    unsafe impl<D: fidl::encoding::ResourceDialect>
1396        fidl::encoding::Encode<StorageIteratorNextResponse, D> for &StorageIteratorNextResponse
1397    {
1398        #[inline]
1399        unsafe fn encode(
1400            self,
1401            encoder: &mut fidl::encoding::Encoder<'_, D>,
1402            offset: usize,
1403            _depth: fidl::encoding::Depth,
1404        ) -> fidl::Result<()> {
1405            encoder.debug_check_bounds::<StorageIteratorNextResponse>(offset);
1406            // Delegate to tuple encoding.
1407            fidl::encoding::Encode::<StorageIteratorNextResponse, D>::encode(
1408                (
1409                    <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_monikers),
1410                ),
1411                encoder, offset, _depth
1412            )
1413        }
1414    }
1415    unsafe impl<
1416        D: fidl::encoding::ResourceDialect,
1417        T0: fidl::encoding::Encode<
1418                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
1419                D,
1420            >,
1421    > fidl::encoding::Encode<StorageIteratorNextResponse, D> for (T0,)
1422    {
1423        #[inline]
1424        unsafe fn encode(
1425            self,
1426            encoder: &mut fidl::encoding::Encoder<'_, D>,
1427            offset: usize,
1428            depth: fidl::encoding::Depth,
1429        ) -> fidl::Result<()> {
1430            encoder.debug_check_bounds::<StorageIteratorNextResponse>(offset);
1431            // Zero out padding regions. There's no need to apply masks
1432            // because the unmasked parts will be overwritten by fields.
1433            // Write the fields.
1434            self.0.encode(encoder, offset + 0, depth)?;
1435            Ok(())
1436        }
1437    }
1438
1439    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1440        for StorageIteratorNextResponse
1441    {
1442        #[inline(always)]
1443        fn new_empty() -> Self {
1444            Self {
1445                relative_monikers: fidl::new_empty!(
1446                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
1447                    D
1448                ),
1449            }
1450        }
1451
1452        #[inline]
1453        unsafe fn decode(
1454            &mut self,
1455            decoder: &mut fidl::encoding::Decoder<'_, D>,
1456            offset: usize,
1457            _depth: fidl::encoding::Depth,
1458        ) -> fidl::Result<()> {
1459            decoder.debug_check_bounds::<Self>(offset);
1460            // Verify that padding bytes are zero.
1461            fidl::decode!(
1462                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
1463                D,
1464                &mut self.relative_monikers,
1465                decoder,
1466                offset + 0,
1467                _depth
1468            )?;
1469            Ok(())
1470        }
1471    }
1472
1473    impl DestroyedPayload {
1474        #[inline(always)]
1475        fn max_ordinal_present(&self) -> u64 {
1476            0
1477        }
1478    }
1479
1480    impl fidl::encoding::ValueTypeMarker for DestroyedPayload {
1481        type Borrowed<'a> = &'a Self;
1482        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1483            value
1484        }
1485    }
1486
1487    unsafe impl fidl::encoding::TypeMarker for DestroyedPayload {
1488        type Owned = Self;
1489
1490        #[inline(always)]
1491        fn inline_align(_context: fidl::encoding::Context) -> usize {
1492            8
1493        }
1494
1495        #[inline(always)]
1496        fn inline_size(_context: fidl::encoding::Context) -> usize {
1497            16
1498        }
1499    }
1500
1501    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DestroyedPayload, D>
1502        for &DestroyedPayload
1503    {
1504        unsafe fn encode(
1505            self,
1506            encoder: &mut fidl::encoding::Encoder<'_, D>,
1507            offset: usize,
1508            mut depth: fidl::encoding::Depth,
1509        ) -> fidl::Result<()> {
1510            encoder.debug_check_bounds::<DestroyedPayload>(offset);
1511            // Vector header
1512            let max_ordinal: u64 = self.max_ordinal_present();
1513            encoder.write_num(max_ordinal, offset);
1514            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1515            // Calling encoder.out_of_line_offset(0) is not allowed.
1516            if max_ordinal == 0 {
1517                return Ok(());
1518            }
1519            depth.increment()?;
1520            let envelope_size = 8;
1521            let bytes_len = max_ordinal as usize * envelope_size;
1522            #[allow(unused_variables)]
1523            let offset = encoder.out_of_line_offset(bytes_len);
1524            let mut _prev_end_offset: usize = 0;
1525
1526            Ok(())
1527        }
1528    }
1529
1530    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DestroyedPayload {
1531        #[inline(always)]
1532        fn new_empty() -> Self {
1533            Self::default()
1534        }
1535
1536        unsafe fn decode(
1537            &mut self,
1538            decoder: &mut fidl::encoding::Decoder<'_, D>,
1539            offset: usize,
1540            mut depth: fidl::encoding::Depth,
1541        ) -> fidl::Result<()> {
1542            decoder.debug_check_bounds::<Self>(offset);
1543            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1544                None => return Err(fidl::Error::NotNullable),
1545                Some(len) => len,
1546            };
1547            // Calling decoder.out_of_line_offset(0) is not allowed.
1548            if len == 0 {
1549                return Ok(());
1550            };
1551            depth.increment()?;
1552            let envelope_size = 8;
1553            let bytes_len = len * envelope_size;
1554            let offset = decoder.out_of_line_offset(bytes_len)?;
1555            // Decode the envelope for each type.
1556            let mut _next_ordinal_to_read = 0;
1557            let mut next_offset = offset;
1558            let end_offset = offset + bytes_len;
1559
1560            // Decode the remaining unknown envelopes.
1561            while next_offset < end_offset {
1562                _next_ordinal_to_read += 1;
1563                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1564                next_offset += envelope_size;
1565            }
1566
1567            Ok(())
1568        }
1569    }
1570
1571    impl DiscoveredPayload {
1572        #[inline(always)]
1573        fn max_ordinal_present(&self) -> u64 {
1574            0
1575        }
1576    }
1577
1578    impl fidl::encoding::ValueTypeMarker for DiscoveredPayload {
1579        type Borrowed<'a> = &'a Self;
1580        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1581            value
1582        }
1583    }
1584
1585    unsafe impl fidl::encoding::TypeMarker for DiscoveredPayload {
1586        type Owned = Self;
1587
1588        #[inline(always)]
1589        fn inline_align(_context: fidl::encoding::Context) -> usize {
1590            8
1591        }
1592
1593        #[inline(always)]
1594        fn inline_size(_context: fidl::encoding::Context) -> usize {
1595            16
1596        }
1597    }
1598
1599    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DiscoveredPayload, D>
1600        for &DiscoveredPayload
1601    {
1602        unsafe fn encode(
1603            self,
1604            encoder: &mut fidl::encoding::Encoder<'_, D>,
1605            offset: usize,
1606            mut depth: fidl::encoding::Depth,
1607        ) -> fidl::Result<()> {
1608            encoder.debug_check_bounds::<DiscoveredPayload>(offset);
1609            // Vector header
1610            let max_ordinal: u64 = self.max_ordinal_present();
1611            encoder.write_num(max_ordinal, offset);
1612            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1613            // Calling encoder.out_of_line_offset(0) is not allowed.
1614            if max_ordinal == 0 {
1615                return Ok(());
1616            }
1617            depth.increment()?;
1618            let envelope_size = 8;
1619            let bytes_len = max_ordinal as usize * envelope_size;
1620            #[allow(unused_variables)]
1621            let offset = encoder.out_of_line_offset(bytes_len);
1622            let mut _prev_end_offset: usize = 0;
1623
1624            Ok(())
1625        }
1626    }
1627
1628    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DiscoveredPayload {
1629        #[inline(always)]
1630        fn new_empty() -> Self {
1631            Self::default()
1632        }
1633
1634        unsafe fn decode(
1635            &mut self,
1636            decoder: &mut fidl::encoding::Decoder<'_, D>,
1637            offset: usize,
1638            mut depth: fidl::encoding::Depth,
1639        ) -> fidl::Result<()> {
1640            decoder.debug_check_bounds::<Self>(offset);
1641            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1642                None => return Err(fidl::Error::NotNullable),
1643                Some(len) => len,
1644            };
1645            // Calling decoder.out_of_line_offset(0) is not allowed.
1646            if len == 0 {
1647                return Ok(());
1648            };
1649            depth.increment()?;
1650            let envelope_size = 8;
1651            let bytes_len = len * envelope_size;
1652            let offset = decoder.out_of_line_offset(bytes_len)?;
1653            // Decode the envelope for each type.
1654            let mut _next_ordinal_to_read = 0;
1655            let mut next_offset = offset;
1656            let end_offset = offset + bytes_len;
1657
1658            // Decode the remaining unknown envelopes.
1659            while next_offset < end_offset {
1660                _next_ordinal_to_read += 1;
1661                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1662                next_offset += envelope_size;
1663            }
1664
1665            Ok(())
1666        }
1667    }
1668
1669    impl EventHeader {
1670        #[inline(always)]
1671        fn max_ordinal_present(&self) -> u64 {
1672            if let Some(_) = self.timestamp {
1673                return 4;
1674            }
1675            if let Some(_) = self.component_url {
1676                return 3;
1677            }
1678            if let Some(_) = self.moniker {
1679                return 2;
1680            }
1681            if let Some(_) = self.event_type {
1682                return 1;
1683            }
1684            0
1685        }
1686    }
1687
1688    impl fidl::encoding::ValueTypeMarker for EventHeader {
1689        type Borrowed<'a> = &'a Self;
1690        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1691            value
1692        }
1693    }
1694
1695    unsafe impl fidl::encoding::TypeMarker for EventHeader {
1696        type Owned = Self;
1697
1698        #[inline(always)]
1699        fn inline_align(_context: fidl::encoding::Context) -> usize {
1700            8
1701        }
1702
1703        #[inline(always)]
1704        fn inline_size(_context: fidl::encoding::Context) -> usize {
1705            16
1706        }
1707    }
1708
1709    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EventHeader, D>
1710        for &EventHeader
1711    {
1712        unsafe fn encode(
1713            self,
1714            encoder: &mut fidl::encoding::Encoder<'_, D>,
1715            offset: usize,
1716            mut depth: fidl::encoding::Depth,
1717        ) -> fidl::Result<()> {
1718            encoder.debug_check_bounds::<EventHeader>(offset);
1719            // Vector header
1720            let max_ordinal: u64 = self.max_ordinal_present();
1721            encoder.write_num(max_ordinal, offset);
1722            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1723            // Calling encoder.out_of_line_offset(0) is not allowed.
1724            if max_ordinal == 0 {
1725                return Ok(());
1726            }
1727            depth.increment()?;
1728            let envelope_size = 8;
1729            let bytes_len = max_ordinal as usize * envelope_size;
1730            #[allow(unused_variables)]
1731            let offset = encoder.out_of_line_offset(bytes_len);
1732            let mut _prev_end_offset: usize = 0;
1733            if 1 > max_ordinal {
1734                return Ok(());
1735            }
1736
1737            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1738            // are envelope_size bytes.
1739            let cur_offset: usize = (1 - 1) * envelope_size;
1740
1741            // Zero reserved fields.
1742            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1743
1744            // Safety:
1745            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1746            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1747            //   envelope_size bytes, there is always sufficient room.
1748            fidl::encoding::encode_in_envelope_optional::<EventType, D>(
1749                self.event_type
1750                    .as_ref()
1751                    .map(<EventType as fidl::encoding::ValueTypeMarker>::borrow),
1752                encoder,
1753                offset + cur_offset,
1754                depth,
1755            )?;
1756
1757            _prev_end_offset = cur_offset + envelope_size;
1758            if 2 > max_ordinal {
1759                return Ok(());
1760            }
1761
1762            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1763            // are envelope_size bytes.
1764            let cur_offset: usize = (2 - 1) * envelope_size;
1765
1766            // Zero reserved fields.
1767            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1768
1769            // Safety:
1770            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1771            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1772            //   envelope_size bytes, there is always sufficient room.
1773            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
1774            self.moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
1775            encoder, offset + cur_offset, depth
1776        )?;
1777
1778            _prev_end_offset = cur_offset + envelope_size;
1779            if 3 > max_ordinal {
1780                return Ok(());
1781            }
1782
1783            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1784            // are envelope_size bytes.
1785            let cur_offset: usize = (3 - 1) * envelope_size;
1786
1787            // Zero reserved fields.
1788            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1789
1790            // Safety:
1791            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1792            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1793            //   envelope_size bytes, there is always sufficient room.
1794            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
1795            self.component_url.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
1796            encoder, offset + cur_offset, depth
1797        )?;
1798
1799            _prev_end_offset = cur_offset + envelope_size;
1800            if 4 > max_ordinal {
1801                return Ok(());
1802            }
1803
1804            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1805            // are envelope_size bytes.
1806            let cur_offset: usize = (4 - 1) * envelope_size;
1807
1808            // Zero reserved fields.
1809            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1810
1811            // Safety:
1812            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1813            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1814            //   envelope_size bytes, there is always sufficient room.
1815            fidl::encoding::encode_in_envelope_optional::<fidl::BootInstant, D>(
1816                self.timestamp
1817                    .as_ref()
1818                    .map(<fidl::BootInstant as fidl::encoding::ValueTypeMarker>::borrow),
1819                encoder,
1820                offset + cur_offset,
1821                depth,
1822            )?;
1823
1824            _prev_end_offset = cur_offset + envelope_size;
1825
1826            Ok(())
1827        }
1828    }
1829
1830    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EventHeader {
1831        #[inline(always)]
1832        fn new_empty() -> Self {
1833            Self::default()
1834        }
1835
1836        unsafe fn decode(
1837            &mut self,
1838            decoder: &mut fidl::encoding::Decoder<'_, D>,
1839            offset: usize,
1840            mut depth: fidl::encoding::Depth,
1841        ) -> fidl::Result<()> {
1842            decoder.debug_check_bounds::<Self>(offset);
1843            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1844                None => return Err(fidl::Error::NotNullable),
1845                Some(len) => len,
1846            };
1847            // Calling decoder.out_of_line_offset(0) is not allowed.
1848            if len == 0 {
1849                return Ok(());
1850            };
1851            depth.increment()?;
1852            let envelope_size = 8;
1853            let bytes_len = len * envelope_size;
1854            let offset = decoder.out_of_line_offset(bytes_len)?;
1855            // Decode the envelope for each type.
1856            let mut _next_ordinal_to_read = 0;
1857            let mut next_offset = offset;
1858            let end_offset = offset + bytes_len;
1859            _next_ordinal_to_read += 1;
1860            if next_offset >= end_offset {
1861                return Ok(());
1862            }
1863
1864            // Decode unknown envelopes for gaps in ordinals.
1865            while _next_ordinal_to_read < 1 {
1866                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1867                _next_ordinal_to_read += 1;
1868                next_offset += envelope_size;
1869            }
1870
1871            let next_out_of_line = decoder.next_out_of_line();
1872            let handles_before = decoder.remaining_handles();
1873            if let Some((inlined, num_bytes, num_handles)) =
1874                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1875            {
1876                let member_inline_size =
1877                    <EventType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1878                if inlined != (member_inline_size <= 4) {
1879                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1880                }
1881                let inner_offset;
1882                let mut inner_depth = depth.clone();
1883                if inlined {
1884                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1885                    inner_offset = next_offset;
1886                } else {
1887                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1888                    inner_depth.increment()?;
1889                }
1890                let val_ref = self.event_type.get_or_insert_with(|| fidl::new_empty!(EventType, D));
1891                fidl::decode!(EventType, D, val_ref, decoder, inner_offset, inner_depth)?;
1892                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1893                {
1894                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1895                }
1896                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1897                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1898                }
1899            }
1900
1901            next_offset += envelope_size;
1902            _next_ordinal_to_read += 1;
1903            if next_offset >= end_offset {
1904                return Ok(());
1905            }
1906
1907            // Decode unknown envelopes for gaps in ordinals.
1908            while _next_ordinal_to_read < 2 {
1909                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1910                _next_ordinal_to_read += 1;
1911                next_offset += envelope_size;
1912            }
1913
1914            let next_out_of_line = decoder.next_out_of_line();
1915            let handles_before = decoder.remaining_handles();
1916            if let Some((inlined, num_bytes, num_handles)) =
1917                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1918            {
1919                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1920                if inlined != (member_inline_size <= 4) {
1921                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1922                }
1923                let inner_offset;
1924                let mut inner_depth = depth.clone();
1925                if inlined {
1926                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1927                    inner_offset = next_offset;
1928                } else {
1929                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1930                    inner_depth.increment()?;
1931                }
1932                let val_ref = self.moniker.get_or_insert_with(|| {
1933                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
1934                });
1935                fidl::decode!(
1936                    fidl::encoding::BoundedString<4096>,
1937                    D,
1938                    val_ref,
1939                    decoder,
1940                    inner_offset,
1941                    inner_depth
1942                )?;
1943                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1944                {
1945                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1946                }
1947                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1948                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1949                }
1950            }
1951
1952            next_offset += envelope_size;
1953            _next_ordinal_to_read += 1;
1954            if next_offset >= end_offset {
1955                return Ok(());
1956            }
1957
1958            // Decode unknown envelopes for gaps in ordinals.
1959            while _next_ordinal_to_read < 3 {
1960                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1961                _next_ordinal_to_read += 1;
1962                next_offset += envelope_size;
1963            }
1964
1965            let next_out_of_line = decoder.next_out_of_line();
1966            let handles_before = decoder.remaining_handles();
1967            if let Some((inlined, num_bytes, num_handles)) =
1968                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1969            {
1970                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1971                if inlined != (member_inline_size <= 4) {
1972                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1973                }
1974                let inner_offset;
1975                let mut inner_depth = depth.clone();
1976                if inlined {
1977                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1978                    inner_offset = next_offset;
1979                } else {
1980                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1981                    inner_depth.increment()?;
1982                }
1983                let val_ref = self.component_url.get_or_insert_with(|| {
1984                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
1985                });
1986                fidl::decode!(
1987                    fidl::encoding::BoundedString<4096>,
1988                    D,
1989                    val_ref,
1990                    decoder,
1991                    inner_offset,
1992                    inner_depth
1993                )?;
1994                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1995                {
1996                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1997                }
1998                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1999                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2000                }
2001            }
2002
2003            next_offset += envelope_size;
2004            _next_ordinal_to_read += 1;
2005            if next_offset >= end_offset {
2006                return Ok(());
2007            }
2008
2009            // Decode unknown envelopes for gaps in ordinals.
2010            while _next_ordinal_to_read < 4 {
2011                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2012                _next_ordinal_to_read += 1;
2013                next_offset += envelope_size;
2014            }
2015
2016            let next_out_of_line = decoder.next_out_of_line();
2017            let handles_before = decoder.remaining_handles();
2018            if let Some((inlined, num_bytes, num_handles)) =
2019                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2020            {
2021                let member_inline_size =
2022                    <fidl::BootInstant as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2023                if inlined != (member_inline_size <= 4) {
2024                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2025                }
2026                let inner_offset;
2027                let mut inner_depth = depth.clone();
2028                if inlined {
2029                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2030                    inner_offset = next_offset;
2031                } else {
2032                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2033                    inner_depth.increment()?;
2034                }
2035                let val_ref =
2036                    self.timestamp.get_or_insert_with(|| fidl::new_empty!(fidl::BootInstant, D));
2037                fidl::decode!(fidl::BootInstant, D, val_ref, decoder, inner_offset, inner_depth)?;
2038                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2039                {
2040                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2041                }
2042                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2043                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2044                }
2045            }
2046
2047            next_offset += envelope_size;
2048
2049            // Decode the remaining unknown envelopes.
2050            while next_offset < end_offset {
2051                _next_ordinal_to_read += 1;
2052                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2053                next_offset += envelope_size;
2054            }
2055
2056            Ok(())
2057        }
2058    }
2059
2060    impl PurgedPayload {
2061        #[inline(always)]
2062        fn max_ordinal_present(&self) -> u64 {
2063            0
2064        }
2065    }
2066
2067    impl fidl::encoding::ValueTypeMarker for PurgedPayload {
2068        type Borrowed<'a> = &'a Self;
2069        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2070            value
2071        }
2072    }
2073
2074    unsafe impl fidl::encoding::TypeMarker for PurgedPayload {
2075        type Owned = Self;
2076
2077        #[inline(always)]
2078        fn inline_align(_context: fidl::encoding::Context) -> usize {
2079            8
2080        }
2081
2082        #[inline(always)]
2083        fn inline_size(_context: fidl::encoding::Context) -> usize {
2084            16
2085        }
2086    }
2087
2088    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PurgedPayload, D>
2089        for &PurgedPayload
2090    {
2091        unsafe fn encode(
2092            self,
2093            encoder: &mut fidl::encoding::Encoder<'_, D>,
2094            offset: usize,
2095            mut depth: fidl::encoding::Depth,
2096        ) -> fidl::Result<()> {
2097            encoder.debug_check_bounds::<PurgedPayload>(offset);
2098            // Vector header
2099            let max_ordinal: u64 = self.max_ordinal_present();
2100            encoder.write_num(max_ordinal, offset);
2101            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2102            // Calling encoder.out_of_line_offset(0) is not allowed.
2103            if max_ordinal == 0 {
2104                return Ok(());
2105            }
2106            depth.increment()?;
2107            let envelope_size = 8;
2108            let bytes_len = max_ordinal as usize * envelope_size;
2109            #[allow(unused_variables)]
2110            let offset = encoder.out_of_line_offset(bytes_len);
2111            let mut _prev_end_offset: usize = 0;
2112
2113            Ok(())
2114        }
2115    }
2116
2117    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PurgedPayload {
2118        #[inline(always)]
2119        fn new_empty() -> Self {
2120            Self::default()
2121        }
2122
2123        unsafe fn decode(
2124            &mut self,
2125            decoder: &mut fidl::encoding::Decoder<'_, D>,
2126            offset: usize,
2127            mut depth: fidl::encoding::Depth,
2128        ) -> fidl::Result<()> {
2129            decoder.debug_check_bounds::<Self>(offset);
2130            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2131                None => return Err(fidl::Error::NotNullable),
2132                Some(len) => len,
2133            };
2134            // Calling decoder.out_of_line_offset(0) is not allowed.
2135            if len == 0 {
2136                return Ok(());
2137            };
2138            depth.increment()?;
2139            let envelope_size = 8;
2140            let bytes_len = len * envelope_size;
2141            let offset = decoder.out_of_line_offset(bytes_len)?;
2142            // Decode the envelope for each type.
2143            let mut _next_ordinal_to_read = 0;
2144            let mut next_offset = offset;
2145            let end_offset = offset + bytes_len;
2146
2147            // Decode the remaining unknown envelopes.
2148            while next_offset < end_offset {
2149                _next_ordinal_to_read += 1;
2150                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2151                next_offset += envelope_size;
2152            }
2153
2154            Ok(())
2155        }
2156    }
2157
2158    impl ResolvedPayload {
2159        #[inline(always)]
2160        fn max_ordinal_present(&self) -> u64 {
2161            0
2162        }
2163    }
2164
2165    impl fidl::encoding::ValueTypeMarker for ResolvedPayload {
2166        type Borrowed<'a> = &'a Self;
2167        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2168            value
2169        }
2170    }
2171
2172    unsafe impl fidl::encoding::TypeMarker for ResolvedPayload {
2173        type Owned = Self;
2174
2175        #[inline(always)]
2176        fn inline_align(_context: fidl::encoding::Context) -> usize {
2177            8
2178        }
2179
2180        #[inline(always)]
2181        fn inline_size(_context: fidl::encoding::Context) -> usize {
2182            16
2183        }
2184    }
2185
2186    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResolvedPayload, D>
2187        for &ResolvedPayload
2188    {
2189        unsafe fn encode(
2190            self,
2191            encoder: &mut fidl::encoding::Encoder<'_, D>,
2192            offset: usize,
2193            mut depth: fidl::encoding::Depth,
2194        ) -> fidl::Result<()> {
2195            encoder.debug_check_bounds::<ResolvedPayload>(offset);
2196            // Vector header
2197            let max_ordinal: u64 = self.max_ordinal_present();
2198            encoder.write_num(max_ordinal, offset);
2199            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2200            // Calling encoder.out_of_line_offset(0) is not allowed.
2201            if max_ordinal == 0 {
2202                return Ok(());
2203            }
2204            depth.increment()?;
2205            let envelope_size = 8;
2206            let bytes_len = max_ordinal as usize * envelope_size;
2207            #[allow(unused_variables)]
2208            let offset = encoder.out_of_line_offset(bytes_len);
2209            let mut _prev_end_offset: usize = 0;
2210
2211            Ok(())
2212        }
2213    }
2214
2215    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolvedPayload {
2216        #[inline(always)]
2217        fn new_empty() -> Self {
2218            Self::default()
2219        }
2220
2221        unsafe fn decode(
2222            &mut self,
2223            decoder: &mut fidl::encoding::Decoder<'_, D>,
2224            offset: usize,
2225            mut depth: fidl::encoding::Depth,
2226        ) -> fidl::Result<()> {
2227            decoder.debug_check_bounds::<Self>(offset);
2228            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2229                None => return Err(fidl::Error::NotNullable),
2230                Some(len) => len,
2231            };
2232            // Calling decoder.out_of_line_offset(0) is not allowed.
2233            if len == 0 {
2234                return Ok(());
2235            };
2236            depth.increment()?;
2237            let envelope_size = 8;
2238            let bytes_len = len * envelope_size;
2239            let offset = decoder.out_of_line_offset(bytes_len)?;
2240            // Decode the envelope for each type.
2241            let mut _next_ordinal_to_read = 0;
2242            let mut next_offset = offset;
2243            let end_offset = offset + bytes_len;
2244
2245            // Decode the remaining unknown envelopes.
2246            while next_offset < end_offset {
2247                _next_ordinal_to_read += 1;
2248                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2249                next_offset += envelope_size;
2250            }
2251
2252            Ok(())
2253        }
2254    }
2255
2256    impl StartedPayload {
2257        #[inline(always)]
2258        fn max_ordinal_present(&self) -> u64 {
2259            0
2260        }
2261    }
2262
2263    impl fidl::encoding::ValueTypeMarker for StartedPayload {
2264        type Borrowed<'a> = &'a Self;
2265        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2266            value
2267        }
2268    }
2269
2270    unsafe impl fidl::encoding::TypeMarker for StartedPayload {
2271        type Owned = Self;
2272
2273        #[inline(always)]
2274        fn inline_align(_context: fidl::encoding::Context) -> usize {
2275            8
2276        }
2277
2278        #[inline(always)]
2279        fn inline_size(_context: fidl::encoding::Context) -> usize {
2280            16
2281        }
2282    }
2283
2284    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StartedPayload, D>
2285        for &StartedPayload
2286    {
2287        unsafe fn encode(
2288            self,
2289            encoder: &mut fidl::encoding::Encoder<'_, D>,
2290            offset: usize,
2291            mut depth: fidl::encoding::Depth,
2292        ) -> fidl::Result<()> {
2293            encoder.debug_check_bounds::<StartedPayload>(offset);
2294            // Vector header
2295            let max_ordinal: u64 = self.max_ordinal_present();
2296            encoder.write_num(max_ordinal, offset);
2297            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2298            // Calling encoder.out_of_line_offset(0) is not allowed.
2299            if max_ordinal == 0 {
2300                return Ok(());
2301            }
2302            depth.increment()?;
2303            let envelope_size = 8;
2304            let bytes_len = max_ordinal as usize * envelope_size;
2305            #[allow(unused_variables)]
2306            let offset = encoder.out_of_line_offset(bytes_len);
2307            let mut _prev_end_offset: usize = 0;
2308
2309            Ok(())
2310        }
2311    }
2312
2313    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StartedPayload {
2314        #[inline(always)]
2315        fn new_empty() -> Self {
2316            Self::default()
2317        }
2318
2319        unsafe fn decode(
2320            &mut self,
2321            decoder: &mut fidl::encoding::Decoder<'_, D>,
2322            offset: usize,
2323            mut depth: fidl::encoding::Depth,
2324        ) -> fidl::Result<()> {
2325            decoder.debug_check_bounds::<Self>(offset);
2326            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2327                None => return Err(fidl::Error::NotNullable),
2328                Some(len) => len,
2329            };
2330            // Calling decoder.out_of_line_offset(0) is not allowed.
2331            if len == 0 {
2332                return Ok(());
2333            };
2334            depth.increment()?;
2335            let envelope_size = 8;
2336            let bytes_len = len * envelope_size;
2337            let offset = decoder.out_of_line_offset(bytes_len)?;
2338            // Decode the envelope for each type.
2339            let mut _next_ordinal_to_read = 0;
2340            let mut next_offset = offset;
2341            let end_offset = offset + bytes_len;
2342
2343            // Decode the remaining unknown envelopes.
2344            while next_offset < end_offset {
2345                _next_ordinal_to_read += 1;
2346                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2347                next_offset += envelope_size;
2348            }
2349
2350            Ok(())
2351        }
2352    }
2353
2354    impl StoppedPayload {
2355        #[inline(always)]
2356        fn max_ordinal_present(&self) -> u64 {
2357            if let Some(_) = self.exit_code {
2358                return 2;
2359            }
2360            if let Some(_) = self.status {
2361                return 1;
2362            }
2363            0
2364        }
2365    }
2366
2367    impl fidl::encoding::ValueTypeMarker for StoppedPayload {
2368        type Borrowed<'a> = &'a Self;
2369        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2370            value
2371        }
2372    }
2373
2374    unsafe impl fidl::encoding::TypeMarker for StoppedPayload {
2375        type Owned = Self;
2376
2377        #[inline(always)]
2378        fn inline_align(_context: fidl::encoding::Context) -> usize {
2379            8
2380        }
2381
2382        #[inline(always)]
2383        fn inline_size(_context: fidl::encoding::Context) -> usize {
2384            16
2385        }
2386    }
2387
2388    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StoppedPayload, D>
2389        for &StoppedPayload
2390    {
2391        unsafe fn encode(
2392            self,
2393            encoder: &mut fidl::encoding::Encoder<'_, D>,
2394            offset: usize,
2395            mut depth: fidl::encoding::Depth,
2396        ) -> fidl::Result<()> {
2397            encoder.debug_check_bounds::<StoppedPayload>(offset);
2398            // Vector header
2399            let max_ordinal: u64 = self.max_ordinal_present();
2400            encoder.write_num(max_ordinal, offset);
2401            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2402            // Calling encoder.out_of_line_offset(0) is not allowed.
2403            if max_ordinal == 0 {
2404                return Ok(());
2405            }
2406            depth.increment()?;
2407            let envelope_size = 8;
2408            let bytes_len = max_ordinal as usize * envelope_size;
2409            #[allow(unused_variables)]
2410            let offset = encoder.out_of_line_offset(bytes_len);
2411            let mut _prev_end_offset: usize = 0;
2412            if 1 > max_ordinal {
2413                return Ok(());
2414            }
2415
2416            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2417            // are envelope_size bytes.
2418            let cur_offset: usize = (1 - 1) * envelope_size;
2419
2420            // Zero reserved fields.
2421            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2422
2423            // Safety:
2424            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2425            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2426            //   envelope_size bytes, there is always sufficient room.
2427            fidl::encoding::encode_in_envelope_optional::<i32, D>(
2428                self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
2429                encoder,
2430                offset + cur_offset,
2431                depth,
2432            )?;
2433
2434            _prev_end_offset = cur_offset + envelope_size;
2435            if 2 > max_ordinal {
2436                return Ok(());
2437            }
2438
2439            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2440            // are envelope_size bytes.
2441            let cur_offset: usize = (2 - 1) * envelope_size;
2442
2443            // Zero reserved fields.
2444            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2445
2446            // Safety:
2447            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2448            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2449            //   envelope_size bytes, there is always sufficient room.
2450            fidl::encoding::encode_in_envelope_optional::<i64, D>(
2451                self.exit_code.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2452                encoder,
2453                offset + cur_offset,
2454                depth,
2455            )?;
2456
2457            _prev_end_offset = cur_offset + envelope_size;
2458
2459            Ok(())
2460        }
2461    }
2462
2463    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StoppedPayload {
2464        #[inline(always)]
2465        fn new_empty() -> Self {
2466            Self::default()
2467        }
2468
2469        unsafe fn decode(
2470            &mut self,
2471            decoder: &mut fidl::encoding::Decoder<'_, D>,
2472            offset: usize,
2473            mut depth: fidl::encoding::Depth,
2474        ) -> fidl::Result<()> {
2475            decoder.debug_check_bounds::<Self>(offset);
2476            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2477                None => return Err(fidl::Error::NotNullable),
2478                Some(len) => len,
2479            };
2480            // Calling decoder.out_of_line_offset(0) is not allowed.
2481            if len == 0 {
2482                return Ok(());
2483            };
2484            depth.increment()?;
2485            let envelope_size = 8;
2486            let bytes_len = len * envelope_size;
2487            let offset = decoder.out_of_line_offset(bytes_len)?;
2488            // Decode the envelope for each type.
2489            let mut _next_ordinal_to_read = 0;
2490            let mut next_offset = offset;
2491            let end_offset = offset + bytes_len;
2492            _next_ordinal_to_read += 1;
2493            if next_offset >= end_offset {
2494                return Ok(());
2495            }
2496
2497            // Decode unknown envelopes for gaps in ordinals.
2498            while _next_ordinal_to_read < 1 {
2499                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2500                _next_ordinal_to_read += 1;
2501                next_offset += envelope_size;
2502            }
2503
2504            let next_out_of_line = decoder.next_out_of_line();
2505            let handles_before = decoder.remaining_handles();
2506            if let Some((inlined, num_bytes, num_handles)) =
2507                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2508            {
2509                let member_inline_size =
2510                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2511                if inlined != (member_inline_size <= 4) {
2512                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2513                }
2514                let inner_offset;
2515                let mut inner_depth = depth.clone();
2516                if inlined {
2517                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2518                    inner_offset = next_offset;
2519                } else {
2520                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2521                    inner_depth.increment()?;
2522                }
2523                let val_ref = self.status.get_or_insert_with(|| fidl::new_empty!(i32, D));
2524                fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
2525                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2526                {
2527                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2528                }
2529                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2530                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2531                }
2532            }
2533
2534            next_offset += envelope_size;
2535            _next_ordinal_to_read += 1;
2536            if next_offset >= end_offset {
2537                return Ok(());
2538            }
2539
2540            // Decode unknown envelopes for gaps in ordinals.
2541            while _next_ordinal_to_read < 2 {
2542                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2543                _next_ordinal_to_read += 1;
2544                next_offset += envelope_size;
2545            }
2546
2547            let next_out_of_line = decoder.next_out_of_line();
2548            let handles_before = decoder.remaining_handles();
2549            if let Some((inlined, num_bytes, num_handles)) =
2550                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2551            {
2552                let member_inline_size =
2553                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2554                if inlined != (member_inline_size <= 4) {
2555                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2556                }
2557                let inner_offset;
2558                let mut inner_depth = depth.clone();
2559                if inlined {
2560                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2561                    inner_offset = next_offset;
2562                } else {
2563                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2564                    inner_depth.increment()?;
2565                }
2566                let val_ref = self.exit_code.get_or_insert_with(|| fidl::new_empty!(i64, D));
2567                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
2568                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2569                {
2570                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2571                }
2572                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2573                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2574                }
2575            }
2576
2577            next_offset += envelope_size;
2578
2579            // Decode the remaining unknown envelopes.
2580            while next_offset < end_offset {
2581                _next_ordinal_to_read += 1;
2582                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2583                next_offset += envelope_size;
2584            }
2585
2586            Ok(())
2587        }
2588    }
2589
2590    impl StorageStatus {
2591        #[inline(always)]
2592        fn max_ordinal_present(&self) -> u64 {
2593            if let Some(_) = self.used_size {
2594                return 2;
2595            }
2596            if let Some(_) = self.total_size {
2597                return 1;
2598            }
2599            0
2600        }
2601    }
2602
2603    impl fidl::encoding::ValueTypeMarker for StorageStatus {
2604        type Borrowed<'a> = &'a Self;
2605        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2606            value
2607        }
2608    }
2609
2610    unsafe impl fidl::encoding::TypeMarker for StorageStatus {
2611        type Owned = Self;
2612
2613        #[inline(always)]
2614        fn inline_align(_context: fidl::encoding::Context) -> usize {
2615            8
2616        }
2617
2618        #[inline(always)]
2619        fn inline_size(_context: fidl::encoding::Context) -> usize {
2620            16
2621        }
2622    }
2623
2624    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StorageStatus, D>
2625        for &StorageStatus
2626    {
2627        unsafe fn encode(
2628            self,
2629            encoder: &mut fidl::encoding::Encoder<'_, D>,
2630            offset: usize,
2631            mut depth: fidl::encoding::Depth,
2632        ) -> fidl::Result<()> {
2633            encoder.debug_check_bounds::<StorageStatus>(offset);
2634            // Vector header
2635            let max_ordinal: u64 = self.max_ordinal_present();
2636            encoder.write_num(max_ordinal, offset);
2637            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2638            // Calling encoder.out_of_line_offset(0) is not allowed.
2639            if max_ordinal == 0 {
2640                return Ok(());
2641            }
2642            depth.increment()?;
2643            let envelope_size = 8;
2644            let bytes_len = max_ordinal as usize * envelope_size;
2645            #[allow(unused_variables)]
2646            let offset = encoder.out_of_line_offset(bytes_len);
2647            let mut _prev_end_offset: usize = 0;
2648            if 1 > max_ordinal {
2649                return Ok(());
2650            }
2651
2652            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2653            // are envelope_size bytes.
2654            let cur_offset: usize = (1 - 1) * envelope_size;
2655
2656            // Zero reserved fields.
2657            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2658
2659            // Safety:
2660            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2661            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2662            //   envelope_size bytes, there is always sufficient room.
2663            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2664                self.total_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2665                encoder,
2666                offset + cur_offset,
2667                depth,
2668            )?;
2669
2670            _prev_end_offset = cur_offset + envelope_size;
2671            if 2 > max_ordinal {
2672                return Ok(());
2673            }
2674
2675            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2676            // are envelope_size bytes.
2677            let cur_offset: usize = (2 - 1) * envelope_size;
2678
2679            // Zero reserved fields.
2680            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2681
2682            // Safety:
2683            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2684            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2685            //   envelope_size bytes, there is always sufficient room.
2686            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2687                self.used_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2688                encoder,
2689                offset + cur_offset,
2690                depth,
2691            )?;
2692
2693            _prev_end_offset = cur_offset + envelope_size;
2694
2695            Ok(())
2696        }
2697    }
2698
2699    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StorageStatus {
2700        #[inline(always)]
2701        fn new_empty() -> Self {
2702            Self::default()
2703        }
2704
2705        unsafe fn decode(
2706            &mut self,
2707            decoder: &mut fidl::encoding::Decoder<'_, D>,
2708            offset: usize,
2709            mut depth: fidl::encoding::Depth,
2710        ) -> fidl::Result<()> {
2711            decoder.debug_check_bounds::<Self>(offset);
2712            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2713                None => return Err(fidl::Error::NotNullable),
2714                Some(len) => len,
2715            };
2716            // Calling decoder.out_of_line_offset(0) is not allowed.
2717            if len == 0 {
2718                return Ok(());
2719            };
2720            depth.increment()?;
2721            let envelope_size = 8;
2722            let bytes_len = len * envelope_size;
2723            let offset = decoder.out_of_line_offset(bytes_len)?;
2724            // Decode the envelope for each type.
2725            let mut _next_ordinal_to_read = 0;
2726            let mut next_offset = offset;
2727            let end_offset = offset + bytes_len;
2728            _next_ordinal_to_read += 1;
2729            if next_offset >= end_offset {
2730                return Ok(());
2731            }
2732
2733            // Decode unknown envelopes for gaps in ordinals.
2734            while _next_ordinal_to_read < 1 {
2735                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2736                _next_ordinal_to_read += 1;
2737                next_offset += envelope_size;
2738            }
2739
2740            let next_out_of_line = decoder.next_out_of_line();
2741            let handles_before = decoder.remaining_handles();
2742            if let Some((inlined, num_bytes, num_handles)) =
2743                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2744            {
2745                let member_inline_size =
2746                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2747                if inlined != (member_inline_size <= 4) {
2748                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2749                }
2750                let inner_offset;
2751                let mut inner_depth = depth.clone();
2752                if inlined {
2753                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2754                    inner_offset = next_offset;
2755                } else {
2756                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2757                    inner_depth.increment()?;
2758                }
2759                let val_ref = self.total_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
2760                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2761                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2762                {
2763                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2764                }
2765                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2766                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2767                }
2768            }
2769
2770            next_offset += envelope_size;
2771            _next_ordinal_to_read += 1;
2772            if next_offset >= end_offset {
2773                return Ok(());
2774            }
2775
2776            // Decode unknown envelopes for gaps in ordinals.
2777            while _next_ordinal_to_read < 2 {
2778                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2779                _next_ordinal_to_read += 1;
2780                next_offset += envelope_size;
2781            }
2782
2783            let next_out_of_line = decoder.next_out_of_line();
2784            let handles_before = decoder.remaining_handles();
2785            if let Some((inlined, num_bytes, num_handles)) =
2786                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2787            {
2788                let member_inline_size =
2789                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2790                if inlined != (member_inline_size <= 4) {
2791                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2792                }
2793                let inner_offset;
2794                let mut inner_depth = depth.clone();
2795                if inlined {
2796                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2797                    inner_offset = next_offset;
2798                } else {
2799                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2800                    inner_depth.increment()?;
2801                }
2802                let val_ref = self.used_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
2803                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2804                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2805                {
2806                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2807                }
2808                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2809                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2810                }
2811            }
2812
2813            next_offset += envelope_size;
2814
2815            // Decode the remaining unknown envelopes.
2816            while next_offset < end_offset {
2817                _next_ordinal_to_read += 1;
2818                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2819                next_offset += envelope_size;
2820            }
2821
2822            Ok(())
2823        }
2824    }
2825
2826    impl UnresolvedPayload {
2827        #[inline(always)]
2828        fn max_ordinal_present(&self) -> u64 {
2829            0
2830        }
2831    }
2832
2833    impl fidl::encoding::ValueTypeMarker for UnresolvedPayload {
2834        type Borrowed<'a> = &'a Self;
2835        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2836            value
2837        }
2838    }
2839
2840    unsafe impl fidl::encoding::TypeMarker for UnresolvedPayload {
2841        type Owned = Self;
2842
2843        #[inline(always)]
2844        fn inline_align(_context: fidl::encoding::Context) -> usize {
2845            8
2846        }
2847
2848        #[inline(always)]
2849        fn inline_size(_context: fidl::encoding::Context) -> usize {
2850            16
2851        }
2852    }
2853
2854    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UnresolvedPayload, D>
2855        for &UnresolvedPayload
2856    {
2857        unsafe fn encode(
2858            self,
2859            encoder: &mut fidl::encoding::Encoder<'_, D>,
2860            offset: usize,
2861            mut depth: fidl::encoding::Depth,
2862        ) -> fidl::Result<()> {
2863            encoder.debug_check_bounds::<UnresolvedPayload>(offset);
2864            // Vector header
2865            let max_ordinal: u64 = self.max_ordinal_present();
2866            encoder.write_num(max_ordinal, offset);
2867            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2868            // Calling encoder.out_of_line_offset(0) is not allowed.
2869            if max_ordinal == 0 {
2870                return Ok(());
2871            }
2872            depth.increment()?;
2873            let envelope_size = 8;
2874            let bytes_len = max_ordinal as usize * envelope_size;
2875            #[allow(unused_variables)]
2876            let offset = encoder.out_of_line_offset(bytes_len);
2877            let mut _prev_end_offset: usize = 0;
2878
2879            Ok(())
2880        }
2881    }
2882
2883    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UnresolvedPayload {
2884        #[inline(always)]
2885        fn new_empty() -> Self {
2886            Self::default()
2887        }
2888
2889        unsafe fn decode(
2890            &mut self,
2891            decoder: &mut fidl::encoding::Decoder<'_, D>,
2892            offset: usize,
2893            mut depth: fidl::encoding::Depth,
2894        ) -> fidl::Result<()> {
2895            decoder.debug_check_bounds::<Self>(offset);
2896            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2897                None => return Err(fidl::Error::NotNullable),
2898                Some(len) => len,
2899            };
2900            // Calling decoder.out_of_line_offset(0) is not allowed.
2901            if len == 0 {
2902                return Ok(());
2903            };
2904            depth.increment()?;
2905            let envelope_size = 8;
2906            let bytes_len = len * envelope_size;
2907            let offset = decoder.out_of_line_offset(bytes_len)?;
2908            // Decode the envelope for each type.
2909            let mut _next_ordinal_to_read = 0;
2910            let mut next_offset = offset;
2911            let end_offset = offset + bytes_len;
2912
2913            // Decode the remaining unknown envelopes.
2914            while next_offset < end_offset {
2915                _next_ordinal_to_read += 1;
2916                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2917                next_offset += envelope_size;
2918            }
2919
2920            Ok(())
2921        }
2922    }
2923}