fidl_fuchsia_component__common/
fidl_fuchsia_component__common.rs

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