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 GET_OUTPUT_DICTIONARY: u64 = 0x3a0c4696620ad221;
539    pub const DESTROY: u64 = 0x74529fa68b5c1741;
540}
541
542pub mod event_stream_ordinals {
543    pub const GET_NEXT: u64 = 0x3f24c9495978eb86;
544    pub const WAIT_FOR_READY: u64 = 0x31331f9578d2e682;
545}
546
547pub mod execution_controller_ordinals {
548    pub const STOP: u64 = 0x56d23cec21036117;
549    pub const ON_STOP: u64 = 0x62d5018e2174f57f;
550}
551
552pub mod introspector_ordinals {
553    pub const GET_MONIKER: u64 = 0x2f980ceb37bf458;
554}
555
556pub mod namespace_ordinals {
557    pub const CREATE: u64 = 0x4329fe12b2a790f9;
558    pub const CREATE2: u64 = 0x665aa4bb3773b351;
559}
560
561pub mod realm_ordinals {
562    pub const OPEN_CONTROLLER: u64 = 0x7150b7898d1b1180;
563    pub const OPEN_EXPOSED_DIR: u64 = 0x7f993235ca59f92c;
564    pub const CREATE_CHILD: u64 = 0x43e48ce8483d7560;
565    pub const DESTROY_CHILD: u64 = 0x71d8caf8850c9222;
566    pub const LIST_CHILDREN: u64 = 0x6888a76683efc0a1;
567    pub const GET_RESOLVED_INFO: u64 = 0x734f744cb7d210a2;
568    pub const GET_CHILD_OUTPUT_DICTIONARY_DEPRECATED: u64 = 0x39245b02aba94364;
569    pub const GET_CHILD_OUTPUT_DICTIONARY: u64 = 0x4259d08d261d5610;
570}
571
572pub mod storage_admin_ordinals {
573    pub const OPEN_STORAGE: u64 = 0x6ceaa5904cfe4377;
574    pub const LIST_STORAGE_IN_REALM: u64 = 0x764f6d1f083e8bfb;
575    pub const OPEN_COMPONENT_STORAGE_BY_ID: u64 = 0x4802102cc55d5df1;
576    pub const DELETE_COMPONENT_STORAGE: u64 = 0x1677c1cdfcdbf45a;
577    pub const GET_STATUS: u64 = 0x7729e325a6c526c8;
578    pub const DELETE_ALL_STORAGE_CONTENTS: u64 = 0x2ee980b4b2d24adb;
579}
580
581pub mod storage_iterator_ordinals {
582    pub const NEXT: u64 = 0x7a6b21f15fd01b72;
583}
584
585mod internal {
586    use super::*;
587    unsafe impl fidl::encoding::TypeMarker for DeletionError {
588        type Owned = Self;
589
590        #[inline(always)]
591        fn inline_align(_context: fidl::encoding::Context) -> usize {
592            std::mem::align_of::<u32>()
593        }
594
595        #[inline(always)]
596        fn inline_size(_context: fidl::encoding::Context) -> usize {
597            std::mem::size_of::<u32>()
598        }
599
600        #[inline(always)]
601        fn encode_is_copy() -> bool {
602            true
603        }
604
605        #[inline(always)]
606        fn decode_is_copy() -> bool {
607            false
608        }
609    }
610
611    impl fidl::encoding::ValueTypeMarker for DeletionError {
612        type Borrowed<'a> = Self;
613        #[inline(always)]
614        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
615            *value
616        }
617    }
618
619    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DeletionError {
620        #[inline]
621        unsafe fn encode(
622            self,
623            encoder: &mut fidl::encoding::Encoder<'_, D>,
624            offset: usize,
625            _depth: fidl::encoding::Depth,
626        ) -> fidl::Result<()> {
627            encoder.debug_check_bounds::<Self>(offset);
628            encoder.write_num(self.into_primitive(), offset);
629            Ok(())
630        }
631    }
632
633    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeletionError {
634        #[inline(always)]
635        fn new_empty() -> Self {
636            Self::Connection
637        }
638
639        #[inline]
640        unsafe fn decode(
641            &mut self,
642            decoder: &mut fidl::encoding::Decoder<'_, D>,
643            offset: usize,
644            _depth: fidl::encoding::Depth,
645        ) -> fidl::Result<()> {
646            decoder.debug_check_bounds::<Self>(offset);
647            let prim = decoder.read_num::<u32>(offset);
648
649            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
650            Ok(())
651        }
652    }
653    unsafe impl fidl::encoding::TypeMarker for Error {
654        type Owned = Self;
655
656        #[inline(always)]
657        fn inline_align(_context: fidl::encoding::Context) -> usize {
658            std::mem::align_of::<u32>()
659        }
660
661        #[inline(always)]
662        fn inline_size(_context: fidl::encoding::Context) -> usize {
663            std::mem::size_of::<u32>()
664        }
665
666        #[inline(always)]
667        fn encode_is_copy() -> bool {
668            false
669        }
670
671        #[inline(always)]
672        fn decode_is_copy() -> bool {
673            false
674        }
675    }
676
677    impl fidl::encoding::ValueTypeMarker for Error {
678        type Borrowed<'a> = Self;
679        #[inline(always)]
680        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
681            *value
682        }
683    }
684
685    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Error {
686        #[inline]
687        unsafe fn encode(
688            self,
689            encoder: &mut fidl::encoding::Encoder<'_, D>,
690            offset: usize,
691            _depth: fidl::encoding::Depth,
692        ) -> fidl::Result<()> {
693            encoder.debug_check_bounds::<Self>(offset);
694            encoder.write_num(self.into_primitive(), offset);
695            Ok(())
696        }
697    }
698
699    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Error {
700        #[inline(always)]
701        fn new_empty() -> Self {
702            Self::unknown()
703        }
704
705        #[inline]
706        unsafe fn decode(
707            &mut self,
708            decoder: &mut fidl::encoding::Decoder<'_, D>,
709            offset: usize,
710            _depth: fidl::encoding::Depth,
711        ) -> fidl::Result<()> {
712            decoder.debug_check_bounds::<Self>(offset);
713            let prim = decoder.read_num::<u32>(offset);
714
715            *self = Self::from_primitive_allow_unknown(prim);
716            Ok(())
717        }
718    }
719    unsafe impl fidl::encoding::TypeMarker for EventType {
720        type Owned = Self;
721
722        #[inline(always)]
723        fn inline_align(_context: fidl::encoding::Context) -> usize {
724            std::mem::align_of::<u32>()
725        }
726
727        #[inline(always)]
728        fn inline_size(_context: fidl::encoding::Context) -> usize {
729            std::mem::size_of::<u32>()
730        }
731
732        #[inline(always)]
733        fn encode_is_copy() -> bool {
734            true
735        }
736
737        #[inline(always)]
738        fn decode_is_copy() -> bool {
739            false
740        }
741    }
742
743    impl fidl::encoding::ValueTypeMarker for EventType {
744        type Borrowed<'a> = Self;
745        #[inline(always)]
746        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
747            *value
748        }
749    }
750
751    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for EventType {
752        #[inline]
753        unsafe fn encode(
754            self,
755            encoder: &mut fidl::encoding::Encoder<'_, D>,
756            offset: usize,
757            _depth: fidl::encoding::Depth,
758        ) -> fidl::Result<()> {
759            encoder.debug_check_bounds::<Self>(offset);
760            encoder.write_num(self.into_primitive(), offset);
761            Ok(())
762        }
763    }
764
765    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EventType {
766        #[inline(always)]
767        fn new_empty() -> Self {
768            Self::CapabilityRequested
769        }
770
771        #[inline]
772        unsafe fn decode(
773            &mut self,
774            decoder: &mut fidl::encoding::Decoder<'_, D>,
775            offset: usize,
776            _depth: fidl::encoding::Depth,
777        ) -> fidl::Result<()> {
778            decoder.debug_check_bounds::<Self>(offset);
779            let prim = decoder.read_num::<u32>(offset);
780
781            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
782            Ok(())
783        }
784    }
785    unsafe impl fidl::encoding::TypeMarker for NamespaceError {
786        type Owned = Self;
787
788        #[inline(always)]
789        fn inline_align(_context: fidl::encoding::Context) -> usize {
790            std::mem::align_of::<u32>()
791        }
792
793        #[inline(always)]
794        fn inline_size(_context: fidl::encoding::Context) -> usize {
795            std::mem::size_of::<u32>()
796        }
797
798        #[inline(always)]
799        fn encode_is_copy() -> bool {
800            false
801        }
802
803        #[inline(always)]
804        fn decode_is_copy() -> bool {
805            false
806        }
807    }
808
809    impl fidl::encoding::ValueTypeMarker for NamespaceError {
810        type Borrowed<'a> = Self;
811        #[inline(always)]
812        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
813            *value
814        }
815    }
816
817    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for NamespaceError {
818        #[inline]
819        unsafe fn encode(
820            self,
821            encoder: &mut fidl::encoding::Encoder<'_, D>,
822            offset: usize,
823            _depth: fidl::encoding::Depth,
824        ) -> fidl::Result<()> {
825            encoder.debug_check_bounds::<Self>(offset);
826            encoder.write_num(self.into_primitive(), offset);
827            Ok(())
828        }
829    }
830
831    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NamespaceError {
832        #[inline(always)]
833        fn new_empty() -> Self {
834            Self::unknown()
835        }
836
837        #[inline]
838        unsafe fn decode(
839            &mut self,
840            decoder: &mut fidl::encoding::Decoder<'_, D>,
841            offset: usize,
842            _depth: fidl::encoding::Depth,
843        ) -> fidl::Result<()> {
844            decoder.debug_check_bounds::<Self>(offset);
845            let prim = decoder.read_num::<u32>(offset);
846
847            *self = Self::from_primitive_allow_unknown(prim);
848            Ok(())
849        }
850    }
851    unsafe impl fidl::encoding::TypeMarker for StatusError {
852        type Owned = Self;
853
854        #[inline(always)]
855        fn inline_align(_context: fidl::encoding::Context) -> usize {
856            std::mem::align_of::<u32>()
857        }
858
859        #[inline(always)]
860        fn inline_size(_context: fidl::encoding::Context) -> usize {
861            std::mem::size_of::<u32>()
862        }
863
864        #[inline(always)]
865        fn encode_is_copy() -> bool {
866            true
867        }
868
869        #[inline(always)]
870        fn decode_is_copy() -> bool {
871            false
872        }
873    }
874
875    impl fidl::encoding::ValueTypeMarker for StatusError {
876        type Borrowed<'a> = Self;
877        #[inline(always)]
878        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
879            *value
880        }
881    }
882
883    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for StatusError {
884        #[inline]
885        unsafe fn encode(
886            self,
887            encoder: &mut fidl::encoding::Encoder<'_, D>,
888            offset: usize,
889            _depth: fidl::encoding::Depth,
890        ) -> fidl::Result<()> {
891            encoder.debug_check_bounds::<Self>(offset);
892            encoder.write_num(self.into_primitive(), offset);
893            Ok(())
894        }
895    }
896
897    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StatusError {
898        #[inline(always)]
899        fn new_empty() -> Self {
900            Self::Provider
901        }
902
903        #[inline]
904        unsafe fn decode(
905            &mut self,
906            decoder: &mut fidl::encoding::Decoder<'_, D>,
907            offset: usize,
908            _depth: fidl::encoding::Depth,
909        ) -> fidl::Result<()> {
910            decoder.debug_check_bounds::<Self>(offset);
911            let prim = decoder.read_num::<u32>(offset);
912
913            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
914            Ok(())
915        }
916    }
917
918    impl fidl::encoding::ValueTypeMarker for ChildIteratorNextResponse {
919        type Borrowed<'a> = &'a Self;
920        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
921            value
922        }
923    }
924
925    unsafe impl fidl::encoding::TypeMarker for ChildIteratorNextResponse {
926        type Owned = Self;
927
928        #[inline(always)]
929        fn inline_align(_context: fidl::encoding::Context) -> usize {
930            8
931        }
932
933        #[inline(always)]
934        fn inline_size(_context: fidl::encoding::Context) -> usize {
935            16
936        }
937    }
938
939    unsafe impl<D: fidl::encoding::ResourceDialect>
940        fidl::encoding::Encode<ChildIteratorNextResponse, D> for &ChildIteratorNextResponse
941    {
942        #[inline]
943        unsafe fn encode(
944            self,
945            encoder: &mut fidl::encoding::Encoder<'_, D>,
946            offset: usize,
947            _depth: fidl::encoding::Depth,
948        ) -> fidl::Result<()> {
949            encoder.debug_check_bounds::<ChildIteratorNextResponse>(offset);
950            // Delegate to tuple encoding.
951            fidl::encoding::Encode::<ChildIteratorNextResponse, D>::encode(
952                (
953                    <fidl::encoding::Vector<fidl_fuchsia_component_decl__common::ChildRef, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.children),
954                ),
955                encoder, offset, _depth
956            )
957        }
958    }
959    unsafe impl<
960        D: fidl::encoding::ResourceDialect,
961        T0: fidl::encoding::Encode<
962                fidl::encoding::Vector<fidl_fuchsia_component_decl__common::ChildRef, 128>,
963                D,
964            >,
965    > fidl::encoding::Encode<ChildIteratorNextResponse, D> for (T0,)
966    {
967        #[inline]
968        unsafe fn encode(
969            self,
970            encoder: &mut fidl::encoding::Encoder<'_, D>,
971            offset: usize,
972            depth: fidl::encoding::Depth,
973        ) -> fidl::Result<()> {
974            encoder.debug_check_bounds::<ChildIteratorNextResponse>(offset);
975            // Zero out padding regions. There's no need to apply masks
976            // because the unmasked parts will be overwritten by fields.
977            // Write the fields.
978            self.0.encode(encoder, offset + 0, depth)?;
979            Ok(())
980        }
981    }
982
983    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
984        for ChildIteratorNextResponse
985    {
986        #[inline(always)]
987        fn new_empty() -> Self {
988            Self {
989                children: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_component_decl__common::ChildRef, 128>, D),
990            }
991        }
992
993        #[inline]
994        unsafe fn decode(
995            &mut self,
996            decoder: &mut fidl::encoding::Decoder<'_, D>,
997            offset: usize,
998            _depth: fidl::encoding::Depth,
999        ) -> fidl::Result<()> {
1000            decoder.debug_check_bounds::<Self>(offset);
1001            // Verify that padding bytes are zero.
1002            fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_component_decl__common::ChildRef, 128>, D, &mut self.children, decoder, offset + 0, _depth)?;
1003            Ok(())
1004        }
1005    }
1006
1007    impl fidl::encoding::ValueTypeMarker for ExecutionControllerOnStopRequest {
1008        type Borrowed<'a> = &'a Self;
1009        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1010            value
1011        }
1012    }
1013
1014    unsafe impl fidl::encoding::TypeMarker for ExecutionControllerOnStopRequest {
1015        type Owned = Self;
1016
1017        #[inline(always)]
1018        fn inline_align(_context: fidl::encoding::Context) -> usize {
1019            8
1020        }
1021
1022        #[inline(always)]
1023        fn inline_size(_context: fidl::encoding::Context) -> usize {
1024            16
1025        }
1026    }
1027
1028    unsafe impl<D: fidl::encoding::ResourceDialect>
1029        fidl::encoding::Encode<ExecutionControllerOnStopRequest, D>
1030        for &ExecutionControllerOnStopRequest
1031    {
1032        #[inline]
1033        unsafe fn encode(
1034            self,
1035            encoder: &mut fidl::encoding::Encoder<'_, D>,
1036            offset: usize,
1037            _depth: fidl::encoding::Depth,
1038        ) -> fidl::Result<()> {
1039            encoder.debug_check_bounds::<ExecutionControllerOnStopRequest>(offset);
1040            // Delegate to tuple encoding.
1041            fidl::encoding::Encode::<ExecutionControllerOnStopRequest, D>::encode(
1042                (<StoppedPayload as fidl::encoding::ValueTypeMarker>::borrow(
1043                    &self.stopped_payload,
1044                ),),
1045                encoder,
1046                offset,
1047                _depth,
1048            )
1049        }
1050    }
1051    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StoppedPayload, D>>
1052        fidl::encoding::Encode<ExecutionControllerOnStopRequest, D> for (T0,)
1053    {
1054        #[inline]
1055        unsafe fn encode(
1056            self,
1057            encoder: &mut fidl::encoding::Encoder<'_, D>,
1058            offset: usize,
1059            depth: fidl::encoding::Depth,
1060        ) -> fidl::Result<()> {
1061            encoder.debug_check_bounds::<ExecutionControllerOnStopRequest>(offset);
1062            // Zero out padding regions. There's no need to apply masks
1063            // because the unmasked parts will be overwritten by fields.
1064            // Write the fields.
1065            self.0.encode(encoder, offset + 0, depth)?;
1066            Ok(())
1067        }
1068    }
1069
1070    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1071        for ExecutionControllerOnStopRequest
1072    {
1073        #[inline(always)]
1074        fn new_empty() -> Self {
1075            Self { stopped_payload: fidl::new_empty!(StoppedPayload, D) }
1076        }
1077
1078        #[inline]
1079        unsafe fn decode(
1080            &mut self,
1081            decoder: &mut fidl::encoding::Decoder<'_, D>,
1082            offset: usize,
1083            _depth: fidl::encoding::Depth,
1084        ) -> fidl::Result<()> {
1085            decoder.debug_check_bounds::<Self>(offset);
1086            // Verify that padding bytes are zero.
1087            fidl::decode!(
1088                StoppedPayload,
1089                D,
1090                &mut self.stopped_payload,
1091                decoder,
1092                offset + 0,
1093                _depth
1094            )?;
1095            Ok(())
1096        }
1097    }
1098
1099    impl fidl::encoding::ValueTypeMarker for IntrospectorGetMonikerResponse {
1100        type Borrowed<'a> = &'a Self;
1101        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1102            value
1103        }
1104    }
1105
1106    unsafe impl fidl::encoding::TypeMarker for IntrospectorGetMonikerResponse {
1107        type Owned = Self;
1108
1109        #[inline(always)]
1110        fn inline_align(_context: fidl::encoding::Context) -> usize {
1111            8
1112        }
1113
1114        #[inline(always)]
1115        fn inline_size(_context: fidl::encoding::Context) -> usize {
1116            16
1117        }
1118    }
1119
1120    unsafe impl<D: fidl::encoding::ResourceDialect>
1121        fidl::encoding::Encode<IntrospectorGetMonikerResponse, D>
1122        for &IntrospectorGetMonikerResponse
1123    {
1124        #[inline]
1125        unsafe fn encode(
1126            self,
1127            encoder: &mut fidl::encoding::Encoder<'_, D>,
1128            offset: usize,
1129            _depth: fidl::encoding::Depth,
1130        ) -> fidl::Result<()> {
1131            encoder.debug_check_bounds::<IntrospectorGetMonikerResponse>(offset);
1132            // Delegate to tuple encoding.
1133            fidl::encoding::Encode::<IntrospectorGetMonikerResponse, D>::encode(
1134                (<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
1135                    &self.moniker,
1136                ),),
1137                encoder,
1138                offset,
1139                _depth,
1140            )
1141        }
1142    }
1143    unsafe impl<
1144        D: fidl::encoding::ResourceDialect,
1145        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
1146    > fidl::encoding::Encode<IntrospectorGetMonikerResponse, D> for (T0,)
1147    {
1148        #[inline]
1149        unsafe fn encode(
1150            self,
1151            encoder: &mut fidl::encoding::Encoder<'_, D>,
1152            offset: usize,
1153            depth: fidl::encoding::Depth,
1154        ) -> fidl::Result<()> {
1155            encoder.debug_check_bounds::<IntrospectorGetMonikerResponse>(offset);
1156            // Zero out padding regions. There's no need to apply masks
1157            // because the unmasked parts will be overwritten by fields.
1158            // Write the fields.
1159            self.0.encode(encoder, offset + 0, depth)?;
1160            Ok(())
1161        }
1162    }
1163
1164    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1165        for IntrospectorGetMonikerResponse
1166    {
1167        #[inline(always)]
1168        fn new_empty() -> Self {
1169            Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
1170        }
1171
1172        #[inline]
1173        unsafe fn decode(
1174            &mut self,
1175            decoder: &mut fidl::encoding::Decoder<'_, D>,
1176            offset: usize,
1177            _depth: fidl::encoding::Depth,
1178        ) -> fidl::Result<()> {
1179            decoder.debug_check_bounds::<Self>(offset);
1180            // Verify that padding bytes are zero.
1181            fidl::decode!(
1182                fidl::encoding::BoundedString<4096>,
1183                D,
1184                &mut self.moniker,
1185                decoder,
1186                offset + 0,
1187                _depth
1188            )?;
1189            Ok(())
1190        }
1191    }
1192
1193    impl fidl::encoding::ValueTypeMarker for RealmDestroyChildRequest {
1194        type Borrowed<'a> = &'a Self;
1195        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1196            value
1197        }
1198    }
1199
1200    unsafe impl fidl::encoding::TypeMarker for RealmDestroyChildRequest {
1201        type Owned = Self;
1202
1203        #[inline(always)]
1204        fn inline_align(_context: fidl::encoding::Context) -> usize {
1205            8
1206        }
1207
1208        #[inline(always)]
1209        fn inline_size(_context: fidl::encoding::Context) -> usize {
1210            32
1211        }
1212    }
1213
1214    unsafe impl<D: fidl::encoding::ResourceDialect>
1215        fidl::encoding::Encode<RealmDestroyChildRequest, D> for &RealmDestroyChildRequest
1216    {
1217        #[inline]
1218        unsafe fn encode(
1219            self,
1220            encoder: &mut fidl::encoding::Encoder<'_, D>,
1221            offset: usize,
1222            _depth: fidl::encoding::Depth,
1223        ) -> fidl::Result<()> {
1224            encoder.debug_check_bounds::<RealmDestroyChildRequest>(offset);
1225            // Delegate to tuple encoding.
1226            fidl::encoding::Encode::<RealmDestroyChildRequest, D>::encode(
1227                (
1228                    <fidl_fuchsia_component_decl__common::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
1229                ),
1230                encoder, offset, _depth
1231            )
1232        }
1233    }
1234    unsafe impl<
1235        D: fidl::encoding::ResourceDialect,
1236        T0: fidl::encoding::Encode<fidl_fuchsia_component_decl__common::ChildRef, D>,
1237    > fidl::encoding::Encode<RealmDestroyChildRequest, D> for (T0,)
1238    {
1239        #[inline]
1240        unsafe fn encode(
1241            self,
1242            encoder: &mut fidl::encoding::Encoder<'_, D>,
1243            offset: usize,
1244            depth: fidl::encoding::Depth,
1245        ) -> fidl::Result<()> {
1246            encoder.debug_check_bounds::<RealmDestroyChildRequest>(offset);
1247            // Zero out padding regions. There's no need to apply masks
1248            // because the unmasked parts will be overwritten by fields.
1249            // Write the fields.
1250            self.0.encode(encoder, offset + 0, depth)?;
1251            Ok(())
1252        }
1253    }
1254
1255    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1256        for RealmDestroyChildRequest
1257    {
1258        #[inline(always)]
1259        fn new_empty() -> Self {
1260            Self { child: fidl::new_empty!(fidl_fuchsia_component_decl__common::ChildRef, D) }
1261        }
1262
1263        #[inline]
1264        unsafe fn decode(
1265            &mut self,
1266            decoder: &mut fidl::encoding::Decoder<'_, D>,
1267            offset: usize,
1268            _depth: fidl::encoding::Depth,
1269        ) -> fidl::Result<()> {
1270            decoder.debug_check_bounds::<Self>(offset);
1271            // Verify that padding bytes are zero.
1272            fidl::decode!(
1273                fidl_fuchsia_component_decl__common::ChildRef,
1274                D,
1275                &mut self.child,
1276                decoder,
1277                offset + 0,
1278                _depth
1279            )?;
1280            Ok(())
1281        }
1282    }
1283
1284    impl fidl::encoding::ValueTypeMarker for StorageAdminDeleteComponentStorageRequest {
1285        type Borrowed<'a> = &'a Self;
1286        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1287            value
1288        }
1289    }
1290
1291    unsafe impl fidl::encoding::TypeMarker for StorageAdminDeleteComponentStorageRequest {
1292        type Owned = Self;
1293
1294        #[inline(always)]
1295        fn inline_align(_context: fidl::encoding::Context) -> usize {
1296            8
1297        }
1298
1299        #[inline(always)]
1300        fn inline_size(_context: fidl::encoding::Context) -> usize {
1301            16
1302        }
1303    }
1304
1305    unsafe impl<D: fidl::encoding::ResourceDialect>
1306        fidl::encoding::Encode<StorageAdminDeleteComponentStorageRequest, D>
1307        for &StorageAdminDeleteComponentStorageRequest
1308    {
1309        #[inline]
1310        unsafe fn encode(
1311            self,
1312            encoder: &mut fidl::encoding::Encoder<'_, D>,
1313            offset: usize,
1314            _depth: fidl::encoding::Depth,
1315        ) -> fidl::Result<()> {
1316            encoder.debug_check_bounds::<StorageAdminDeleteComponentStorageRequest>(offset);
1317            // Delegate to tuple encoding.
1318            fidl::encoding::Encode::<StorageAdminDeleteComponentStorageRequest, D>::encode(
1319                (<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
1320                    &self.relative_moniker,
1321                ),),
1322                encoder,
1323                offset,
1324                _depth,
1325            )
1326        }
1327    }
1328    unsafe impl<
1329        D: fidl::encoding::ResourceDialect,
1330        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
1331    > fidl::encoding::Encode<StorageAdminDeleteComponentStorageRequest, D> for (T0,)
1332    {
1333        #[inline]
1334        unsafe fn encode(
1335            self,
1336            encoder: &mut fidl::encoding::Encoder<'_, D>,
1337            offset: usize,
1338            depth: fidl::encoding::Depth,
1339        ) -> fidl::Result<()> {
1340            encoder.debug_check_bounds::<StorageAdminDeleteComponentStorageRequest>(offset);
1341            // Zero out padding regions. There's no need to apply masks
1342            // because the unmasked parts will be overwritten by fields.
1343            // Write the fields.
1344            self.0.encode(encoder, offset + 0, depth)?;
1345            Ok(())
1346        }
1347    }
1348
1349    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1350        for StorageAdminDeleteComponentStorageRequest
1351    {
1352        #[inline(always)]
1353        fn new_empty() -> Self {
1354            Self { relative_moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
1355        }
1356
1357        #[inline]
1358        unsafe fn decode(
1359            &mut self,
1360            decoder: &mut fidl::encoding::Decoder<'_, D>,
1361            offset: usize,
1362            _depth: fidl::encoding::Depth,
1363        ) -> fidl::Result<()> {
1364            decoder.debug_check_bounds::<Self>(offset);
1365            // Verify that padding bytes are zero.
1366            fidl::decode!(
1367                fidl::encoding::BoundedString<4096>,
1368                D,
1369                &mut self.relative_moniker,
1370                decoder,
1371                offset + 0,
1372                _depth
1373            )?;
1374            Ok(())
1375        }
1376    }
1377
1378    impl fidl::encoding::ValueTypeMarker for StorageIteratorNextResponse {
1379        type Borrowed<'a> = &'a Self;
1380        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1381            value
1382        }
1383    }
1384
1385    unsafe impl fidl::encoding::TypeMarker for StorageIteratorNextResponse {
1386        type Owned = Self;
1387
1388        #[inline(always)]
1389        fn inline_align(_context: fidl::encoding::Context) -> usize {
1390            8
1391        }
1392
1393        #[inline(always)]
1394        fn inline_size(_context: fidl::encoding::Context) -> usize {
1395            16
1396        }
1397    }
1398
1399    unsafe impl<D: fidl::encoding::ResourceDialect>
1400        fidl::encoding::Encode<StorageIteratorNextResponse, D> for &StorageIteratorNextResponse
1401    {
1402        #[inline]
1403        unsafe fn encode(
1404            self,
1405            encoder: &mut fidl::encoding::Encoder<'_, D>,
1406            offset: usize,
1407            _depth: fidl::encoding::Depth,
1408        ) -> fidl::Result<()> {
1409            encoder.debug_check_bounds::<StorageIteratorNextResponse>(offset);
1410            // Delegate to tuple encoding.
1411            fidl::encoding::Encode::<StorageIteratorNextResponse, D>::encode(
1412                (
1413                    <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_monikers),
1414                ),
1415                encoder, offset, _depth
1416            )
1417        }
1418    }
1419    unsafe impl<
1420        D: fidl::encoding::ResourceDialect,
1421        T0: fidl::encoding::Encode<
1422                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
1423                D,
1424            >,
1425    > fidl::encoding::Encode<StorageIteratorNextResponse, D> for (T0,)
1426    {
1427        #[inline]
1428        unsafe fn encode(
1429            self,
1430            encoder: &mut fidl::encoding::Encoder<'_, D>,
1431            offset: usize,
1432            depth: fidl::encoding::Depth,
1433        ) -> fidl::Result<()> {
1434            encoder.debug_check_bounds::<StorageIteratorNextResponse>(offset);
1435            // Zero out padding regions. There's no need to apply masks
1436            // because the unmasked parts will be overwritten by fields.
1437            // Write the fields.
1438            self.0.encode(encoder, offset + 0, depth)?;
1439            Ok(())
1440        }
1441    }
1442
1443    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1444        for StorageIteratorNextResponse
1445    {
1446        #[inline(always)]
1447        fn new_empty() -> Self {
1448            Self {
1449                relative_monikers: fidl::new_empty!(
1450                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
1451                    D
1452                ),
1453            }
1454        }
1455
1456        #[inline]
1457        unsafe fn decode(
1458            &mut self,
1459            decoder: &mut fidl::encoding::Decoder<'_, D>,
1460            offset: usize,
1461            _depth: fidl::encoding::Depth,
1462        ) -> fidl::Result<()> {
1463            decoder.debug_check_bounds::<Self>(offset);
1464            // Verify that padding bytes are zero.
1465            fidl::decode!(
1466                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
1467                D,
1468                &mut self.relative_monikers,
1469                decoder,
1470                offset + 0,
1471                _depth
1472            )?;
1473            Ok(())
1474        }
1475    }
1476
1477    impl DestroyedPayload {
1478        #[inline(always)]
1479        fn max_ordinal_present(&self) -> u64 {
1480            0
1481        }
1482    }
1483
1484    impl fidl::encoding::ValueTypeMarker for DestroyedPayload {
1485        type Borrowed<'a> = &'a Self;
1486        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1487            value
1488        }
1489    }
1490
1491    unsafe impl fidl::encoding::TypeMarker for DestroyedPayload {
1492        type Owned = Self;
1493
1494        #[inline(always)]
1495        fn inline_align(_context: fidl::encoding::Context) -> usize {
1496            8
1497        }
1498
1499        #[inline(always)]
1500        fn inline_size(_context: fidl::encoding::Context) -> usize {
1501            16
1502        }
1503    }
1504
1505    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DestroyedPayload, D>
1506        for &DestroyedPayload
1507    {
1508        unsafe fn encode(
1509            self,
1510            encoder: &mut fidl::encoding::Encoder<'_, D>,
1511            offset: usize,
1512            mut depth: fidl::encoding::Depth,
1513        ) -> fidl::Result<()> {
1514            encoder.debug_check_bounds::<DestroyedPayload>(offset);
1515            // Vector header
1516            let max_ordinal: u64 = self.max_ordinal_present();
1517            encoder.write_num(max_ordinal, offset);
1518            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1519            // Calling encoder.out_of_line_offset(0) is not allowed.
1520            if max_ordinal == 0 {
1521                return Ok(());
1522            }
1523            depth.increment()?;
1524            let envelope_size = 8;
1525            let bytes_len = max_ordinal as usize * envelope_size;
1526            #[allow(unused_variables)]
1527            let offset = encoder.out_of_line_offset(bytes_len);
1528            let mut _prev_end_offset: usize = 0;
1529
1530            Ok(())
1531        }
1532    }
1533
1534    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DestroyedPayload {
1535        #[inline(always)]
1536        fn new_empty() -> Self {
1537            Self::default()
1538        }
1539
1540        unsafe fn decode(
1541            &mut self,
1542            decoder: &mut fidl::encoding::Decoder<'_, D>,
1543            offset: usize,
1544            mut depth: fidl::encoding::Depth,
1545        ) -> fidl::Result<()> {
1546            decoder.debug_check_bounds::<Self>(offset);
1547            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1548                None => return Err(fidl::Error::NotNullable),
1549                Some(len) => len,
1550            };
1551            // Calling decoder.out_of_line_offset(0) is not allowed.
1552            if len == 0 {
1553                return Ok(());
1554            };
1555            depth.increment()?;
1556            let envelope_size = 8;
1557            let bytes_len = len * envelope_size;
1558            let offset = decoder.out_of_line_offset(bytes_len)?;
1559            // Decode the envelope for each type.
1560            let mut _next_ordinal_to_read = 0;
1561            let mut next_offset = offset;
1562            let end_offset = offset + bytes_len;
1563
1564            // Decode the remaining unknown envelopes.
1565            while next_offset < end_offset {
1566                _next_ordinal_to_read += 1;
1567                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1568                next_offset += envelope_size;
1569            }
1570
1571            Ok(())
1572        }
1573    }
1574
1575    impl DiscoveredPayload {
1576        #[inline(always)]
1577        fn max_ordinal_present(&self) -> u64 {
1578            0
1579        }
1580    }
1581
1582    impl fidl::encoding::ValueTypeMarker for DiscoveredPayload {
1583        type Borrowed<'a> = &'a Self;
1584        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1585            value
1586        }
1587    }
1588
1589    unsafe impl fidl::encoding::TypeMarker for DiscoveredPayload {
1590        type Owned = Self;
1591
1592        #[inline(always)]
1593        fn inline_align(_context: fidl::encoding::Context) -> usize {
1594            8
1595        }
1596
1597        #[inline(always)]
1598        fn inline_size(_context: fidl::encoding::Context) -> usize {
1599            16
1600        }
1601    }
1602
1603    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DiscoveredPayload, D>
1604        for &DiscoveredPayload
1605    {
1606        unsafe fn encode(
1607            self,
1608            encoder: &mut fidl::encoding::Encoder<'_, D>,
1609            offset: usize,
1610            mut depth: fidl::encoding::Depth,
1611        ) -> fidl::Result<()> {
1612            encoder.debug_check_bounds::<DiscoveredPayload>(offset);
1613            // Vector header
1614            let max_ordinal: u64 = self.max_ordinal_present();
1615            encoder.write_num(max_ordinal, offset);
1616            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1617            // Calling encoder.out_of_line_offset(0) is not allowed.
1618            if max_ordinal == 0 {
1619                return Ok(());
1620            }
1621            depth.increment()?;
1622            let envelope_size = 8;
1623            let bytes_len = max_ordinal as usize * envelope_size;
1624            #[allow(unused_variables)]
1625            let offset = encoder.out_of_line_offset(bytes_len);
1626            let mut _prev_end_offset: usize = 0;
1627
1628            Ok(())
1629        }
1630    }
1631
1632    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DiscoveredPayload {
1633        #[inline(always)]
1634        fn new_empty() -> Self {
1635            Self::default()
1636        }
1637
1638        unsafe fn decode(
1639            &mut self,
1640            decoder: &mut fidl::encoding::Decoder<'_, D>,
1641            offset: usize,
1642            mut depth: fidl::encoding::Depth,
1643        ) -> fidl::Result<()> {
1644            decoder.debug_check_bounds::<Self>(offset);
1645            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1646                None => return Err(fidl::Error::NotNullable),
1647                Some(len) => len,
1648            };
1649            // Calling decoder.out_of_line_offset(0) is not allowed.
1650            if len == 0 {
1651                return Ok(());
1652            };
1653            depth.increment()?;
1654            let envelope_size = 8;
1655            let bytes_len = len * envelope_size;
1656            let offset = decoder.out_of_line_offset(bytes_len)?;
1657            // Decode the envelope for each type.
1658            let mut _next_ordinal_to_read = 0;
1659            let mut next_offset = offset;
1660            let end_offset = offset + bytes_len;
1661
1662            // Decode the remaining unknown envelopes.
1663            while next_offset < end_offset {
1664                _next_ordinal_to_read += 1;
1665                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1666                next_offset += envelope_size;
1667            }
1668
1669            Ok(())
1670        }
1671    }
1672
1673    impl EventHeader {
1674        #[inline(always)]
1675        fn max_ordinal_present(&self) -> u64 {
1676            if let Some(_) = self.timestamp {
1677                return 4;
1678            }
1679            if let Some(_) = self.component_url {
1680                return 3;
1681            }
1682            if let Some(_) = self.moniker {
1683                return 2;
1684            }
1685            if let Some(_) = self.event_type {
1686                return 1;
1687            }
1688            0
1689        }
1690    }
1691
1692    impl fidl::encoding::ValueTypeMarker for EventHeader {
1693        type Borrowed<'a> = &'a Self;
1694        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1695            value
1696        }
1697    }
1698
1699    unsafe impl fidl::encoding::TypeMarker for EventHeader {
1700        type Owned = Self;
1701
1702        #[inline(always)]
1703        fn inline_align(_context: fidl::encoding::Context) -> usize {
1704            8
1705        }
1706
1707        #[inline(always)]
1708        fn inline_size(_context: fidl::encoding::Context) -> usize {
1709            16
1710        }
1711    }
1712
1713    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EventHeader, D>
1714        for &EventHeader
1715    {
1716        unsafe fn encode(
1717            self,
1718            encoder: &mut fidl::encoding::Encoder<'_, D>,
1719            offset: usize,
1720            mut depth: fidl::encoding::Depth,
1721        ) -> fidl::Result<()> {
1722            encoder.debug_check_bounds::<EventHeader>(offset);
1723            // Vector header
1724            let max_ordinal: u64 = self.max_ordinal_present();
1725            encoder.write_num(max_ordinal, offset);
1726            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1727            // Calling encoder.out_of_line_offset(0) is not allowed.
1728            if max_ordinal == 0 {
1729                return Ok(());
1730            }
1731            depth.increment()?;
1732            let envelope_size = 8;
1733            let bytes_len = max_ordinal as usize * envelope_size;
1734            #[allow(unused_variables)]
1735            let offset = encoder.out_of_line_offset(bytes_len);
1736            let mut _prev_end_offset: usize = 0;
1737            if 1 > max_ordinal {
1738                return Ok(());
1739            }
1740
1741            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1742            // are envelope_size bytes.
1743            let cur_offset: usize = (1 - 1) * envelope_size;
1744
1745            // Zero reserved fields.
1746            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1747
1748            // Safety:
1749            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1750            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1751            //   envelope_size bytes, there is always sufficient room.
1752            fidl::encoding::encode_in_envelope_optional::<EventType, D>(
1753                self.event_type
1754                    .as_ref()
1755                    .map(<EventType as fidl::encoding::ValueTypeMarker>::borrow),
1756                encoder,
1757                offset + cur_offset,
1758                depth,
1759            )?;
1760
1761            _prev_end_offset = cur_offset + envelope_size;
1762            if 2 > max_ordinal {
1763                return Ok(());
1764            }
1765
1766            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1767            // are envelope_size bytes.
1768            let cur_offset: usize = (2 - 1) * envelope_size;
1769
1770            // Zero reserved fields.
1771            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1772
1773            // Safety:
1774            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1775            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1776            //   envelope_size bytes, there is always sufficient room.
1777            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
1778            self.moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
1779            encoder, offset + cur_offset, depth
1780        )?;
1781
1782            _prev_end_offset = cur_offset + envelope_size;
1783            if 3 > max_ordinal {
1784                return Ok(());
1785            }
1786
1787            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1788            // are envelope_size bytes.
1789            let cur_offset: usize = (3 - 1) * envelope_size;
1790
1791            // Zero reserved fields.
1792            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1793
1794            // Safety:
1795            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1796            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1797            //   envelope_size bytes, there is always sufficient room.
1798            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
1799            self.component_url.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
1800            encoder, offset + cur_offset, depth
1801        )?;
1802
1803            _prev_end_offset = cur_offset + envelope_size;
1804            if 4 > max_ordinal {
1805                return Ok(());
1806            }
1807
1808            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1809            // are envelope_size bytes.
1810            let cur_offset: usize = (4 - 1) * envelope_size;
1811
1812            // Zero reserved fields.
1813            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1814
1815            // Safety:
1816            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1817            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1818            //   envelope_size bytes, there is always sufficient room.
1819            fidl::encoding::encode_in_envelope_optional::<fidl::BootInstant, D>(
1820                self.timestamp
1821                    .as_ref()
1822                    .map(<fidl::BootInstant as fidl::encoding::ValueTypeMarker>::borrow),
1823                encoder,
1824                offset + cur_offset,
1825                depth,
1826            )?;
1827
1828            _prev_end_offset = cur_offset + envelope_size;
1829
1830            Ok(())
1831        }
1832    }
1833
1834    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EventHeader {
1835        #[inline(always)]
1836        fn new_empty() -> Self {
1837            Self::default()
1838        }
1839
1840        unsafe fn decode(
1841            &mut self,
1842            decoder: &mut fidl::encoding::Decoder<'_, D>,
1843            offset: usize,
1844            mut depth: fidl::encoding::Depth,
1845        ) -> fidl::Result<()> {
1846            decoder.debug_check_bounds::<Self>(offset);
1847            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1848                None => return Err(fidl::Error::NotNullable),
1849                Some(len) => len,
1850            };
1851            // Calling decoder.out_of_line_offset(0) is not allowed.
1852            if len == 0 {
1853                return Ok(());
1854            };
1855            depth.increment()?;
1856            let envelope_size = 8;
1857            let bytes_len = len * envelope_size;
1858            let offset = decoder.out_of_line_offset(bytes_len)?;
1859            // Decode the envelope for each type.
1860            let mut _next_ordinal_to_read = 0;
1861            let mut next_offset = offset;
1862            let end_offset = offset + bytes_len;
1863            _next_ordinal_to_read += 1;
1864            if next_offset >= end_offset {
1865                return Ok(());
1866            }
1867
1868            // Decode unknown envelopes for gaps in ordinals.
1869            while _next_ordinal_to_read < 1 {
1870                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1871                _next_ordinal_to_read += 1;
1872                next_offset += envelope_size;
1873            }
1874
1875            let next_out_of_line = decoder.next_out_of_line();
1876            let handles_before = decoder.remaining_handles();
1877            if let Some((inlined, num_bytes, num_handles)) =
1878                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1879            {
1880                let member_inline_size =
1881                    <EventType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1882                if inlined != (member_inline_size <= 4) {
1883                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1884                }
1885                let inner_offset;
1886                let mut inner_depth = depth.clone();
1887                if inlined {
1888                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1889                    inner_offset = next_offset;
1890                } else {
1891                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1892                    inner_depth.increment()?;
1893                }
1894                let val_ref = self.event_type.get_or_insert_with(|| fidl::new_empty!(EventType, D));
1895                fidl::decode!(EventType, D, val_ref, decoder, inner_offset, inner_depth)?;
1896                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1897                {
1898                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1899                }
1900                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1901                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1902                }
1903            }
1904
1905            next_offset += envelope_size;
1906            _next_ordinal_to_read += 1;
1907            if next_offset >= end_offset {
1908                return Ok(());
1909            }
1910
1911            // Decode unknown envelopes for gaps in ordinals.
1912            while _next_ordinal_to_read < 2 {
1913                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1914                _next_ordinal_to_read += 1;
1915                next_offset += envelope_size;
1916            }
1917
1918            let next_out_of_line = decoder.next_out_of_line();
1919            let handles_before = decoder.remaining_handles();
1920            if let Some((inlined, num_bytes, num_handles)) =
1921                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1922            {
1923                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1924                if inlined != (member_inline_size <= 4) {
1925                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1926                }
1927                let inner_offset;
1928                let mut inner_depth = depth.clone();
1929                if inlined {
1930                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1931                    inner_offset = next_offset;
1932                } else {
1933                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1934                    inner_depth.increment()?;
1935                }
1936                let val_ref = self.moniker.get_or_insert_with(|| {
1937                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
1938                });
1939                fidl::decode!(
1940                    fidl::encoding::BoundedString<4096>,
1941                    D,
1942                    val_ref,
1943                    decoder,
1944                    inner_offset,
1945                    inner_depth
1946                )?;
1947                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1948                {
1949                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1950                }
1951                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1952                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1953                }
1954            }
1955
1956            next_offset += envelope_size;
1957            _next_ordinal_to_read += 1;
1958            if next_offset >= end_offset {
1959                return Ok(());
1960            }
1961
1962            // Decode unknown envelopes for gaps in ordinals.
1963            while _next_ordinal_to_read < 3 {
1964                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1965                _next_ordinal_to_read += 1;
1966                next_offset += envelope_size;
1967            }
1968
1969            let next_out_of_line = decoder.next_out_of_line();
1970            let handles_before = decoder.remaining_handles();
1971            if let Some((inlined, num_bytes, num_handles)) =
1972                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1973            {
1974                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1975                if inlined != (member_inline_size <= 4) {
1976                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1977                }
1978                let inner_offset;
1979                let mut inner_depth = depth.clone();
1980                if inlined {
1981                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1982                    inner_offset = next_offset;
1983                } else {
1984                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1985                    inner_depth.increment()?;
1986                }
1987                let val_ref = self.component_url.get_or_insert_with(|| {
1988                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
1989                });
1990                fidl::decode!(
1991                    fidl::encoding::BoundedString<4096>,
1992                    D,
1993                    val_ref,
1994                    decoder,
1995                    inner_offset,
1996                    inner_depth
1997                )?;
1998                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1999                {
2000                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2001                }
2002                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2003                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2004                }
2005            }
2006
2007            next_offset += envelope_size;
2008            _next_ordinal_to_read += 1;
2009            if next_offset >= end_offset {
2010                return Ok(());
2011            }
2012
2013            // Decode unknown envelopes for gaps in ordinals.
2014            while _next_ordinal_to_read < 4 {
2015                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2016                _next_ordinal_to_read += 1;
2017                next_offset += envelope_size;
2018            }
2019
2020            let next_out_of_line = decoder.next_out_of_line();
2021            let handles_before = decoder.remaining_handles();
2022            if let Some((inlined, num_bytes, num_handles)) =
2023                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2024            {
2025                let member_inline_size =
2026                    <fidl::BootInstant as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2027                if inlined != (member_inline_size <= 4) {
2028                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2029                }
2030                let inner_offset;
2031                let mut inner_depth = depth.clone();
2032                if inlined {
2033                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2034                    inner_offset = next_offset;
2035                } else {
2036                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2037                    inner_depth.increment()?;
2038                }
2039                let val_ref =
2040                    self.timestamp.get_or_insert_with(|| fidl::new_empty!(fidl::BootInstant, D));
2041                fidl::decode!(fidl::BootInstant, D, val_ref, decoder, inner_offset, inner_depth)?;
2042                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2043                {
2044                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2045                }
2046                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2047                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2048                }
2049            }
2050
2051            next_offset += envelope_size;
2052
2053            // Decode the remaining unknown envelopes.
2054            while next_offset < end_offset {
2055                _next_ordinal_to_read += 1;
2056                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2057                next_offset += envelope_size;
2058            }
2059
2060            Ok(())
2061        }
2062    }
2063
2064    impl PurgedPayload {
2065        #[inline(always)]
2066        fn max_ordinal_present(&self) -> u64 {
2067            0
2068        }
2069    }
2070
2071    impl fidl::encoding::ValueTypeMarker for PurgedPayload {
2072        type Borrowed<'a> = &'a Self;
2073        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2074            value
2075        }
2076    }
2077
2078    unsafe impl fidl::encoding::TypeMarker for PurgedPayload {
2079        type Owned = Self;
2080
2081        #[inline(always)]
2082        fn inline_align(_context: fidl::encoding::Context) -> usize {
2083            8
2084        }
2085
2086        #[inline(always)]
2087        fn inline_size(_context: fidl::encoding::Context) -> usize {
2088            16
2089        }
2090    }
2091
2092    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PurgedPayload, D>
2093        for &PurgedPayload
2094    {
2095        unsafe fn encode(
2096            self,
2097            encoder: &mut fidl::encoding::Encoder<'_, D>,
2098            offset: usize,
2099            mut depth: fidl::encoding::Depth,
2100        ) -> fidl::Result<()> {
2101            encoder.debug_check_bounds::<PurgedPayload>(offset);
2102            // Vector header
2103            let max_ordinal: u64 = self.max_ordinal_present();
2104            encoder.write_num(max_ordinal, offset);
2105            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2106            // Calling encoder.out_of_line_offset(0) is not allowed.
2107            if max_ordinal == 0 {
2108                return Ok(());
2109            }
2110            depth.increment()?;
2111            let envelope_size = 8;
2112            let bytes_len = max_ordinal as usize * envelope_size;
2113            #[allow(unused_variables)]
2114            let offset = encoder.out_of_line_offset(bytes_len);
2115            let mut _prev_end_offset: usize = 0;
2116
2117            Ok(())
2118        }
2119    }
2120
2121    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PurgedPayload {
2122        #[inline(always)]
2123        fn new_empty() -> Self {
2124            Self::default()
2125        }
2126
2127        unsafe fn decode(
2128            &mut self,
2129            decoder: &mut fidl::encoding::Decoder<'_, D>,
2130            offset: usize,
2131            mut depth: fidl::encoding::Depth,
2132        ) -> fidl::Result<()> {
2133            decoder.debug_check_bounds::<Self>(offset);
2134            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2135                None => return Err(fidl::Error::NotNullable),
2136                Some(len) => len,
2137            };
2138            // Calling decoder.out_of_line_offset(0) is not allowed.
2139            if len == 0 {
2140                return Ok(());
2141            };
2142            depth.increment()?;
2143            let envelope_size = 8;
2144            let bytes_len = len * envelope_size;
2145            let offset = decoder.out_of_line_offset(bytes_len)?;
2146            // Decode the envelope for each type.
2147            let mut _next_ordinal_to_read = 0;
2148            let mut next_offset = offset;
2149            let end_offset = offset + bytes_len;
2150
2151            // Decode the remaining unknown envelopes.
2152            while next_offset < end_offset {
2153                _next_ordinal_to_read += 1;
2154                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2155                next_offset += envelope_size;
2156            }
2157
2158            Ok(())
2159        }
2160    }
2161
2162    impl ResolvedPayload {
2163        #[inline(always)]
2164        fn max_ordinal_present(&self) -> u64 {
2165            0
2166        }
2167    }
2168
2169    impl fidl::encoding::ValueTypeMarker for ResolvedPayload {
2170        type Borrowed<'a> = &'a Self;
2171        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2172            value
2173        }
2174    }
2175
2176    unsafe impl fidl::encoding::TypeMarker for ResolvedPayload {
2177        type Owned = Self;
2178
2179        #[inline(always)]
2180        fn inline_align(_context: fidl::encoding::Context) -> usize {
2181            8
2182        }
2183
2184        #[inline(always)]
2185        fn inline_size(_context: fidl::encoding::Context) -> usize {
2186            16
2187        }
2188    }
2189
2190    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResolvedPayload, D>
2191        for &ResolvedPayload
2192    {
2193        unsafe fn encode(
2194            self,
2195            encoder: &mut fidl::encoding::Encoder<'_, D>,
2196            offset: usize,
2197            mut depth: fidl::encoding::Depth,
2198        ) -> fidl::Result<()> {
2199            encoder.debug_check_bounds::<ResolvedPayload>(offset);
2200            // Vector header
2201            let max_ordinal: u64 = self.max_ordinal_present();
2202            encoder.write_num(max_ordinal, offset);
2203            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2204            // Calling encoder.out_of_line_offset(0) is not allowed.
2205            if max_ordinal == 0 {
2206                return Ok(());
2207            }
2208            depth.increment()?;
2209            let envelope_size = 8;
2210            let bytes_len = max_ordinal as usize * envelope_size;
2211            #[allow(unused_variables)]
2212            let offset = encoder.out_of_line_offset(bytes_len);
2213            let mut _prev_end_offset: usize = 0;
2214
2215            Ok(())
2216        }
2217    }
2218
2219    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolvedPayload {
2220        #[inline(always)]
2221        fn new_empty() -> Self {
2222            Self::default()
2223        }
2224
2225        unsafe fn decode(
2226            &mut self,
2227            decoder: &mut fidl::encoding::Decoder<'_, D>,
2228            offset: usize,
2229            mut depth: fidl::encoding::Depth,
2230        ) -> fidl::Result<()> {
2231            decoder.debug_check_bounds::<Self>(offset);
2232            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2233                None => return Err(fidl::Error::NotNullable),
2234                Some(len) => len,
2235            };
2236            // Calling decoder.out_of_line_offset(0) is not allowed.
2237            if len == 0 {
2238                return Ok(());
2239            };
2240            depth.increment()?;
2241            let envelope_size = 8;
2242            let bytes_len = len * envelope_size;
2243            let offset = decoder.out_of_line_offset(bytes_len)?;
2244            // Decode the envelope for each type.
2245            let mut _next_ordinal_to_read = 0;
2246            let mut next_offset = offset;
2247            let end_offset = offset + bytes_len;
2248
2249            // Decode the remaining unknown envelopes.
2250            while next_offset < end_offset {
2251                _next_ordinal_to_read += 1;
2252                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2253                next_offset += envelope_size;
2254            }
2255
2256            Ok(())
2257        }
2258    }
2259
2260    impl StartedPayload {
2261        #[inline(always)]
2262        fn max_ordinal_present(&self) -> u64 {
2263            0
2264        }
2265    }
2266
2267    impl fidl::encoding::ValueTypeMarker for StartedPayload {
2268        type Borrowed<'a> = &'a Self;
2269        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2270            value
2271        }
2272    }
2273
2274    unsafe impl fidl::encoding::TypeMarker for StartedPayload {
2275        type Owned = Self;
2276
2277        #[inline(always)]
2278        fn inline_align(_context: fidl::encoding::Context) -> usize {
2279            8
2280        }
2281
2282        #[inline(always)]
2283        fn inline_size(_context: fidl::encoding::Context) -> usize {
2284            16
2285        }
2286    }
2287
2288    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StartedPayload, D>
2289        for &StartedPayload
2290    {
2291        unsafe fn encode(
2292            self,
2293            encoder: &mut fidl::encoding::Encoder<'_, D>,
2294            offset: usize,
2295            mut depth: fidl::encoding::Depth,
2296        ) -> fidl::Result<()> {
2297            encoder.debug_check_bounds::<StartedPayload>(offset);
2298            // Vector header
2299            let max_ordinal: u64 = self.max_ordinal_present();
2300            encoder.write_num(max_ordinal, offset);
2301            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2302            // Calling encoder.out_of_line_offset(0) is not allowed.
2303            if max_ordinal == 0 {
2304                return Ok(());
2305            }
2306            depth.increment()?;
2307            let envelope_size = 8;
2308            let bytes_len = max_ordinal as usize * envelope_size;
2309            #[allow(unused_variables)]
2310            let offset = encoder.out_of_line_offset(bytes_len);
2311            let mut _prev_end_offset: usize = 0;
2312
2313            Ok(())
2314        }
2315    }
2316
2317    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StartedPayload {
2318        #[inline(always)]
2319        fn new_empty() -> Self {
2320            Self::default()
2321        }
2322
2323        unsafe fn decode(
2324            &mut self,
2325            decoder: &mut fidl::encoding::Decoder<'_, D>,
2326            offset: usize,
2327            mut depth: fidl::encoding::Depth,
2328        ) -> fidl::Result<()> {
2329            decoder.debug_check_bounds::<Self>(offset);
2330            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2331                None => return Err(fidl::Error::NotNullable),
2332                Some(len) => len,
2333            };
2334            // Calling decoder.out_of_line_offset(0) is not allowed.
2335            if len == 0 {
2336                return Ok(());
2337            };
2338            depth.increment()?;
2339            let envelope_size = 8;
2340            let bytes_len = len * envelope_size;
2341            let offset = decoder.out_of_line_offset(bytes_len)?;
2342            // Decode the envelope for each type.
2343            let mut _next_ordinal_to_read = 0;
2344            let mut next_offset = offset;
2345            let end_offset = offset + bytes_len;
2346
2347            // Decode the remaining unknown envelopes.
2348            while next_offset < end_offset {
2349                _next_ordinal_to_read += 1;
2350                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2351                next_offset += envelope_size;
2352            }
2353
2354            Ok(())
2355        }
2356    }
2357
2358    impl StoppedPayload {
2359        #[inline(always)]
2360        fn max_ordinal_present(&self) -> u64 {
2361            if let Some(_) = self.exit_code {
2362                return 2;
2363            }
2364            if let Some(_) = self.status {
2365                return 1;
2366            }
2367            0
2368        }
2369    }
2370
2371    impl fidl::encoding::ValueTypeMarker for StoppedPayload {
2372        type Borrowed<'a> = &'a Self;
2373        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2374            value
2375        }
2376    }
2377
2378    unsafe impl fidl::encoding::TypeMarker for StoppedPayload {
2379        type Owned = Self;
2380
2381        #[inline(always)]
2382        fn inline_align(_context: fidl::encoding::Context) -> usize {
2383            8
2384        }
2385
2386        #[inline(always)]
2387        fn inline_size(_context: fidl::encoding::Context) -> usize {
2388            16
2389        }
2390    }
2391
2392    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StoppedPayload, D>
2393        for &StoppedPayload
2394    {
2395        unsafe fn encode(
2396            self,
2397            encoder: &mut fidl::encoding::Encoder<'_, D>,
2398            offset: usize,
2399            mut depth: fidl::encoding::Depth,
2400        ) -> fidl::Result<()> {
2401            encoder.debug_check_bounds::<StoppedPayload>(offset);
2402            // Vector header
2403            let max_ordinal: u64 = self.max_ordinal_present();
2404            encoder.write_num(max_ordinal, offset);
2405            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2406            // Calling encoder.out_of_line_offset(0) is not allowed.
2407            if max_ordinal == 0 {
2408                return Ok(());
2409            }
2410            depth.increment()?;
2411            let envelope_size = 8;
2412            let bytes_len = max_ordinal as usize * envelope_size;
2413            #[allow(unused_variables)]
2414            let offset = encoder.out_of_line_offset(bytes_len);
2415            let mut _prev_end_offset: usize = 0;
2416            if 1 > max_ordinal {
2417                return Ok(());
2418            }
2419
2420            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2421            // are envelope_size bytes.
2422            let cur_offset: usize = (1 - 1) * envelope_size;
2423
2424            // Zero reserved fields.
2425            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2426
2427            // Safety:
2428            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2429            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2430            //   envelope_size bytes, there is always sufficient room.
2431            fidl::encoding::encode_in_envelope_optional::<i32, D>(
2432                self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
2433                encoder,
2434                offset + cur_offset,
2435                depth,
2436            )?;
2437
2438            _prev_end_offset = cur_offset + envelope_size;
2439            if 2 > max_ordinal {
2440                return Ok(());
2441            }
2442
2443            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2444            // are envelope_size bytes.
2445            let cur_offset: usize = (2 - 1) * envelope_size;
2446
2447            // Zero reserved fields.
2448            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2449
2450            // Safety:
2451            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2452            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2453            //   envelope_size bytes, there is always sufficient room.
2454            fidl::encoding::encode_in_envelope_optional::<i64, D>(
2455                self.exit_code.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2456                encoder,
2457                offset + cur_offset,
2458                depth,
2459            )?;
2460
2461            _prev_end_offset = cur_offset + envelope_size;
2462
2463            Ok(())
2464        }
2465    }
2466
2467    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StoppedPayload {
2468        #[inline(always)]
2469        fn new_empty() -> Self {
2470            Self::default()
2471        }
2472
2473        unsafe fn decode(
2474            &mut self,
2475            decoder: &mut fidl::encoding::Decoder<'_, D>,
2476            offset: usize,
2477            mut depth: fidl::encoding::Depth,
2478        ) -> fidl::Result<()> {
2479            decoder.debug_check_bounds::<Self>(offset);
2480            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2481                None => return Err(fidl::Error::NotNullable),
2482                Some(len) => len,
2483            };
2484            // Calling decoder.out_of_line_offset(0) is not allowed.
2485            if len == 0 {
2486                return Ok(());
2487            };
2488            depth.increment()?;
2489            let envelope_size = 8;
2490            let bytes_len = len * envelope_size;
2491            let offset = decoder.out_of_line_offset(bytes_len)?;
2492            // Decode the envelope for each type.
2493            let mut _next_ordinal_to_read = 0;
2494            let mut next_offset = offset;
2495            let end_offset = offset + bytes_len;
2496            _next_ordinal_to_read += 1;
2497            if next_offset >= end_offset {
2498                return Ok(());
2499            }
2500
2501            // Decode unknown envelopes for gaps in ordinals.
2502            while _next_ordinal_to_read < 1 {
2503                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2504                _next_ordinal_to_read += 1;
2505                next_offset += envelope_size;
2506            }
2507
2508            let next_out_of_line = decoder.next_out_of_line();
2509            let handles_before = decoder.remaining_handles();
2510            if let Some((inlined, num_bytes, num_handles)) =
2511                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2512            {
2513                let member_inline_size =
2514                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2515                if inlined != (member_inline_size <= 4) {
2516                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2517                }
2518                let inner_offset;
2519                let mut inner_depth = depth.clone();
2520                if inlined {
2521                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2522                    inner_offset = next_offset;
2523                } else {
2524                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2525                    inner_depth.increment()?;
2526                }
2527                let val_ref = self.status.get_or_insert_with(|| fidl::new_empty!(i32, D));
2528                fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
2529                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2530                {
2531                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2532                }
2533                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2534                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2535                }
2536            }
2537
2538            next_offset += envelope_size;
2539            _next_ordinal_to_read += 1;
2540            if next_offset >= end_offset {
2541                return Ok(());
2542            }
2543
2544            // Decode unknown envelopes for gaps in ordinals.
2545            while _next_ordinal_to_read < 2 {
2546                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2547                _next_ordinal_to_read += 1;
2548                next_offset += envelope_size;
2549            }
2550
2551            let next_out_of_line = decoder.next_out_of_line();
2552            let handles_before = decoder.remaining_handles();
2553            if let Some((inlined, num_bytes, num_handles)) =
2554                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2555            {
2556                let member_inline_size =
2557                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2558                if inlined != (member_inline_size <= 4) {
2559                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2560                }
2561                let inner_offset;
2562                let mut inner_depth = depth.clone();
2563                if inlined {
2564                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2565                    inner_offset = next_offset;
2566                } else {
2567                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2568                    inner_depth.increment()?;
2569                }
2570                let val_ref = self.exit_code.get_or_insert_with(|| fidl::new_empty!(i64, D));
2571                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
2572                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2573                {
2574                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2575                }
2576                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2577                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2578                }
2579            }
2580
2581            next_offset += envelope_size;
2582
2583            // Decode the remaining unknown envelopes.
2584            while next_offset < end_offset {
2585                _next_ordinal_to_read += 1;
2586                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2587                next_offset += envelope_size;
2588            }
2589
2590            Ok(())
2591        }
2592    }
2593
2594    impl StorageStatus {
2595        #[inline(always)]
2596        fn max_ordinal_present(&self) -> u64 {
2597            if let Some(_) = self.used_size {
2598                return 2;
2599            }
2600            if let Some(_) = self.total_size {
2601                return 1;
2602            }
2603            0
2604        }
2605    }
2606
2607    impl fidl::encoding::ValueTypeMarker for StorageStatus {
2608        type Borrowed<'a> = &'a Self;
2609        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2610            value
2611        }
2612    }
2613
2614    unsafe impl fidl::encoding::TypeMarker for StorageStatus {
2615        type Owned = Self;
2616
2617        #[inline(always)]
2618        fn inline_align(_context: fidl::encoding::Context) -> usize {
2619            8
2620        }
2621
2622        #[inline(always)]
2623        fn inline_size(_context: fidl::encoding::Context) -> usize {
2624            16
2625        }
2626    }
2627
2628    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StorageStatus, D>
2629        for &StorageStatus
2630    {
2631        unsafe fn encode(
2632            self,
2633            encoder: &mut fidl::encoding::Encoder<'_, D>,
2634            offset: usize,
2635            mut depth: fidl::encoding::Depth,
2636        ) -> fidl::Result<()> {
2637            encoder.debug_check_bounds::<StorageStatus>(offset);
2638            // Vector header
2639            let max_ordinal: u64 = self.max_ordinal_present();
2640            encoder.write_num(max_ordinal, offset);
2641            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2642            // Calling encoder.out_of_line_offset(0) is not allowed.
2643            if max_ordinal == 0 {
2644                return Ok(());
2645            }
2646            depth.increment()?;
2647            let envelope_size = 8;
2648            let bytes_len = max_ordinal as usize * envelope_size;
2649            #[allow(unused_variables)]
2650            let offset = encoder.out_of_line_offset(bytes_len);
2651            let mut _prev_end_offset: usize = 0;
2652            if 1 > max_ordinal {
2653                return Ok(());
2654            }
2655
2656            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2657            // are envelope_size bytes.
2658            let cur_offset: usize = (1 - 1) * envelope_size;
2659
2660            // Zero reserved fields.
2661            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2662
2663            // Safety:
2664            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2665            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2666            //   envelope_size bytes, there is always sufficient room.
2667            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2668                self.total_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2669                encoder,
2670                offset + cur_offset,
2671                depth,
2672            )?;
2673
2674            _prev_end_offset = cur_offset + envelope_size;
2675            if 2 > max_ordinal {
2676                return Ok(());
2677            }
2678
2679            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2680            // are envelope_size bytes.
2681            let cur_offset: usize = (2 - 1) * envelope_size;
2682
2683            // Zero reserved fields.
2684            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2685
2686            // Safety:
2687            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2688            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2689            //   envelope_size bytes, there is always sufficient room.
2690            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2691                self.used_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2692                encoder,
2693                offset + cur_offset,
2694                depth,
2695            )?;
2696
2697            _prev_end_offset = cur_offset + envelope_size;
2698
2699            Ok(())
2700        }
2701    }
2702
2703    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StorageStatus {
2704        #[inline(always)]
2705        fn new_empty() -> Self {
2706            Self::default()
2707        }
2708
2709        unsafe fn decode(
2710            &mut self,
2711            decoder: &mut fidl::encoding::Decoder<'_, D>,
2712            offset: usize,
2713            mut depth: fidl::encoding::Depth,
2714        ) -> fidl::Result<()> {
2715            decoder.debug_check_bounds::<Self>(offset);
2716            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2717                None => return Err(fidl::Error::NotNullable),
2718                Some(len) => len,
2719            };
2720            // Calling decoder.out_of_line_offset(0) is not allowed.
2721            if len == 0 {
2722                return Ok(());
2723            };
2724            depth.increment()?;
2725            let envelope_size = 8;
2726            let bytes_len = len * envelope_size;
2727            let offset = decoder.out_of_line_offset(bytes_len)?;
2728            // Decode the envelope for each type.
2729            let mut _next_ordinal_to_read = 0;
2730            let mut next_offset = offset;
2731            let end_offset = offset + bytes_len;
2732            _next_ordinal_to_read += 1;
2733            if next_offset >= end_offset {
2734                return Ok(());
2735            }
2736
2737            // Decode unknown envelopes for gaps in ordinals.
2738            while _next_ordinal_to_read < 1 {
2739                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2740                _next_ordinal_to_read += 1;
2741                next_offset += envelope_size;
2742            }
2743
2744            let next_out_of_line = decoder.next_out_of_line();
2745            let handles_before = decoder.remaining_handles();
2746            if let Some((inlined, num_bytes, num_handles)) =
2747                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2748            {
2749                let member_inline_size =
2750                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2751                if inlined != (member_inline_size <= 4) {
2752                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2753                }
2754                let inner_offset;
2755                let mut inner_depth = depth.clone();
2756                if inlined {
2757                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2758                    inner_offset = next_offset;
2759                } else {
2760                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2761                    inner_depth.increment()?;
2762                }
2763                let val_ref = self.total_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
2764                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2765                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2766                {
2767                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2768                }
2769                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2770                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2771                }
2772            }
2773
2774            next_offset += envelope_size;
2775            _next_ordinal_to_read += 1;
2776            if next_offset >= end_offset {
2777                return Ok(());
2778            }
2779
2780            // Decode unknown envelopes for gaps in ordinals.
2781            while _next_ordinal_to_read < 2 {
2782                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2783                _next_ordinal_to_read += 1;
2784                next_offset += envelope_size;
2785            }
2786
2787            let next_out_of_line = decoder.next_out_of_line();
2788            let handles_before = decoder.remaining_handles();
2789            if let Some((inlined, num_bytes, num_handles)) =
2790                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2791            {
2792                let member_inline_size =
2793                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2794                if inlined != (member_inline_size <= 4) {
2795                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2796                }
2797                let inner_offset;
2798                let mut inner_depth = depth.clone();
2799                if inlined {
2800                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2801                    inner_offset = next_offset;
2802                } else {
2803                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2804                    inner_depth.increment()?;
2805                }
2806                let val_ref = self.used_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
2807                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2808                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2809                {
2810                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2811                }
2812                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2813                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2814                }
2815            }
2816
2817            next_offset += envelope_size;
2818
2819            // Decode the remaining unknown envelopes.
2820            while next_offset < end_offset {
2821                _next_ordinal_to_read += 1;
2822                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2823                next_offset += envelope_size;
2824            }
2825
2826            Ok(())
2827        }
2828    }
2829
2830    impl UnresolvedPayload {
2831        #[inline(always)]
2832        fn max_ordinal_present(&self) -> u64 {
2833            0
2834        }
2835    }
2836
2837    impl fidl::encoding::ValueTypeMarker for UnresolvedPayload {
2838        type Borrowed<'a> = &'a Self;
2839        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2840            value
2841        }
2842    }
2843
2844    unsafe impl fidl::encoding::TypeMarker for UnresolvedPayload {
2845        type Owned = Self;
2846
2847        #[inline(always)]
2848        fn inline_align(_context: fidl::encoding::Context) -> usize {
2849            8
2850        }
2851
2852        #[inline(always)]
2853        fn inline_size(_context: fidl::encoding::Context) -> usize {
2854            16
2855        }
2856    }
2857
2858    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UnresolvedPayload, D>
2859        for &UnresolvedPayload
2860    {
2861        unsafe fn encode(
2862            self,
2863            encoder: &mut fidl::encoding::Encoder<'_, D>,
2864            offset: usize,
2865            mut depth: fidl::encoding::Depth,
2866        ) -> fidl::Result<()> {
2867            encoder.debug_check_bounds::<UnresolvedPayload>(offset);
2868            // Vector header
2869            let max_ordinal: u64 = self.max_ordinal_present();
2870            encoder.write_num(max_ordinal, offset);
2871            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2872            // Calling encoder.out_of_line_offset(0) is not allowed.
2873            if max_ordinal == 0 {
2874                return Ok(());
2875            }
2876            depth.increment()?;
2877            let envelope_size = 8;
2878            let bytes_len = max_ordinal as usize * envelope_size;
2879            #[allow(unused_variables)]
2880            let offset = encoder.out_of_line_offset(bytes_len);
2881            let mut _prev_end_offset: usize = 0;
2882
2883            Ok(())
2884        }
2885    }
2886
2887    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UnresolvedPayload {
2888        #[inline(always)]
2889        fn new_empty() -> Self {
2890            Self::default()
2891        }
2892
2893        unsafe fn decode(
2894            &mut self,
2895            decoder: &mut fidl::encoding::Decoder<'_, D>,
2896            offset: usize,
2897            mut depth: fidl::encoding::Depth,
2898        ) -> fidl::Result<()> {
2899            decoder.debug_check_bounds::<Self>(offset);
2900            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2901                None => return Err(fidl::Error::NotNullable),
2902                Some(len) => len,
2903            };
2904            // Calling decoder.out_of_line_offset(0) is not allowed.
2905            if len == 0 {
2906                return Ok(());
2907            };
2908            depth.increment()?;
2909            let envelope_size = 8;
2910            let bytes_len = len * envelope_size;
2911            let offset = decoder.out_of_line_offset(bytes_len)?;
2912            // Decode the envelope for each type.
2913            let mut _next_ordinal_to_read = 0;
2914            let mut next_offset = offset;
2915            let end_offset = offset + bytes_len;
2916
2917            // Decode the remaining unknown envelopes.
2918            while next_offset < end_offset {
2919                _next_ordinal_to_read += 1;
2920                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2921                next_offset += envelope_size;
2922            }
2923
2924            Ok(())
2925        }
2926    }
2927}