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