fidl_fuchsia_component_internal_common/
fidl_fuchsia_component_internal_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
11/// A single entry in an allowlist, expressed in one of three forms:
12///
13///   1. Exact moniker - Most entries should fall under this case,
14///      where the exact monikers of allowed components are listed.
15///      For example, "/foo/bar".
16///   2. Realm - Realms can be allowlisted such that any descendant will be
17///      allowed without being listed explicitly. For example, "/foo/**"
18///      allows any descendant of "/foo" (but not foo itself).
19///   3. Collection - Individual collections can also be allowlisted. For
20///      example, "/foo/bar:**" will allow any child in foo's "bar"
21///      collection and any descendant thereof, but not foo or other
22///      children of foo.
23pub type AllowlistEntryMoniker = String;
24
25/// 256 bits encoded in lower-cased base64 (64 chars).
26pub type InstanceId = String;
27
28pub type Moniker = String;
29
30/// The maximum size of the JobPolicyAllowlists entries.
31/// This value is currently set arbitrarily.
32pub const MAX_ALLOWLIST_SIZE: u64 = 128;
33
34/// The builtin resolver to use for the fuchsia-boot scheme, if any.
35#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
36#[repr(u8)]
37pub enum BuiltinBootResolver {
38    /// No builtin boot resolver is used.
39    None = 1,
40    /// Try to use the /boot directory from the namespace. Typically this is provided
41    /// to component manager during initialization of the system.
42    Boot = 2,
43}
44
45impl BuiltinBootResolver {
46    #[inline]
47    pub fn from_primitive(prim: u8) -> Option<Self> {
48        match prim {
49            1 => Some(Self::None),
50            2 => Some(Self::Boot),
51            _ => None,
52        }
53    }
54
55    #[inline]
56    pub const fn into_primitive(self) -> u8 {
57        self as u8
58    }
59
60    #[deprecated = "Strict enums should not use `is_unknown`"]
61    #[inline]
62    pub fn is_unknown(&self) -> bool {
63        false
64    }
65}
66
67/// Where to log to.
68#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
69#[repr(u8)]
70pub enum LogDestination {
71    /// Log to syslog.
72    Syslog = 1,
73    /// Log to klog.
74    Klog = 2,
75}
76
77impl LogDestination {
78    #[inline]
79    pub fn from_primitive(prim: u8) -> Option<Self> {
80        match prim {
81            1 => Some(Self::Syslog),
82            2 => Some(Self::Klog),
83            _ => None,
84        }
85    }
86
87    #[inline]
88    pub const fn into_primitive(self) -> u8 {
89        self as u8
90    }
91
92    #[deprecated = "Strict enums should not use `is_unknown`"]
93    #[inline]
94    pub fn is_unknown(&self) -> bool {
95        false
96    }
97}
98
99/// If and how the realm builder resolver and runner will be used.
100#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
101#[repr(u8)]
102pub enum RealmBuilderResolverAndRunner {
103    /// The realm builder resolver and runner are not used.
104    None = 1,
105    /// The realm builder resolver and runner will be accessed through component
106    /// manager's namespace, and made available to the root realm.
107    Namespace = 2,
108}
109
110impl RealmBuilderResolverAndRunner {
111    #[inline]
112    pub fn from_primitive(prim: u8) -> Option<Self> {
113        match prim {
114            1 => Some(Self::None),
115            2 => Some(Self::Namespace),
116            _ => None,
117        }
118    }
119
120    #[inline]
121    pub const fn into_primitive(self) -> u8 {
122        self as u8
123    }
124
125    #[deprecated = "Strict enums should not use `is_unknown`"]
126    #[inline]
127    pub fn is_unknown(&self) -> bool {
128        false
129    }
130}
131
132/// Where to obtain the trace provider from.
133/// to find the trace provider to register with.
134#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
135#[repr(u8)]
136pub enum TraceProvider {
137    /// Default. Get it from the normal fuchsia.tracing.provider.Registry.
138    Namespace = 1,
139    /// Get it from the root component's exposed directory. It is expected that the root
140    /// component exposes `fuchsia.tracing.provider.Registry` protocol to its parent.
141    RootExposed = 2,
142}
143
144impl TraceProvider {
145    #[inline]
146    pub fn from_primitive(prim: u8) -> Option<Self> {
147        match prim {
148            1 => Some(Self::Namespace),
149            2 => Some(Self::RootExposed),
150            _ => None,
151        }
152    }
153
154    #[inline]
155    pub const fn into_primitive(self) -> u8 {
156        self as u8
157    }
158
159    #[deprecated = "Strict enums should not use `is_unknown`"]
160    #[inline]
161    pub fn is_unknown(&self) -> bool {
162        false
163    }
164}
165
166/// Where to obtain the vmex resource from, if this component_manager is hosting bootfs.
167#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
168#[repr(u8)]
169pub enum VmexSource {
170    /// Get it from the PA_SYSTEM_RESOURCE handle passed to component_manager
171    SystemResource = 1,
172    /// Get it from the /svc/fuchsia.kernel.VmexResource protocol in
173    /// component_manager's namespace.
174    Namespace = 2,
175}
176
177impl VmexSource {
178    #[inline]
179    pub fn from_primitive(prim: u8) -> Option<Self> {
180        match prim {
181            1 => Some(Self::SystemResource),
182            2 => Some(Self::Namespace),
183            _ => None,
184        }
185    }
186
187    #[inline]
188    pub const fn into_primitive(self) -> u8 {
189        self as u8
190    }
191
192    #[deprecated = "Strict enums should not use `is_unknown`"]
193    #[inline]
194    pub fn is_unknown(&self) -> bool {
195        false
196    }
197}
198
199/// The enforcement and validation policy to apply to component target ABI revisions.
200#[derive(Clone, Debug, Default, PartialEq)]
201pub struct AbiRevisionPolicy {
202    /// Allowlist entry monikers for components that will be permitted to run
203    /// even if they fail ABI revision checks. This should _never_ be used. Any
204    /// component that bypasses these checks is unsupported by the platform and
205    /// may behave in unexpected ways!
206    pub allowlist: Option<Vec<String>>,
207    #[doc(hidden)]
208    pub __source_breaking: fidl::marker::SourceBreaking,
209}
210
211impl fidl::Persistable for AbiRevisionPolicy {}
212
213#[derive(Clone, Debug, Default, PartialEq)]
214pub struct AllowlistedDirectory {
215    #[doc(hidden)]
216    pub __source_breaking: fidl::marker::SourceBreaking,
217}
218
219impl fidl::Persistable for AllowlistedDirectory {}
220
221#[derive(Clone, Debug, Default, PartialEq)]
222pub struct AllowlistedProtocol {
223    #[doc(hidden)]
224    pub __source_breaking: fidl::marker::SourceBreaking,
225}
226
227impl fidl::Persistable for AllowlistedProtocol {}
228
229#[derive(Clone, Debug, Default, PartialEq)]
230pub struct AllowlistedResolver {
231    #[doc(hidden)]
232    pub __source_breaking: fidl::marker::SourceBreaking,
233}
234
235impl fidl::Persistable for AllowlistedResolver {}
236
237#[derive(Clone, Debug, Default, PartialEq)]
238pub struct AllowlistedRunner {
239    #[doc(hidden)]
240    pub __source_breaking: fidl::marker::SourceBreaking,
241}
242
243impl fidl::Persistable for AllowlistedRunner {}
244
245#[derive(Clone, Debug, Default, PartialEq)]
246pub struct AllowlistedService {
247    #[doc(hidden)]
248    pub __source_breaking: fidl::marker::SourceBreaking,
249}
250
251impl fidl::Persistable for AllowlistedService {}
252
253#[derive(Clone, Debug, Default, PartialEq)]
254pub struct AllowlistedStorage {
255    #[doc(hidden)]
256    pub __source_breaking: fidl::marker::SourceBreaking,
257}
258
259impl fidl::Persistable for AllowlistedStorage {}
260
261#[derive(Clone, Debug, Default, PartialEq)]
262pub struct AnonymizedAggregate {
263    pub capability: Option<AggregateCapability>,
264    pub moniker: Option<String>,
265    pub members: Option<Vec<AggregateMember>>,
266    pub sources: Option<Sources>,
267    pub instances: Option<Vec<fidl_fuchsia_sys2::ServiceInstance>>,
268    #[doc(hidden)]
269    pub __source_breaking: fidl::marker::SourceBreaking,
270}
271
272impl fidl::Persistable for AnonymizedAggregate {}
273
274#[derive(Clone, Debug, Default, PartialEq)]
275pub struct Builtin {
276    pub capability: Option<InternalCapability>,
277    #[doc(hidden)]
278    pub __source_breaking: fidl::marker::SourceBreaking,
279}
280
281impl fidl::Persistable for Builtin {}
282
283#[derive(Clone, Debug, Default, PartialEq)]
284pub struct Capability {
285    pub source_capability: Option<ComponentCapability>,
286    pub moniker: Option<String>,
287    #[doc(hidden)]
288    pub __source_breaking: fidl::marker::SourceBreaking,
289}
290
291impl fidl::Persistable for Capability {}
292
293/// Defines a single capability policy entry in the set of capability policy
294/// allowlists.
295#[derive(Clone, Debug, Default, PartialEq)]
296pub struct CapabilityAllowlistEntry {
297    /// The `source_moniker` represents the origin of a capability. The
298    /// `source_moniker` is either a moniker or '<component_manager>'.
299    pub source_moniker: Option<String>,
300    /// The source name of this particular capability.
301    pub source_name: Option<String>,
302    /// Represents the type of capability that is being restricted along
303    /// with any other properties required by a particular capability type.
304    pub capability: Option<AllowlistedCapability>,
305    /// The set of components, described by either exact monikers, realm, or collection,
306    /// that are allowed to use this specific capability.
307    pub target_monikers: Option<Vec<String>>,
308    /// The original source type of this capability, self or framework.
309    pub source: Option<fidl_fuchsia_component_decl::Ref>,
310    #[doc(hidden)]
311    pub __source_breaking: fidl::marker::SourceBreaking,
312}
313
314impl fidl::Persistable for CapabilityAllowlistEntry {}
315
316/// Defines the total set of capability allowlists. Each
317/// `source_moniker` + `capability` pair must be unique in the vector.
318#[derive(Clone, Debug, Default, PartialEq)]
319pub struct CapabilityPolicyAllowlists {
320    pub allowlist: Option<Vec<CapabilityAllowlistEntry>>,
321    #[doc(hidden)]
322    pub __source_breaking: fidl::marker::SourceBreaking,
323}
324
325impl fidl::Persistable for CapabilityPolicyAllowlists {}
326
327/// Allowlists for privileged child options.
328#[derive(Clone, Debug, Default, PartialEq)]
329pub struct ChildPolicyAllowlists {
330    /// Allowlist entry monikers of component instances allowed to have the
331    /// `on_terminate=REBOOT` in their `children` declaration.
332    pub reboot_on_terminate: Option<Vec<String>>,
333    #[doc(hidden)]
334    pub __source_breaking: fidl::marker::SourceBreaking,
335}
336
337impl fidl::Persistable for ChildPolicyAllowlists {}
338
339#[derive(Clone, Debug, Default, PartialEq)]
340pub struct Component {
341    pub capability: Option<ComponentCapability>,
342    pub moniker: Option<String>,
343    #[doc(hidden)]
344    pub __source_breaking: fidl::marker::SourceBreaking,
345}
346
347impl fidl::Persistable for Component {}
348
349/// Top-level type describing the component ID index.
350#[derive(Clone, Debug, Default, PartialEq)]
351pub struct ComponentIdIndex {
352    /// A list of component ID instance entries.
353    ///
354    /// Required, but may be empty.
355    pub instances: Option<Vec<InstanceIdEntry>>,
356    #[doc(hidden)]
357    pub __source_breaking: fidl::marker::SourceBreaking,
358}
359
360impl fidl::Persistable for ComponentIdIndex {}
361
362#[derive(Clone, Debug, Default, PartialEq)]
363pub struct Config {
364    /// If true, component manager will be in debug mode. In this mode, component manager
365    /// provides the `EventSource` protocol and exposes this protocol. Component
366    /// manager will not start until it is resumed by a call to
367    /// `EventSource.StartComponentTree`.
368    ///
369    /// This is done so that an external component (say an integration test) can subscribe
370    /// to events before the root component has started.
371    pub debug: Option<bool>,
372    /// How many children, maximum, are returned by a call to `Realm.ChildIterator.next()`.
373    pub list_children_batch_size: Option<u32>,
374    /// Security policy configuration.
375    pub security_policy: Option<SecurityPolicy>,
376    /// Capabilities offered from component manager's namespace.
377    pub namespace_capabilities: Option<Vec<fidl_fuchsia_component_decl::Capability>>,
378    /// If true, component_manager will serve an instance of fuchsia.process.Launcher and use this
379    /// launcher for the built-in ELF component runner. The root component can additionally
380    /// use and/or offer this service using `/builtin/fuchsia.process.Launcher` from realm.
381    /// This flag exists because the built-in process launcher *only* works when
382    /// component_manager runs under a job that has ZX_POL_NEW_PROCESS set to allow, like the root
383    /// job. Otherwise, the component_manager process cannot directly create process through
384    /// zx_process_create. When we run component_manager elsewhere, like in test environments, it
385    /// has to use the fuchsia.process.Launcher service provided through its namespace instead.
386    pub use_builtin_process_launcher: Option<bool>,
387    /// If true, component_manager will maintain a UTC kernel clock and vend write handles through
388    /// an instance of `fuchsia.time.Maintenance`. This flag should only be used with the top-level
389    /// component_manager.
390    pub maintain_utc_clock: Option<bool>,
391    /// The number of threads to use for running component_manager's executor.
392    /// If not present, interpreted as 1.
393    pub num_threads: Option<u8>,
394    /// URL of the root component to launch. This field is used if the no URL
395    /// is passed to component manager. If value is passed in both places, then
396    /// an error is raised.
397    pub root_component_url: Option<String>,
398    /// Path to the component ID index. An empty value defaults to an empty index.
399    /// An invalid index causes component_manager to abort.
400    pub component_id_index_path: Option<String>,
401    /// Where to log to.
402    pub log_destination: Option<LogDestination>,
403    /// If true, component manager will log all events dispatched in the topology.
404    pub log_all_events: Option<bool>,
405    /// Which builtin resolver to use for the fuchsia-boot scheme.
406    /// If not present, interpreted as BuiltinBootResolver.NONE.
407    pub builtin_boot_resolver: Option<BuiltinBootResolver>,
408    /// If and how the realm builder resolver and runner will be used. Typically
409    /// these capabilities from realm builder are available to a nested
410    /// component manager that is undergoing an integration test.
411    pub realm_builder_resolver_and_runner: Option<RealmBuilderResolverAndRunner>,
412    /// Capabilities offered from component manager as built-in capabilities.
413    pub builtin_capabilities: Option<Vec<fidl_fuchsia_component_decl::Capability>>,
414    /// Enables Component Manager's introspection APIs (RealmQuery, RealmExplorer,
415    /// RouteValidator, LifecycleController, etc.) for use by components.
416    pub enable_introspection: Option<bool>,
417    /// The enforcement and validation policy to apply to component target ABI
418    /// revisions.
419    pub abi_revision_policy: Option<AbiRevisionPolicy>,
420    /// Where to obtain the vmex resource from, if this component_manager is hosting bootfs.
421    /// If not present, defaults to `VmexSource::SYSTEM_RESOURCE`.
422    pub vmex_source: Option<VmexSource>,
423    /// Information about the health checks during the update process.
424    pub health_check: Option<HealthCheck>,
425    /// Where to look for the trace provider. If missing, defaults to TraceProvider::NAMESPACE.
426    /// This is ignored on non-tracing builds.
427    pub trace_provider: Option<TraceProvider>,
428    #[doc(hidden)]
429    pub __source_breaking: fidl::marker::SourceBreaking,
430}
431
432impl fidl::Persistable for Config {}
433
434/// Defines a capability policy entry in the set of debug capability policy
435/// allowlists.
436#[derive(Clone, Debug, Default, PartialEq)]
437pub struct DebugRegistrationAllowlistEntry {
438    /// The name of the capability as it's registered in the environment.
439    pub name: Option<String>,
440    /// Represents the type of capability that is being restricted along
441    /// with any other properties required by a particular capability type.
442    pub debug: Option<AllowlistedDebugRegistration>,
443    /// The moniker of the component which is allowed to register
444    /// this capability in its environment's debug sction.
445    pub moniker: Option<String>,
446    /// Name of the environment where this capability can be registered.
447    pub environment_name: Option<String>,
448    #[doc(hidden)]
449    pub __source_breaking: fidl::marker::SourceBreaking,
450}
451
452impl fidl::Persistable for DebugRegistrationAllowlistEntry {}
453
454/// Defines the total set of debug capability allowlists.
455#[derive(Clone, Debug, Default, PartialEq)]
456pub struct DebugRegistrationPolicyAllowlists {
457    pub allowlist: Option<Vec<DebugRegistrationAllowlistEntry>>,
458    #[doc(hidden)]
459    pub __source_breaking: fidl::marker::SourceBreaking,
460}
461
462impl fidl::Persistable for DebugRegistrationPolicyAllowlists {}
463
464#[derive(Clone, Debug, Default, PartialEq)]
465pub struct Environment {
466    pub capability: Option<ComponentCapability>,
467    pub moniker: Option<String>,
468    #[doc(hidden)]
469    pub __source_breaking: fidl::marker::SourceBreaking,
470}
471
472impl fidl::Persistable for Environment {}
473
474#[derive(Clone, Debug, Default, PartialEq)]
475pub struct EnvironmentSource {
476    pub source_name: Option<String>,
477    pub source: Option<fidl_fuchsia_component_decl::Ref>,
478    #[doc(hidden)]
479    pub __source_breaking: fidl::marker::SourceBreaking,
480}
481
482impl fidl::Persistable for EnvironmentSource {}
483
484#[derive(Clone, Debug, Default, PartialEq)]
485pub struct FilteredAggregateProvider {
486    pub capability: Option<AggregateCapability>,
487    pub moniker: Option<String>,
488    pub offer_service_decls: Option<Vec<fidl_fuchsia_component_decl::OfferService>>,
489    pub sources: Option<Sources>,
490    #[doc(hidden)]
491    pub __source_breaking: fidl::marker::SourceBreaking,
492}
493
494impl fidl::Persistable for FilteredAggregateProvider {}
495
496#[derive(Clone, Debug, Default, PartialEq)]
497pub struct FilteredProvider {
498    pub capability: Option<AggregateCapability>,
499    pub moniker: Option<String>,
500    pub service_capability: Option<ComponentCapability>,
501    pub offer_service_decl: Option<fidl_fuchsia_component_decl::OfferService>,
502    #[doc(hidden)]
503    pub __source_breaking: fidl::marker::SourceBreaking,
504}
505
506impl fidl::Persistable for FilteredProvider {}
507
508#[derive(Clone, Debug, Default, PartialEq)]
509pub struct Framework {
510    pub capability: Option<InternalCapability>,
511    pub moniker: Option<String>,
512    #[doc(hidden)]
513    pub __source_breaking: fidl::marker::SourceBreaking,
514}
515
516impl fidl::Persistable for Framework {}
517
518/// Information about the health checks during the update process.
519#[derive(Clone, Debug, Default, PartialEq)]
520pub struct HealthCheck {
521    /// Component monikers that must be healthy in order to complete an OTA update.
522    pub monikers: Option<Vec<String>>,
523    #[doc(hidden)]
524    pub __source_breaking: fidl::marker::SourceBreaking,
525}
526
527impl fidl::Persistable for HealthCheck {}
528
529#[derive(Clone, Debug, Default, PartialEq)]
530pub struct InstanceIdEntry {
531    /// A 256-bit identifier encoded in base64 which is unique across all other
532    /// instance IDs in the index.
533    pub instance_id: Option<String>,
534    /// The moniker identifying the component instance.
535    pub moniker: Option<String>,
536    #[doc(hidden)]
537    pub __source_breaking: fidl::marker::SourceBreaking,
538}
539
540impl fidl::Persistable for InstanceIdEntry {}
541
542/// Allowlists for Zircon job policy.
543#[derive(Clone, Debug, Default, PartialEq)]
544pub struct JobPolicyAllowlists {
545    /// Allowlist entry monikers for components allowed to be given the
546    /// ZX_POL_AMBIENT_MARK_VMO_EXEC job policy.
547    ///
548    /// Components must request this policy by including "job_policy_ambient_mark_vmo_exec: true" in
549    /// their CML's `program` section and must be using the ELF runner.
550    /// This is equivalent to the v1 'deprecated-ambient-replace-as-executable' feature.
551    pub ambient_mark_vmo_exec: Option<Vec<String>>,
552    /// Allowlist entry monikers for components allowed to have their original process
553    /// marked as critical to component_manager's job.
554    ///
555    /// Components must request this critical marking by including "main_process_critical: true" in
556    /// their CML's `program` section and must be using the ELF runner.
557    pub main_process_critical: Option<Vec<String>>,
558    /// Allowlist entry monikers for components allowed to call zx_process_create directly
559    /// (e.g., do not have ZX_POL_NEW_PROCESS set to ZX_POL_ACTION_DENY).
560    ///
561    /// Components must request this policy by including "job_policy_create_raw_processes: true" in
562    /// their manifest's program object and must be using the ELF runner.
563    pub create_raw_processes: Option<Vec<String>>,
564    #[doc(hidden)]
565    pub __source_breaking: fidl::marker::SourceBreaking,
566}
567
568impl fidl::Persistable for JobPolicyAllowlists {}
569
570#[derive(Clone, Debug, Default, PartialEq)]
571pub struct Namespace {
572    pub capability: Option<ComponentCapability>,
573    #[doc(hidden)]
574    pub __source_breaking: fidl::marker::SourceBreaking,
575}
576
577impl fidl::Persistable for Namespace {}
578
579/// Runtime security policy.
580#[derive(Clone, Debug, Default, PartialEq)]
581pub struct SecurityPolicy {
582    /// Allowlists for Zircon job policy.
583    pub job_policy: Option<JobPolicyAllowlists>,
584    /// Capability access policy.
585    pub capability_policy: Option<CapabilityPolicyAllowlists>,
586    /// Debug capability registration policy.
587    pub debug_registration_policy: Option<DebugRegistrationPolicyAllowlists>,
588    /// Component child options policy.
589    pub child_policy: Option<ChildPolicyAllowlists>,
590    #[doc(hidden)]
591    pub __source_breaking: fidl::marker::SourceBreaking,
592}
593
594impl fidl::Persistable for SecurityPolicy {}
595
596#[derive(Clone, Debug, Default, PartialEq)]
597pub struct Sources {
598    pub framework: Option<bool>,
599    pub builtin: Option<bool>,
600    pub capability: Option<bool>,
601    pub collection: Option<bool>,
602    pub namespace: Option<bool>,
603    pub component: Option<bool>,
604    pub capability_type: Option<String>,
605    #[doc(hidden)]
606    pub __source_breaking: fidl::marker::SourceBreaking,
607}
608
609impl fidl::Persistable for Sources {}
610
611#[derive(Clone, Debug, Default, PartialEq)]
612pub struct Void {
613    pub capability: Option<InternalCapability>,
614    pub moniker: Option<String>,
615    #[doc(hidden)]
616    pub __source_breaking: fidl::marker::SourceBreaking,
617}
618
619impl fidl::Persistable for Void {}
620
621#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
622pub enum AggregateCapability {
623    Service(String),
624}
625
626impl AggregateCapability {
627    #[inline]
628    pub fn ordinal(&self) -> u64 {
629        match *self {
630            Self::Service(_) => 1,
631        }
632    }
633
634    #[deprecated = "Strict unions should not use `is_unknown`"]
635    #[inline]
636    pub fn is_unknown(&self) -> bool {
637        false
638    }
639}
640
641impl fidl::Persistable for AggregateCapability {}
642
643#[derive(Clone, Debug, PartialEq)]
644pub enum AggregateMember {
645    Child(fidl_fuchsia_component_decl::ChildRef),
646    Collection(String),
647    Parent(fidl_fuchsia_component_decl::ParentRef),
648    Self_(fidl_fuchsia_component_decl::SelfRef),
649}
650
651impl AggregateMember {
652    #[inline]
653    pub fn ordinal(&self) -> u64 {
654        match *self {
655            Self::Child(_) => 1,
656            Self::Collection(_) => 2,
657            Self::Parent(_) => 3,
658            Self::Self_(_) => 4,
659        }
660    }
661
662    #[deprecated = "Strict unions should not use `is_unknown`"]
663    #[inline]
664    pub fn is_unknown(&self) -> bool {
665        false
666    }
667}
668
669impl fidl::Persistable for AggregateMember {}
670
671/// Represents the class of capabilities supported to be allowlisted.
672#[derive(Clone, Debug)]
673pub enum AllowlistedCapability {
674    Directory(AllowlistedDirectory),
675    Protocol(AllowlistedProtocol),
676    Service(AllowlistedService),
677    Storage(AllowlistedStorage),
678    Runner(AllowlistedRunner),
679    Resolver(AllowlistedResolver),
680    #[doc(hidden)]
681    __SourceBreaking {
682        unknown_ordinal: u64,
683    },
684}
685
686/// Pattern that matches an unknown `AllowlistedCapability` member.
687#[macro_export]
688macro_rules! AllowlistedCapabilityUnknown {
689    () => {
690        _
691    };
692}
693
694// Custom PartialEq so that unknown variants are not equal to themselves.
695impl PartialEq for AllowlistedCapability {
696    fn eq(&self, other: &Self) -> bool {
697        match (self, other) {
698            (Self::Directory(x), Self::Directory(y)) => *x == *y,
699            (Self::Protocol(x), Self::Protocol(y)) => *x == *y,
700            (Self::Service(x), Self::Service(y)) => *x == *y,
701            (Self::Storage(x), Self::Storage(y)) => *x == *y,
702            (Self::Runner(x), Self::Runner(y)) => *x == *y,
703            (Self::Resolver(x), Self::Resolver(y)) => *x == *y,
704            _ => false,
705        }
706    }
707}
708
709impl AllowlistedCapability {
710    #[inline]
711    pub fn ordinal(&self) -> u64 {
712        match *self {
713            Self::Directory(_) => 1,
714            Self::Protocol(_) => 3,
715            Self::Service(_) => 4,
716            Self::Storage(_) => 5,
717            Self::Runner(_) => 6,
718            Self::Resolver(_) => 7,
719            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
720        }
721    }
722
723    #[inline]
724    pub fn unknown_variant_for_testing() -> Self {
725        Self::__SourceBreaking { unknown_ordinal: 0 }
726    }
727
728    #[inline]
729    pub fn is_unknown(&self) -> bool {
730        match self {
731            Self::__SourceBreaking { .. } => true,
732            _ => false,
733        }
734    }
735}
736
737impl fidl::Persistable for AllowlistedCapability {}
738
739/// Represents the class of capabilities supported to be allowlisted.
740#[derive(Clone, Debug)]
741pub enum AllowlistedDebugRegistration {
742    Protocol(AllowlistedProtocol),
743    #[doc(hidden)]
744    __SourceBreaking {
745        unknown_ordinal: u64,
746    },
747}
748
749/// Pattern that matches an unknown `AllowlistedDebugRegistration` member.
750#[macro_export]
751macro_rules! AllowlistedDebugRegistrationUnknown {
752    () => {
753        _
754    };
755}
756
757// Custom PartialEq so that unknown variants are not equal to themselves.
758impl PartialEq for AllowlistedDebugRegistration {
759    fn eq(&self, other: &Self) -> bool {
760        match (self, other) {
761            (Self::Protocol(x), Self::Protocol(y)) => *x == *y,
762            _ => false,
763        }
764    }
765}
766
767impl AllowlistedDebugRegistration {
768    #[inline]
769    pub fn ordinal(&self) -> u64 {
770        match *self {
771            Self::Protocol(_) => 1,
772            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
773        }
774    }
775
776    #[inline]
777    pub fn unknown_variant_for_testing() -> Self {
778        Self::__SourceBreaking { unknown_ordinal: 0 }
779    }
780
781    #[inline]
782    pub fn is_unknown(&self) -> bool {
783        match self {
784            Self::__SourceBreaking { .. } => true,
785            _ => false,
786        }
787    }
788}
789
790impl fidl::Persistable for AllowlistedDebugRegistration {}
791
792#[derive(Clone, Debug, PartialEq)]
793pub enum CapabilitySource {
794    Component(Component),
795    Framework(Framework),
796    Builtin(Builtin),
797    Namespace(Namespace),
798    Capability(Capability),
799    AnonymizedAggregate(AnonymizedAggregate),
800    FilteredProvider(FilteredProvider),
801    FilteredAggregateProvider(FilteredAggregateProvider),
802    Environment(Environment),
803    Void(Void),
804}
805
806impl CapabilitySource {
807    #[inline]
808    pub fn ordinal(&self) -> u64 {
809        match *self {
810            Self::Component(_) => 1,
811            Self::Framework(_) => 2,
812            Self::Builtin(_) => 3,
813            Self::Namespace(_) => 4,
814            Self::Capability(_) => 5,
815            Self::AnonymizedAggregate(_) => 6,
816            Self::FilteredProvider(_) => 7,
817            Self::FilteredAggregateProvider(_) => 8,
818            Self::Environment(_) => 9,
819            Self::Void(_) => 10,
820        }
821    }
822
823    #[deprecated = "Strict unions should not use `is_unknown`"]
824    #[inline]
825    pub fn is_unknown(&self) -> bool {
826        false
827    }
828}
829
830impl fidl::Persistable for CapabilitySource {}
831
832#[derive(Clone, Debug, PartialEq)]
833pub enum ComponentCapability {
834    Use_(fidl_fuchsia_component_decl::Use),
835    Offer(fidl_fuchsia_component_decl::Offer),
836    Expose(fidl_fuchsia_component_decl::Expose),
837    Config(fidl_fuchsia_component_decl::Configuration),
838    Dictionary(fidl_fuchsia_component_decl::Dictionary),
839    Directory(fidl_fuchsia_component_decl::Directory),
840    Environment(EnvironmentCapability),
841    EventStream(fidl_fuchsia_component_decl::EventStream),
842    Protocol(fidl_fuchsia_component_decl::Protocol),
843    Resolver(fidl_fuchsia_component_decl::Resolver),
844    Runner(fidl_fuchsia_component_decl::Runner),
845    Service(fidl_fuchsia_component_decl::Service),
846    Storage(fidl_fuchsia_component_decl::Storage),
847}
848
849impl ComponentCapability {
850    #[inline]
851    pub fn ordinal(&self) -> u64 {
852        match *self {
853            Self::Use_(_) => 1,
854            Self::Offer(_) => 2,
855            Self::Expose(_) => 3,
856            Self::Config(_) => 4,
857            Self::Dictionary(_) => 5,
858            Self::Directory(_) => 6,
859            Self::Environment(_) => 7,
860            Self::EventStream(_) => 8,
861            Self::Protocol(_) => 9,
862            Self::Resolver(_) => 10,
863            Self::Runner(_) => 11,
864            Self::Service(_) => 12,
865            Self::Storage(_) => 13,
866        }
867    }
868
869    #[deprecated = "Strict unions should not use `is_unknown`"]
870    #[inline]
871    pub fn is_unknown(&self) -> bool {
872        false
873    }
874}
875
876impl fidl::Persistable for ComponentCapability {}
877
878#[derive(Clone, Debug, PartialEq)]
879pub enum EnvironmentCapability {
880    Runner(EnvironmentSource),
881    Resolver(EnvironmentSource),
882    Debug(EnvironmentSource),
883}
884
885impl EnvironmentCapability {
886    #[inline]
887    pub fn ordinal(&self) -> u64 {
888        match *self {
889            Self::Runner(_) => 1,
890            Self::Resolver(_) => 2,
891            Self::Debug(_) => 3,
892        }
893    }
894
895    #[deprecated = "Strict unions should not use `is_unknown`"]
896    #[inline]
897    pub fn is_unknown(&self) -> bool {
898        false
899    }
900}
901
902impl fidl::Persistable for EnvironmentCapability {}
903
904#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
905pub enum InternalCapability {
906    Config(String),
907    Dictionary(String),
908    Directory(String),
909    EventStream(String),
910    Protocol(String),
911    Resolver(String),
912    Runner(String),
913    Service(String),
914    Storage(String),
915}
916
917impl InternalCapability {
918    #[inline]
919    pub fn ordinal(&self) -> u64 {
920        match *self {
921            Self::Config(_) => 1,
922            Self::Dictionary(_) => 2,
923            Self::Directory(_) => 3,
924            Self::EventStream(_) => 4,
925            Self::Protocol(_) => 5,
926            Self::Resolver(_) => 6,
927            Self::Runner(_) => 7,
928            Self::Service(_) => 8,
929            Self::Storage(_) => 9,
930        }
931    }
932
933    #[deprecated = "Strict unions should not use `is_unknown`"]
934    #[inline]
935    pub fn is_unknown(&self) -> bool {
936        false
937    }
938}
939
940impl fidl::Persistable for InternalCapability {}
941
942mod internal {
943    use super::*;
944    unsafe impl fidl::encoding::TypeMarker for BuiltinBootResolver {
945        type Owned = Self;
946
947        #[inline(always)]
948        fn inline_align(_context: fidl::encoding::Context) -> usize {
949            std::mem::align_of::<u8>()
950        }
951
952        #[inline(always)]
953        fn inline_size(_context: fidl::encoding::Context) -> usize {
954            std::mem::size_of::<u8>()
955        }
956
957        #[inline(always)]
958        fn encode_is_copy() -> bool {
959            true
960        }
961
962        #[inline(always)]
963        fn decode_is_copy() -> bool {
964            false
965        }
966    }
967
968    impl fidl::encoding::ValueTypeMarker for BuiltinBootResolver {
969        type Borrowed<'a> = Self;
970        #[inline(always)]
971        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
972            *value
973        }
974    }
975
976    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
977        for BuiltinBootResolver
978    {
979        #[inline]
980        unsafe fn encode(
981            self,
982            encoder: &mut fidl::encoding::Encoder<'_, D>,
983            offset: usize,
984            _depth: fidl::encoding::Depth,
985        ) -> fidl::Result<()> {
986            encoder.debug_check_bounds::<Self>(offset);
987            encoder.write_num(self.into_primitive(), offset);
988            Ok(())
989        }
990    }
991
992    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BuiltinBootResolver {
993        #[inline(always)]
994        fn new_empty() -> Self {
995            Self::None
996        }
997
998        #[inline]
999        unsafe fn decode(
1000            &mut self,
1001            decoder: &mut fidl::encoding::Decoder<'_, D>,
1002            offset: usize,
1003            _depth: fidl::encoding::Depth,
1004        ) -> fidl::Result<()> {
1005            decoder.debug_check_bounds::<Self>(offset);
1006            let prim = decoder.read_num::<u8>(offset);
1007
1008            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1009            Ok(())
1010        }
1011    }
1012    unsafe impl fidl::encoding::TypeMarker for LogDestination {
1013        type Owned = Self;
1014
1015        #[inline(always)]
1016        fn inline_align(_context: fidl::encoding::Context) -> usize {
1017            std::mem::align_of::<u8>()
1018        }
1019
1020        #[inline(always)]
1021        fn inline_size(_context: fidl::encoding::Context) -> usize {
1022            std::mem::size_of::<u8>()
1023        }
1024
1025        #[inline(always)]
1026        fn encode_is_copy() -> bool {
1027            true
1028        }
1029
1030        #[inline(always)]
1031        fn decode_is_copy() -> bool {
1032            false
1033        }
1034    }
1035
1036    impl fidl::encoding::ValueTypeMarker for LogDestination {
1037        type Borrowed<'a> = Self;
1038        #[inline(always)]
1039        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1040            *value
1041        }
1042    }
1043
1044    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for LogDestination {
1045        #[inline]
1046        unsafe fn encode(
1047            self,
1048            encoder: &mut fidl::encoding::Encoder<'_, D>,
1049            offset: usize,
1050            _depth: fidl::encoding::Depth,
1051        ) -> fidl::Result<()> {
1052            encoder.debug_check_bounds::<Self>(offset);
1053            encoder.write_num(self.into_primitive(), offset);
1054            Ok(())
1055        }
1056    }
1057
1058    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogDestination {
1059        #[inline(always)]
1060        fn new_empty() -> Self {
1061            Self::Syslog
1062        }
1063
1064        #[inline]
1065        unsafe fn decode(
1066            &mut self,
1067            decoder: &mut fidl::encoding::Decoder<'_, D>,
1068            offset: usize,
1069            _depth: fidl::encoding::Depth,
1070        ) -> fidl::Result<()> {
1071            decoder.debug_check_bounds::<Self>(offset);
1072            let prim = decoder.read_num::<u8>(offset);
1073
1074            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1075            Ok(())
1076        }
1077    }
1078    unsafe impl fidl::encoding::TypeMarker for RealmBuilderResolverAndRunner {
1079        type Owned = Self;
1080
1081        #[inline(always)]
1082        fn inline_align(_context: fidl::encoding::Context) -> usize {
1083            std::mem::align_of::<u8>()
1084        }
1085
1086        #[inline(always)]
1087        fn inline_size(_context: fidl::encoding::Context) -> usize {
1088            std::mem::size_of::<u8>()
1089        }
1090
1091        #[inline(always)]
1092        fn encode_is_copy() -> bool {
1093            true
1094        }
1095
1096        #[inline(always)]
1097        fn decode_is_copy() -> bool {
1098            false
1099        }
1100    }
1101
1102    impl fidl::encoding::ValueTypeMarker for RealmBuilderResolverAndRunner {
1103        type Borrowed<'a> = Self;
1104        #[inline(always)]
1105        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1106            *value
1107        }
1108    }
1109
1110    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1111        for RealmBuilderResolverAndRunner
1112    {
1113        #[inline]
1114        unsafe fn encode(
1115            self,
1116            encoder: &mut fidl::encoding::Encoder<'_, D>,
1117            offset: usize,
1118            _depth: fidl::encoding::Depth,
1119        ) -> fidl::Result<()> {
1120            encoder.debug_check_bounds::<Self>(offset);
1121            encoder.write_num(self.into_primitive(), offset);
1122            Ok(())
1123        }
1124    }
1125
1126    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1127        for RealmBuilderResolverAndRunner
1128    {
1129        #[inline(always)]
1130        fn new_empty() -> Self {
1131            Self::None
1132        }
1133
1134        #[inline]
1135        unsafe fn decode(
1136            &mut self,
1137            decoder: &mut fidl::encoding::Decoder<'_, D>,
1138            offset: usize,
1139            _depth: fidl::encoding::Depth,
1140        ) -> fidl::Result<()> {
1141            decoder.debug_check_bounds::<Self>(offset);
1142            let prim = decoder.read_num::<u8>(offset);
1143
1144            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1145            Ok(())
1146        }
1147    }
1148    unsafe impl fidl::encoding::TypeMarker for TraceProvider {
1149        type Owned = Self;
1150
1151        #[inline(always)]
1152        fn inline_align(_context: fidl::encoding::Context) -> usize {
1153            std::mem::align_of::<u8>()
1154        }
1155
1156        #[inline(always)]
1157        fn inline_size(_context: fidl::encoding::Context) -> usize {
1158            std::mem::size_of::<u8>()
1159        }
1160
1161        #[inline(always)]
1162        fn encode_is_copy() -> bool {
1163            true
1164        }
1165
1166        #[inline(always)]
1167        fn decode_is_copy() -> bool {
1168            false
1169        }
1170    }
1171
1172    impl fidl::encoding::ValueTypeMarker for TraceProvider {
1173        type Borrowed<'a> = Self;
1174        #[inline(always)]
1175        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1176            *value
1177        }
1178    }
1179
1180    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TraceProvider {
1181        #[inline]
1182        unsafe fn encode(
1183            self,
1184            encoder: &mut fidl::encoding::Encoder<'_, D>,
1185            offset: usize,
1186            _depth: fidl::encoding::Depth,
1187        ) -> fidl::Result<()> {
1188            encoder.debug_check_bounds::<Self>(offset);
1189            encoder.write_num(self.into_primitive(), offset);
1190            Ok(())
1191        }
1192    }
1193
1194    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TraceProvider {
1195        #[inline(always)]
1196        fn new_empty() -> Self {
1197            Self::Namespace
1198        }
1199
1200        #[inline]
1201        unsafe fn decode(
1202            &mut self,
1203            decoder: &mut fidl::encoding::Decoder<'_, D>,
1204            offset: usize,
1205            _depth: fidl::encoding::Depth,
1206        ) -> fidl::Result<()> {
1207            decoder.debug_check_bounds::<Self>(offset);
1208            let prim = decoder.read_num::<u8>(offset);
1209
1210            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1211            Ok(())
1212        }
1213    }
1214    unsafe impl fidl::encoding::TypeMarker for VmexSource {
1215        type Owned = Self;
1216
1217        #[inline(always)]
1218        fn inline_align(_context: fidl::encoding::Context) -> usize {
1219            std::mem::align_of::<u8>()
1220        }
1221
1222        #[inline(always)]
1223        fn inline_size(_context: fidl::encoding::Context) -> usize {
1224            std::mem::size_of::<u8>()
1225        }
1226
1227        #[inline(always)]
1228        fn encode_is_copy() -> bool {
1229            true
1230        }
1231
1232        #[inline(always)]
1233        fn decode_is_copy() -> bool {
1234            false
1235        }
1236    }
1237
1238    impl fidl::encoding::ValueTypeMarker for VmexSource {
1239        type Borrowed<'a> = Self;
1240        #[inline(always)]
1241        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1242            *value
1243        }
1244    }
1245
1246    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for VmexSource {
1247        #[inline]
1248        unsafe fn encode(
1249            self,
1250            encoder: &mut fidl::encoding::Encoder<'_, D>,
1251            offset: usize,
1252            _depth: fidl::encoding::Depth,
1253        ) -> fidl::Result<()> {
1254            encoder.debug_check_bounds::<Self>(offset);
1255            encoder.write_num(self.into_primitive(), offset);
1256            Ok(())
1257        }
1258    }
1259
1260    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VmexSource {
1261        #[inline(always)]
1262        fn new_empty() -> Self {
1263            Self::SystemResource
1264        }
1265
1266        #[inline]
1267        unsafe fn decode(
1268            &mut self,
1269            decoder: &mut fidl::encoding::Decoder<'_, D>,
1270            offset: usize,
1271            _depth: fidl::encoding::Depth,
1272        ) -> fidl::Result<()> {
1273            decoder.debug_check_bounds::<Self>(offset);
1274            let prim = decoder.read_num::<u8>(offset);
1275
1276            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1277            Ok(())
1278        }
1279    }
1280
1281    impl AbiRevisionPolicy {
1282        #[inline(always)]
1283        fn max_ordinal_present(&self) -> u64 {
1284            if let Some(_) = self.allowlist {
1285                return 1;
1286            }
1287            0
1288        }
1289    }
1290
1291    impl fidl::encoding::ValueTypeMarker for AbiRevisionPolicy {
1292        type Borrowed<'a> = &'a Self;
1293        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1294            value
1295        }
1296    }
1297
1298    unsafe impl fidl::encoding::TypeMarker for AbiRevisionPolicy {
1299        type Owned = Self;
1300
1301        #[inline(always)]
1302        fn inline_align(_context: fidl::encoding::Context) -> usize {
1303            8
1304        }
1305
1306        #[inline(always)]
1307        fn inline_size(_context: fidl::encoding::Context) -> usize {
1308            16
1309        }
1310    }
1311
1312    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AbiRevisionPolicy, D>
1313        for &AbiRevisionPolicy
1314    {
1315        unsafe fn encode(
1316            self,
1317            encoder: &mut fidl::encoding::Encoder<'_, D>,
1318            offset: usize,
1319            mut depth: fidl::encoding::Depth,
1320        ) -> fidl::Result<()> {
1321            encoder.debug_check_bounds::<AbiRevisionPolicy>(offset);
1322            // Vector header
1323            let max_ordinal: u64 = self.max_ordinal_present();
1324            encoder.write_num(max_ordinal, offset);
1325            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1326            // Calling encoder.out_of_line_offset(0) is not allowed.
1327            if max_ordinal == 0 {
1328                return Ok(());
1329            }
1330            depth.increment()?;
1331            let envelope_size = 8;
1332            let bytes_len = max_ordinal as usize * envelope_size;
1333            #[allow(unused_variables)]
1334            let offset = encoder.out_of_line_offset(bytes_len);
1335            let mut _prev_end_offset: usize = 0;
1336            if 1 > max_ordinal {
1337                return Ok(());
1338            }
1339
1340            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1341            // are envelope_size bytes.
1342            let cur_offset: usize = (1 - 1) * envelope_size;
1343
1344            // Zero reserved fields.
1345            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1346
1347            // Safety:
1348            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1349            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1350            //   envelope_size bytes, there is always sufficient room.
1351            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>, D>(
1352            self.allowlist.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128> as fidl::encoding::ValueTypeMarker>::borrow),
1353            encoder, offset + cur_offset, depth
1354        )?;
1355
1356            _prev_end_offset = cur_offset + envelope_size;
1357
1358            Ok(())
1359        }
1360    }
1361
1362    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AbiRevisionPolicy {
1363        #[inline(always)]
1364        fn new_empty() -> Self {
1365            Self::default()
1366        }
1367
1368        unsafe fn decode(
1369            &mut self,
1370            decoder: &mut fidl::encoding::Decoder<'_, D>,
1371            offset: usize,
1372            mut depth: fidl::encoding::Depth,
1373        ) -> fidl::Result<()> {
1374            decoder.debug_check_bounds::<Self>(offset);
1375            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1376                None => return Err(fidl::Error::NotNullable),
1377                Some(len) => len,
1378            };
1379            // Calling decoder.out_of_line_offset(0) is not allowed.
1380            if len == 0 {
1381                return Ok(());
1382            };
1383            depth.increment()?;
1384            let envelope_size = 8;
1385            let bytes_len = len * envelope_size;
1386            let offset = decoder.out_of_line_offset(bytes_len)?;
1387            // Decode the envelope for each type.
1388            let mut _next_ordinal_to_read = 0;
1389            let mut next_offset = offset;
1390            let end_offset = offset + bytes_len;
1391            _next_ordinal_to_read += 1;
1392            if next_offset >= end_offset {
1393                return Ok(());
1394            }
1395
1396            // Decode unknown envelopes for gaps in ordinals.
1397            while _next_ordinal_to_read < 1 {
1398                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1399                _next_ordinal_to_read += 1;
1400                next_offset += envelope_size;
1401            }
1402
1403            let next_out_of_line = decoder.next_out_of_line();
1404            let handles_before = decoder.remaining_handles();
1405            if let Some((inlined, num_bytes, num_handles)) =
1406                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1407            {
1408                let member_inline_size = <fidl::encoding::Vector<
1409                    fidl::encoding::BoundedString<4096>,
1410                    128,
1411                > as fidl::encoding::TypeMarker>::inline_size(
1412                    decoder.context
1413                );
1414                if inlined != (member_inline_size <= 4) {
1415                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1416                }
1417                let inner_offset;
1418                let mut inner_depth = depth.clone();
1419                if inlined {
1420                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1421                    inner_offset = next_offset;
1422                } else {
1423                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1424                    inner_depth.increment()?;
1425                }
1426                let val_ref = self.allowlist.get_or_insert_with(|| {
1427                    fidl::new_empty!(
1428                        fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>,
1429                        D
1430                    )
1431                });
1432                fidl::decode!(
1433                    fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>,
1434                    D,
1435                    val_ref,
1436                    decoder,
1437                    inner_offset,
1438                    inner_depth
1439                )?;
1440                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1441                {
1442                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1443                }
1444                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1445                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1446                }
1447            }
1448
1449            next_offset += envelope_size;
1450
1451            // Decode the remaining unknown envelopes.
1452            while next_offset < end_offset {
1453                _next_ordinal_to_read += 1;
1454                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1455                next_offset += envelope_size;
1456            }
1457
1458            Ok(())
1459        }
1460    }
1461
1462    impl AllowlistedDirectory {
1463        #[inline(always)]
1464        fn max_ordinal_present(&self) -> u64 {
1465            0
1466        }
1467    }
1468
1469    impl fidl::encoding::ValueTypeMarker for AllowlistedDirectory {
1470        type Borrowed<'a> = &'a Self;
1471        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1472            value
1473        }
1474    }
1475
1476    unsafe impl fidl::encoding::TypeMarker for AllowlistedDirectory {
1477        type Owned = Self;
1478
1479        #[inline(always)]
1480        fn inline_align(_context: fidl::encoding::Context) -> usize {
1481            8
1482        }
1483
1484        #[inline(always)]
1485        fn inline_size(_context: fidl::encoding::Context) -> usize {
1486            16
1487        }
1488    }
1489
1490    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AllowlistedDirectory, D>
1491        for &AllowlistedDirectory
1492    {
1493        unsafe fn encode(
1494            self,
1495            encoder: &mut fidl::encoding::Encoder<'_, D>,
1496            offset: usize,
1497            mut depth: fidl::encoding::Depth,
1498        ) -> fidl::Result<()> {
1499            encoder.debug_check_bounds::<AllowlistedDirectory>(offset);
1500            // Vector header
1501            let max_ordinal: u64 = self.max_ordinal_present();
1502            encoder.write_num(max_ordinal, offset);
1503            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1504            // Calling encoder.out_of_line_offset(0) is not allowed.
1505            if max_ordinal == 0 {
1506                return Ok(());
1507            }
1508            depth.increment()?;
1509            let envelope_size = 8;
1510            let bytes_len = max_ordinal as usize * envelope_size;
1511            #[allow(unused_variables)]
1512            let offset = encoder.out_of_line_offset(bytes_len);
1513            let mut _prev_end_offset: usize = 0;
1514
1515            Ok(())
1516        }
1517    }
1518
1519    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AllowlistedDirectory {
1520        #[inline(always)]
1521        fn new_empty() -> Self {
1522            Self::default()
1523        }
1524
1525        unsafe fn decode(
1526            &mut self,
1527            decoder: &mut fidl::encoding::Decoder<'_, D>,
1528            offset: usize,
1529            mut depth: fidl::encoding::Depth,
1530        ) -> fidl::Result<()> {
1531            decoder.debug_check_bounds::<Self>(offset);
1532            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1533                None => return Err(fidl::Error::NotNullable),
1534                Some(len) => len,
1535            };
1536            // Calling decoder.out_of_line_offset(0) is not allowed.
1537            if len == 0 {
1538                return Ok(());
1539            };
1540            depth.increment()?;
1541            let envelope_size = 8;
1542            let bytes_len = len * envelope_size;
1543            let offset = decoder.out_of_line_offset(bytes_len)?;
1544            // Decode the envelope for each type.
1545            let mut _next_ordinal_to_read = 0;
1546            let mut next_offset = offset;
1547            let end_offset = offset + bytes_len;
1548
1549            // Decode the remaining unknown envelopes.
1550            while next_offset < end_offset {
1551                _next_ordinal_to_read += 1;
1552                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1553                next_offset += envelope_size;
1554            }
1555
1556            Ok(())
1557        }
1558    }
1559
1560    impl AllowlistedProtocol {
1561        #[inline(always)]
1562        fn max_ordinal_present(&self) -> u64 {
1563            0
1564        }
1565    }
1566
1567    impl fidl::encoding::ValueTypeMarker for AllowlistedProtocol {
1568        type Borrowed<'a> = &'a Self;
1569        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1570            value
1571        }
1572    }
1573
1574    unsafe impl fidl::encoding::TypeMarker for AllowlistedProtocol {
1575        type Owned = Self;
1576
1577        #[inline(always)]
1578        fn inline_align(_context: fidl::encoding::Context) -> usize {
1579            8
1580        }
1581
1582        #[inline(always)]
1583        fn inline_size(_context: fidl::encoding::Context) -> usize {
1584            16
1585        }
1586    }
1587
1588    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AllowlistedProtocol, D>
1589        for &AllowlistedProtocol
1590    {
1591        unsafe fn encode(
1592            self,
1593            encoder: &mut fidl::encoding::Encoder<'_, D>,
1594            offset: usize,
1595            mut depth: fidl::encoding::Depth,
1596        ) -> fidl::Result<()> {
1597            encoder.debug_check_bounds::<AllowlistedProtocol>(offset);
1598            // Vector header
1599            let max_ordinal: u64 = self.max_ordinal_present();
1600            encoder.write_num(max_ordinal, offset);
1601            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1602            // Calling encoder.out_of_line_offset(0) is not allowed.
1603            if max_ordinal == 0 {
1604                return Ok(());
1605            }
1606            depth.increment()?;
1607            let envelope_size = 8;
1608            let bytes_len = max_ordinal as usize * envelope_size;
1609            #[allow(unused_variables)]
1610            let offset = encoder.out_of_line_offset(bytes_len);
1611            let mut _prev_end_offset: usize = 0;
1612
1613            Ok(())
1614        }
1615    }
1616
1617    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AllowlistedProtocol {
1618        #[inline(always)]
1619        fn new_empty() -> Self {
1620            Self::default()
1621        }
1622
1623        unsafe fn decode(
1624            &mut self,
1625            decoder: &mut fidl::encoding::Decoder<'_, D>,
1626            offset: usize,
1627            mut depth: fidl::encoding::Depth,
1628        ) -> fidl::Result<()> {
1629            decoder.debug_check_bounds::<Self>(offset);
1630            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1631                None => return Err(fidl::Error::NotNullable),
1632                Some(len) => len,
1633            };
1634            // Calling decoder.out_of_line_offset(0) is not allowed.
1635            if len == 0 {
1636                return Ok(());
1637            };
1638            depth.increment()?;
1639            let envelope_size = 8;
1640            let bytes_len = len * envelope_size;
1641            let offset = decoder.out_of_line_offset(bytes_len)?;
1642            // Decode the envelope for each type.
1643            let mut _next_ordinal_to_read = 0;
1644            let mut next_offset = offset;
1645            let end_offset = offset + bytes_len;
1646
1647            // Decode the remaining unknown envelopes.
1648            while next_offset < end_offset {
1649                _next_ordinal_to_read += 1;
1650                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1651                next_offset += envelope_size;
1652            }
1653
1654            Ok(())
1655        }
1656    }
1657
1658    impl AllowlistedResolver {
1659        #[inline(always)]
1660        fn max_ordinal_present(&self) -> u64 {
1661            0
1662        }
1663    }
1664
1665    impl fidl::encoding::ValueTypeMarker for AllowlistedResolver {
1666        type Borrowed<'a> = &'a Self;
1667        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1668            value
1669        }
1670    }
1671
1672    unsafe impl fidl::encoding::TypeMarker for AllowlistedResolver {
1673        type Owned = Self;
1674
1675        #[inline(always)]
1676        fn inline_align(_context: fidl::encoding::Context) -> usize {
1677            8
1678        }
1679
1680        #[inline(always)]
1681        fn inline_size(_context: fidl::encoding::Context) -> usize {
1682            16
1683        }
1684    }
1685
1686    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AllowlistedResolver, D>
1687        for &AllowlistedResolver
1688    {
1689        unsafe fn encode(
1690            self,
1691            encoder: &mut fidl::encoding::Encoder<'_, D>,
1692            offset: usize,
1693            mut depth: fidl::encoding::Depth,
1694        ) -> fidl::Result<()> {
1695            encoder.debug_check_bounds::<AllowlistedResolver>(offset);
1696            // Vector header
1697            let max_ordinal: u64 = self.max_ordinal_present();
1698            encoder.write_num(max_ordinal, offset);
1699            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1700            // Calling encoder.out_of_line_offset(0) is not allowed.
1701            if max_ordinal == 0 {
1702                return Ok(());
1703            }
1704            depth.increment()?;
1705            let envelope_size = 8;
1706            let bytes_len = max_ordinal as usize * envelope_size;
1707            #[allow(unused_variables)]
1708            let offset = encoder.out_of_line_offset(bytes_len);
1709            let mut _prev_end_offset: usize = 0;
1710
1711            Ok(())
1712        }
1713    }
1714
1715    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AllowlistedResolver {
1716        #[inline(always)]
1717        fn new_empty() -> Self {
1718            Self::default()
1719        }
1720
1721        unsafe fn decode(
1722            &mut self,
1723            decoder: &mut fidl::encoding::Decoder<'_, D>,
1724            offset: usize,
1725            mut depth: fidl::encoding::Depth,
1726        ) -> fidl::Result<()> {
1727            decoder.debug_check_bounds::<Self>(offset);
1728            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1729                None => return Err(fidl::Error::NotNullable),
1730                Some(len) => len,
1731            };
1732            // Calling decoder.out_of_line_offset(0) is not allowed.
1733            if len == 0 {
1734                return Ok(());
1735            };
1736            depth.increment()?;
1737            let envelope_size = 8;
1738            let bytes_len = len * envelope_size;
1739            let offset = decoder.out_of_line_offset(bytes_len)?;
1740            // Decode the envelope for each type.
1741            let mut _next_ordinal_to_read = 0;
1742            let mut next_offset = offset;
1743            let end_offset = offset + bytes_len;
1744
1745            // Decode the remaining unknown envelopes.
1746            while next_offset < end_offset {
1747                _next_ordinal_to_read += 1;
1748                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1749                next_offset += envelope_size;
1750            }
1751
1752            Ok(())
1753        }
1754    }
1755
1756    impl AllowlistedRunner {
1757        #[inline(always)]
1758        fn max_ordinal_present(&self) -> u64 {
1759            0
1760        }
1761    }
1762
1763    impl fidl::encoding::ValueTypeMarker for AllowlistedRunner {
1764        type Borrowed<'a> = &'a Self;
1765        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1766            value
1767        }
1768    }
1769
1770    unsafe impl fidl::encoding::TypeMarker for AllowlistedRunner {
1771        type Owned = Self;
1772
1773        #[inline(always)]
1774        fn inline_align(_context: fidl::encoding::Context) -> usize {
1775            8
1776        }
1777
1778        #[inline(always)]
1779        fn inline_size(_context: fidl::encoding::Context) -> usize {
1780            16
1781        }
1782    }
1783
1784    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AllowlistedRunner, D>
1785        for &AllowlistedRunner
1786    {
1787        unsafe fn encode(
1788            self,
1789            encoder: &mut fidl::encoding::Encoder<'_, D>,
1790            offset: usize,
1791            mut depth: fidl::encoding::Depth,
1792        ) -> fidl::Result<()> {
1793            encoder.debug_check_bounds::<AllowlistedRunner>(offset);
1794            // Vector header
1795            let max_ordinal: u64 = self.max_ordinal_present();
1796            encoder.write_num(max_ordinal, offset);
1797            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1798            // Calling encoder.out_of_line_offset(0) is not allowed.
1799            if max_ordinal == 0 {
1800                return Ok(());
1801            }
1802            depth.increment()?;
1803            let envelope_size = 8;
1804            let bytes_len = max_ordinal as usize * envelope_size;
1805            #[allow(unused_variables)]
1806            let offset = encoder.out_of_line_offset(bytes_len);
1807            let mut _prev_end_offset: usize = 0;
1808
1809            Ok(())
1810        }
1811    }
1812
1813    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AllowlistedRunner {
1814        #[inline(always)]
1815        fn new_empty() -> Self {
1816            Self::default()
1817        }
1818
1819        unsafe fn decode(
1820            &mut self,
1821            decoder: &mut fidl::encoding::Decoder<'_, D>,
1822            offset: usize,
1823            mut depth: fidl::encoding::Depth,
1824        ) -> fidl::Result<()> {
1825            decoder.debug_check_bounds::<Self>(offset);
1826            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1827                None => return Err(fidl::Error::NotNullable),
1828                Some(len) => len,
1829            };
1830            // Calling decoder.out_of_line_offset(0) is not allowed.
1831            if len == 0 {
1832                return Ok(());
1833            };
1834            depth.increment()?;
1835            let envelope_size = 8;
1836            let bytes_len = len * envelope_size;
1837            let offset = decoder.out_of_line_offset(bytes_len)?;
1838            // Decode the envelope for each type.
1839            let mut _next_ordinal_to_read = 0;
1840            let mut next_offset = offset;
1841            let end_offset = offset + bytes_len;
1842
1843            // Decode the remaining unknown envelopes.
1844            while next_offset < end_offset {
1845                _next_ordinal_to_read += 1;
1846                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1847                next_offset += envelope_size;
1848            }
1849
1850            Ok(())
1851        }
1852    }
1853
1854    impl AllowlistedService {
1855        #[inline(always)]
1856        fn max_ordinal_present(&self) -> u64 {
1857            0
1858        }
1859    }
1860
1861    impl fidl::encoding::ValueTypeMarker for AllowlistedService {
1862        type Borrowed<'a> = &'a Self;
1863        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1864            value
1865        }
1866    }
1867
1868    unsafe impl fidl::encoding::TypeMarker for AllowlistedService {
1869        type Owned = Self;
1870
1871        #[inline(always)]
1872        fn inline_align(_context: fidl::encoding::Context) -> usize {
1873            8
1874        }
1875
1876        #[inline(always)]
1877        fn inline_size(_context: fidl::encoding::Context) -> usize {
1878            16
1879        }
1880    }
1881
1882    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AllowlistedService, D>
1883        for &AllowlistedService
1884    {
1885        unsafe fn encode(
1886            self,
1887            encoder: &mut fidl::encoding::Encoder<'_, D>,
1888            offset: usize,
1889            mut depth: fidl::encoding::Depth,
1890        ) -> fidl::Result<()> {
1891            encoder.debug_check_bounds::<AllowlistedService>(offset);
1892            // Vector header
1893            let max_ordinal: u64 = self.max_ordinal_present();
1894            encoder.write_num(max_ordinal, offset);
1895            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1896            // Calling encoder.out_of_line_offset(0) is not allowed.
1897            if max_ordinal == 0 {
1898                return Ok(());
1899            }
1900            depth.increment()?;
1901            let envelope_size = 8;
1902            let bytes_len = max_ordinal as usize * envelope_size;
1903            #[allow(unused_variables)]
1904            let offset = encoder.out_of_line_offset(bytes_len);
1905            let mut _prev_end_offset: usize = 0;
1906
1907            Ok(())
1908        }
1909    }
1910
1911    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AllowlistedService {
1912        #[inline(always)]
1913        fn new_empty() -> Self {
1914            Self::default()
1915        }
1916
1917        unsafe fn decode(
1918            &mut self,
1919            decoder: &mut fidl::encoding::Decoder<'_, D>,
1920            offset: usize,
1921            mut depth: fidl::encoding::Depth,
1922        ) -> fidl::Result<()> {
1923            decoder.debug_check_bounds::<Self>(offset);
1924            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1925                None => return Err(fidl::Error::NotNullable),
1926                Some(len) => len,
1927            };
1928            // Calling decoder.out_of_line_offset(0) is not allowed.
1929            if len == 0 {
1930                return Ok(());
1931            };
1932            depth.increment()?;
1933            let envelope_size = 8;
1934            let bytes_len = len * envelope_size;
1935            let offset = decoder.out_of_line_offset(bytes_len)?;
1936            // Decode the envelope for each type.
1937            let mut _next_ordinal_to_read = 0;
1938            let mut next_offset = offset;
1939            let end_offset = offset + bytes_len;
1940
1941            // Decode the remaining unknown envelopes.
1942            while next_offset < end_offset {
1943                _next_ordinal_to_read += 1;
1944                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1945                next_offset += envelope_size;
1946            }
1947
1948            Ok(())
1949        }
1950    }
1951
1952    impl AllowlistedStorage {
1953        #[inline(always)]
1954        fn max_ordinal_present(&self) -> u64 {
1955            0
1956        }
1957    }
1958
1959    impl fidl::encoding::ValueTypeMarker for AllowlistedStorage {
1960        type Borrowed<'a> = &'a Self;
1961        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1962            value
1963        }
1964    }
1965
1966    unsafe impl fidl::encoding::TypeMarker for AllowlistedStorage {
1967        type Owned = Self;
1968
1969        #[inline(always)]
1970        fn inline_align(_context: fidl::encoding::Context) -> usize {
1971            8
1972        }
1973
1974        #[inline(always)]
1975        fn inline_size(_context: fidl::encoding::Context) -> usize {
1976            16
1977        }
1978    }
1979
1980    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AllowlistedStorage, D>
1981        for &AllowlistedStorage
1982    {
1983        unsafe fn encode(
1984            self,
1985            encoder: &mut fidl::encoding::Encoder<'_, D>,
1986            offset: usize,
1987            mut depth: fidl::encoding::Depth,
1988        ) -> fidl::Result<()> {
1989            encoder.debug_check_bounds::<AllowlistedStorage>(offset);
1990            // Vector header
1991            let max_ordinal: u64 = self.max_ordinal_present();
1992            encoder.write_num(max_ordinal, offset);
1993            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1994            // Calling encoder.out_of_line_offset(0) is not allowed.
1995            if max_ordinal == 0 {
1996                return Ok(());
1997            }
1998            depth.increment()?;
1999            let envelope_size = 8;
2000            let bytes_len = max_ordinal as usize * envelope_size;
2001            #[allow(unused_variables)]
2002            let offset = encoder.out_of_line_offset(bytes_len);
2003            let mut _prev_end_offset: usize = 0;
2004
2005            Ok(())
2006        }
2007    }
2008
2009    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AllowlistedStorage {
2010        #[inline(always)]
2011        fn new_empty() -> Self {
2012            Self::default()
2013        }
2014
2015        unsafe fn decode(
2016            &mut self,
2017            decoder: &mut fidl::encoding::Decoder<'_, D>,
2018            offset: usize,
2019            mut depth: fidl::encoding::Depth,
2020        ) -> fidl::Result<()> {
2021            decoder.debug_check_bounds::<Self>(offset);
2022            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2023                None => return Err(fidl::Error::NotNullable),
2024                Some(len) => len,
2025            };
2026            // Calling decoder.out_of_line_offset(0) is not allowed.
2027            if len == 0 {
2028                return Ok(());
2029            };
2030            depth.increment()?;
2031            let envelope_size = 8;
2032            let bytes_len = len * envelope_size;
2033            let offset = decoder.out_of_line_offset(bytes_len)?;
2034            // Decode the envelope for each type.
2035            let mut _next_ordinal_to_read = 0;
2036            let mut next_offset = offset;
2037            let end_offset = offset + bytes_len;
2038
2039            // Decode the remaining unknown envelopes.
2040            while next_offset < end_offset {
2041                _next_ordinal_to_read += 1;
2042                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2043                next_offset += envelope_size;
2044            }
2045
2046            Ok(())
2047        }
2048    }
2049
2050    impl AnonymizedAggregate {
2051        #[inline(always)]
2052        fn max_ordinal_present(&self) -> u64 {
2053            if let Some(_) = self.instances {
2054                return 5;
2055            }
2056            if let Some(_) = self.sources {
2057                return 4;
2058            }
2059            if let Some(_) = self.members {
2060                return 3;
2061            }
2062            if let Some(_) = self.moniker {
2063                return 2;
2064            }
2065            if let Some(_) = self.capability {
2066                return 1;
2067            }
2068            0
2069        }
2070    }
2071
2072    impl fidl::encoding::ValueTypeMarker for AnonymizedAggregate {
2073        type Borrowed<'a> = &'a Self;
2074        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2075            value
2076        }
2077    }
2078
2079    unsafe impl fidl::encoding::TypeMarker for AnonymizedAggregate {
2080        type Owned = Self;
2081
2082        #[inline(always)]
2083        fn inline_align(_context: fidl::encoding::Context) -> usize {
2084            8
2085        }
2086
2087        #[inline(always)]
2088        fn inline_size(_context: fidl::encoding::Context) -> usize {
2089            16
2090        }
2091    }
2092
2093    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AnonymizedAggregate, D>
2094        for &AnonymizedAggregate
2095    {
2096        unsafe fn encode(
2097            self,
2098            encoder: &mut fidl::encoding::Encoder<'_, D>,
2099            offset: usize,
2100            mut depth: fidl::encoding::Depth,
2101        ) -> fidl::Result<()> {
2102            encoder.debug_check_bounds::<AnonymizedAggregate>(offset);
2103            // Vector header
2104            let max_ordinal: u64 = self.max_ordinal_present();
2105            encoder.write_num(max_ordinal, offset);
2106            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2107            // Calling encoder.out_of_line_offset(0) is not allowed.
2108            if max_ordinal == 0 {
2109                return Ok(());
2110            }
2111            depth.increment()?;
2112            let envelope_size = 8;
2113            let bytes_len = max_ordinal as usize * envelope_size;
2114            #[allow(unused_variables)]
2115            let offset = encoder.out_of_line_offset(bytes_len);
2116            let mut _prev_end_offset: usize = 0;
2117            if 1 > max_ordinal {
2118                return Ok(());
2119            }
2120
2121            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2122            // are envelope_size bytes.
2123            let cur_offset: usize = (1 - 1) * envelope_size;
2124
2125            // Zero reserved fields.
2126            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2127
2128            // Safety:
2129            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2130            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2131            //   envelope_size bytes, there is always sufficient room.
2132            fidl::encoding::encode_in_envelope_optional::<AggregateCapability, D>(
2133                self.capability
2134                    .as_ref()
2135                    .map(<AggregateCapability as fidl::encoding::ValueTypeMarker>::borrow),
2136                encoder,
2137                offset + cur_offset,
2138                depth,
2139            )?;
2140
2141            _prev_end_offset = cur_offset + envelope_size;
2142            if 2 > max_ordinal {
2143                return Ok(());
2144            }
2145
2146            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2147            // are envelope_size bytes.
2148            let cur_offset: usize = (2 - 1) * envelope_size;
2149
2150            // Zero reserved fields.
2151            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2152
2153            // Safety:
2154            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2155            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2156            //   envelope_size bytes, there is always sufficient room.
2157            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
2158            self.moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
2159            encoder, offset + cur_offset, depth
2160        )?;
2161
2162            _prev_end_offset = cur_offset + envelope_size;
2163            if 3 > max_ordinal {
2164                return Ok(());
2165            }
2166
2167            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2168            // are envelope_size bytes.
2169            let cur_offset: usize = (3 - 1) * envelope_size;
2170
2171            // Zero reserved fields.
2172            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2173
2174            // Safety:
2175            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2176            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2177            //   envelope_size bytes, there is always sufficient room.
2178            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<AggregateMember>, D>(
2179            self.members.as_ref().map(<fidl::encoding::UnboundedVector<AggregateMember> as fidl::encoding::ValueTypeMarker>::borrow),
2180            encoder, offset + cur_offset, depth
2181        )?;
2182
2183            _prev_end_offset = cur_offset + envelope_size;
2184            if 4 > max_ordinal {
2185                return Ok(());
2186            }
2187
2188            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2189            // are envelope_size bytes.
2190            let cur_offset: usize = (4 - 1) * envelope_size;
2191
2192            // Zero reserved fields.
2193            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2194
2195            // Safety:
2196            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2197            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2198            //   envelope_size bytes, there is always sufficient room.
2199            fidl::encoding::encode_in_envelope_optional::<Sources, D>(
2200                self.sources.as_ref().map(<Sources as fidl::encoding::ValueTypeMarker>::borrow),
2201                encoder,
2202                offset + cur_offset,
2203                depth,
2204            )?;
2205
2206            _prev_end_offset = cur_offset + envelope_size;
2207            if 5 > max_ordinal {
2208                return Ok(());
2209            }
2210
2211            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2212            // are envelope_size bytes.
2213            let cur_offset: usize = (5 - 1) * envelope_size;
2214
2215            // Zero reserved fields.
2216            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2217
2218            // Safety:
2219            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2220            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2221            //   envelope_size bytes, there is always sufficient room.
2222            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_sys2::ServiceInstance>, D>(
2223            self.instances.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_sys2::ServiceInstance> as fidl::encoding::ValueTypeMarker>::borrow),
2224            encoder, offset + cur_offset, depth
2225        )?;
2226
2227            _prev_end_offset = cur_offset + envelope_size;
2228
2229            Ok(())
2230        }
2231    }
2232
2233    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AnonymizedAggregate {
2234        #[inline(always)]
2235        fn new_empty() -> Self {
2236            Self::default()
2237        }
2238
2239        unsafe fn decode(
2240            &mut self,
2241            decoder: &mut fidl::encoding::Decoder<'_, D>,
2242            offset: usize,
2243            mut depth: fidl::encoding::Depth,
2244        ) -> fidl::Result<()> {
2245            decoder.debug_check_bounds::<Self>(offset);
2246            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2247                None => return Err(fidl::Error::NotNullable),
2248                Some(len) => len,
2249            };
2250            // Calling decoder.out_of_line_offset(0) is not allowed.
2251            if len == 0 {
2252                return Ok(());
2253            };
2254            depth.increment()?;
2255            let envelope_size = 8;
2256            let bytes_len = len * envelope_size;
2257            let offset = decoder.out_of_line_offset(bytes_len)?;
2258            // Decode the envelope for each type.
2259            let mut _next_ordinal_to_read = 0;
2260            let mut next_offset = offset;
2261            let end_offset = offset + bytes_len;
2262            _next_ordinal_to_read += 1;
2263            if next_offset >= end_offset {
2264                return Ok(());
2265            }
2266
2267            // Decode unknown envelopes for gaps in ordinals.
2268            while _next_ordinal_to_read < 1 {
2269                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2270                _next_ordinal_to_read += 1;
2271                next_offset += envelope_size;
2272            }
2273
2274            let next_out_of_line = decoder.next_out_of_line();
2275            let handles_before = decoder.remaining_handles();
2276            if let Some((inlined, num_bytes, num_handles)) =
2277                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2278            {
2279                let member_inline_size =
2280                    <AggregateCapability as fidl::encoding::TypeMarker>::inline_size(
2281                        decoder.context,
2282                    );
2283                if inlined != (member_inline_size <= 4) {
2284                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2285                }
2286                let inner_offset;
2287                let mut inner_depth = depth.clone();
2288                if inlined {
2289                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2290                    inner_offset = next_offset;
2291                } else {
2292                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2293                    inner_depth.increment()?;
2294                }
2295                let val_ref =
2296                    self.capability.get_or_insert_with(|| fidl::new_empty!(AggregateCapability, D));
2297                fidl::decode!(AggregateCapability, D, val_ref, decoder, inner_offset, inner_depth)?;
2298                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2299                {
2300                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2301                }
2302                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2303                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2304                }
2305            }
2306
2307            next_offset += envelope_size;
2308            _next_ordinal_to_read += 1;
2309            if next_offset >= end_offset {
2310                return Ok(());
2311            }
2312
2313            // Decode unknown envelopes for gaps in ordinals.
2314            while _next_ordinal_to_read < 2 {
2315                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2316                _next_ordinal_to_read += 1;
2317                next_offset += envelope_size;
2318            }
2319
2320            let next_out_of_line = decoder.next_out_of_line();
2321            let handles_before = decoder.remaining_handles();
2322            if let Some((inlined, num_bytes, num_handles)) =
2323                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2324            {
2325                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2326                if inlined != (member_inline_size <= 4) {
2327                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2328                }
2329                let inner_offset;
2330                let mut inner_depth = depth.clone();
2331                if inlined {
2332                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2333                    inner_offset = next_offset;
2334                } else {
2335                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2336                    inner_depth.increment()?;
2337                }
2338                let val_ref = self.moniker.get_or_insert_with(|| {
2339                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
2340                });
2341                fidl::decode!(
2342                    fidl::encoding::BoundedString<4096>,
2343                    D,
2344                    val_ref,
2345                    decoder,
2346                    inner_offset,
2347                    inner_depth
2348                )?;
2349                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2350                {
2351                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2352                }
2353                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2354                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2355                }
2356            }
2357
2358            next_offset += envelope_size;
2359            _next_ordinal_to_read += 1;
2360            if next_offset >= end_offset {
2361                return Ok(());
2362            }
2363
2364            // Decode unknown envelopes for gaps in ordinals.
2365            while _next_ordinal_to_read < 3 {
2366                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2367                _next_ordinal_to_read += 1;
2368                next_offset += envelope_size;
2369            }
2370
2371            let next_out_of_line = decoder.next_out_of_line();
2372            let handles_before = decoder.remaining_handles();
2373            if let Some((inlined, num_bytes, num_handles)) =
2374                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2375            {
2376                let member_inline_size = <fidl::encoding::UnboundedVector<AggregateMember> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2377                if inlined != (member_inline_size <= 4) {
2378                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2379                }
2380                let inner_offset;
2381                let mut inner_depth = depth.clone();
2382                if inlined {
2383                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2384                    inner_offset = next_offset;
2385                } else {
2386                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2387                    inner_depth.increment()?;
2388                }
2389                let val_ref = self.members.get_or_insert_with(|| {
2390                    fidl::new_empty!(fidl::encoding::UnboundedVector<AggregateMember>, D)
2391                });
2392                fidl::decode!(
2393                    fidl::encoding::UnboundedVector<AggregateMember>,
2394                    D,
2395                    val_ref,
2396                    decoder,
2397                    inner_offset,
2398                    inner_depth
2399                )?;
2400                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2401                {
2402                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2403                }
2404                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2405                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2406                }
2407            }
2408
2409            next_offset += envelope_size;
2410            _next_ordinal_to_read += 1;
2411            if next_offset >= end_offset {
2412                return Ok(());
2413            }
2414
2415            // Decode unknown envelopes for gaps in ordinals.
2416            while _next_ordinal_to_read < 4 {
2417                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2418                _next_ordinal_to_read += 1;
2419                next_offset += envelope_size;
2420            }
2421
2422            let next_out_of_line = decoder.next_out_of_line();
2423            let handles_before = decoder.remaining_handles();
2424            if let Some((inlined, num_bytes, num_handles)) =
2425                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2426            {
2427                let member_inline_size =
2428                    <Sources as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2429                if inlined != (member_inline_size <= 4) {
2430                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2431                }
2432                let inner_offset;
2433                let mut inner_depth = depth.clone();
2434                if inlined {
2435                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2436                    inner_offset = next_offset;
2437                } else {
2438                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2439                    inner_depth.increment()?;
2440                }
2441                let val_ref = self.sources.get_or_insert_with(|| fidl::new_empty!(Sources, D));
2442                fidl::decode!(Sources, D, val_ref, decoder, inner_offset, inner_depth)?;
2443                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2444                {
2445                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2446                }
2447                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2448                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2449                }
2450            }
2451
2452            next_offset += envelope_size;
2453            _next_ordinal_to_read += 1;
2454            if next_offset >= end_offset {
2455                return Ok(());
2456            }
2457
2458            // Decode unknown envelopes for gaps in ordinals.
2459            while _next_ordinal_to_read < 5 {
2460                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2461                _next_ordinal_to_read += 1;
2462                next_offset += envelope_size;
2463            }
2464
2465            let next_out_of_line = decoder.next_out_of_line();
2466            let handles_before = decoder.remaining_handles();
2467            if let Some((inlined, num_bytes, num_handles)) =
2468                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2469            {
2470                let member_inline_size = <fidl::encoding::UnboundedVector<
2471                    fidl_fuchsia_sys2::ServiceInstance,
2472                > as fidl::encoding::TypeMarker>::inline_size(
2473                    decoder.context
2474                );
2475                if inlined != (member_inline_size <= 4) {
2476                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2477                }
2478                let inner_offset;
2479                let mut inner_depth = depth.clone();
2480                if inlined {
2481                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2482                    inner_offset = next_offset;
2483                } else {
2484                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2485                    inner_depth.increment()?;
2486                }
2487                let val_ref = self.instances.get_or_insert_with(|| {
2488                    fidl::new_empty!(
2489                        fidl::encoding::UnboundedVector<fidl_fuchsia_sys2::ServiceInstance>,
2490                        D
2491                    )
2492                });
2493                fidl::decode!(
2494                    fidl::encoding::UnboundedVector<fidl_fuchsia_sys2::ServiceInstance>,
2495                    D,
2496                    val_ref,
2497                    decoder,
2498                    inner_offset,
2499                    inner_depth
2500                )?;
2501                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2502                {
2503                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2504                }
2505                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2506                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2507                }
2508            }
2509
2510            next_offset += envelope_size;
2511
2512            // Decode the remaining unknown envelopes.
2513            while next_offset < end_offset {
2514                _next_ordinal_to_read += 1;
2515                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2516                next_offset += envelope_size;
2517            }
2518
2519            Ok(())
2520        }
2521    }
2522
2523    impl Builtin {
2524        #[inline(always)]
2525        fn max_ordinal_present(&self) -> u64 {
2526            if let Some(_) = self.capability {
2527                return 1;
2528            }
2529            0
2530        }
2531    }
2532
2533    impl fidl::encoding::ValueTypeMarker for Builtin {
2534        type Borrowed<'a> = &'a Self;
2535        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2536            value
2537        }
2538    }
2539
2540    unsafe impl fidl::encoding::TypeMarker for Builtin {
2541        type Owned = Self;
2542
2543        #[inline(always)]
2544        fn inline_align(_context: fidl::encoding::Context) -> usize {
2545            8
2546        }
2547
2548        #[inline(always)]
2549        fn inline_size(_context: fidl::encoding::Context) -> usize {
2550            16
2551        }
2552    }
2553
2554    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Builtin, D> for &Builtin {
2555        unsafe fn encode(
2556            self,
2557            encoder: &mut fidl::encoding::Encoder<'_, D>,
2558            offset: usize,
2559            mut depth: fidl::encoding::Depth,
2560        ) -> fidl::Result<()> {
2561            encoder.debug_check_bounds::<Builtin>(offset);
2562            // Vector header
2563            let max_ordinal: u64 = self.max_ordinal_present();
2564            encoder.write_num(max_ordinal, offset);
2565            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2566            // Calling encoder.out_of_line_offset(0) is not allowed.
2567            if max_ordinal == 0 {
2568                return Ok(());
2569            }
2570            depth.increment()?;
2571            let envelope_size = 8;
2572            let bytes_len = max_ordinal as usize * envelope_size;
2573            #[allow(unused_variables)]
2574            let offset = encoder.out_of_line_offset(bytes_len);
2575            let mut _prev_end_offset: usize = 0;
2576            if 1 > max_ordinal {
2577                return Ok(());
2578            }
2579
2580            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2581            // are envelope_size bytes.
2582            let cur_offset: usize = (1 - 1) * envelope_size;
2583
2584            // Zero reserved fields.
2585            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2586
2587            // Safety:
2588            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2589            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2590            //   envelope_size bytes, there is always sufficient room.
2591            fidl::encoding::encode_in_envelope_optional::<InternalCapability, D>(
2592                self.capability
2593                    .as_ref()
2594                    .map(<InternalCapability as fidl::encoding::ValueTypeMarker>::borrow),
2595                encoder,
2596                offset + cur_offset,
2597                depth,
2598            )?;
2599
2600            _prev_end_offset = cur_offset + envelope_size;
2601
2602            Ok(())
2603        }
2604    }
2605
2606    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Builtin {
2607        #[inline(always)]
2608        fn new_empty() -> Self {
2609            Self::default()
2610        }
2611
2612        unsafe fn decode(
2613            &mut self,
2614            decoder: &mut fidl::encoding::Decoder<'_, D>,
2615            offset: usize,
2616            mut depth: fidl::encoding::Depth,
2617        ) -> fidl::Result<()> {
2618            decoder.debug_check_bounds::<Self>(offset);
2619            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2620                None => return Err(fidl::Error::NotNullable),
2621                Some(len) => len,
2622            };
2623            // Calling decoder.out_of_line_offset(0) is not allowed.
2624            if len == 0 {
2625                return Ok(());
2626            };
2627            depth.increment()?;
2628            let envelope_size = 8;
2629            let bytes_len = len * envelope_size;
2630            let offset = decoder.out_of_line_offset(bytes_len)?;
2631            // Decode the envelope for each type.
2632            let mut _next_ordinal_to_read = 0;
2633            let mut next_offset = offset;
2634            let end_offset = offset + bytes_len;
2635            _next_ordinal_to_read += 1;
2636            if next_offset >= end_offset {
2637                return Ok(());
2638            }
2639
2640            // Decode unknown envelopes for gaps in ordinals.
2641            while _next_ordinal_to_read < 1 {
2642                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2643                _next_ordinal_to_read += 1;
2644                next_offset += envelope_size;
2645            }
2646
2647            let next_out_of_line = decoder.next_out_of_line();
2648            let handles_before = decoder.remaining_handles();
2649            if let Some((inlined, num_bytes, num_handles)) =
2650                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2651            {
2652                let member_inline_size =
2653                    <InternalCapability as fidl::encoding::TypeMarker>::inline_size(
2654                        decoder.context,
2655                    );
2656                if inlined != (member_inline_size <= 4) {
2657                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2658                }
2659                let inner_offset;
2660                let mut inner_depth = depth.clone();
2661                if inlined {
2662                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2663                    inner_offset = next_offset;
2664                } else {
2665                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2666                    inner_depth.increment()?;
2667                }
2668                let val_ref =
2669                    self.capability.get_or_insert_with(|| fidl::new_empty!(InternalCapability, D));
2670                fidl::decode!(InternalCapability, D, val_ref, decoder, inner_offset, inner_depth)?;
2671                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2672                {
2673                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2674                }
2675                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2676                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2677                }
2678            }
2679
2680            next_offset += envelope_size;
2681
2682            // Decode the remaining unknown envelopes.
2683            while next_offset < end_offset {
2684                _next_ordinal_to_read += 1;
2685                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2686                next_offset += envelope_size;
2687            }
2688
2689            Ok(())
2690        }
2691    }
2692
2693    impl Capability {
2694        #[inline(always)]
2695        fn max_ordinal_present(&self) -> u64 {
2696            if let Some(_) = self.moniker {
2697                return 2;
2698            }
2699            if let Some(_) = self.source_capability {
2700                return 1;
2701            }
2702            0
2703        }
2704    }
2705
2706    impl fidl::encoding::ValueTypeMarker for Capability {
2707        type Borrowed<'a> = &'a Self;
2708        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2709            value
2710        }
2711    }
2712
2713    unsafe impl fidl::encoding::TypeMarker for Capability {
2714        type Owned = Self;
2715
2716        #[inline(always)]
2717        fn inline_align(_context: fidl::encoding::Context) -> usize {
2718            8
2719        }
2720
2721        #[inline(always)]
2722        fn inline_size(_context: fidl::encoding::Context) -> usize {
2723            16
2724        }
2725    }
2726
2727    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Capability, D>
2728        for &Capability
2729    {
2730        unsafe fn encode(
2731            self,
2732            encoder: &mut fidl::encoding::Encoder<'_, D>,
2733            offset: usize,
2734            mut depth: fidl::encoding::Depth,
2735        ) -> fidl::Result<()> {
2736            encoder.debug_check_bounds::<Capability>(offset);
2737            // Vector header
2738            let max_ordinal: u64 = self.max_ordinal_present();
2739            encoder.write_num(max_ordinal, offset);
2740            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2741            // Calling encoder.out_of_line_offset(0) is not allowed.
2742            if max_ordinal == 0 {
2743                return Ok(());
2744            }
2745            depth.increment()?;
2746            let envelope_size = 8;
2747            let bytes_len = max_ordinal as usize * envelope_size;
2748            #[allow(unused_variables)]
2749            let offset = encoder.out_of_line_offset(bytes_len);
2750            let mut _prev_end_offset: usize = 0;
2751            if 1 > max_ordinal {
2752                return Ok(());
2753            }
2754
2755            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2756            // are envelope_size bytes.
2757            let cur_offset: usize = (1 - 1) * envelope_size;
2758
2759            // Zero reserved fields.
2760            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2761
2762            // Safety:
2763            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2764            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2765            //   envelope_size bytes, there is always sufficient room.
2766            fidl::encoding::encode_in_envelope_optional::<ComponentCapability, D>(
2767                self.source_capability
2768                    .as_ref()
2769                    .map(<ComponentCapability as fidl::encoding::ValueTypeMarker>::borrow),
2770                encoder,
2771                offset + cur_offset,
2772                depth,
2773            )?;
2774
2775            _prev_end_offset = cur_offset + envelope_size;
2776            if 2 > max_ordinal {
2777                return Ok(());
2778            }
2779
2780            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2781            // are envelope_size bytes.
2782            let cur_offset: usize = (2 - 1) * envelope_size;
2783
2784            // Zero reserved fields.
2785            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2786
2787            // Safety:
2788            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2789            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2790            //   envelope_size bytes, there is always sufficient room.
2791            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
2792            self.moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
2793            encoder, offset + cur_offset, depth
2794        )?;
2795
2796            _prev_end_offset = cur_offset + envelope_size;
2797
2798            Ok(())
2799        }
2800    }
2801
2802    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Capability {
2803        #[inline(always)]
2804        fn new_empty() -> Self {
2805            Self::default()
2806        }
2807
2808        unsafe fn decode(
2809            &mut self,
2810            decoder: &mut fidl::encoding::Decoder<'_, D>,
2811            offset: usize,
2812            mut depth: fidl::encoding::Depth,
2813        ) -> fidl::Result<()> {
2814            decoder.debug_check_bounds::<Self>(offset);
2815            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2816                None => return Err(fidl::Error::NotNullable),
2817                Some(len) => len,
2818            };
2819            // Calling decoder.out_of_line_offset(0) is not allowed.
2820            if len == 0 {
2821                return Ok(());
2822            };
2823            depth.increment()?;
2824            let envelope_size = 8;
2825            let bytes_len = len * envelope_size;
2826            let offset = decoder.out_of_line_offset(bytes_len)?;
2827            // Decode the envelope for each type.
2828            let mut _next_ordinal_to_read = 0;
2829            let mut next_offset = offset;
2830            let end_offset = offset + bytes_len;
2831            _next_ordinal_to_read += 1;
2832            if next_offset >= end_offset {
2833                return Ok(());
2834            }
2835
2836            // Decode unknown envelopes for gaps in ordinals.
2837            while _next_ordinal_to_read < 1 {
2838                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2839                _next_ordinal_to_read += 1;
2840                next_offset += envelope_size;
2841            }
2842
2843            let next_out_of_line = decoder.next_out_of_line();
2844            let handles_before = decoder.remaining_handles();
2845            if let Some((inlined, num_bytes, num_handles)) =
2846                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2847            {
2848                let member_inline_size =
2849                    <ComponentCapability as fidl::encoding::TypeMarker>::inline_size(
2850                        decoder.context,
2851                    );
2852                if inlined != (member_inline_size <= 4) {
2853                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2854                }
2855                let inner_offset;
2856                let mut inner_depth = depth.clone();
2857                if inlined {
2858                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2859                    inner_offset = next_offset;
2860                } else {
2861                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2862                    inner_depth.increment()?;
2863                }
2864                let val_ref = self
2865                    .source_capability
2866                    .get_or_insert_with(|| fidl::new_empty!(ComponentCapability, D));
2867                fidl::decode!(ComponentCapability, D, val_ref, decoder, inner_offset, inner_depth)?;
2868                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2869                {
2870                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2871                }
2872                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2873                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2874                }
2875            }
2876
2877            next_offset += envelope_size;
2878            _next_ordinal_to_read += 1;
2879            if next_offset >= end_offset {
2880                return Ok(());
2881            }
2882
2883            // Decode unknown envelopes for gaps in ordinals.
2884            while _next_ordinal_to_read < 2 {
2885                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2886                _next_ordinal_to_read += 1;
2887                next_offset += envelope_size;
2888            }
2889
2890            let next_out_of_line = decoder.next_out_of_line();
2891            let handles_before = decoder.remaining_handles();
2892            if let Some((inlined, num_bytes, num_handles)) =
2893                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2894            {
2895                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2896                if inlined != (member_inline_size <= 4) {
2897                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2898                }
2899                let inner_offset;
2900                let mut inner_depth = depth.clone();
2901                if inlined {
2902                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2903                    inner_offset = next_offset;
2904                } else {
2905                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2906                    inner_depth.increment()?;
2907                }
2908                let val_ref = self.moniker.get_or_insert_with(|| {
2909                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
2910                });
2911                fidl::decode!(
2912                    fidl::encoding::BoundedString<4096>,
2913                    D,
2914                    val_ref,
2915                    decoder,
2916                    inner_offset,
2917                    inner_depth
2918                )?;
2919                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2920                {
2921                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2922                }
2923                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2924                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2925                }
2926            }
2927
2928            next_offset += envelope_size;
2929
2930            // Decode the remaining unknown envelopes.
2931            while next_offset < end_offset {
2932                _next_ordinal_to_read += 1;
2933                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2934                next_offset += envelope_size;
2935            }
2936
2937            Ok(())
2938        }
2939    }
2940
2941    impl CapabilityAllowlistEntry {
2942        #[inline(always)]
2943        fn max_ordinal_present(&self) -> u64 {
2944            if let Some(_) = self.source {
2945                return 5;
2946            }
2947            if let Some(_) = self.target_monikers {
2948                return 4;
2949            }
2950            if let Some(_) = self.capability {
2951                return 3;
2952            }
2953            if let Some(_) = self.source_name {
2954                return 2;
2955            }
2956            if let Some(_) = self.source_moniker {
2957                return 1;
2958            }
2959            0
2960        }
2961    }
2962
2963    impl fidl::encoding::ValueTypeMarker for CapabilityAllowlistEntry {
2964        type Borrowed<'a> = &'a Self;
2965        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2966            value
2967        }
2968    }
2969
2970    unsafe impl fidl::encoding::TypeMarker for CapabilityAllowlistEntry {
2971        type Owned = Self;
2972
2973        #[inline(always)]
2974        fn inline_align(_context: fidl::encoding::Context) -> usize {
2975            8
2976        }
2977
2978        #[inline(always)]
2979        fn inline_size(_context: fidl::encoding::Context) -> usize {
2980            16
2981        }
2982    }
2983
2984    unsafe impl<D: fidl::encoding::ResourceDialect>
2985        fidl::encoding::Encode<CapabilityAllowlistEntry, D> for &CapabilityAllowlistEntry
2986    {
2987        unsafe fn encode(
2988            self,
2989            encoder: &mut fidl::encoding::Encoder<'_, D>,
2990            offset: usize,
2991            mut depth: fidl::encoding::Depth,
2992        ) -> fidl::Result<()> {
2993            encoder.debug_check_bounds::<CapabilityAllowlistEntry>(offset);
2994            // Vector header
2995            let max_ordinal: u64 = self.max_ordinal_present();
2996            encoder.write_num(max_ordinal, offset);
2997            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2998            // Calling encoder.out_of_line_offset(0) is not allowed.
2999            if max_ordinal == 0 {
3000                return Ok(());
3001            }
3002            depth.increment()?;
3003            let envelope_size = 8;
3004            let bytes_len = max_ordinal as usize * envelope_size;
3005            #[allow(unused_variables)]
3006            let offset = encoder.out_of_line_offset(bytes_len);
3007            let mut _prev_end_offset: usize = 0;
3008            if 1 > max_ordinal {
3009                return Ok(());
3010            }
3011
3012            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3013            // are envelope_size bytes.
3014            let cur_offset: usize = (1 - 1) * envelope_size;
3015
3016            // Zero reserved fields.
3017            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3018
3019            // Safety:
3020            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3021            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3022            //   envelope_size bytes, there is always sufficient room.
3023            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
3024            self.source_moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
3025            encoder, offset + cur_offset, depth
3026        )?;
3027
3028            _prev_end_offset = cur_offset + envelope_size;
3029            if 2 > max_ordinal {
3030                return Ok(());
3031            }
3032
3033            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3034            // are envelope_size bytes.
3035            let cur_offset: usize = (2 - 1) * envelope_size;
3036
3037            // Zero reserved fields.
3038            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3039
3040            // Safety:
3041            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3042            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3043            //   envelope_size bytes, there is always sufficient room.
3044            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
3045                self.source_name.as_ref().map(
3046                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
3047                ),
3048                encoder,
3049                offset + cur_offset,
3050                depth,
3051            )?;
3052
3053            _prev_end_offset = cur_offset + envelope_size;
3054            if 3 > max_ordinal {
3055                return Ok(());
3056            }
3057
3058            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3059            // are envelope_size bytes.
3060            let cur_offset: usize = (3 - 1) * envelope_size;
3061
3062            // Zero reserved fields.
3063            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3064
3065            // Safety:
3066            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3067            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3068            //   envelope_size bytes, there is always sufficient room.
3069            fidl::encoding::encode_in_envelope_optional::<AllowlistedCapability, D>(
3070                self.capability
3071                    .as_ref()
3072                    .map(<AllowlistedCapability as fidl::encoding::ValueTypeMarker>::borrow),
3073                encoder,
3074                offset + cur_offset,
3075                depth,
3076            )?;
3077
3078            _prev_end_offset = cur_offset + envelope_size;
3079            if 4 > max_ordinal {
3080                return Ok(());
3081            }
3082
3083            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3084            // are envelope_size bytes.
3085            let cur_offset: usize = (4 - 1) * envelope_size;
3086
3087            // Zero reserved fields.
3088            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3089
3090            // Safety:
3091            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3092            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3093            //   envelope_size bytes, there is always sufficient room.
3094            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>, D>(
3095            self.target_monikers.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128> as fidl::encoding::ValueTypeMarker>::borrow),
3096            encoder, offset + cur_offset, depth
3097        )?;
3098
3099            _prev_end_offset = cur_offset + envelope_size;
3100            if 5 > max_ordinal {
3101                return Ok(());
3102            }
3103
3104            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3105            // are envelope_size bytes.
3106            let cur_offset: usize = (5 - 1) * envelope_size;
3107
3108            // Zero reserved fields.
3109            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3110
3111            // Safety:
3112            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3113            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3114            //   envelope_size bytes, there is always sufficient room.
3115            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_decl::Ref, D>(
3116                self.source.as_ref().map(
3117                    <fidl_fuchsia_component_decl::Ref as fidl::encoding::ValueTypeMarker>::borrow,
3118                ),
3119                encoder,
3120                offset + cur_offset,
3121                depth,
3122            )?;
3123
3124            _prev_end_offset = cur_offset + envelope_size;
3125
3126            Ok(())
3127        }
3128    }
3129
3130    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3131        for CapabilityAllowlistEntry
3132    {
3133        #[inline(always)]
3134        fn new_empty() -> Self {
3135            Self::default()
3136        }
3137
3138        unsafe fn decode(
3139            &mut self,
3140            decoder: &mut fidl::encoding::Decoder<'_, D>,
3141            offset: usize,
3142            mut depth: fidl::encoding::Depth,
3143        ) -> fidl::Result<()> {
3144            decoder.debug_check_bounds::<Self>(offset);
3145            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3146                None => return Err(fidl::Error::NotNullable),
3147                Some(len) => len,
3148            };
3149            // Calling decoder.out_of_line_offset(0) is not allowed.
3150            if len == 0 {
3151                return Ok(());
3152            };
3153            depth.increment()?;
3154            let envelope_size = 8;
3155            let bytes_len = len * envelope_size;
3156            let offset = decoder.out_of_line_offset(bytes_len)?;
3157            // Decode the envelope for each type.
3158            let mut _next_ordinal_to_read = 0;
3159            let mut next_offset = offset;
3160            let end_offset = offset + bytes_len;
3161            _next_ordinal_to_read += 1;
3162            if next_offset >= end_offset {
3163                return Ok(());
3164            }
3165
3166            // Decode unknown envelopes for gaps in ordinals.
3167            while _next_ordinal_to_read < 1 {
3168                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3169                _next_ordinal_to_read += 1;
3170                next_offset += envelope_size;
3171            }
3172
3173            let next_out_of_line = decoder.next_out_of_line();
3174            let handles_before = decoder.remaining_handles();
3175            if let Some((inlined, num_bytes, num_handles)) =
3176                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3177            {
3178                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3179                if inlined != (member_inline_size <= 4) {
3180                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3181                }
3182                let inner_offset;
3183                let mut inner_depth = depth.clone();
3184                if inlined {
3185                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3186                    inner_offset = next_offset;
3187                } else {
3188                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3189                    inner_depth.increment()?;
3190                }
3191                let val_ref = self.source_moniker.get_or_insert_with(|| {
3192                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
3193                });
3194                fidl::decode!(
3195                    fidl::encoding::BoundedString<4096>,
3196                    D,
3197                    val_ref,
3198                    decoder,
3199                    inner_offset,
3200                    inner_depth
3201                )?;
3202                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3203                {
3204                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3205                }
3206                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3207                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3208                }
3209            }
3210
3211            next_offset += envelope_size;
3212            _next_ordinal_to_read += 1;
3213            if next_offset >= end_offset {
3214                return Ok(());
3215            }
3216
3217            // Decode unknown envelopes for gaps in ordinals.
3218            while _next_ordinal_to_read < 2 {
3219                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3220                _next_ordinal_to_read += 1;
3221                next_offset += envelope_size;
3222            }
3223
3224            let next_out_of_line = decoder.next_out_of_line();
3225            let handles_before = decoder.remaining_handles();
3226            if let Some((inlined, num_bytes, num_handles)) =
3227                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3228            {
3229                let member_inline_size =
3230                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
3231                        decoder.context,
3232                    );
3233                if inlined != (member_inline_size <= 4) {
3234                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3235                }
3236                let inner_offset;
3237                let mut inner_depth = depth.clone();
3238                if inlined {
3239                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3240                    inner_offset = next_offset;
3241                } else {
3242                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3243                    inner_depth.increment()?;
3244                }
3245                let val_ref = self
3246                    .source_name
3247                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
3248                fidl::decode!(
3249                    fidl::encoding::BoundedString<255>,
3250                    D,
3251                    val_ref,
3252                    decoder,
3253                    inner_offset,
3254                    inner_depth
3255                )?;
3256                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3257                {
3258                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3259                }
3260                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3261                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3262                }
3263            }
3264
3265            next_offset += envelope_size;
3266            _next_ordinal_to_read += 1;
3267            if next_offset >= end_offset {
3268                return Ok(());
3269            }
3270
3271            // Decode unknown envelopes for gaps in ordinals.
3272            while _next_ordinal_to_read < 3 {
3273                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3274                _next_ordinal_to_read += 1;
3275                next_offset += envelope_size;
3276            }
3277
3278            let next_out_of_line = decoder.next_out_of_line();
3279            let handles_before = decoder.remaining_handles();
3280            if let Some((inlined, num_bytes, num_handles)) =
3281                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3282            {
3283                let member_inline_size =
3284                    <AllowlistedCapability as fidl::encoding::TypeMarker>::inline_size(
3285                        decoder.context,
3286                    );
3287                if inlined != (member_inline_size <= 4) {
3288                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3289                }
3290                let inner_offset;
3291                let mut inner_depth = depth.clone();
3292                if inlined {
3293                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3294                    inner_offset = next_offset;
3295                } else {
3296                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3297                    inner_depth.increment()?;
3298                }
3299                let val_ref = self
3300                    .capability
3301                    .get_or_insert_with(|| fidl::new_empty!(AllowlistedCapability, D));
3302                fidl::decode!(
3303                    AllowlistedCapability,
3304                    D,
3305                    val_ref,
3306                    decoder,
3307                    inner_offset,
3308                    inner_depth
3309                )?;
3310                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3311                {
3312                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3313                }
3314                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3315                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3316                }
3317            }
3318
3319            next_offset += envelope_size;
3320            _next_ordinal_to_read += 1;
3321            if next_offset >= end_offset {
3322                return Ok(());
3323            }
3324
3325            // Decode unknown envelopes for gaps in ordinals.
3326            while _next_ordinal_to_read < 4 {
3327                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3328                _next_ordinal_to_read += 1;
3329                next_offset += envelope_size;
3330            }
3331
3332            let next_out_of_line = decoder.next_out_of_line();
3333            let handles_before = decoder.remaining_handles();
3334            if let Some((inlined, num_bytes, num_handles)) =
3335                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3336            {
3337                let member_inline_size = <fidl::encoding::Vector<
3338                    fidl::encoding::BoundedString<4096>,
3339                    128,
3340                > as fidl::encoding::TypeMarker>::inline_size(
3341                    decoder.context
3342                );
3343                if inlined != (member_inline_size <= 4) {
3344                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3345                }
3346                let inner_offset;
3347                let mut inner_depth = depth.clone();
3348                if inlined {
3349                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3350                    inner_offset = next_offset;
3351                } else {
3352                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3353                    inner_depth.increment()?;
3354                }
3355                let val_ref = self.target_monikers.get_or_insert_with(|| {
3356                    fidl::new_empty!(
3357                        fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>,
3358                        D
3359                    )
3360                });
3361                fidl::decode!(
3362                    fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>,
3363                    D,
3364                    val_ref,
3365                    decoder,
3366                    inner_offset,
3367                    inner_depth
3368                )?;
3369                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3370                {
3371                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3372                }
3373                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3374                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3375                }
3376            }
3377
3378            next_offset += envelope_size;
3379            _next_ordinal_to_read += 1;
3380            if next_offset >= end_offset {
3381                return Ok(());
3382            }
3383
3384            // Decode unknown envelopes for gaps in ordinals.
3385            while _next_ordinal_to_read < 5 {
3386                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3387                _next_ordinal_to_read += 1;
3388                next_offset += envelope_size;
3389            }
3390
3391            let next_out_of_line = decoder.next_out_of_line();
3392            let handles_before = decoder.remaining_handles();
3393            if let Some((inlined, num_bytes, num_handles)) =
3394                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3395            {
3396                let member_inline_size =
3397                    <fidl_fuchsia_component_decl::Ref as fidl::encoding::TypeMarker>::inline_size(
3398                        decoder.context,
3399                    );
3400                if inlined != (member_inline_size <= 4) {
3401                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3402                }
3403                let inner_offset;
3404                let mut inner_depth = depth.clone();
3405                if inlined {
3406                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3407                    inner_offset = next_offset;
3408                } else {
3409                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3410                    inner_depth.increment()?;
3411                }
3412                let val_ref = self
3413                    .source
3414                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_component_decl::Ref, D));
3415                fidl::decode!(
3416                    fidl_fuchsia_component_decl::Ref,
3417                    D,
3418                    val_ref,
3419                    decoder,
3420                    inner_offset,
3421                    inner_depth
3422                )?;
3423                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3424                {
3425                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3426                }
3427                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3428                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3429                }
3430            }
3431
3432            next_offset += envelope_size;
3433
3434            // Decode the remaining unknown envelopes.
3435            while next_offset < end_offset {
3436                _next_ordinal_to_read += 1;
3437                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3438                next_offset += envelope_size;
3439            }
3440
3441            Ok(())
3442        }
3443    }
3444
3445    impl CapabilityPolicyAllowlists {
3446        #[inline(always)]
3447        fn max_ordinal_present(&self) -> u64 {
3448            if let Some(_) = self.allowlist {
3449                return 1;
3450            }
3451            0
3452        }
3453    }
3454
3455    impl fidl::encoding::ValueTypeMarker for CapabilityPolicyAllowlists {
3456        type Borrowed<'a> = &'a Self;
3457        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3458            value
3459        }
3460    }
3461
3462    unsafe impl fidl::encoding::TypeMarker for CapabilityPolicyAllowlists {
3463        type Owned = Self;
3464
3465        #[inline(always)]
3466        fn inline_align(_context: fidl::encoding::Context) -> usize {
3467            8
3468        }
3469
3470        #[inline(always)]
3471        fn inline_size(_context: fidl::encoding::Context) -> usize {
3472            16
3473        }
3474    }
3475
3476    unsafe impl<D: fidl::encoding::ResourceDialect>
3477        fidl::encoding::Encode<CapabilityPolicyAllowlists, D> for &CapabilityPolicyAllowlists
3478    {
3479        unsafe fn encode(
3480            self,
3481            encoder: &mut fidl::encoding::Encoder<'_, D>,
3482            offset: usize,
3483            mut depth: fidl::encoding::Depth,
3484        ) -> fidl::Result<()> {
3485            encoder.debug_check_bounds::<CapabilityPolicyAllowlists>(offset);
3486            // Vector header
3487            let max_ordinal: u64 = self.max_ordinal_present();
3488            encoder.write_num(max_ordinal, offset);
3489            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3490            // Calling encoder.out_of_line_offset(0) is not allowed.
3491            if max_ordinal == 0 {
3492                return Ok(());
3493            }
3494            depth.increment()?;
3495            let envelope_size = 8;
3496            let bytes_len = max_ordinal as usize * envelope_size;
3497            #[allow(unused_variables)]
3498            let offset = encoder.out_of_line_offset(bytes_len);
3499            let mut _prev_end_offset: usize = 0;
3500            if 1 > max_ordinal {
3501                return Ok(());
3502            }
3503
3504            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3505            // are envelope_size bytes.
3506            let cur_offset: usize = (1 - 1) * envelope_size;
3507
3508            // Zero reserved fields.
3509            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3510
3511            // Safety:
3512            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3513            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3514            //   envelope_size bytes, there is always sufficient room.
3515            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<CapabilityAllowlistEntry, 128>, D>(
3516            self.allowlist.as_ref().map(<fidl::encoding::Vector<CapabilityAllowlistEntry, 128> as fidl::encoding::ValueTypeMarker>::borrow),
3517            encoder, offset + cur_offset, depth
3518        )?;
3519
3520            _prev_end_offset = cur_offset + envelope_size;
3521
3522            Ok(())
3523        }
3524    }
3525
3526    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3527        for CapabilityPolicyAllowlists
3528    {
3529        #[inline(always)]
3530        fn new_empty() -> Self {
3531            Self::default()
3532        }
3533
3534        unsafe fn decode(
3535            &mut self,
3536            decoder: &mut fidl::encoding::Decoder<'_, D>,
3537            offset: usize,
3538            mut depth: fidl::encoding::Depth,
3539        ) -> fidl::Result<()> {
3540            decoder.debug_check_bounds::<Self>(offset);
3541            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3542                None => return Err(fidl::Error::NotNullable),
3543                Some(len) => len,
3544            };
3545            // Calling decoder.out_of_line_offset(0) is not allowed.
3546            if len == 0 {
3547                return Ok(());
3548            };
3549            depth.increment()?;
3550            let envelope_size = 8;
3551            let bytes_len = len * envelope_size;
3552            let offset = decoder.out_of_line_offset(bytes_len)?;
3553            // Decode the envelope for each type.
3554            let mut _next_ordinal_to_read = 0;
3555            let mut next_offset = offset;
3556            let end_offset = offset + bytes_len;
3557            _next_ordinal_to_read += 1;
3558            if next_offset >= end_offset {
3559                return Ok(());
3560            }
3561
3562            // Decode unknown envelopes for gaps in ordinals.
3563            while _next_ordinal_to_read < 1 {
3564                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3565                _next_ordinal_to_read += 1;
3566                next_offset += envelope_size;
3567            }
3568
3569            let next_out_of_line = decoder.next_out_of_line();
3570            let handles_before = decoder.remaining_handles();
3571            if let Some((inlined, num_bytes, num_handles)) =
3572                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3573            {
3574                let member_inline_size = <fidl::encoding::Vector<CapabilityAllowlistEntry, 128> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3575                if inlined != (member_inline_size <= 4) {
3576                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3577                }
3578                let inner_offset;
3579                let mut inner_depth = depth.clone();
3580                if inlined {
3581                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3582                    inner_offset = next_offset;
3583                } else {
3584                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3585                    inner_depth.increment()?;
3586                }
3587                let val_ref = self.allowlist.get_or_insert_with(
3588                    || fidl::new_empty!(fidl::encoding::Vector<CapabilityAllowlistEntry, 128>, D),
3589                );
3590                fidl::decode!(fidl::encoding::Vector<CapabilityAllowlistEntry, 128>, D, val_ref, decoder, inner_offset, inner_depth)?;
3591                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3592                {
3593                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3594                }
3595                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3596                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3597                }
3598            }
3599
3600            next_offset += envelope_size;
3601
3602            // Decode the remaining unknown envelopes.
3603            while next_offset < end_offset {
3604                _next_ordinal_to_read += 1;
3605                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3606                next_offset += envelope_size;
3607            }
3608
3609            Ok(())
3610        }
3611    }
3612
3613    impl ChildPolicyAllowlists {
3614        #[inline(always)]
3615        fn max_ordinal_present(&self) -> u64 {
3616            if let Some(_) = self.reboot_on_terminate {
3617                return 1;
3618            }
3619            0
3620        }
3621    }
3622
3623    impl fidl::encoding::ValueTypeMarker for ChildPolicyAllowlists {
3624        type Borrowed<'a> = &'a Self;
3625        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3626            value
3627        }
3628    }
3629
3630    unsafe impl fidl::encoding::TypeMarker for ChildPolicyAllowlists {
3631        type Owned = Self;
3632
3633        #[inline(always)]
3634        fn inline_align(_context: fidl::encoding::Context) -> usize {
3635            8
3636        }
3637
3638        #[inline(always)]
3639        fn inline_size(_context: fidl::encoding::Context) -> usize {
3640            16
3641        }
3642    }
3643
3644    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ChildPolicyAllowlists, D>
3645        for &ChildPolicyAllowlists
3646    {
3647        unsafe fn encode(
3648            self,
3649            encoder: &mut fidl::encoding::Encoder<'_, D>,
3650            offset: usize,
3651            mut depth: fidl::encoding::Depth,
3652        ) -> fidl::Result<()> {
3653            encoder.debug_check_bounds::<ChildPolicyAllowlists>(offset);
3654            // Vector header
3655            let max_ordinal: u64 = self.max_ordinal_present();
3656            encoder.write_num(max_ordinal, offset);
3657            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3658            // Calling encoder.out_of_line_offset(0) is not allowed.
3659            if max_ordinal == 0 {
3660                return Ok(());
3661            }
3662            depth.increment()?;
3663            let envelope_size = 8;
3664            let bytes_len = max_ordinal as usize * envelope_size;
3665            #[allow(unused_variables)]
3666            let offset = encoder.out_of_line_offset(bytes_len);
3667            let mut _prev_end_offset: usize = 0;
3668            if 1 > max_ordinal {
3669                return Ok(());
3670            }
3671
3672            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3673            // are envelope_size bytes.
3674            let cur_offset: usize = (1 - 1) * envelope_size;
3675
3676            // Zero reserved fields.
3677            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3678
3679            // Safety:
3680            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3681            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3682            //   envelope_size bytes, there is always sufficient room.
3683            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>, D>(
3684            self.reboot_on_terminate.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128> as fidl::encoding::ValueTypeMarker>::borrow),
3685            encoder, offset + cur_offset, depth
3686        )?;
3687
3688            _prev_end_offset = cur_offset + envelope_size;
3689
3690            Ok(())
3691        }
3692    }
3693
3694    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChildPolicyAllowlists {
3695        #[inline(always)]
3696        fn new_empty() -> Self {
3697            Self::default()
3698        }
3699
3700        unsafe fn decode(
3701            &mut self,
3702            decoder: &mut fidl::encoding::Decoder<'_, D>,
3703            offset: usize,
3704            mut depth: fidl::encoding::Depth,
3705        ) -> fidl::Result<()> {
3706            decoder.debug_check_bounds::<Self>(offset);
3707            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3708                None => return Err(fidl::Error::NotNullable),
3709                Some(len) => len,
3710            };
3711            // Calling decoder.out_of_line_offset(0) is not allowed.
3712            if len == 0 {
3713                return Ok(());
3714            };
3715            depth.increment()?;
3716            let envelope_size = 8;
3717            let bytes_len = len * envelope_size;
3718            let offset = decoder.out_of_line_offset(bytes_len)?;
3719            // Decode the envelope for each type.
3720            let mut _next_ordinal_to_read = 0;
3721            let mut next_offset = offset;
3722            let end_offset = offset + bytes_len;
3723            _next_ordinal_to_read += 1;
3724            if next_offset >= end_offset {
3725                return Ok(());
3726            }
3727
3728            // Decode unknown envelopes for gaps in ordinals.
3729            while _next_ordinal_to_read < 1 {
3730                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3731                _next_ordinal_to_read += 1;
3732                next_offset += envelope_size;
3733            }
3734
3735            let next_out_of_line = decoder.next_out_of_line();
3736            let handles_before = decoder.remaining_handles();
3737            if let Some((inlined, num_bytes, num_handles)) =
3738                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3739            {
3740                let member_inline_size = <fidl::encoding::Vector<
3741                    fidl::encoding::BoundedString<4096>,
3742                    128,
3743                > as fidl::encoding::TypeMarker>::inline_size(
3744                    decoder.context
3745                );
3746                if inlined != (member_inline_size <= 4) {
3747                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3748                }
3749                let inner_offset;
3750                let mut inner_depth = depth.clone();
3751                if inlined {
3752                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3753                    inner_offset = next_offset;
3754                } else {
3755                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3756                    inner_depth.increment()?;
3757                }
3758                let val_ref = self.reboot_on_terminate.get_or_insert_with(|| {
3759                    fidl::new_empty!(
3760                        fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>,
3761                        D
3762                    )
3763                });
3764                fidl::decode!(
3765                    fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>,
3766                    D,
3767                    val_ref,
3768                    decoder,
3769                    inner_offset,
3770                    inner_depth
3771                )?;
3772                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3773                {
3774                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3775                }
3776                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3777                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3778                }
3779            }
3780
3781            next_offset += envelope_size;
3782
3783            // Decode the remaining unknown envelopes.
3784            while next_offset < end_offset {
3785                _next_ordinal_to_read += 1;
3786                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3787                next_offset += envelope_size;
3788            }
3789
3790            Ok(())
3791        }
3792    }
3793
3794    impl Component {
3795        #[inline(always)]
3796        fn max_ordinal_present(&self) -> u64 {
3797            if let Some(_) = self.moniker {
3798                return 2;
3799            }
3800            if let Some(_) = self.capability {
3801                return 1;
3802            }
3803            0
3804        }
3805    }
3806
3807    impl fidl::encoding::ValueTypeMarker for Component {
3808        type Borrowed<'a> = &'a Self;
3809        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3810            value
3811        }
3812    }
3813
3814    unsafe impl fidl::encoding::TypeMarker for Component {
3815        type Owned = Self;
3816
3817        #[inline(always)]
3818        fn inline_align(_context: fidl::encoding::Context) -> usize {
3819            8
3820        }
3821
3822        #[inline(always)]
3823        fn inline_size(_context: fidl::encoding::Context) -> usize {
3824            16
3825        }
3826    }
3827
3828    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Component, D>
3829        for &Component
3830    {
3831        unsafe fn encode(
3832            self,
3833            encoder: &mut fidl::encoding::Encoder<'_, D>,
3834            offset: usize,
3835            mut depth: fidl::encoding::Depth,
3836        ) -> fidl::Result<()> {
3837            encoder.debug_check_bounds::<Component>(offset);
3838            // Vector header
3839            let max_ordinal: u64 = self.max_ordinal_present();
3840            encoder.write_num(max_ordinal, offset);
3841            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3842            // Calling encoder.out_of_line_offset(0) is not allowed.
3843            if max_ordinal == 0 {
3844                return Ok(());
3845            }
3846            depth.increment()?;
3847            let envelope_size = 8;
3848            let bytes_len = max_ordinal as usize * envelope_size;
3849            #[allow(unused_variables)]
3850            let offset = encoder.out_of_line_offset(bytes_len);
3851            let mut _prev_end_offset: usize = 0;
3852            if 1 > max_ordinal {
3853                return Ok(());
3854            }
3855
3856            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3857            // are envelope_size bytes.
3858            let cur_offset: usize = (1 - 1) * envelope_size;
3859
3860            // Zero reserved fields.
3861            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3862
3863            // Safety:
3864            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3865            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3866            //   envelope_size bytes, there is always sufficient room.
3867            fidl::encoding::encode_in_envelope_optional::<ComponentCapability, D>(
3868                self.capability
3869                    .as_ref()
3870                    .map(<ComponentCapability as fidl::encoding::ValueTypeMarker>::borrow),
3871                encoder,
3872                offset + cur_offset,
3873                depth,
3874            )?;
3875
3876            _prev_end_offset = cur_offset + envelope_size;
3877            if 2 > max_ordinal {
3878                return Ok(());
3879            }
3880
3881            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3882            // are envelope_size bytes.
3883            let cur_offset: usize = (2 - 1) * envelope_size;
3884
3885            // Zero reserved fields.
3886            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3887
3888            // Safety:
3889            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3890            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3891            //   envelope_size bytes, there is always sufficient room.
3892            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
3893            self.moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
3894            encoder, offset + cur_offset, depth
3895        )?;
3896
3897            _prev_end_offset = cur_offset + envelope_size;
3898
3899            Ok(())
3900        }
3901    }
3902
3903    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Component {
3904        #[inline(always)]
3905        fn new_empty() -> Self {
3906            Self::default()
3907        }
3908
3909        unsafe fn decode(
3910            &mut self,
3911            decoder: &mut fidl::encoding::Decoder<'_, D>,
3912            offset: usize,
3913            mut depth: fidl::encoding::Depth,
3914        ) -> fidl::Result<()> {
3915            decoder.debug_check_bounds::<Self>(offset);
3916            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3917                None => return Err(fidl::Error::NotNullable),
3918                Some(len) => len,
3919            };
3920            // Calling decoder.out_of_line_offset(0) is not allowed.
3921            if len == 0 {
3922                return Ok(());
3923            };
3924            depth.increment()?;
3925            let envelope_size = 8;
3926            let bytes_len = len * envelope_size;
3927            let offset = decoder.out_of_line_offset(bytes_len)?;
3928            // Decode the envelope for each type.
3929            let mut _next_ordinal_to_read = 0;
3930            let mut next_offset = offset;
3931            let end_offset = offset + bytes_len;
3932            _next_ordinal_to_read += 1;
3933            if next_offset >= end_offset {
3934                return Ok(());
3935            }
3936
3937            // Decode unknown envelopes for gaps in ordinals.
3938            while _next_ordinal_to_read < 1 {
3939                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3940                _next_ordinal_to_read += 1;
3941                next_offset += envelope_size;
3942            }
3943
3944            let next_out_of_line = decoder.next_out_of_line();
3945            let handles_before = decoder.remaining_handles();
3946            if let Some((inlined, num_bytes, num_handles)) =
3947                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3948            {
3949                let member_inline_size =
3950                    <ComponentCapability as fidl::encoding::TypeMarker>::inline_size(
3951                        decoder.context,
3952                    );
3953                if inlined != (member_inline_size <= 4) {
3954                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3955                }
3956                let inner_offset;
3957                let mut inner_depth = depth.clone();
3958                if inlined {
3959                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3960                    inner_offset = next_offset;
3961                } else {
3962                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3963                    inner_depth.increment()?;
3964                }
3965                let val_ref =
3966                    self.capability.get_or_insert_with(|| fidl::new_empty!(ComponentCapability, D));
3967                fidl::decode!(ComponentCapability, D, val_ref, decoder, inner_offset, inner_depth)?;
3968                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3969                {
3970                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3971                }
3972                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3973                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3974                }
3975            }
3976
3977            next_offset += envelope_size;
3978            _next_ordinal_to_read += 1;
3979            if next_offset >= end_offset {
3980                return Ok(());
3981            }
3982
3983            // Decode unknown envelopes for gaps in ordinals.
3984            while _next_ordinal_to_read < 2 {
3985                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3986                _next_ordinal_to_read += 1;
3987                next_offset += envelope_size;
3988            }
3989
3990            let next_out_of_line = decoder.next_out_of_line();
3991            let handles_before = decoder.remaining_handles();
3992            if let Some((inlined, num_bytes, num_handles)) =
3993                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3994            {
3995                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3996                if inlined != (member_inline_size <= 4) {
3997                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3998                }
3999                let inner_offset;
4000                let mut inner_depth = depth.clone();
4001                if inlined {
4002                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4003                    inner_offset = next_offset;
4004                } else {
4005                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4006                    inner_depth.increment()?;
4007                }
4008                let val_ref = self.moniker.get_or_insert_with(|| {
4009                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
4010                });
4011                fidl::decode!(
4012                    fidl::encoding::BoundedString<4096>,
4013                    D,
4014                    val_ref,
4015                    decoder,
4016                    inner_offset,
4017                    inner_depth
4018                )?;
4019                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4020                {
4021                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4022                }
4023                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4024                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4025                }
4026            }
4027
4028            next_offset += envelope_size;
4029
4030            // Decode the remaining unknown envelopes.
4031            while next_offset < end_offset {
4032                _next_ordinal_to_read += 1;
4033                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4034                next_offset += envelope_size;
4035            }
4036
4037            Ok(())
4038        }
4039    }
4040
4041    impl ComponentIdIndex {
4042        #[inline(always)]
4043        fn max_ordinal_present(&self) -> u64 {
4044            if let Some(_) = self.instances {
4045                return 2;
4046            }
4047            0
4048        }
4049    }
4050
4051    impl fidl::encoding::ValueTypeMarker for ComponentIdIndex {
4052        type Borrowed<'a> = &'a Self;
4053        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4054            value
4055        }
4056    }
4057
4058    unsafe impl fidl::encoding::TypeMarker for ComponentIdIndex {
4059        type Owned = Self;
4060
4061        #[inline(always)]
4062        fn inline_align(_context: fidl::encoding::Context) -> usize {
4063            8
4064        }
4065
4066        #[inline(always)]
4067        fn inline_size(_context: fidl::encoding::Context) -> usize {
4068            16
4069        }
4070    }
4071
4072    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ComponentIdIndex, D>
4073        for &ComponentIdIndex
4074    {
4075        unsafe fn encode(
4076            self,
4077            encoder: &mut fidl::encoding::Encoder<'_, D>,
4078            offset: usize,
4079            mut depth: fidl::encoding::Depth,
4080        ) -> fidl::Result<()> {
4081            encoder.debug_check_bounds::<ComponentIdIndex>(offset);
4082            // Vector header
4083            let max_ordinal: u64 = self.max_ordinal_present();
4084            encoder.write_num(max_ordinal, offset);
4085            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4086            // Calling encoder.out_of_line_offset(0) is not allowed.
4087            if max_ordinal == 0 {
4088                return Ok(());
4089            }
4090            depth.increment()?;
4091            let envelope_size = 8;
4092            let bytes_len = max_ordinal as usize * envelope_size;
4093            #[allow(unused_variables)]
4094            let offset = encoder.out_of_line_offset(bytes_len);
4095            let mut _prev_end_offset: usize = 0;
4096            if 2 > max_ordinal {
4097                return Ok(());
4098            }
4099
4100            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4101            // are envelope_size bytes.
4102            let cur_offset: usize = (2 - 1) * envelope_size;
4103
4104            // Zero reserved fields.
4105            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4106
4107            // Safety:
4108            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4109            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4110            //   envelope_size bytes, there is always sufficient room.
4111            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<InstanceIdEntry, 1024>, D>(
4112            self.instances.as_ref().map(<fidl::encoding::Vector<InstanceIdEntry, 1024> as fidl::encoding::ValueTypeMarker>::borrow),
4113            encoder, offset + cur_offset, depth
4114        )?;
4115
4116            _prev_end_offset = cur_offset + envelope_size;
4117
4118            Ok(())
4119        }
4120    }
4121
4122    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ComponentIdIndex {
4123        #[inline(always)]
4124        fn new_empty() -> Self {
4125            Self::default()
4126        }
4127
4128        unsafe fn decode(
4129            &mut self,
4130            decoder: &mut fidl::encoding::Decoder<'_, D>,
4131            offset: usize,
4132            mut depth: fidl::encoding::Depth,
4133        ) -> fidl::Result<()> {
4134            decoder.debug_check_bounds::<Self>(offset);
4135            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4136                None => return Err(fidl::Error::NotNullable),
4137                Some(len) => len,
4138            };
4139            // Calling decoder.out_of_line_offset(0) is not allowed.
4140            if len == 0 {
4141                return Ok(());
4142            };
4143            depth.increment()?;
4144            let envelope_size = 8;
4145            let bytes_len = len * envelope_size;
4146            let offset = decoder.out_of_line_offset(bytes_len)?;
4147            // Decode the envelope for each type.
4148            let mut _next_ordinal_to_read = 0;
4149            let mut next_offset = offset;
4150            let end_offset = offset + bytes_len;
4151            _next_ordinal_to_read += 1;
4152            if next_offset >= end_offset {
4153                return Ok(());
4154            }
4155
4156            // Decode unknown envelopes for gaps in ordinals.
4157            while _next_ordinal_to_read < 2 {
4158                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4159                _next_ordinal_to_read += 1;
4160                next_offset += envelope_size;
4161            }
4162
4163            let next_out_of_line = decoder.next_out_of_line();
4164            let handles_before = decoder.remaining_handles();
4165            if let Some((inlined, num_bytes, num_handles)) =
4166                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4167            {
4168                let member_inline_size = <fidl::encoding::Vector<InstanceIdEntry, 1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4169                if inlined != (member_inline_size <= 4) {
4170                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4171                }
4172                let inner_offset;
4173                let mut inner_depth = depth.clone();
4174                if inlined {
4175                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4176                    inner_offset = next_offset;
4177                } else {
4178                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4179                    inner_depth.increment()?;
4180                }
4181                let val_ref = self.instances.get_or_insert_with(
4182                    || fidl::new_empty!(fidl::encoding::Vector<InstanceIdEntry, 1024>, D),
4183                );
4184                fidl::decode!(fidl::encoding::Vector<InstanceIdEntry, 1024>, D, val_ref, decoder, inner_offset, inner_depth)?;
4185                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4186                {
4187                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4188                }
4189                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4190                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4191                }
4192            }
4193
4194            next_offset += envelope_size;
4195
4196            // Decode the remaining unknown envelopes.
4197            while next_offset < end_offset {
4198                _next_ordinal_to_read += 1;
4199                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4200                next_offset += envelope_size;
4201            }
4202
4203            Ok(())
4204        }
4205    }
4206
4207    impl Config {
4208        #[inline(always)]
4209        fn max_ordinal_present(&self) -> u64 {
4210            if let Some(_) = self.trace_provider {
4211                return 22;
4212            }
4213            if let Some(_) = self.health_check {
4214                return 21;
4215            }
4216            if let Some(_) = self.vmex_source {
4217                return 20;
4218            }
4219            if let Some(_) = self.abi_revision_policy {
4220                return 19;
4221            }
4222            if let Some(_) = self.enable_introspection {
4223                return 18;
4224            }
4225            if let Some(_) = self.builtin_capabilities {
4226                return 17;
4227            }
4228            if let Some(_) = self.realm_builder_resolver_and_runner {
4229                return 16;
4230            }
4231            if let Some(_) = self.builtin_boot_resolver {
4232                return 14;
4233            }
4234            if let Some(_) = self.log_all_events {
4235                return 13;
4236            }
4237            if let Some(_) = self.log_destination {
4238                return 12;
4239            }
4240            if let Some(_) = self.component_id_index_path {
4241                return 11;
4242            }
4243            if let Some(_) = self.root_component_url {
4244                return 10;
4245            }
4246            if let Some(_) = self.num_threads {
4247                return 7;
4248            }
4249            if let Some(_) = self.maintain_utc_clock {
4250                return 6;
4251            }
4252            if let Some(_) = self.use_builtin_process_launcher {
4253                return 5;
4254            }
4255            if let Some(_) = self.namespace_capabilities {
4256                return 4;
4257            }
4258            if let Some(_) = self.security_policy {
4259                return 3;
4260            }
4261            if let Some(_) = self.list_children_batch_size {
4262                return 2;
4263            }
4264            if let Some(_) = self.debug {
4265                return 1;
4266            }
4267            0
4268        }
4269    }
4270
4271    impl fidl::encoding::ValueTypeMarker for Config {
4272        type Borrowed<'a> = &'a Self;
4273        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4274            value
4275        }
4276    }
4277
4278    unsafe impl fidl::encoding::TypeMarker for Config {
4279        type Owned = Self;
4280
4281        #[inline(always)]
4282        fn inline_align(_context: fidl::encoding::Context) -> usize {
4283            8
4284        }
4285
4286        #[inline(always)]
4287        fn inline_size(_context: fidl::encoding::Context) -> usize {
4288            16
4289        }
4290    }
4291
4292    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Config, D> for &Config {
4293        unsafe fn encode(
4294            self,
4295            encoder: &mut fidl::encoding::Encoder<'_, D>,
4296            offset: usize,
4297            mut depth: fidl::encoding::Depth,
4298        ) -> fidl::Result<()> {
4299            encoder.debug_check_bounds::<Config>(offset);
4300            // Vector header
4301            let max_ordinal: u64 = self.max_ordinal_present();
4302            encoder.write_num(max_ordinal, offset);
4303            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4304            // Calling encoder.out_of_line_offset(0) is not allowed.
4305            if max_ordinal == 0 {
4306                return Ok(());
4307            }
4308            depth.increment()?;
4309            let envelope_size = 8;
4310            let bytes_len = max_ordinal as usize * envelope_size;
4311            #[allow(unused_variables)]
4312            let offset = encoder.out_of_line_offset(bytes_len);
4313            let mut _prev_end_offset: usize = 0;
4314            if 1 > max_ordinal {
4315                return Ok(());
4316            }
4317
4318            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4319            // are envelope_size bytes.
4320            let cur_offset: usize = (1 - 1) * envelope_size;
4321
4322            // Zero reserved fields.
4323            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4324
4325            // Safety:
4326            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4327            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4328            //   envelope_size bytes, there is always sufficient room.
4329            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4330                self.debug.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4331                encoder,
4332                offset + cur_offset,
4333                depth,
4334            )?;
4335
4336            _prev_end_offset = cur_offset + envelope_size;
4337            if 2 > max_ordinal {
4338                return Ok(());
4339            }
4340
4341            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4342            // are envelope_size bytes.
4343            let cur_offset: usize = (2 - 1) * envelope_size;
4344
4345            // Zero reserved fields.
4346            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4347
4348            // Safety:
4349            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4350            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4351            //   envelope_size bytes, there is always sufficient room.
4352            fidl::encoding::encode_in_envelope_optional::<u32, D>(
4353                self.list_children_batch_size
4354                    .as_ref()
4355                    .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4356                encoder,
4357                offset + cur_offset,
4358                depth,
4359            )?;
4360
4361            _prev_end_offset = cur_offset + envelope_size;
4362            if 3 > max_ordinal {
4363                return Ok(());
4364            }
4365
4366            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4367            // are envelope_size bytes.
4368            let cur_offset: usize = (3 - 1) * envelope_size;
4369
4370            // Zero reserved fields.
4371            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4372
4373            // Safety:
4374            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4375            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4376            //   envelope_size bytes, there is always sufficient room.
4377            fidl::encoding::encode_in_envelope_optional::<SecurityPolicy, D>(
4378                self.security_policy
4379                    .as_ref()
4380                    .map(<SecurityPolicy as fidl::encoding::ValueTypeMarker>::borrow),
4381                encoder,
4382                offset + cur_offset,
4383                depth,
4384            )?;
4385
4386            _prev_end_offset = cur_offset + envelope_size;
4387            if 4 > max_ordinal {
4388                return Ok(());
4389            }
4390
4391            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4392            // are envelope_size bytes.
4393            let cur_offset: usize = (4 - 1) * envelope_size;
4394
4395            // Zero reserved fields.
4396            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4397
4398            // Safety:
4399            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4400            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4401            //   envelope_size bytes, there is always sufficient room.
4402            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Capability>, D>(
4403            self.namespace_capabilities.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Capability> as fidl::encoding::ValueTypeMarker>::borrow),
4404            encoder, offset + cur_offset, depth
4405        )?;
4406
4407            _prev_end_offset = cur_offset + envelope_size;
4408            if 5 > max_ordinal {
4409                return Ok(());
4410            }
4411
4412            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4413            // are envelope_size bytes.
4414            let cur_offset: usize = (5 - 1) * envelope_size;
4415
4416            // Zero reserved fields.
4417            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4418
4419            // Safety:
4420            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4421            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4422            //   envelope_size bytes, there is always sufficient room.
4423            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4424                self.use_builtin_process_launcher
4425                    .as_ref()
4426                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4427                encoder,
4428                offset + cur_offset,
4429                depth,
4430            )?;
4431
4432            _prev_end_offset = cur_offset + envelope_size;
4433            if 6 > max_ordinal {
4434                return Ok(());
4435            }
4436
4437            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4438            // are envelope_size bytes.
4439            let cur_offset: usize = (6 - 1) * envelope_size;
4440
4441            // Zero reserved fields.
4442            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4443
4444            // Safety:
4445            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4446            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4447            //   envelope_size bytes, there is always sufficient room.
4448            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4449                self.maintain_utc_clock
4450                    .as_ref()
4451                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4452                encoder,
4453                offset + cur_offset,
4454                depth,
4455            )?;
4456
4457            _prev_end_offset = cur_offset + envelope_size;
4458            if 7 > max_ordinal {
4459                return Ok(());
4460            }
4461
4462            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4463            // are envelope_size bytes.
4464            let cur_offset: usize = (7 - 1) * envelope_size;
4465
4466            // Zero reserved fields.
4467            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4468
4469            // Safety:
4470            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4471            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4472            //   envelope_size bytes, there is always sufficient room.
4473            fidl::encoding::encode_in_envelope_optional::<u8, D>(
4474                self.num_threads.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4475                encoder,
4476                offset + cur_offset,
4477                depth,
4478            )?;
4479
4480            _prev_end_offset = cur_offset + envelope_size;
4481            if 10 > max_ordinal {
4482                return Ok(());
4483            }
4484
4485            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4486            // are envelope_size bytes.
4487            let cur_offset: usize = (10 - 1) * envelope_size;
4488
4489            // Zero reserved fields.
4490            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4491
4492            // Safety:
4493            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4494            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4495            //   envelope_size bytes, there is always sufficient room.
4496            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
4497            self.root_component_url.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
4498            encoder, offset + cur_offset, depth
4499        )?;
4500
4501            _prev_end_offset = cur_offset + envelope_size;
4502            if 11 > max_ordinal {
4503                return Ok(());
4504            }
4505
4506            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4507            // are envelope_size bytes.
4508            let cur_offset: usize = (11 - 1) * envelope_size;
4509
4510            // Zero reserved fields.
4511            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4512
4513            // Safety:
4514            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4515            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4516            //   envelope_size bytes, there is always sufficient room.
4517            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, D>(
4518            self.component_id_index_path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
4519            encoder, offset + cur_offset, depth
4520        )?;
4521
4522            _prev_end_offset = cur_offset + envelope_size;
4523            if 12 > max_ordinal {
4524                return Ok(());
4525            }
4526
4527            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4528            // are envelope_size bytes.
4529            let cur_offset: usize = (12 - 1) * envelope_size;
4530
4531            // Zero reserved fields.
4532            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4533
4534            // Safety:
4535            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4536            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4537            //   envelope_size bytes, there is always sufficient room.
4538            fidl::encoding::encode_in_envelope_optional::<LogDestination, D>(
4539                self.log_destination
4540                    .as_ref()
4541                    .map(<LogDestination as fidl::encoding::ValueTypeMarker>::borrow),
4542                encoder,
4543                offset + cur_offset,
4544                depth,
4545            )?;
4546
4547            _prev_end_offset = cur_offset + envelope_size;
4548            if 13 > max_ordinal {
4549                return Ok(());
4550            }
4551
4552            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4553            // are envelope_size bytes.
4554            let cur_offset: usize = (13 - 1) * envelope_size;
4555
4556            // Zero reserved fields.
4557            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4558
4559            // Safety:
4560            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4561            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4562            //   envelope_size bytes, there is always sufficient room.
4563            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4564                self.log_all_events.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4565                encoder,
4566                offset + cur_offset,
4567                depth,
4568            )?;
4569
4570            _prev_end_offset = cur_offset + envelope_size;
4571            if 14 > max_ordinal {
4572                return Ok(());
4573            }
4574
4575            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4576            // are envelope_size bytes.
4577            let cur_offset: usize = (14 - 1) * envelope_size;
4578
4579            // Zero reserved fields.
4580            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4581
4582            // Safety:
4583            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4584            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4585            //   envelope_size bytes, there is always sufficient room.
4586            fidl::encoding::encode_in_envelope_optional::<BuiltinBootResolver, D>(
4587                self.builtin_boot_resolver
4588                    .as_ref()
4589                    .map(<BuiltinBootResolver as fidl::encoding::ValueTypeMarker>::borrow),
4590                encoder,
4591                offset + cur_offset,
4592                depth,
4593            )?;
4594
4595            _prev_end_offset = cur_offset + envelope_size;
4596            if 16 > max_ordinal {
4597                return Ok(());
4598            }
4599
4600            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4601            // are envelope_size bytes.
4602            let cur_offset: usize = (16 - 1) * envelope_size;
4603
4604            // Zero reserved fields.
4605            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4606
4607            // Safety:
4608            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4609            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4610            //   envelope_size bytes, there is always sufficient room.
4611            fidl::encoding::encode_in_envelope_optional::<RealmBuilderResolverAndRunner, D>(
4612                self.realm_builder_resolver_and_runner.as_ref().map(
4613                    <RealmBuilderResolverAndRunner as fidl::encoding::ValueTypeMarker>::borrow,
4614                ),
4615                encoder,
4616                offset + cur_offset,
4617                depth,
4618            )?;
4619
4620            _prev_end_offset = cur_offset + envelope_size;
4621            if 17 > max_ordinal {
4622                return Ok(());
4623            }
4624
4625            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4626            // are envelope_size bytes.
4627            let cur_offset: usize = (17 - 1) * envelope_size;
4628
4629            // Zero reserved fields.
4630            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4631
4632            // Safety:
4633            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4634            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4635            //   envelope_size bytes, there is always sufficient room.
4636            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Capability>, D>(
4637            self.builtin_capabilities.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Capability> as fidl::encoding::ValueTypeMarker>::borrow),
4638            encoder, offset + cur_offset, depth
4639        )?;
4640
4641            _prev_end_offset = cur_offset + envelope_size;
4642            if 18 > max_ordinal {
4643                return Ok(());
4644            }
4645
4646            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4647            // are envelope_size bytes.
4648            let cur_offset: usize = (18 - 1) * envelope_size;
4649
4650            // Zero reserved fields.
4651            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4652
4653            // Safety:
4654            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4655            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4656            //   envelope_size bytes, there is always sufficient room.
4657            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4658                self.enable_introspection
4659                    .as_ref()
4660                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4661                encoder,
4662                offset + cur_offset,
4663                depth,
4664            )?;
4665
4666            _prev_end_offset = cur_offset + envelope_size;
4667            if 19 > max_ordinal {
4668                return Ok(());
4669            }
4670
4671            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4672            // are envelope_size bytes.
4673            let cur_offset: usize = (19 - 1) * envelope_size;
4674
4675            // Zero reserved fields.
4676            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4677
4678            // Safety:
4679            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4680            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4681            //   envelope_size bytes, there is always sufficient room.
4682            fidl::encoding::encode_in_envelope_optional::<AbiRevisionPolicy, D>(
4683                self.abi_revision_policy
4684                    .as_ref()
4685                    .map(<AbiRevisionPolicy as fidl::encoding::ValueTypeMarker>::borrow),
4686                encoder,
4687                offset + cur_offset,
4688                depth,
4689            )?;
4690
4691            _prev_end_offset = cur_offset + envelope_size;
4692            if 20 > max_ordinal {
4693                return Ok(());
4694            }
4695
4696            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4697            // are envelope_size bytes.
4698            let cur_offset: usize = (20 - 1) * envelope_size;
4699
4700            // Zero reserved fields.
4701            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4702
4703            // Safety:
4704            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4705            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4706            //   envelope_size bytes, there is always sufficient room.
4707            fidl::encoding::encode_in_envelope_optional::<VmexSource, D>(
4708                self.vmex_source
4709                    .as_ref()
4710                    .map(<VmexSource as fidl::encoding::ValueTypeMarker>::borrow),
4711                encoder,
4712                offset + cur_offset,
4713                depth,
4714            )?;
4715
4716            _prev_end_offset = cur_offset + envelope_size;
4717            if 21 > max_ordinal {
4718                return Ok(());
4719            }
4720
4721            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4722            // are envelope_size bytes.
4723            let cur_offset: usize = (21 - 1) * envelope_size;
4724
4725            // Zero reserved fields.
4726            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4727
4728            // Safety:
4729            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4730            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4731            //   envelope_size bytes, there is always sufficient room.
4732            fidl::encoding::encode_in_envelope_optional::<HealthCheck, D>(
4733                self.health_check
4734                    .as_ref()
4735                    .map(<HealthCheck as fidl::encoding::ValueTypeMarker>::borrow),
4736                encoder,
4737                offset + cur_offset,
4738                depth,
4739            )?;
4740
4741            _prev_end_offset = cur_offset + envelope_size;
4742            if 22 > max_ordinal {
4743                return Ok(());
4744            }
4745
4746            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4747            // are envelope_size bytes.
4748            let cur_offset: usize = (22 - 1) * envelope_size;
4749
4750            // Zero reserved fields.
4751            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4752
4753            // Safety:
4754            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4755            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4756            //   envelope_size bytes, there is always sufficient room.
4757            fidl::encoding::encode_in_envelope_optional::<TraceProvider, D>(
4758                self.trace_provider
4759                    .as_ref()
4760                    .map(<TraceProvider as fidl::encoding::ValueTypeMarker>::borrow),
4761                encoder,
4762                offset + cur_offset,
4763                depth,
4764            )?;
4765
4766            _prev_end_offset = cur_offset + envelope_size;
4767
4768            Ok(())
4769        }
4770    }
4771
4772    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Config {
4773        #[inline(always)]
4774        fn new_empty() -> Self {
4775            Self::default()
4776        }
4777
4778        unsafe fn decode(
4779            &mut self,
4780            decoder: &mut fidl::encoding::Decoder<'_, D>,
4781            offset: usize,
4782            mut depth: fidl::encoding::Depth,
4783        ) -> fidl::Result<()> {
4784            decoder.debug_check_bounds::<Self>(offset);
4785            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4786                None => return Err(fidl::Error::NotNullable),
4787                Some(len) => len,
4788            };
4789            // Calling decoder.out_of_line_offset(0) is not allowed.
4790            if len == 0 {
4791                return Ok(());
4792            };
4793            depth.increment()?;
4794            let envelope_size = 8;
4795            let bytes_len = len * envelope_size;
4796            let offset = decoder.out_of_line_offset(bytes_len)?;
4797            // Decode the envelope for each type.
4798            let mut _next_ordinal_to_read = 0;
4799            let mut next_offset = offset;
4800            let end_offset = offset + bytes_len;
4801            _next_ordinal_to_read += 1;
4802            if next_offset >= end_offset {
4803                return Ok(());
4804            }
4805
4806            // Decode unknown envelopes for gaps in ordinals.
4807            while _next_ordinal_to_read < 1 {
4808                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4809                _next_ordinal_to_read += 1;
4810                next_offset += envelope_size;
4811            }
4812
4813            let next_out_of_line = decoder.next_out_of_line();
4814            let handles_before = decoder.remaining_handles();
4815            if let Some((inlined, num_bytes, num_handles)) =
4816                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4817            {
4818                let member_inline_size =
4819                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4820                if inlined != (member_inline_size <= 4) {
4821                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4822                }
4823                let inner_offset;
4824                let mut inner_depth = depth.clone();
4825                if inlined {
4826                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4827                    inner_offset = next_offset;
4828                } else {
4829                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4830                    inner_depth.increment()?;
4831                }
4832                let val_ref = self.debug.get_or_insert_with(|| fidl::new_empty!(bool, D));
4833                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4834                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4835                {
4836                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4837                }
4838                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4839                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4840                }
4841            }
4842
4843            next_offset += envelope_size;
4844            _next_ordinal_to_read += 1;
4845            if next_offset >= end_offset {
4846                return Ok(());
4847            }
4848
4849            // Decode unknown envelopes for gaps in ordinals.
4850            while _next_ordinal_to_read < 2 {
4851                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4852                _next_ordinal_to_read += 1;
4853                next_offset += envelope_size;
4854            }
4855
4856            let next_out_of_line = decoder.next_out_of_line();
4857            let handles_before = decoder.remaining_handles();
4858            if let Some((inlined, num_bytes, num_handles)) =
4859                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4860            {
4861                let member_inline_size =
4862                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4863                if inlined != (member_inline_size <= 4) {
4864                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4865                }
4866                let inner_offset;
4867                let mut inner_depth = depth.clone();
4868                if inlined {
4869                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4870                    inner_offset = next_offset;
4871                } else {
4872                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4873                    inner_depth.increment()?;
4874                }
4875                let val_ref =
4876                    self.list_children_batch_size.get_or_insert_with(|| fidl::new_empty!(u32, D));
4877                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
4878                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4879                {
4880                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4881                }
4882                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4883                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4884                }
4885            }
4886
4887            next_offset += envelope_size;
4888            _next_ordinal_to_read += 1;
4889            if next_offset >= end_offset {
4890                return Ok(());
4891            }
4892
4893            // Decode unknown envelopes for gaps in ordinals.
4894            while _next_ordinal_to_read < 3 {
4895                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4896                _next_ordinal_to_read += 1;
4897                next_offset += envelope_size;
4898            }
4899
4900            let next_out_of_line = decoder.next_out_of_line();
4901            let handles_before = decoder.remaining_handles();
4902            if let Some((inlined, num_bytes, num_handles)) =
4903                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4904            {
4905                let member_inline_size =
4906                    <SecurityPolicy as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4907                if inlined != (member_inline_size <= 4) {
4908                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4909                }
4910                let inner_offset;
4911                let mut inner_depth = depth.clone();
4912                if inlined {
4913                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4914                    inner_offset = next_offset;
4915                } else {
4916                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4917                    inner_depth.increment()?;
4918                }
4919                let val_ref =
4920                    self.security_policy.get_or_insert_with(|| fidl::new_empty!(SecurityPolicy, D));
4921                fidl::decode!(SecurityPolicy, D, val_ref, decoder, inner_offset, inner_depth)?;
4922                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4923                {
4924                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4925                }
4926                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4927                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4928                }
4929            }
4930
4931            next_offset += envelope_size;
4932            _next_ordinal_to_read += 1;
4933            if next_offset >= end_offset {
4934                return Ok(());
4935            }
4936
4937            // Decode unknown envelopes for gaps in ordinals.
4938            while _next_ordinal_to_read < 4 {
4939                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4940                _next_ordinal_to_read += 1;
4941                next_offset += envelope_size;
4942            }
4943
4944            let next_out_of_line = decoder.next_out_of_line();
4945            let handles_before = decoder.remaining_handles();
4946            if let Some((inlined, num_bytes, num_handles)) =
4947                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4948            {
4949                let member_inline_size = <fidl::encoding::UnboundedVector<
4950                    fidl_fuchsia_component_decl::Capability,
4951                > as fidl::encoding::TypeMarker>::inline_size(
4952                    decoder.context
4953                );
4954                if inlined != (member_inline_size <= 4) {
4955                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4956                }
4957                let inner_offset;
4958                let mut inner_depth = depth.clone();
4959                if inlined {
4960                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4961                    inner_offset = next_offset;
4962                } else {
4963                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4964                    inner_depth.increment()?;
4965                }
4966                let val_ref = self.namespace_capabilities.get_or_insert_with(|| {
4967                    fidl::new_empty!(
4968                        fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Capability>,
4969                        D
4970                    )
4971                });
4972                fidl::decode!(
4973                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Capability>,
4974                    D,
4975                    val_ref,
4976                    decoder,
4977                    inner_offset,
4978                    inner_depth
4979                )?;
4980                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4981                {
4982                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4983                }
4984                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4985                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4986                }
4987            }
4988
4989            next_offset += envelope_size;
4990            _next_ordinal_to_read += 1;
4991            if next_offset >= end_offset {
4992                return Ok(());
4993            }
4994
4995            // Decode unknown envelopes for gaps in ordinals.
4996            while _next_ordinal_to_read < 5 {
4997                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4998                _next_ordinal_to_read += 1;
4999                next_offset += envelope_size;
5000            }
5001
5002            let next_out_of_line = decoder.next_out_of_line();
5003            let handles_before = decoder.remaining_handles();
5004            if let Some((inlined, num_bytes, num_handles)) =
5005                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5006            {
5007                let member_inline_size =
5008                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5009                if inlined != (member_inline_size <= 4) {
5010                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5011                }
5012                let inner_offset;
5013                let mut inner_depth = depth.clone();
5014                if inlined {
5015                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5016                    inner_offset = next_offset;
5017                } else {
5018                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5019                    inner_depth.increment()?;
5020                }
5021                let val_ref = self
5022                    .use_builtin_process_launcher
5023                    .get_or_insert_with(|| fidl::new_empty!(bool, D));
5024                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5025                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5026                {
5027                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5028                }
5029                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5030                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5031                }
5032            }
5033
5034            next_offset += envelope_size;
5035            _next_ordinal_to_read += 1;
5036            if next_offset >= end_offset {
5037                return Ok(());
5038            }
5039
5040            // Decode unknown envelopes for gaps in ordinals.
5041            while _next_ordinal_to_read < 6 {
5042                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5043                _next_ordinal_to_read += 1;
5044                next_offset += envelope_size;
5045            }
5046
5047            let next_out_of_line = decoder.next_out_of_line();
5048            let handles_before = decoder.remaining_handles();
5049            if let Some((inlined, num_bytes, num_handles)) =
5050                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5051            {
5052                let member_inline_size =
5053                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5054                if inlined != (member_inline_size <= 4) {
5055                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5056                }
5057                let inner_offset;
5058                let mut inner_depth = depth.clone();
5059                if inlined {
5060                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5061                    inner_offset = next_offset;
5062                } else {
5063                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5064                    inner_depth.increment()?;
5065                }
5066                let val_ref =
5067                    self.maintain_utc_clock.get_or_insert_with(|| fidl::new_empty!(bool, D));
5068                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5069                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5070                {
5071                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5072                }
5073                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5074                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5075                }
5076            }
5077
5078            next_offset += envelope_size;
5079            _next_ordinal_to_read += 1;
5080            if next_offset >= end_offset {
5081                return Ok(());
5082            }
5083
5084            // Decode unknown envelopes for gaps in ordinals.
5085            while _next_ordinal_to_read < 7 {
5086                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5087                _next_ordinal_to_read += 1;
5088                next_offset += envelope_size;
5089            }
5090
5091            let next_out_of_line = decoder.next_out_of_line();
5092            let handles_before = decoder.remaining_handles();
5093            if let Some((inlined, num_bytes, num_handles)) =
5094                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5095            {
5096                let member_inline_size =
5097                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5098                if inlined != (member_inline_size <= 4) {
5099                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5100                }
5101                let inner_offset;
5102                let mut inner_depth = depth.clone();
5103                if inlined {
5104                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5105                    inner_offset = next_offset;
5106                } else {
5107                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5108                    inner_depth.increment()?;
5109                }
5110                let val_ref = self.num_threads.get_or_insert_with(|| fidl::new_empty!(u8, D));
5111                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
5112                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5113                {
5114                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5115                }
5116                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5117                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5118                }
5119            }
5120
5121            next_offset += envelope_size;
5122            _next_ordinal_to_read += 1;
5123            if next_offset >= end_offset {
5124                return Ok(());
5125            }
5126
5127            // Decode unknown envelopes for gaps in ordinals.
5128            while _next_ordinal_to_read < 10 {
5129                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5130                _next_ordinal_to_read += 1;
5131                next_offset += envelope_size;
5132            }
5133
5134            let next_out_of_line = decoder.next_out_of_line();
5135            let handles_before = decoder.remaining_handles();
5136            if let Some((inlined, num_bytes, num_handles)) =
5137                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5138            {
5139                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5140                if inlined != (member_inline_size <= 4) {
5141                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5142                }
5143                let inner_offset;
5144                let mut inner_depth = depth.clone();
5145                if inlined {
5146                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5147                    inner_offset = next_offset;
5148                } else {
5149                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5150                    inner_depth.increment()?;
5151                }
5152                let val_ref = self.root_component_url.get_or_insert_with(|| {
5153                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
5154                });
5155                fidl::decode!(
5156                    fidl::encoding::BoundedString<4096>,
5157                    D,
5158                    val_ref,
5159                    decoder,
5160                    inner_offset,
5161                    inner_depth
5162                )?;
5163                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5164                {
5165                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5166                }
5167                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5168                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5169                }
5170            }
5171
5172            next_offset += envelope_size;
5173            _next_ordinal_to_read += 1;
5174            if next_offset >= end_offset {
5175                return Ok(());
5176            }
5177
5178            // Decode unknown envelopes for gaps in ordinals.
5179            while _next_ordinal_to_read < 11 {
5180                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5181                _next_ordinal_to_read += 1;
5182                next_offset += envelope_size;
5183            }
5184
5185            let next_out_of_line = decoder.next_out_of_line();
5186            let handles_before = decoder.remaining_handles();
5187            if let Some((inlined, num_bytes, num_handles)) =
5188                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5189            {
5190                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5191                if inlined != (member_inline_size <= 4) {
5192                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5193                }
5194                let inner_offset;
5195                let mut inner_depth = depth.clone();
5196                if inlined {
5197                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5198                    inner_offset = next_offset;
5199                } else {
5200                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5201                    inner_depth.increment()?;
5202                }
5203                let val_ref = self.component_id_index_path.get_or_insert_with(|| {
5204                    fidl::new_empty!(fidl::encoding::BoundedString<4095>, D)
5205                });
5206                fidl::decode!(
5207                    fidl::encoding::BoundedString<4095>,
5208                    D,
5209                    val_ref,
5210                    decoder,
5211                    inner_offset,
5212                    inner_depth
5213                )?;
5214                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5215                {
5216                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5217                }
5218                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5219                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5220                }
5221            }
5222
5223            next_offset += envelope_size;
5224            _next_ordinal_to_read += 1;
5225            if next_offset >= end_offset {
5226                return Ok(());
5227            }
5228
5229            // Decode unknown envelopes for gaps in ordinals.
5230            while _next_ordinal_to_read < 12 {
5231                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5232                _next_ordinal_to_read += 1;
5233                next_offset += envelope_size;
5234            }
5235
5236            let next_out_of_line = decoder.next_out_of_line();
5237            let handles_before = decoder.remaining_handles();
5238            if let Some((inlined, num_bytes, num_handles)) =
5239                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5240            {
5241                let member_inline_size =
5242                    <LogDestination as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5243                if inlined != (member_inline_size <= 4) {
5244                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5245                }
5246                let inner_offset;
5247                let mut inner_depth = depth.clone();
5248                if inlined {
5249                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5250                    inner_offset = next_offset;
5251                } else {
5252                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5253                    inner_depth.increment()?;
5254                }
5255                let val_ref =
5256                    self.log_destination.get_or_insert_with(|| fidl::new_empty!(LogDestination, D));
5257                fidl::decode!(LogDestination, D, val_ref, decoder, inner_offset, inner_depth)?;
5258                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5259                {
5260                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5261                }
5262                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5263                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5264                }
5265            }
5266
5267            next_offset += envelope_size;
5268            _next_ordinal_to_read += 1;
5269            if next_offset >= end_offset {
5270                return Ok(());
5271            }
5272
5273            // Decode unknown envelopes for gaps in ordinals.
5274            while _next_ordinal_to_read < 13 {
5275                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5276                _next_ordinal_to_read += 1;
5277                next_offset += envelope_size;
5278            }
5279
5280            let next_out_of_line = decoder.next_out_of_line();
5281            let handles_before = decoder.remaining_handles();
5282            if let Some((inlined, num_bytes, num_handles)) =
5283                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5284            {
5285                let member_inline_size =
5286                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5287                if inlined != (member_inline_size <= 4) {
5288                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5289                }
5290                let inner_offset;
5291                let mut inner_depth = depth.clone();
5292                if inlined {
5293                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5294                    inner_offset = next_offset;
5295                } else {
5296                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5297                    inner_depth.increment()?;
5298                }
5299                let val_ref = self.log_all_events.get_or_insert_with(|| fidl::new_empty!(bool, D));
5300                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5301                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5302                {
5303                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5304                }
5305                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5306                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5307                }
5308            }
5309
5310            next_offset += envelope_size;
5311            _next_ordinal_to_read += 1;
5312            if next_offset >= end_offset {
5313                return Ok(());
5314            }
5315
5316            // Decode unknown envelopes for gaps in ordinals.
5317            while _next_ordinal_to_read < 14 {
5318                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5319                _next_ordinal_to_read += 1;
5320                next_offset += envelope_size;
5321            }
5322
5323            let next_out_of_line = decoder.next_out_of_line();
5324            let handles_before = decoder.remaining_handles();
5325            if let Some((inlined, num_bytes, num_handles)) =
5326                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5327            {
5328                let member_inline_size =
5329                    <BuiltinBootResolver as fidl::encoding::TypeMarker>::inline_size(
5330                        decoder.context,
5331                    );
5332                if inlined != (member_inline_size <= 4) {
5333                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5334                }
5335                let inner_offset;
5336                let mut inner_depth = depth.clone();
5337                if inlined {
5338                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5339                    inner_offset = next_offset;
5340                } else {
5341                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5342                    inner_depth.increment()?;
5343                }
5344                let val_ref = self
5345                    .builtin_boot_resolver
5346                    .get_or_insert_with(|| fidl::new_empty!(BuiltinBootResolver, D));
5347                fidl::decode!(BuiltinBootResolver, D, val_ref, decoder, inner_offset, inner_depth)?;
5348                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5349                {
5350                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5351                }
5352                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5353                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5354                }
5355            }
5356
5357            next_offset += envelope_size;
5358            _next_ordinal_to_read += 1;
5359            if next_offset >= end_offset {
5360                return Ok(());
5361            }
5362
5363            // Decode unknown envelopes for gaps in ordinals.
5364            while _next_ordinal_to_read < 16 {
5365                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5366                _next_ordinal_to_read += 1;
5367                next_offset += envelope_size;
5368            }
5369
5370            let next_out_of_line = decoder.next_out_of_line();
5371            let handles_before = decoder.remaining_handles();
5372            if let Some((inlined, num_bytes, num_handles)) =
5373                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5374            {
5375                let member_inline_size =
5376                    <RealmBuilderResolverAndRunner as fidl::encoding::TypeMarker>::inline_size(
5377                        decoder.context,
5378                    );
5379                if inlined != (member_inline_size <= 4) {
5380                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5381                }
5382                let inner_offset;
5383                let mut inner_depth = depth.clone();
5384                if inlined {
5385                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5386                    inner_offset = next_offset;
5387                } else {
5388                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5389                    inner_depth.increment()?;
5390                }
5391                let val_ref = self
5392                    .realm_builder_resolver_and_runner
5393                    .get_or_insert_with(|| fidl::new_empty!(RealmBuilderResolverAndRunner, D));
5394                fidl::decode!(
5395                    RealmBuilderResolverAndRunner,
5396                    D,
5397                    val_ref,
5398                    decoder,
5399                    inner_offset,
5400                    inner_depth
5401                )?;
5402                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5403                {
5404                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5405                }
5406                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5407                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5408                }
5409            }
5410
5411            next_offset += envelope_size;
5412            _next_ordinal_to_read += 1;
5413            if next_offset >= end_offset {
5414                return Ok(());
5415            }
5416
5417            // Decode unknown envelopes for gaps in ordinals.
5418            while _next_ordinal_to_read < 17 {
5419                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5420                _next_ordinal_to_read += 1;
5421                next_offset += envelope_size;
5422            }
5423
5424            let next_out_of_line = decoder.next_out_of_line();
5425            let handles_before = decoder.remaining_handles();
5426            if let Some((inlined, num_bytes, num_handles)) =
5427                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5428            {
5429                let member_inline_size = <fidl::encoding::UnboundedVector<
5430                    fidl_fuchsia_component_decl::Capability,
5431                > as fidl::encoding::TypeMarker>::inline_size(
5432                    decoder.context
5433                );
5434                if inlined != (member_inline_size <= 4) {
5435                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5436                }
5437                let inner_offset;
5438                let mut inner_depth = depth.clone();
5439                if inlined {
5440                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5441                    inner_offset = next_offset;
5442                } else {
5443                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5444                    inner_depth.increment()?;
5445                }
5446                let val_ref = self.builtin_capabilities.get_or_insert_with(|| {
5447                    fidl::new_empty!(
5448                        fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Capability>,
5449                        D
5450                    )
5451                });
5452                fidl::decode!(
5453                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Capability>,
5454                    D,
5455                    val_ref,
5456                    decoder,
5457                    inner_offset,
5458                    inner_depth
5459                )?;
5460                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5461                {
5462                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5463                }
5464                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5465                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5466                }
5467            }
5468
5469            next_offset += envelope_size;
5470            _next_ordinal_to_read += 1;
5471            if next_offset >= end_offset {
5472                return Ok(());
5473            }
5474
5475            // Decode unknown envelopes for gaps in ordinals.
5476            while _next_ordinal_to_read < 18 {
5477                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5478                _next_ordinal_to_read += 1;
5479                next_offset += envelope_size;
5480            }
5481
5482            let next_out_of_line = decoder.next_out_of_line();
5483            let handles_before = decoder.remaining_handles();
5484            if let Some((inlined, num_bytes, num_handles)) =
5485                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5486            {
5487                let member_inline_size =
5488                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5489                if inlined != (member_inline_size <= 4) {
5490                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5491                }
5492                let inner_offset;
5493                let mut inner_depth = depth.clone();
5494                if inlined {
5495                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5496                    inner_offset = next_offset;
5497                } else {
5498                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5499                    inner_depth.increment()?;
5500                }
5501                let val_ref =
5502                    self.enable_introspection.get_or_insert_with(|| fidl::new_empty!(bool, D));
5503                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5504                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5505                {
5506                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5507                }
5508                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5509                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5510                }
5511            }
5512
5513            next_offset += envelope_size;
5514            _next_ordinal_to_read += 1;
5515            if next_offset >= end_offset {
5516                return Ok(());
5517            }
5518
5519            // Decode unknown envelopes for gaps in ordinals.
5520            while _next_ordinal_to_read < 19 {
5521                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5522                _next_ordinal_to_read += 1;
5523                next_offset += envelope_size;
5524            }
5525
5526            let next_out_of_line = decoder.next_out_of_line();
5527            let handles_before = decoder.remaining_handles();
5528            if let Some((inlined, num_bytes, num_handles)) =
5529                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5530            {
5531                let member_inline_size =
5532                    <AbiRevisionPolicy as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5533                if inlined != (member_inline_size <= 4) {
5534                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5535                }
5536                let inner_offset;
5537                let mut inner_depth = depth.clone();
5538                if inlined {
5539                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5540                    inner_offset = next_offset;
5541                } else {
5542                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5543                    inner_depth.increment()?;
5544                }
5545                let val_ref = self
5546                    .abi_revision_policy
5547                    .get_or_insert_with(|| fidl::new_empty!(AbiRevisionPolicy, D));
5548                fidl::decode!(AbiRevisionPolicy, D, val_ref, decoder, inner_offset, inner_depth)?;
5549                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5550                {
5551                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5552                }
5553                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5554                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5555                }
5556            }
5557
5558            next_offset += envelope_size;
5559            _next_ordinal_to_read += 1;
5560            if next_offset >= end_offset {
5561                return Ok(());
5562            }
5563
5564            // Decode unknown envelopes for gaps in ordinals.
5565            while _next_ordinal_to_read < 20 {
5566                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5567                _next_ordinal_to_read += 1;
5568                next_offset += envelope_size;
5569            }
5570
5571            let next_out_of_line = decoder.next_out_of_line();
5572            let handles_before = decoder.remaining_handles();
5573            if let Some((inlined, num_bytes, num_handles)) =
5574                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5575            {
5576                let member_inline_size =
5577                    <VmexSource as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5578                if inlined != (member_inline_size <= 4) {
5579                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5580                }
5581                let inner_offset;
5582                let mut inner_depth = depth.clone();
5583                if inlined {
5584                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5585                    inner_offset = next_offset;
5586                } else {
5587                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5588                    inner_depth.increment()?;
5589                }
5590                let val_ref =
5591                    self.vmex_source.get_or_insert_with(|| fidl::new_empty!(VmexSource, D));
5592                fidl::decode!(VmexSource, D, val_ref, decoder, inner_offset, inner_depth)?;
5593                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5594                {
5595                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5596                }
5597                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5598                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5599                }
5600            }
5601
5602            next_offset += envelope_size;
5603            _next_ordinal_to_read += 1;
5604            if next_offset >= end_offset {
5605                return Ok(());
5606            }
5607
5608            // Decode unknown envelopes for gaps in ordinals.
5609            while _next_ordinal_to_read < 21 {
5610                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5611                _next_ordinal_to_read += 1;
5612                next_offset += envelope_size;
5613            }
5614
5615            let next_out_of_line = decoder.next_out_of_line();
5616            let handles_before = decoder.remaining_handles();
5617            if let Some((inlined, num_bytes, num_handles)) =
5618                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5619            {
5620                let member_inline_size =
5621                    <HealthCheck as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5622                if inlined != (member_inline_size <= 4) {
5623                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5624                }
5625                let inner_offset;
5626                let mut inner_depth = depth.clone();
5627                if inlined {
5628                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5629                    inner_offset = next_offset;
5630                } else {
5631                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5632                    inner_depth.increment()?;
5633                }
5634                let val_ref =
5635                    self.health_check.get_or_insert_with(|| fidl::new_empty!(HealthCheck, D));
5636                fidl::decode!(HealthCheck, D, val_ref, decoder, inner_offset, inner_depth)?;
5637                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5638                {
5639                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5640                }
5641                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5642                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5643                }
5644            }
5645
5646            next_offset += envelope_size;
5647            _next_ordinal_to_read += 1;
5648            if next_offset >= end_offset {
5649                return Ok(());
5650            }
5651
5652            // Decode unknown envelopes for gaps in ordinals.
5653            while _next_ordinal_to_read < 22 {
5654                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5655                _next_ordinal_to_read += 1;
5656                next_offset += envelope_size;
5657            }
5658
5659            let next_out_of_line = decoder.next_out_of_line();
5660            let handles_before = decoder.remaining_handles();
5661            if let Some((inlined, num_bytes, num_handles)) =
5662                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5663            {
5664                let member_inline_size =
5665                    <TraceProvider as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5666                if inlined != (member_inline_size <= 4) {
5667                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5668                }
5669                let inner_offset;
5670                let mut inner_depth = depth.clone();
5671                if inlined {
5672                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5673                    inner_offset = next_offset;
5674                } else {
5675                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5676                    inner_depth.increment()?;
5677                }
5678                let val_ref =
5679                    self.trace_provider.get_or_insert_with(|| fidl::new_empty!(TraceProvider, D));
5680                fidl::decode!(TraceProvider, D, val_ref, decoder, inner_offset, inner_depth)?;
5681                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5682                {
5683                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5684                }
5685                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5686                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5687                }
5688            }
5689
5690            next_offset += envelope_size;
5691
5692            // Decode the remaining unknown envelopes.
5693            while next_offset < end_offset {
5694                _next_ordinal_to_read += 1;
5695                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5696                next_offset += envelope_size;
5697            }
5698
5699            Ok(())
5700        }
5701    }
5702
5703    impl DebugRegistrationAllowlistEntry {
5704        #[inline(always)]
5705        fn max_ordinal_present(&self) -> u64 {
5706            if let Some(_) = self.environment_name {
5707                return 4;
5708            }
5709            if let Some(_) = self.moniker {
5710                return 3;
5711            }
5712            if let Some(_) = self.debug {
5713                return 2;
5714            }
5715            if let Some(_) = self.name {
5716                return 1;
5717            }
5718            0
5719        }
5720    }
5721
5722    impl fidl::encoding::ValueTypeMarker for DebugRegistrationAllowlistEntry {
5723        type Borrowed<'a> = &'a Self;
5724        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5725            value
5726        }
5727    }
5728
5729    unsafe impl fidl::encoding::TypeMarker for DebugRegistrationAllowlistEntry {
5730        type Owned = Self;
5731
5732        #[inline(always)]
5733        fn inline_align(_context: fidl::encoding::Context) -> usize {
5734            8
5735        }
5736
5737        #[inline(always)]
5738        fn inline_size(_context: fidl::encoding::Context) -> usize {
5739            16
5740        }
5741    }
5742
5743    unsafe impl<D: fidl::encoding::ResourceDialect>
5744        fidl::encoding::Encode<DebugRegistrationAllowlistEntry, D>
5745        for &DebugRegistrationAllowlistEntry
5746    {
5747        unsafe fn encode(
5748            self,
5749            encoder: &mut fidl::encoding::Encoder<'_, D>,
5750            offset: usize,
5751            mut depth: fidl::encoding::Depth,
5752        ) -> fidl::Result<()> {
5753            encoder.debug_check_bounds::<DebugRegistrationAllowlistEntry>(offset);
5754            // Vector header
5755            let max_ordinal: u64 = self.max_ordinal_present();
5756            encoder.write_num(max_ordinal, offset);
5757            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5758            // Calling encoder.out_of_line_offset(0) is not allowed.
5759            if max_ordinal == 0 {
5760                return Ok(());
5761            }
5762            depth.increment()?;
5763            let envelope_size = 8;
5764            let bytes_len = max_ordinal as usize * envelope_size;
5765            #[allow(unused_variables)]
5766            let offset = encoder.out_of_line_offset(bytes_len);
5767            let mut _prev_end_offset: usize = 0;
5768            if 1 > max_ordinal {
5769                return Ok(());
5770            }
5771
5772            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5773            // are envelope_size bytes.
5774            let cur_offset: usize = (1 - 1) * envelope_size;
5775
5776            // Zero reserved fields.
5777            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5778
5779            // Safety:
5780            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5781            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5782            //   envelope_size bytes, there is always sufficient room.
5783            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
5784                self.name.as_ref().map(
5785                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
5786                ),
5787                encoder,
5788                offset + cur_offset,
5789                depth,
5790            )?;
5791
5792            _prev_end_offset = cur_offset + envelope_size;
5793            if 2 > max_ordinal {
5794                return Ok(());
5795            }
5796
5797            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5798            // are envelope_size bytes.
5799            let cur_offset: usize = (2 - 1) * envelope_size;
5800
5801            // Zero reserved fields.
5802            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5803
5804            // Safety:
5805            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5806            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5807            //   envelope_size bytes, there is always sufficient room.
5808            fidl::encoding::encode_in_envelope_optional::<AllowlistedDebugRegistration, D>(
5809                self.debug
5810                    .as_ref()
5811                    .map(<AllowlistedDebugRegistration as fidl::encoding::ValueTypeMarker>::borrow),
5812                encoder,
5813                offset + cur_offset,
5814                depth,
5815            )?;
5816
5817            _prev_end_offset = cur_offset + envelope_size;
5818            if 3 > max_ordinal {
5819                return Ok(());
5820            }
5821
5822            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5823            // are envelope_size bytes.
5824            let cur_offset: usize = (3 - 1) * envelope_size;
5825
5826            // Zero reserved fields.
5827            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5828
5829            // Safety:
5830            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5831            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5832            //   envelope_size bytes, there is always sufficient room.
5833            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
5834            self.moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
5835            encoder, offset + cur_offset, depth
5836        )?;
5837
5838            _prev_end_offset = cur_offset + envelope_size;
5839            if 4 > max_ordinal {
5840                return Ok(());
5841            }
5842
5843            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5844            // are envelope_size bytes.
5845            let cur_offset: usize = (4 - 1) * envelope_size;
5846
5847            // Zero reserved fields.
5848            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5849
5850            // Safety:
5851            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5852            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5853            //   envelope_size bytes, there is always sufficient room.
5854            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
5855                self.environment_name.as_ref().map(
5856                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
5857                ),
5858                encoder,
5859                offset + cur_offset,
5860                depth,
5861            )?;
5862
5863            _prev_end_offset = cur_offset + envelope_size;
5864
5865            Ok(())
5866        }
5867    }
5868
5869    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5870        for DebugRegistrationAllowlistEntry
5871    {
5872        #[inline(always)]
5873        fn new_empty() -> Self {
5874            Self::default()
5875        }
5876
5877        unsafe fn decode(
5878            &mut self,
5879            decoder: &mut fidl::encoding::Decoder<'_, D>,
5880            offset: usize,
5881            mut depth: fidl::encoding::Depth,
5882        ) -> fidl::Result<()> {
5883            decoder.debug_check_bounds::<Self>(offset);
5884            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5885                None => return Err(fidl::Error::NotNullable),
5886                Some(len) => len,
5887            };
5888            // Calling decoder.out_of_line_offset(0) is not allowed.
5889            if len == 0 {
5890                return Ok(());
5891            };
5892            depth.increment()?;
5893            let envelope_size = 8;
5894            let bytes_len = len * envelope_size;
5895            let offset = decoder.out_of_line_offset(bytes_len)?;
5896            // Decode the envelope for each type.
5897            let mut _next_ordinal_to_read = 0;
5898            let mut next_offset = offset;
5899            let end_offset = offset + bytes_len;
5900            _next_ordinal_to_read += 1;
5901            if next_offset >= end_offset {
5902                return Ok(());
5903            }
5904
5905            // Decode unknown envelopes for gaps in ordinals.
5906            while _next_ordinal_to_read < 1 {
5907                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5908                _next_ordinal_to_read += 1;
5909                next_offset += envelope_size;
5910            }
5911
5912            let next_out_of_line = decoder.next_out_of_line();
5913            let handles_before = decoder.remaining_handles();
5914            if let Some((inlined, num_bytes, num_handles)) =
5915                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5916            {
5917                let member_inline_size =
5918                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
5919                        decoder.context,
5920                    );
5921                if inlined != (member_inline_size <= 4) {
5922                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5923                }
5924                let inner_offset;
5925                let mut inner_depth = depth.clone();
5926                if inlined {
5927                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5928                    inner_offset = next_offset;
5929                } else {
5930                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5931                    inner_depth.increment()?;
5932                }
5933                let val_ref = self
5934                    .name
5935                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
5936                fidl::decode!(
5937                    fidl::encoding::BoundedString<255>,
5938                    D,
5939                    val_ref,
5940                    decoder,
5941                    inner_offset,
5942                    inner_depth
5943                )?;
5944                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5945                {
5946                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5947                }
5948                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5949                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5950                }
5951            }
5952
5953            next_offset += envelope_size;
5954            _next_ordinal_to_read += 1;
5955            if next_offset >= end_offset {
5956                return Ok(());
5957            }
5958
5959            // Decode unknown envelopes for gaps in ordinals.
5960            while _next_ordinal_to_read < 2 {
5961                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5962                _next_ordinal_to_read += 1;
5963                next_offset += envelope_size;
5964            }
5965
5966            let next_out_of_line = decoder.next_out_of_line();
5967            let handles_before = decoder.remaining_handles();
5968            if let Some((inlined, num_bytes, num_handles)) =
5969                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5970            {
5971                let member_inline_size =
5972                    <AllowlistedDebugRegistration as fidl::encoding::TypeMarker>::inline_size(
5973                        decoder.context,
5974                    );
5975                if inlined != (member_inline_size <= 4) {
5976                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5977                }
5978                let inner_offset;
5979                let mut inner_depth = depth.clone();
5980                if inlined {
5981                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5982                    inner_offset = next_offset;
5983                } else {
5984                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5985                    inner_depth.increment()?;
5986                }
5987                let val_ref = self
5988                    .debug
5989                    .get_or_insert_with(|| fidl::new_empty!(AllowlistedDebugRegistration, D));
5990                fidl::decode!(
5991                    AllowlistedDebugRegistration,
5992                    D,
5993                    val_ref,
5994                    decoder,
5995                    inner_offset,
5996                    inner_depth
5997                )?;
5998                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5999                {
6000                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6001                }
6002                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6003                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6004                }
6005            }
6006
6007            next_offset += envelope_size;
6008            _next_ordinal_to_read += 1;
6009            if next_offset >= end_offset {
6010                return Ok(());
6011            }
6012
6013            // Decode unknown envelopes for gaps in ordinals.
6014            while _next_ordinal_to_read < 3 {
6015                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6016                _next_ordinal_to_read += 1;
6017                next_offset += envelope_size;
6018            }
6019
6020            let next_out_of_line = decoder.next_out_of_line();
6021            let handles_before = decoder.remaining_handles();
6022            if let Some((inlined, num_bytes, num_handles)) =
6023                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6024            {
6025                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6026                if inlined != (member_inline_size <= 4) {
6027                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6028                }
6029                let inner_offset;
6030                let mut inner_depth = depth.clone();
6031                if inlined {
6032                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6033                    inner_offset = next_offset;
6034                } else {
6035                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6036                    inner_depth.increment()?;
6037                }
6038                let val_ref = self.moniker.get_or_insert_with(|| {
6039                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
6040                });
6041                fidl::decode!(
6042                    fidl::encoding::BoundedString<4096>,
6043                    D,
6044                    val_ref,
6045                    decoder,
6046                    inner_offset,
6047                    inner_depth
6048                )?;
6049                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6050                {
6051                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6052                }
6053                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6054                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6055                }
6056            }
6057
6058            next_offset += envelope_size;
6059            _next_ordinal_to_read += 1;
6060            if next_offset >= end_offset {
6061                return Ok(());
6062            }
6063
6064            // Decode unknown envelopes for gaps in ordinals.
6065            while _next_ordinal_to_read < 4 {
6066                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6067                _next_ordinal_to_read += 1;
6068                next_offset += envelope_size;
6069            }
6070
6071            let next_out_of_line = decoder.next_out_of_line();
6072            let handles_before = decoder.remaining_handles();
6073            if let Some((inlined, num_bytes, num_handles)) =
6074                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6075            {
6076                let member_inline_size =
6077                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
6078                        decoder.context,
6079                    );
6080                if inlined != (member_inline_size <= 4) {
6081                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6082                }
6083                let inner_offset;
6084                let mut inner_depth = depth.clone();
6085                if inlined {
6086                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6087                    inner_offset = next_offset;
6088                } else {
6089                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6090                    inner_depth.increment()?;
6091                }
6092                let val_ref = self
6093                    .environment_name
6094                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
6095                fidl::decode!(
6096                    fidl::encoding::BoundedString<255>,
6097                    D,
6098                    val_ref,
6099                    decoder,
6100                    inner_offset,
6101                    inner_depth
6102                )?;
6103                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6104                {
6105                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6106                }
6107                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6108                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6109                }
6110            }
6111
6112            next_offset += envelope_size;
6113
6114            // Decode the remaining unknown envelopes.
6115            while next_offset < end_offset {
6116                _next_ordinal_to_read += 1;
6117                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6118                next_offset += envelope_size;
6119            }
6120
6121            Ok(())
6122        }
6123    }
6124
6125    impl DebugRegistrationPolicyAllowlists {
6126        #[inline(always)]
6127        fn max_ordinal_present(&self) -> u64 {
6128            if let Some(_) = self.allowlist {
6129                return 1;
6130            }
6131            0
6132        }
6133    }
6134
6135    impl fidl::encoding::ValueTypeMarker for DebugRegistrationPolicyAllowlists {
6136        type Borrowed<'a> = &'a Self;
6137        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6138            value
6139        }
6140    }
6141
6142    unsafe impl fidl::encoding::TypeMarker for DebugRegistrationPolicyAllowlists {
6143        type Owned = Self;
6144
6145        #[inline(always)]
6146        fn inline_align(_context: fidl::encoding::Context) -> usize {
6147            8
6148        }
6149
6150        #[inline(always)]
6151        fn inline_size(_context: fidl::encoding::Context) -> usize {
6152            16
6153        }
6154    }
6155
6156    unsafe impl<D: fidl::encoding::ResourceDialect>
6157        fidl::encoding::Encode<DebugRegistrationPolicyAllowlists, D>
6158        for &DebugRegistrationPolicyAllowlists
6159    {
6160        unsafe fn encode(
6161            self,
6162            encoder: &mut fidl::encoding::Encoder<'_, D>,
6163            offset: usize,
6164            mut depth: fidl::encoding::Depth,
6165        ) -> fidl::Result<()> {
6166            encoder.debug_check_bounds::<DebugRegistrationPolicyAllowlists>(offset);
6167            // Vector header
6168            let max_ordinal: u64 = self.max_ordinal_present();
6169            encoder.write_num(max_ordinal, offset);
6170            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6171            // Calling encoder.out_of_line_offset(0) is not allowed.
6172            if max_ordinal == 0 {
6173                return Ok(());
6174            }
6175            depth.increment()?;
6176            let envelope_size = 8;
6177            let bytes_len = max_ordinal as usize * envelope_size;
6178            #[allow(unused_variables)]
6179            let offset = encoder.out_of_line_offset(bytes_len);
6180            let mut _prev_end_offset: usize = 0;
6181            if 1 > max_ordinal {
6182                return Ok(());
6183            }
6184
6185            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6186            // are envelope_size bytes.
6187            let cur_offset: usize = (1 - 1) * envelope_size;
6188
6189            // Zero reserved fields.
6190            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6191
6192            // Safety:
6193            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6194            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6195            //   envelope_size bytes, there is always sufficient room.
6196            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<DebugRegistrationAllowlistEntry, 128>, D>(
6197            self.allowlist.as_ref().map(<fidl::encoding::Vector<DebugRegistrationAllowlistEntry, 128> as fidl::encoding::ValueTypeMarker>::borrow),
6198            encoder, offset + cur_offset, depth
6199        )?;
6200
6201            _prev_end_offset = cur_offset + envelope_size;
6202
6203            Ok(())
6204        }
6205    }
6206
6207    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6208        for DebugRegistrationPolicyAllowlists
6209    {
6210        #[inline(always)]
6211        fn new_empty() -> Self {
6212            Self::default()
6213        }
6214
6215        unsafe fn decode(
6216            &mut self,
6217            decoder: &mut fidl::encoding::Decoder<'_, D>,
6218            offset: usize,
6219            mut depth: fidl::encoding::Depth,
6220        ) -> fidl::Result<()> {
6221            decoder.debug_check_bounds::<Self>(offset);
6222            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6223                None => return Err(fidl::Error::NotNullable),
6224                Some(len) => len,
6225            };
6226            // Calling decoder.out_of_line_offset(0) is not allowed.
6227            if len == 0 {
6228                return Ok(());
6229            };
6230            depth.increment()?;
6231            let envelope_size = 8;
6232            let bytes_len = len * envelope_size;
6233            let offset = decoder.out_of_line_offset(bytes_len)?;
6234            // Decode the envelope for each type.
6235            let mut _next_ordinal_to_read = 0;
6236            let mut next_offset = offset;
6237            let end_offset = offset + bytes_len;
6238            _next_ordinal_to_read += 1;
6239            if next_offset >= end_offset {
6240                return Ok(());
6241            }
6242
6243            // Decode unknown envelopes for gaps in ordinals.
6244            while _next_ordinal_to_read < 1 {
6245                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6246                _next_ordinal_to_read += 1;
6247                next_offset += envelope_size;
6248            }
6249
6250            let next_out_of_line = decoder.next_out_of_line();
6251            let handles_before = decoder.remaining_handles();
6252            if let Some((inlined, num_bytes, num_handles)) =
6253                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6254            {
6255                let member_inline_size = <fidl::encoding::Vector<
6256                    DebugRegistrationAllowlistEntry,
6257                    128,
6258                > as fidl::encoding::TypeMarker>::inline_size(
6259                    decoder.context
6260                );
6261                if inlined != (member_inline_size <= 4) {
6262                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6263                }
6264                let inner_offset;
6265                let mut inner_depth = depth.clone();
6266                if inlined {
6267                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6268                    inner_offset = next_offset;
6269                } else {
6270                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6271                    inner_depth.increment()?;
6272                }
6273                let val_ref =
6274                self.allowlist.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<DebugRegistrationAllowlistEntry, 128>, D));
6275                fidl::decode!(fidl::encoding::Vector<DebugRegistrationAllowlistEntry, 128>, D, val_ref, decoder, inner_offset, inner_depth)?;
6276                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6277                {
6278                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6279                }
6280                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6281                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6282                }
6283            }
6284
6285            next_offset += envelope_size;
6286
6287            // Decode the remaining unknown envelopes.
6288            while next_offset < end_offset {
6289                _next_ordinal_to_read += 1;
6290                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6291                next_offset += envelope_size;
6292            }
6293
6294            Ok(())
6295        }
6296    }
6297
6298    impl Environment {
6299        #[inline(always)]
6300        fn max_ordinal_present(&self) -> u64 {
6301            if let Some(_) = self.moniker {
6302                return 2;
6303            }
6304            if let Some(_) = self.capability {
6305                return 1;
6306            }
6307            0
6308        }
6309    }
6310
6311    impl fidl::encoding::ValueTypeMarker for Environment {
6312        type Borrowed<'a> = &'a Self;
6313        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6314            value
6315        }
6316    }
6317
6318    unsafe impl fidl::encoding::TypeMarker for Environment {
6319        type Owned = Self;
6320
6321        #[inline(always)]
6322        fn inline_align(_context: fidl::encoding::Context) -> usize {
6323            8
6324        }
6325
6326        #[inline(always)]
6327        fn inline_size(_context: fidl::encoding::Context) -> usize {
6328            16
6329        }
6330    }
6331
6332    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Environment, D>
6333        for &Environment
6334    {
6335        unsafe fn encode(
6336            self,
6337            encoder: &mut fidl::encoding::Encoder<'_, D>,
6338            offset: usize,
6339            mut depth: fidl::encoding::Depth,
6340        ) -> fidl::Result<()> {
6341            encoder.debug_check_bounds::<Environment>(offset);
6342            // Vector header
6343            let max_ordinal: u64 = self.max_ordinal_present();
6344            encoder.write_num(max_ordinal, offset);
6345            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6346            // Calling encoder.out_of_line_offset(0) is not allowed.
6347            if max_ordinal == 0 {
6348                return Ok(());
6349            }
6350            depth.increment()?;
6351            let envelope_size = 8;
6352            let bytes_len = max_ordinal as usize * envelope_size;
6353            #[allow(unused_variables)]
6354            let offset = encoder.out_of_line_offset(bytes_len);
6355            let mut _prev_end_offset: usize = 0;
6356            if 1 > max_ordinal {
6357                return Ok(());
6358            }
6359
6360            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6361            // are envelope_size bytes.
6362            let cur_offset: usize = (1 - 1) * envelope_size;
6363
6364            // Zero reserved fields.
6365            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6366
6367            // Safety:
6368            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6369            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6370            //   envelope_size bytes, there is always sufficient room.
6371            fidl::encoding::encode_in_envelope_optional::<ComponentCapability, D>(
6372                self.capability
6373                    .as_ref()
6374                    .map(<ComponentCapability as fidl::encoding::ValueTypeMarker>::borrow),
6375                encoder,
6376                offset + cur_offset,
6377                depth,
6378            )?;
6379
6380            _prev_end_offset = cur_offset + envelope_size;
6381            if 2 > max_ordinal {
6382                return Ok(());
6383            }
6384
6385            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6386            // are envelope_size bytes.
6387            let cur_offset: usize = (2 - 1) * envelope_size;
6388
6389            // Zero reserved fields.
6390            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6391
6392            // Safety:
6393            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6394            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6395            //   envelope_size bytes, there is always sufficient room.
6396            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
6397            self.moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
6398            encoder, offset + cur_offset, depth
6399        )?;
6400
6401            _prev_end_offset = cur_offset + envelope_size;
6402
6403            Ok(())
6404        }
6405    }
6406
6407    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Environment {
6408        #[inline(always)]
6409        fn new_empty() -> Self {
6410            Self::default()
6411        }
6412
6413        unsafe fn decode(
6414            &mut self,
6415            decoder: &mut fidl::encoding::Decoder<'_, D>,
6416            offset: usize,
6417            mut depth: fidl::encoding::Depth,
6418        ) -> fidl::Result<()> {
6419            decoder.debug_check_bounds::<Self>(offset);
6420            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6421                None => return Err(fidl::Error::NotNullable),
6422                Some(len) => len,
6423            };
6424            // Calling decoder.out_of_line_offset(0) is not allowed.
6425            if len == 0 {
6426                return Ok(());
6427            };
6428            depth.increment()?;
6429            let envelope_size = 8;
6430            let bytes_len = len * envelope_size;
6431            let offset = decoder.out_of_line_offset(bytes_len)?;
6432            // Decode the envelope for each type.
6433            let mut _next_ordinal_to_read = 0;
6434            let mut next_offset = offset;
6435            let end_offset = offset + bytes_len;
6436            _next_ordinal_to_read += 1;
6437            if next_offset >= end_offset {
6438                return Ok(());
6439            }
6440
6441            // Decode unknown envelopes for gaps in ordinals.
6442            while _next_ordinal_to_read < 1 {
6443                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6444                _next_ordinal_to_read += 1;
6445                next_offset += envelope_size;
6446            }
6447
6448            let next_out_of_line = decoder.next_out_of_line();
6449            let handles_before = decoder.remaining_handles();
6450            if let Some((inlined, num_bytes, num_handles)) =
6451                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6452            {
6453                let member_inline_size =
6454                    <ComponentCapability as fidl::encoding::TypeMarker>::inline_size(
6455                        decoder.context,
6456                    );
6457                if inlined != (member_inline_size <= 4) {
6458                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6459                }
6460                let inner_offset;
6461                let mut inner_depth = depth.clone();
6462                if inlined {
6463                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6464                    inner_offset = next_offset;
6465                } else {
6466                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6467                    inner_depth.increment()?;
6468                }
6469                let val_ref =
6470                    self.capability.get_or_insert_with(|| fidl::new_empty!(ComponentCapability, D));
6471                fidl::decode!(ComponentCapability, D, val_ref, decoder, inner_offset, inner_depth)?;
6472                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6473                {
6474                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6475                }
6476                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6477                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6478                }
6479            }
6480
6481            next_offset += envelope_size;
6482            _next_ordinal_to_read += 1;
6483            if next_offset >= end_offset {
6484                return Ok(());
6485            }
6486
6487            // Decode unknown envelopes for gaps in ordinals.
6488            while _next_ordinal_to_read < 2 {
6489                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6490                _next_ordinal_to_read += 1;
6491                next_offset += envelope_size;
6492            }
6493
6494            let next_out_of_line = decoder.next_out_of_line();
6495            let handles_before = decoder.remaining_handles();
6496            if let Some((inlined, num_bytes, num_handles)) =
6497                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6498            {
6499                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6500                if inlined != (member_inline_size <= 4) {
6501                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6502                }
6503                let inner_offset;
6504                let mut inner_depth = depth.clone();
6505                if inlined {
6506                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6507                    inner_offset = next_offset;
6508                } else {
6509                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6510                    inner_depth.increment()?;
6511                }
6512                let val_ref = self.moniker.get_or_insert_with(|| {
6513                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
6514                });
6515                fidl::decode!(
6516                    fidl::encoding::BoundedString<4096>,
6517                    D,
6518                    val_ref,
6519                    decoder,
6520                    inner_offset,
6521                    inner_depth
6522                )?;
6523                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6524                {
6525                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6526                }
6527                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6528                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6529                }
6530            }
6531
6532            next_offset += envelope_size;
6533
6534            // Decode the remaining unknown envelopes.
6535            while next_offset < end_offset {
6536                _next_ordinal_to_read += 1;
6537                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6538                next_offset += envelope_size;
6539            }
6540
6541            Ok(())
6542        }
6543    }
6544
6545    impl EnvironmentSource {
6546        #[inline(always)]
6547        fn max_ordinal_present(&self) -> u64 {
6548            if let Some(_) = self.source {
6549                return 2;
6550            }
6551            if let Some(_) = self.source_name {
6552                return 1;
6553            }
6554            0
6555        }
6556    }
6557
6558    impl fidl::encoding::ValueTypeMarker for EnvironmentSource {
6559        type Borrowed<'a> = &'a Self;
6560        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6561            value
6562        }
6563    }
6564
6565    unsafe impl fidl::encoding::TypeMarker for EnvironmentSource {
6566        type Owned = Self;
6567
6568        #[inline(always)]
6569        fn inline_align(_context: fidl::encoding::Context) -> usize {
6570            8
6571        }
6572
6573        #[inline(always)]
6574        fn inline_size(_context: fidl::encoding::Context) -> usize {
6575            16
6576        }
6577    }
6578
6579    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EnvironmentSource, D>
6580        for &EnvironmentSource
6581    {
6582        unsafe fn encode(
6583            self,
6584            encoder: &mut fidl::encoding::Encoder<'_, D>,
6585            offset: usize,
6586            mut depth: fidl::encoding::Depth,
6587        ) -> fidl::Result<()> {
6588            encoder.debug_check_bounds::<EnvironmentSource>(offset);
6589            // Vector header
6590            let max_ordinal: u64 = self.max_ordinal_present();
6591            encoder.write_num(max_ordinal, offset);
6592            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6593            // Calling encoder.out_of_line_offset(0) is not allowed.
6594            if max_ordinal == 0 {
6595                return Ok(());
6596            }
6597            depth.increment()?;
6598            let envelope_size = 8;
6599            let bytes_len = max_ordinal as usize * envelope_size;
6600            #[allow(unused_variables)]
6601            let offset = encoder.out_of_line_offset(bytes_len);
6602            let mut _prev_end_offset: usize = 0;
6603            if 1 > max_ordinal {
6604                return Ok(());
6605            }
6606
6607            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6608            // are envelope_size bytes.
6609            let cur_offset: usize = (1 - 1) * envelope_size;
6610
6611            // Zero reserved fields.
6612            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6613
6614            // Safety:
6615            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6616            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6617            //   envelope_size bytes, there is always sufficient room.
6618            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
6619            self.source_name.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
6620            encoder, offset + cur_offset, depth
6621        )?;
6622
6623            _prev_end_offset = cur_offset + envelope_size;
6624            if 2 > max_ordinal {
6625                return Ok(());
6626            }
6627
6628            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6629            // are envelope_size bytes.
6630            let cur_offset: usize = (2 - 1) * envelope_size;
6631
6632            // Zero reserved fields.
6633            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6634
6635            // Safety:
6636            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6637            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6638            //   envelope_size bytes, there is always sufficient room.
6639            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_decl::Ref, D>(
6640                self.source.as_ref().map(
6641                    <fidl_fuchsia_component_decl::Ref as fidl::encoding::ValueTypeMarker>::borrow,
6642                ),
6643                encoder,
6644                offset + cur_offset,
6645                depth,
6646            )?;
6647
6648            _prev_end_offset = cur_offset + envelope_size;
6649
6650            Ok(())
6651        }
6652    }
6653
6654    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EnvironmentSource {
6655        #[inline(always)]
6656        fn new_empty() -> Self {
6657            Self::default()
6658        }
6659
6660        unsafe fn decode(
6661            &mut self,
6662            decoder: &mut fidl::encoding::Decoder<'_, D>,
6663            offset: usize,
6664            mut depth: fidl::encoding::Depth,
6665        ) -> fidl::Result<()> {
6666            decoder.debug_check_bounds::<Self>(offset);
6667            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6668                None => return Err(fidl::Error::NotNullable),
6669                Some(len) => len,
6670            };
6671            // Calling decoder.out_of_line_offset(0) is not allowed.
6672            if len == 0 {
6673                return Ok(());
6674            };
6675            depth.increment()?;
6676            let envelope_size = 8;
6677            let bytes_len = len * envelope_size;
6678            let offset = decoder.out_of_line_offset(bytes_len)?;
6679            // Decode the envelope for each type.
6680            let mut _next_ordinal_to_read = 0;
6681            let mut next_offset = offset;
6682            let end_offset = offset + bytes_len;
6683            _next_ordinal_to_read += 1;
6684            if next_offset >= end_offset {
6685                return Ok(());
6686            }
6687
6688            // Decode unknown envelopes for gaps in ordinals.
6689            while _next_ordinal_to_read < 1 {
6690                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6691                _next_ordinal_to_read += 1;
6692                next_offset += envelope_size;
6693            }
6694
6695            let next_out_of_line = decoder.next_out_of_line();
6696            let handles_before = decoder.remaining_handles();
6697            if let Some((inlined, num_bytes, num_handles)) =
6698                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6699            {
6700                let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6701                if inlined != (member_inline_size <= 4) {
6702                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6703                }
6704                let inner_offset;
6705                let mut inner_depth = depth.clone();
6706                if inlined {
6707                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6708                    inner_offset = next_offset;
6709                } else {
6710                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6711                    inner_depth.increment()?;
6712                }
6713                let val_ref = self.source_name.get_or_insert_with(|| {
6714                    fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
6715                });
6716                fidl::decode!(
6717                    fidl::encoding::BoundedString<1024>,
6718                    D,
6719                    val_ref,
6720                    decoder,
6721                    inner_offset,
6722                    inner_depth
6723                )?;
6724                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6725                {
6726                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6727                }
6728                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6729                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6730                }
6731            }
6732
6733            next_offset += envelope_size;
6734            _next_ordinal_to_read += 1;
6735            if next_offset >= end_offset {
6736                return Ok(());
6737            }
6738
6739            // Decode unknown envelopes for gaps in ordinals.
6740            while _next_ordinal_to_read < 2 {
6741                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6742                _next_ordinal_to_read += 1;
6743                next_offset += envelope_size;
6744            }
6745
6746            let next_out_of_line = decoder.next_out_of_line();
6747            let handles_before = decoder.remaining_handles();
6748            if let Some((inlined, num_bytes, num_handles)) =
6749                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6750            {
6751                let member_inline_size =
6752                    <fidl_fuchsia_component_decl::Ref as fidl::encoding::TypeMarker>::inline_size(
6753                        decoder.context,
6754                    );
6755                if inlined != (member_inline_size <= 4) {
6756                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6757                }
6758                let inner_offset;
6759                let mut inner_depth = depth.clone();
6760                if inlined {
6761                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6762                    inner_offset = next_offset;
6763                } else {
6764                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6765                    inner_depth.increment()?;
6766                }
6767                let val_ref = self
6768                    .source
6769                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_component_decl::Ref, D));
6770                fidl::decode!(
6771                    fidl_fuchsia_component_decl::Ref,
6772                    D,
6773                    val_ref,
6774                    decoder,
6775                    inner_offset,
6776                    inner_depth
6777                )?;
6778                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6779                {
6780                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6781                }
6782                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6783                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6784                }
6785            }
6786
6787            next_offset += envelope_size;
6788
6789            // Decode the remaining unknown envelopes.
6790            while next_offset < end_offset {
6791                _next_ordinal_to_read += 1;
6792                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6793                next_offset += envelope_size;
6794            }
6795
6796            Ok(())
6797        }
6798    }
6799
6800    impl FilteredAggregateProvider {
6801        #[inline(always)]
6802        fn max_ordinal_present(&self) -> u64 {
6803            if let Some(_) = self.sources {
6804                return 4;
6805            }
6806            if let Some(_) = self.offer_service_decls {
6807                return 3;
6808            }
6809            if let Some(_) = self.moniker {
6810                return 2;
6811            }
6812            if let Some(_) = self.capability {
6813                return 1;
6814            }
6815            0
6816        }
6817    }
6818
6819    impl fidl::encoding::ValueTypeMarker for FilteredAggregateProvider {
6820        type Borrowed<'a> = &'a Self;
6821        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6822            value
6823        }
6824    }
6825
6826    unsafe impl fidl::encoding::TypeMarker for FilteredAggregateProvider {
6827        type Owned = Self;
6828
6829        #[inline(always)]
6830        fn inline_align(_context: fidl::encoding::Context) -> usize {
6831            8
6832        }
6833
6834        #[inline(always)]
6835        fn inline_size(_context: fidl::encoding::Context) -> usize {
6836            16
6837        }
6838    }
6839
6840    unsafe impl<D: fidl::encoding::ResourceDialect>
6841        fidl::encoding::Encode<FilteredAggregateProvider, D> for &FilteredAggregateProvider
6842    {
6843        unsafe fn encode(
6844            self,
6845            encoder: &mut fidl::encoding::Encoder<'_, D>,
6846            offset: usize,
6847            mut depth: fidl::encoding::Depth,
6848        ) -> fidl::Result<()> {
6849            encoder.debug_check_bounds::<FilteredAggregateProvider>(offset);
6850            // Vector header
6851            let max_ordinal: u64 = self.max_ordinal_present();
6852            encoder.write_num(max_ordinal, offset);
6853            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6854            // Calling encoder.out_of_line_offset(0) is not allowed.
6855            if max_ordinal == 0 {
6856                return Ok(());
6857            }
6858            depth.increment()?;
6859            let envelope_size = 8;
6860            let bytes_len = max_ordinal as usize * envelope_size;
6861            #[allow(unused_variables)]
6862            let offset = encoder.out_of_line_offset(bytes_len);
6863            let mut _prev_end_offset: usize = 0;
6864            if 1 > max_ordinal {
6865                return Ok(());
6866            }
6867
6868            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6869            // are envelope_size bytes.
6870            let cur_offset: usize = (1 - 1) * envelope_size;
6871
6872            // Zero reserved fields.
6873            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6874
6875            // Safety:
6876            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6877            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6878            //   envelope_size bytes, there is always sufficient room.
6879            fidl::encoding::encode_in_envelope_optional::<AggregateCapability, D>(
6880                self.capability
6881                    .as_ref()
6882                    .map(<AggregateCapability as fidl::encoding::ValueTypeMarker>::borrow),
6883                encoder,
6884                offset + cur_offset,
6885                depth,
6886            )?;
6887
6888            _prev_end_offset = cur_offset + envelope_size;
6889            if 2 > max_ordinal {
6890                return Ok(());
6891            }
6892
6893            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6894            // are envelope_size bytes.
6895            let cur_offset: usize = (2 - 1) * envelope_size;
6896
6897            // Zero reserved fields.
6898            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6899
6900            // Safety:
6901            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6902            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6903            //   envelope_size bytes, there is always sufficient room.
6904            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
6905            self.moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
6906            encoder, offset + cur_offset, depth
6907        )?;
6908
6909            _prev_end_offset = cur_offset + envelope_size;
6910            if 3 > max_ordinal {
6911                return Ok(());
6912            }
6913
6914            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6915            // are envelope_size bytes.
6916            let cur_offset: usize = (3 - 1) * envelope_size;
6917
6918            // Zero reserved fields.
6919            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6920
6921            // Safety:
6922            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6923            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6924            //   envelope_size bytes, there is always sufficient room.
6925            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::OfferService>, D>(
6926            self.offer_service_decls.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::OfferService> as fidl::encoding::ValueTypeMarker>::borrow),
6927            encoder, offset + cur_offset, depth
6928        )?;
6929
6930            _prev_end_offset = cur_offset + envelope_size;
6931            if 4 > max_ordinal {
6932                return Ok(());
6933            }
6934
6935            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6936            // are envelope_size bytes.
6937            let cur_offset: usize = (4 - 1) * envelope_size;
6938
6939            // Zero reserved fields.
6940            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6941
6942            // Safety:
6943            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6944            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6945            //   envelope_size bytes, there is always sufficient room.
6946            fidl::encoding::encode_in_envelope_optional::<Sources, D>(
6947                self.sources.as_ref().map(<Sources as fidl::encoding::ValueTypeMarker>::borrow),
6948                encoder,
6949                offset + cur_offset,
6950                depth,
6951            )?;
6952
6953            _prev_end_offset = cur_offset + envelope_size;
6954
6955            Ok(())
6956        }
6957    }
6958
6959    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6960        for FilteredAggregateProvider
6961    {
6962        #[inline(always)]
6963        fn new_empty() -> Self {
6964            Self::default()
6965        }
6966
6967        unsafe fn decode(
6968            &mut self,
6969            decoder: &mut fidl::encoding::Decoder<'_, D>,
6970            offset: usize,
6971            mut depth: fidl::encoding::Depth,
6972        ) -> fidl::Result<()> {
6973            decoder.debug_check_bounds::<Self>(offset);
6974            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6975                None => return Err(fidl::Error::NotNullable),
6976                Some(len) => len,
6977            };
6978            // Calling decoder.out_of_line_offset(0) is not allowed.
6979            if len == 0 {
6980                return Ok(());
6981            };
6982            depth.increment()?;
6983            let envelope_size = 8;
6984            let bytes_len = len * envelope_size;
6985            let offset = decoder.out_of_line_offset(bytes_len)?;
6986            // Decode the envelope for each type.
6987            let mut _next_ordinal_to_read = 0;
6988            let mut next_offset = offset;
6989            let end_offset = offset + bytes_len;
6990            _next_ordinal_to_read += 1;
6991            if next_offset >= end_offset {
6992                return Ok(());
6993            }
6994
6995            // Decode unknown envelopes for gaps in ordinals.
6996            while _next_ordinal_to_read < 1 {
6997                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6998                _next_ordinal_to_read += 1;
6999                next_offset += envelope_size;
7000            }
7001
7002            let next_out_of_line = decoder.next_out_of_line();
7003            let handles_before = decoder.remaining_handles();
7004            if let Some((inlined, num_bytes, num_handles)) =
7005                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7006            {
7007                let member_inline_size =
7008                    <AggregateCapability as fidl::encoding::TypeMarker>::inline_size(
7009                        decoder.context,
7010                    );
7011                if inlined != (member_inline_size <= 4) {
7012                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7013                }
7014                let inner_offset;
7015                let mut inner_depth = depth.clone();
7016                if inlined {
7017                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7018                    inner_offset = next_offset;
7019                } else {
7020                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7021                    inner_depth.increment()?;
7022                }
7023                let val_ref =
7024                    self.capability.get_or_insert_with(|| fidl::new_empty!(AggregateCapability, D));
7025                fidl::decode!(AggregateCapability, D, val_ref, decoder, inner_offset, inner_depth)?;
7026                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7027                {
7028                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7029                }
7030                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7031                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7032                }
7033            }
7034
7035            next_offset += envelope_size;
7036            _next_ordinal_to_read += 1;
7037            if next_offset >= end_offset {
7038                return Ok(());
7039            }
7040
7041            // Decode unknown envelopes for gaps in ordinals.
7042            while _next_ordinal_to_read < 2 {
7043                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7044                _next_ordinal_to_read += 1;
7045                next_offset += envelope_size;
7046            }
7047
7048            let next_out_of_line = decoder.next_out_of_line();
7049            let handles_before = decoder.remaining_handles();
7050            if let Some((inlined, num_bytes, num_handles)) =
7051                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7052            {
7053                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7054                if inlined != (member_inline_size <= 4) {
7055                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7056                }
7057                let inner_offset;
7058                let mut inner_depth = depth.clone();
7059                if inlined {
7060                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7061                    inner_offset = next_offset;
7062                } else {
7063                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7064                    inner_depth.increment()?;
7065                }
7066                let val_ref = self.moniker.get_or_insert_with(|| {
7067                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
7068                });
7069                fidl::decode!(
7070                    fidl::encoding::BoundedString<4096>,
7071                    D,
7072                    val_ref,
7073                    decoder,
7074                    inner_offset,
7075                    inner_depth
7076                )?;
7077                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7078                {
7079                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7080                }
7081                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7082                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7083                }
7084            }
7085
7086            next_offset += envelope_size;
7087            _next_ordinal_to_read += 1;
7088            if next_offset >= end_offset {
7089                return Ok(());
7090            }
7091
7092            // Decode unknown envelopes for gaps in ordinals.
7093            while _next_ordinal_to_read < 3 {
7094                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7095                _next_ordinal_to_read += 1;
7096                next_offset += envelope_size;
7097            }
7098
7099            let next_out_of_line = decoder.next_out_of_line();
7100            let handles_before = decoder.remaining_handles();
7101            if let Some((inlined, num_bytes, num_handles)) =
7102                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7103            {
7104                let member_inline_size = <fidl::encoding::UnboundedVector<
7105                    fidl_fuchsia_component_decl::OfferService,
7106                > as fidl::encoding::TypeMarker>::inline_size(
7107                    decoder.context
7108                );
7109                if inlined != (member_inline_size <= 4) {
7110                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7111                }
7112                let inner_offset;
7113                let mut inner_depth = depth.clone();
7114                if inlined {
7115                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7116                    inner_offset = next_offset;
7117                } else {
7118                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7119                    inner_depth.increment()?;
7120                }
7121                let val_ref = self.offer_service_decls.get_or_insert_with(|| {
7122                    fidl::new_empty!(
7123                        fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::OfferService>,
7124                        D
7125                    )
7126                });
7127                fidl::decode!(
7128                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::OfferService>,
7129                    D,
7130                    val_ref,
7131                    decoder,
7132                    inner_offset,
7133                    inner_depth
7134                )?;
7135                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7136                {
7137                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7138                }
7139                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7140                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7141                }
7142            }
7143
7144            next_offset += envelope_size;
7145            _next_ordinal_to_read += 1;
7146            if next_offset >= end_offset {
7147                return Ok(());
7148            }
7149
7150            // Decode unknown envelopes for gaps in ordinals.
7151            while _next_ordinal_to_read < 4 {
7152                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7153                _next_ordinal_to_read += 1;
7154                next_offset += envelope_size;
7155            }
7156
7157            let next_out_of_line = decoder.next_out_of_line();
7158            let handles_before = decoder.remaining_handles();
7159            if let Some((inlined, num_bytes, num_handles)) =
7160                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7161            {
7162                let member_inline_size =
7163                    <Sources as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7164                if inlined != (member_inline_size <= 4) {
7165                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7166                }
7167                let inner_offset;
7168                let mut inner_depth = depth.clone();
7169                if inlined {
7170                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7171                    inner_offset = next_offset;
7172                } else {
7173                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7174                    inner_depth.increment()?;
7175                }
7176                let val_ref = self.sources.get_or_insert_with(|| fidl::new_empty!(Sources, D));
7177                fidl::decode!(Sources, D, val_ref, decoder, inner_offset, inner_depth)?;
7178                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7179                {
7180                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7181                }
7182                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7183                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7184                }
7185            }
7186
7187            next_offset += envelope_size;
7188
7189            // Decode the remaining unknown envelopes.
7190            while next_offset < end_offset {
7191                _next_ordinal_to_read += 1;
7192                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7193                next_offset += envelope_size;
7194            }
7195
7196            Ok(())
7197        }
7198    }
7199
7200    impl FilteredProvider {
7201        #[inline(always)]
7202        fn max_ordinal_present(&self) -> u64 {
7203            if let Some(_) = self.offer_service_decl {
7204                return 4;
7205            }
7206            if let Some(_) = self.service_capability {
7207                return 3;
7208            }
7209            if let Some(_) = self.moniker {
7210                return 2;
7211            }
7212            if let Some(_) = self.capability {
7213                return 1;
7214            }
7215            0
7216        }
7217    }
7218
7219    impl fidl::encoding::ValueTypeMarker for FilteredProvider {
7220        type Borrowed<'a> = &'a Self;
7221        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7222            value
7223        }
7224    }
7225
7226    unsafe impl fidl::encoding::TypeMarker for FilteredProvider {
7227        type Owned = Self;
7228
7229        #[inline(always)]
7230        fn inline_align(_context: fidl::encoding::Context) -> usize {
7231            8
7232        }
7233
7234        #[inline(always)]
7235        fn inline_size(_context: fidl::encoding::Context) -> usize {
7236            16
7237        }
7238    }
7239
7240    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FilteredProvider, D>
7241        for &FilteredProvider
7242    {
7243        unsafe fn encode(
7244            self,
7245            encoder: &mut fidl::encoding::Encoder<'_, D>,
7246            offset: usize,
7247            mut depth: fidl::encoding::Depth,
7248        ) -> fidl::Result<()> {
7249            encoder.debug_check_bounds::<FilteredProvider>(offset);
7250            // Vector header
7251            let max_ordinal: u64 = self.max_ordinal_present();
7252            encoder.write_num(max_ordinal, offset);
7253            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7254            // Calling encoder.out_of_line_offset(0) is not allowed.
7255            if max_ordinal == 0 {
7256                return Ok(());
7257            }
7258            depth.increment()?;
7259            let envelope_size = 8;
7260            let bytes_len = max_ordinal as usize * envelope_size;
7261            #[allow(unused_variables)]
7262            let offset = encoder.out_of_line_offset(bytes_len);
7263            let mut _prev_end_offset: usize = 0;
7264            if 1 > max_ordinal {
7265                return Ok(());
7266            }
7267
7268            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7269            // are envelope_size bytes.
7270            let cur_offset: usize = (1 - 1) * envelope_size;
7271
7272            // Zero reserved fields.
7273            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7274
7275            // Safety:
7276            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7277            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7278            //   envelope_size bytes, there is always sufficient room.
7279            fidl::encoding::encode_in_envelope_optional::<AggregateCapability, D>(
7280                self.capability
7281                    .as_ref()
7282                    .map(<AggregateCapability as fidl::encoding::ValueTypeMarker>::borrow),
7283                encoder,
7284                offset + cur_offset,
7285                depth,
7286            )?;
7287
7288            _prev_end_offset = cur_offset + envelope_size;
7289            if 2 > max_ordinal {
7290                return Ok(());
7291            }
7292
7293            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7294            // are envelope_size bytes.
7295            let cur_offset: usize = (2 - 1) * envelope_size;
7296
7297            // Zero reserved fields.
7298            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7299
7300            // Safety:
7301            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7302            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7303            //   envelope_size bytes, there is always sufficient room.
7304            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
7305            self.moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
7306            encoder, offset + cur_offset, depth
7307        )?;
7308
7309            _prev_end_offset = cur_offset + envelope_size;
7310            if 3 > max_ordinal {
7311                return Ok(());
7312            }
7313
7314            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7315            // are envelope_size bytes.
7316            let cur_offset: usize = (3 - 1) * envelope_size;
7317
7318            // Zero reserved fields.
7319            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7320
7321            // Safety:
7322            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7323            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7324            //   envelope_size bytes, there is always sufficient room.
7325            fidl::encoding::encode_in_envelope_optional::<ComponentCapability, D>(
7326                self.service_capability
7327                    .as_ref()
7328                    .map(<ComponentCapability as fidl::encoding::ValueTypeMarker>::borrow),
7329                encoder,
7330                offset + cur_offset,
7331                depth,
7332            )?;
7333
7334            _prev_end_offset = cur_offset + envelope_size;
7335            if 4 > max_ordinal {
7336                return Ok(());
7337            }
7338
7339            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7340            // are envelope_size bytes.
7341            let cur_offset: usize = (4 - 1) * envelope_size;
7342
7343            // Zero reserved fields.
7344            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7345
7346            // Safety:
7347            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7348            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7349            //   envelope_size bytes, there is always sufficient room.
7350            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_decl::OfferService, D>(
7351            self.offer_service_decl.as_ref().map(<fidl_fuchsia_component_decl::OfferService as fidl::encoding::ValueTypeMarker>::borrow),
7352            encoder, offset + cur_offset, depth
7353        )?;
7354
7355            _prev_end_offset = cur_offset + envelope_size;
7356
7357            Ok(())
7358        }
7359    }
7360
7361    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilteredProvider {
7362        #[inline(always)]
7363        fn new_empty() -> Self {
7364            Self::default()
7365        }
7366
7367        unsafe fn decode(
7368            &mut self,
7369            decoder: &mut fidl::encoding::Decoder<'_, D>,
7370            offset: usize,
7371            mut depth: fidl::encoding::Depth,
7372        ) -> fidl::Result<()> {
7373            decoder.debug_check_bounds::<Self>(offset);
7374            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7375                None => return Err(fidl::Error::NotNullable),
7376                Some(len) => len,
7377            };
7378            // Calling decoder.out_of_line_offset(0) is not allowed.
7379            if len == 0 {
7380                return Ok(());
7381            };
7382            depth.increment()?;
7383            let envelope_size = 8;
7384            let bytes_len = len * envelope_size;
7385            let offset = decoder.out_of_line_offset(bytes_len)?;
7386            // Decode the envelope for each type.
7387            let mut _next_ordinal_to_read = 0;
7388            let mut next_offset = offset;
7389            let end_offset = offset + bytes_len;
7390            _next_ordinal_to_read += 1;
7391            if next_offset >= end_offset {
7392                return Ok(());
7393            }
7394
7395            // Decode unknown envelopes for gaps in ordinals.
7396            while _next_ordinal_to_read < 1 {
7397                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7398                _next_ordinal_to_read += 1;
7399                next_offset += envelope_size;
7400            }
7401
7402            let next_out_of_line = decoder.next_out_of_line();
7403            let handles_before = decoder.remaining_handles();
7404            if let Some((inlined, num_bytes, num_handles)) =
7405                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7406            {
7407                let member_inline_size =
7408                    <AggregateCapability as fidl::encoding::TypeMarker>::inline_size(
7409                        decoder.context,
7410                    );
7411                if inlined != (member_inline_size <= 4) {
7412                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7413                }
7414                let inner_offset;
7415                let mut inner_depth = depth.clone();
7416                if inlined {
7417                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7418                    inner_offset = next_offset;
7419                } else {
7420                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7421                    inner_depth.increment()?;
7422                }
7423                let val_ref =
7424                    self.capability.get_or_insert_with(|| fidl::new_empty!(AggregateCapability, D));
7425                fidl::decode!(AggregateCapability, D, val_ref, decoder, inner_offset, inner_depth)?;
7426                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7427                {
7428                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7429                }
7430                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7431                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7432                }
7433            }
7434
7435            next_offset += envelope_size;
7436            _next_ordinal_to_read += 1;
7437            if next_offset >= end_offset {
7438                return Ok(());
7439            }
7440
7441            // Decode unknown envelopes for gaps in ordinals.
7442            while _next_ordinal_to_read < 2 {
7443                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7444                _next_ordinal_to_read += 1;
7445                next_offset += envelope_size;
7446            }
7447
7448            let next_out_of_line = decoder.next_out_of_line();
7449            let handles_before = decoder.remaining_handles();
7450            if let Some((inlined, num_bytes, num_handles)) =
7451                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7452            {
7453                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7454                if inlined != (member_inline_size <= 4) {
7455                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7456                }
7457                let inner_offset;
7458                let mut inner_depth = depth.clone();
7459                if inlined {
7460                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7461                    inner_offset = next_offset;
7462                } else {
7463                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7464                    inner_depth.increment()?;
7465                }
7466                let val_ref = self.moniker.get_or_insert_with(|| {
7467                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
7468                });
7469                fidl::decode!(
7470                    fidl::encoding::BoundedString<4096>,
7471                    D,
7472                    val_ref,
7473                    decoder,
7474                    inner_offset,
7475                    inner_depth
7476                )?;
7477                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7478                {
7479                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7480                }
7481                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7482                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7483                }
7484            }
7485
7486            next_offset += envelope_size;
7487            _next_ordinal_to_read += 1;
7488            if next_offset >= end_offset {
7489                return Ok(());
7490            }
7491
7492            // Decode unknown envelopes for gaps in ordinals.
7493            while _next_ordinal_to_read < 3 {
7494                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7495                _next_ordinal_to_read += 1;
7496                next_offset += envelope_size;
7497            }
7498
7499            let next_out_of_line = decoder.next_out_of_line();
7500            let handles_before = decoder.remaining_handles();
7501            if let Some((inlined, num_bytes, num_handles)) =
7502                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7503            {
7504                let member_inline_size =
7505                    <ComponentCapability as fidl::encoding::TypeMarker>::inline_size(
7506                        decoder.context,
7507                    );
7508                if inlined != (member_inline_size <= 4) {
7509                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7510                }
7511                let inner_offset;
7512                let mut inner_depth = depth.clone();
7513                if inlined {
7514                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7515                    inner_offset = next_offset;
7516                } else {
7517                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7518                    inner_depth.increment()?;
7519                }
7520                let val_ref = self
7521                    .service_capability
7522                    .get_or_insert_with(|| fidl::new_empty!(ComponentCapability, D));
7523                fidl::decode!(ComponentCapability, D, val_ref, decoder, inner_offset, inner_depth)?;
7524                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7525                {
7526                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7527                }
7528                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7529                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7530                }
7531            }
7532
7533            next_offset += envelope_size;
7534            _next_ordinal_to_read += 1;
7535            if next_offset >= end_offset {
7536                return Ok(());
7537            }
7538
7539            // Decode unknown envelopes for gaps in ordinals.
7540            while _next_ordinal_to_read < 4 {
7541                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7542                _next_ordinal_to_read += 1;
7543                next_offset += envelope_size;
7544            }
7545
7546            let next_out_of_line = decoder.next_out_of_line();
7547            let handles_before = decoder.remaining_handles();
7548            if let Some((inlined, num_bytes, num_handles)) =
7549                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7550            {
7551                let member_inline_size = <fidl_fuchsia_component_decl::OfferService as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7552                if inlined != (member_inline_size <= 4) {
7553                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7554                }
7555                let inner_offset;
7556                let mut inner_depth = depth.clone();
7557                if inlined {
7558                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7559                    inner_offset = next_offset;
7560                } else {
7561                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7562                    inner_depth.increment()?;
7563                }
7564                let val_ref = self.offer_service_decl.get_or_insert_with(|| {
7565                    fidl::new_empty!(fidl_fuchsia_component_decl::OfferService, D)
7566                });
7567                fidl::decode!(
7568                    fidl_fuchsia_component_decl::OfferService,
7569                    D,
7570                    val_ref,
7571                    decoder,
7572                    inner_offset,
7573                    inner_depth
7574                )?;
7575                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7576                {
7577                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7578                }
7579                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7580                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7581                }
7582            }
7583
7584            next_offset += envelope_size;
7585
7586            // Decode the remaining unknown envelopes.
7587            while next_offset < end_offset {
7588                _next_ordinal_to_read += 1;
7589                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7590                next_offset += envelope_size;
7591            }
7592
7593            Ok(())
7594        }
7595    }
7596
7597    impl Framework {
7598        #[inline(always)]
7599        fn max_ordinal_present(&self) -> u64 {
7600            if let Some(_) = self.moniker {
7601                return 2;
7602            }
7603            if let Some(_) = self.capability {
7604                return 1;
7605            }
7606            0
7607        }
7608    }
7609
7610    impl fidl::encoding::ValueTypeMarker for Framework {
7611        type Borrowed<'a> = &'a Self;
7612        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7613            value
7614        }
7615    }
7616
7617    unsafe impl fidl::encoding::TypeMarker for Framework {
7618        type Owned = Self;
7619
7620        #[inline(always)]
7621        fn inline_align(_context: fidl::encoding::Context) -> usize {
7622            8
7623        }
7624
7625        #[inline(always)]
7626        fn inline_size(_context: fidl::encoding::Context) -> usize {
7627            16
7628        }
7629    }
7630
7631    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Framework, D>
7632        for &Framework
7633    {
7634        unsafe fn encode(
7635            self,
7636            encoder: &mut fidl::encoding::Encoder<'_, D>,
7637            offset: usize,
7638            mut depth: fidl::encoding::Depth,
7639        ) -> fidl::Result<()> {
7640            encoder.debug_check_bounds::<Framework>(offset);
7641            // Vector header
7642            let max_ordinal: u64 = self.max_ordinal_present();
7643            encoder.write_num(max_ordinal, offset);
7644            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7645            // Calling encoder.out_of_line_offset(0) is not allowed.
7646            if max_ordinal == 0 {
7647                return Ok(());
7648            }
7649            depth.increment()?;
7650            let envelope_size = 8;
7651            let bytes_len = max_ordinal as usize * envelope_size;
7652            #[allow(unused_variables)]
7653            let offset = encoder.out_of_line_offset(bytes_len);
7654            let mut _prev_end_offset: usize = 0;
7655            if 1 > max_ordinal {
7656                return Ok(());
7657            }
7658
7659            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7660            // are envelope_size bytes.
7661            let cur_offset: usize = (1 - 1) * envelope_size;
7662
7663            // Zero reserved fields.
7664            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7665
7666            // Safety:
7667            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7668            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7669            //   envelope_size bytes, there is always sufficient room.
7670            fidl::encoding::encode_in_envelope_optional::<InternalCapability, D>(
7671                self.capability
7672                    .as_ref()
7673                    .map(<InternalCapability as fidl::encoding::ValueTypeMarker>::borrow),
7674                encoder,
7675                offset + cur_offset,
7676                depth,
7677            )?;
7678
7679            _prev_end_offset = cur_offset + envelope_size;
7680            if 2 > max_ordinal {
7681                return Ok(());
7682            }
7683
7684            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7685            // are envelope_size bytes.
7686            let cur_offset: usize = (2 - 1) * envelope_size;
7687
7688            // Zero reserved fields.
7689            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7690
7691            // Safety:
7692            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7693            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7694            //   envelope_size bytes, there is always sufficient room.
7695            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
7696            self.moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
7697            encoder, offset + cur_offset, depth
7698        )?;
7699
7700            _prev_end_offset = cur_offset + envelope_size;
7701
7702            Ok(())
7703        }
7704    }
7705
7706    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Framework {
7707        #[inline(always)]
7708        fn new_empty() -> Self {
7709            Self::default()
7710        }
7711
7712        unsafe fn decode(
7713            &mut self,
7714            decoder: &mut fidl::encoding::Decoder<'_, D>,
7715            offset: usize,
7716            mut depth: fidl::encoding::Depth,
7717        ) -> fidl::Result<()> {
7718            decoder.debug_check_bounds::<Self>(offset);
7719            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7720                None => return Err(fidl::Error::NotNullable),
7721                Some(len) => len,
7722            };
7723            // Calling decoder.out_of_line_offset(0) is not allowed.
7724            if len == 0 {
7725                return Ok(());
7726            };
7727            depth.increment()?;
7728            let envelope_size = 8;
7729            let bytes_len = len * envelope_size;
7730            let offset = decoder.out_of_line_offset(bytes_len)?;
7731            // Decode the envelope for each type.
7732            let mut _next_ordinal_to_read = 0;
7733            let mut next_offset = offset;
7734            let end_offset = offset + bytes_len;
7735            _next_ordinal_to_read += 1;
7736            if next_offset >= end_offset {
7737                return Ok(());
7738            }
7739
7740            // Decode unknown envelopes for gaps in ordinals.
7741            while _next_ordinal_to_read < 1 {
7742                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7743                _next_ordinal_to_read += 1;
7744                next_offset += envelope_size;
7745            }
7746
7747            let next_out_of_line = decoder.next_out_of_line();
7748            let handles_before = decoder.remaining_handles();
7749            if let Some((inlined, num_bytes, num_handles)) =
7750                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7751            {
7752                let member_inline_size =
7753                    <InternalCapability as fidl::encoding::TypeMarker>::inline_size(
7754                        decoder.context,
7755                    );
7756                if inlined != (member_inline_size <= 4) {
7757                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7758                }
7759                let inner_offset;
7760                let mut inner_depth = depth.clone();
7761                if inlined {
7762                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7763                    inner_offset = next_offset;
7764                } else {
7765                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7766                    inner_depth.increment()?;
7767                }
7768                let val_ref =
7769                    self.capability.get_or_insert_with(|| fidl::new_empty!(InternalCapability, D));
7770                fidl::decode!(InternalCapability, D, val_ref, decoder, inner_offset, inner_depth)?;
7771                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7772                {
7773                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7774                }
7775                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7776                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7777                }
7778            }
7779
7780            next_offset += envelope_size;
7781            _next_ordinal_to_read += 1;
7782            if next_offset >= end_offset {
7783                return Ok(());
7784            }
7785
7786            // Decode unknown envelopes for gaps in ordinals.
7787            while _next_ordinal_to_read < 2 {
7788                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7789                _next_ordinal_to_read += 1;
7790                next_offset += envelope_size;
7791            }
7792
7793            let next_out_of_line = decoder.next_out_of_line();
7794            let handles_before = decoder.remaining_handles();
7795            if let Some((inlined, num_bytes, num_handles)) =
7796                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7797            {
7798                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7799                if inlined != (member_inline_size <= 4) {
7800                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7801                }
7802                let inner_offset;
7803                let mut inner_depth = depth.clone();
7804                if inlined {
7805                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7806                    inner_offset = next_offset;
7807                } else {
7808                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7809                    inner_depth.increment()?;
7810                }
7811                let val_ref = self.moniker.get_or_insert_with(|| {
7812                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
7813                });
7814                fidl::decode!(
7815                    fidl::encoding::BoundedString<4096>,
7816                    D,
7817                    val_ref,
7818                    decoder,
7819                    inner_offset,
7820                    inner_depth
7821                )?;
7822                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7823                {
7824                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7825                }
7826                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7827                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7828                }
7829            }
7830
7831            next_offset += envelope_size;
7832
7833            // Decode the remaining unknown envelopes.
7834            while next_offset < end_offset {
7835                _next_ordinal_to_read += 1;
7836                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7837                next_offset += envelope_size;
7838            }
7839
7840            Ok(())
7841        }
7842    }
7843
7844    impl HealthCheck {
7845        #[inline(always)]
7846        fn max_ordinal_present(&self) -> u64 {
7847            if let Some(_) = self.monikers {
7848                return 1;
7849            }
7850            0
7851        }
7852    }
7853
7854    impl fidl::encoding::ValueTypeMarker for HealthCheck {
7855        type Borrowed<'a> = &'a Self;
7856        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7857            value
7858        }
7859    }
7860
7861    unsafe impl fidl::encoding::TypeMarker for HealthCheck {
7862        type Owned = Self;
7863
7864        #[inline(always)]
7865        fn inline_align(_context: fidl::encoding::Context) -> usize {
7866            8
7867        }
7868
7869        #[inline(always)]
7870        fn inline_size(_context: fidl::encoding::Context) -> usize {
7871            16
7872        }
7873    }
7874
7875    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HealthCheck, D>
7876        for &HealthCheck
7877    {
7878        unsafe fn encode(
7879            self,
7880            encoder: &mut fidl::encoding::Encoder<'_, D>,
7881            offset: usize,
7882            mut depth: fidl::encoding::Depth,
7883        ) -> fidl::Result<()> {
7884            encoder.debug_check_bounds::<HealthCheck>(offset);
7885            // Vector header
7886            let max_ordinal: u64 = self.max_ordinal_present();
7887            encoder.write_num(max_ordinal, offset);
7888            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7889            // Calling encoder.out_of_line_offset(0) is not allowed.
7890            if max_ordinal == 0 {
7891                return Ok(());
7892            }
7893            depth.increment()?;
7894            let envelope_size = 8;
7895            let bytes_len = max_ordinal as usize * envelope_size;
7896            #[allow(unused_variables)]
7897            let offset = encoder.out_of_line_offset(bytes_len);
7898            let mut _prev_end_offset: usize = 0;
7899            if 1 > max_ordinal {
7900                return Ok(());
7901            }
7902
7903            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7904            // are envelope_size bytes.
7905            let cur_offset: usize = (1 - 1) * envelope_size;
7906
7907            // Zero reserved fields.
7908            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7909
7910            // Safety:
7911            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7912            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7913            //   envelope_size bytes, there is always sufficient room.
7914            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>>, D>(
7915            self.monikers.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>> as fidl::encoding::ValueTypeMarker>::borrow),
7916            encoder, offset + cur_offset, depth
7917        )?;
7918
7919            _prev_end_offset = cur_offset + envelope_size;
7920
7921            Ok(())
7922        }
7923    }
7924
7925    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HealthCheck {
7926        #[inline(always)]
7927        fn new_empty() -> Self {
7928            Self::default()
7929        }
7930
7931        unsafe fn decode(
7932            &mut self,
7933            decoder: &mut fidl::encoding::Decoder<'_, D>,
7934            offset: usize,
7935            mut depth: fidl::encoding::Depth,
7936        ) -> fidl::Result<()> {
7937            decoder.debug_check_bounds::<Self>(offset);
7938            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7939                None => return Err(fidl::Error::NotNullable),
7940                Some(len) => len,
7941            };
7942            // Calling decoder.out_of_line_offset(0) is not allowed.
7943            if len == 0 {
7944                return Ok(());
7945            };
7946            depth.increment()?;
7947            let envelope_size = 8;
7948            let bytes_len = len * envelope_size;
7949            let offset = decoder.out_of_line_offset(bytes_len)?;
7950            // Decode the envelope for each type.
7951            let mut _next_ordinal_to_read = 0;
7952            let mut next_offset = offset;
7953            let end_offset = offset + bytes_len;
7954            _next_ordinal_to_read += 1;
7955            if next_offset >= end_offset {
7956                return Ok(());
7957            }
7958
7959            // Decode unknown envelopes for gaps in ordinals.
7960            while _next_ordinal_to_read < 1 {
7961                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7962                _next_ordinal_to_read += 1;
7963                next_offset += envelope_size;
7964            }
7965
7966            let next_out_of_line = decoder.next_out_of_line();
7967            let handles_before = decoder.remaining_handles();
7968            if let Some((inlined, num_bytes, num_handles)) =
7969                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7970            {
7971                let member_inline_size = <fidl::encoding::UnboundedVector<
7972                    fidl::encoding::BoundedString<255>,
7973                > as fidl::encoding::TypeMarker>::inline_size(
7974                    decoder.context
7975                );
7976                if inlined != (member_inline_size <= 4) {
7977                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7978                }
7979                let inner_offset;
7980                let mut inner_depth = depth.clone();
7981                if inlined {
7982                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7983                    inner_offset = next_offset;
7984                } else {
7985                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7986                    inner_depth.increment()?;
7987                }
7988                let val_ref = self.monikers.get_or_insert_with(|| {
7989                    fidl::new_empty!(
7990                        fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>>,
7991                        D
7992                    )
7993                });
7994                fidl::decode!(
7995                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>>,
7996                    D,
7997                    val_ref,
7998                    decoder,
7999                    inner_offset,
8000                    inner_depth
8001                )?;
8002                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8003                {
8004                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8005                }
8006                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8007                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8008                }
8009            }
8010
8011            next_offset += envelope_size;
8012
8013            // Decode the remaining unknown envelopes.
8014            while next_offset < end_offset {
8015                _next_ordinal_to_read += 1;
8016                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8017                next_offset += envelope_size;
8018            }
8019
8020            Ok(())
8021        }
8022    }
8023
8024    impl InstanceIdEntry {
8025        #[inline(always)]
8026        fn max_ordinal_present(&self) -> u64 {
8027            if let Some(_) = self.moniker {
8028                return 3;
8029            }
8030            if let Some(_) = self.instance_id {
8031                return 1;
8032            }
8033            0
8034        }
8035    }
8036
8037    impl fidl::encoding::ValueTypeMarker for InstanceIdEntry {
8038        type Borrowed<'a> = &'a Self;
8039        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8040            value
8041        }
8042    }
8043
8044    unsafe impl fidl::encoding::TypeMarker for InstanceIdEntry {
8045        type Owned = Self;
8046
8047        #[inline(always)]
8048        fn inline_align(_context: fidl::encoding::Context) -> usize {
8049            8
8050        }
8051
8052        #[inline(always)]
8053        fn inline_size(_context: fidl::encoding::Context) -> usize {
8054            16
8055        }
8056    }
8057
8058    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InstanceIdEntry, D>
8059        for &InstanceIdEntry
8060    {
8061        unsafe fn encode(
8062            self,
8063            encoder: &mut fidl::encoding::Encoder<'_, D>,
8064            offset: usize,
8065            mut depth: fidl::encoding::Depth,
8066        ) -> fidl::Result<()> {
8067            encoder.debug_check_bounds::<InstanceIdEntry>(offset);
8068            // Vector header
8069            let max_ordinal: u64 = self.max_ordinal_present();
8070            encoder.write_num(max_ordinal, offset);
8071            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8072            // Calling encoder.out_of_line_offset(0) is not allowed.
8073            if max_ordinal == 0 {
8074                return Ok(());
8075            }
8076            depth.increment()?;
8077            let envelope_size = 8;
8078            let bytes_len = max_ordinal as usize * envelope_size;
8079            #[allow(unused_variables)]
8080            let offset = encoder.out_of_line_offset(bytes_len);
8081            let mut _prev_end_offset: usize = 0;
8082            if 1 > max_ordinal {
8083                return Ok(());
8084            }
8085
8086            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8087            // are envelope_size bytes.
8088            let cur_offset: usize = (1 - 1) * envelope_size;
8089
8090            // Zero reserved fields.
8091            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8092
8093            // Safety:
8094            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8095            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8096            //   envelope_size bytes, there is always sufficient room.
8097            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<64>, D>(
8098                self.instance_id.as_ref().map(
8099                    <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow,
8100                ),
8101                encoder,
8102                offset + cur_offset,
8103                depth,
8104            )?;
8105
8106            _prev_end_offset = cur_offset + envelope_size;
8107            if 3 > max_ordinal {
8108                return Ok(());
8109            }
8110
8111            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8112            // are envelope_size bytes.
8113            let cur_offset: usize = (3 - 1) * envelope_size;
8114
8115            // Zero reserved fields.
8116            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8117
8118            // Safety:
8119            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8120            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8121            //   envelope_size bytes, there is always sufficient room.
8122            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
8123            self.moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
8124            encoder, offset + cur_offset, depth
8125        )?;
8126
8127            _prev_end_offset = cur_offset + envelope_size;
8128
8129            Ok(())
8130        }
8131    }
8132
8133    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InstanceIdEntry {
8134        #[inline(always)]
8135        fn new_empty() -> Self {
8136            Self::default()
8137        }
8138
8139        unsafe fn decode(
8140            &mut self,
8141            decoder: &mut fidl::encoding::Decoder<'_, D>,
8142            offset: usize,
8143            mut depth: fidl::encoding::Depth,
8144        ) -> fidl::Result<()> {
8145            decoder.debug_check_bounds::<Self>(offset);
8146            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8147                None => return Err(fidl::Error::NotNullable),
8148                Some(len) => len,
8149            };
8150            // Calling decoder.out_of_line_offset(0) is not allowed.
8151            if len == 0 {
8152                return Ok(());
8153            };
8154            depth.increment()?;
8155            let envelope_size = 8;
8156            let bytes_len = len * envelope_size;
8157            let offset = decoder.out_of_line_offset(bytes_len)?;
8158            // Decode the envelope for each type.
8159            let mut _next_ordinal_to_read = 0;
8160            let mut next_offset = offset;
8161            let end_offset = offset + bytes_len;
8162            _next_ordinal_to_read += 1;
8163            if next_offset >= end_offset {
8164                return Ok(());
8165            }
8166
8167            // Decode unknown envelopes for gaps in ordinals.
8168            while _next_ordinal_to_read < 1 {
8169                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8170                _next_ordinal_to_read += 1;
8171                next_offset += envelope_size;
8172            }
8173
8174            let next_out_of_line = decoder.next_out_of_line();
8175            let handles_before = decoder.remaining_handles();
8176            if let Some((inlined, num_bytes, num_handles)) =
8177                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8178            {
8179                let member_inline_size =
8180                    <fidl::encoding::BoundedString<64> as fidl::encoding::TypeMarker>::inline_size(
8181                        decoder.context,
8182                    );
8183                if inlined != (member_inline_size <= 4) {
8184                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8185                }
8186                let inner_offset;
8187                let mut inner_depth = depth.clone();
8188                if inlined {
8189                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8190                    inner_offset = next_offset;
8191                } else {
8192                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8193                    inner_depth.increment()?;
8194                }
8195                let val_ref = self
8196                    .instance_id
8197                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<64>, D));
8198                fidl::decode!(
8199                    fidl::encoding::BoundedString<64>,
8200                    D,
8201                    val_ref,
8202                    decoder,
8203                    inner_offset,
8204                    inner_depth
8205                )?;
8206                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8207                {
8208                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8209                }
8210                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8211                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8212                }
8213            }
8214
8215            next_offset += envelope_size;
8216            _next_ordinal_to_read += 1;
8217            if next_offset >= end_offset {
8218                return Ok(());
8219            }
8220
8221            // Decode unknown envelopes for gaps in ordinals.
8222            while _next_ordinal_to_read < 3 {
8223                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8224                _next_ordinal_to_read += 1;
8225                next_offset += envelope_size;
8226            }
8227
8228            let next_out_of_line = decoder.next_out_of_line();
8229            let handles_before = decoder.remaining_handles();
8230            if let Some((inlined, num_bytes, num_handles)) =
8231                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8232            {
8233                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8234                if inlined != (member_inline_size <= 4) {
8235                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8236                }
8237                let inner_offset;
8238                let mut inner_depth = depth.clone();
8239                if inlined {
8240                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8241                    inner_offset = next_offset;
8242                } else {
8243                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8244                    inner_depth.increment()?;
8245                }
8246                let val_ref = self.moniker.get_or_insert_with(|| {
8247                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
8248                });
8249                fidl::decode!(
8250                    fidl::encoding::BoundedString<4096>,
8251                    D,
8252                    val_ref,
8253                    decoder,
8254                    inner_offset,
8255                    inner_depth
8256                )?;
8257                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8258                {
8259                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8260                }
8261                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8262                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8263                }
8264            }
8265
8266            next_offset += envelope_size;
8267
8268            // Decode the remaining unknown envelopes.
8269            while next_offset < end_offset {
8270                _next_ordinal_to_read += 1;
8271                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8272                next_offset += envelope_size;
8273            }
8274
8275            Ok(())
8276        }
8277    }
8278
8279    impl JobPolicyAllowlists {
8280        #[inline(always)]
8281        fn max_ordinal_present(&self) -> u64 {
8282            if let Some(_) = self.create_raw_processes {
8283                return 3;
8284            }
8285            if let Some(_) = self.main_process_critical {
8286                return 2;
8287            }
8288            if let Some(_) = self.ambient_mark_vmo_exec {
8289                return 1;
8290            }
8291            0
8292        }
8293    }
8294
8295    impl fidl::encoding::ValueTypeMarker for JobPolicyAllowlists {
8296        type Borrowed<'a> = &'a Self;
8297        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8298            value
8299        }
8300    }
8301
8302    unsafe impl fidl::encoding::TypeMarker for JobPolicyAllowlists {
8303        type Owned = Self;
8304
8305        #[inline(always)]
8306        fn inline_align(_context: fidl::encoding::Context) -> usize {
8307            8
8308        }
8309
8310        #[inline(always)]
8311        fn inline_size(_context: fidl::encoding::Context) -> usize {
8312            16
8313        }
8314    }
8315
8316    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<JobPolicyAllowlists, D>
8317        for &JobPolicyAllowlists
8318    {
8319        unsafe fn encode(
8320            self,
8321            encoder: &mut fidl::encoding::Encoder<'_, D>,
8322            offset: usize,
8323            mut depth: fidl::encoding::Depth,
8324        ) -> fidl::Result<()> {
8325            encoder.debug_check_bounds::<JobPolicyAllowlists>(offset);
8326            // Vector header
8327            let max_ordinal: u64 = self.max_ordinal_present();
8328            encoder.write_num(max_ordinal, offset);
8329            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8330            // Calling encoder.out_of_line_offset(0) is not allowed.
8331            if max_ordinal == 0 {
8332                return Ok(());
8333            }
8334            depth.increment()?;
8335            let envelope_size = 8;
8336            let bytes_len = max_ordinal as usize * envelope_size;
8337            #[allow(unused_variables)]
8338            let offset = encoder.out_of_line_offset(bytes_len);
8339            let mut _prev_end_offset: usize = 0;
8340            if 1 > max_ordinal {
8341                return Ok(());
8342            }
8343
8344            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8345            // are envelope_size bytes.
8346            let cur_offset: usize = (1 - 1) * envelope_size;
8347
8348            // Zero reserved fields.
8349            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8350
8351            // Safety:
8352            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8353            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8354            //   envelope_size bytes, there is always sufficient room.
8355            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>, D>(
8356            self.ambient_mark_vmo_exec.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128> as fidl::encoding::ValueTypeMarker>::borrow),
8357            encoder, offset + cur_offset, depth
8358        )?;
8359
8360            _prev_end_offset = cur_offset + envelope_size;
8361            if 2 > max_ordinal {
8362                return Ok(());
8363            }
8364
8365            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8366            // are envelope_size bytes.
8367            let cur_offset: usize = (2 - 1) * envelope_size;
8368
8369            // Zero reserved fields.
8370            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8371
8372            // Safety:
8373            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8374            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8375            //   envelope_size bytes, there is always sufficient room.
8376            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>, D>(
8377            self.main_process_critical.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128> as fidl::encoding::ValueTypeMarker>::borrow),
8378            encoder, offset + cur_offset, depth
8379        )?;
8380
8381            _prev_end_offset = cur_offset + envelope_size;
8382            if 3 > max_ordinal {
8383                return Ok(());
8384            }
8385
8386            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8387            // are envelope_size bytes.
8388            let cur_offset: usize = (3 - 1) * envelope_size;
8389
8390            // Zero reserved fields.
8391            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8392
8393            // Safety:
8394            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8395            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8396            //   envelope_size bytes, there is always sufficient room.
8397            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>, D>(
8398            self.create_raw_processes.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128> as fidl::encoding::ValueTypeMarker>::borrow),
8399            encoder, offset + cur_offset, depth
8400        )?;
8401
8402            _prev_end_offset = cur_offset + envelope_size;
8403
8404            Ok(())
8405        }
8406    }
8407
8408    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for JobPolicyAllowlists {
8409        #[inline(always)]
8410        fn new_empty() -> Self {
8411            Self::default()
8412        }
8413
8414        unsafe fn decode(
8415            &mut self,
8416            decoder: &mut fidl::encoding::Decoder<'_, D>,
8417            offset: usize,
8418            mut depth: fidl::encoding::Depth,
8419        ) -> fidl::Result<()> {
8420            decoder.debug_check_bounds::<Self>(offset);
8421            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8422                None => return Err(fidl::Error::NotNullable),
8423                Some(len) => len,
8424            };
8425            // Calling decoder.out_of_line_offset(0) is not allowed.
8426            if len == 0 {
8427                return Ok(());
8428            };
8429            depth.increment()?;
8430            let envelope_size = 8;
8431            let bytes_len = len * envelope_size;
8432            let offset = decoder.out_of_line_offset(bytes_len)?;
8433            // Decode the envelope for each type.
8434            let mut _next_ordinal_to_read = 0;
8435            let mut next_offset = offset;
8436            let end_offset = offset + bytes_len;
8437            _next_ordinal_to_read += 1;
8438            if next_offset >= end_offset {
8439                return Ok(());
8440            }
8441
8442            // Decode unknown envelopes for gaps in ordinals.
8443            while _next_ordinal_to_read < 1 {
8444                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8445                _next_ordinal_to_read += 1;
8446                next_offset += envelope_size;
8447            }
8448
8449            let next_out_of_line = decoder.next_out_of_line();
8450            let handles_before = decoder.remaining_handles();
8451            if let Some((inlined, num_bytes, num_handles)) =
8452                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8453            {
8454                let member_inline_size = <fidl::encoding::Vector<
8455                    fidl::encoding::BoundedString<4096>,
8456                    128,
8457                > as fidl::encoding::TypeMarker>::inline_size(
8458                    decoder.context
8459                );
8460                if inlined != (member_inline_size <= 4) {
8461                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8462                }
8463                let inner_offset;
8464                let mut inner_depth = depth.clone();
8465                if inlined {
8466                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8467                    inner_offset = next_offset;
8468                } else {
8469                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8470                    inner_depth.increment()?;
8471                }
8472                let val_ref = self.ambient_mark_vmo_exec.get_or_insert_with(|| {
8473                    fidl::new_empty!(
8474                        fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>,
8475                        D
8476                    )
8477                });
8478                fidl::decode!(
8479                    fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>,
8480                    D,
8481                    val_ref,
8482                    decoder,
8483                    inner_offset,
8484                    inner_depth
8485                )?;
8486                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8487                {
8488                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8489                }
8490                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8491                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8492                }
8493            }
8494
8495            next_offset += envelope_size;
8496            _next_ordinal_to_read += 1;
8497            if next_offset >= end_offset {
8498                return Ok(());
8499            }
8500
8501            // Decode unknown envelopes for gaps in ordinals.
8502            while _next_ordinal_to_read < 2 {
8503                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8504                _next_ordinal_to_read += 1;
8505                next_offset += envelope_size;
8506            }
8507
8508            let next_out_of_line = decoder.next_out_of_line();
8509            let handles_before = decoder.remaining_handles();
8510            if let Some((inlined, num_bytes, num_handles)) =
8511                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8512            {
8513                let member_inline_size = <fidl::encoding::Vector<
8514                    fidl::encoding::BoundedString<4096>,
8515                    128,
8516                > as fidl::encoding::TypeMarker>::inline_size(
8517                    decoder.context
8518                );
8519                if inlined != (member_inline_size <= 4) {
8520                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8521                }
8522                let inner_offset;
8523                let mut inner_depth = depth.clone();
8524                if inlined {
8525                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8526                    inner_offset = next_offset;
8527                } else {
8528                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8529                    inner_depth.increment()?;
8530                }
8531                let val_ref = self.main_process_critical.get_or_insert_with(|| {
8532                    fidl::new_empty!(
8533                        fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>,
8534                        D
8535                    )
8536                });
8537                fidl::decode!(
8538                    fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>,
8539                    D,
8540                    val_ref,
8541                    decoder,
8542                    inner_offset,
8543                    inner_depth
8544                )?;
8545                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8546                {
8547                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8548                }
8549                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8550                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8551                }
8552            }
8553
8554            next_offset += envelope_size;
8555            _next_ordinal_to_read += 1;
8556            if next_offset >= end_offset {
8557                return Ok(());
8558            }
8559
8560            // Decode unknown envelopes for gaps in ordinals.
8561            while _next_ordinal_to_read < 3 {
8562                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8563                _next_ordinal_to_read += 1;
8564                next_offset += envelope_size;
8565            }
8566
8567            let next_out_of_line = decoder.next_out_of_line();
8568            let handles_before = decoder.remaining_handles();
8569            if let Some((inlined, num_bytes, num_handles)) =
8570                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8571            {
8572                let member_inline_size = <fidl::encoding::Vector<
8573                    fidl::encoding::BoundedString<4096>,
8574                    128,
8575                > as fidl::encoding::TypeMarker>::inline_size(
8576                    decoder.context
8577                );
8578                if inlined != (member_inline_size <= 4) {
8579                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8580                }
8581                let inner_offset;
8582                let mut inner_depth = depth.clone();
8583                if inlined {
8584                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8585                    inner_offset = next_offset;
8586                } else {
8587                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8588                    inner_depth.increment()?;
8589                }
8590                let val_ref = self.create_raw_processes.get_or_insert_with(|| {
8591                    fidl::new_empty!(
8592                        fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>,
8593                        D
8594                    )
8595                });
8596                fidl::decode!(
8597                    fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 128>,
8598                    D,
8599                    val_ref,
8600                    decoder,
8601                    inner_offset,
8602                    inner_depth
8603                )?;
8604                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8605                {
8606                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8607                }
8608                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8609                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8610                }
8611            }
8612
8613            next_offset += envelope_size;
8614
8615            // Decode the remaining unknown envelopes.
8616            while next_offset < end_offset {
8617                _next_ordinal_to_read += 1;
8618                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8619                next_offset += envelope_size;
8620            }
8621
8622            Ok(())
8623        }
8624    }
8625
8626    impl Namespace {
8627        #[inline(always)]
8628        fn max_ordinal_present(&self) -> u64 {
8629            if let Some(_) = self.capability {
8630                return 1;
8631            }
8632            0
8633        }
8634    }
8635
8636    impl fidl::encoding::ValueTypeMarker for Namespace {
8637        type Borrowed<'a> = &'a Self;
8638        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8639            value
8640        }
8641    }
8642
8643    unsafe impl fidl::encoding::TypeMarker for Namespace {
8644        type Owned = Self;
8645
8646        #[inline(always)]
8647        fn inline_align(_context: fidl::encoding::Context) -> usize {
8648            8
8649        }
8650
8651        #[inline(always)]
8652        fn inline_size(_context: fidl::encoding::Context) -> usize {
8653            16
8654        }
8655    }
8656
8657    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Namespace, D>
8658        for &Namespace
8659    {
8660        unsafe fn encode(
8661            self,
8662            encoder: &mut fidl::encoding::Encoder<'_, D>,
8663            offset: usize,
8664            mut depth: fidl::encoding::Depth,
8665        ) -> fidl::Result<()> {
8666            encoder.debug_check_bounds::<Namespace>(offset);
8667            // Vector header
8668            let max_ordinal: u64 = self.max_ordinal_present();
8669            encoder.write_num(max_ordinal, offset);
8670            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8671            // Calling encoder.out_of_line_offset(0) is not allowed.
8672            if max_ordinal == 0 {
8673                return Ok(());
8674            }
8675            depth.increment()?;
8676            let envelope_size = 8;
8677            let bytes_len = max_ordinal as usize * envelope_size;
8678            #[allow(unused_variables)]
8679            let offset = encoder.out_of_line_offset(bytes_len);
8680            let mut _prev_end_offset: usize = 0;
8681            if 1 > max_ordinal {
8682                return Ok(());
8683            }
8684
8685            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8686            // are envelope_size bytes.
8687            let cur_offset: usize = (1 - 1) * envelope_size;
8688
8689            // Zero reserved fields.
8690            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8691
8692            // Safety:
8693            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8694            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8695            //   envelope_size bytes, there is always sufficient room.
8696            fidl::encoding::encode_in_envelope_optional::<ComponentCapability, D>(
8697                self.capability
8698                    .as_ref()
8699                    .map(<ComponentCapability as fidl::encoding::ValueTypeMarker>::borrow),
8700                encoder,
8701                offset + cur_offset,
8702                depth,
8703            )?;
8704
8705            _prev_end_offset = cur_offset + envelope_size;
8706
8707            Ok(())
8708        }
8709    }
8710
8711    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Namespace {
8712        #[inline(always)]
8713        fn new_empty() -> Self {
8714            Self::default()
8715        }
8716
8717        unsafe fn decode(
8718            &mut self,
8719            decoder: &mut fidl::encoding::Decoder<'_, D>,
8720            offset: usize,
8721            mut depth: fidl::encoding::Depth,
8722        ) -> fidl::Result<()> {
8723            decoder.debug_check_bounds::<Self>(offset);
8724            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8725                None => return Err(fidl::Error::NotNullable),
8726                Some(len) => len,
8727            };
8728            // Calling decoder.out_of_line_offset(0) is not allowed.
8729            if len == 0 {
8730                return Ok(());
8731            };
8732            depth.increment()?;
8733            let envelope_size = 8;
8734            let bytes_len = len * envelope_size;
8735            let offset = decoder.out_of_line_offset(bytes_len)?;
8736            // Decode the envelope for each type.
8737            let mut _next_ordinal_to_read = 0;
8738            let mut next_offset = offset;
8739            let end_offset = offset + bytes_len;
8740            _next_ordinal_to_read += 1;
8741            if next_offset >= end_offset {
8742                return Ok(());
8743            }
8744
8745            // Decode unknown envelopes for gaps in ordinals.
8746            while _next_ordinal_to_read < 1 {
8747                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8748                _next_ordinal_to_read += 1;
8749                next_offset += envelope_size;
8750            }
8751
8752            let next_out_of_line = decoder.next_out_of_line();
8753            let handles_before = decoder.remaining_handles();
8754            if let Some((inlined, num_bytes, num_handles)) =
8755                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8756            {
8757                let member_inline_size =
8758                    <ComponentCapability as fidl::encoding::TypeMarker>::inline_size(
8759                        decoder.context,
8760                    );
8761                if inlined != (member_inline_size <= 4) {
8762                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8763                }
8764                let inner_offset;
8765                let mut inner_depth = depth.clone();
8766                if inlined {
8767                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8768                    inner_offset = next_offset;
8769                } else {
8770                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8771                    inner_depth.increment()?;
8772                }
8773                let val_ref =
8774                    self.capability.get_or_insert_with(|| fidl::new_empty!(ComponentCapability, D));
8775                fidl::decode!(ComponentCapability, D, val_ref, decoder, inner_offset, inner_depth)?;
8776                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8777                {
8778                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8779                }
8780                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8781                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8782                }
8783            }
8784
8785            next_offset += envelope_size;
8786
8787            // Decode the remaining unknown envelopes.
8788            while next_offset < end_offset {
8789                _next_ordinal_to_read += 1;
8790                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8791                next_offset += envelope_size;
8792            }
8793
8794            Ok(())
8795        }
8796    }
8797
8798    impl SecurityPolicy {
8799        #[inline(always)]
8800        fn max_ordinal_present(&self) -> u64 {
8801            if let Some(_) = self.child_policy {
8802                return 4;
8803            }
8804            if let Some(_) = self.debug_registration_policy {
8805                return 3;
8806            }
8807            if let Some(_) = self.capability_policy {
8808                return 2;
8809            }
8810            if let Some(_) = self.job_policy {
8811                return 1;
8812            }
8813            0
8814        }
8815    }
8816
8817    impl fidl::encoding::ValueTypeMarker for SecurityPolicy {
8818        type Borrowed<'a> = &'a Self;
8819        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8820            value
8821        }
8822    }
8823
8824    unsafe impl fidl::encoding::TypeMarker for SecurityPolicy {
8825        type Owned = Self;
8826
8827        #[inline(always)]
8828        fn inline_align(_context: fidl::encoding::Context) -> usize {
8829            8
8830        }
8831
8832        #[inline(always)]
8833        fn inline_size(_context: fidl::encoding::Context) -> usize {
8834            16
8835        }
8836    }
8837
8838    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SecurityPolicy, D>
8839        for &SecurityPolicy
8840    {
8841        unsafe fn encode(
8842            self,
8843            encoder: &mut fidl::encoding::Encoder<'_, D>,
8844            offset: usize,
8845            mut depth: fidl::encoding::Depth,
8846        ) -> fidl::Result<()> {
8847            encoder.debug_check_bounds::<SecurityPolicy>(offset);
8848            // Vector header
8849            let max_ordinal: u64 = self.max_ordinal_present();
8850            encoder.write_num(max_ordinal, offset);
8851            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8852            // Calling encoder.out_of_line_offset(0) is not allowed.
8853            if max_ordinal == 0 {
8854                return Ok(());
8855            }
8856            depth.increment()?;
8857            let envelope_size = 8;
8858            let bytes_len = max_ordinal as usize * envelope_size;
8859            #[allow(unused_variables)]
8860            let offset = encoder.out_of_line_offset(bytes_len);
8861            let mut _prev_end_offset: usize = 0;
8862            if 1 > max_ordinal {
8863                return Ok(());
8864            }
8865
8866            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8867            // are envelope_size bytes.
8868            let cur_offset: usize = (1 - 1) * envelope_size;
8869
8870            // Zero reserved fields.
8871            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8872
8873            // Safety:
8874            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8875            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8876            //   envelope_size bytes, there is always sufficient room.
8877            fidl::encoding::encode_in_envelope_optional::<JobPolicyAllowlists, D>(
8878                self.job_policy
8879                    .as_ref()
8880                    .map(<JobPolicyAllowlists as fidl::encoding::ValueTypeMarker>::borrow),
8881                encoder,
8882                offset + cur_offset,
8883                depth,
8884            )?;
8885
8886            _prev_end_offset = cur_offset + envelope_size;
8887            if 2 > max_ordinal {
8888                return Ok(());
8889            }
8890
8891            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8892            // are envelope_size bytes.
8893            let cur_offset: usize = (2 - 1) * envelope_size;
8894
8895            // Zero reserved fields.
8896            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8897
8898            // Safety:
8899            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8900            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8901            //   envelope_size bytes, there is always sufficient room.
8902            fidl::encoding::encode_in_envelope_optional::<CapabilityPolicyAllowlists, D>(
8903                self.capability_policy
8904                    .as_ref()
8905                    .map(<CapabilityPolicyAllowlists as fidl::encoding::ValueTypeMarker>::borrow),
8906                encoder,
8907                offset + cur_offset,
8908                depth,
8909            )?;
8910
8911            _prev_end_offset = cur_offset + envelope_size;
8912            if 3 > max_ordinal {
8913                return Ok(());
8914            }
8915
8916            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8917            // are envelope_size bytes.
8918            let cur_offset: usize = (3 - 1) * envelope_size;
8919
8920            // Zero reserved fields.
8921            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8922
8923            // Safety:
8924            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8925            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8926            //   envelope_size bytes, there is always sufficient room.
8927            fidl::encoding::encode_in_envelope_optional::<DebugRegistrationPolicyAllowlists, D>(
8928                self.debug_registration_policy.as_ref().map(
8929                    <DebugRegistrationPolicyAllowlists as fidl::encoding::ValueTypeMarker>::borrow,
8930                ),
8931                encoder,
8932                offset + cur_offset,
8933                depth,
8934            )?;
8935
8936            _prev_end_offset = cur_offset + envelope_size;
8937            if 4 > max_ordinal {
8938                return Ok(());
8939            }
8940
8941            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8942            // are envelope_size bytes.
8943            let cur_offset: usize = (4 - 1) * envelope_size;
8944
8945            // Zero reserved fields.
8946            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8947
8948            // Safety:
8949            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8950            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8951            //   envelope_size bytes, there is always sufficient room.
8952            fidl::encoding::encode_in_envelope_optional::<ChildPolicyAllowlists, D>(
8953                self.child_policy
8954                    .as_ref()
8955                    .map(<ChildPolicyAllowlists as fidl::encoding::ValueTypeMarker>::borrow),
8956                encoder,
8957                offset + cur_offset,
8958                depth,
8959            )?;
8960
8961            _prev_end_offset = cur_offset + envelope_size;
8962
8963            Ok(())
8964        }
8965    }
8966
8967    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SecurityPolicy {
8968        #[inline(always)]
8969        fn new_empty() -> Self {
8970            Self::default()
8971        }
8972
8973        unsafe fn decode(
8974            &mut self,
8975            decoder: &mut fidl::encoding::Decoder<'_, D>,
8976            offset: usize,
8977            mut depth: fidl::encoding::Depth,
8978        ) -> fidl::Result<()> {
8979            decoder.debug_check_bounds::<Self>(offset);
8980            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8981                None => return Err(fidl::Error::NotNullable),
8982                Some(len) => len,
8983            };
8984            // Calling decoder.out_of_line_offset(0) is not allowed.
8985            if len == 0 {
8986                return Ok(());
8987            };
8988            depth.increment()?;
8989            let envelope_size = 8;
8990            let bytes_len = len * envelope_size;
8991            let offset = decoder.out_of_line_offset(bytes_len)?;
8992            // Decode the envelope for each type.
8993            let mut _next_ordinal_to_read = 0;
8994            let mut next_offset = offset;
8995            let end_offset = offset + bytes_len;
8996            _next_ordinal_to_read += 1;
8997            if next_offset >= end_offset {
8998                return Ok(());
8999            }
9000
9001            // Decode unknown envelopes for gaps in ordinals.
9002            while _next_ordinal_to_read < 1 {
9003                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9004                _next_ordinal_to_read += 1;
9005                next_offset += envelope_size;
9006            }
9007
9008            let next_out_of_line = decoder.next_out_of_line();
9009            let handles_before = decoder.remaining_handles();
9010            if let Some((inlined, num_bytes, num_handles)) =
9011                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9012            {
9013                let member_inline_size =
9014                    <JobPolicyAllowlists as fidl::encoding::TypeMarker>::inline_size(
9015                        decoder.context,
9016                    );
9017                if inlined != (member_inline_size <= 4) {
9018                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9019                }
9020                let inner_offset;
9021                let mut inner_depth = depth.clone();
9022                if inlined {
9023                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9024                    inner_offset = next_offset;
9025                } else {
9026                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9027                    inner_depth.increment()?;
9028                }
9029                let val_ref =
9030                    self.job_policy.get_or_insert_with(|| fidl::new_empty!(JobPolicyAllowlists, D));
9031                fidl::decode!(JobPolicyAllowlists, D, val_ref, decoder, inner_offset, inner_depth)?;
9032                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9033                {
9034                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9035                }
9036                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9037                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9038                }
9039            }
9040
9041            next_offset += envelope_size;
9042            _next_ordinal_to_read += 1;
9043            if next_offset >= end_offset {
9044                return Ok(());
9045            }
9046
9047            // Decode unknown envelopes for gaps in ordinals.
9048            while _next_ordinal_to_read < 2 {
9049                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9050                _next_ordinal_to_read += 1;
9051                next_offset += envelope_size;
9052            }
9053
9054            let next_out_of_line = decoder.next_out_of_line();
9055            let handles_before = decoder.remaining_handles();
9056            if let Some((inlined, num_bytes, num_handles)) =
9057                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9058            {
9059                let member_inline_size =
9060                    <CapabilityPolicyAllowlists as fidl::encoding::TypeMarker>::inline_size(
9061                        decoder.context,
9062                    );
9063                if inlined != (member_inline_size <= 4) {
9064                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9065                }
9066                let inner_offset;
9067                let mut inner_depth = depth.clone();
9068                if inlined {
9069                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9070                    inner_offset = next_offset;
9071                } else {
9072                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9073                    inner_depth.increment()?;
9074                }
9075                let val_ref = self
9076                    .capability_policy
9077                    .get_or_insert_with(|| fidl::new_empty!(CapabilityPolicyAllowlists, D));
9078                fidl::decode!(
9079                    CapabilityPolicyAllowlists,
9080                    D,
9081                    val_ref,
9082                    decoder,
9083                    inner_offset,
9084                    inner_depth
9085                )?;
9086                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9087                {
9088                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9089                }
9090                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9091                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9092                }
9093            }
9094
9095            next_offset += envelope_size;
9096            _next_ordinal_to_read += 1;
9097            if next_offset >= end_offset {
9098                return Ok(());
9099            }
9100
9101            // Decode unknown envelopes for gaps in ordinals.
9102            while _next_ordinal_to_read < 3 {
9103                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9104                _next_ordinal_to_read += 1;
9105                next_offset += envelope_size;
9106            }
9107
9108            let next_out_of_line = decoder.next_out_of_line();
9109            let handles_before = decoder.remaining_handles();
9110            if let Some((inlined, num_bytes, num_handles)) =
9111                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9112            {
9113                let member_inline_size =
9114                    <DebugRegistrationPolicyAllowlists as fidl::encoding::TypeMarker>::inline_size(
9115                        decoder.context,
9116                    );
9117                if inlined != (member_inline_size <= 4) {
9118                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9119                }
9120                let inner_offset;
9121                let mut inner_depth = depth.clone();
9122                if inlined {
9123                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9124                    inner_offset = next_offset;
9125                } else {
9126                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9127                    inner_depth.increment()?;
9128                }
9129                let val_ref = self
9130                    .debug_registration_policy
9131                    .get_or_insert_with(|| fidl::new_empty!(DebugRegistrationPolicyAllowlists, D));
9132                fidl::decode!(
9133                    DebugRegistrationPolicyAllowlists,
9134                    D,
9135                    val_ref,
9136                    decoder,
9137                    inner_offset,
9138                    inner_depth
9139                )?;
9140                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9141                {
9142                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9143                }
9144                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9145                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9146                }
9147            }
9148
9149            next_offset += envelope_size;
9150            _next_ordinal_to_read += 1;
9151            if next_offset >= end_offset {
9152                return Ok(());
9153            }
9154
9155            // Decode unknown envelopes for gaps in ordinals.
9156            while _next_ordinal_to_read < 4 {
9157                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9158                _next_ordinal_to_read += 1;
9159                next_offset += envelope_size;
9160            }
9161
9162            let next_out_of_line = decoder.next_out_of_line();
9163            let handles_before = decoder.remaining_handles();
9164            if let Some((inlined, num_bytes, num_handles)) =
9165                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9166            {
9167                let member_inline_size =
9168                    <ChildPolicyAllowlists as fidl::encoding::TypeMarker>::inline_size(
9169                        decoder.context,
9170                    );
9171                if inlined != (member_inline_size <= 4) {
9172                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9173                }
9174                let inner_offset;
9175                let mut inner_depth = depth.clone();
9176                if inlined {
9177                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9178                    inner_offset = next_offset;
9179                } else {
9180                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9181                    inner_depth.increment()?;
9182                }
9183                let val_ref = self
9184                    .child_policy
9185                    .get_or_insert_with(|| fidl::new_empty!(ChildPolicyAllowlists, D));
9186                fidl::decode!(
9187                    ChildPolicyAllowlists,
9188                    D,
9189                    val_ref,
9190                    decoder,
9191                    inner_offset,
9192                    inner_depth
9193                )?;
9194                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9195                {
9196                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9197                }
9198                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9199                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9200                }
9201            }
9202
9203            next_offset += envelope_size;
9204
9205            // Decode the remaining unknown envelopes.
9206            while next_offset < end_offset {
9207                _next_ordinal_to_read += 1;
9208                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9209                next_offset += envelope_size;
9210            }
9211
9212            Ok(())
9213        }
9214    }
9215
9216    impl Sources {
9217        #[inline(always)]
9218        fn max_ordinal_present(&self) -> u64 {
9219            if let Some(_) = self.capability_type {
9220                return 7;
9221            }
9222            if let Some(_) = self.component {
9223                return 6;
9224            }
9225            if let Some(_) = self.namespace {
9226                return 5;
9227            }
9228            if let Some(_) = self.collection {
9229                return 4;
9230            }
9231            if let Some(_) = self.capability {
9232                return 3;
9233            }
9234            if let Some(_) = self.builtin {
9235                return 2;
9236            }
9237            if let Some(_) = self.framework {
9238                return 1;
9239            }
9240            0
9241        }
9242    }
9243
9244    impl fidl::encoding::ValueTypeMarker for Sources {
9245        type Borrowed<'a> = &'a Self;
9246        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9247            value
9248        }
9249    }
9250
9251    unsafe impl fidl::encoding::TypeMarker for Sources {
9252        type Owned = Self;
9253
9254        #[inline(always)]
9255        fn inline_align(_context: fidl::encoding::Context) -> usize {
9256            8
9257        }
9258
9259        #[inline(always)]
9260        fn inline_size(_context: fidl::encoding::Context) -> usize {
9261            16
9262        }
9263    }
9264
9265    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Sources, D> for &Sources {
9266        unsafe fn encode(
9267            self,
9268            encoder: &mut fidl::encoding::Encoder<'_, D>,
9269            offset: usize,
9270            mut depth: fidl::encoding::Depth,
9271        ) -> fidl::Result<()> {
9272            encoder.debug_check_bounds::<Sources>(offset);
9273            // Vector header
9274            let max_ordinal: u64 = self.max_ordinal_present();
9275            encoder.write_num(max_ordinal, offset);
9276            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9277            // Calling encoder.out_of_line_offset(0) is not allowed.
9278            if max_ordinal == 0 {
9279                return Ok(());
9280            }
9281            depth.increment()?;
9282            let envelope_size = 8;
9283            let bytes_len = max_ordinal as usize * envelope_size;
9284            #[allow(unused_variables)]
9285            let offset = encoder.out_of_line_offset(bytes_len);
9286            let mut _prev_end_offset: usize = 0;
9287            if 1 > max_ordinal {
9288                return Ok(());
9289            }
9290
9291            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9292            // are envelope_size bytes.
9293            let cur_offset: usize = (1 - 1) * envelope_size;
9294
9295            // Zero reserved fields.
9296            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9297
9298            // Safety:
9299            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9300            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9301            //   envelope_size bytes, there is always sufficient room.
9302            fidl::encoding::encode_in_envelope_optional::<bool, D>(
9303                self.framework.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9304                encoder,
9305                offset + cur_offset,
9306                depth,
9307            )?;
9308
9309            _prev_end_offset = cur_offset + envelope_size;
9310            if 2 > max_ordinal {
9311                return Ok(());
9312            }
9313
9314            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9315            // are envelope_size bytes.
9316            let cur_offset: usize = (2 - 1) * envelope_size;
9317
9318            // Zero reserved fields.
9319            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9320
9321            // Safety:
9322            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9323            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9324            //   envelope_size bytes, there is always sufficient room.
9325            fidl::encoding::encode_in_envelope_optional::<bool, D>(
9326                self.builtin.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9327                encoder,
9328                offset + cur_offset,
9329                depth,
9330            )?;
9331
9332            _prev_end_offset = cur_offset + envelope_size;
9333            if 3 > max_ordinal {
9334                return Ok(());
9335            }
9336
9337            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9338            // are envelope_size bytes.
9339            let cur_offset: usize = (3 - 1) * envelope_size;
9340
9341            // Zero reserved fields.
9342            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9343
9344            // Safety:
9345            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9346            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9347            //   envelope_size bytes, there is always sufficient room.
9348            fidl::encoding::encode_in_envelope_optional::<bool, D>(
9349                self.capability.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9350                encoder,
9351                offset + cur_offset,
9352                depth,
9353            )?;
9354
9355            _prev_end_offset = cur_offset + envelope_size;
9356            if 4 > max_ordinal {
9357                return Ok(());
9358            }
9359
9360            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9361            // are envelope_size bytes.
9362            let cur_offset: usize = (4 - 1) * envelope_size;
9363
9364            // Zero reserved fields.
9365            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9366
9367            // Safety:
9368            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9369            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9370            //   envelope_size bytes, there is always sufficient room.
9371            fidl::encoding::encode_in_envelope_optional::<bool, D>(
9372                self.collection.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9373                encoder,
9374                offset + cur_offset,
9375                depth,
9376            )?;
9377
9378            _prev_end_offset = cur_offset + envelope_size;
9379            if 5 > max_ordinal {
9380                return Ok(());
9381            }
9382
9383            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9384            // are envelope_size bytes.
9385            let cur_offset: usize = (5 - 1) * envelope_size;
9386
9387            // Zero reserved fields.
9388            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9389
9390            // Safety:
9391            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9392            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9393            //   envelope_size bytes, there is always sufficient room.
9394            fidl::encoding::encode_in_envelope_optional::<bool, D>(
9395                self.namespace.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9396                encoder,
9397                offset + cur_offset,
9398                depth,
9399            )?;
9400
9401            _prev_end_offset = cur_offset + envelope_size;
9402            if 6 > max_ordinal {
9403                return Ok(());
9404            }
9405
9406            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9407            // are envelope_size bytes.
9408            let cur_offset: usize = (6 - 1) * envelope_size;
9409
9410            // Zero reserved fields.
9411            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9412
9413            // Safety:
9414            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9415            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9416            //   envelope_size bytes, there is always sufficient room.
9417            fidl::encoding::encode_in_envelope_optional::<bool, D>(
9418                self.component.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9419                encoder,
9420                offset + cur_offset,
9421                depth,
9422            )?;
9423
9424            _prev_end_offset = cur_offset + envelope_size;
9425            if 7 > max_ordinal {
9426                return Ok(());
9427            }
9428
9429            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9430            // are envelope_size bytes.
9431            let cur_offset: usize = (7 - 1) * envelope_size;
9432
9433            // Zero reserved fields.
9434            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9435
9436            // Safety:
9437            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9438            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9439            //   envelope_size bytes, there is always sufficient room.
9440            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
9441                self.capability_type.as_ref().map(
9442                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
9443                ),
9444                encoder,
9445                offset + cur_offset,
9446                depth,
9447            )?;
9448
9449            _prev_end_offset = cur_offset + envelope_size;
9450
9451            Ok(())
9452        }
9453    }
9454
9455    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Sources {
9456        #[inline(always)]
9457        fn new_empty() -> Self {
9458            Self::default()
9459        }
9460
9461        unsafe fn decode(
9462            &mut self,
9463            decoder: &mut fidl::encoding::Decoder<'_, D>,
9464            offset: usize,
9465            mut depth: fidl::encoding::Depth,
9466        ) -> fidl::Result<()> {
9467            decoder.debug_check_bounds::<Self>(offset);
9468            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9469                None => return Err(fidl::Error::NotNullable),
9470                Some(len) => len,
9471            };
9472            // Calling decoder.out_of_line_offset(0) is not allowed.
9473            if len == 0 {
9474                return Ok(());
9475            };
9476            depth.increment()?;
9477            let envelope_size = 8;
9478            let bytes_len = len * envelope_size;
9479            let offset = decoder.out_of_line_offset(bytes_len)?;
9480            // Decode the envelope for each type.
9481            let mut _next_ordinal_to_read = 0;
9482            let mut next_offset = offset;
9483            let end_offset = offset + bytes_len;
9484            _next_ordinal_to_read += 1;
9485            if next_offset >= end_offset {
9486                return Ok(());
9487            }
9488
9489            // Decode unknown envelopes for gaps in ordinals.
9490            while _next_ordinal_to_read < 1 {
9491                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9492                _next_ordinal_to_read += 1;
9493                next_offset += envelope_size;
9494            }
9495
9496            let next_out_of_line = decoder.next_out_of_line();
9497            let handles_before = decoder.remaining_handles();
9498            if let Some((inlined, num_bytes, num_handles)) =
9499                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9500            {
9501                let member_inline_size =
9502                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9503                if inlined != (member_inline_size <= 4) {
9504                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9505                }
9506                let inner_offset;
9507                let mut inner_depth = depth.clone();
9508                if inlined {
9509                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9510                    inner_offset = next_offset;
9511                } else {
9512                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9513                    inner_depth.increment()?;
9514                }
9515                let val_ref = self.framework.get_or_insert_with(|| fidl::new_empty!(bool, D));
9516                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
9517                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9518                {
9519                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9520                }
9521                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9522                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9523                }
9524            }
9525
9526            next_offset += envelope_size;
9527            _next_ordinal_to_read += 1;
9528            if next_offset >= end_offset {
9529                return Ok(());
9530            }
9531
9532            // Decode unknown envelopes for gaps in ordinals.
9533            while _next_ordinal_to_read < 2 {
9534                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9535                _next_ordinal_to_read += 1;
9536                next_offset += envelope_size;
9537            }
9538
9539            let next_out_of_line = decoder.next_out_of_line();
9540            let handles_before = decoder.remaining_handles();
9541            if let Some((inlined, num_bytes, num_handles)) =
9542                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9543            {
9544                let member_inline_size =
9545                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9546                if inlined != (member_inline_size <= 4) {
9547                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9548                }
9549                let inner_offset;
9550                let mut inner_depth = depth.clone();
9551                if inlined {
9552                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9553                    inner_offset = next_offset;
9554                } else {
9555                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9556                    inner_depth.increment()?;
9557                }
9558                let val_ref = self.builtin.get_or_insert_with(|| fidl::new_empty!(bool, D));
9559                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
9560                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9561                {
9562                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9563                }
9564                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9565                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9566                }
9567            }
9568
9569            next_offset += envelope_size;
9570            _next_ordinal_to_read += 1;
9571            if next_offset >= end_offset {
9572                return Ok(());
9573            }
9574
9575            // Decode unknown envelopes for gaps in ordinals.
9576            while _next_ordinal_to_read < 3 {
9577                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9578                _next_ordinal_to_read += 1;
9579                next_offset += envelope_size;
9580            }
9581
9582            let next_out_of_line = decoder.next_out_of_line();
9583            let handles_before = decoder.remaining_handles();
9584            if let Some((inlined, num_bytes, num_handles)) =
9585                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9586            {
9587                let member_inline_size =
9588                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9589                if inlined != (member_inline_size <= 4) {
9590                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9591                }
9592                let inner_offset;
9593                let mut inner_depth = depth.clone();
9594                if inlined {
9595                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9596                    inner_offset = next_offset;
9597                } else {
9598                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9599                    inner_depth.increment()?;
9600                }
9601                let val_ref = self.capability.get_or_insert_with(|| fidl::new_empty!(bool, D));
9602                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
9603                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9604                {
9605                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9606                }
9607                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9608                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9609                }
9610            }
9611
9612            next_offset += envelope_size;
9613            _next_ordinal_to_read += 1;
9614            if next_offset >= end_offset {
9615                return Ok(());
9616            }
9617
9618            // Decode unknown envelopes for gaps in ordinals.
9619            while _next_ordinal_to_read < 4 {
9620                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9621                _next_ordinal_to_read += 1;
9622                next_offset += envelope_size;
9623            }
9624
9625            let next_out_of_line = decoder.next_out_of_line();
9626            let handles_before = decoder.remaining_handles();
9627            if let Some((inlined, num_bytes, num_handles)) =
9628                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9629            {
9630                let member_inline_size =
9631                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9632                if inlined != (member_inline_size <= 4) {
9633                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9634                }
9635                let inner_offset;
9636                let mut inner_depth = depth.clone();
9637                if inlined {
9638                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9639                    inner_offset = next_offset;
9640                } else {
9641                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9642                    inner_depth.increment()?;
9643                }
9644                let val_ref = self.collection.get_or_insert_with(|| fidl::new_empty!(bool, D));
9645                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
9646                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9647                {
9648                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9649                }
9650                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9651                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9652                }
9653            }
9654
9655            next_offset += envelope_size;
9656            _next_ordinal_to_read += 1;
9657            if next_offset >= end_offset {
9658                return Ok(());
9659            }
9660
9661            // Decode unknown envelopes for gaps in ordinals.
9662            while _next_ordinal_to_read < 5 {
9663                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9664                _next_ordinal_to_read += 1;
9665                next_offset += envelope_size;
9666            }
9667
9668            let next_out_of_line = decoder.next_out_of_line();
9669            let handles_before = decoder.remaining_handles();
9670            if let Some((inlined, num_bytes, num_handles)) =
9671                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9672            {
9673                let member_inline_size =
9674                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9675                if inlined != (member_inline_size <= 4) {
9676                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9677                }
9678                let inner_offset;
9679                let mut inner_depth = depth.clone();
9680                if inlined {
9681                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9682                    inner_offset = next_offset;
9683                } else {
9684                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9685                    inner_depth.increment()?;
9686                }
9687                let val_ref = self.namespace.get_or_insert_with(|| fidl::new_empty!(bool, D));
9688                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
9689                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9690                {
9691                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9692                }
9693                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9694                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9695                }
9696            }
9697
9698            next_offset += envelope_size;
9699            _next_ordinal_to_read += 1;
9700            if next_offset >= end_offset {
9701                return Ok(());
9702            }
9703
9704            // Decode unknown envelopes for gaps in ordinals.
9705            while _next_ordinal_to_read < 6 {
9706                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9707                _next_ordinal_to_read += 1;
9708                next_offset += envelope_size;
9709            }
9710
9711            let next_out_of_line = decoder.next_out_of_line();
9712            let handles_before = decoder.remaining_handles();
9713            if let Some((inlined, num_bytes, num_handles)) =
9714                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9715            {
9716                let member_inline_size =
9717                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9718                if inlined != (member_inline_size <= 4) {
9719                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9720                }
9721                let inner_offset;
9722                let mut inner_depth = depth.clone();
9723                if inlined {
9724                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9725                    inner_offset = next_offset;
9726                } else {
9727                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9728                    inner_depth.increment()?;
9729                }
9730                let val_ref = self.component.get_or_insert_with(|| fidl::new_empty!(bool, D));
9731                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
9732                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9733                {
9734                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9735                }
9736                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9737                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9738                }
9739            }
9740
9741            next_offset += envelope_size;
9742            _next_ordinal_to_read += 1;
9743            if next_offset >= end_offset {
9744                return Ok(());
9745            }
9746
9747            // Decode unknown envelopes for gaps in ordinals.
9748            while _next_ordinal_to_read < 7 {
9749                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9750                _next_ordinal_to_read += 1;
9751                next_offset += envelope_size;
9752            }
9753
9754            let next_out_of_line = decoder.next_out_of_line();
9755            let handles_before = decoder.remaining_handles();
9756            if let Some((inlined, num_bytes, num_handles)) =
9757                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9758            {
9759                let member_inline_size =
9760                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
9761                        decoder.context,
9762                    );
9763                if inlined != (member_inline_size <= 4) {
9764                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9765                }
9766                let inner_offset;
9767                let mut inner_depth = depth.clone();
9768                if inlined {
9769                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9770                    inner_offset = next_offset;
9771                } else {
9772                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9773                    inner_depth.increment()?;
9774                }
9775                let val_ref = self
9776                    .capability_type
9777                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
9778                fidl::decode!(
9779                    fidl::encoding::BoundedString<100>,
9780                    D,
9781                    val_ref,
9782                    decoder,
9783                    inner_offset,
9784                    inner_depth
9785                )?;
9786                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9787                {
9788                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9789                }
9790                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9791                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9792                }
9793            }
9794
9795            next_offset += envelope_size;
9796
9797            // Decode the remaining unknown envelopes.
9798            while next_offset < end_offset {
9799                _next_ordinal_to_read += 1;
9800                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9801                next_offset += envelope_size;
9802            }
9803
9804            Ok(())
9805        }
9806    }
9807
9808    impl Void {
9809        #[inline(always)]
9810        fn max_ordinal_present(&self) -> u64 {
9811            if let Some(_) = self.moniker {
9812                return 2;
9813            }
9814            if let Some(_) = self.capability {
9815                return 1;
9816            }
9817            0
9818        }
9819    }
9820
9821    impl fidl::encoding::ValueTypeMarker for Void {
9822        type Borrowed<'a> = &'a Self;
9823        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9824            value
9825        }
9826    }
9827
9828    unsafe impl fidl::encoding::TypeMarker for Void {
9829        type Owned = Self;
9830
9831        #[inline(always)]
9832        fn inline_align(_context: fidl::encoding::Context) -> usize {
9833            8
9834        }
9835
9836        #[inline(always)]
9837        fn inline_size(_context: fidl::encoding::Context) -> usize {
9838            16
9839        }
9840    }
9841
9842    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Void, D> for &Void {
9843        unsafe fn encode(
9844            self,
9845            encoder: &mut fidl::encoding::Encoder<'_, D>,
9846            offset: usize,
9847            mut depth: fidl::encoding::Depth,
9848        ) -> fidl::Result<()> {
9849            encoder.debug_check_bounds::<Void>(offset);
9850            // Vector header
9851            let max_ordinal: u64 = self.max_ordinal_present();
9852            encoder.write_num(max_ordinal, offset);
9853            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9854            // Calling encoder.out_of_line_offset(0) is not allowed.
9855            if max_ordinal == 0 {
9856                return Ok(());
9857            }
9858            depth.increment()?;
9859            let envelope_size = 8;
9860            let bytes_len = max_ordinal as usize * envelope_size;
9861            #[allow(unused_variables)]
9862            let offset = encoder.out_of_line_offset(bytes_len);
9863            let mut _prev_end_offset: usize = 0;
9864            if 1 > max_ordinal {
9865                return Ok(());
9866            }
9867
9868            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9869            // are envelope_size bytes.
9870            let cur_offset: usize = (1 - 1) * envelope_size;
9871
9872            // Zero reserved fields.
9873            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9874
9875            // Safety:
9876            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9877            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9878            //   envelope_size bytes, there is always sufficient room.
9879            fidl::encoding::encode_in_envelope_optional::<InternalCapability, D>(
9880                self.capability
9881                    .as_ref()
9882                    .map(<InternalCapability as fidl::encoding::ValueTypeMarker>::borrow),
9883                encoder,
9884                offset + cur_offset,
9885                depth,
9886            )?;
9887
9888            _prev_end_offset = cur_offset + envelope_size;
9889            if 2 > max_ordinal {
9890                return Ok(());
9891            }
9892
9893            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9894            // are envelope_size bytes.
9895            let cur_offset: usize = (2 - 1) * envelope_size;
9896
9897            // Zero reserved fields.
9898            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9899
9900            // Safety:
9901            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9902            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9903            //   envelope_size bytes, there is always sufficient room.
9904            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
9905            self.moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
9906            encoder, offset + cur_offset, depth
9907        )?;
9908
9909            _prev_end_offset = cur_offset + envelope_size;
9910
9911            Ok(())
9912        }
9913    }
9914
9915    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Void {
9916        #[inline(always)]
9917        fn new_empty() -> Self {
9918            Self::default()
9919        }
9920
9921        unsafe fn decode(
9922            &mut self,
9923            decoder: &mut fidl::encoding::Decoder<'_, D>,
9924            offset: usize,
9925            mut depth: fidl::encoding::Depth,
9926        ) -> fidl::Result<()> {
9927            decoder.debug_check_bounds::<Self>(offset);
9928            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9929                None => return Err(fidl::Error::NotNullable),
9930                Some(len) => len,
9931            };
9932            // Calling decoder.out_of_line_offset(0) is not allowed.
9933            if len == 0 {
9934                return Ok(());
9935            };
9936            depth.increment()?;
9937            let envelope_size = 8;
9938            let bytes_len = len * envelope_size;
9939            let offset = decoder.out_of_line_offset(bytes_len)?;
9940            // Decode the envelope for each type.
9941            let mut _next_ordinal_to_read = 0;
9942            let mut next_offset = offset;
9943            let end_offset = offset + bytes_len;
9944            _next_ordinal_to_read += 1;
9945            if next_offset >= end_offset {
9946                return Ok(());
9947            }
9948
9949            // Decode unknown envelopes for gaps in ordinals.
9950            while _next_ordinal_to_read < 1 {
9951                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9952                _next_ordinal_to_read += 1;
9953                next_offset += envelope_size;
9954            }
9955
9956            let next_out_of_line = decoder.next_out_of_line();
9957            let handles_before = decoder.remaining_handles();
9958            if let Some((inlined, num_bytes, num_handles)) =
9959                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9960            {
9961                let member_inline_size =
9962                    <InternalCapability as fidl::encoding::TypeMarker>::inline_size(
9963                        decoder.context,
9964                    );
9965                if inlined != (member_inline_size <= 4) {
9966                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9967                }
9968                let inner_offset;
9969                let mut inner_depth = depth.clone();
9970                if inlined {
9971                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9972                    inner_offset = next_offset;
9973                } else {
9974                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9975                    inner_depth.increment()?;
9976                }
9977                let val_ref =
9978                    self.capability.get_or_insert_with(|| fidl::new_empty!(InternalCapability, D));
9979                fidl::decode!(InternalCapability, D, val_ref, decoder, inner_offset, inner_depth)?;
9980                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9981                {
9982                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9983                }
9984                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9985                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9986                }
9987            }
9988
9989            next_offset += envelope_size;
9990            _next_ordinal_to_read += 1;
9991            if next_offset >= end_offset {
9992                return Ok(());
9993            }
9994
9995            // Decode unknown envelopes for gaps in ordinals.
9996            while _next_ordinal_to_read < 2 {
9997                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9998                _next_ordinal_to_read += 1;
9999                next_offset += envelope_size;
10000            }
10001
10002            let next_out_of_line = decoder.next_out_of_line();
10003            let handles_before = decoder.remaining_handles();
10004            if let Some((inlined, num_bytes, num_handles)) =
10005                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10006            {
10007                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10008                if inlined != (member_inline_size <= 4) {
10009                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10010                }
10011                let inner_offset;
10012                let mut inner_depth = depth.clone();
10013                if inlined {
10014                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10015                    inner_offset = next_offset;
10016                } else {
10017                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10018                    inner_depth.increment()?;
10019                }
10020                let val_ref = self.moniker.get_or_insert_with(|| {
10021                    fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
10022                });
10023                fidl::decode!(
10024                    fidl::encoding::BoundedString<4096>,
10025                    D,
10026                    val_ref,
10027                    decoder,
10028                    inner_offset,
10029                    inner_depth
10030                )?;
10031                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10032                {
10033                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10034                }
10035                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10036                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10037                }
10038            }
10039
10040            next_offset += envelope_size;
10041
10042            // Decode the remaining unknown envelopes.
10043            while next_offset < end_offset {
10044                _next_ordinal_to_read += 1;
10045                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10046                next_offset += envelope_size;
10047            }
10048
10049            Ok(())
10050        }
10051    }
10052
10053    impl fidl::encoding::ValueTypeMarker for AggregateCapability {
10054        type Borrowed<'a> = &'a Self;
10055        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10056            value
10057        }
10058    }
10059
10060    unsafe impl fidl::encoding::TypeMarker for AggregateCapability {
10061        type Owned = Self;
10062
10063        #[inline(always)]
10064        fn inline_align(_context: fidl::encoding::Context) -> usize {
10065            8
10066        }
10067
10068        #[inline(always)]
10069        fn inline_size(_context: fidl::encoding::Context) -> usize {
10070            16
10071        }
10072    }
10073
10074    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AggregateCapability, D>
10075        for &AggregateCapability
10076    {
10077        #[inline]
10078        unsafe fn encode(
10079            self,
10080            encoder: &mut fidl::encoding::Encoder<'_, D>,
10081            offset: usize,
10082            _depth: fidl::encoding::Depth,
10083        ) -> fidl::Result<()> {
10084            encoder.debug_check_bounds::<AggregateCapability>(offset);
10085            encoder.write_num::<u64>(self.ordinal(), offset);
10086            match self {
10087                AggregateCapability::Service(ref val) => fidl::encoding::encode_in_envelope::<
10088                    fidl::encoding::BoundedString<100>,
10089                    D,
10090                >(
10091                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
10092                        val,
10093                    ),
10094                    encoder,
10095                    offset + 8,
10096                    _depth,
10097                ),
10098            }
10099        }
10100    }
10101
10102    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AggregateCapability {
10103        #[inline(always)]
10104        fn new_empty() -> Self {
10105            Self::Service(fidl::new_empty!(fidl::encoding::BoundedString<100>, D))
10106        }
10107
10108        #[inline]
10109        unsafe fn decode(
10110            &mut self,
10111            decoder: &mut fidl::encoding::Decoder<'_, D>,
10112            offset: usize,
10113            mut depth: fidl::encoding::Depth,
10114        ) -> fidl::Result<()> {
10115            decoder.debug_check_bounds::<Self>(offset);
10116            #[allow(unused_variables)]
10117            let next_out_of_line = decoder.next_out_of_line();
10118            let handles_before = decoder.remaining_handles();
10119            let (ordinal, inlined, num_bytes, num_handles) =
10120                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
10121
10122            let member_inline_size = match ordinal {
10123                1 => {
10124                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
10125                        decoder.context,
10126                    )
10127                }
10128                _ => return Err(fidl::Error::UnknownUnionTag),
10129            };
10130
10131            if inlined != (member_inline_size <= 4) {
10132                return Err(fidl::Error::InvalidInlineBitInEnvelope);
10133            }
10134            let _inner_offset;
10135            if inlined {
10136                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
10137                _inner_offset = offset + 8;
10138            } else {
10139                depth.increment()?;
10140                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10141            }
10142            match ordinal {
10143                1 => {
10144                    #[allow(irrefutable_let_patterns)]
10145                    if let AggregateCapability::Service(_) = self {
10146                        // Do nothing, read the value into the object
10147                    } else {
10148                        // Initialize `self` to the right variant
10149                        *self = AggregateCapability::Service(fidl::new_empty!(
10150                            fidl::encoding::BoundedString<100>,
10151                            D
10152                        ));
10153                    }
10154                    #[allow(irrefutable_let_patterns)]
10155                    if let AggregateCapability::Service(ref mut val) = self {
10156                        fidl::decode!(
10157                            fidl::encoding::BoundedString<100>,
10158                            D,
10159                            val,
10160                            decoder,
10161                            _inner_offset,
10162                            depth
10163                        )?;
10164                    } else {
10165                        unreachable!()
10166                    }
10167                }
10168                ordinal => panic!("unexpected ordinal {:?}", ordinal),
10169            }
10170            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
10171                return Err(fidl::Error::InvalidNumBytesInEnvelope);
10172            }
10173            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10174                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10175            }
10176            Ok(())
10177        }
10178    }
10179
10180    impl fidl::encoding::ValueTypeMarker for AggregateMember {
10181        type Borrowed<'a> = &'a Self;
10182        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10183            value
10184        }
10185    }
10186
10187    unsafe impl fidl::encoding::TypeMarker for AggregateMember {
10188        type Owned = Self;
10189
10190        #[inline(always)]
10191        fn inline_align(_context: fidl::encoding::Context) -> usize {
10192            8
10193        }
10194
10195        #[inline(always)]
10196        fn inline_size(_context: fidl::encoding::Context) -> usize {
10197            16
10198        }
10199    }
10200
10201    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AggregateMember, D>
10202        for &AggregateMember
10203    {
10204        #[inline]
10205        unsafe fn encode(
10206            self,
10207            encoder: &mut fidl::encoding::Encoder<'_, D>,
10208            offset: usize,
10209            _depth: fidl::encoding::Depth,
10210        ) -> fidl::Result<()> {
10211            encoder.debug_check_bounds::<AggregateMember>(offset);
10212            encoder.write_num::<u64>(self.ordinal(), offset);
10213            match self {
10214            AggregateMember::Child(ref val) => {
10215                fidl::encoding::encode_in_envelope::<fidl_fuchsia_component_decl::ChildRef, D>(
10216                    <fidl_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(val),
10217                    encoder, offset + 8, _depth
10218                )
10219            }
10220            AggregateMember::Collection(ref val) => {
10221                fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<100>, D>(
10222                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(val),
10223                    encoder, offset + 8, _depth
10224                )
10225            }
10226            AggregateMember::Parent(ref val) => {
10227                fidl::encoding::encode_in_envelope::<fidl_fuchsia_component_decl::ParentRef, D>(
10228                    <fidl_fuchsia_component_decl::ParentRef as fidl::encoding::ValueTypeMarker>::borrow(val),
10229                    encoder, offset + 8, _depth
10230                )
10231            }
10232            AggregateMember::Self_(ref val) => {
10233                fidl::encoding::encode_in_envelope::<fidl_fuchsia_component_decl::SelfRef, D>(
10234                    <fidl_fuchsia_component_decl::SelfRef as fidl::encoding::ValueTypeMarker>::borrow(val),
10235                    encoder, offset + 8, _depth
10236                )
10237            }
10238        }
10239        }
10240    }
10241
10242    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AggregateMember {
10243        #[inline(always)]
10244        fn new_empty() -> Self {
10245            Self::Child(fidl::new_empty!(fidl_fuchsia_component_decl::ChildRef, D))
10246        }
10247
10248        #[inline]
10249        unsafe fn decode(
10250            &mut self,
10251            decoder: &mut fidl::encoding::Decoder<'_, D>,
10252            offset: usize,
10253            mut depth: fidl::encoding::Depth,
10254        ) -> fidl::Result<()> {
10255            decoder.debug_check_bounds::<Self>(offset);
10256            #[allow(unused_variables)]
10257            let next_out_of_line = decoder.next_out_of_line();
10258            let handles_before = decoder.remaining_handles();
10259            let (ordinal, inlined, num_bytes, num_handles) =
10260                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
10261
10262            let member_inline_size = match ordinal {
10263            1 => <fidl_fuchsia_component_decl::ChildRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10264            2 => <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10265            3 => <fidl_fuchsia_component_decl::ParentRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10266            4 => <fidl_fuchsia_component_decl::SelfRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10267            _ => return Err(fidl::Error::UnknownUnionTag),
10268        };
10269
10270            if inlined != (member_inline_size <= 4) {
10271                return Err(fidl::Error::InvalidInlineBitInEnvelope);
10272            }
10273            let _inner_offset;
10274            if inlined {
10275                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
10276                _inner_offset = offset + 8;
10277            } else {
10278                depth.increment()?;
10279                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10280            }
10281            match ordinal {
10282                1 => {
10283                    #[allow(irrefutable_let_patterns)]
10284                    if let AggregateMember::Child(_) = self {
10285                        // Do nothing, read the value into the object
10286                    } else {
10287                        // Initialize `self` to the right variant
10288                        *self = AggregateMember::Child(fidl::new_empty!(
10289                            fidl_fuchsia_component_decl::ChildRef,
10290                            D
10291                        ));
10292                    }
10293                    #[allow(irrefutable_let_patterns)]
10294                    if let AggregateMember::Child(ref mut val) = self {
10295                        fidl::decode!(
10296                            fidl_fuchsia_component_decl::ChildRef,
10297                            D,
10298                            val,
10299                            decoder,
10300                            _inner_offset,
10301                            depth
10302                        )?;
10303                    } else {
10304                        unreachable!()
10305                    }
10306                }
10307                2 => {
10308                    #[allow(irrefutable_let_patterns)]
10309                    if let AggregateMember::Collection(_) = self {
10310                        // Do nothing, read the value into the object
10311                    } else {
10312                        // Initialize `self` to the right variant
10313                        *self = AggregateMember::Collection(fidl::new_empty!(
10314                            fidl::encoding::BoundedString<100>,
10315                            D
10316                        ));
10317                    }
10318                    #[allow(irrefutable_let_patterns)]
10319                    if let AggregateMember::Collection(ref mut val) = self {
10320                        fidl::decode!(
10321                            fidl::encoding::BoundedString<100>,
10322                            D,
10323                            val,
10324                            decoder,
10325                            _inner_offset,
10326                            depth
10327                        )?;
10328                    } else {
10329                        unreachable!()
10330                    }
10331                }
10332                3 => {
10333                    #[allow(irrefutable_let_patterns)]
10334                    if let AggregateMember::Parent(_) = self {
10335                        // Do nothing, read the value into the object
10336                    } else {
10337                        // Initialize `self` to the right variant
10338                        *self = AggregateMember::Parent(fidl::new_empty!(
10339                            fidl_fuchsia_component_decl::ParentRef,
10340                            D
10341                        ));
10342                    }
10343                    #[allow(irrefutable_let_patterns)]
10344                    if let AggregateMember::Parent(ref mut val) = self {
10345                        fidl::decode!(
10346                            fidl_fuchsia_component_decl::ParentRef,
10347                            D,
10348                            val,
10349                            decoder,
10350                            _inner_offset,
10351                            depth
10352                        )?;
10353                    } else {
10354                        unreachable!()
10355                    }
10356                }
10357                4 => {
10358                    #[allow(irrefutable_let_patterns)]
10359                    if let AggregateMember::Self_(_) = self {
10360                        // Do nothing, read the value into the object
10361                    } else {
10362                        // Initialize `self` to the right variant
10363                        *self = AggregateMember::Self_(fidl::new_empty!(
10364                            fidl_fuchsia_component_decl::SelfRef,
10365                            D
10366                        ));
10367                    }
10368                    #[allow(irrefutable_let_patterns)]
10369                    if let AggregateMember::Self_(ref mut val) = self {
10370                        fidl::decode!(
10371                            fidl_fuchsia_component_decl::SelfRef,
10372                            D,
10373                            val,
10374                            decoder,
10375                            _inner_offset,
10376                            depth
10377                        )?;
10378                    } else {
10379                        unreachable!()
10380                    }
10381                }
10382                ordinal => panic!("unexpected ordinal {:?}", ordinal),
10383            }
10384            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
10385                return Err(fidl::Error::InvalidNumBytesInEnvelope);
10386            }
10387            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10388                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10389            }
10390            Ok(())
10391        }
10392    }
10393
10394    impl fidl::encoding::ValueTypeMarker for AllowlistedCapability {
10395        type Borrowed<'a> = &'a Self;
10396        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10397            value
10398        }
10399    }
10400
10401    unsafe impl fidl::encoding::TypeMarker for AllowlistedCapability {
10402        type Owned = Self;
10403
10404        #[inline(always)]
10405        fn inline_align(_context: fidl::encoding::Context) -> usize {
10406            8
10407        }
10408
10409        #[inline(always)]
10410        fn inline_size(_context: fidl::encoding::Context) -> usize {
10411            16
10412        }
10413    }
10414
10415    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AllowlistedCapability, D>
10416        for &AllowlistedCapability
10417    {
10418        #[inline]
10419        unsafe fn encode(
10420            self,
10421            encoder: &mut fidl::encoding::Encoder<'_, D>,
10422            offset: usize,
10423            _depth: fidl::encoding::Depth,
10424        ) -> fidl::Result<()> {
10425            encoder.debug_check_bounds::<AllowlistedCapability>(offset);
10426            encoder.write_num::<u64>(self.ordinal(), offset);
10427            match self {
10428                AllowlistedCapability::Directory(ref val) => {
10429                    fidl::encoding::encode_in_envelope::<AllowlistedDirectory, D>(
10430                        <AllowlistedDirectory as fidl::encoding::ValueTypeMarker>::borrow(val),
10431                        encoder,
10432                        offset + 8,
10433                        _depth,
10434                    )
10435                }
10436                AllowlistedCapability::Protocol(ref val) => {
10437                    fidl::encoding::encode_in_envelope::<AllowlistedProtocol, D>(
10438                        <AllowlistedProtocol as fidl::encoding::ValueTypeMarker>::borrow(val),
10439                        encoder,
10440                        offset + 8,
10441                        _depth,
10442                    )
10443                }
10444                AllowlistedCapability::Service(ref val) => {
10445                    fidl::encoding::encode_in_envelope::<AllowlistedService, D>(
10446                        <AllowlistedService as fidl::encoding::ValueTypeMarker>::borrow(val),
10447                        encoder,
10448                        offset + 8,
10449                        _depth,
10450                    )
10451                }
10452                AllowlistedCapability::Storage(ref val) => {
10453                    fidl::encoding::encode_in_envelope::<AllowlistedStorage, D>(
10454                        <AllowlistedStorage as fidl::encoding::ValueTypeMarker>::borrow(val),
10455                        encoder,
10456                        offset + 8,
10457                        _depth,
10458                    )
10459                }
10460                AllowlistedCapability::Runner(ref val) => {
10461                    fidl::encoding::encode_in_envelope::<AllowlistedRunner, D>(
10462                        <AllowlistedRunner as fidl::encoding::ValueTypeMarker>::borrow(val),
10463                        encoder,
10464                        offset + 8,
10465                        _depth,
10466                    )
10467                }
10468                AllowlistedCapability::Resolver(ref val) => {
10469                    fidl::encoding::encode_in_envelope::<AllowlistedResolver, D>(
10470                        <AllowlistedResolver as fidl::encoding::ValueTypeMarker>::borrow(val),
10471                        encoder,
10472                        offset + 8,
10473                        _depth,
10474                    )
10475                }
10476                AllowlistedCapability::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
10477            }
10478        }
10479    }
10480
10481    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AllowlistedCapability {
10482        #[inline(always)]
10483        fn new_empty() -> Self {
10484            Self::__SourceBreaking { unknown_ordinal: 0 }
10485        }
10486
10487        #[inline]
10488        unsafe fn decode(
10489            &mut self,
10490            decoder: &mut fidl::encoding::Decoder<'_, D>,
10491            offset: usize,
10492            mut depth: fidl::encoding::Depth,
10493        ) -> fidl::Result<()> {
10494            decoder.debug_check_bounds::<Self>(offset);
10495            #[allow(unused_variables)]
10496            let next_out_of_line = decoder.next_out_of_line();
10497            let handles_before = decoder.remaining_handles();
10498            let (ordinal, inlined, num_bytes, num_handles) =
10499                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
10500
10501            let member_inline_size = match ordinal {
10502                1 => <AllowlistedDirectory as fidl::encoding::TypeMarker>::inline_size(
10503                    decoder.context,
10504                ),
10505                3 => <AllowlistedProtocol as fidl::encoding::TypeMarker>::inline_size(
10506                    decoder.context,
10507                ),
10508                4 => {
10509                    <AllowlistedService as fidl::encoding::TypeMarker>::inline_size(decoder.context)
10510                }
10511                5 => {
10512                    <AllowlistedStorage as fidl::encoding::TypeMarker>::inline_size(decoder.context)
10513                }
10514                6 => {
10515                    <AllowlistedRunner as fidl::encoding::TypeMarker>::inline_size(decoder.context)
10516                }
10517                7 => <AllowlistedResolver as fidl::encoding::TypeMarker>::inline_size(
10518                    decoder.context,
10519                ),
10520                0 => return Err(fidl::Error::UnknownUnionTag),
10521                _ => num_bytes as usize,
10522            };
10523
10524            if inlined != (member_inline_size <= 4) {
10525                return Err(fidl::Error::InvalidInlineBitInEnvelope);
10526            }
10527            let _inner_offset;
10528            if inlined {
10529                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
10530                _inner_offset = offset + 8;
10531            } else {
10532                depth.increment()?;
10533                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10534            }
10535            match ordinal {
10536                1 => {
10537                    #[allow(irrefutable_let_patterns)]
10538                    if let AllowlistedCapability::Directory(_) = self {
10539                        // Do nothing, read the value into the object
10540                    } else {
10541                        // Initialize `self` to the right variant
10542                        *self = AllowlistedCapability::Directory(fidl::new_empty!(
10543                            AllowlistedDirectory,
10544                            D
10545                        ));
10546                    }
10547                    #[allow(irrefutable_let_patterns)]
10548                    if let AllowlistedCapability::Directory(ref mut val) = self {
10549                        fidl::decode!(AllowlistedDirectory, D, val, decoder, _inner_offset, depth)?;
10550                    } else {
10551                        unreachable!()
10552                    }
10553                }
10554                3 => {
10555                    #[allow(irrefutable_let_patterns)]
10556                    if let AllowlistedCapability::Protocol(_) = self {
10557                        // Do nothing, read the value into the object
10558                    } else {
10559                        // Initialize `self` to the right variant
10560                        *self = AllowlistedCapability::Protocol(fidl::new_empty!(
10561                            AllowlistedProtocol,
10562                            D
10563                        ));
10564                    }
10565                    #[allow(irrefutable_let_patterns)]
10566                    if let AllowlistedCapability::Protocol(ref mut val) = self {
10567                        fidl::decode!(AllowlistedProtocol, D, val, decoder, _inner_offset, depth)?;
10568                    } else {
10569                        unreachable!()
10570                    }
10571                }
10572                4 => {
10573                    #[allow(irrefutable_let_patterns)]
10574                    if let AllowlistedCapability::Service(_) = self {
10575                        // Do nothing, read the value into the object
10576                    } else {
10577                        // Initialize `self` to the right variant
10578                        *self =
10579                            AllowlistedCapability::Service(fidl::new_empty!(AllowlistedService, D));
10580                    }
10581                    #[allow(irrefutable_let_patterns)]
10582                    if let AllowlistedCapability::Service(ref mut val) = self {
10583                        fidl::decode!(AllowlistedService, D, val, decoder, _inner_offset, depth)?;
10584                    } else {
10585                        unreachable!()
10586                    }
10587                }
10588                5 => {
10589                    #[allow(irrefutable_let_patterns)]
10590                    if let AllowlistedCapability::Storage(_) = self {
10591                        // Do nothing, read the value into the object
10592                    } else {
10593                        // Initialize `self` to the right variant
10594                        *self =
10595                            AllowlistedCapability::Storage(fidl::new_empty!(AllowlistedStorage, D));
10596                    }
10597                    #[allow(irrefutable_let_patterns)]
10598                    if let AllowlistedCapability::Storage(ref mut val) = self {
10599                        fidl::decode!(AllowlistedStorage, D, val, decoder, _inner_offset, depth)?;
10600                    } else {
10601                        unreachable!()
10602                    }
10603                }
10604                6 => {
10605                    #[allow(irrefutable_let_patterns)]
10606                    if let AllowlistedCapability::Runner(_) = self {
10607                        // Do nothing, read the value into the object
10608                    } else {
10609                        // Initialize `self` to the right variant
10610                        *self =
10611                            AllowlistedCapability::Runner(fidl::new_empty!(AllowlistedRunner, D));
10612                    }
10613                    #[allow(irrefutable_let_patterns)]
10614                    if let AllowlistedCapability::Runner(ref mut val) = self {
10615                        fidl::decode!(AllowlistedRunner, D, val, decoder, _inner_offset, depth)?;
10616                    } else {
10617                        unreachable!()
10618                    }
10619                }
10620                7 => {
10621                    #[allow(irrefutable_let_patterns)]
10622                    if let AllowlistedCapability::Resolver(_) = self {
10623                        // Do nothing, read the value into the object
10624                    } else {
10625                        // Initialize `self` to the right variant
10626                        *self = AllowlistedCapability::Resolver(fidl::new_empty!(
10627                            AllowlistedResolver,
10628                            D
10629                        ));
10630                    }
10631                    #[allow(irrefutable_let_patterns)]
10632                    if let AllowlistedCapability::Resolver(ref mut val) = self {
10633                        fidl::decode!(AllowlistedResolver, D, val, decoder, _inner_offset, depth)?;
10634                    } else {
10635                        unreachable!()
10636                    }
10637                }
10638                #[allow(deprecated)]
10639                ordinal => {
10640                    for _ in 0..num_handles {
10641                        decoder.drop_next_handle()?;
10642                    }
10643                    *self = AllowlistedCapability::__SourceBreaking { unknown_ordinal: ordinal };
10644                }
10645            }
10646            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
10647                return Err(fidl::Error::InvalidNumBytesInEnvelope);
10648            }
10649            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10650                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10651            }
10652            Ok(())
10653        }
10654    }
10655
10656    impl fidl::encoding::ValueTypeMarker for AllowlistedDebugRegistration {
10657        type Borrowed<'a> = &'a Self;
10658        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10659            value
10660        }
10661    }
10662
10663    unsafe impl fidl::encoding::TypeMarker for AllowlistedDebugRegistration {
10664        type Owned = Self;
10665
10666        #[inline(always)]
10667        fn inline_align(_context: fidl::encoding::Context) -> usize {
10668            8
10669        }
10670
10671        #[inline(always)]
10672        fn inline_size(_context: fidl::encoding::Context) -> usize {
10673            16
10674        }
10675    }
10676
10677    unsafe impl<D: fidl::encoding::ResourceDialect>
10678        fidl::encoding::Encode<AllowlistedDebugRegistration, D> for &AllowlistedDebugRegistration
10679    {
10680        #[inline]
10681        unsafe fn encode(
10682            self,
10683            encoder: &mut fidl::encoding::Encoder<'_, D>,
10684            offset: usize,
10685            _depth: fidl::encoding::Depth,
10686        ) -> fidl::Result<()> {
10687            encoder.debug_check_bounds::<AllowlistedDebugRegistration>(offset);
10688            encoder.write_num::<u64>(self.ordinal(), offset);
10689            match self {
10690                AllowlistedDebugRegistration::Protocol(ref val) => {
10691                    fidl::encoding::encode_in_envelope::<AllowlistedProtocol, D>(
10692                        <AllowlistedProtocol as fidl::encoding::ValueTypeMarker>::borrow(val),
10693                        encoder,
10694                        offset + 8,
10695                        _depth,
10696                    )
10697                }
10698                AllowlistedDebugRegistration::__SourceBreaking { .. } => {
10699                    Err(fidl::Error::UnknownUnionTag)
10700                }
10701            }
10702        }
10703    }
10704
10705    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10706        for AllowlistedDebugRegistration
10707    {
10708        #[inline(always)]
10709        fn new_empty() -> Self {
10710            Self::__SourceBreaking { unknown_ordinal: 0 }
10711        }
10712
10713        #[inline]
10714        unsafe fn decode(
10715            &mut self,
10716            decoder: &mut fidl::encoding::Decoder<'_, D>,
10717            offset: usize,
10718            mut depth: fidl::encoding::Depth,
10719        ) -> fidl::Result<()> {
10720            decoder.debug_check_bounds::<Self>(offset);
10721            #[allow(unused_variables)]
10722            let next_out_of_line = decoder.next_out_of_line();
10723            let handles_before = decoder.remaining_handles();
10724            let (ordinal, inlined, num_bytes, num_handles) =
10725                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
10726
10727            let member_inline_size = match ordinal {
10728                1 => <AllowlistedProtocol as fidl::encoding::TypeMarker>::inline_size(
10729                    decoder.context,
10730                ),
10731                0 => return Err(fidl::Error::UnknownUnionTag),
10732                _ => num_bytes as usize,
10733            };
10734
10735            if inlined != (member_inline_size <= 4) {
10736                return Err(fidl::Error::InvalidInlineBitInEnvelope);
10737            }
10738            let _inner_offset;
10739            if inlined {
10740                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
10741                _inner_offset = offset + 8;
10742            } else {
10743                depth.increment()?;
10744                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10745            }
10746            match ordinal {
10747                1 => {
10748                    #[allow(irrefutable_let_patterns)]
10749                    if let AllowlistedDebugRegistration::Protocol(_) = self {
10750                        // Do nothing, read the value into the object
10751                    } else {
10752                        // Initialize `self` to the right variant
10753                        *self = AllowlistedDebugRegistration::Protocol(fidl::new_empty!(
10754                            AllowlistedProtocol,
10755                            D
10756                        ));
10757                    }
10758                    #[allow(irrefutable_let_patterns)]
10759                    if let AllowlistedDebugRegistration::Protocol(ref mut val) = self {
10760                        fidl::decode!(AllowlistedProtocol, D, val, decoder, _inner_offset, depth)?;
10761                    } else {
10762                        unreachable!()
10763                    }
10764                }
10765                #[allow(deprecated)]
10766                ordinal => {
10767                    for _ in 0..num_handles {
10768                        decoder.drop_next_handle()?;
10769                    }
10770                    *self =
10771                        AllowlistedDebugRegistration::__SourceBreaking { unknown_ordinal: ordinal };
10772                }
10773            }
10774            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
10775                return Err(fidl::Error::InvalidNumBytesInEnvelope);
10776            }
10777            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10778                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10779            }
10780            Ok(())
10781        }
10782    }
10783
10784    impl fidl::encoding::ValueTypeMarker for CapabilitySource {
10785        type Borrowed<'a> = &'a Self;
10786        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10787            value
10788        }
10789    }
10790
10791    unsafe impl fidl::encoding::TypeMarker for CapabilitySource {
10792        type Owned = Self;
10793
10794        #[inline(always)]
10795        fn inline_align(_context: fidl::encoding::Context) -> usize {
10796            8
10797        }
10798
10799        #[inline(always)]
10800        fn inline_size(_context: fidl::encoding::Context) -> usize {
10801            16
10802        }
10803    }
10804
10805    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CapabilitySource, D>
10806        for &CapabilitySource
10807    {
10808        #[inline]
10809        unsafe fn encode(
10810            self,
10811            encoder: &mut fidl::encoding::Encoder<'_, D>,
10812            offset: usize,
10813            _depth: fidl::encoding::Depth,
10814        ) -> fidl::Result<()> {
10815            encoder.debug_check_bounds::<CapabilitySource>(offset);
10816            encoder.write_num::<u64>(self.ordinal(), offset);
10817            match self {
10818                CapabilitySource::Component(ref val) => {
10819                    fidl::encoding::encode_in_envelope::<Component, D>(
10820                        <Component as fidl::encoding::ValueTypeMarker>::borrow(val),
10821                        encoder,
10822                        offset + 8,
10823                        _depth,
10824                    )
10825                }
10826                CapabilitySource::Framework(ref val) => {
10827                    fidl::encoding::encode_in_envelope::<Framework, D>(
10828                        <Framework as fidl::encoding::ValueTypeMarker>::borrow(val),
10829                        encoder,
10830                        offset + 8,
10831                        _depth,
10832                    )
10833                }
10834                CapabilitySource::Builtin(ref val) => {
10835                    fidl::encoding::encode_in_envelope::<Builtin, D>(
10836                        <Builtin as fidl::encoding::ValueTypeMarker>::borrow(val),
10837                        encoder,
10838                        offset + 8,
10839                        _depth,
10840                    )
10841                }
10842                CapabilitySource::Namespace(ref val) => {
10843                    fidl::encoding::encode_in_envelope::<Namespace, D>(
10844                        <Namespace as fidl::encoding::ValueTypeMarker>::borrow(val),
10845                        encoder,
10846                        offset + 8,
10847                        _depth,
10848                    )
10849                }
10850                CapabilitySource::Capability(ref val) => {
10851                    fidl::encoding::encode_in_envelope::<Capability, D>(
10852                        <Capability as fidl::encoding::ValueTypeMarker>::borrow(val),
10853                        encoder,
10854                        offset + 8,
10855                        _depth,
10856                    )
10857                }
10858                CapabilitySource::AnonymizedAggregate(ref val) => {
10859                    fidl::encoding::encode_in_envelope::<AnonymizedAggregate, D>(
10860                        <AnonymizedAggregate as fidl::encoding::ValueTypeMarker>::borrow(val),
10861                        encoder,
10862                        offset + 8,
10863                        _depth,
10864                    )
10865                }
10866                CapabilitySource::FilteredProvider(ref val) => {
10867                    fidl::encoding::encode_in_envelope::<FilteredProvider, D>(
10868                        <FilteredProvider as fidl::encoding::ValueTypeMarker>::borrow(val),
10869                        encoder,
10870                        offset + 8,
10871                        _depth,
10872                    )
10873                }
10874                CapabilitySource::FilteredAggregateProvider(ref val) => {
10875                    fidl::encoding::encode_in_envelope::<FilteredAggregateProvider, D>(
10876                        <FilteredAggregateProvider as fidl::encoding::ValueTypeMarker>::borrow(val),
10877                        encoder,
10878                        offset + 8,
10879                        _depth,
10880                    )
10881                }
10882                CapabilitySource::Environment(ref val) => {
10883                    fidl::encoding::encode_in_envelope::<Environment, D>(
10884                        <Environment as fidl::encoding::ValueTypeMarker>::borrow(val),
10885                        encoder,
10886                        offset + 8,
10887                        _depth,
10888                    )
10889                }
10890                CapabilitySource::Void(ref val) => fidl::encoding::encode_in_envelope::<Void, D>(
10891                    <Void as fidl::encoding::ValueTypeMarker>::borrow(val),
10892                    encoder,
10893                    offset + 8,
10894                    _depth,
10895                ),
10896            }
10897        }
10898    }
10899
10900    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CapabilitySource {
10901        #[inline(always)]
10902        fn new_empty() -> Self {
10903            Self::Component(fidl::new_empty!(Component, D))
10904        }
10905
10906        #[inline]
10907        unsafe fn decode(
10908            &mut self,
10909            decoder: &mut fidl::encoding::Decoder<'_, D>,
10910            offset: usize,
10911            mut depth: fidl::encoding::Depth,
10912        ) -> fidl::Result<()> {
10913            decoder.debug_check_bounds::<Self>(offset);
10914            #[allow(unused_variables)]
10915            let next_out_of_line = decoder.next_out_of_line();
10916            let handles_before = decoder.remaining_handles();
10917            let (ordinal, inlined, num_bytes, num_handles) =
10918                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
10919
10920            let member_inline_size = match ordinal {
10921                1 => <Component as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10922                2 => <Framework as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10923                3 => <Builtin as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10924                4 => <Namespace as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10925                5 => <Capability as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10926                6 => <AnonymizedAggregate as fidl::encoding::TypeMarker>::inline_size(
10927                    decoder.context,
10928                ),
10929                7 => <FilteredProvider as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10930                8 => <FilteredAggregateProvider as fidl::encoding::TypeMarker>::inline_size(
10931                    decoder.context,
10932                ),
10933                9 => <Environment as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10934                10 => <Void as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10935                _ => return Err(fidl::Error::UnknownUnionTag),
10936            };
10937
10938            if inlined != (member_inline_size <= 4) {
10939                return Err(fidl::Error::InvalidInlineBitInEnvelope);
10940            }
10941            let _inner_offset;
10942            if inlined {
10943                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
10944                _inner_offset = offset + 8;
10945            } else {
10946                depth.increment()?;
10947                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10948            }
10949            match ordinal {
10950                1 => {
10951                    #[allow(irrefutable_let_patterns)]
10952                    if let CapabilitySource::Component(_) = self {
10953                        // Do nothing, read the value into the object
10954                    } else {
10955                        // Initialize `self` to the right variant
10956                        *self = CapabilitySource::Component(fidl::new_empty!(Component, D));
10957                    }
10958                    #[allow(irrefutable_let_patterns)]
10959                    if let CapabilitySource::Component(ref mut val) = self {
10960                        fidl::decode!(Component, D, val, decoder, _inner_offset, depth)?;
10961                    } else {
10962                        unreachable!()
10963                    }
10964                }
10965                2 => {
10966                    #[allow(irrefutable_let_patterns)]
10967                    if let CapabilitySource::Framework(_) = self {
10968                        // Do nothing, read the value into the object
10969                    } else {
10970                        // Initialize `self` to the right variant
10971                        *self = CapabilitySource::Framework(fidl::new_empty!(Framework, D));
10972                    }
10973                    #[allow(irrefutable_let_patterns)]
10974                    if let CapabilitySource::Framework(ref mut val) = self {
10975                        fidl::decode!(Framework, D, val, decoder, _inner_offset, depth)?;
10976                    } else {
10977                        unreachable!()
10978                    }
10979                }
10980                3 => {
10981                    #[allow(irrefutable_let_patterns)]
10982                    if let CapabilitySource::Builtin(_) = self {
10983                        // Do nothing, read the value into the object
10984                    } else {
10985                        // Initialize `self` to the right variant
10986                        *self = CapabilitySource::Builtin(fidl::new_empty!(Builtin, D));
10987                    }
10988                    #[allow(irrefutable_let_patterns)]
10989                    if let CapabilitySource::Builtin(ref mut val) = self {
10990                        fidl::decode!(Builtin, D, val, decoder, _inner_offset, depth)?;
10991                    } else {
10992                        unreachable!()
10993                    }
10994                }
10995                4 => {
10996                    #[allow(irrefutable_let_patterns)]
10997                    if let CapabilitySource::Namespace(_) = self {
10998                        // Do nothing, read the value into the object
10999                    } else {
11000                        // Initialize `self` to the right variant
11001                        *self = CapabilitySource::Namespace(fidl::new_empty!(Namespace, D));
11002                    }
11003                    #[allow(irrefutable_let_patterns)]
11004                    if let CapabilitySource::Namespace(ref mut val) = self {
11005                        fidl::decode!(Namespace, D, val, decoder, _inner_offset, depth)?;
11006                    } else {
11007                        unreachable!()
11008                    }
11009                }
11010                5 => {
11011                    #[allow(irrefutable_let_patterns)]
11012                    if let CapabilitySource::Capability(_) = self {
11013                        // Do nothing, read the value into the object
11014                    } else {
11015                        // Initialize `self` to the right variant
11016                        *self = CapabilitySource::Capability(fidl::new_empty!(Capability, D));
11017                    }
11018                    #[allow(irrefutable_let_patterns)]
11019                    if let CapabilitySource::Capability(ref mut val) = self {
11020                        fidl::decode!(Capability, D, val, decoder, _inner_offset, depth)?;
11021                    } else {
11022                        unreachable!()
11023                    }
11024                }
11025                6 => {
11026                    #[allow(irrefutable_let_patterns)]
11027                    if let CapabilitySource::AnonymizedAggregate(_) = self {
11028                        // Do nothing, read the value into the object
11029                    } else {
11030                        // Initialize `self` to the right variant
11031                        *self = CapabilitySource::AnonymizedAggregate(fidl::new_empty!(
11032                            AnonymizedAggregate,
11033                            D
11034                        ));
11035                    }
11036                    #[allow(irrefutable_let_patterns)]
11037                    if let CapabilitySource::AnonymizedAggregate(ref mut val) = self {
11038                        fidl::decode!(AnonymizedAggregate, D, val, decoder, _inner_offset, depth)?;
11039                    } else {
11040                        unreachable!()
11041                    }
11042                }
11043                7 => {
11044                    #[allow(irrefutable_let_patterns)]
11045                    if let CapabilitySource::FilteredProvider(_) = self {
11046                        // Do nothing, read the value into the object
11047                    } else {
11048                        // Initialize `self` to the right variant
11049                        *self = CapabilitySource::FilteredProvider(fidl::new_empty!(
11050                            FilteredProvider,
11051                            D
11052                        ));
11053                    }
11054                    #[allow(irrefutable_let_patterns)]
11055                    if let CapabilitySource::FilteredProvider(ref mut val) = self {
11056                        fidl::decode!(FilteredProvider, D, val, decoder, _inner_offset, depth)?;
11057                    } else {
11058                        unreachable!()
11059                    }
11060                }
11061                8 => {
11062                    #[allow(irrefutable_let_patterns)]
11063                    if let CapabilitySource::FilteredAggregateProvider(_) = self {
11064                        // Do nothing, read the value into the object
11065                    } else {
11066                        // Initialize `self` to the right variant
11067                        *self = CapabilitySource::FilteredAggregateProvider(fidl::new_empty!(
11068                            FilteredAggregateProvider,
11069                            D
11070                        ));
11071                    }
11072                    #[allow(irrefutable_let_patterns)]
11073                    if let CapabilitySource::FilteredAggregateProvider(ref mut val) = self {
11074                        fidl::decode!(
11075                            FilteredAggregateProvider,
11076                            D,
11077                            val,
11078                            decoder,
11079                            _inner_offset,
11080                            depth
11081                        )?;
11082                    } else {
11083                        unreachable!()
11084                    }
11085                }
11086                9 => {
11087                    #[allow(irrefutable_let_patterns)]
11088                    if let CapabilitySource::Environment(_) = self {
11089                        // Do nothing, read the value into the object
11090                    } else {
11091                        // Initialize `self` to the right variant
11092                        *self = CapabilitySource::Environment(fidl::new_empty!(Environment, D));
11093                    }
11094                    #[allow(irrefutable_let_patterns)]
11095                    if let CapabilitySource::Environment(ref mut val) = self {
11096                        fidl::decode!(Environment, D, val, decoder, _inner_offset, depth)?;
11097                    } else {
11098                        unreachable!()
11099                    }
11100                }
11101                10 => {
11102                    #[allow(irrefutable_let_patterns)]
11103                    if let CapabilitySource::Void(_) = self {
11104                        // Do nothing, read the value into the object
11105                    } else {
11106                        // Initialize `self` to the right variant
11107                        *self = CapabilitySource::Void(fidl::new_empty!(Void, D));
11108                    }
11109                    #[allow(irrefutable_let_patterns)]
11110                    if let CapabilitySource::Void(ref mut val) = self {
11111                        fidl::decode!(Void, D, val, decoder, _inner_offset, depth)?;
11112                    } else {
11113                        unreachable!()
11114                    }
11115                }
11116                ordinal => panic!("unexpected ordinal {:?}", ordinal),
11117            }
11118            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
11119                return Err(fidl::Error::InvalidNumBytesInEnvelope);
11120            }
11121            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11122                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11123            }
11124            Ok(())
11125        }
11126    }
11127
11128    impl fidl::encoding::ValueTypeMarker for ComponentCapability {
11129        type Borrowed<'a> = &'a Self;
11130        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11131            value
11132        }
11133    }
11134
11135    unsafe impl fidl::encoding::TypeMarker for ComponentCapability {
11136        type Owned = Self;
11137
11138        #[inline(always)]
11139        fn inline_align(_context: fidl::encoding::Context) -> usize {
11140            8
11141        }
11142
11143        #[inline(always)]
11144        fn inline_size(_context: fidl::encoding::Context) -> usize {
11145            16
11146        }
11147    }
11148
11149    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ComponentCapability, D>
11150        for &ComponentCapability
11151    {
11152        #[inline]
11153        unsafe fn encode(
11154            self,
11155            encoder: &mut fidl::encoding::Encoder<'_, D>,
11156            offset: usize,
11157            _depth: fidl::encoding::Depth,
11158        ) -> fidl::Result<()> {
11159            encoder.debug_check_bounds::<ComponentCapability>(offset);
11160            encoder.write_num::<u64>(self.ordinal(), offset);
11161            match self {
11162            ComponentCapability::Use_(ref val) => {
11163                fidl::encoding::encode_in_envelope::<fidl_fuchsia_component_decl::Use, D>(
11164                    <fidl_fuchsia_component_decl::Use as fidl::encoding::ValueTypeMarker>::borrow(val),
11165                    encoder, offset + 8, _depth
11166                )
11167            }
11168            ComponentCapability::Offer(ref val) => {
11169                fidl::encoding::encode_in_envelope::<fidl_fuchsia_component_decl::Offer, D>(
11170                    <fidl_fuchsia_component_decl::Offer as fidl::encoding::ValueTypeMarker>::borrow(val),
11171                    encoder, offset + 8, _depth
11172                )
11173            }
11174            ComponentCapability::Expose(ref val) => {
11175                fidl::encoding::encode_in_envelope::<fidl_fuchsia_component_decl::Expose, D>(
11176                    <fidl_fuchsia_component_decl::Expose as fidl::encoding::ValueTypeMarker>::borrow(val),
11177                    encoder, offset + 8, _depth
11178                )
11179            }
11180            ComponentCapability::Config(ref val) => {
11181                fidl::encoding::encode_in_envelope::<fidl_fuchsia_component_decl::Configuration, D>(
11182                    <fidl_fuchsia_component_decl::Configuration as fidl::encoding::ValueTypeMarker>::borrow(val),
11183                    encoder, offset + 8, _depth
11184                )
11185            }
11186            ComponentCapability::Dictionary(ref val) => {
11187                fidl::encoding::encode_in_envelope::<fidl_fuchsia_component_decl::Dictionary, D>(
11188                    <fidl_fuchsia_component_decl::Dictionary as fidl::encoding::ValueTypeMarker>::borrow(val),
11189                    encoder, offset + 8, _depth
11190                )
11191            }
11192            ComponentCapability::Directory(ref val) => {
11193                fidl::encoding::encode_in_envelope::<fidl_fuchsia_component_decl::Directory, D>(
11194                    <fidl_fuchsia_component_decl::Directory as fidl::encoding::ValueTypeMarker>::borrow(val),
11195                    encoder, offset + 8, _depth
11196                )
11197            }
11198            ComponentCapability::Environment(ref val) => {
11199                fidl::encoding::encode_in_envelope::<EnvironmentCapability, D>(
11200                    <EnvironmentCapability as fidl::encoding::ValueTypeMarker>::borrow(val),
11201                    encoder, offset + 8, _depth
11202                )
11203            }
11204            ComponentCapability::EventStream(ref val) => {
11205                fidl::encoding::encode_in_envelope::<fidl_fuchsia_component_decl::EventStream, D>(
11206                    <fidl_fuchsia_component_decl::EventStream as fidl::encoding::ValueTypeMarker>::borrow(val),
11207                    encoder, offset + 8, _depth
11208                )
11209            }
11210            ComponentCapability::Protocol(ref val) => {
11211                fidl::encoding::encode_in_envelope::<fidl_fuchsia_component_decl::Protocol, D>(
11212                    <fidl_fuchsia_component_decl::Protocol as fidl::encoding::ValueTypeMarker>::borrow(val),
11213                    encoder, offset + 8, _depth
11214                )
11215            }
11216            ComponentCapability::Resolver(ref val) => {
11217                fidl::encoding::encode_in_envelope::<fidl_fuchsia_component_decl::Resolver, D>(
11218                    <fidl_fuchsia_component_decl::Resolver as fidl::encoding::ValueTypeMarker>::borrow(val),
11219                    encoder, offset + 8, _depth
11220                )
11221            }
11222            ComponentCapability::Runner(ref val) => {
11223                fidl::encoding::encode_in_envelope::<fidl_fuchsia_component_decl::Runner, D>(
11224                    <fidl_fuchsia_component_decl::Runner as fidl::encoding::ValueTypeMarker>::borrow(val),
11225                    encoder, offset + 8, _depth
11226                )
11227            }
11228            ComponentCapability::Service(ref val) => {
11229                fidl::encoding::encode_in_envelope::<fidl_fuchsia_component_decl::Service, D>(
11230                    <fidl_fuchsia_component_decl::Service as fidl::encoding::ValueTypeMarker>::borrow(val),
11231                    encoder, offset + 8, _depth
11232                )
11233            }
11234            ComponentCapability::Storage(ref val) => {
11235                fidl::encoding::encode_in_envelope::<fidl_fuchsia_component_decl::Storage, D>(
11236                    <fidl_fuchsia_component_decl::Storage as fidl::encoding::ValueTypeMarker>::borrow(val),
11237                    encoder, offset + 8, _depth
11238                )
11239            }
11240        }
11241        }
11242    }
11243
11244    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ComponentCapability {
11245        #[inline(always)]
11246        fn new_empty() -> Self {
11247            Self::Use_(fidl::new_empty!(fidl_fuchsia_component_decl::Use, D))
11248        }
11249
11250        #[inline]
11251        unsafe fn decode(
11252            &mut self,
11253            decoder: &mut fidl::encoding::Decoder<'_, D>,
11254            offset: usize,
11255            mut depth: fidl::encoding::Depth,
11256        ) -> fidl::Result<()> {
11257            decoder.debug_check_bounds::<Self>(offset);
11258            #[allow(unused_variables)]
11259            let next_out_of_line = decoder.next_out_of_line();
11260            let handles_before = decoder.remaining_handles();
11261            let (ordinal, inlined, num_bytes, num_handles) =
11262                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
11263
11264            let member_inline_size = match ordinal {
11265            1 => <fidl_fuchsia_component_decl::Use as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11266            2 => <fidl_fuchsia_component_decl::Offer as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11267            3 => <fidl_fuchsia_component_decl::Expose as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11268            4 => <fidl_fuchsia_component_decl::Configuration as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11269            5 => <fidl_fuchsia_component_decl::Dictionary as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11270            6 => <fidl_fuchsia_component_decl::Directory as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11271            7 => <EnvironmentCapability as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11272            8 => <fidl_fuchsia_component_decl::EventStream as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11273            9 => <fidl_fuchsia_component_decl::Protocol as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11274            10 => <fidl_fuchsia_component_decl::Resolver as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11275            11 => <fidl_fuchsia_component_decl::Runner as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11276            12 => <fidl_fuchsia_component_decl::Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11277            13 => <fidl_fuchsia_component_decl::Storage as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11278            _ => return Err(fidl::Error::UnknownUnionTag),
11279        };
11280
11281            if inlined != (member_inline_size <= 4) {
11282                return Err(fidl::Error::InvalidInlineBitInEnvelope);
11283            }
11284            let _inner_offset;
11285            if inlined {
11286                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
11287                _inner_offset = offset + 8;
11288            } else {
11289                depth.increment()?;
11290                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11291            }
11292            match ordinal {
11293                1 => {
11294                    #[allow(irrefutable_let_patterns)]
11295                    if let ComponentCapability::Use_(_) = self {
11296                        // Do nothing, read the value into the object
11297                    } else {
11298                        // Initialize `self` to the right variant
11299                        *self = ComponentCapability::Use_(fidl::new_empty!(
11300                            fidl_fuchsia_component_decl::Use,
11301                            D
11302                        ));
11303                    }
11304                    #[allow(irrefutable_let_patterns)]
11305                    if let ComponentCapability::Use_(ref mut val) = self {
11306                        fidl::decode!(
11307                            fidl_fuchsia_component_decl::Use,
11308                            D,
11309                            val,
11310                            decoder,
11311                            _inner_offset,
11312                            depth
11313                        )?;
11314                    } else {
11315                        unreachable!()
11316                    }
11317                }
11318                2 => {
11319                    #[allow(irrefutable_let_patterns)]
11320                    if let ComponentCapability::Offer(_) = self {
11321                        // Do nothing, read the value into the object
11322                    } else {
11323                        // Initialize `self` to the right variant
11324                        *self = ComponentCapability::Offer(fidl::new_empty!(
11325                            fidl_fuchsia_component_decl::Offer,
11326                            D
11327                        ));
11328                    }
11329                    #[allow(irrefutable_let_patterns)]
11330                    if let ComponentCapability::Offer(ref mut val) = self {
11331                        fidl::decode!(
11332                            fidl_fuchsia_component_decl::Offer,
11333                            D,
11334                            val,
11335                            decoder,
11336                            _inner_offset,
11337                            depth
11338                        )?;
11339                    } else {
11340                        unreachable!()
11341                    }
11342                }
11343                3 => {
11344                    #[allow(irrefutable_let_patterns)]
11345                    if let ComponentCapability::Expose(_) = self {
11346                        // Do nothing, read the value into the object
11347                    } else {
11348                        // Initialize `self` to the right variant
11349                        *self = ComponentCapability::Expose(fidl::new_empty!(
11350                            fidl_fuchsia_component_decl::Expose,
11351                            D
11352                        ));
11353                    }
11354                    #[allow(irrefutable_let_patterns)]
11355                    if let ComponentCapability::Expose(ref mut val) = self {
11356                        fidl::decode!(
11357                            fidl_fuchsia_component_decl::Expose,
11358                            D,
11359                            val,
11360                            decoder,
11361                            _inner_offset,
11362                            depth
11363                        )?;
11364                    } else {
11365                        unreachable!()
11366                    }
11367                }
11368                4 => {
11369                    #[allow(irrefutable_let_patterns)]
11370                    if let ComponentCapability::Config(_) = self {
11371                        // Do nothing, read the value into the object
11372                    } else {
11373                        // Initialize `self` to the right variant
11374                        *self = ComponentCapability::Config(fidl::new_empty!(
11375                            fidl_fuchsia_component_decl::Configuration,
11376                            D
11377                        ));
11378                    }
11379                    #[allow(irrefutable_let_patterns)]
11380                    if let ComponentCapability::Config(ref mut val) = self {
11381                        fidl::decode!(
11382                            fidl_fuchsia_component_decl::Configuration,
11383                            D,
11384                            val,
11385                            decoder,
11386                            _inner_offset,
11387                            depth
11388                        )?;
11389                    } else {
11390                        unreachable!()
11391                    }
11392                }
11393                5 => {
11394                    #[allow(irrefutable_let_patterns)]
11395                    if let ComponentCapability::Dictionary(_) = self {
11396                        // Do nothing, read the value into the object
11397                    } else {
11398                        // Initialize `self` to the right variant
11399                        *self = ComponentCapability::Dictionary(fidl::new_empty!(
11400                            fidl_fuchsia_component_decl::Dictionary,
11401                            D
11402                        ));
11403                    }
11404                    #[allow(irrefutable_let_patterns)]
11405                    if let ComponentCapability::Dictionary(ref mut val) = self {
11406                        fidl::decode!(
11407                            fidl_fuchsia_component_decl::Dictionary,
11408                            D,
11409                            val,
11410                            decoder,
11411                            _inner_offset,
11412                            depth
11413                        )?;
11414                    } else {
11415                        unreachable!()
11416                    }
11417                }
11418                6 => {
11419                    #[allow(irrefutable_let_patterns)]
11420                    if let ComponentCapability::Directory(_) = self {
11421                        // Do nothing, read the value into the object
11422                    } else {
11423                        // Initialize `self` to the right variant
11424                        *self = ComponentCapability::Directory(fidl::new_empty!(
11425                            fidl_fuchsia_component_decl::Directory,
11426                            D
11427                        ));
11428                    }
11429                    #[allow(irrefutable_let_patterns)]
11430                    if let ComponentCapability::Directory(ref mut val) = self {
11431                        fidl::decode!(
11432                            fidl_fuchsia_component_decl::Directory,
11433                            D,
11434                            val,
11435                            decoder,
11436                            _inner_offset,
11437                            depth
11438                        )?;
11439                    } else {
11440                        unreachable!()
11441                    }
11442                }
11443                7 => {
11444                    #[allow(irrefutable_let_patterns)]
11445                    if let ComponentCapability::Environment(_) = self {
11446                        // Do nothing, read the value into the object
11447                    } else {
11448                        // Initialize `self` to the right variant
11449                        *self = ComponentCapability::Environment(fidl::new_empty!(
11450                            EnvironmentCapability,
11451                            D
11452                        ));
11453                    }
11454                    #[allow(irrefutable_let_patterns)]
11455                    if let ComponentCapability::Environment(ref mut val) = self {
11456                        fidl::decode!(
11457                            EnvironmentCapability,
11458                            D,
11459                            val,
11460                            decoder,
11461                            _inner_offset,
11462                            depth
11463                        )?;
11464                    } else {
11465                        unreachable!()
11466                    }
11467                }
11468                8 => {
11469                    #[allow(irrefutable_let_patterns)]
11470                    if let ComponentCapability::EventStream(_) = self {
11471                        // Do nothing, read the value into the object
11472                    } else {
11473                        // Initialize `self` to the right variant
11474                        *self = ComponentCapability::EventStream(fidl::new_empty!(
11475                            fidl_fuchsia_component_decl::EventStream,
11476                            D
11477                        ));
11478                    }
11479                    #[allow(irrefutable_let_patterns)]
11480                    if let ComponentCapability::EventStream(ref mut val) = self {
11481                        fidl::decode!(
11482                            fidl_fuchsia_component_decl::EventStream,
11483                            D,
11484                            val,
11485                            decoder,
11486                            _inner_offset,
11487                            depth
11488                        )?;
11489                    } else {
11490                        unreachable!()
11491                    }
11492                }
11493                9 => {
11494                    #[allow(irrefutable_let_patterns)]
11495                    if let ComponentCapability::Protocol(_) = self {
11496                        // Do nothing, read the value into the object
11497                    } else {
11498                        // Initialize `self` to the right variant
11499                        *self = ComponentCapability::Protocol(fidl::new_empty!(
11500                            fidl_fuchsia_component_decl::Protocol,
11501                            D
11502                        ));
11503                    }
11504                    #[allow(irrefutable_let_patterns)]
11505                    if let ComponentCapability::Protocol(ref mut val) = self {
11506                        fidl::decode!(
11507                            fidl_fuchsia_component_decl::Protocol,
11508                            D,
11509                            val,
11510                            decoder,
11511                            _inner_offset,
11512                            depth
11513                        )?;
11514                    } else {
11515                        unreachable!()
11516                    }
11517                }
11518                10 => {
11519                    #[allow(irrefutable_let_patterns)]
11520                    if let ComponentCapability::Resolver(_) = self {
11521                        // Do nothing, read the value into the object
11522                    } else {
11523                        // Initialize `self` to the right variant
11524                        *self = ComponentCapability::Resolver(fidl::new_empty!(
11525                            fidl_fuchsia_component_decl::Resolver,
11526                            D
11527                        ));
11528                    }
11529                    #[allow(irrefutable_let_patterns)]
11530                    if let ComponentCapability::Resolver(ref mut val) = self {
11531                        fidl::decode!(
11532                            fidl_fuchsia_component_decl::Resolver,
11533                            D,
11534                            val,
11535                            decoder,
11536                            _inner_offset,
11537                            depth
11538                        )?;
11539                    } else {
11540                        unreachable!()
11541                    }
11542                }
11543                11 => {
11544                    #[allow(irrefutable_let_patterns)]
11545                    if let ComponentCapability::Runner(_) = self {
11546                        // Do nothing, read the value into the object
11547                    } else {
11548                        // Initialize `self` to the right variant
11549                        *self = ComponentCapability::Runner(fidl::new_empty!(
11550                            fidl_fuchsia_component_decl::Runner,
11551                            D
11552                        ));
11553                    }
11554                    #[allow(irrefutable_let_patterns)]
11555                    if let ComponentCapability::Runner(ref mut val) = self {
11556                        fidl::decode!(
11557                            fidl_fuchsia_component_decl::Runner,
11558                            D,
11559                            val,
11560                            decoder,
11561                            _inner_offset,
11562                            depth
11563                        )?;
11564                    } else {
11565                        unreachable!()
11566                    }
11567                }
11568                12 => {
11569                    #[allow(irrefutable_let_patterns)]
11570                    if let ComponentCapability::Service(_) = self {
11571                        // Do nothing, read the value into the object
11572                    } else {
11573                        // Initialize `self` to the right variant
11574                        *self = ComponentCapability::Service(fidl::new_empty!(
11575                            fidl_fuchsia_component_decl::Service,
11576                            D
11577                        ));
11578                    }
11579                    #[allow(irrefutable_let_patterns)]
11580                    if let ComponentCapability::Service(ref mut val) = self {
11581                        fidl::decode!(
11582                            fidl_fuchsia_component_decl::Service,
11583                            D,
11584                            val,
11585                            decoder,
11586                            _inner_offset,
11587                            depth
11588                        )?;
11589                    } else {
11590                        unreachable!()
11591                    }
11592                }
11593                13 => {
11594                    #[allow(irrefutable_let_patterns)]
11595                    if let ComponentCapability::Storage(_) = self {
11596                        // Do nothing, read the value into the object
11597                    } else {
11598                        // Initialize `self` to the right variant
11599                        *self = ComponentCapability::Storage(fidl::new_empty!(
11600                            fidl_fuchsia_component_decl::Storage,
11601                            D
11602                        ));
11603                    }
11604                    #[allow(irrefutable_let_patterns)]
11605                    if let ComponentCapability::Storage(ref mut val) = self {
11606                        fidl::decode!(
11607                            fidl_fuchsia_component_decl::Storage,
11608                            D,
11609                            val,
11610                            decoder,
11611                            _inner_offset,
11612                            depth
11613                        )?;
11614                    } else {
11615                        unreachable!()
11616                    }
11617                }
11618                ordinal => panic!("unexpected ordinal {:?}", ordinal),
11619            }
11620            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
11621                return Err(fidl::Error::InvalidNumBytesInEnvelope);
11622            }
11623            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11624                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11625            }
11626            Ok(())
11627        }
11628    }
11629
11630    impl fidl::encoding::ValueTypeMarker for EnvironmentCapability {
11631        type Borrowed<'a> = &'a Self;
11632        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11633            value
11634        }
11635    }
11636
11637    unsafe impl fidl::encoding::TypeMarker for EnvironmentCapability {
11638        type Owned = Self;
11639
11640        #[inline(always)]
11641        fn inline_align(_context: fidl::encoding::Context) -> usize {
11642            8
11643        }
11644
11645        #[inline(always)]
11646        fn inline_size(_context: fidl::encoding::Context) -> usize {
11647            16
11648        }
11649    }
11650
11651    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EnvironmentCapability, D>
11652        for &EnvironmentCapability
11653    {
11654        #[inline]
11655        unsafe fn encode(
11656            self,
11657            encoder: &mut fidl::encoding::Encoder<'_, D>,
11658            offset: usize,
11659            _depth: fidl::encoding::Depth,
11660        ) -> fidl::Result<()> {
11661            encoder.debug_check_bounds::<EnvironmentCapability>(offset);
11662            encoder.write_num::<u64>(self.ordinal(), offset);
11663            match self {
11664                EnvironmentCapability::Runner(ref val) => {
11665                    fidl::encoding::encode_in_envelope::<EnvironmentSource, D>(
11666                        <EnvironmentSource as fidl::encoding::ValueTypeMarker>::borrow(val),
11667                        encoder,
11668                        offset + 8,
11669                        _depth,
11670                    )
11671                }
11672                EnvironmentCapability::Resolver(ref val) => {
11673                    fidl::encoding::encode_in_envelope::<EnvironmentSource, D>(
11674                        <EnvironmentSource as fidl::encoding::ValueTypeMarker>::borrow(val),
11675                        encoder,
11676                        offset + 8,
11677                        _depth,
11678                    )
11679                }
11680                EnvironmentCapability::Debug(ref val) => {
11681                    fidl::encoding::encode_in_envelope::<EnvironmentSource, D>(
11682                        <EnvironmentSource as fidl::encoding::ValueTypeMarker>::borrow(val),
11683                        encoder,
11684                        offset + 8,
11685                        _depth,
11686                    )
11687                }
11688            }
11689        }
11690    }
11691
11692    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EnvironmentCapability {
11693        #[inline(always)]
11694        fn new_empty() -> Self {
11695            Self::Runner(fidl::new_empty!(EnvironmentSource, D))
11696        }
11697
11698        #[inline]
11699        unsafe fn decode(
11700            &mut self,
11701            decoder: &mut fidl::encoding::Decoder<'_, D>,
11702            offset: usize,
11703            mut depth: fidl::encoding::Depth,
11704        ) -> fidl::Result<()> {
11705            decoder.debug_check_bounds::<Self>(offset);
11706            #[allow(unused_variables)]
11707            let next_out_of_line = decoder.next_out_of_line();
11708            let handles_before = decoder.remaining_handles();
11709            let (ordinal, inlined, num_bytes, num_handles) =
11710                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
11711
11712            let member_inline_size = match ordinal {
11713                1 => {
11714                    <EnvironmentSource as fidl::encoding::TypeMarker>::inline_size(decoder.context)
11715                }
11716                2 => {
11717                    <EnvironmentSource as fidl::encoding::TypeMarker>::inline_size(decoder.context)
11718                }
11719                3 => {
11720                    <EnvironmentSource as fidl::encoding::TypeMarker>::inline_size(decoder.context)
11721                }
11722                _ => return Err(fidl::Error::UnknownUnionTag),
11723            };
11724
11725            if inlined != (member_inline_size <= 4) {
11726                return Err(fidl::Error::InvalidInlineBitInEnvelope);
11727            }
11728            let _inner_offset;
11729            if inlined {
11730                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
11731                _inner_offset = offset + 8;
11732            } else {
11733                depth.increment()?;
11734                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11735            }
11736            match ordinal {
11737                1 => {
11738                    #[allow(irrefutable_let_patterns)]
11739                    if let EnvironmentCapability::Runner(_) = self {
11740                        // Do nothing, read the value into the object
11741                    } else {
11742                        // Initialize `self` to the right variant
11743                        *self =
11744                            EnvironmentCapability::Runner(fidl::new_empty!(EnvironmentSource, D));
11745                    }
11746                    #[allow(irrefutable_let_patterns)]
11747                    if let EnvironmentCapability::Runner(ref mut val) = self {
11748                        fidl::decode!(EnvironmentSource, D, val, decoder, _inner_offset, depth)?;
11749                    } else {
11750                        unreachable!()
11751                    }
11752                }
11753                2 => {
11754                    #[allow(irrefutable_let_patterns)]
11755                    if let EnvironmentCapability::Resolver(_) = self {
11756                        // Do nothing, read the value into the object
11757                    } else {
11758                        // Initialize `self` to the right variant
11759                        *self =
11760                            EnvironmentCapability::Resolver(fidl::new_empty!(EnvironmentSource, D));
11761                    }
11762                    #[allow(irrefutable_let_patterns)]
11763                    if let EnvironmentCapability::Resolver(ref mut val) = self {
11764                        fidl::decode!(EnvironmentSource, D, val, decoder, _inner_offset, depth)?;
11765                    } else {
11766                        unreachable!()
11767                    }
11768                }
11769                3 => {
11770                    #[allow(irrefutable_let_patterns)]
11771                    if let EnvironmentCapability::Debug(_) = self {
11772                        // Do nothing, read the value into the object
11773                    } else {
11774                        // Initialize `self` to the right variant
11775                        *self =
11776                            EnvironmentCapability::Debug(fidl::new_empty!(EnvironmentSource, D));
11777                    }
11778                    #[allow(irrefutable_let_patterns)]
11779                    if let EnvironmentCapability::Debug(ref mut val) = self {
11780                        fidl::decode!(EnvironmentSource, D, val, decoder, _inner_offset, depth)?;
11781                    } else {
11782                        unreachable!()
11783                    }
11784                }
11785                ordinal => panic!("unexpected ordinal {:?}", ordinal),
11786            }
11787            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
11788                return Err(fidl::Error::InvalidNumBytesInEnvelope);
11789            }
11790            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11791                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11792            }
11793            Ok(())
11794        }
11795    }
11796
11797    impl fidl::encoding::ValueTypeMarker for InternalCapability {
11798        type Borrowed<'a> = &'a Self;
11799        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11800            value
11801        }
11802    }
11803
11804    unsafe impl fidl::encoding::TypeMarker for InternalCapability {
11805        type Owned = Self;
11806
11807        #[inline(always)]
11808        fn inline_align(_context: fidl::encoding::Context) -> usize {
11809            8
11810        }
11811
11812        #[inline(always)]
11813        fn inline_size(_context: fidl::encoding::Context) -> usize {
11814            16
11815        }
11816    }
11817
11818    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InternalCapability, D>
11819        for &InternalCapability
11820    {
11821        #[inline]
11822        unsafe fn encode(
11823            self,
11824            encoder: &mut fidl::encoding::Encoder<'_, D>,
11825            offset: usize,
11826            _depth: fidl::encoding::Depth,
11827        ) -> fidl::Result<()> {
11828            encoder.debug_check_bounds::<InternalCapability>(offset);
11829            encoder.write_num::<u64>(self.ordinal(), offset);
11830            match self {
11831                InternalCapability::Config(ref val) => fidl::encoding::encode_in_envelope::<
11832                    fidl::encoding::BoundedString<100>,
11833                    D,
11834                >(
11835                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
11836                        val,
11837                    ),
11838                    encoder,
11839                    offset + 8,
11840                    _depth,
11841                ),
11842                InternalCapability::Dictionary(ref val) => fidl::encoding::encode_in_envelope::<
11843                    fidl::encoding::BoundedString<100>,
11844                    D,
11845                >(
11846                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
11847                        val,
11848                    ),
11849                    encoder,
11850                    offset + 8,
11851                    _depth,
11852                ),
11853                InternalCapability::Directory(ref val) => fidl::encoding::encode_in_envelope::<
11854                    fidl::encoding::BoundedString<100>,
11855                    D,
11856                >(
11857                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
11858                        val,
11859                    ),
11860                    encoder,
11861                    offset + 8,
11862                    _depth,
11863                ),
11864                InternalCapability::EventStream(ref val) => fidl::encoding::encode_in_envelope::<
11865                    fidl::encoding::BoundedString<100>,
11866                    D,
11867                >(
11868                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
11869                        val,
11870                    ),
11871                    encoder,
11872                    offset + 8,
11873                    _depth,
11874                ),
11875                InternalCapability::Protocol(ref val) => fidl::encoding::encode_in_envelope::<
11876                    fidl::encoding::BoundedString<100>,
11877                    D,
11878                >(
11879                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
11880                        val,
11881                    ),
11882                    encoder,
11883                    offset + 8,
11884                    _depth,
11885                ),
11886                InternalCapability::Resolver(ref val) => fidl::encoding::encode_in_envelope::<
11887                    fidl::encoding::BoundedString<100>,
11888                    D,
11889                >(
11890                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
11891                        val,
11892                    ),
11893                    encoder,
11894                    offset + 8,
11895                    _depth,
11896                ),
11897                InternalCapability::Runner(ref val) => fidl::encoding::encode_in_envelope::<
11898                    fidl::encoding::BoundedString<100>,
11899                    D,
11900                >(
11901                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
11902                        val,
11903                    ),
11904                    encoder,
11905                    offset + 8,
11906                    _depth,
11907                ),
11908                InternalCapability::Service(ref val) => fidl::encoding::encode_in_envelope::<
11909                    fidl::encoding::BoundedString<100>,
11910                    D,
11911                >(
11912                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
11913                        val,
11914                    ),
11915                    encoder,
11916                    offset + 8,
11917                    _depth,
11918                ),
11919                InternalCapability::Storage(ref val) => fidl::encoding::encode_in_envelope::<
11920                    fidl::encoding::BoundedString<100>,
11921                    D,
11922                >(
11923                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
11924                        val,
11925                    ),
11926                    encoder,
11927                    offset + 8,
11928                    _depth,
11929                ),
11930            }
11931        }
11932    }
11933
11934    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InternalCapability {
11935        #[inline(always)]
11936        fn new_empty() -> Self {
11937            Self::Config(fidl::new_empty!(fidl::encoding::BoundedString<100>, D))
11938        }
11939
11940        #[inline]
11941        unsafe fn decode(
11942            &mut self,
11943            decoder: &mut fidl::encoding::Decoder<'_, D>,
11944            offset: usize,
11945            mut depth: fidl::encoding::Depth,
11946        ) -> fidl::Result<()> {
11947            decoder.debug_check_bounds::<Self>(offset);
11948            #[allow(unused_variables)]
11949            let next_out_of_line = decoder.next_out_of_line();
11950            let handles_before = decoder.remaining_handles();
11951            let (ordinal, inlined, num_bytes, num_handles) =
11952                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
11953
11954            let member_inline_size = match ordinal {
11955                1 => {
11956                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
11957                        decoder.context,
11958                    )
11959                }
11960                2 => {
11961                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
11962                        decoder.context,
11963                    )
11964                }
11965                3 => {
11966                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
11967                        decoder.context,
11968                    )
11969                }
11970                4 => {
11971                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
11972                        decoder.context,
11973                    )
11974                }
11975                5 => {
11976                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
11977                        decoder.context,
11978                    )
11979                }
11980                6 => {
11981                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
11982                        decoder.context,
11983                    )
11984                }
11985                7 => {
11986                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
11987                        decoder.context,
11988                    )
11989                }
11990                8 => {
11991                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
11992                        decoder.context,
11993                    )
11994                }
11995                9 => {
11996                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
11997                        decoder.context,
11998                    )
11999                }
12000                _ => return Err(fidl::Error::UnknownUnionTag),
12001            };
12002
12003            if inlined != (member_inline_size <= 4) {
12004                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12005            }
12006            let _inner_offset;
12007            if inlined {
12008                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12009                _inner_offset = offset + 8;
12010            } else {
12011                depth.increment()?;
12012                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12013            }
12014            match ordinal {
12015                1 => {
12016                    #[allow(irrefutable_let_patterns)]
12017                    if let InternalCapability::Config(_) = self {
12018                        // Do nothing, read the value into the object
12019                    } else {
12020                        // Initialize `self` to the right variant
12021                        *self = InternalCapability::Config(fidl::new_empty!(
12022                            fidl::encoding::BoundedString<100>,
12023                            D
12024                        ));
12025                    }
12026                    #[allow(irrefutable_let_patterns)]
12027                    if let InternalCapability::Config(ref mut val) = self {
12028                        fidl::decode!(
12029                            fidl::encoding::BoundedString<100>,
12030                            D,
12031                            val,
12032                            decoder,
12033                            _inner_offset,
12034                            depth
12035                        )?;
12036                    } else {
12037                        unreachable!()
12038                    }
12039                }
12040                2 => {
12041                    #[allow(irrefutable_let_patterns)]
12042                    if let InternalCapability::Dictionary(_) = self {
12043                        // Do nothing, read the value into the object
12044                    } else {
12045                        // Initialize `self` to the right variant
12046                        *self = InternalCapability::Dictionary(fidl::new_empty!(
12047                            fidl::encoding::BoundedString<100>,
12048                            D
12049                        ));
12050                    }
12051                    #[allow(irrefutable_let_patterns)]
12052                    if let InternalCapability::Dictionary(ref mut val) = self {
12053                        fidl::decode!(
12054                            fidl::encoding::BoundedString<100>,
12055                            D,
12056                            val,
12057                            decoder,
12058                            _inner_offset,
12059                            depth
12060                        )?;
12061                    } else {
12062                        unreachable!()
12063                    }
12064                }
12065                3 => {
12066                    #[allow(irrefutable_let_patterns)]
12067                    if let InternalCapability::Directory(_) = self {
12068                        // Do nothing, read the value into the object
12069                    } else {
12070                        // Initialize `self` to the right variant
12071                        *self = InternalCapability::Directory(fidl::new_empty!(
12072                            fidl::encoding::BoundedString<100>,
12073                            D
12074                        ));
12075                    }
12076                    #[allow(irrefutable_let_patterns)]
12077                    if let InternalCapability::Directory(ref mut val) = self {
12078                        fidl::decode!(
12079                            fidl::encoding::BoundedString<100>,
12080                            D,
12081                            val,
12082                            decoder,
12083                            _inner_offset,
12084                            depth
12085                        )?;
12086                    } else {
12087                        unreachable!()
12088                    }
12089                }
12090                4 => {
12091                    #[allow(irrefutable_let_patterns)]
12092                    if let InternalCapability::EventStream(_) = self {
12093                        // Do nothing, read the value into the object
12094                    } else {
12095                        // Initialize `self` to the right variant
12096                        *self = InternalCapability::EventStream(fidl::new_empty!(
12097                            fidl::encoding::BoundedString<100>,
12098                            D
12099                        ));
12100                    }
12101                    #[allow(irrefutable_let_patterns)]
12102                    if let InternalCapability::EventStream(ref mut val) = self {
12103                        fidl::decode!(
12104                            fidl::encoding::BoundedString<100>,
12105                            D,
12106                            val,
12107                            decoder,
12108                            _inner_offset,
12109                            depth
12110                        )?;
12111                    } else {
12112                        unreachable!()
12113                    }
12114                }
12115                5 => {
12116                    #[allow(irrefutable_let_patterns)]
12117                    if let InternalCapability::Protocol(_) = self {
12118                        // Do nothing, read the value into the object
12119                    } else {
12120                        // Initialize `self` to the right variant
12121                        *self = InternalCapability::Protocol(fidl::new_empty!(
12122                            fidl::encoding::BoundedString<100>,
12123                            D
12124                        ));
12125                    }
12126                    #[allow(irrefutable_let_patterns)]
12127                    if let InternalCapability::Protocol(ref mut val) = self {
12128                        fidl::decode!(
12129                            fidl::encoding::BoundedString<100>,
12130                            D,
12131                            val,
12132                            decoder,
12133                            _inner_offset,
12134                            depth
12135                        )?;
12136                    } else {
12137                        unreachable!()
12138                    }
12139                }
12140                6 => {
12141                    #[allow(irrefutable_let_patterns)]
12142                    if let InternalCapability::Resolver(_) = self {
12143                        // Do nothing, read the value into the object
12144                    } else {
12145                        // Initialize `self` to the right variant
12146                        *self = InternalCapability::Resolver(fidl::new_empty!(
12147                            fidl::encoding::BoundedString<100>,
12148                            D
12149                        ));
12150                    }
12151                    #[allow(irrefutable_let_patterns)]
12152                    if let InternalCapability::Resolver(ref mut val) = self {
12153                        fidl::decode!(
12154                            fidl::encoding::BoundedString<100>,
12155                            D,
12156                            val,
12157                            decoder,
12158                            _inner_offset,
12159                            depth
12160                        )?;
12161                    } else {
12162                        unreachable!()
12163                    }
12164                }
12165                7 => {
12166                    #[allow(irrefutable_let_patterns)]
12167                    if let InternalCapability::Runner(_) = self {
12168                        // Do nothing, read the value into the object
12169                    } else {
12170                        // Initialize `self` to the right variant
12171                        *self = InternalCapability::Runner(fidl::new_empty!(
12172                            fidl::encoding::BoundedString<100>,
12173                            D
12174                        ));
12175                    }
12176                    #[allow(irrefutable_let_patterns)]
12177                    if let InternalCapability::Runner(ref mut val) = self {
12178                        fidl::decode!(
12179                            fidl::encoding::BoundedString<100>,
12180                            D,
12181                            val,
12182                            decoder,
12183                            _inner_offset,
12184                            depth
12185                        )?;
12186                    } else {
12187                        unreachable!()
12188                    }
12189                }
12190                8 => {
12191                    #[allow(irrefutable_let_patterns)]
12192                    if let InternalCapability::Service(_) = self {
12193                        // Do nothing, read the value into the object
12194                    } else {
12195                        // Initialize `self` to the right variant
12196                        *self = InternalCapability::Service(fidl::new_empty!(
12197                            fidl::encoding::BoundedString<100>,
12198                            D
12199                        ));
12200                    }
12201                    #[allow(irrefutable_let_patterns)]
12202                    if let InternalCapability::Service(ref mut val) = self {
12203                        fidl::decode!(
12204                            fidl::encoding::BoundedString<100>,
12205                            D,
12206                            val,
12207                            decoder,
12208                            _inner_offset,
12209                            depth
12210                        )?;
12211                    } else {
12212                        unreachable!()
12213                    }
12214                }
12215                9 => {
12216                    #[allow(irrefutable_let_patterns)]
12217                    if let InternalCapability::Storage(_) = self {
12218                        // Do nothing, read the value into the object
12219                    } else {
12220                        // Initialize `self` to the right variant
12221                        *self = InternalCapability::Storage(fidl::new_empty!(
12222                            fidl::encoding::BoundedString<100>,
12223                            D
12224                        ));
12225                    }
12226                    #[allow(irrefutable_let_patterns)]
12227                    if let InternalCapability::Storage(ref mut val) = self {
12228                        fidl::decode!(
12229                            fidl::encoding::BoundedString<100>,
12230                            D,
12231                            val,
12232                            decoder,
12233                            _inner_offset,
12234                            depth
12235                        )?;
12236                    } else {
12237                        unreachable!()
12238                    }
12239                }
12240                ordinal => panic!("unexpected ordinal {:?}", ordinal),
12241            }
12242            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12243                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12244            }
12245            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12246                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12247            }
12248            Ok(())
12249        }
12250    }
12251}