fidl_fuchsia_fs_startup__common/
fidl_fuchsia_fs_startup__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/// Compression algorithm specifier.
12#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
13pub enum CompressionAlgorithm {
14    ZstdChunked,
15    Uncompressed,
16    #[doc(hidden)]
17    __SourceBreaking {
18        unknown_ordinal: u32,
19    },
20}
21
22/// Pattern that matches an unknown `CompressionAlgorithm` member.
23#[macro_export]
24macro_rules! CompressionAlgorithmUnknown {
25    () => {
26        _
27    };
28}
29
30impl CompressionAlgorithm {
31    #[inline]
32    pub fn from_primitive(prim: u32) -> Option<Self> {
33        match prim {
34            0 => Some(Self::ZstdChunked),
35            1 => Some(Self::Uncompressed),
36            _ => None,
37        }
38    }
39
40    #[inline]
41    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
42        match prim {
43            0 => Self::ZstdChunked,
44            1 => Self::Uncompressed,
45            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
46        }
47    }
48
49    #[inline]
50    pub fn unknown() -> Self {
51        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
52    }
53
54    #[inline]
55    pub const fn into_primitive(self) -> u32 {
56        match self {
57            Self::ZstdChunked => 0,
58            Self::Uncompressed => 1,
59            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
60        }
61    }
62
63    #[inline]
64    pub fn is_unknown(&self) -> bool {
65        match self {
66            Self::__SourceBreaking { unknown_ordinal: _ } => true,
67            _ => false,
68        }
69    }
70}
71
72/// An optional eviction policy override for pager-backed blobs for blobfs.
73#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
74pub enum EvictionPolicyOverride {
75    /// Don't override the default cache policy.
76    None,
77    /// Override the default cache policy for pager-backed blobs with kNeverEvict.
78    NeverEvict,
79    /// Override the default cache policy for pager-backed blobs with kEvictImmediately.
80    EvictImmediately,
81    #[doc(hidden)]
82    __SourceBreaking { unknown_ordinal: u32 },
83}
84
85/// Pattern that matches an unknown `EvictionPolicyOverride` member.
86#[macro_export]
87macro_rules! EvictionPolicyOverrideUnknown {
88    () => {
89        _
90    };
91}
92
93impl EvictionPolicyOverride {
94    #[inline]
95    pub fn from_primitive(prim: u32) -> Option<Self> {
96        match prim {
97            0 => Some(Self::None),
98            1 => Some(Self::NeverEvict),
99            2 => Some(Self::EvictImmediately),
100            _ => None,
101        }
102    }
103
104    #[inline]
105    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
106        match prim {
107            0 => Self::None,
108            1 => Self::NeverEvict,
109            2 => Self::EvictImmediately,
110            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
111        }
112    }
113
114    #[inline]
115    pub fn unknown() -> Self {
116        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
117    }
118
119    #[inline]
120    pub const fn into_primitive(self) -> u32 {
121        match self {
122            Self::None => 0,
123            Self::NeverEvict => 1,
124            Self::EvictImmediately => 2,
125            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
126        }
127    }
128
129    #[inline]
130    pub fn is_unknown(&self) -> bool {
131        match self {
132            Self::__SourceBreaking { unknown_ordinal: _ } => true,
133            _ => false,
134        }
135    }
136}
137
138#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
139#[repr(C)]
140pub struct VolumeSetLimitRequest {
141    pub bytes: u64,
142}
143
144impl fidl::Persistable for VolumeSetLimitRequest {}
145
146#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
147#[repr(C)]
148pub struct VolumeGetLimitResponse {
149    pub bytes: u64,
150}
151
152impl fidl::Persistable for VolumeGetLimitResponse {}
153
154#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
155pub struct VolumesRemoveRequest {
156    pub name: String,
157}
158
159impl fidl::Persistable for VolumesRemoveRequest {}
160
161#[derive(Clone, Debug, PartialEq)]
162pub struct VolumesGetInfoResponse {
163    pub info: Option<Box<fidl_fuchsia_hardware_block_volume__common::VolumeManagerInfo>>,
164}
165
166impl fidl::Persistable for VolumesGetInfoResponse {}
167
168/// Options for how to format filesystems.
169#[derive(Clone, Debug, Default, PartialEq)]
170pub struct FormatOptions {
171    /// Enable verbose logging.
172    pub verbose: Option<bool>,
173    /// If true, use the deprecated padded merkle tree blobfs format.
174    pub deprecated_padded_blobfs_format: Option<bool>,
175    /// The initial number of inodes to allocate space for. If zero, a default is used. Only
176    /// supported for blobfs.
177    pub num_inodes: Option<u64>,
178    /// The number of fvm slices to preallocate for data when the filesystem is created.
179    pub fvm_data_slices: Option<u32>,
180    /// The number of sectors-per-cluster (for FAT filesystems).
181    pub sectors_per_cluster: Option<u16>,
182    #[doc(hidden)]
183    pub __source_breaking: fidl::marker::SourceBreaking,
184}
185
186impl fidl::Persistable for FormatOptions {}
187
188/// Options for starting a filesystem.
189#[derive(Clone, Debug, Default, PartialEq)]
190pub struct StartOptions {
191    /// Start the filesystem in read-only mode.
192    pub read_only: Option<bool>,
193    /// Enable verbose logging.
194    pub verbose: Option<bool>,
195    /// If true, run fsck after every transaction. This is for testing purposes only - it's very
196    /// slow to run a filesystem like this.
197    pub fsck_after_every_transaction: Option<bool>,
198    /// A compression algorithm specifier for the filesystem to use when storing files (if the
199    /// filesystem supports it). Defaults to ZSTD_CHUNKED.
200    pub write_compression_algorithm: Option<CompressionAlgorithm>,
201    /// An optional compression level for the filesystem to use when storing files (if the
202    /// filesystem and the configured |write_compression_algorithm| supports it). Setting to < 0
203    /// indicates no value (the filesystem chooses a default if necessary).
204    pub write_compression_level: Option<i32>,
205    /// An optional eviction policy specifier for the filesystem to use for in-memory structures
206    /// (if the filesystem supports it), specifically for pager-backed files.
207    pub cache_eviction_policy_override: Option<EvictionPolicyOverride>,
208    /// Use profiling for the first N seconds after filesystem start. Records the access patterns
209    /// of objects for N seconds and if the profile already exists, prefetch data and hold the vmos
210    /// in cache for N seconds. Functionally this means that the first launch with this option
211    /// records the profile and all other launches with this option will replay that profile.
212    pub startup_profiling_seconds: Option<u32>,
213    /// If true, configures the filesystem to use the hardware's inline encryption engine when
214    /// writing encrypted data. This allows the filesystem to store user-encrypted data without
215    /// being able to read or write the plaintext contents, which enhances security and privacy.
216    /// Requires the block device to support inline encryption and for `barriers_enabled` to be
217    /// true.
218    /// TODO(https://fxbug.dev/393196849): For now, this flag only prevents the filesystem from
219    /// computing checksums. Update this comment when the filesystem actually uses inline
220    /// encryption.
221    pub inline_crypto_enabled: Option<bool>,
222    /// Configures the filesystem to use barriers instead of checksums to ensure consistency. If
223    /// set, barriers will be used to enforce proper ordering of data and metadata writes, which
224    /// is otherwise provided by computing and verifying data checksums.  Requires filesystem
225    /// support; at the time of writing, only Fxfs uses this argument.
226    /// Must be set to true if `inline_crypto_enabled` is true.
227    pub barriers_enabled: Option<bool>,
228    /// Only valid for GPT.
229    /// Configures the GPT to merge the `super` and `userdata` partitions into an overlay partition
230    /// `fxfs` when possible.  The partitions must be physically contiguous.  See
231    /// fuchsia.storage.partitions.OverlayPartition for more details.
232    pub merge_super_and_userdata: Option<bool>,
233    #[doc(hidden)]
234    pub __source_breaking: fidl::marker::SourceBreaking,
235}
236
237impl fidl::Persistable for StartOptions {}
238
239#[derive(Clone, Debug, Default, PartialEq)]
240pub struct VolumeInfo {
241    pub guid: Option<[u8; 16]>,
242    #[doc(hidden)]
243    pub __source_breaking: fidl::marker::SourceBreaking,
244}
245
246impl fidl::Persistable for VolumeInfo {}
247
248pub mod startup_ordinals {
249    pub const START: u64 = 0x317aa9458d3190c8;
250    pub const FORMAT: u64 = 0x3124676dd91933de;
251    pub const CHECK: u64 = 0x81e85b3190e7db3;
252}
253
254pub mod volume_ordinals {
255    pub const MOUNT: u64 = 0x3470ab56d455af0;
256    pub const CHECK: u64 = 0x5b638348f5e0418c;
257    pub const SET_LIMIT: u64 = 0x19286d83eb3cd137;
258    pub const GET_LIMIT: u64 = 0xb14e4950939f16;
259    pub const GET_INFO: u64 = 0x481018250e109f53;
260}
261
262pub mod volumes_ordinals {
263    pub const CREATE: u64 = 0x11a55097834b38e8;
264    pub const REMOVE: u64 = 0x70983b9344dc2292;
265    pub const GET_INFO: u64 = 0x50d2962df9a0746e;
266}
267
268mod internal {
269    use super::*;
270    unsafe impl fidl::encoding::TypeMarker for CompressionAlgorithm {
271        type Owned = Self;
272
273        #[inline(always)]
274        fn inline_align(_context: fidl::encoding::Context) -> usize {
275            std::mem::align_of::<u32>()
276        }
277
278        #[inline(always)]
279        fn inline_size(_context: fidl::encoding::Context) -> usize {
280            std::mem::size_of::<u32>()
281        }
282
283        #[inline(always)]
284        fn encode_is_copy() -> bool {
285            false
286        }
287
288        #[inline(always)]
289        fn decode_is_copy() -> bool {
290            false
291        }
292    }
293
294    impl fidl::encoding::ValueTypeMarker for CompressionAlgorithm {
295        type Borrowed<'a> = Self;
296        #[inline(always)]
297        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
298            *value
299        }
300    }
301
302    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
303        for CompressionAlgorithm
304    {
305        #[inline]
306        unsafe fn encode(
307            self,
308            encoder: &mut fidl::encoding::Encoder<'_, D>,
309            offset: usize,
310            _depth: fidl::encoding::Depth,
311        ) -> fidl::Result<()> {
312            encoder.debug_check_bounds::<Self>(offset);
313            encoder.write_num(self.into_primitive(), offset);
314            Ok(())
315        }
316    }
317
318    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CompressionAlgorithm {
319        #[inline(always)]
320        fn new_empty() -> Self {
321            Self::unknown()
322        }
323
324        #[inline]
325        unsafe fn decode(
326            &mut self,
327            decoder: &mut fidl::encoding::Decoder<'_, D>,
328            offset: usize,
329            _depth: fidl::encoding::Depth,
330        ) -> fidl::Result<()> {
331            decoder.debug_check_bounds::<Self>(offset);
332            let prim = decoder.read_num::<u32>(offset);
333
334            *self = Self::from_primitive_allow_unknown(prim);
335            Ok(())
336        }
337    }
338    unsafe impl fidl::encoding::TypeMarker for EvictionPolicyOverride {
339        type Owned = Self;
340
341        #[inline(always)]
342        fn inline_align(_context: fidl::encoding::Context) -> usize {
343            std::mem::align_of::<u32>()
344        }
345
346        #[inline(always)]
347        fn inline_size(_context: fidl::encoding::Context) -> usize {
348            std::mem::size_of::<u32>()
349        }
350
351        #[inline(always)]
352        fn encode_is_copy() -> bool {
353            false
354        }
355
356        #[inline(always)]
357        fn decode_is_copy() -> bool {
358            false
359        }
360    }
361
362    impl fidl::encoding::ValueTypeMarker for EvictionPolicyOverride {
363        type Borrowed<'a> = Self;
364        #[inline(always)]
365        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
366            *value
367        }
368    }
369
370    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
371        for EvictionPolicyOverride
372    {
373        #[inline]
374        unsafe fn encode(
375            self,
376            encoder: &mut fidl::encoding::Encoder<'_, D>,
377            offset: usize,
378            _depth: fidl::encoding::Depth,
379        ) -> fidl::Result<()> {
380            encoder.debug_check_bounds::<Self>(offset);
381            encoder.write_num(self.into_primitive(), offset);
382            Ok(())
383        }
384    }
385
386    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
387        for EvictionPolicyOverride
388    {
389        #[inline(always)]
390        fn new_empty() -> Self {
391            Self::unknown()
392        }
393
394        #[inline]
395        unsafe fn decode(
396            &mut self,
397            decoder: &mut fidl::encoding::Decoder<'_, D>,
398            offset: usize,
399            _depth: fidl::encoding::Depth,
400        ) -> fidl::Result<()> {
401            decoder.debug_check_bounds::<Self>(offset);
402            let prim = decoder.read_num::<u32>(offset);
403
404            *self = Self::from_primitive_allow_unknown(prim);
405            Ok(())
406        }
407    }
408
409    impl fidl::encoding::ValueTypeMarker for VolumeSetLimitRequest {
410        type Borrowed<'a> = &'a Self;
411        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
412            value
413        }
414    }
415
416    unsafe impl fidl::encoding::TypeMarker for VolumeSetLimitRequest {
417        type Owned = Self;
418
419        #[inline(always)]
420        fn inline_align(_context: fidl::encoding::Context) -> usize {
421            8
422        }
423
424        #[inline(always)]
425        fn inline_size(_context: fidl::encoding::Context) -> usize {
426            8
427        }
428        #[inline(always)]
429        fn encode_is_copy() -> bool {
430            true
431        }
432
433        #[inline(always)]
434        fn decode_is_copy() -> bool {
435            true
436        }
437    }
438
439    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeSetLimitRequest, D>
440        for &VolumeSetLimitRequest
441    {
442        #[inline]
443        unsafe fn encode(
444            self,
445            encoder: &mut fidl::encoding::Encoder<'_, D>,
446            offset: usize,
447            _depth: fidl::encoding::Depth,
448        ) -> fidl::Result<()> {
449            encoder.debug_check_bounds::<VolumeSetLimitRequest>(offset);
450            unsafe {
451                // Copy the object into the buffer.
452                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
453                (buf_ptr as *mut VolumeSetLimitRequest)
454                    .write_unaligned((self as *const VolumeSetLimitRequest).read());
455                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
456                // done second because the memcpy will write garbage to these bytes.
457            }
458            Ok(())
459        }
460    }
461    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
462        fidl::encoding::Encode<VolumeSetLimitRequest, D> for (T0,)
463    {
464        #[inline]
465        unsafe fn encode(
466            self,
467            encoder: &mut fidl::encoding::Encoder<'_, D>,
468            offset: usize,
469            depth: fidl::encoding::Depth,
470        ) -> fidl::Result<()> {
471            encoder.debug_check_bounds::<VolumeSetLimitRequest>(offset);
472            // Zero out padding regions. There's no need to apply masks
473            // because the unmasked parts will be overwritten by fields.
474            // Write the fields.
475            self.0.encode(encoder, offset + 0, depth)?;
476            Ok(())
477        }
478    }
479
480    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeSetLimitRequest {
481        #[inline(always)]
482        fn new_empty() -> Self {
483            Self { bytes: fidl::new_empty!(u64, D) }
484        }
485
486        #[inline]
487        unsafe fn decode(
488            &mut self,
489            decoder: &mut fidl::encoding::Decoder<'_, D>,
490            offset: usize,
491            _depth: fidl::encoding::Depth,
492        ) -> fidl::Result<()> {
493            decoder.debug_check_bounds::<Self>(offset);
494            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
495            // Verify that padding bytes are zero.
496            // Copy from the buffer into the object.
497            unsafe {
498                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
499            }
500            Ok(())
501        }
502    }
503
504    impl fidl::encoding::ValueTypeMarker for VolumeGetLimitResponse {
505        type Borrowed<'a> = &'a Self;
506        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
507            value
508        }
509    }
510
511    unsafe impl fidl::encoding::TypeMarker for VolumeGetLimitResponse {
512        type Owned = Self;
513
514        #[inline(always)]
515        fn inline_align(_context: fidl::encoding::Context) -> usize {
516            8
517        }
518
519        #[inline(always)]
520        fn inline_size(_context: fidl::encoding::Context) -> usize {
521            8
522        }
523        #[inline(always)]
524        fn encode_is_copy() -> bool {
525            true
526        }
527
528        #[inline(always)]
529        fn decode_is_copy() -> bool {
530            true
531        }
532    }
533
534    unsafe impl<D: fidl::encoding::ResourceDialect>
535        fidl::encoding::Encode<VolumeGetLimitResponse, D> for &VolumeGetLimitResponse
536    {
537        #[inline]
538        unsafe fn encode(
539            self,
540            encoder: &mut fidl::encoding::Encoder<'_, D>,
541            offset: usize,
542            _depth: fidl::encoding::Depth,
543        ) -> fidl::Result<()> {
544            encoder.debug_check_bounds::<VolumeGetLimitResponse>(offset);
545            unsafe {
546                // Copy the object into the buffer.
547                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
548                (buf_ptr as *mut VolumeGetLimitResponse)
549                    .write_unaligned((self as *const VolumeGetLimitResponse).read());
550                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
551                // done second because the memcpy will write garbage to these bytes.
552            }
553            Ok(())
554        }
555    }
556    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
557        fidl::encoding::Encode<VolumeGetLimitResponse, D> for (T0,)
558    {
559        #[inline]
560        unsafe fn encode(
561            self,
562            encoder: &mut fidl::encoding::Encoder<'_, D>,
563            offset: usize,
564            depth: fidl::encoding::Depth,
565        ) -> fidl::Result<()> {
566            encoder.debug_check_bounds::<VolumeGetLimitResponse>(offset);
567            // Zero out padding regions. There's no need to apply masks
568            // because the unmasked parts will be overwritten by fields.
569            // Write the fields.
570            self.0.encode(encoder, offset + 0, depth)?;
571            Ok(())
572        }
573    }
574
575    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
576        for VolumeGetLimitResponse
577    {
578        #[inline(always)]
579        fn new_empty() -> Self {
580            Self { bytes: fidl::new_empty!(u64, D) }
581        }
582
583        #[inline]
584        unsafe fn decode(
585            &mut self,
586            decoder: &mut fidl::encoding::Decoder<'_, D>,
587            offset: usize,
588            _depth: fidl::encoding::Depth,
589        ) -> fidl::Result<()> {
590            decoder.debug_check_bounds::<Self>(offset);
591            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
592            // Verify that padding bytes are zero.
593            // Copy from the buffer into the object.
594            unsafe {
595                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
596            }
597            Ok(())
598        }
599    }
600
601    impl fidl::encoding::ValueTypeMarker for VolumesRemoveRequest {
602        type Borrowed<'a> = &'a Self;
603        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
604            value
605        }
606    }
607
608    unsafe impl fidl::encoding::TypeMarker for VolumesRemoveRequest {
609        type Owned = Self;
610
611        #[inline(always)]
612        fn inline_align(_context: fidl::encoding::Context) -> usize {
613            8
614        }
615
616        #[inline(always)]
617        fn inline_size(_context: fidl::encoding::Context) -> usize {
618            16
619        }
620    }
621
622    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumesRemoveRequest, D>
623        for &VolumesRemoveRequest
624    {
625        #[inline]
626        unsafe fn encode(
627            self,
628            encoder: &mut fidl::encoding::Encoder<'_, D>,
629            offset: usize,
630            _depth: fidl::encoding::Depth,
631        ) -> fidl::Result<()> {
632            encoder.debug_check_bounds::<VolumesRemoveRequest>(offset);
633            // Delegate to tuple encoding.
634            fidl::encoding::Encode::<VolumesRemoveRequest, D>::encode(
635                (<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
636                    &self.name,
637                ),),
638                encoder,
639                offset,
640                _depth,
641            )
642        }
643    }
644    unsafe impl<
645        D: fidl::encoding::ResourceDialect,
646        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
647    > fidl::encoding::Encode<VolumesRemoveRequest, D> for (T0,)
648    {
649        #[inline]
650        unsafe fn encode(
651            self,
652            encoder: &mut fidl::encoding::Encoder<'_, D>,
653            offset: usize,
654            depth: fidl::encoding::Depth,
655        ) -> fidl::Result<()> {
656            encoder.debug_check_bounds::<VolumesRemoveRequest>(offset);
657            // Zero out padding regions. There's no need to apply masks
658            // because the unmasked parts will be overwritten by fields.
659            // Write the fields.
660            self.0.encode(encoder, offset + 0, depth)?;
661            Ok(())
662        }
663    }
664
665    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumesRemoveRequest {
666        #[inline(always)]
667        fn new_empty() -> Self {
668            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<255>, D) }
669        }
670
671        #[inline]
672        unsafe fn decode(
673            &mut self,
674            decoder: &mut fidl::encoding::Decoder<'_, D>,
675            offset: usize,
676            _depth: fidl::encoding::Depth,
677        ) -> fidl::Result<()> {
678            decoder.debug_check_bounds::<Self>(offset);
679            // Verify that padding bytes are zero.
680            fidl::decode!(
681                fidl::encoding::BoundedString<255>,
682                D,
683                &mut self.name,
684                decoder,
685                offset + 0,
686                _depth
687            )?;
688            Ok(())
689        }
690    }
691
692    impl fidl::encoding::ValueTypeMarker for VolumesGetInfoResponse {
693        type Borrowed<'a> = &'a Self;
694        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
695            value
696        }
697    }
698
699    unsafe impl fidl::encoding::TypeMarker for VolumesGetInfoResponse {
700        type Owned = Self;
701
702        #[inline(always)]
703        fn inline_align(_context: fidl::encoding::Context) -> usize {
704            8
705        }
706
707        #[inline(always)]
708        fn inline_size(_context: fidl::encoding::Context) -> usize {
709            8
710        }
711    }
712
713    unsafe impl<D: fidl::encoding::ResourceDialect>
714        fidl::encoding::Encode<VolumesGetInfoResponse, D> for &VolumesGetInfoResponse
715    {
716        #[inline]
717        unsafe fn encode(
718            self,
719            encoder: &mut fidl::encoding::Encoder<'_, D>,
720            offset: usize,
721            _depth: fidl::encoding::Depth,
722        ) -> fidl::Result<()> {
723            encoder.debug_check_bounds::<VolumesGetInfoResponse>(offset);
724            // Delegate to tuple encoding.
725            fidl::encoding::Encode::<VolumesGetInfoResponse, D>::encode(
726                (<fidl::encoding::Boxed<
727                    fidl_fuchsia_hardware_block_volume__common::VolumeManagerInfo,
728                > as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
729                encoder,
730                offset,
731                _depth,
732            )
733        }
734    }
735    unsafe impl<
736        D: fidl::encoding::ResourceDialect,
737        T0: fidl::encoding::Encode<
738                fidl::encoding::Boxed<
739                    fidl_fuchsia_hardware_block_volume__common::VolumeManagerInfo,
740                >,
741                D,
742            >,
743    > fidl::encoding::Encode<VolumesGetInfoResponse, D> for (T0,)
744    {
745        #[inline]
746        unsafe fn encode(
747            self,
748            encoder: &mut fidl::encoding::Encoder<'_, D>,
749            offset: usize,
750            depth: fidl::encoding::Depth,
751        ) -> fidl::Result<()> {
752            encoder.debug_check_bounds::<VolumesGetInfoResponse>(offset);
753            // Zero out padding regions. There's no need to apply masks
754            // because the unmasked parts will be overwritten by fields.
755            // Write the fields.
756            self.0.encode(encoder, offset + 0, depth)?;
757            Ok(())
758        }
759    }
760
761    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
762        for VolumesGetInfoResponse
763    {
764        #[inline(always)]
765        fn new_empty() -> Self {
766            Self {
767                info: fidl::new_empty!(
768                    fidl::encoding::Boxed<
769                        fidl_fuchsia_hardware_block_volume__common::VolumeManagerInfo,
770                    >,
771                    D
772                ),
773            }
774        }
775
776        #[inline]
777        unsafe fn decode(
778            &mut self,
779            decoder: &mut fidl::encoding::Decoder<'_, D>,
780            offset: usize,
781            _depth: fidl::encoding::Depth,
782        ) -> fidl::Result<()> {
783            decoder.debug_check_bounds::<Self>(offset);
784            // Verify that padding bytes are zero.
785            fidl::decode!(
786                fidl::encoding::Boxed<
787                    fidl_fuchsia_hardware_block_volume__common::VolumeManagerInfo,
788                >,
789                D,
790                &mut self.info,
791                decoder,
792                offset + 0,
793                _depth
794            )?;
795            Ok(())
796        }
797    }
798
799    impl FormatOptions {
800        #[inline(always)]
801        fn max_ordinal_present(&self) -> u64 {
802            if let Some(_) = self.sectors_per_cluster {
803                return 5;
804            }
805            if let Some(_) = self.fvm_data_slices {
806                return 4;
807            }
808            if let Some(_) = self.num_inodes {
809                return 3;
810            }
811            if let Some(_) = self.deprecated_padded_blobfs_format {
812                return 2;
813            }
814            if let Some(_) = self.verbose {
815                return 1;
816            }
817            0
818        }
819    }
820
821    impl fidl::encoding::ValueTypeMarker for FormatOptions {
822        type Borrowed<'a> = &'a Self;
823        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
824            value
825        }
826    }
827
828    unsafe impl fidl::encoding::TypeMarker for FormatOptions {
829        type Owned = Self;
830
831        #[inline(always)]
832        fn inline_align(_context: fidl::encoding::Context) -> usize {
833            8
834        }
835
836        #[inline(always)]
837        fn inline_size(_context: fidl::encoding::Context) -> usize {
838            16
839        }
840    }
841
842    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FormatOptions, D>
843        for &FormatOptions
844    {
845        unsafe fn encode(
846            self,
847            encoder: &mut fidl::encoding::Encoder<'_, D>,
848            offset: usize,
849            mut depth: fidl::encoding::Depth,
850        ) -> fidl::Result<()> {
851            encoder.debug_check_bounds::<FormatOptions>(offset);
852            // Vector header
853            let max_ordinal: u64 = self.max_ordinal_present();
854            encoder.write_num(max_ordinal, offset);
855            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
856            // Calling encoder.out_of_line_offset(0) is not allowed.
857            if max_ordinal == 0 {
858                return Ok(());
859            }
860            depth.increment()?;
861            let envelope_size = 8;
862            let bytes_len = max_ordinal as usize * envelope_size;
863            #[allow(unused_variables)]
864            let offset = encoder.out_of_line_offset(bytes_len);
865            let mut _prev_end_offset: usize = 0;
866            if 1 > max_ordinal {
867                return Ok(());
868            }
869
870            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
871            // are envelope_size bytes.
872            let cur_offset: usize = (1 - 1) * envelope_size;
873
874            // Zero reserved fields.
875            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
876
877            // Safety:
878            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
879            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
880            //   envelope_size bytes, there is always sufficient room.
881            fidl::encoding::encode_in_envelope_optional::<bool, D>(
882                self.verbose.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
883                encoder,
884                offset + cur_offset,
885                depth,
886            )?;
887
888            _prev_end_offset = cur_offset + envelope_size;
889            if 2 > max_ordinal {
890                return Ok(());
891            }
892
893            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
894            // are envelope_size bytes.
895            let cur_offset: usize = (2 - 1) * envelope_size;
896
897            // Zero reserved fields.
898            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
899
900            // Safety:
901            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
902            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
903            //   envelope_size bytes, there is always sufficient room.
904            fidl::encoding::encode_in_envelope_optional::<bool, D>(
905                self.deprecated_padded_blobfs_format
906                    .as_ref()
907                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
908                encoder,
909                offset + cur_offset,
910                depth,
911            )?;
912
913            _prev_end_offset = cur_offset + envelope_size;
914            if 3 > max_ordinal {
915                return Ok(());
916            }
917
918            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
919            // are envelope_size bytes.
920            let cur_offset: usize = (3 - 1) * envelope_size;
921
922            // Zero reserved fields.
923            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
924
925            // Safety:
926            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
927            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
928            //   envelope_size bytes, there is always sufficient room.
929            fidl::encoding::encode_in_envelope_optional::<u64, D>(
930                self.num_inodes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
931                encoder,
932                offset + cur_offset,
933                depth,
934            )?;
935
936            _prev_end_offset = cur_offset + envelope_size;
937            if 4 > max_ordinal {
938                return Ok(());
939            }
940
941            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
942            // are envelope_size bytes.
943            let cur_offset: usize = (4 - 1) * envelope_size;
944
945            // Zero reserved fields.
946            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
947
948            // Safety:
949            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
950            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
951            //   envelope_size bytes, there is always sufficient room.
952            fidl::encoding::encode_in_envelope_optional::<u32, D>(
953                self.fvm_data_slices.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
954                encoder,
955                offset + cur_offset,
956                depth,
957            )?;
958
959            _prev_end_offset = cur_offset + envelope_size;
960            if 5 > max_ordinal {
961                return Ok(());
962            }
963
964            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
965            // are envelope_size bytes.
966            let cur_offset: usize = (5 - 1) * envelope_size;
967
968            // Zero reserved fields.
969            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
970
971            // Safety:
972            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
973            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
974            //   envelope_size bytes, there is always sufficient room.
975            fidl::encoding::encode_in_envelope_optional::<u16, D>(
976                self.sectors_per_cluster
977                    .as_ref()
978                    .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
979                encoder,
980                offset + cur_offset,
981                depth,
982            )?;
983
984            _prev_end_offset = cur_offset + envelope_size;
985
986            Ok(())
987        }
988    }
989
990    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FormatOptions {
991        #[inline(always)]
992        fn new_empty() -> Self {
993            Self::default()
994        }
995
996        unsafe fn decode(
997            &mut self,
998            decoder: &mut fidl::encoding::Decoder<'_, D>,
999            offset: usize,
1000            mut depth: fidl::encoding::Depth,
1001        ) -> fidl::Result<()> {
1002            decoder.debug_check_bounds::<Self>(offset);
1003            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1004                None => return Err(fidl::Error::NotNullable),
1005                Some(len) => len,
1006            };
1007            // Calling decoder.out_of_line_offset(0) is not allowed.
1008            if len == 0 {
1009                return Ok(());
1010            };
1011            depth.increment()?;
1012            let envelope_size = 8;
1013            let bytes_len = len * envelope_size;
1014            let offset = decoder.out_of_line_offset(bytes_len)?;
1015            // Decode the envelope for each type.
1016            let mut _next_ordinal_to_read = 0;
1017            let mut next_offset = offset;
1018            let end_offset = offset + bytes_len;
1019            _next_ordinal_to_read += 1;
1020            if next_offset >= end_offset {
1021                return Ok(());
1022            }
1023
1024            // Decode unknown envelopes for gaps in ordinals.
1025            while _next_ordinal_to_read < 1 {
1026                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1027                _next_ordinal_to_read += 1;
1028                next_offset += envelope_size;
1029            }
1030
1031            let next_out_of_line = decoder.next_out_of_line();
1032            let handles_before = decoder.remaining_handles();
1033            if let Some((inlined, num_bytes, num_handles)) =
1034                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1035            {
1036                let member_inline_size =
1037                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1038                if inlined != (member_inline_size <= 4) {
1039                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1040                }
1041                let inner_offset;
1042                let mut inner_depth = depth.clone();
1043                if inlined {
1044                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1045                    inner_offset = next_offset;
1046                } else {
1047                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1048                    inner_depth.increment()?;
1049                }
1050                let val_ref = self.verbose.get_or_insert_with(|| fidl::new_empty!(bool, D));
1051                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1052                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1053                {
1054                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1055                }
1056                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1057                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1058                }
1059            }
1060
1061            next_offset += envelope_size;
1062            _next_ordinal_to_read += 1;
1063            if next_offset >= end_offset {
1064                return Ok(());
1065            }
1066
1067            // Decode unknown envelopes for gaps in ordinals.
1068            while _next_ordinal_to_read < 2 {
1069                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1070                _next_ordinal_to_read += 1;
1071                next_offset += envelope_size;
1072            }
1073
1074            let next_out_of_line = decoder.next_out_of_line();
1075            let handles_before = decoder.remaining_handles();
1076            if let Some((inlined, num_bytes, num_handles)) =
1077                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1078            {
1079                let member_inline_size =
1080                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1081                if inlined != (member_inline_size <= 4) {
1082                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1083                }
1084                let inner_offset;
1085                let mut inner_depth = depth.clone();
1086                if inlined {
1087                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1088                    inner_offset = next_offset;
1089                } else {
1090                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1091                    inner_depth.increment()?;
1092                }
1093                let val_ref = self
1094                    .deprecated_padded_blobfs_format
1095                    .get_or_insert_with(|| fidl::new_empty!(bool, D));
1096                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1097                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1098                {
1099                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1100                }
1101                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1102                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1103                }
1104            }
1105
1106            next_offset += envelope_size;
1107            _next_ordinal_to_read += 1;
1108            if next_offset >= end_offset {
1109                return Ok(());
1110            }
1111
1112            // Decode unknown envelopes for gaps in ordinals.
1113            while _next_ordinal_to_read < 3 {
1114                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1115                _next_ordinal_to_read += 1;
1116                next_offset += envelope_size;
1117            }
1118
1119            let next_out_of_line = decoder.next_out_of_line();
1120            let handles_before = decoder.remaining_handles();
1121            if let Some((inlined, num_bytes, num_handles)) =
1122                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1123            {
1124                let member_inline_size =
1125                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1126                if inlined != (member_inline_size <= 4) {
1127                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1128                }
1129                let inner_offset;
1130                let mut inner_depth = depth.clone();
1131                if inlined {
1132                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1133                    inner_offset = next_offset;
1134                } else {
1135                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1136                    inner_depth.increment()?;
1137                }
1138                let val_ref = self.num_inodes.get_or_insert_with(|| fidl::new_empty!(u64, D));
1139                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
1140                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1141                {
1142                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1143                }
1144                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1145                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1146                }
1147            }
1148
1149            next_offset += envelope_size;
1150            _next_ordinal_to_read += 1;
1151            if next_offset >= end_offset {
1152                return Ok(());
1153            }
1154
1155            // Decode unknown envelopes for gaps in ordinals.
1156            while _next_ordinal_to_read < 4 {
1157                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1158                _next_ordinal_to_read += 1;
1159                next_offset += envelope_size;
1160            }
1161
1162            let next_out_of_line = decoder.next_out_of_line();
1163            let handles_before = decoder.remaining_handles();
1164            if let Some((inlined, num_bytes, num_handles)) =
1165                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1166            {
1167                let member_inline_size =
1168                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1169                if inlined != (member_inline_size <= 4) {
1170                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1171                }
1172                let inner_offset;
1173                let mut inner_depth = depth.clone();
1174                if inlined {
1175                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1176                    inner_offset = next_offset;
1177                } else {
1178                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1179                    inner_depth.increment()?;
1180                }
1181                let val_ref = self.fvm_data_slices.get_or_insert_with(|| fidl::new_empty!(u32, D));
1182                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
1183                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1184                {
1185                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1186                }
1187                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1188                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1189                }
1190            }
1191
1192            next_offset += envelope_size;
1193            _next_ordinal_to_read += 1;
1194            if next_offset >= end_offset {
1195                return Ok(());
1196            }
1197
1198            // Decode unknown envelopes for gaps in ordinals.
1199            while _next_ordinal_to_read < 5 {
1200                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1201                _next_ordinal_to_read += 1;
1202                next_offset += envelope_size;
1203            }
1204
1205            let next_out_of_line = decoder.next_out_of_line();
1206            let handles_before = decoder.remaining_handles();
1207            if let Some((inlined, num_bytes, num_handles)) =
1208                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1209            {
1210                let member_inline_size =
1211                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1212                if inlined != (member_inline_size <= 4) {
1213                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1214                }
1215                let inner_offset;
1216                let mut inner_depth = depth.clone();
1217                if inlined {
1218                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1219                    inner_offset = next_offset;
1220                } else {
1221                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1222                    inner_depth.increment()?;
1223                }
1224                let val_ref =
1225                    self.sectors_per_cluster.get_or_insert_with(|| fidl::new_empty!(u16, D));
1226                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
1227                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1228                {
1229                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1230                }
1231                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1232                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1233                }
1234            }
1235
1236            next_offset += envelope_size;
1237
1238            // Decode the remaining unknown envelopes.
1239            while next_offset < end_offset {
1240                _next_ordinal_to_read += 1;
1241                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1242                next_offset += envelope_size;
1243            }
1244
1245            Ok(())
1246        }
1247    }
1248
1249    impl StartOptions {
1250        #[inline(always)]
1251        fn max_ordinal_present(&self) -> u64 {
1252            if let Some(_) = self.merge_super_and_userdata {
1253                return 10;
1254            }
1255            if let Some(_) = self.barriers_enabled {
1256                return 9;
1257            }
1258            if let Some(_) = self.inline_crypto_enabled {
1259                return 8;
1260            }
1261            if let Some(_) = self.startup_profiling_seconds {
1262                return 7;
1263            }
1264            if let Some(_) = self.cache_eviction_policy_override {
1265                return 6;
1266            }
1267            if let Some(_) = self.write_compression_level {
1268                return 5;
1269            }
1270            if let Some(_) = self.write_compression_algorithm {
1271                return 4;
1272            }
1273            if let Some(_) = self.fsck_after_every_transaction {
1274                return 3;
1275            }
1276            if let Some(_) = self.verbose {
1277                return 2;
1278            }
1279            if let Some(_) = self.read_only {
1280                return 1;
1281            }
1282            0
1283        }
1284    }
1285
1286    impl fidl::encoding::ValueTypeMarker for StartOptions {
1287        type Borrowed<'a> = &'a Self;
1288        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1289            value
1290        }
1291    }
1292
1293    unsafe impl fidl::encoding::TypeMarker for StartOptions {
1294        type Owned = Self;
1295
1296        #[inline(always)]
1297        fn inline_align(_context: fidl::encoding::Context) -> usize {
1298            8
1299        }
1300
1301        #[inline(always)]
1302        fn inline_size(_context: fidl::encoding::Context) -> usize {
1303            16
1304        }
1305    }
1306
1307    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StartOptions, D>
1308        for &StartOptions
1309    {
1310        unsafe fn encode(
1311            self,
1312            encoder: &mut fidl::encoding::Encoder<'_, D>,
1313            offset: usize,
1314            mut depth: fidl::encoding::Depth,
1315        ) -> fidl::Result<()> {
1316            encoder.debug_check_bounds::<StartOptions>(offset);
1317            // Vector header
1318            let max_ordinal: u64 = self.max_ordinal_present();
1319            encoder.write_num(max_ordinal, offset);
1320            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1321            // Calling encoder.out_of_line_offset(0) is not allowed.
1322            if max_ordinal == 0 {
1323                return Ok(());
1324            }
1325            depth.increment()?;
1326            let envelope_size = 8;
1327            let bytes_len = max_ordinal as usize * envelope_size;
1328            #[allow(unused_variables)]
1329            let offset = encoder.out_of_line_offset(bytes_len);
1330            let mut _prev_end_offset: usize = 0;
1331            if 1 > max_ordinal {
1332                return Ok(());
1333            }
1334
1335            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1336            // are envelope_size bytes.
1337            let cur_offset: usize = (1 - 1) * envelope_size;
1338
1339            // Zero reserved fields.
1340            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1341
1342            // Safety:
1343            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1344            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1345            //   envelope_size bytes, there is always sufficient room.
1346            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1347                self.read_only.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1348                encoder,
1349                offset + cur_offset,
1350                depth,
1351            )?;
1352
1353            _prev_end_offset = cur_offset + envelope_size;
1354            if 2 > max_ordinal {
1355                return Ok(());
1356            }
1357
1358            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1359            // are envelope_size bytes.
1360            let cur_offset: usize = (2 - 1) * envelope_size;
1361
1362            // Zero reserved fields.
1363            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1364
1365            // Safety:
1366            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1367            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1368            //   envelope_size bytes, there is always sufficient room.
1369            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1370                self.verbose.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1371                encoder,
1372                offset + cur_offset,
1373                depth,
1374            )?;
1375
1376            _prev_end_offset = cur_offset + envelope_size;
1377            if 3 > max_ordinal {
1378                return Ok(());
1379            }
1380
1381            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1382            // are envelope_size bytes.
1383            let cur_offset: usize = (3 - 1) * envelope_size;
1384
1385            // Zero reserved fields.
1386            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1387
1388            // Safety:
1389            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1390            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1391            //   envelope_size bytes, there is always sufficient room.
1392            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1393                self.fsck_after_every_transaction
1394                    .as_ref()
1395                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1396                encoder,
1397                offset + cur_offset,
1398                depth,
1399            )?;
1400
1401            _prev_end_offset = cur_offset + envelope_size;
1402            if 4 > max_ordinal {
1403                return Ok(());
1404            }
1405
1406            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1407            // are envelope_size bytes.
1408            let cur_offset: usize = (4 - 1) * envelope_size;
1409
1410            // Zero reserved fields.
1411            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1412
1413            // Safety:
1414            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1415            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1416            //   envelope_size bytes, there is always sufficient room.
1417            fidl::encoding::encode_in_envelope_optional::<CompressionAlgorithm, D>(
1418                self.write_compression_algorithm
1419                    .as_ref()
1420                    .map(<CompressionAlgorithm as fidl::encoding::ValueTypeMarker>::borrow),
1421                encoder,
1422                offset + cur_offset,
1423                depth,
1424            )?;
1425
1426            _prev_end_offset = cur_offset + envelope_size;
1427            if 5 > max_ordinal {
1428                return Ok(());
1429            }
1430
1431            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1432            // are envelope_size bytes.
1433            let cur_offset: usize = (5 - 1) * envelope_size;
1434
1435            // Zero reserved fields.
1436            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1437
1438            // Safety:
1439            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1440            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1441            //   envelope_size bytes, there is always sufficient room.
1442            fidl::encoding::encode_in_envelope_optional::<i32, D>(
1443                self.write_compression_level
1444                    .as_ref()
1445                    .map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
1446                encoder,
1447                offset + cur_offset,
1448                depth,
1449            )?;
1450
1451            _prev_end_offset = cur_offset + envelope_size;
1452            if 6 > max_ordinal {
1453                return Ok(());
1454            }
1455
1456            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1457            // are envelope_size bytes.
1458            let cur_offset: usize = (6 - 1) * envelope_size;
1459
1460            // Zero reserved fields.
1461            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1462
1463            // Safety:
1464            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1465            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1466            //   envelope_size bytes, there is always sufficient room.
1467            fidl::encoding::encode_in_envelope_optional::<EvictionPolicyOverride, D>(
1468                self.cache_eviction_policy_override
1469                    .as_ref()
1470                    .map(<EvictionPolicyOverride as fidl::encoding::ValueTypeMarker>::borrow),
1471                encoder,
1472                offset + cur_offset,
1473                depth,
1474            )?;
1475
1476            _prev_end_offset = cur_offset + envelope_size;
1477            if 7 > max_ordinal {
1478                return Ok(());
1479            }
1480
1481            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1482            // are envelope_size bytes.
1483            let cur_offset: usize = (7 - 1) * envelope_size;
1484
1485            // Zero reserved fields.
1486            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1487
1488            // Safety:
1489            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1490            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1491            //   envelope_size bytes, there is always sufficient room.
1492            fidl::encoding::encode_in_envelope_optional::<u32, D>(
1493                self.startup_profiling_seconds
1494                    .as_ref()
1495                    .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
1496                encoder,
1497                offset + cur_offset,
1498                depth,
1499            )?;
1500
1501            _prev_end_offset = cur_offset + envelope_size;
1502            if 8 > max_ordinal {
1503                return Ok(());
1504            }
1505
1506            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1507            // are envelope_size bytes.
1508            let cur_offset: usize = (8 - 1) * envelope_size;
1509
1510            // Zero reserved fields.
1511            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1512
1513            // Safety:
1514            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1515            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1516            //   envelope_size bytes, there is always sufficient room.
1517            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1518                self.inline_crypto_enabled
1519                    .as_ref()
1520                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1521                encoder,
1522                offset + cur_offset,
1523                depth,
1524            )?;
1525
1526            _prev_end_offset = cur_offset + envelope_size;
1527            if 9 > max_ordinal {
1528                return Ok(());
1529            }
1530
1531            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1532            // are envelope_size bytes.
1533            let cur_offset: usize = (9 - 1) * envelope_size;
1534
1535            // Zero reserved fields.
1536            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1537
1538            // Safety:
1539            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1540            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1541            //   envelope_size bytes, there is always sufficient room.
1542            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1543                self.barriers_enabled
1544                    .as_ref()
1545                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1546                encoder,
1547                offset + cur_offset,
1548                depth,
1549            )?;
1550
1551            _prev_end_offset = cur_offset + envelope_size;
1552            if 10 > max_ordinal {
1553                return Ok(());
1554            }
1555
1556            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1557            // are envelope_size bytes.
1558            let cur_offset: usize = (10 - 1) * envelope_size;
1559
1560            // Zero reserved fields.
1561            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1562
1563            // Safety:
1564            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1565            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1566            //   envelope_size bytes, there is always sufficient room.
1567            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1568                self.merge_super_and_userdata
1569                    .as_ref()
1570                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1571                encoder,
1572                offset + cur_offset,
1573                depth,
1574            )?;
1575
1576            _prev_end_offset = cur_offset + envelope_size;
1577
1578            Ok(())
1579        }
1580    }
1581
1582    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StartOptions {
1583        #[inline(always)]
1584        fn new_empty() -> Self {
1585            Self::default()
1586        }
1587
1588        unsafe fn decode(
1589            &mut self,
1590            decoder: &mut fidl::encoding::Decoder<'_, D>,
1591            offset: usize,
1592            mut depth: fidl::encoding::Depth,
1593        ) -> fidl::Result<()> {
1594            decoder.debug_check_bounds::<Self>(offset);
1595            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1596                None => return Err(fidl::Error::NotNullable),
1597                Some(len) => len,
1598            };
1599            // Calling decoder.out_of_line_offset(0) is not allowed.
1600            if len == 0 {
1601                return Ok(());
1602            };
1603            depth.increment()?;
1604            let envelope_size = 8;
1605            let bytes_len = len * envelope_size;
1606            let offset = decoder.out_of_line_offset(bytes_len)?;
1607            // Decode the envelope for each type.
1608            let mut _next_ordinal_to_read = 0;
1609            let mut next_offset = offset;
1610            let end_offset = offset + bytes_len;
1611            _next_ordinal_to_read += 1;
1612            if next_offset >= end_offset {
1613                return Ok(());
1614            }
1615
1616            // Decode unknown envelopes for gaps in ordinals.
1617            while _next_ordinal_to_read < 1 {
1618                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1619                _next_ordinal_to_read += 1;
1620                next_offset += envelope_size;
1621            }
1622
1623            let next_out_of_line = decoder.next_out_of_line();
1624            let handles_before = decoder.remaining_handles();
1625            if let Some((inlined, num_bytes, num_handles)) =
1626                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1627            {
1628                let member_inline_size =
1629                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1630                if inlined != (member_inline_size <= 4) {
1631                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1632                }
1633                let inner_offset;
1634                let mut inner_depth = depth.clone();
1635                if inlined {
1636                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1637                    inner_offset = next_offset;
1638                } else {
1639                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1640                    inner_depth.increment()?;
1641                }
1642                let val_ref = self.read_only.get_or_insert_with(|| fidl::new_empty!(bool, D));
1643                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1644                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1645                {
1646                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1647                }
1648                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1649                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1650                }
1651            }
1652
1653            next_offset += envelope_size;
1654            _next_ordinal_to_read += 1;
1655            if next_offset >= end_offset {
1656                return Ok(());
1657            }
1658
1659            // Decode unknown envelopes for gaps in ordinals.
1660            while _next_ordinal_to_read < 2 {
1661                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1662                _next_ordinal_to_read += 1;
1663                next_offset += envelope_size;
1664            }
1665
1666            let next_out_of_line = decoder.next_out_of_line();
1667            let handles_before = decoder.remaining_handles();
1668            if let Some((inlined, num_bytes, num_handles)) =
1669                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1670            {
1671                let member_inline_size =
1672                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1673                if inlined != (member_inline_size <= 4) {
1674                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1675                }
1676                let inner_offset;
1677                let mut inner_depth = depth.clone();
1678                if inlined {
1679                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1680                    inner_offset = next_offset;
1681                } else {
1682                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1683                    inner_depth.increment()?;
1684                }
1685                let val_ref = self.verbose.get_or_insert_with(|| fidl::new_empty!(bool, D));
1686                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1687                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1688                {
1689                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1690                }
1691                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1692                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1693                }
1694            }
1695
1696            next_offset += envelope_size;
1697            _next_ordinal_to_read += 1;
1698            if next_offset >= end_offset {
1699                return Ok(());
1700            }
1701
1702            // Decode unknown envelopes for gaps in ordinals.
1703            while _next_ordinal_to_read < 3 {
1704                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1705                _next_ordinal_to_read += 1;
1706                next_offset += envelope_size;
1707            }
1708
1709            let next_out_of_line = decoder.next_out_of_line();
1710            let handles_before = decoder.remaining_handles();
1711            if let Some((inlined, num_bytes, num_handles)) =
1712                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1713            {
1714                let member_inline_size =
1715                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1716                if inlined != (member_inline_size <= 4) {
1717                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1718                }
1719                let inner_offset;
1720                let mut inner_depth = depth.clone();
1721                if inlined {
1722                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1723                    inner_offset = next_offset;
1724                } else {
1725                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1726                    inner_depth.increment()?;
1727                }
1728                let val_ref = self
1729                    .fsck_after_every_transaction
1730                    .get_or_insert_with(|| fidl::new_empty!(bool, D));
1731                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1732                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1733                {
1734                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1735                }
1736                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1737                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1738                }
1739            }
1740
1741            next_offset += envelope_size;
1742            _next_ordinal_to_read += 1;
1743            if next_offset >= end_offset {
1744                return Ok(());
1745            }
1746
1747            // Decode unknown envelopes for gaps in ordinals.
1748            while _next_ordinal_to_read < 4 {
1749                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1750                _next_ordinal_to_read += 1;
1751                next_offset += envelope_size;
1752            }
1753
1754            let next_out_of_line = decoder.next_out_of_line();
1755            let handles_before = decoder.remaining_handles();
1756            if let Some((inlined, num_bytes, num_handles)) =
1757                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1758            {
1759                let member_inline_size =
1760                    <CompressionAlgorithm as fidl::encoding::TypeMarker>::inline_size(
1761                        decoder.context,
1762                    );
1763                if inlined != (member_inline_size <= 4) {
1764                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1765                }
1766                let inner_offset;
1767                let mut inner_depth = depth.clone();
1768                if inlined {
1769                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1770                    inner_offset = next_offset;
1771                } else {
1772                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1773                    inner_depth.increment()?;
1774                }
1775                let val_ref = self
1776                    .write_compression_algorithm
1777                    .get_or_insert_with(|| fidl::new_empty!(CompressionAlgorithm, D));
1778                fidl::decode!(
1779                    CompressionAlgorithm,
1780                    D,
1781                    val_ref,
1782                    decoder,
1783                    inner_offset,
1784                    inner_depth
1785                )?;
1786                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1787                {
1788                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1789                }
1790                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1791                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1792                }
1793            }
1794
1795            next_offset += envelope_size;
1796            _next_ordinal_to_read += 1;
1797            if next_offset >= end_offset {
1798                return Ok(());
1799            }
1800
1801            // Decode unknown envelopes for gaps in ordinals.
1802            while _next_ordinal_to_read < 5 {
1803                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1804                _next_ordinal_to_read += 1;
1805                next_offset += envelope_size;
1806            }
1807
1808            let next_out_of_line = decoder.next_out_of_line();
1809            let handles_before = decoder.remaining_handles();
1810            if let Some((inlined, num_bytes, num_handles)) =
1811                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1812            {
1813                let member_inline_size =
1814                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1815                if inlined != (member_inline_size <= 4) {
1816                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1817                }
1818                let inner_offset;
1819                let mut inner_depth = depth.clone();
1820                if inlined {
1821                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1822                    inner_offset = next_offset;
1823                } else {
1824                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1825                    inner_depth.increment()?;
1826                }
1827                let val_ref =
1828                    self.write_compression_level.get_or_insert_with(|| fidl::new_empty!(i32, D));
1829                fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
1830                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1831                {
1832                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1833                }
1834                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1835                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1836                }
1837            }
1838
1839            next_offset += envelope_size;
1840            _next_ordinal_to_read += 1;
1841            if next_offset >= end_offset {
1842                return Ok(());
1843            }
1844
1845            // Decode unknown envelopes for gaps in ordinals.
1846            while _next_ordinal_to_read < 6 {
1847                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1848                _next_ordinal_to_read += 1;
1849                next_offset += envelope_size;
1850            }
1851
1852            let next_out_of_line = decoder.next_out_of_line();
1853            let handles_before = decoder.remaining_handles();
1854            if let Some((inlined, num_bytes, num_handles)) =
1855                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1856            {
1857                let member_inline_size =
1858                    <EvictionPolicyOverride as fidl::encoding::TypeMarker>::inline_size(
1859                        decoder.context,
1860                    );
1861                if inlined != (member_inline_size <= 4) {
1862                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1863                }
1864                let inner_offset;
1865                let mut inner_depth = depth.clone();
1866                if inlined {
1867                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1868                    inner_offset = next_offset;
1869                } else {
1870                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1871                    inner_depth.increment()?;
1872                }
1873                let val_ref = self
1874                    .cache_eviction_policy_override
1875                    .get_or_insert_with(|| fidl::new_empty!(EvictionPolicyOverride, D));
1876                fidl::decode!(
1877                    EvictionPolicyOverride,
1878                    D,
1879                    val_ref,
1880                    decoder,
1881                    inner_offset,
1882                    inner_depth
1883                )?;
1884                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1885                {
1886                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1887                }
1888                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1889                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1890                }
1891            }
1892
1893            next_offset += envelope_size;
1894            _next_ordinal_to_read += 1;
1895            if next_offset >= end_offset {
1896                return Ok(());
1897            }
1898
1899            // Decode unknown envelopes for gaps in ordinals.
1900            while _next_ordinal_to_read < 7 {
1901                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1902                _next_ordinal_to_read += 1;
1903                next_offset += envelope_size;
1904            }
1905
1906            let next_out_of_line = decoder.next_out_of_line();
1907            let handles_before = decoder.remaining_handles();
1908            if let Some((inlined, num_bytes, num_handles)) =
1909                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1910            {
1911                let member_inline_size =
1912                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1913                if inlined != (member_inline_size <= 4) {
1914                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1915                }
1916                let inner_offset;
1917                let mut inner_depth = depth.clone();
1918                if inlined {
1919                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1920                    inner_offset = next_offset;
1921                } else {
1922                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1923                    inner_depth.increment()?;
1924                }
1925                let val_ref =
1926                    self.startup_profiling_seconds.get_or_insert_with(|| fidl::new_empty!(u32, D));
1927                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
1928                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1929                {
1930                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1931                }
1932                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1933                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1934                }
1935            }
1936
1937            next_offset += envelope_size;
1938            _next_ordinal_to_read += 1;
1939            if next_offset >= end_offset {
1940                return Ok(());
1941            }
1942
1943            // Decode unknown envelopes for gaps in ordinals.
1944            while _next_ordinal_to_read < 8 {
1945                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1946                _next_ordinal_to_read += 1;
1947                next_offset += envelope_size;
1948            }
1949
1950            let next_out_of_line = decoder.next_out_of_line();
1951            let handles_before = decoder.remaining_handles();
1952            if let Some((inlined, num_bytes, num_handles)) =
1953                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1954            {
1955                let member_inline_size =
1956                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1957                if inlined != (member_inline_size <= 4) {
1958                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1959                }
1960                let inner_offset;
1961                let mut inner_depth = depth.clone();
1962                if inlined {
1963                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1964                    inner_offset = next_offset;
1965                } else {
1966                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1967                    inner_depth.increment()?;
1968                }
1969                let val_ref =
1970                    self.inline_crypto_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
1971                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1972                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1973                {
1974                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1975                }
1976                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1977                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1978                }
1979            }
1980
1981            next_offset += envelope_size;
1982            _next_ordinal_to_read += 1;
1983            if next_offset >= end_offset {
1984                return Ok(());
1985            }
1986
1987            // Decode unknown envelopes for gaps in ordinals.
1988            while _next_ordinal_to_read < 9 {
1989                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1990                _next_ordinal_to_read += 1;
1991                next_offset += envelope_size;
1992            }
1993
1994            let next_out_of_line = decoder.next_out_of_line();
1995            let handles_before = decoder.remaining_handles();
1996            if let Some((inlined, num_bytes, num_handles)) =
1997                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1998            {
1999                let member_inline_size =
2000                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2001                if inlined != (member_inline_size <= 4) {
2002                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2003                }
2004                let inner_offset;
2005                let mut inner_depth = depth.clone();
2006                if inlined {
2007                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2008                    inner_offset = next_offset;
2009                } else {
2010                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2011                    inner_depth.increment()?;
2012                }
2013                let val_ref =
2014                    self.barriers_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
2015                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2016                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2017                {
2018                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2019                }
2020                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2021                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2022                }
2023            }
2024
2025            next_offset += envelope_size;
2026            _next_ordinal_to_read += 1;
2027            if next_offset >= end_offset {
2028                return Ok(());
2029            }
2030
2031            // Decode unknown envelopes for gaps in ordinals.
2032            while _next_ordinal_to_read < 10 {
2033                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2034                _next_ordinal_to_read += 1;
2035                next_offset += envelope_size;
2036            }
2037
2038            let next_out_of_line = decoder.next_out_of_line();
2039            let handles_before = decoder.remaining_handles();
2040            if let Some((inlined, num_bytes, num_handles)) =
2041                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2042            {
2043                let member_inline_size =
2044                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2045                if inlined != (member_inline_size <= 4) {
2046                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2047                }
2048                let inner_offset;
2049                let mut inner_depth = depth.clone();
2050                if inlined {
2051                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2052                    inner_offset = next_offset;
2053                } else {
2054                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2055                    inner_depth.increment()?;
2056                }
2057                let val_ref =
2058                    self.merge_super_and_userdata.get_or_insert_with(|| fidl::new_empty!(bool, D));
2059                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2060                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2061                {
2062                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2063                }
2064                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2065                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2066                }
2067            }
2068
2069            next_offset += envelope_size;
2070
2071            // Decode the remaining unknown envelopes.
2072            while next_offset < end_offset {
2073                _next_ordinal_to_read += 1;
2074                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2075                next_offset += envelope_size;
2076            }
2077
2078            Ok(())
2079        }
2080    }
2081
2082    impl VolumeInfo {
2083        #[inline(always)]
2084        fn max_ordinal_present(&self) -> u64 {
2085            if let Some(_) = self.guid {
2086                return 1;
2087            }
2088            0
2089        }
2090    }
2091
2092    impl fidl::encoding::ValueTypeMarker for VolumeInfo {
2093        type Borrowed<'a> = &'a Self;
2094        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2095            value
2096        }
2097    }
2098
2099    unsafe impl fidl::encoding::TypeMarker for VolumeInfo {
2100        type Owned = Self;
2101
2102        #[inline(always)]
2103        fn inline_align(_context: fidl::encoding::Context) -> usize {
2104            8
2105        }
2106
2107        #[inline(always)]
2108        fn inline_size(_context: fidl::encoding::Context) -> usize {
2109            16
2110        }
2111    }
2112
2113    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeInfo, D>
2114        for &VolumeInfo
2115    {
2116        unsafe fn encode(
2117            self,
2118            encoder: &mut fidl::encoding::Encoder<'_, D>,
2119            offset: usize,
2120            mut depth: fidl::encoding::Depth,
2121        ) -> fidl::Result<()> {
2122            encoder.debug_check_bounds::<VolumeInfo>(offset);
2123            // Vector header
2124            let max_ordinal: u64 = self.max_ordinal_present();
2125            encoder.write_num(max_ordinal, offset);
2126            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2127            // Calling encoder.out_of_line_offset(0) is not allowed.
2128            if max_ordinal == 0 {
2129                return Ok(());
2130            }
2131            depth.increment()?;
2132            let envelope_size = 8;
2133            let bytes_len = max_ordinal as usize * envelope_size;
2134            #[allow(unused_variables)]
2135            let offset = encoder.out_of_line_offset(bytes_len);
2136            let mut _prev_end_offset: usize = 0;
2137            if 1 > max_ordinal {
2138                return Ok(());
2139            }
2140
2141            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2142            // are envelope_size bytes.
2143            let cur_offset: usize = (1 - 1) * envelope_size;
2144
2145            // Zero reserved fields.
2146            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2147
2148            // Safety:
2149            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2150            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2151            //   envelope_size bytes, there is always sufficient room.
2152            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 16>, D>(
2153                self.guid.as_ref().map(
2154                    <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
2155                ),
2156                encoder,
2157                offset + cur_offset,
2158                depth,
2159            )?;
2160
2161            _prev_end_offset = cur_offset + envelope_size;
2162
2163            Ok(())
2164        }
2165    }
2166
2167    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeInfo {
2168        #[inline(always)]
2169        fn new_empty() -> Self {
2170            Self::default()
2171        }
2172
2173        unsafe fn decode(
2174            &mut self,
2175            decoder: &mut fidl::encoding::Decoder<'_, D>,
2176            offset: usize,
2177            mut depth: fidl::encoding::Depth,
2178        ) -> fidl::Result<()> {
2179            decoder.debug_check_bounds::<Self>(offset);
2180            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2181                None => return Err(fidl::Error::NotNullable),
2182                Some(len) => len,
2183            };
2184            // Calling decoder.out_of_line_offset(0) is not allowed.
2185            if len == 0 {
2186                return Ok(());
2187            };
2188            depth.increment()?;
2189            let envelope_size = 8;
2190            let bytes_len = len * envelope_size;
2191            let offset = decoder.out_of_line_offset(bytes_len)?;
2192            // Decode the envelope for each type.
2193            let mut _next_ordinal_to_read = 0;
2194            let mut next_offset = offset;
2195            let end_offset = offset + bytes_len;
2196            _next_ordinal_to_read += 1;
2197            if next_offset >= end_offset {
2198                return Ok(());
2199            }
2200
2201            // Decode unknown envelopes for gaps in ordinals.
2202            while _next_ordinal_to_read < 1 {
2203                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2204                _next_ordinal_to_read += 1;
2205                next_offset += envelope_size;
2206            }
2207
2208            let next_out_of_line = decoder.next_out_of_line();
2209            let handles_before = decoder.remaining_handles();
2210            if let Some((inlined, num_bytes, num_handles)) =
2211                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2212            {
2213                let member_inline_size =
2214                    <fidl::encoding::Array<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
2215                        decoder.context,
2216                    );
2217                if inlined != (member_inline_size <= 4) {
2218                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2219                }
2220                let inner_offset;
2221                let mut inner_depth = depth.clone();
2222                if inlined {
2223                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2224                    inner_offset = next_offset;
2225                } else {
2226                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2227                    inner_depth.increment()?;
2228                }
2229                let val_ref = self
2230                    .guid
2231                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
2232                fidl::decode!(fidl::encoding::Array<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
2233                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2234                {
2235                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2236                }
2237                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2238                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2239                }
2240            }
2241
2242            next_offset += envelope_size;
2243
2244            // Decode the remaining unknown envelopes.
2245            while next_offset < end_offset {
2246                _next_ordinal_to_read += 1;
2247                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2248                next_offset += envelope_size;
2249            }
2250
2251            Ok(())
2252        }
2253    }
2254}