Skip to main content

fidl_fuchsia_storage_block_common/
fidl_fuchsia_storage_block_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/// Indicates that the partition should be created as inactive, implying that it
12/// will be destroyed on reboot (unless activated by a call to "Activate").
13pub const ALLOCATE_PARTITION_FLAG_INACTIVE: u32 = 1;
14
15pub const GUID_LENGTH: u32 = 16;
16
17/// The maximum amount of data that can be decompressed in a single group of decompression
18/// operations.
19pub const MAX_DECOMPRESSED_BYTES: u64 = 134217728;
20
21/// The maximum number of block offset mappings that can be provided when opening a session.
22/// This limit is arbitrary and can be increased if needed.
23pub const MAX_MAPPINGS: u32 = 4;
24
25/// An arbitrary cap on the number of slices which may be requested when querying
26/// for allocation information from a volume.
27pub const MAX_SLICE_REQUESTS: u32 = 16;
28
29/// The maximum value for a transfer size, identifying that there
30/// effectively exists no maximum for a single operation.
31pub const MAX_TRANSFER_UNBOUNDED: u32 = 4294967295;
32
33/// Multiple block I/O operations may be sent at once before a response is
34/// actually sent back. Block I/O ops may be sent concurrently to different
35/// vmoids, and they also may be sent to different groups at any point in time.
36///
37/// `MAX_TXN_GROUP_COUNT` "groups" are pre-allocated lanes separated on the
38/// block server.  Using a group allows multiple message to be buffered at once
39/// on a single communication channel before receiving a response.
40///
41/// Usage of groups is identified by the `GROUP_ITEM` flag, and is optional.
42///
43/// These groups may be referred to with a "groupid", in the range [0,
44/// `MAX_TXN_GROUP_COUNT`).
45///
46/// The protocol to communicate with a single group is as follows:
47/// 1) SEND [N - 1] messages with an allocated groupid for any value of 1 <= N.
48///    The `GROUP_ITEM` flag is set for these messages.
49/// 2) SEND a final Nth message with the same groupid. The `GROUP_ITEM
50///    | GROUP_LAST` flags are set for this message.
51/// 3) RECEIVE a single response from the Block I/O server after all N requests
52///    have completed. This response is sent once all operations either complete
53///    or a single operation fails. At this point, step (1) may begin again for
54///    the same groupid.
55///
56/// For `READ` and `WRITE`, N may be greater than 1. Otherwise,
57/// N == 1 (skipping step (1) in the protocol above).
58///
59/// Notes:
60/// - groupids may operate on any number of vmoids at once.
61/// - If additional requests are sent on the same groupid before step (3) has
62///   completed, then the additional request will not be processed. If
63///   `GROUP_LAST` is set, an error will be returned. Otherwise, the
64///   request will be silently dropped.
65/// - Messages within a group are not guaranteed to be processed in any order
66///   relative to each other.
67/// - All requests receive responses, except for ones with `GROUP_ITEM`
68///   that do not have `GROUP_LAST` set.
69///
70/// For example, the following is a valid sequence of transactions:
71///
72///   -> (groupid = 1, vmoid = 1, OP = Write | GroupItem,             reqid = 1)
73///   -> (groupid = 1, vmoid = 2, OP = Write | GroupItem,             reqid = 2)
74///   -> (groupid = 2, vmoid = 3, OP = Write | GroupItem | GroupLast, reqid = 0)
75///   <- Response sent to groupid = 2, reqid = 0
76///   -> (groupid = 1, vmoid = 1, OP = Read | GroupItem | GroupLast,  reqid = 3)
77///   <- Response sent to groupid = 1, reqid = 3
78///   -> (groupid = 3, vmoid = 1, OP = Write | GroupItem,             reqid = 4)
79///   -> (groupid = don't care, vmoid = 1, OP = Read, reqid = 5)
80///   <- Response sent to reqid = 5
81///   -> (groupid = 3, vmoid = 1, OP = Read | GroupItem | GroupLast,  reqid = 6)
82///   <- Response sent to groupid = 3, reqid = 6
83///
84/// Each transaction reads or writes up to `length` blocks from the device,
85/// starting at `dev_offset` blocks, into the VMO associated with `vmoid`,
86/// starting at `vmo_offset` blocks.  If the transaction is out of range, for
87/// example if `length` is too large or if `dev_offset` is beyond the end of the
88/// device, `ZX_ERR_OUT_OF_RANGE` is returned.
89pub const MAX_TXN_GROUP_COUNT: u32 = 8;
90
91pub const NAME_LENGTH: u32 = 128;
92
93/// Value reserved for "invalid" VmoId. Will never be allocated by the server,
94/// and may be utilized as a local value for an unallocated ID.
95pub const VMOID_INVALID: u16 = 0;
96
97bitflags! {
98    /// Flags which may be attached to FIFO requests.
99    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
100    pub struct BlockIoFlag: u32 {
101        /// Associate the following request with `group`.
102        const GROUP_ITEM = 1;
103        /// Only respond after this request (and all previous within group) have
104        /// completed. Only valid with `GROUP_ITEM`.
105        const GROUP_LAST = 2;
106        /// Mark this operation as "Force Unit Access" (FUA), indicating that
107        /// it should not complete until the data is written to the non-volatile
108        /// medium (write), and that reads should bypass any on-device caches.
109        const FORCE_ACCESS = 4;
110        /// Attaches a pre-barrier to a request.  This will ensure that no request which was
111        /// executed before this request will be re-ordered to execute after this request.
112        ///
113        /// NOTE: Barriers do NOT guarantee ordering of in-flight requests.  Any request which the
114        /// client has not yet received a response for is considered in-flight, and no guarantees
115        /// are made about relative ordering with this request.  This has important implications for
116        /// grouped requests:  A request in the middle of a group with PRE_BARRIER set will NOT have
117        /// ordering guarantees relative to the other requests in the same group.
118        const PRE_BARRIER = 8;
119        /// If set, the request is to be decompressed.
120        const DECOMPRESS_WITH_ZSTD = 16;
121        /// Use the `slot` and `dun` inline encryption (write) or decryption (read) parameters.
122        /// Can only be used if the underlying hardware supports inline encryption.
123        const INLINE_ENCRYPTION_ENABLED = 32;
124    }
125}
126
127impl BlockIoFlag {}
128
129bitflags! {
130    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
131    pub struct DeviceFlag: u32 {
132        /// All writes to the block device will fail.
133        const READONLY = 1;
134        /// The block device may be removed from the device during operation.
135        const REMOVABLE = 2;
136        /// The device provides trim support.
137        const TRIM_SUPPORT = 8;
138        /// The device provides Force Unit Access (FUA) support.
139        ///
140        /// If this bit is unset, and a request is sent with the FORCE_ACCESS option set, the device
141        /// will simulate a FUA by executing a device flush after the request completes (but before
142        /// responding to the client).  Clients are strongly encouraged to probe for FUA support and
143        /// avoid usage of FORCE_ACCESS without device support, since this is expensive.
144        const FUA_SUPPORT = 16;
145        /// The device provides zstd decompression support.
146        const ZSTD_DECOMPRESSION_SUPPORT = 32;
147        /// The device provides Barrier support.
148        ///
149        /// If this bit is unset, and a request is sent with the PRE_BARRIER option set, the device
150        /// will simulate a barrier by executing a device flush before the request is submitted.
151        /// Clients are strongly encouraged to probe for barrier support and avoid usage of
152        /// PRE_BARRIER without device support, since this is expensive.
153        const BARRIER_SUPPORT = 64;
154    }
155}
156
157impl DeviceFlag {}
158
159/// The opcode used in FIFO requests.
160#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
161#[repr(u8)]
162pub enum BlockOpcode {
163    /// Performs a regular data read or write from the device. The operation may
164    /// be cached internally.
165    Read = 1,
166    Write = 2,
167    /// Write any controller or device cached data to nonvolatile storage.
168    Flush = 3,
169    /// Instructs the device to invalidate a number of blocks, making them  usable
170    /// for storing something else. This is basically a "delete" optimization,
171    /// where the device is in charge of discarding the old content without
172    /// clients having to write a given pattern. The operation may be cached
173    /// internally.
174    Trim = 4,
175    /// Detaches the VMO from the block device.
176    CloseVmo = 5,
177}
178
179impl BlockOpcode {
180    #[inline]
181    pub fn from_primitive(prim: u8) -> Option<Self> {
182        match prim {
183            1 => Some(Self::Read),
184            2 => Some(Self::Write),
185            3 => Some(Self::Flush),
186            4 => Some(Self::Trim),
187            5 => Some(Self::CloseVmo),
188            _ => None,
189        }
190    }
191
192    #[inline]
193    pub const fn into_primitive(self) -> u8 {
194        self as u8
195    }
196}
197
198#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
199#[repr(C)]
200pub struct BlockDestroyResponse {
201    pub status: i32,
202}
203
204impl fidl::Persistable for BlockDestroyResponse {}
205
206#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
207#[repr(C)]
208pub struct BlockExtendRequest {
209    pub start_slice: u64,
210    pub slice_count: u64,
211}
212
213impl fidl::Persistable for BlockExtendRequest {}
214
215#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
216#[repr(C)]
217pub struct BlockExtendResponse {
218    pub status: i32,
219}
220
221impl fidl::Persistable for BlockExtendResponse {}
222
223#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
224pub struct BlockGetInstanceGuidResponse {
225    pub status: i32,
226    pub guid: Option<Box<Guid>>,
227}
228
229impl fidl::Persistable for BlockGetInstanceGuidResponse {}
230
231#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
232pub struct BlockGetNameResponse {
233    pub status: i32,
234    pub name: Option<String>,
235}
236
237impl fidl::Persistable for BlockGetNameResponse {}
238
239#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
240pub struct BlockGetTypeGuidResponse {
241    pub status: i32,
242    pub guid: Option<Box<Guid>>,
243}
244
245impl fidl::Persistable for BlockGetTypeGuidResponse {}
246
247#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
248pub struct BlockGetVolumeInfoResponse {
249    pub status: i32,
250    pub manager: Option<Box<VolumeManagerInfo>>,
251    pub volume: Option<Box<VolumeInfo>>,
252}
253
254impl fidl::Persistable for BlockGetVolumeInfoResponse {}
255
256#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
257pub struct BlockInfo {
258    /// The number of blocks in this block device.
259    pub block_count: u64,
260    /// The size of a single block.
261    pub block_size: u32,
262    /// The maximum size, in bytes, of a transfer.
263    /// Set to MAX_TRANSFER_UNBOUNDED if no such maximum exists.
264    pub max_transfer_size: u32,
265    /// Identifiers about the device.
266    pub flags: DeviceFlag,
267}
268
269impl fidl::Persistable for BlockInfo {}
270
271/// Describes a re-mapping of a block range. The logical offset is implied by its position in the
272/// list passed to [`OpenSessionWithOptions`], which is a logically contiguous list of mappings.
273/// Note that all fields are in *blocks*, not bytes.
274#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
275#[repr(C)]
276pub struct BlockOffsetMapping {
277    pub target_block_offset: u64,
278    pub length: u64,
279}
280
281impl fidl::Persistable for BlockOffsetMapping {}
282
283#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
284pub struct BlockQuerySlicesRequest {
285    pub start_slices: Vec<u64>,
286}
287
288impl fidl::Persistable for BlockQuerySlicesRequest {}
289
290#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
291pub struct BlockQuerySlicesResponse {
292    pub status: i32,
293    pub response: [VsliceRange; 16],
294    pub response_count: u64,
295}
296
297impl fidl::Persistable for BlockQuerySlicesResponse {}
298
299#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
300#[repr(C)]
301pub struct BlockShrinkRequest {
302    pub start_slice: u64,
303    pub slice_count: u64,
304}
305
306impl fidl::Persistable for BlockShrinkRequest {}
307
308#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
309#[repr(C)]
310pub struct BlockShrinkResponse {
311    pub status: i32,
312}
313
314impl fidl::Persistable for BlockShrinkResponse {}
315
316#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
317pub struct BlockGetInfoResponse {
318    pub info: BlockInfo,
319}
320
321impl fidl::Persistable for BlockGetInfoResponse {}
322
323/// A Globally Unique IDentifier, which may be utilized to identify
324/// a partition.
325#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
326#[repr(C)]
327pub struct Guid {
328    pub value: [u8; 16],
329}
330
331impl fidl::Persistable for Guid {}
332
333#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
334#[repr(C)]
335pub struct SessionAttachVmoResponse {
336    pub vmoid: VmoId,
337}
338
339impl fidl::Persistable for SessionAttachVmoResponse {}
340
341#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
342#[repr(C)]
343pub struct VmoId {
344    pub id: u16,
345}
346
347impl fidl::Persistable for VmoId {}
348
349#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
350#[repr(C)]
351pub struct VolumeInfo {
352    /// Number of slices allocated to the volume.
353    pub partition_slice_count: u64,
354    /// Limit on the maximum slices assigned to this partition, if there is one. If the size of the
355    /// partition is not limited, this value will be 0. Partitions can grow into free slices
356    /// available in the volume manager as long as their slices are less than or equal to this
357    /// value.
358    ///
359    /// The partition may be larger than this limit if a smaller limit was applied after the
360    /// partition had already grown to the current size.
361    ///
362    /// See `VolumeManager.GetPartitionLimit()`
363    pub slice_limit: u64,
364}
365
366impl fidl::Persistable for VolumeInfo {}
367
368#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
369#[repr(C)]
370pub struct VolumeManagerActivateRequest {
371    pub old_guid: Guid,
372    pub new_guid: Guid,
373}
374
375impl fidl::Persistable for VolumeManagerActivateRequest {}
376
377#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
378#[repr(C)]
379pub struct VolumeManagerActivateResponse {
380    pub status: i32,
381}
382
383impl fidl::Persistable for VolumeManagerActivateResponse {}
384
385#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
386pub struct VolumeManagerAllocatePartitionRequest {
387    pub slice_count: u64,
388    pub type_: Guid,
389    pub instance: Guid,
390    pub name: String,
391    pub flags: u32,
392}
393
394impl fidl::Persistable for VolumeManagerAllocatePartitionRequest {}
395
396#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
397#[repr(C)]
398pub struct VolumeManagerAllocatePartitionResponse {
399    pub status: i32,
400}
401
402impl fidl::Persistable for VolumeManagerAllocatePartitionResponse {}
403
404#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
405pub struct VolumeManagerGetInfoResponse {
406    pub status: i32,
407    pub info: Option<Box<VolumeManagerInfo>>,
408}
409
410impl fidl::Persistable for VolumeManagerGetInfoResponse {}
411
412#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
413#[repr(C)]
414pub struct VolumeManagerGetPartitionLimitRequest {
415    pub guid: Guid,
416}
417
418impl fidl::Persistable for VolumeManagerGetPartitionLimitRequest {}
419
420#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
421#[repr(C)]
422pub struct VolumeManagerGetPartitionLimitResponse {
423    pub status: i32,
424    pub slice_count: u64,
425}
426
427impl fidl::Persistable for VolumeManagerGetPartitionLimitResponse {}
428
429/// VolumeManagerInfo describes the properties of the volume manager and not each individual volume.
430#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
431#[repr(C)]
432pub struct VolumeManagerInfo {
433    /// Size of a single slice, in bytes.
434    pub slice_size: u64,
435    /// Number of slices the volume manager is able use right now. This counts the
436    /// allocated_slice_count plus the number of available slices.
437    pub slice_count: u64,
438    /// Number of slices currently assigned to partitions.
439    pub assigned_slice_count: u64,
440    /// The maximum capacity which the Volume Manager could grow to utilize if the partition
441    /// containing the Volume Manager itself expands (i.e., the Volume Manager is initialized on a
442    /// GPT partition that has extended beyond the originally allocated capacity). This value is
443    /// the number of entries reserved in the volume manager header and is not related to the size
444    /// of the physical device (which may be larger or smaller).
445    pub maximum_slice_count: u64,
446    /// Largest value that can be used for a virtual slice number.
447    pub max_virtual_slice: u64,
448}
449
450impl fidl::Persistable for VolumeManagerInfo {}
451
452#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
453#[repr(C)]
454pub struct VolumeManagerSetPartitionLimitRequest {
455    pub guid: Guid,
456    pub slice_count: u64,
457}
458
459impl fidl::Persistable for VolumeManagerSetPartitionLimitRequest {}
460
461#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
462#[repr(C)]
463pub struct VolumeManagerSetPartitionLimitResponse {
464    pub status: i32,
465}
466
467impl fidl::Persistable for VolumeManagerSetPartitionLimitResponse {}
468
469#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
470pub struct VolumeManagerSetPartitionNameRequest {
471    pub guid: Guid,
472    pub name: String,
473}
474
475impl fidl::Persistable for VolumeManagerSetPartitionNameRequest {}
476
477/// VsliceRange describes a range of virtual slices: start, length, and allocated status.
478///
479/// These ranges are returned in an ordered container, which implicitly describes the
480/// starting offset, starting from the "index zero" slice.
481#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
482pub struct VsliceRange {
483    /// True if the virtual slices are allocated, false otherwise.
484    pub allocated: bool,
485    /// The number of contiguous virtual slices.
486    pub count: u64,
487}
488
489impl fidl::Persistable for VsliceRange {}
490
491/// Metadata describing a partition.
492#[derive(Clone, Debug, Default, PartialEq)]
493pub struct PartitionInfo {
494    pub name: Option<String>,
495    pub type_guid: Option<Guid>,
496    pub instance_guid: Option<Guid>,
497    /// start_block_offset will be absent if the partition is a composite of multiple physical
498    /// partitions.  See fuchsia.storage.partitions.OverlayPartition.
499    pub start_block_offset: Option<u64>,
500    /// num_blocks will be absent if the partition is a volume, which is dynamically sized and can
501    /// grow via fuchsia.storage.block.Block/Extend.  To get the current size, use
502    /// fuchsia.storage.block.Block/GetVolumeInfo.
503    pub num_blocks: Option<u64>,
504    /// The partition table entry flags (for example, in a GPT partition, the GPT partition table
505    /// entry flags).  Note that this is distinct from the device flags returned in BlockInfo.  This
506    /// field will be absent for composite partitions.
507    pub flags: Option<u64>,
508    #[doc(hidden)]
509    pub __source_breaking: fidl::marker::SourceBreaking,
510}
511
512impl fidl::Persistable for PartitionInfo {}
513
514pub mod block_ordinals {
515    pub const GET_INFO: u64 = 0x58777a4a31cc9a47;
516    pub const OPEN_SESSION: u64 = 0x2ca32f8c64f1d6c8;
517    pub const OPEN_SESSION_WITH_OPTIONS: u64 = 0x1974e5f7b9de6f0c;
518    pub const GET_TYPE_GUID: u64 = 0xefe4e41dafce4cc;
519    pub const GET_INSTANCE_GUID: u64 = 0x2e85011aabeb87fb;
520    pub const GET_NAME: u64 = 0x630be18badedbb05;
521    pub const GET_METADATA: u64 = 0x2c76b02ef9382533;
522    pub const QUERY_SLICES: u64 = 0x289240ac4fbaa190;
523    pub const GET_VOLUME_INFO: u64 = 0x3a7dc69ea5d788d4;
524    pub const EXTEND: u64 = 0x273fb2980ff24157;
525    pub const SHRINK: u64 = 0x73da6de865600a8b;
526    pub const DESTROY: u64 = 0x5866ba764e05a68e;
527}
528
529pub mod session_ordinals {
530    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
531    pub const GET_FIFO: u64 = 0x7a6c7610912aaa98;
532    pub const ATTACH_VMO: u64 = 0x677a0f6fd1a370b2;
533}
534
535pub mod volume_manager_ordinals {
536    pub const ALLOCATE_PARTITION: u64 = 0x5db528bfc287b696;
537    pub const GET_INFO: u64 = 0x2611214dcca5b064;
538    pub const ACTIVATE: u64 = 0x182238d40c275be;
539    pub const GET_PARTITION_LIMIT: u64 = 0x5bc9d21ea8bd52db;
540    pub const SET_PARTITION_LIMIT: u64 = 0x3a4903076534c093;
541    pub const SET_PARTITION_NAME: u64 = 0x26afb07b9d70ff1a;
542}
543
544mod internal {
545    use super::*;
546    unsafe impl fidl::encoding::TypeMarker for BlockIoFlag {
547        type Owned = Self;
548
549        #[inline(always)]
550        fn inline_align(_context: fidl::encoding::Context) -> usize {
551            4
552        }
553
554        #[inline(always)]
555        fn inline_size(_context: fidl::encoding::Context) -> usize {
556            4
557        }
558    }
559
560    impl fidl::encoding::ValueTypeMarker for BlockIoFlag {
561        type Borrowed<'a> = Self;
562        #[inline(always)]
563        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
564            *value
565        }
566    }
567
568    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for BlockIoFlag {
569        #[inline]
570        unsafe fn encode(
571            self,
572            encoder: &mut fidl::encoding::Encoder<'_, D>,
573            offset: usize,
574            _depth: fidl::encoding::Depth,
575        ) -> fidl::Result<()> {
576            encoder.debug_check_bounds::<Self>(offset);
577            if self.bits() & Self::all().bits() != self.bits() {
578                return Err(fidl::Error::InvalidBitsValue);
579            }
580            encoder.write_num(self.bits(), offset);
581            Ok(())
582        }
583    }
584
585    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlockIoFlag {
586        #[inline(always)]
587        fn new_empty() -> Self {
588            Self::empty()
589        }
590
591        #[inline]
592        unsafe fn decode(
593            &mut self,
594            decoder: &mut fidl::encoding::Decoder<'_, D>,
595            offset: usize,
596            _depth: fidl::encoding::Depth,
597        ) -> fidl::Result<()> {
598            decoder.debug_check_bounds::<Self>(offset);
599            let prim = decoder.read_num::<u32>(offset);
600            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
601            Ok(())
602        }
603    }
604    unsafe impl fidl::encoding::TypeMarker for DeviceFlag {
605        type Owned = Self;
606
607        #[inline(always)]
608        fn inline_align(_context: fidl::encoding::Context) -> usize {
609            4
610        }
611
612        #[inline(always)]
613        fn inline_size(_context: fidl::encoding::Context) -> usize {
614            4
615        }
616    }
617
618    impl fidl::encoding::ValueTypeMarker for DeviceFlag {
619        type Borrowed<'a> = Self;
620        #[inline(always)]
621        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
622            *value
623        }
624    }
625
626    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DeviceFlag {
627        #[inline]
628        unsafe fn encode(
629            self,
630            encoder: &mut fidl::encoding::Encoder<'_, D>,
631            offset: usize,
632            _depth: fidl::encoding::Depth,
633        ) -> fidl::Result<()> {
634            encoder.debug_check_bounds::<Self>(offset);
635            if self.bits() & Self::all().bits() != self.bits() {
636                return Err(fidl::Error::InvalidBitsValue);
637            }
638            encoder.write_num(self.bits(), offset);
639            Ok(())
640        }
641    }
642
643    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceFlag {
644        #[inline(always)]
645        fn new_empty() -> Self {
646            Self::empty()
647        }
648
649        #[inline]
650        unsafe fn decode(
651            &mut self,
652            decoder: &mut fidl::encoding::Decoder<'_, D>,
653            offset: usize,
654            _depth: fidl::encoding::Depth,
655        ) -> fidl::Result<()> {
656            decoder.debug_check_bounds::<Self>(offset);
657            let prim = decoder.read_num::<u32>(offset);
658            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
659            Ok(())
660        }
661    }
662    unsafe impl fidl::encoding::TypeMarker for BlockOpcode {
663        type Owned = Self;
664
665        #[inline(always)]
666        fn inline_align(_context: fidl::encoding::Context) -> usize {
667            std::mem::align_of::<u8>()
668        }
669
670        #[inline(always)]
671        fn inline_size(_context: fidl::encoding::Context) -> usize {
672            std::mem::size_of::<u8>()
673        }
674
675        #[inline(always)]
676        fn encode_is_copy() -> bool {
677            true
678        }
679
680        #[inline(always)]
681        fn decode_is_copy() -> bool {
682            false
683        }
684    }
685
686    impl fidl::encoding::ValueTypeMarker for BlockOpcode {
687        type Borrowed<'a> = Self;
688        #[inline(always)]
689        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
690            *value
691        }
692    }
693
694    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for BlockOpcode {
695        #[inline]
696        unsafe fn encode(
697            self,
698            encoder: &mut fidl::encoding::Encoder<'_, D>,
699            offset: usize,
700            _depth: fidl::encoding::Depth,
701        ) -> fidl::Result<()> {
702            encoder.debug_check_bounds::<Self>(offset);
703            encoder.write_num(self.into_primitive(), offset);
704            Ok(())
705        }
706    }
707
708    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlockOpcode {
709        #[inline(always)]
710        fn new_empty() -> Self {
711            Self::Read
712        }
713
714        #[inline]
715        unsafe fn decode(
716            &mut self,
717            decoder: &mut fidl::encoding::Decoder<'_, D>,
718            offset: usize,
719            _depth: fidl::encoding::Depth,
720        ) -> fidl::Result<()> {
721            decoder.debug_check_bounds::<Self>(offset);
722            let prim = decoder.read_num::<u8>(offset);
723
724            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
725            Ok(())
726        }
727    }
728
729    impl fidl::encoding::ValueTypeMarker for BlockDestroyResponse {
730        type Borrowed<'a> = &'a Self;
731        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
732            value
733        }
734    }
735
736    unsafe impl fidl::encoding::TypeMarker for BlockDestroyResponse {
737        type Owned = Self;
738
739        #[inline(always)]
740        fn inline_align(_context: fidl::encoding::Context) -> usize {
741            4
742        }
743
744        #[inline(always)]
745        fn inline_size(_context: fidl::encoding::Context) -> usize {
746            4
747        }
748        #[inline(always)]
749        fn encode_is_copy() -> bool {
750            true
751        }
752
753        #[inline(always)]
754        fn decode_is_copy() -> bool {
755            true
756        }
757    }
758
759    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BlockDestroyResponse, D>
760        for &BlockDestroyResponse
761    {
762        #[inline]
763        unsafe fn encode(
764            self,
765            encoder: &mut fidl::encoding::Encoder<'_, D>,
766            offset: usize,
767            _depth: fidl::encoding::Depth,
768        ) -> fidl::Result<()> {
769            encoder.debug_check_bounds::<BlockDestroyResponse>(offset);
770            unsafe {
771                // Copy the object into the buffer.
772                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
773                (buf_ptr as *mut BlockDestroyResponse)
774                    .write_unaligned((self as *const BlockDestroyResponse).read());
775                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
776                // done second because the memcpy will write garbage to these bytes.
777            }
778            Ok(())
779        }
780    }
781    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
782        fidl::encoding::Encode<BlockDestroyResponse, D> for (T0,)
783    {
784        #[inline]
785        unsafe fn encode(
786            self,
787            encoder: &mut fidl::encoding::Encoder<'_, D>,
788            offset: usize,
789            depth: fidl::encoding::Depth,
790        ) -> fidl::Result<()> {
791            encoder.debug_check_bounds::<BlockDestroyResponse>(offset);
792            // Zero out padding regions. There's no need to apply masks
793            // because the unmasked parts will be overwritten by fields.
794            // Write the fields.
795            self.0.encode(encoder, offset + 0, depth)?;
796            Ok(())
797        }
798    }
799
800    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlockDestroyResponse {
801        #[inline(always)]
802        fn new_empty() -> Self {
803            Self { status: fidl::new_empty!(i32, D) }
804        }
805
806        #[inline]
807        unsafe fn decode(
808            &mut self,
809            decoder: &mut fidl::encoding::Decoder<'_, D>,
810            offset: usize,
811            _depth: fidl::encoding::Depth,
812        ) -> fidl::Result<()> {
813            decoder.debug_check_bounds::<Self>(offset);
814            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
815            // Verify that padding bytes are zero.
816            // Copy from the buffer into the object.
817            unsafe {
818                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
819            }
820            Ok(())
821        }
822    }
823
824    impl fidl::encoding::ValueTypeMarker for BlockExtendRequest {
825        type Borrowed<'a> = &'a Self;
826        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
827            value
828        }
829    }
830
831    unsafe impl fidl::encoding::TypeMarker for BlockExtendRequest {
832        type Owned = Self;
833
834        #[inline(always)]
835        fn inline_align(_context: fidl::encoding::Context) -> usize {
836            8
837        }
838
839        #[inline(always)]
840        fn inline_size(_context: fidl::encoding::Context) -> usize {
841            16
842        }
843        #[inline(always)]
844        fn encode_is_copy() -> bool {
845            true
846        }
847
848        #[inline(always)]
849        fn decode_is_copy() -> bool {
850            true
851        }
852    }
853
854    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BlockExtendRequest, D>
855        for &BlockExtendRequest
856    {
857        #[inline]
858        unsafe fn encode(
859            self,
860            encoder: &mut fidl::encoding::Encoder<'_, D>,
861            offset: usize,
862            _depth: fidl::encoding::Depth,
863        ) -> fidl::Result<()> {
864            encoder.debug_check_bounds::<BlockExtendRequest>(offset);
865            unsafe {
866                // Copy the object into the buffer.
867                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
868                (buf_ptr as *mut BlockExtendRequest)
869                    .write_unaligned((self as *const BlockExtendRequest).read());
870                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
871                // done second because the memcpy will write garbage to these bytes.
872            }
873            Ok(())
874        }
875    }
876    unsafe impl<
877        D: fidl::encoding::ResourceDialect,
878        T0: fidl::encoding::Encode<u64, D>,
879        T1: fidl::encoding::Encode<u64, D>,
880    > fidl::encoding::Encode<BlockExtendRequest, D> for (T0, T1)
881    {
882        #[inline]
883        unsafe fn encode(
884            self,
885            encoder: &mut fidl::encoding::Encoder<'_, D>,
886            offset: usize,
887            depth: fidl::encoding::Depth,
888        ) -> fidl::Result<()> {
889            encoder.debug_check_bounds::<BlockExtendRequest>(offset);
890            // Zero out padding regions. There's no need to apply masks
891            // because the unmasked parts will be overwritten by fields.
892            // Write the fields.
893            self.0.encode(encoder, offset + 0, depth)?;
894            self.1.encode(encoder, offset + 8, depth)?;
895            Ok(())
896        }
897    }
898
899    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlockExtendRequest {
900        #[inline(always)]
901        fn new_empty() -> Self {
902            Self { start_slice: fidl::new_empty!(u64, D), slice_count: fidl::new_empty!(u64, D) }
903        }
904
905        #[inline]
906        unsafe fn decode(
907            &mut self,
908            decoder: &mut fidl::encoding::Decoder<'_, D>,
909            offset: usize,
910            _depth: fidl::encoding::Depth,
911        ) -> fidl::Result<()> {
912            decoder.debug_check_bounds::<Self>(offset);
913            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
914            // Verify that padding bytes are zero.
915            // Copy from the buffer into the object.
916            unsafe {
917                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
918            }
919            Ok(())
920        }
921    }
922
923    impl fidl::encoding::ValueTypeMarker for BlockExtendResponse {
924        type Borrowed<'a> = &'a Self;
925        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
926            value
927        }
928    }
929
930    unsafe impl fidl::encoding::TypeMarker for BlockExtendResponse {
931        type Owned = Self;
932
933        #[inline(always)]
934        fn inline_align(_context: fidl::encoding::Context) -> usize {
935            4
936        }
937
938        #[inline(always)]
939        fn inline_size(_context: fidl::encoding::Context) -> usize {
940            4
941        }
942        #[inline(always)]
943        fn encode_is_copy() -> bool {
944            true
945        }
946
947        #[inline(always)]
948        fn decode_is_copy() -> bool {
949            true
950        }
951    }
952
953    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BlockExtendResponse, D>
954        for &BlockExtendResponse
955    {
956        #[inline]
957        unsafe fn encode(
958            self,
959            encoder: &mut fidl::encoding::Encoder<'_, D>,
960            offset: usize,
961            _depth: fidl::encoding::Depth,
962        ) -> fidl::Result<()> {
963            encoder.debug_check_bounds::<BlockExtendResponse>(offset);
964            unsafe {
965                // Copy the object into the buffer.
966                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
967                (buf_ptr as *mut BlockExtendResponse)
968                    .write_unaligned((self as *const BlockExtendResponse).read());
969                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
970                // done second because the memcpy will write garbage to these bytes.
971            }
972            Ok(())
973        }
974    }
975    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
976        fidl::encoding::Encode<BlockExtendResponse, D> for (T0,)
977    {
978        #[inline]
979        unsafe fn encode(
980            self,
981            encoder: &mut fidl::encoding::Encoder<'_, D>,
982            offset: usize,
983            depth: fidl::encoding::Depth,
984        ) -> fidl::Result<()> {
985            encoder.debug_check_bounds::<BlockExtendResponse>(offset);
986            // Zero out padding regions. There's no need to apply masks
987            // because the unmasked parts will be overwritten by fields.
988            // Write the fields.
989            self.0.encode(encoder, offset + 0, depth)?;
990            Ok(())
991        }
992    }
993
994    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlockExtendResponse {
995        #[inline(always)]
996        fn new_empty() -> Self {
997            Self { status: fidl::new_empty!(i32, D) }
998        }
999
1000        #[inline]
1001        unsafe fn decode(
1002            &mut self,
1003            decoder: &mut fidl::encoding::Decoder<'_, D>,
1004            offset: usize,
1005            _depth: fidl::encoding::Depth,
1006        ) -> fidl::Result<()> {
1007            decoder.debug_check_bounds::<Self>(offset);
1008            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1009            // Verify that padding bytes are zero.
1010            // Copy from the buffer into the object.
1011            unsafe {
1012                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1013            }
1014            Ok(())
1015        }
1016    }
1017
1018    impl fidl::encoding::ValueTypeMarker for BlockGetInstanceGuidResponse {
1019        type Borrowed<'a> = &'a Self;
1020        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1021            value
1022        }
1023    }
1024
1025    unsafe impl fidl::encoding::TypeMarker for BlockGetInstanceGuidResponse {
1026        type Owned = Self;
1027
1028        #[inline(always)]
1029        fn inline_align(_context: fidl::encoding::Context) -> usize {
1030            8
1031        }
1032
1033        #[inline(always)]
1034        fn inline_size(_context: fidl::encoding::Context) -> usize {
1035            16
1036        }
1037    }
1038
1039    unsafe impl<D: fidl::encoding::ResourceDialect>
1040        fidl::encoding::Encode<BlockGetInstanceGuidResponse, D> for &BlockGetInstanceGuidResponse
1041    {
1042        #[inline]
1043        unsafe fn encode(
1044            self,
1045            encoder: &mut fidl::encoding::Encoder<'_, D>,
1046            offset: usize,
1047            _depth: fidl::encoding::Depth,
1048        ) -> fidl::Result<()> {
1049            encoder.debug_check_bounds::<BlockGetInstanceGuidResponse>(offset);
1050            // Delegate to tuple encoding.
1051            fidl::encoding::Encode::<BlockGetInstanceGuidResponse, D>::encode(
1052                (
1053                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
1054                    <fidl::encoding::Boxed<Guid> as fidl::encoding::ValueTypeMarker>::borrow(
1055                        &self.guid,
1056                    ),
1057                ),
1058                encoder,
1059                offset,
1060                _depth,
1061            )
1062        }
1063    }
1064    unsafe impl<
1065        D: fidl::encoding::ResourceDialect,
1066        T0: fidl::encoding::Encode<i32, D>,
1067        T1: fidl::encoding::Encode<fidl::encoding::Boxed<Guid>, D>,
1068    > fidl::encoding::Encode<BlockGetInstanceGuidResponse, D> for (T0, T1)
1069    {
1070        #[inline]
1071        unsafe fn encode(
1072            self,
1073            encoder: &mut fidl::encoding::Encoder<'_, D>,
1074            offset: usize,
1075            depth: fidl::encoding::Depth,
1076        ) -> fidl::Result<()> {
1077            encoder.debug_check_bounds::<BlockGetInstanceGuidResponse>(offset);
1078            // Zero out padding regions. There's no need to apply masks
1079            // because the unmasked parts will be overwritten by fields.
1080            unsafe {
1081                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1082                (ptr as *mut u64).write_unaligned(0);
1083            }
1084            // Write the fields.
1085            self.0.encode(encoder, offset + 0, depth)?;
1086            self.1.encode(encoder, offset + 8, depth)?;
1087            Ok(())
1088        }
1089    }
1090
1091    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1092        for BlockGetInstanceGuidResponse
1093    {
1094        #[inline(always)]
1095        fn new_empty() -> Self {
1096            Self {
1097                status: fidl::new_empty!(i32, D),
1098                guid: fidl::new_empty!(fidl::encoding::Boxed<Guid>, D),
1099            }
1100        }
1101
1102        #[inline]
1103        unsafe fn decode(
1104            &mut self,
1105            decoder: &mut fidl::encoding::Decoder<'_, D>,
1106            offset: usize,
1107            _depth: fidl::encoding::Depth,
1108        ) -> fidl::Result<()> {
1109            decoder.debug_check_bounds::<Self>(offset);
1110            // Verify that padding bytes are zero.
1111            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1112            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1113            let mask = 0xffffffff00000000u64;
1114            let maskedval = padval & mask;
1115            if maskedval != 0 {
1116                return Err(fidl::Error::NonZeroPadding {
1117                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1118                });
1119            }
1120            fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
1121            fidl::decode!(
1122                fidl::encoding::Boxed<Guid>,
1123                D,
1124                &mut self.guid,
1125                decoder,
1126                offset + 8,
1127                _depth
1128            )?;
1129            Ok(())
1130        }
1131    }
1132
1133    impl fidl::encoding::ValueTypeMarker for BlockGetNameResponse {
1134        type Borrowed<'a> = &'a Self;
1135        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1136            value
1137        }
1138    }
1139
1140    unsafe impl fidl::encoding::TypeMarker for BlockGetNameResponse {
1141        type Owned = Self;
1142
1143        #[inline(always)]
1144        fn inline_align(_context: fidl::encoding::Context) -> usize {
1145            8
1146        }
1147
1148        #[inline(always)]
1149        fn inline_size(_context: fidl::encoding::Context) -> usize {
1150            24
1151        }
1152    }
1153
1154    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BlockGetNameResponse, D>
1155        for &BlockGetNameResponse
1156    {
1157        #[inline]
1158        unsafe fn encode(
1159            self,
1160            encoder: &mut fidl::encoding::Encoder<'_, D>,
1161            offset: usize,
1162            _depth: fidl::encoding::Depth,
1163        ) -> fidl::Result<()> {
1164            encoder.debug_check_bounds::<BlockGetNameResponse>(offset);
1165            // Delegate to tuple encoding.
1166            fidl::encoding::Encode::<BlockGetNameResponse, D>::encode(
1167                (
1168                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
1169                    <fidl::encoding::Optional<fidl::encoding::BoundedString<128>> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
1170                ),
1171                encoder, offset, _depth
1172            )
1173        }
1174    }
1175    unsafe impl<
1176        D: fidl::encoding::ResourceDialect,
1177        T0: fidl::encoding::Encode<i32, D>,
1178        T1: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<128>>, D>,
1179    > fidl::encoding::Encode<BlockGetNameResponse, D> for (T0, T1)
1180    {
1181        #[inline]
1182        unsafe fn encode(
1183            self,
1184            encoder: &mut fidl::encoding::Encoder<'_, D>,
1185            offset: usize,
1186            depth: fidl::encoding::Depth,
1187        ) -> fidl::Result<()> {
1188            encoder.debug_check_bounds::<BlockGetNameResponse>(offset);
1189            // Zero out padding regions. There's no need to apply masks
1190            // because the unmasked parts will be overwritten by fields.
1191            unsafe {
1192                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1193                (ptr as *mut u64).write_unaligned(0);
1194            }
1195            // Write the fields.
1196            self.0.encode(encoder, offset + 0, depth)?;
1197            self.1.encode(encoder, offset + 8, depth)?;
1198            Ok(())
1199        }
1200    }
1201
1202    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlockGetNameResponse {
1203        #[inline(always)]
1204        fn new_empty() -> Self {
1205            Self {
1206                status: fidl::new_empty!(i32, D),
1207                name: fidl::new_empty!(
1208                    fidl::encoding::Optional<fidl::encoding::BoundedString<128>>,
1209                    D
1210                ),
1211            }
1212        }
1213
1214        #[inline]
1215        unsafe fn decode(
1216            &mut self,
1217            decoder: &mut fidl::encoding::Decoder<'_, D>,
1218            offset: usize,
1219            _depth: fidl::encoding::Depth,
1220        ) -> fidl::Result<()> {
1221            decoder.debug_check_bounds::<Self>(offset);
1222            // Verify that padding bytes are zero.
1223            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1224            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1225            let mask = 0xffffffff00000000u64;
1226            let maskedval = padval & mask;
1227            if maskedval != 0 {
1228                return Err(fidl::Error::NonZeroPadding {
1229                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1230                });
1231            }
1232            fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
1233            fidl::decode!(
1234                fidl::encoding::Optional<fidl::encoding::BoundedString<128>>,
1235                D,
1236                &mut self.name,
1237                decoder,
1238                offset + 8,
1239                _depth
1240            )?;
1241            Ok(())
1242        }
1243    }
1244
1245    impl fidl::encoding::ValueTypeMarker for BlockGetTypeGuidResponse {
1246        type Borrowed<'a> = &'a Self;
1247        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1248            value
1249        }
1250    }
1251
1252    unsafe impl fidl::encoding::TypeMarker for BlockGetTypeGuidResponse {
1253        type Owned = Self;
1254
1255        #[inline(always)]
1256        fn inline_align(_context: fidl::encoding::Context) -> usize {
1257            8
1258        }
1259
1260        #[inline(always)]
1261        fn inline_size(_context: fidl::encoding::Context) -> usize {
1262            16
1263        }
1264    }
1265
1266    unsafe impl<D: fidl::encoding::ResourceDialect>
1267        fidl::encoding::Encode<BlockGetTypeGuidResponse, D> for &BlockGetTypeGuidResponse
1268    {
1269        #[inline]
1270        unsafe fn encode(
1271            self,
1272            encoder: &mut fidl::encoding::Encoder<'_, D>,
1273            offset: usize,
1274            _depth: fidl::encoding::Depth,
1275        ) -> fidl::Result<()> {
1276            encoder.debug_check_bounds::<BlockGetTypeGuidResponse>(offset);
1277            // Delegate to tuple encoding.
1278            fidl::encoding::Encode::<BlockGetTypeGuidResponse, D>::encode(
1279                (
1280                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
1281                    <fidl::encoding::Boxed<Guid> as fidl::encoding::ValueTypeMarker>::borrow(
1282                        &self.guid,
1283                    ),
1284                ),
1285                encoder,
1286                offset,
1287                _depth,
1288            )
1289        }
1290    }
1291    unsafe impl<
1292        D: fidl::encoding::ResourceDialect,
1293        T0: fidl::encoding::Encode<i32, D>,
1294        T1: fidl::encoding::Encode<fidl::encoding::Boxed<Guid>, D>,
1295    > fidl::encoding::Encode<BlockGetTypeGuidResponse, D> for (T0, T1)
1296    {
1297        #[inline]
1298        unsafe fn encode(
1299            self,
1300            encoder: &mut fidl::encoding::Encoder<'_, D>,
1301            offset: usize,
1302            depth: fidl::encoding::Depth,
1303        ) -> fidl::Result<()> {
1304            encoder.debug_check_bounds::<BlockGetTypeGuidResponse>(offset);
1305            // Zero out padding regions. There's no need to apply masks
1306            // because the unmasked parts will be overwritten by fields.
1307            unsafe {
1308                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1309                (ptr as *mut u64).write_unaligned(0);
1310            }
1311            // Write the fields.
1312            self.0.encode(encoder, offset + 0, depth)?;
1313            self.1.encode(encoder, offset + 8, depth)?;
1314            Ok(())
1315        }
1316    }
1317
1318    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1319        for BlockGetTypeGuidResponse
1320    {
1321        #[inline(always)]
1322        fn new_empty() -> Self {
1323            Self {
1324                status: fidl::new_empty!(i32, D),
1325                guid: fidl::new_empty!(fidl::encoding::Boxed<Guid>, D),
1326            }
1327        }
1328
1329        #[inline]
1330        unsafe fn decode(
1331            &mut self,
1332            decoder: &mut fidl::encoding::Decoder<'_, D>,
1333            offset: usize,
1334            _depth: fidl::encoding::Depth,
1335        ) -> fidl::Result<()> {
1336            decoder.debug_check_bounds::<Self>(offset);
1337            // Verify that padding bytes are zero.
1338            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1339            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1340            let mask = 0xffffffff00000000u64;
1341            let maskedval = padval & mask;
1342            if maskedval != 0 {
1343                return Err(fidl::Error::NonZeroPadding {
1344                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1345                });
1346            }
1347            fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
1348            fidl::decode!(
1349                fidl::encoding::Boxed<Guid>,
1350                D,
1351                &mut self.guid,
1352                decoder,
1353                offset + 8,
1354                _depth
1355            )?;
1356            Ok(())
1357        }
1358    }
1359
1360    impl fidl::encoding::ValueTypeMarker for BlockGetVolumeInfoResponse {
1361        type Borrowed<'a> = &'a Self;
1362        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1363            value
1364        }
1365    }
1366
1367    unsafe impl fidl::encoding::TypeMarker for BlockGetVolumeInfoResponse {
1368        type Owned = Self;
1369
1370        #[inline(always)]
1371        fn inline_align(_context: fidl::encoding::Context) -> usize {
1372            8
1373        }
1374
1375        #[inline(always)]
1376        fn inline_size(_context: fidl::encoding::Context) -> usize {
1377            24
1378        }
1379    }
1380
1381    unsafe impl<D: fidl::encoding::ResourceDialect>
1382        fidl::encoding::Encode<BlockGetVolumeInfoResponse, D> for &BlockGetVolumeInfoResponse
1383    {
1384        #[inline]
1385        unsafe fn encode(
1386            self,
1387            encoder: &mut fidl::encoding::Encoder<'_, D>,
1388            offset: usize,
1389            _depth: fidl::encoding::Depth,
1390        ) -> fidl::Result<()> {
1391            encoder.debug_check_bounds::<BlockGetVolumeInfoResponse>(offset);
1392            // Delegate to tuple encoding.
1393            fidl::encoding::Encode::<BlockGetVolumeInfoResponse, D>::encode(
1394                (
1395                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
1396                    <fidl::encoding::Boxed<VolumeManagerInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.manager),
1397                    <fidl::encoding::Boxed<VolumeInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.volume),
1398                ),
1399                encoder, offset, _depth
1400            )
1401        }
1402    }
1403    unsafe impl<
1404        D: fidl::encoding::ResourceDialect,
1405        T0: fidl::encoding::Encode<i32, D>,
1406        T1: fidl::encoding::Encode<fidl::encoding::Boxed<VolumeManagerInfo>, D>,
1407        T2: fidl::encoding::Encode<fidl::encoding::Boxed<VolumeInfo>, D>,
1408    > fidl::encoding::Encode<BlockGetVolumeInfoResponse, D> for (T0, T1, T2)
1409    {
1410        #[inline]
1411        unsafe fn encode(
1412            self,
1413            encoder: &mut fidl::encoding::Encoder<'_, D>,
1414            offset: usize,
1415            depth: fidl::encoding::Depth,
1416        ) -> fidl::Result<()> {
1417            encoder.debug_check_bounds::<BlockGetVolumeInfoResponse>(offset);
1418            // Zero out padding regions. There's no need to apply masks
1419            // because the unmasked parts will be overwritten by fields.
1420            unsafe {
1421                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1422                (ptr as *mut u64).write_unaligned(0);
1423            }
1424            // Write the fields.
1425            self.0.encode(encoder, offset + 0, depth)?;
1426            self.1.encode(encoder, offset + 8, depth)?;
1427            self.2.encode(encoder, offset + 16, depth)?;
1428            Ok(())
1429        }
1430    }
1431
1432    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1433        for BlockGetVolumeInfoResponse
1434    {
1435        #[inline(always)]
1436        fn new_empty() -> Self {
1437            Self {
1438                status: fidl::new_empty!(i32, D),
1439                manager: fidl::new_empty!(fidl::encoding::Boxed<VolumeManagerInfo>, D),
1440                volume: fidl::new_empty!(fidl::encoding::Boxed<VolumeInfo>, D),
1441            }
1442        }
1443
1444        #[inline]
1445        unsafe fn decode(
1446            &mut self,
1447            decoder: &mut fidl::encoding::Decoder<'_, D>,
1448            offset: usize,
1449            _depth: fidl::encoding::Depth,
1450        ) -> fidl::Result<()> {
1451            decoder.debug_check_bounds::<Self>(offset);
1452            // Verify that padding bytes are zero.
1453            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1454            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1455            let mask = 0xffffffff00000000u64;
1456            let maskedval = padval & mask;
1457            if maskedval != 0 {
1458                return Err(fidl::Error::NonZeroPadding {
1459                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1460                });
1461            }
1462            fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
1463            fidl::decode!(
1464                fidl::encoding::Boxed<VolumeManagerInfo>,
1465                D,
1466                &mut self.manager,
1467                decoder,
1468                offset + 8,
1469                _depth
1470            )?;
1471            fidl::decode!(
1472                fidl::encoding::Boxed<VolumeInfo>,
1473                D,
1474                &mut self.volume,
1475                decoder,
1476                offset + 16,
1477                _depth
1478            )?;
1479            Ok(())
1480        }
1481    }
1482
1483    impl fidl::encoding::ValueTypeMarker for BlockInfo {
1484        type Borrowed<'a> = &'a Self;
1485        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1486            value
1487        }
1488    }
1489
1490    unsafe impl fidl::encoding::TypeMarker for BlockInfo {
1491        type Owned = Self;
1492
1493        #[inline(always)]
1494        fn inline_align(_context: fidl::encoding::Context) -> usize {
1495            8
1496        }
1497
1498        #[inline(always)]
1499        fn inline_size(_context: fidl::encoding::Context) -> usize {
1500            24
1501        }
1502    }
1503
1504    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BlockInfo, D>
1505        for &BlockInfo
1506    {
1507        #[inline]
1508        unsafe fn encode(
1509            self,
1510            encoder: &mut fidl::encoding::Encoder<'_, D>,
1511            offset: usize,
1512            _depth: fidl::encoding::Depth,
1513        ) -> fidl::Result<()> {
1514            encoder.debug_check_bounds::<BlockInfo>(offset);
1515            // Delegate to tuple encoding.
1516            fidl::encoding::Encode::<BlockInfo, D>::encode(
1517                (
1518                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.block_count),
1519                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.block_size),
1520                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.max_transfer_size),
1521                    <DeviceFlag as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
1522                ),
1523                encoder,
1524                offset,
1525                _depth,
1526            )
1527        }
1528    }
1529    unsafe impl<
1530        D: fidl::encoding::ResourceDialect,
1531        T0: fidl::encoding::Encode<u64, D>,
1532        T1: fidl::encoding::Encode<u32, D>,
1533        T2: fidl::encoding::Encode<u32, D>,
1534        T3: fidl::encoding::Encode<DeviceFlag, D>,
1535    > fidl::encoding::Encode<BlockInfo, D> for (T0, T1, T2, T3)
1536    {
1537        #[inline]
1538        unsafe fn encode(
1539            self,
1540            encoder: &mut fidl::encoding::Encoder<'_, D>,
1541            offset: usize,
1542            depth: fidl::encoding::Depth,
1543        ) -> fidl::Result<()> {
1544            encoder.debug_check_bounds::<BlockInfo>(offset);
1545            // Zero out padding regions. There's no need to apply masks
1546            // because the unmasked parts will be overwritten by fields.
1547            unsafe {
1548                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
1549                (ptr as *mut u64).write_unaligned(0);
1550            }
1551            // Write the fields.
1552            self.0.encode(encoder, offset + 0, depth)?;
1553            self.1.encode(encoder, offset + 8, depth)?;
1554            self.2.encode(encoder, offset + 12, depth)?;
1555            self.3.encode(encoder, offset + 16, depth)?;
1556            Ok(())
1557        }
1558    }
1559
1560    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlockInfo {
1561        #[inline(always)]
1562        fn new_empty() -> Self {
1563            Self {
1564                block_count: fidl::new_empty!(u64, D),
1565                block_size: fidl::new_empty!(u32, D),
1566                max_transfer_size: fidl::new_empty!(u32, D),
1567                flags: fidl::new_empty!(DeviceFlag, D),
1568            }
1569        }
1570
1571        #[inline]
1572        unsafe fn decode(
1573            &mut self,
1574            decoder: &mut fidl::encoding::Decoder<'_, D>,
1575            offset: usize,
1576            _depth: fidl::encoding::Depth,
1577        ) -> fidl::Result<()> {
1578            decoder.debug_check_bounds::<Self>(offset);
1579            // Verify that padding bytes are zero.
1580            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1581            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1582            let mask = 0xffffffff00000000u64;
1583            let maskedval = padval & mask;
1584            if maskedval != 0 {
1585                return Err(fidl::Error::NonZeroPadding {
1586                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1587                });
1588            }
1589            fidl::decode!(u64, D, &mut self.block_count, decoder, offset + 0, _depth)?;
1590            fidl::decode!(u32, D, &mut self.block_size, decoder, offset + 8, _depth)?;
1591            fidl::decode!(u32, D, &mut self.max_transfer_size, decoder, offset + 12, _depth)?;
1592            fidl::decode!(DeviceFlag, D, &mut self.flags, decoder, offset + 16, _depth)?;
1593            Ok(())
1594        }
1595    }
1596
1597    impl fidl::encoding::ValueTypeMarker for BlockOffsetMapping {
1598        type Borrowed<'a> = &'a Self;
1599        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1600            value
1601        }
1602    }
1603
1604    unsafe impl fidl::encoding::TypeMarker for BlockOffsetMapping {
1605        type Owned = Self;
1606
1607        #[inline(always)]
1608        fn inline_align(_context: fidl::encoding::Context) -> usize {
1609            8
1610        }
1611
1612        #[inline(always)]
1613        fn inline_size(_context: fidl::encoding::Context) -> usize {
1614            16
1615        }
1616        #[inline(always)]
1617        fn encode_is_copy() -> bool {
1618            true
1619        }
1620
1621        #[inline(always)]
1622        fn decode_is_copy() -> bool {
1623            true
1624        }
1625    }
1626
1627    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BlockOffsetMapping, D>
1628        for &BlockOffsetMapping
1629    {
1630        #[inline]
1631        unsafe fn encode(
1632            self,
1633            encoder: &mut fidl::encoding::Encoder<'_, D>,
1634            offset: usize,
1635            _depth: fidl::encoding::Depth,
1636        ) -> fidl::Result<()> {
1637            encoder.debug_check_bounds::<BlockOffsetMapping>(offset);
1638            unsafe {
1639                // Copy the object into the buffer.
1640                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1641                (buf_ptr as *mut BlockOffsetMapping)
1642                    .write_unaligned((self as *const BlockOffsetMapping).read());
1643                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1644                // done second because the memcpy will write garbage to these bytes.
1645            }
1646            Ok(())
1647        }
1648    }
1649    unsafe impl<
1650        D: fidl::encoding::ResourceDialect,
1651        T0: fidl::encoding::Encode<u64, D>,
1652        T1: fidl::encoding::Encode<u64, D>,
1653    > fidl::encoding::Encode<BlockOffsetMapping, D> for (T0, T1)
1654    {
1655        #[inline]
1656        unsafe fn encode(
1657            self,
1658            encoder: &mut fidl::encoding::Encoder<'_, D>,
1659            offset: usize,
1660            depth: fidl::encoding::Depth,
1661        ) -> fidl::Result<()> {
1662            encoder.debug_check_bounds::<BlockOffsetMapping>(offset);
1663            // Zero out padding regions. There's no need to apply masks
1664            // because the unmasked parts will be overwritten by fields.
1665            // Write the fields.
1666            self.0.encode(encoder, offset + 0, depth)?;
1667            self.1.encode(encoder, offset + 8, depth)?;
1668            Ok(())
1669        }
1670    }
1671
1672    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlockOffsetMapping {
1673        #[inline(always)]
1674        fn new_empty() -> Self {
1675            Self { target_block_offset: fidl::new_empty!(u64, D), length: fidl::new_empty!(u64, D) }
1676        }
1677
1678        #[inline]
1679        unsafe fn decode(
1680            &mut self,
1681            decoder: &mut fidl::encoding::Decoder<'_, D>,
1682            offset: usize,
1683            _depth: fidl::encoding::Depth,
1684        ) -> fidl::Result<()> {
1685            decoder.debug_check_bounds::<Self>(offset);
1686            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1687            // Verify that padding bytes are zero.
1688            // Copy from the buffer into the object.
1689            unsafe {
1690                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
1691            }
1692            Ok(())
1693        }
1694    }
1695
1696    impl fidl::encoding::ValueTypeMarker for BlockQuerySlicesRequest {
1697        type Borrowed<'a> = &'a Self;
1698        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1699            value
1700        }
1701    }
1702
1703    unsafe impl fidl::encoding::TypeMarker for BlockQuerySlicesRequest {
1704        type Owned = Self;
1705
1706        #[inline(always)]
1707        fn inline_align(_context: fidl::encoding::Context) -> usize {
1708            8
1709        }
1710
1711        #[inline(always)]
1712        fn inline_size(_context: fidl::encoding::Context) -> usize {
1713            16
1714        }
1715    }
1716
1717    unsafe impl<D: fidl::encoding::ResourceDialect>
1718        fidl::encoding::Encode<BlockQuerySlicesRequest, D> for &BlockQuerySlicesRequest
1719    {
1720        #[inline]
1721        unsafe fn encode(
1722            self,
1723            encoder: &mut fidl::encoding::Encoder<'_, D>,
1724            offset: usize,
1725            _depth: fidl::encoding::Depth,
1726        ) -> fidl::Result<()> {
1727            encoder.debug_check_bounds::<BlockQuerySlicesRequest>(offset);
1728            // Delegate to tuple encoding.
1729            fidl::encoding::Encode::<BlockQuerySlicesRequest, D>::encode(
1730                (<fidl::encoding::Vector<u64, 16> as fidl::encoding::ValueTypeMarker>::borrow(
1731                    &self.start_slices,
1732                ),),
1733                encoder,
1734                offset,
1735                _depth,
1736            )
1737        }
1738    }
1739    unsafe impl<
1740        D: fidl::encoding::ResourceDialect,
1741        T0: fidl::encoding::Encode<fidl::encoding::Vector<u64, 16>, D>,
1742    > fidl::encoding::Encode<BlockQuerySlicesRequest, D> for (T0,)
1743    {
1744        #[inline]
1745        unsafe fn encode(
1746            self,
1747            encoder: &mut fidl::encoding::Encoder<'_, D>,
1748            offset: usize,
1749            depth: fidl::encoding::Depth,
1750        ) -> fidl::Result<()> {
1751            encoder.debug_check_bounds::<BlockQuerySlicesRequest>(offset);
1752            // Zero out padding regions. There's no need to apply masks
1753            // because the unmasked parts will be overwritten by fields.
1754            // Write the fields.
1755            self.0.encode(encoder, offset + 0, depth)?;
1756            Ok(())
1757        }
1758    }
1759
1760    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1761        for BlockQuerySlicesRequest
1762    {
1763        #[inline(always)]
1764        fn new_empty() -> Self {
1765            Self { start_slices: fidl::new_empty!(fidl::encoding::Vector<u64, 16>, D) }
1766        }
1767
1768        #[inline]
1769        unsafe fn decode(
1770            &mut self,
1771            decoder: &mut fidl::encoding::Decoder<'_, D>,
1772            offset: usize,
1773            _depth: fidl::encoding::Depth,
1774        ) -> fidl::Result<()> {
1775            decoder.debug_check_bounds::<Self>(offset);
1776            // Verify that padding bytes are zero.
1777            fidl::decode!(fidl::encoding::Vector<u64, 16>, D, &mut self.start_slices, decoder, offset + 0, _depth)?;
1778            Ok(())
1779        }
1780    }
1781
1782    impl fidl::encoding::ValueTypeMarker for BlockQuerySlicesResponse {
1783        type Borrowed<'a> = &'a Self;
1784        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1785            value
1786        }
1787    }
1788
1789    unsafe impl fidl::encoding::TypeMarker for BlockQuerySlicesResponse {
1790        type Owned = Self;
1791
1792        #[inline(always)]
1793        fn inline_align(_context: fidl::encoding::Context) -> usize {
1794            8
1795        }
1796
1797        #[inline(always)]
1798        fn inline_size(_context: fidl::encoding::Context) -> usize {
1799            272
1800        }
1801    }
1802
1803    unsafe impl<D: fidl::encoding::ResourceDialect>
1804        fidl::encoding::Encode<BlockQuerySlicesResponse, D> for &BlockQuerySlicesResponse
1805    {
1806        #[inline]
1807        unsafe fn encode(
1808            self,
1809            encoder: &mut fidl::encoding::Encoder<'_, D>,
1810            offset: usize,
1811            _depth: fidl::encoding::Depth,
1812        ) -> fidl::Result<()> {
1813            encoder.debug_check_bounds::<BlockQuerySlicesResponse>(offset);
1814            // Delegate to tuple encoding.
1815            fidl::encoding::Encode::<BlockQuerySlicesResponse, D>::encode(
1816                (
1817                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
1818                    <fidl::encoding::Array<VsliceRange, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.response),
1819                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.response_count),
1820                ),
1821                encoder, offset, _depth
1822            )
1823        }
1824    }
1825    unsafe impl<
1826        D: fidl::encoding::ResourceDialect,
1827        T0: fidl::encoding::Encode<i32, D>,
1828        T1: fidl::encoding::Encode<fidl::encoding::Array<VsliceRange, 16>, D>,
1829        T2: fidl::encoding::Encode<u64, D>,
1830    > fidl::encoding::Encode<BlockQuerySlicesResponse, D> for (T0, T1, T2)
1831    {
1832        #[inline]
1833        unsafe fn encode(
1834            self,
1835            encoder: &mut fidl::encoding::Encoder<'_, D>,
1836            offset: usize,
1837            depth: fidl::encoding::Depth,
1838        ) -> fidl::Result<()> {
1839            encoder.debug_check_bounds::<BlockQuerySlicesResponse>(offset);
1840            // Zero out padding regions. There's no need to apply masks
1841            // because the unmasked parts will be overwritten by fields.
1842            unsafe {
1843                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1844                (ptr as *mut u64).write_unaligned(0);
1845            }
1846            // Write the fields.
1847            self.0.encode(encoder, offset + 0, depth)?;
1848            self.1.encode(encoder, offset + 8, depth)?;
1849            self.2.encode(encoder, offset + 264, depth)?;
1850            Ok(())
1851        }
1852    }
1853
1854    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1855        for BlockQuerySlicesResponse
1856    {
1857        #[inline(always)]
1858        fn new_empty() -> Self {
1859            Self {
1860                status: fidl::new_empty!(i32, D),
1861                response: fidl::new_empty!(fidl::encoding::Array<VsliceRange, 16>, D),
1862                response_count: fidl::new_empty!(u64, D),
1863            }
1864        }
1865
1866        #[inline]
1867        unsafe fn decode(
1868            &mut self,
1869            decoder: &mut fidl::encoding::Decoder<'_, D>,
1870            offset: usize,
1871            _depth: fidl::encoding::Depth,
1872        ) -> fidl::Result<()> {
1873            decoder.debug_check_bounds::<Self>(offset);
1874            // Verify that padding bytes are zero.
1875            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1876            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1877            let mask = 0xffffffff00000000u64;
1878            let maskedval = padval & mask;
1879            if maskedval != 0 {
1880                return Err(fidl::Error::NonZeroPadding {
1881                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1882                });
1883            }
1884            fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
1885            fidl::decode!(fidl::encoding::Array<VsliceRange, 16>, D, &mut self.response, decoder, offset + 8, _depth)?;
1886            fidl::decode!(u64, D, &mut self.response_count, decoder, offset + 264, _depth)?;
1887            Ok(())
1888        }
1889    }
1890
1891    impl fidl::encoding::ValueTypeMarker for BlockShrinkRequest {
1892        type Borrowed<'a> = &'a Self;
1893        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1894            value
1895        }
1896    }
1897
1898    unsafe impl fidl::encoding::TypeMarker for BlockShrinkRequest {
1899        type Owned = Self;
1900
1901        #[inline(always)]
1902        fn inline_align(_context: fidl::encoding::Context) -> usize {
1903            8
1904        }
1905
1906        #[inline(always)]
1907        fn inline_size(_context: fidl::encoding::Context) -> usize {
1908            16
1909        }
1910        #[inline(always)]
1911        fn encode_is_copy() -> bool {
1912            true
1913        }
1914
1915        #[inline(always)]
1916        fn decode_is_copy() -> bool {
1917            true
1918        }
1919    }
1920
1921    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BlockShrinkRequest, D>
1922        for &BlockShrinkRequest
1923    {
1924        #[inline]
1925        unsafe fn encode(
1926            self,
1927            encoder: &mut fidl::encoding::Encoder<'_, D>,
1928            offset: usize,
1929            _depth: fidl::encoding::Depth,
1930        ) -> fidl::Result<()> {
1931            encoder.debug_check_bounds::<BlockShrinkRequest>(offset);
1932            unsafe {
1933                // Copy the object into the buffer.
1934                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1935                (buf_ptr as *mut BlockShrinkRequest)
1936                    .write_unaligned((self as *const BlockShrinkRequest).read());
1937                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1938                // done second because the memcpy will write garbage to these bytes.
1939            }
1940            Ok(())
1941        }
1942    }
1943    unsafe impl<
1944        D: fidl::encoding::ResourceDialect,
1945        T0: fidl::encoding::Encode<u64, D>,
1946        T1: fidl::encoding::Encode<u64, D>,
1947    > fidl::encoding::Encode<BlockShrinkRequest, D> for (T0, T1)
1948    {
1949        #[inline]
1950        unsafe fn encode(
1951            self,
1952            encoder: &mut fidl::encoding::Encoder<'_, D>,
1953            offset: usize,
1954            depth: fidl::encoding::Depth,
1955        ) -> fidl::Result<()> {
1956            encoder.debug_check_bounds::<BlockShrinkRequest>(offset);
1957            // Zero out padding regions. There's no need to apply masks
1958            // because the unmasked parts will be overwritten by fields.
1959            // Write the fields.
1960            self.0.encode(encoder, offset + 0, depth)?;
1961            self.1.encode(encoder, offset + 8, depth)?;
1962            Ok(())
1963        }
1964    }
1965
1966    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlockShrinkRequest {
1967        #[inline(always)]
1968        fn new_empty() -> Self {
1969            Self { start_slice: fidl::new_empty!(u64, D), slice_count: fidl::new_empty!(u64, D) }
1970        }
1971
1972        #[inline]
1973        unsafe fn decode(
1974            &mut self,
1975            decoder: &mut fidl::encoding::Decoder<'_, D>,
1976            offset: usize,
1977            _depth: fidl::encoding::Depth,
1978        ) -> fidl::Result<()> {
1979            decoder.debug_check_bounds::<Self>(offset);
1980            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1981            // Verify that padding bytes are zero.
1982            // Copy from the buffer into the object.
1983            unsafe {
1984                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
1985            }
1986            Ok(())
1987        }
1988    }
1989
1990    impl fidl::encoding::ValueTypeMarker for BlockShrinkResponse {
1991        type Borrowed<'a> = &'a Self;
1992        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1993            value
1994        }
1995    }
1996
1997    unsafe impl fidl::encoding::TypeMarker for BlockShrinkResponse {
1998        type Owned = Self;
1999
2000        #[inline(always)]
2001        fn inline_align(_context: fidl::encoding::Context) -> usize {
2002            4
2003        }
2004
2005        #[inline(always)]
2006        fn inline_size(_context: fidl::encoding::Context) -> usize {
2007            4
2008        }
2009        #[inline(always)]
2010        fn encode_is_copy() -> bool {
2011            true
2012        }
2013
2014        #[inline(always)]
2015        fn decode_is_copy() -> bool {
2016            true
2017        }
2018    }
2019
2020    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BlockShrinkResponse, D>
2021        for &BlockShrinkResponse
2022    {
2023        #[inline]
2024        unsafe fn encode(
2025            self,
2026            encoder: &mut fidl::encoding::Encoder<'_, D>,
2027            offset: usize,
2028            _depth: fidl::encoding::Depth,
2029        ) -> fidl::Result<()> {
2030            encoder.debug_check_bounds::<BlockShrinkResponse>(offset);
2031            unsafe {
2032                // Copy the object into the buffer.
2033                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2034                (buf_ptr as *mut BlockShrinkResponse)
2035                    .write_unaligned((self as *const BlockShrinkResponse).read());
2036                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2037                // done second because the memcpy will write garbage to these bytes.
2038            }
2039            Ok(())
2040        }
2041    }
2042    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2043        fidl::encoding::Encode<BlockShrinkResponse, D> for (T0,)
2044    {
2045        #[inline]
2046        unsafe fn encode(
2047            self,
2048            encoder: &mut fidl::encoding::Encoder<'_, D>,
2049            offset: usize,
2050            depth: fidl::encoding::Depth,
2051        ) -> fidl::Result<()> {
2052            encoder.debug_check_bounds::<BlockShrinkResponse>(offset);
2053            // Zero out padding regions. There's no need to apply masks
2054            // because the unmasked parts will be overwritten by fields.
2055            // Write the fields.
2056            self.0.encode(encoder, offset + 0, depth)?;
2057            Ok(())
2058        }
2059    }
2060
2061    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlockShrinkResponse {
2062        #[inline(always)]
2063        fn new_empty() -> Self {
2064            Self { status: fidl::new_empty!(i32, D) }
2065        }
2066
2067        #[inline]
2068        unsafe fn decode(
2069            &mut self,
2070            decoder: &mut fidl::encoding::Decoder<'_, D>,
2071            offset: usize,
2072            _depth: fidl::encoding::Depth,
2073        ) -> fidl::Result<()> {
2074            decoder.debug_check_bounds::<Self>(offset);
2075            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2076            // Verify that padding bytes are zero.
2077            // Copy from the buffer into the object.
2078            unsafe {
2079                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2080            }
2081            Ok(())
2082        }
2083    }
2084
2085    impl fidl::encoding::ValueTypeMarker for BlockGetInfoResponse {
2086        type Borrowed<'a> = &'a Self;
2087        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2088            value
2089        }
2090    }
2091
2092    unsafe impl fidl::encoding::TypeMarker for BlockGetInfoResponse {
2093        type Owned = Self;
2094
2095        #[inline(always)]
2096        fn inline_align(_context: fidl::encoding::Context) -> usize {
2097            8
2098        }
2099
2100        #[inline(always)]
2101        fn inline_size(_context: fidl::encoding::Context) -> usize {
2102            24
2103        }
2104    }
2105
2106    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BlockGetInfoResponse, D>
2107        for &BlockGetInfoResponse
2108    {
2109        #[inline]
2110        unsafe fn encode(
2111            self,
2112            encoder: &mut fidl::encoding::Encoder<'_, D>,
2113            offset: usize,
2114            _depth: fidl::encoding::Depth,
2115        ) -> fidl::Result<()> {
2116            encoder.debug_check_bounds::<BlockGetInfoResponse>(offset);
2117            // Delegate to tuple encoding.
2118            fidl::encoding::Encode::<BlockGetInfoResponse, D>::encode(
2119                (<BlockInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
2120                encoder,
2121                offset,
2122                _depth,
2123            )
2124        }
2125    }
2126    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BlockInfo, D>>
2127        fidl::encoding::Encode<BlockGetInfoResponse, D> for (T0,)
2128    {
2129        #[inline]
2130        unsafe fn encode(
2131            self,
2132            encoder: &mut fidl::encoding::Encoder<'_, D>,
2133            offset: usize,
2134            depth: fidl::encoding::Depth,
2135        ) -> fidl::Result<()> {
2136            encoder.debug_check_bounds::<BlockGetInfoResponse>(offset);
2137            // Zero out padding regions. There's no need to apply masks
2138            // because the unmasked parts will be overwritten by fields.
2139            // Write the fields.
2140            self.0.encode(encoder, offset + 0, depth)?;
2141            Ok(())
2142        }
2143    }
2144
2145    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlockGetInfoResponse {
2146        #[inline(always)]
2147        fn new_empty() -> Self {
2148            Self { info: fidl::new_empty!(BlockInfo, D) }
2149        }
2150
2151        #[inline]
2152        unsafe fn decode(
2153            &mut self,
2154            decoder: &mut fidl::encoding::Decoder<'_, D>,
2155            offset: usize,
2156            _depth: fidl::encoding::Depth,
2157        ) -> fidl::Result<()> {
2158            decoder.debug_check_bounds::<Self>(offset);
2159            // Verify that padding bytes are zero.
2160            fidl::decode!(BlockInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
2161            Ok(())
2162        }
2163    }
2164
2165    impl fidl::encoding::ValueTypeMarker for Guid {
2166        type Borrowed<'a> = &'a Self;
2167        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2168            value
2169        }
2170    }
2171
2172    unsafe impl fidl::encoding::TypeMarker for Guid {
2173        type Owned = Self;
2174
2175        #[inline(always)]
2176        fn inline_align(_context: fidl::encoding::Context) -> usize {
2177            1
2178        }
2179
2180        #[inline(always)]
2181        fn inline_size(_context: fidl::encoding::Context) -> usize {
2182            16
2183        }
2184        #[inline(always)]
2185        fn encode_is_copy() -> bool {
2186            true
2187        }
2188
2189        #[inline(always)]
2190        fn decode_is_copy() -> bool {
2191            true
2192        }
2193    }
2194
2195    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Guid, D> for &Guid {
2196        #[inline]
2197        unsafe fn encode(
2198            self,
2199            encoder: &mut fidl::encoding::Encoder<'_, D>,
2200            offset: usize,
2201            _depth: fidl::encoding::Depth,
2202        ) -> fidl::Result<()> {
2203            encoder.debug_check_bounds::<Guid>(offset);
2204            unsafe {
2205                // Copy the object into the buffer.
2206                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2207                (buf_ptr as *mut Guid).write_unaligned((self as *const Guid).read());
2208                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2209                // done second because the memcpy will write garbage to these bytes.
2210            }
2211            Ok(())
2212        }
2213    }
2214    unsafe impl<
2215        D: fidl::encoding::ResourceDialect,
2216        T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
2217    > fidl::encoding::Encode<Guid, D> for (T0,)
2218    {
2219        #[inline]
2220        unsafe fn encode(
2221            self,
2222            encoder: &mut fidl::encoding::Encoder<'_, D>,
2223            offset: usize,
2224            depth: fidl::encoding::Depth,
2225        ) -> fidl::Result<()> {
2226            encoder.debug_check_bounds::<Guid>(offset);
2227            // Zero out padding regions. There's no need to apply masks
2228            // because the unmasked parts will be overwritten by fields.
2229            // Write the fields.
2230            self.0.encode(encoder, offset + 0, depth)?;
2231            Ok(())
2232        }
2233    }
2234
2235    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Guid {
2236        #[inline(always)]
2237        fn new_empty() -> Self {
2238            Self { value: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D) }
2239        }
2240
2241        #[inline]
2242        unsafe fn decode(
2243            &mut self,
2244            decoder: &mut fidl::encoding::Decoder<'_, D>,
2245            offset: usize,
2246            _depth: fidl::encoding::Depth,
2247        ) -> fidl::Result<()> {
2248            decoder.debug_check_bounds::<Self>(offset);
2249            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2250            // Verify that padding bytes are zero.
2251            // Copy from the buffer into the object.
2252            unsafe {
2253                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2254            }
2255            Ok(())
2256        }
2257    }
2258
2259    impl fidl::encoding::ValueTypeMarker for SessionAttachVmoResponse {
2260        type Borrowed<'a> = &'a Self;
2261        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2262            value
2263        }
2264    }
2265
2266    unsafe impl fidl::encoding::TypeMarker for SessionAttachVmoResponse {
2267        type Owned = Self;
2268
2269        #[inline(always)]
2270        fn inline_align(_context: fidl::encoding::Context) -> usize {
2271            2
2272        }
2273
2274        #[inline(always)]
2275        fn inline_size(_context: fidl::encoding::Context) -> usize {
2276            2
2277        }
2278        #[inline(always)]
2279        fn encode_is_copy() -> bool {
2280            true
2281        }
2282
2283        #[inline(always)]
2284        fn decode_is_copy() -> bool {
2285            true
2286        }
2287    }
2288
2289    unsafe impl<D: fidl::encoding::ResourceDialect>
2290        fidl::encoding::Encode<SessionAttachVmoResponse, D> for &SessionAttachVmoResponse
2291    {
2292        #[inline]
2293        unsafe fn encode(
2294            self,
2295            encoder: &mut fidl::encoding::Encoder<'_, D>,
2296            offset: usize,
2297            _depth: fidl::encoding::Depth,
2298        ) -> fidl::Result<()> {
2299            encoder.debug_check_bounds::<SessionAttachVmoResponse>(offset);
2300            unsafe {
2301                // Copy the object into the buffer.
2302                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2303                (buf_ptr as *mut SessionAttachVmoResponse)
2304                    .write_unaligned((self as *const SessionAttachVmoResponse).read());
2305                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2306                // done second because the memcpy will write garbage to these bytes.
2307            }
2308            Ok(())
2309        }
2310    }
2311    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<VmoId, D>>
2312        fidl::encoding::Encode<SessionAttachVmoResponse, D> for (T0,)
2313    {
2314        #[inline]
2315        unsafe fn encode(
2316            self,
2317            encoder: &mut fidl::encoding::Encoder<'_, D>,
2318            offset: usize,
2319            depth: fidl::encoding::Depth,
2320        ) -> fidl::Result<()> {
2321            encoder.debug_check_bounds::<SessionAttachVmoResponse>(offset);
2322            // Zero out padding regions. There's no need to apply masks
2323            // because the unmasked parts will be overwritten by fields.
2324            // Write the fields.
2325            self.0.encode(encoder, offset + 0, depth)?;
2326            Ok(())
2327        }
2328    }
2329
2330    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2331        for SessionAttachVmoResponse
2332    {
2333        #[inline(always)]
2334        fn new_empty() -> Self {
2335            Self { vmoid: fidl::new_empty!(VmoId, D) }
2336        }
2337
2338        #[inline]
2339        unsafe fn decode(
2340            &mut self,
2341            decoder: &mut fidl::encoding::Decoder<'_, D>,
2342            offset: usize,
2343            _depth: fidl::encoding::Depth,
2344        ) -> fidl::Result<()> {
2345            decoder.debug_check_bounds::<Self>(offset);
2346            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2347            // Verify that padding bytes are zero.
2348            // Copy from the buffer into the object.
2349            unsafe {
2350                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2351            }
2352            Ok(())
2353        }
2354    }
2355
2356    impl fidl::encoding::ValueTypeMarker for VmoId {
2357        type Borrowed<'a> = &'a Self;
2358        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2359            value
2360        }
2361    }
2362
2363    unsafe impl fidl::encoding::TypeMarker for VmoId {
2364        type Owned = Self;
2365
2366        #[inline(always)]
2367        fn inline_align(_context: fidl::encoding::Context) -> usize {
2368            2
2369        }
2370
2371        #[inline(always)]
2372        fn inline_size(_context: fidl::encoding::Context) -> usize {
2373            2
2374        }
2375        #[inline(always)]
2376        fn encode_is_copy() -> bool {
2377            true
2378        }
2379
2380        #[inline(always)]
2381        fn decode_is_copy() -> bool {
2382            true
2383        }
2384    }
2385
2386    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VmoId, D> for &VmoId {
2387        #[inline]
2388        unsafe fn encode(
2389            self,
2390            encoder: &mut fidl::encoding::Encoder<'_, D>,
2391            offset: usize,
2392            _depth: fidl::encoding::Depth,
2393        ) -> fidl::Result<()> {
2394            encoder.debug_check_bounds::<VmoId>(offset);
2395            unsafe {
2396                // Copy the object into the buffer.
2397                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2398                (buf_ptr as *mut VmoId).write_unaligned((self as *const VmoId).read());
2399                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2400                // done second because the memcpy will write garbage to these bytes.
2401            }
2402            Ok(())
2403        }
2404    }
2405    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
2406        fidl::encoding::Encode<VmoId, D> for (T0,)
2407    {
2408        #[inline]
2409        unsafe fn encode(
2410            self,
2411            encoder: &mut fidl::encoding::Encoder<'_, D>,
2412            offset: usize,
2413            depth: fidl::encoding::Depth,
2414        ) -> fidl::Result<()> {
2415            encoder.debug_check_bounds::<VmoId>(offset);
2416            // Zero out padding regions. There's no need to apply masks
2417            // because the unmasked parts will be overwritten by fields.
2418            // Write the fields.
2419            self.0.encode(encoder, offset + 0, depth)?;
2420            Ok(())
2421        }
2422    }
2423
2424    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VmoId {
2425        #[inline(always)]
2426        fn new_empty() -> Self {
2427            Self { id: fidl::new_empty!(u16, D) }
2428        }
2429
2430        #[inline]
2431        unsafe fn decode(
2432            &mut self,
2433            decoder: &mut fidl::encoding::Decoder<'_, D>,
2434            offset: usize,
2435            _depth: fidl::encoding::Depth,
2436        ) -> fidl::Result<()> {
2437            decoder.debug_check_bounds::<Self>(offset);
2438            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2439            // Verify that padding bytes are zero.
2440            // Copy from the buffer into the object.
2441            unsafe {
2442                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2443            }
2444            Ok(())
2445        }
2446    }
2447
2448    impl fidl::encoding::ValueTypeMarker for VolumeInfo {
2449        type Borrowed<'a> = &'a Self;
2450        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2451            value
2452        }
2453    }
2454
2455    unsafe impl fidl::encoding::TypeMarker for VolumeInfo {
2456        type Owned = Self;
2457
2458        #[inline(always)]
2459        fn inline_align(_context: fidl::encoding::Context) -> usize {
2460            8
2461        }
2462
2463        #[inline(always)]
2464        fn inline_size(_context: fidl::encoding::Context) -> usize {
2465            16
2466        }
2467        #[inline(always)]
2468        fn encode_is_copy() -> bool {
2469            true
2470        }
2471
2472        #[inline(always)]
2473        fn decode_is_copy() -> bool {
2474            true
2475        }
2476    }
2477
2478    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeInfo, D>
2479        for &VolumeInfo
2480    {
2481        #[inline]
2482        unsafe fn encode(
2483            self,
2484            encoder: &mut fidl::encoding::Encoder<'_, D>,
2485            offset: usize,
2486            _depth: fidl::encoding::Depth,
2487        ) -> fidl::Result<()> {
2488            encoder.debug_check_bounds::<VolumeInfo>(offset);
2489            unsafe {
2490                // Copy the object into the buffer.
2491                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2492                (buf_ptr as *mut VolumeInfo).write_unaligned((self as *const VolumeInfo).read());
2493                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2494                // done second because the memcpy will write garbage to these bytes.
2495            }
2496            Ok(())
2497        }
2498    }
2499    unsafe impl<
2500        D: fidl::encoding::ResourceDialect,
2501        T0: fidl::encoding::Encode<u64, D>,
2502        T1: fidl::encoding::Encode<u64, D>,
2503    > fidl::encoding::Encode<VolumeInfo, D> for (T0, T1)
2504    {
2505        #[inline]
2506        unsafe fn encode(
2507            self,
2508            encoder: &mut fidl::encoding::Encoder<'_, D>,
2509            offset: usize,
2510            depth: fidl::encoding::Depth,
2511        ) -> fidl::Result<()> {
2512            encoder.debug_check_bounds::<VolumeInfo>(offset);
2513            // Zero out padding regions. There's no need to apply masks
2514            // because the unmasked parts will be overwritten by fields.
2515            // Write the fields.
2516            self.0.encode(encoder, offset + 0, depth)?;
2517            self.1.encode(encoder, offset + 8, depth)?;
2518            Ok(())
2519        }
2520    }
2521
2522    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeInfo {
2523        #[inline(always)]
2524        fn new_empty() -> Self {
2525            Self {
2526                partition_slice_count: fidl::new_empty!(u64, D),
2527                slice_limit: fidl::new_empty!(u64, D),
2528            }
2529        }
2530
2531        #[inline]
2532        unsafe fn decode(
2533            &mut self,
2534            decoder: &mut fidl::encoding::Decoder<'_, D>,
2535            offset: usize,
2536            _depth: fidl::encoding::Depth,
2537        ) -> fidl::Result<()> {
2538            decoder.debug_check_bounds::<Self>(offset);
2539            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2540            // Verify that padding bytes are zero.
2541            // Copy from the buffer into the object.
2542            unsafe {
2543                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2544            }
2545            Ok(())
2546        }
2547    }
2548
2549    impl fidl::encoding::ValueTypeMarker for VolumeManagerActivateRequest {
2550        type Borrowed<'a> = &'a Self;
2551        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2552            value
2553        }
2554    }
2555
2556    unsafe impl fidl::encoding::TypeMarker for VolumeManagerActivateRequest {
2557        type Owned = Self;
2558
2559        #[inline(always)]
2560        fn inline_align(_context: fidl::encoding::Context) -> usize {
2561            1
2562        }
2563
2564        #[inline(always)]
2565        fn inline_size(_context: fidl::encoding::Context) -> usize {
2566            32
2567        }
2568        #[inline(always)]
2569        fn encode_is_copy() -> bool {
2570            true
2571        }
2572
2573        #[inline(always)]
2574        fn decode_is_copy() -> bool {
2575            true
2576        }
2577    }
2578
2579    unsafe impl<D: fidl::encoding::ResourceDialect>
2580        fidl::encoding::Encode<VolumeManagerActivateRequest, D> for &VolumeManagerActivateRequest
2581    {
2582        #[inline]
2583        unsafe fn encode(
2584            self,
2585            encoder: &mut fidl::encoding::Encoder<'_, D>,
2586            offset: usize,
2587            _depth: fidl::encoding::Depth,
2588        ) -> fidl::Result<()> {
2589            encoder.debug_check_bounds::<VolumeManagerActivateRequest>(offset);
2590            unsafe {
2591                // Copy the object into the buffer.
2592                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2593                (buf_ptr as *mut VolumeManagerActivateRequest)
2594                    .write_unaligned((self as *const VolumeManagerActivateRequest).read());
2595                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2596                // done second because the memcpy will write garbage to these bytes.
2597            }
2598            Ok(())
2599        }
2600    }
2601    unsafe impl<
2602        D: fidl::encoding::ResourceDialect,
2603        T0: fidl::encoding::Encode<Guid, D>,
2604        T1: fidl::encoding::Encode<Guid, D>,
2605    > fidl::encoding::Encode<VolumeManagerActivateRequest, D> for (T0, T1)
2606    {
2607        #[inline]
2608        unsafe fn encode(
2609            self,
2610            encoder: &mut fidl::encoding::Encoder<'_, D>,
2611            offset: usize,
2612            depth: fidl::encoding::Depth,
2613        ) -> fidl::Result<()> {
2614            encoder.debug_check_bounds::<VolumeManagerActivateRequest>(offset);
2615            // Zero out padding regions. There's no need to apply masks
2616            // because the unmasked parts will be overwritten by fields.
2617            // Write the fields.
2618            self.0.encode(encoder, offset + 0, depth)?;
2619            self.1.encode(encoder, offset + 16, depth)?;
2620            Ok(())
2621        }
2622    }
2623
2624    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2625        for VolumeManagerActivateRequest
2626    {
2627        #[inline(always)]
2628        fn new_empty() -> Self {
2629            Self { old_guid: fidl::new_empty!(Guid, D), new_guid: fidl::new_empty!(Guid, D) }
2630        }
2631
2632        #[inline]
2633        unsafe fn decode(
2634            &mut self,
2635            decoder: &mut fidl::encoding::Decoder<'_, D>,
2636            offset: usize,
2637            _depth: fidl::encoding::Depth,
2638        ) -> fidl::Result<()> {
2639            decoder.debug_check_bounds::<Self>(offset);
2640            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2641            // Verify that padding bytes are zero.
2642            // Copy from the buffer into the object.
2643            unsafe {
2644                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
2645            }
2646            Ok(())
2647        }
2648    }
2649
2650    impl fidl::encoding::ValueTypeMarker for VolumeManagerActivateResponse {
2651        type Borrowed<'a> = &'a Self;
2652        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2653            value
2654        }
2655    }
2656
2657    unsafe impl fidl::encoding::TypeMarker for VolumeManagerActivateResponse {
2658        type Owned = Self;
2659
2660        #[inline(always)]
2661        fn inline_align(_context: fidl::encoding::Context) -> usize {
2662            4
2663        }
2664
2665        #[inline(always)]
2666        fn inline_size(_context: fidl::encoding::Context) -> usize {
2667            4
2668        }
2669        #[inline(always)]
2670        fn encode_is_copy() -> bool {
2671            true
2672        }
2673
2674        #[inline(always)]
2675        fn decode_is_copy() -> bool {
2676            true
2677        }
2678    }
2679
2680    unsafe impl<D: fidl::encoding::ResourceDialect>
2681        fidl::encoding::Encode<VolumeManagerActivateResponse, D>
2682        for &VolumeManagerActivateResponse
2683    {
2684        #[inline]
2685        unsafe fn encode(
2686            self,
2687            encoder: &mut fidl::encoding::Encoder<'_, D>,
2688            offset: usize,
2689            _depth: fidl::encoding::Depth,
2690        ) -> fidl::Result<()> {
2691            encoder.debug_check_bounds::<VolumeManagerActivateResponse>(offset);
2692            unsafe {
2693                // Copy the object into the buffer.
2694                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2695                (buf_ptr as *mut VolumeManagerActivateResponse)
2696                    .write_unaligned((self as *const VolumeManagerActivateResponse).read());
2697                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2698                // done second because the memcpy will write garbage to these bytes.
2699            }
2700            Ok(())
2701        }
2702    }
2703    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2704        fidl::encoding::Encode<VolumeManagerActivateResponse, D> for (T0,)
2705    {
2706        #[inline]
2707        unsafe fn encode(
2708            self,
2709            encoder: &mut fidl::encoding::Encoder<'_, D>,
2710            offset: usize,
2711            depth: fidl::encoding::Depth,
2712        ) -> fidl::Result<()> {
2713            encoder.debug_check_bounds::<VolumeManagerActivateResponse>(offset);
2714            // Zero out padding regions. There's no need to apply masks
2715            // because the unmasked parts will be overwritten by fields.
2716            // Write the fields.
2717            self.0.encode(encoder, offset + 0, depth)?;
2718            Ok(())
2719        }
2720    }
2721
2722    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2723        for VolumeManagerActivateResponse
2724    {
2725        #[inline(always)]
2726        fn new_empty() -> Self {
2727            Self { status: fidl::new_empty!(i32, D) }
2728        }
2729
2730        #[inline]
2731        unsafe fn decode(
2732            &mut self,
2733            decoder: &mut fidl::encoding::Decoder<'_, D>,
2734            offset: usize,
2735            _depth: fidl::encoding::Depth,
2736        ) -> fidl::Result<()> {
2737            decoder.debug_check_bounds::<Self>(offset);
2738            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2739            // Verify that padding bytes are zero.
2740            // Copy from the buffer into the object.
2741            unsafe {
2742                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2743            }
2744            Ok(())
2745        }
2746    }
2747
2748    impl fidl::encoding::ValueTypeMarker for VolumeManagerAllocatePartitionRequest {
2749        type Borrowed<'a> = &'a Self;
2750        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2751            value
2752        }
2753    }
2754
2755    unsafe impl fidl::encoding::TypeMarker for VolumeManagerAllocatePartitionRequest {
2756        type Owned = Self;
2757
2758        #[inline(always)]
2759        fn inline_align(_context: fidl::encoding::Context) -> usize {
2760            8
2761        }
2762
2763        #[inline(always)]
2764        fn inline_size(_context: fidl::encoding::Context) -> usize {
2765            64
2766        }
2767    }
2768
2769    unsafe impl<D: fidl::encoding::ResourceDialect>
2770        fidl::encoding::Encode<VolumeManagerAllocatePartitionRequest, D>
2771        for &VolumeManagerAllocatePartitionRequest
2772    {
2773        #[inline]
2774        unsafe fn encode(
2775            self,
2776            encoder: &mut fidl::encoding::Encoder<'_, D>,
2777            offset: usize,
2778            _depth: fidl::encoding::Depth,
2779        ) -> fidl::Result<()> {
2780            encoder.debug_check_bounds::<VolumeManagerAllocatePartitionRequest>(offset);
2781            // Delegate to tuple encoding.
2782            fidl::encoding::Encode::<VolumeManagerAllocatePartitionRequest, D>::encode(
2783                (
2784                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.slice_count),
2785                    <Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
2786                    <Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.instance),
2787                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
2788                        &self.name,
2789                    ),
2790                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
2791                ),
2792                encoder,
2793                offset,
2794                _depth,
2795            )
2796        }
2797    }
2798    unsafe impl<
2799        D: fidl::encoding::ResourceDialect,
2800        T0: fidl::encoding::Encode<u64, D>,
2801        T1: fidl::encoding::Encode<Guid, D>,
2802        T2: fidl::encoding::Encode<Guid, D>,
2803        T3: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
2804        T4: fidl::encoding::Encode<u32, D>,
2805    > fidl::encoding::Encode<VolumeManagerAllocatePartitionRequest, D> for (T0, T1, T2, T3, T4)
2806    {
2807        #[inline]
2808        unsafe fn encode(
2809            self,
2810            encoder: &mut fidl::encoding::Encoder<'_, D>,
2811            offset: usize,
2812            depth: fidl::encoding::Depth,
2813        ) -> fidl::Result<()> {
2814            encoder.debug_check_bounds::<VolumeManagerAllocatePartitionRequest>(offset);
2815            // Zero out padding regions. There's no need to apply masks
2816            // because the unmasked parts will be overwritten by fields.
2817            unsafe {
2818                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(56);
2819                (ptr as *mut u64).write_unaligned(0);
2820            }
2821            // Write the fields.
2822            self.0.encode(encoder, offset + 0, depth)?;
2823            self.1.encode(encoder, offset + 8, depth)?;
2824            self.2.encode(encoder, offset + 24, depth)?;
2825            self.3.encode(encoder, offset + 40, depth)?;
2826            self.4.encode(encoder, offset + 56, depth)?;
2827            Ok(())
2828        }
2829    }
2830
2831    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2832        for VolumeManagerAllocatePartitionRequest
2833    {
2834        #[inline(always)]
2835        fn new_empty() -> Self {
2836            Self {
2837                slice_count: fidl::new_empty!(u64, D),
2838                type_: fidl::new_empty!(Guid, D),
2839                instance: fidl::new_empty!(Guid, D),
2840                name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
2841                flags: fidl::new_empty!(u32, D),
2842            }
2843        }
2844
2845        #[inline]
2846        unsafe fn decode(
2847            &mut self,
2848            decoder: &mut fidl::encoding::Decoder<'_, D>,
2849            offset: usize,
2850            _depth: fidl::encoding::Depth,
2851        ) -> fidl::Result<()> {
2852            decoder.debug_check_bounds::<Self>(offset);
2853            // Verify that padding bytes are zero.
2854            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(56) };
2855            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2856            let mask = 0xffffffff00000000u64;
2857            let maskedval = padval & mask;
2858            if maskedval != 0 {
2859                return Err(fidl::Error::NonZeroPadding {
2860                    padding_start: offset + 56 + ((mask as u64).trailing_zeros() / 8) as usize,
2861                });
2862            }
2863            fidl::decode!(u64, D, &mut self.slice_count, decoder, offset + 0, _depth)?;
2864            fidl::decode!(Guid, D, &mut self.type_, decoder, offset + 8, _depth)?;
2865            fidl::decode!(Guid, D, &mut self.instance, decoder, offset + 24, _depth)?;
2866            fidl::decode!(
2867                fidl::encoding::BoundedString<128>,
2868                D,
2869                &mut self.name,
2870                decoder,
2871                offset + 40,
2872                _depth
2873            )?;
2874            fidl::decode!(u32, D, &mut self.flags, decoder, offset + 56, _depth)?;
2875            Ok(())
2876        }
2877    }
2878
2879    impl fidl::encoding::ValueTypeMarker for VolumeManagerAllocatePartitionResponse {
2880        type Borrowed<'a> = &'a Self;
2881        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2882            value
2883        }
2884    }
2885
2886    unsafe impl fidl::encoding::TypeMarker for VolumeManagerAllocatePartitionResponse {
2887        type Owned = Self;
2888
2889        #[inline(always)]
2890        fn inline_align(_context: fidl::encoding::Context) -> usize {
2891            4
2892        }
2893
2894        #[inline(always)]
2895        fn inline_size(_context: fidl::encoding::Context) -> usize {
2896            4
2897        }
2898        #[inline(always)]
2899        fn encode_is_copy() -> bool {
2900            true
2901        }
2902
2903        #[inline(always)]
2904        fn decode_is_copy() -> bool {
2905            true
2906        }
2907    }
2908
2909    unsafe impl<D: fidl::encoding::ResourceDialect>
2910        fidl::encoding::Encode<VolumeManagerAllocatePartitionResponse, D>
2911        for &VolumeManagerAllocatePartitionResponse
2912    {
2913        #[inline]
2914        unsafe fn encode(
2915            self,
2916            encoder: &mut fidl::encoding::Encoder<'_, D>,
2917            offset: usize,
2918            _depth: fidl::encoding::Depth,
2919        ) -> fidl::Result<()> {
2920            encoder.debug_check_bounds::<VolumeManagerAllocatePartitionResponse>(offset);
2921            unsafe {
2922                // Copy the object into the buffer.
2923                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2924                (buf_ptr as *mut VolumeManagerAllocatePartitionResponse).write_unaligned(
2925                    (self as *const VolumeManagerAllocatePartitionResponse).read(),
2926                );
2927                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2928                // done second because the memcpy will write garbage to these bytes.
2929            }
2930            Ok(())
2931        }
2932    }
2933    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2934        fidl::encoding::Encode<VolumeManagerAllocatePartitionResponse, D> for (T0,)
2935    {
2936        #[inline]
2937        unsafe fn encode(
2938            self,
2939            encoder: &mut fidl::encoding::Encoder<'_, D>,
2940            offset: usize,
2941            depth: fidl::encoding::Depth,
2942        ) -> fidl::Result<()> {
2943            encoder.debug_check_bounds::<VolumeManagerAllocatePartitionResponse>(offset);
2944            // Zero out padding regions. There's no need to apply masks
2945            // because the unmasked parts will be overwritten by fields.
2946            // Write the fields.
2947            self.0.encode(encoder, offset + 0, depth)?;
2948            Ok(())
2949        }
2950    }
2951
2952    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2953        for VolumeManagerAllocatePartitionResponse
2954    {
2955        #[inline(always)]
2956        fn new_empty() -> Self {
2957            Self { status: fidl::new_empty!(i32, D) }
2958        }
2959
2960        #[inline]
2961        unsafe fn decode(
2962            &mut self,
2963            decoder: &mut fidl::encoding::Decoder<'_, D>,
2964            offset: usize,
2965            _depth: fidl::encoding::Depth,
2966        ) -> fidl::Result<()> {
2967            decoder.debug_check_bounds::<Self>(offset);
2968            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2969            // Verify that padding bytes are zero.
2970            // Copy from the buffer into the object.
2971            unsafe {
2972                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2973            }
2974            Ok(())
2975        }
2976    }
2977
2978    impl fidl::encoding::ValueTypeMarker for VolumeManagerGetInfoResponse {
2979        type Borrowed<'a> = &'a Self;
2980        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2981            value
2982        }
2983    }
2984
2985    unsafe impl fidl::encoding::TypeMarker for VolumeManagerGetInfoResponse {
2986        type Owned = Self;
2987
2988        #[inline(always)]
2989        fn inline_align(_context: fidl::encoding::Context) -> usize {
2990            8
2991        }
2992
2993        #[inline(always)]
2994        fn inline_size(_context: fidl::encoding::Context) -> usize {
2995            16
2996        }
2997    }
2998
2999    unsafe impl<D: fidl::encoding::ResourceDialect>
3000        fidl::encoding::Encode<VolumeManagerGetInfoResponse, D> for &VolumeManagerGetInfoResponse
3001    {
3002        #[inline]
3003        unsafe fn encode(
3004            self,
3005            encoder: &mut fidl::encoding::Encoder<'_, D>,
3006            offset: usize,
3007            _depth: fidl::encoding::Depth,
3008        ) -> fidl::Result<()> {
3009            encoder.debug_check_bounds::<VolumeManagerGetInfoResponse>(offset);
3010            // Delegate to tuple encoding.
3011            fidl::encoding::Encode::<VolumeManagerGetInfoResponse, D>::encode(
3012                (
3013                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
3014                    <fidl::encoding::Boxed<VolumeManagerInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
3015                ),
3016                encoder, offset, _depth
3017            )
3018        }
3019    }
3020    unsafe impl<
3021        D: fidl::encoding::ResourceDialect,
3022        T0: fidl::encoding::Encode<i32, D>,
3023        T1: fidl::encoding::Encode<fidl::encoding::Boxed<VolumeManagerInfo>, D>,
3024    > fidl::encoding::Encode<VolumeManagerGetInfoResponse, D> for (T0, T1)
3025    {
3026        #[inline]
3027        unsafe fn encode(
3028            self,
3029            encoder: &mut fidl::encoding::Encoder<'_, D>,
3030            offset: usize,
3031            depth: fidl::encoding::Depth,
3032        ) -> fidl::Result<()> {
3033            encoder.debug_check_bounds::<VolumeManagerGetInfoResponse>(offset);
3034            // Zero out padding regions. There's no need to apply masks
3035            // because the unmasked parts will be overwritten by fields.
3036            unsafe {
3037                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3038                (ptr as *mut u64).write_unaligned(0);
3039            }
3040            // Write the fields.
3041            self.0.encode(encoder, offset + 0, depth)?;
3042            self.1.encode(encoder, offset + 8, depth)?;
3043            Ok(())
3044        }
3045    }
3046
3047    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3048        for VolumeManagerGetInfoResponse
3049    {
3050        #[inline(always)]
3051        fn new_empty() -> Self {
3052            Self {
3053                status: fidl::new_empty!(i32, D),
3054                info: fidl::new_empty!(fidl::encoding::Boxed<VolumeManagerInfo>, D),
3055            }
3056        }
3057
3058        #[inline]
3059        unsafe fn decode(
3060            &mut self,
3061            decoder: &mut fidl::encoding::Decoder<'_, D>,
3062            offset: usize,
3063            _depth: fidl::encoding::Depth,
3064        ) -> fidl::Result<()> {
3065            decoder.debug_check_bounds::<Self>(offset);
3066            // Verify that padding bytes are zero.
3067            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3068            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3069            let mask = 0xffffffff00000000u64;
3070            let maskedval = padval & mask;
3071            if maskedval != 0 {
3072                return Err(fidl::Error::NonZeroPadding {
3073                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3074                });
3075            }
3076            fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
3077            fidl::decode!(
3078                fidl::encoding::Boxed<VolumeManagerInfo>,
3079                D,
3080                &mut self.info,
3081                decoder,
3082                offset + 8,
3083                _depth
3084            )?;
3085            Ok(())
3086        }
3087    }
3088
3089    impl fidl::encoding::ValueTypeMarker for VolumeManagerGetPartitionLimitRequest {
3090        type Borrowed<'a> = &'a Self;
3091        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3092            value
3093        }
3094    }
3095
3096    unsafe impl fidl::encoding::TypeMarker for VolumeManagerGetPartitionLimitRequest {
3097        type Owned = Self;
3098
3099        #[inline(always)]
3100        fn inline_align(_context: fidl::encoding::Context) -> usize {
3101            1
3102        }
3103
3104        #[inline(always)]
3105        fn inline_size(_context: fidl::encoding::Context) -> usize {
3106            16
3107        }
3108        #[inline(always)]
3109        fn encode_is_copy() -> bool {
3110            true
3111        }
3112
3113        #[inline(always)]
3114        fn decode_is_copy() -> bool {
3115            true
3116        }
3117    }
3118
3119    unsafe impl<D: fidl::encoding::ResourceDialect>
3120        fidl::encoding::Encode<VolumeManagerGetPartitionLimitRequest, D>
3121        for &VolumeManagerGetPartitionLimitRequest
3122    {
3123        #[inline]
3124        unsafe fn encode(
3125            self,
3126            encoder: &mut fidl::encoding::Encoder<'_, D>,
3127            offset: usize,
3128            _depth: fidl::encoding::Depth,
3129        ) -> fidl::Result<()> {
3130            encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitRequest>(offset);
3131            unsafe {
3132                // Copy the object into the buffer.
3133                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3134                (buf_ptr as *mut VolumeManagerGetPartitionLimitRequest)
3135                    .write_unaligned((self as *const VolumeManagerGetPartitionLimitRequest).read());
3136                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3137                // done second because the memcpy will write garbage to these bytes.
3138            }
3139            Ok(())
3140        }
3141    }
3142    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Guid, D>>
3143        fidl::encoding::Encode<VolumeManagerGetPartitionLimitRequest, D> for (T0,)
3144    {
3145        #[inline]
3146        unsafe fn encode(
3147            self,
3148            encoder: &mut fidl::encoding::Encoder<'_, D>,
3149            offset: usize,
3150            depth: fidl::encoding::Depth,
3151        ) -> fidl::Result<()> {
3152            encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitRequest>(offset);
3153            // Zero out padding regions. There's no need to apply masks
3154            // because the unmasked parts will be overwritten by fields.
3155            // Write the fields.
3156            self.0.encode(encoder, offset + 0, depth)?;
3157            Ok(())
3158        }
3159    }
3160
3161    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3162        for VolumeManagerGetPartitionLimitRequest
3163    {
3164        #[inline(always)]
3165        fn new_empty() -> Self {
3166            Self { guid: fidl::new_empty!(Guid, D) }
3167        }
3168
3169        #[inline]
3170        unsafe fn decode(
3171            &mut self,
3172            decoder: &mut fidl::encoding::Decoder<'_, D>,
3173            offset: usize,
3174            _depth: fidl::encoding::Depth,
3175        ) -> fidl::Result<()> {
3176            decoder.debug_check_bounds::<Self>(offset);
3177            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3178            // Verify that padding bytes are zero.
3179            // Copy from the buffer into the object.
3180            unsafe {
3181                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
3182            }
3183            Ok(())
3184        }
3185    }
3186
3187    impl fidl::encoding::ValueTypeMarker for VolumeManagerGetPartitionLimitResponse {
3188        type Borrowed<'a> = &'a Self;
3189        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3190            value
3191        }
3192    }
3193
3194    unsafe impl fidl::encoding::TypeMarker for VolumeManagerGetPartitionLimitResponse {
3195        type Owned = Self;
3196
3197        #[inline(always)]
3198        fn inline_align(_context: fidl::encoding::Context) -> usize {
3199            8
3200        }
3201
3202        #[inline(always)]
3203        fn inline_size(_context: fidl::encoding::Context) -> usize {
3204            16
3205        }
3206    }
3207
3208    unsafe impl<D: fidl::encoding::ResourceDialect>
3209        fidl::encoding::Encode<VolumeManagerGetPartitionLimitResponse, D>
3210        for &VolumeManagerGetPartitionLimitResponse
3211    {
3212        #[inline]
3213        unsafe fn encode(
3214            self,
3215            encoder: &mut fidl::encoding::Encoder<'_, D>,
3216            offset: usize,
3217            _depth: fidl::encoding::Depth,
3218        ) -> fidl::Result<()> {
3219            encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitResponse>(offset);
3220            unsafe {
3221                // Copy the object into the buffer.
3222                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3223                (buf_ptr as *mut VolumeManagerGetPartitionLimitResponse).write_unaligned(
3224                    (self as *const VolumeManagerGetPartitionLimitResponse).read(),
3225                );
3226                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3227                // done second because the memcpy will write garbage to these bytes.
3228                let padding_ptr = buf_ptr.offset(0) as *mut u64;
3229                let padding_mask = 0xffffffff00000000u64;
3230                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
3231            }
3232            Ok(())
3233        }
3234    }
3235    unsafe impl<
3236        D: fidl::encoding::ResourceDialect,
3237        T0: fidl::encoding::Encode<i32, D>,
3238        T1: fidl::encoding::Encode<u64, D>,
3239    > fidl::encoding::Encode<VolumeManagerGetPartitionLimitResponse, D> for (T0, T1)
3240    {
3241        #[inline]
3242        unsafe fn encode(
3243            self,
3244            encoder: &mut fidl::encoding::Encoder<'_, D>,
3245            offset: usize,
3246            depth: fidl::encoding::Depth,
3247        ) -> fidl::Result<()> {
3248            encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitResponse>(offset);
3249            // Zero out padding regions. There's no need to apply masks
3250            // because the unmasked parts will be overwritten by fields.
3251            unsafe {
3252                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3253                (ptr as *mut u64).write_unaligned(0);
3254            }
3255            // Write the fields.
3256            self.0.encode(encoder, offset + 0, depth)?;
3257            self.1.encode(encoder, offset + 8, depth)?;
3258            Ok(())
3259        }
3260    }
3261
3262    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3263        for VolumeManagerGetPartitionLimitResponse
3264    {
3265        #[inline(always)]
3266        fn new_empty() -> Self {
3267            Self { status: fidl::new_empty!(i32, D), slice_count: fidl::new_empty!(u64, D) }
3268        }
3269
3270        #[inline]
3271        unsafe fn decode(
3272            &mut self,
3273            decoder: &mut fidl::encoding::Decoder<'_, D>,
3274            offset: usize,
3275            _depth: fidl::encoding::Depth,
3276        ) -> fidl::Result<()> {
3277            decoder.debug_check_bounds::<Self>(offset);
3278            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3279            // Verify that padding bytes are zero.
3280            let ptr = unsafe { buf_ptr.offset(0) };
3281            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3282            let mask = 0xffffffff00000000u64;
3283            let maskedval = padval & mask;
3284            if maskedval != 0 {
3285                return Err(fidl::Error::NonZeroPadding {
3286                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3287                });
3288            }
3289            // Copy from the buffer into the object.
3290            unsafe {
3291                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
3292            }
3293            Ok(())
3294        }
3295    }
3296
3297    impl fidl::encoding::ValueTypeMarker for VolumeManagerInfo {
3298        type Borrowed<'a> = &'a Self;
3299        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3300            value
3301        }
3302    }
3303
3304    unsafe impl fidl::encoding::TypeMarker for VolumeManagerInfo {
3305        type Owned = Self;
3306
3307        #[inline(always)]
3308        fn inline_align(_context: fidl::encoding::Context) -> usize {
3309            8
3310        }
3311
3312        #[inline(always)]
3313        fn inline_size(_context: fidl::encoding::Context) -> usize {
3314            40
3315        }
3316        #[inline(always)]
3317        fn encode_is_copy() -> bool {
3318            true
3319        }
3320
3321        #[inline(always)]
3322        fn decode_is_copy() -> bool {
3323            true
3324        }
3325    }
3326
3327    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeManagerInfo, D>
3328        for &VolumeManagerInfo
3329    {
3330        #[inline]
3331        unsafe fn encode(
3332            self,
3333            encoder: &mut fidl::encoding::Encoder<'_, D>,
3334            offset: usize,
3335            _depth: fidl::encoding::Depth,
3336        ) -> fidl::Result<()> {
3337            encoder.debug_check_bounds::<VolumeManagerInfo>(offset);
3338            unsafe {
3339                // Copy the object into the buffer.
3340                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3341                (buf_ptr as *mut VolumeManagerInfo)
3342                    .write_unaligned((self as *const VolumeManagerInfo).read());
3343                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3344                // done second because the memcpy will write garbage to these bytes.
3345            }
3346            Ok(())
3347        }
3348    }
3349    unsafe impl<
3350        D: fidl::encoding::ResourceDialect,
3351        T0: fidl::encoding::Encode<u64, D>,
3352        T1: fidl::encoding::Encode<u64, D>,
3353        T2: fidl::encoding::Encode<u64, D>,
3354        T3: fidl::encoding::Encode<u64, D>,
3355        T4: fidl::encoding::Encode<u64, D>,
3356    > fidl::encoding::Encode<VolumeManagerInfo, D> for (T0, T1, T2, T3, T4)
3357    {
3358        #[inline]
3359        unsafe fn encode(
3360            self,
3361            encoder: &mut fidl::encoding::Encoder<'_, D>,
3362            offset: usize,
3363            depth: fidl::encoding::Depth,
3364        ) -> fidl::Result<()> {
3365            encoder.debug_check_bounds::<VolumeManagerInfo>(offset);
3366            // Zero out padding regions. There's no need to apply masks
3367            // because the unmasked parts will be overwritten by fields.
3368            // Write the fields.
3369            self.0.encode(encoder, offset + 0, depth)?;
3370            self.1.encode(encoder, offset + 8, depth)?;
3371            self.2.encode(encoder, offset + 16, depth)?;
3372            self.3.encode(encoder, offset + 24, depth)?;
3373            self.4.encode(encoder, offset + 32, depth)?;
3374            Ok(())
3375        }
3376    }
3377
3378    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeManagerInfo {
3379        #[inline(always)]
3380        fn new_empty() -> Self {
3381            Self {
3382                slice_size: fidl::new_empty!(u64, D),
3383                slice_count: fidl::new_empty!(u64, D),
3384                assigned_slice_count: fidl::new_empty!(u64, D),
3385                maximum_slice_count: fidl::new_empty!(u64, D),
3386                max_virtual_slice: fidl::new_empty!(u64, D),
3387            }
3388        }
3389
3390        #[inline]
3391        unsafe fn decode(
3392            &mut self,
3393            decoder: &mut fidl::encoding::Decoder<'_, D>,
3394            offset: usize,
3395            _depth: fidl::encoding::Depth,
3396        ) -> fidl::Result<()> {
3397            decoder.debug_check_bounds::<Self>(offset);
3398            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3399            // Verify that padding bytes are zero.
3400            // Copy from the buffer into the object.
3401            unsafe {
3402                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 40);
3403            }
3404            Ok(())
3405        }
3406    }
3407
3408    impl fidl::encoding::ValueTypeMarker for VolumeManagerSetPartitionLimitRequest {
3409        type Borrowed<'a> = &'a Self;
3410        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3411            value
3412        }
3413    }
3414
3415    unsafe impl fidl::encoding::TypeMarker for VolumeManagerSetPartitionLimitRequest {
3416        type Owned = Self;
3417
3418        #[inline(always)]
3419        fn inline_align(_context: fidl::encoding::Context) -> usize {
3420            8
3421        }
3422
3423        #[inline(always)]
3424        fn inline_size(_context: fidl::encoding::Context) -> usize {
3425            24
3426        }
3427        #[inline(always)]
3428        fn encode_is_copy() -> bool {
3429            true
3430        }
3431
3432        #[inline(always)]
3433        fn decode_is_copy() -> bool {
3434            true
3435        }
3436    }
3437
3438    unsafe impl<D: fidl::encoding::ResourceDialect>
3439        fidl::encoding::Encode<VolumeManagerSetPartitionLimitRequest, D>
3440        for &VolumeManagerSetPartitionLimitRequest
3441    {
3442        #[inline]
3443        unsafe fn encode(
3444            self,
3445            encoder: &mut fidl::encoding::Encoder<'_, D>,
3446            offset: usize,
3447            _depth: fidl::encoding::Depth,
3448        ) -> fidl::Result<()> {
3449            encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitRequest>(offset);
3450            unsafe {
3451                // Copy the object into the buffer.
3452                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3453                (buf_ptr as *mut VolumeManagerSetPartitionLimitRequest)
3454                    .write_unaligned((self as *const VolumeManagerSetPartitionLimitRequest).read());
3455                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3456                // done second because the memcpy will write garbage to these bytes.
3457            }
3458            Ok(())
3459        }
3460    }
3461    unsafe impl<
3462        D: fidl::encoding::ResourceDialect,
3463        T0: fidl::encoding::Encode<Guid, D>,
3464        T1: fidl::encoding::Encode<u64, D>,
3465    > fidl::encoding::Encode<VolumeManagerSetPartitionLimitRequest, D> for (T0, T1)
3466    {
3467        #[inline]
3468        unsafe fn encode(
3469            self,
3470            encoder: &mut fidl::encoding::Encoder<'_, D>,
3471            offset: usize,
3472            depth: fidl::encoding::Depth,
3473        ) -> fidl::Result<()> {
3474            encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitRequest>(offset);
3475            // Zero out padding regions. There's no need to apply masks
3476            // because the unmasked parts will be overwritten by fields.
3477            // Write the fields.
3478            self.0.encode(encoder, offset + 0, depth)?;
3479            self.1.encode(encoder, offset + 16, depth)?;
3480            Ok(())
3481        }
3482    }
3483
3484    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3485        for VolumeManagerSetPartitionLimitRequest
3486    {
3487        #[inline(always)]
3488        fn new_empty() -> Self {
3489            Self { guid: fidl::new_empty!(Guid, D), slice_count: fidl::new_empty!(u64, D) }
3490        }
3491
3492        #[inline]
3493        unsafe fn decode(
3494            &mut self,
3495            decoder: &mut fidl::encoding::Decoder<'_, D>,
3496            offset: usize,
3497            _depth: fidl::encoding::Depth,
3498        ) -> fidl::Result<()> {
3499            decoder.debug_check_bounds::<Self>(offset);
3500            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3501            // Verify that padding bytes are zero.
3502            // Copy from the buffer into the object.
3503            unsafe {
3504                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
3505            }
3506            Ok(())
3507        }
3508    }
3509
3510    impl fidl::encoding::ValueTypeMarker for VolumeManagerSetPartitionLimitResponse {
3511        type Borrowed<'a> = &'a Self;
3512        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3513            value
3514        }
3515    }
3516
3517    unsafe impl fidl::encoding::TypeMarker for VolumeManagerSetPartitionLimitResponse {
3518        type Owned = Self;
3519
3520        #[inline(always)]
3521        fn inline_align(_context: fidl::encoding::Context) -> usize {
3522            4
3523        }
3524
3525        #[inline(always)]
3526        fn inline_size(_context: fidl::encoding::Context) -> usize {
3527            4
3528        }
3529        #[inline(always)]
3530        fn encode_is_copy() -> bool {
3531            true
3532        }
3533
3534        #[inline(always)]
3535        fn decode_is_copy() -> bool {
3536            true
3537        }
3538    }
3539
3540    unsafe impl<D: fidl::encoding::ResourceDialect>
3541        fidl::encoding::Encode<VolumeManagerSetPartitionLimitResponse, D>
3542        for &VolumeManagerSetPartitionLimitResponse
3543    {
3544        #[inline]
3545        unsafe fn encode(
3546            self,
3547            encoder: &mut fidl::encoding::Encoder<'_, D>,
3548            offset: usize,
3549            _depth: fidl::encoding::Depth,
3550        ) -> fidl::Result<()> {
3551            encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitResponse>(offset);
3552            unsafe {
3553                // Copy the object into the buffer.
3554                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3555                (buf_ptr as *mut VolumeManagerSetPartitionLimitResponse).write_unaligned(
3556                    (self as *const VolumeManagerSetPartitionLimitResponse).read(),
3557                );
3558                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3559                // done second because the memcpy will write garbage to these bytes.
3560            }
3561            Ok(())
3562        }
3563    }
3564    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
3565        fidl::encoding::Encode<VolumeManagerSetPartitionLimitResponse, D> for (T0,)
3566    {
3567        #[inline]
3568        unsafe fn encode(
3569            self,
3570            encoder: &mut fidl::encoding::Encoder<'_, D>,
3571            offset: usize,
3572            depth: fidl::encoding::Depth,
3573        ) -> fidl::Result<()> {
3574            encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitResponse>(offset);
3575            // Zero out padding regions. There's no need to apply masks
3576            // because the unmasked parts will be overwritten by fields.
3577            // Write the fields.
3578            self.0.encode(encoder, offset + 0, depth)?;
3579            Ok(())
3580        }
3581    }
3582
3583    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3584        for VolumeManagerSetPartitionLimitResponse
3585    {
3586        #[inline(always)]
3587        fn new_empty() -> Self {
3588            Self { status: fidl::new_empty!(i32, D) }
3589        }
3590
3591        #[inline]
3592        unsafe fn decode(
3593            &mut self,
3594            decoder: &mut fidl::encoding::Decoder<'_, D>,
3595            offset: usize,
3596            _depth: fidl::encoding::Depth,
3597        ) -> fidl::Result<()> {
3598            decoder.debug_check_bounds::<Self>(offset);
3599            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3600            // Verify that padding bytes are zero.
3601            // Copy from the buffer into the object.
3602            unsafe {
3603                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3604            }
3605            Ok(())
3606        }
3607    }
3608
3609    impl fidl::encoding::ValueTypeMarker for VolumeManagerSetPartitionNameRequest {
3610        type Borrowed<'a> = &'a Self;
3611        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3612            value
3613        }
3614    }
3615
3616    unsafe impl fidl::encoding::TypeMarker for VolumeManagerSetPartitionNameRequest {
3617        type Owned = Self;
3618
3619        #[inline(always)]
3620        fn inline_align(_context: fidl::encoding::Context) -> usize {
3621            8
3622        }
3623
3624        #[inline(always)]
3625        fn inline_size(_context: fidl::encoding::Context) -> usize {
3626            32
3627        }
3628    }
3629
3630    unsafe impl<D: fidl::encoding::ResourceDialect>
3631        fidl::encoding::Encode<VolumeManagerSetPartitionNameRequest, D>
3632        for &VolumeManagerSetPartitionNameRequest
3633    {
3634        #[inline]
3635        unsafe fn encode(
3636            self,
3637            encoder: &mut fidl::encoding::Encoder<'_, D>,
3638            offset: usize,
3639            _depth: fidl::encoding::Depth,
3640        ) -> fidl::Result<()> {
3641            encoder.debug_check_bounds::<VolumeManagerSetPartitionNameRequest>(offset);
3642            // Delegate to tuple encoding.
3643            fidl::encoding::Encode::<VolumeManagerSetPartitionNameRequest, D>::encode(
3644                (
3645                    <Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.guid),
3646                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
3647                        &self.name,
3648                    ),
3649                ),
3650                encoder,
3651                offset,
3652                _depth,
3653            )
3654        }
3655    }
3656    unsafe impl<
3657        D: fidl::encoding::ResourceDialect,
3658        T0: fidl::encoding::Encode<Guid, D>,
3659        T1: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
3660    > fidl::encoding::Encode<VolumeManagerSetPartitionNameRequest, D> for (T0, T1)
3661    {
3662        #[inline]
3663        unsafe fn encode(
3664            self,
3665            encoder: &mut fidl::encoding::Encoder<'_, D>,
3666            offset: usize,
3667            depth: fidl::encoding::Depth,
3668        ) -> fidl::Result<()> {
3669            encoder.debug_check_bounds::<VolumeManagerSetPartitionNameRequest>(offset);
3670            // Zero out padding regions. There's no need to apply masks
3671            // because the unmasked parts will be overwritten by fields.
3672            // Write the fields.
3673            self.0.encode(encoder, offset + 0, depth)?;
3674            self.1.encode(encoder, offset + 16, depth)?;
3675            Ok(())
3676        }
3677    }
3678
3679    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3680        for VolumeManagerSetPartitionNameRequest
3681    {
3682        #[inline(always)]
3683        fn new_empty() -> Self {
3684            Self {
3685                guid: fidl::new_empty!(Guid, D),
3686                name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
3687            }
3688        }
3689
3690        #[inline]
3691        unsafe fn decode(
3692            &mut self,
3693            decoder: &mut fidl::encoding::Decoder<'_, D>,
3694            offset: usize,
3695            _depth: fidl::encoding::Depth,
3696        ) -> fidl::Result<()> {
3697            decoder.debug_check_bounds::<Self>(offset);
3698            // Verify that padding bytes are zero.
3699            fidl::decode!(Guid, D, &mut self.guid, decoder, offset + 0, _depth)?;
3700            fidl::decode!(
3701                fidl::encoding::BoundedString<128>,
3702                D,
3703                &mut self.name,
3704                decoder,
3705                offset + 16,
3706                _depth
3707            )?;
3708            Ok(())
3709        }
3710    }
3711
3712    impl fidl::encoding::ValueTypeMarker for VsliceRange {
3713        type Borrowed<'a> = &'a Self;
3714        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3715            value
3716        }
3717    }
3718
3719    unsafe impl fidl::encoding::TypeMarker for VsliceRange {
3720        type Owned = Self;
3721
3722        #[inline(always)]
3723        fn inline_align(_context: fidl::encoding::Context) -> usize {
3724            8
3725        }
3726
3727        #[inline(always)]
3728        fn inline_size(_context: fidl::encoding::Context) -> usize {
3729            16
3730        }
3731    }
3732
3733    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VsliceRange, D>
3734        for &VsliceRange
3735    {
3736        #[inline]
3737        unsafe fn encode(
3738            self,
3739            encoder: &mut fidl::encoding::Encoder<'_, D>,
3740            offset: usize,
3741            _depth: fidl::encoding::Depth,
3742        ) -> fidl::Result<()> {
3743            encoder.debug_check_bounds::<VsliceRange>(offset);
3744            // Delegate to tuple encoding.
3745            fidl::encoding::Encode::<VsliceRange, D>::encode(
3746                (
3747                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.allocated),
3748                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.count),
3749                ),
3750                encoder,
3751                offset,
3752                _depth,
3753            )
3754        }
3755    }
3756    unsafe impl<
3757        D: fidl::encoding::ResourceDialect,
3758        T0: fidl::encoding::Encode<bool, D>,
3759        T1: fidl::encoding::Encode<u64, D>,
3760    > fidl::encoding::Encode<VsliceRange, D> for (T0, T1)
3761    {
3762        #[inline]
3763        unsafe fn encode(
3764            self,
3765            encoder: &mut fidl::encoding::Encoder<'_, D>,
3766            offset: usize,
3767            depth: fidl::encoding::Depth,
3768        ) -> fidl::Result<()> {
3769            encoder.debug_check_bounds::<VsliceRange>(offset);
3770            // Zero out padding regions. There's no need to apply masks
3771            // because the unmasked parts will be overwritten by fields.
3772            unsafe {
3773                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3774                (ptr as *mut u64).write_unaligned(0);
3775            }
3776            // Write the fields.
3777            self.0.encode(encoder, offset + 0, depth)?;
3778            self.1.encode(encoder, offset + 8, depth)?;
3779            Ok(())
3780        }
3781    }
3782
3783    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VsliceRange {
3784        #[inline(always)]
3785        fn new_empty() -> Self {
3786            Self { allocated: fidl::new_empty!(bool, D), count: fidl::new_empty!(u64, D) }
3787        }
3788
3789        #[inline]
3790        unsafe fn decode(
3791            &mut self,
3792            decoder: &mut fidl::encoding::Decoder<'_, D>,
3793            offset: usize,
3794            _depth: fidl::encoding::Depth,
3795        ) -> fidl::Result<()> {
3796            decoder.debug_check_bounds::<Self>(offset);
3797            // Verify that padding bytes are zero.
3798            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3799            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3800            let mask = 0xffffffffffffff00u64;
3801            let maskedval = padval & mask;
3802            if maskedval != 0 {
3803                return Err(fidl::Error::NonZeroPadding {
3804                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3805                });
3806            }
3807            fidl::decode!(bool, D, &mut self.allocated, decoder, offset + 0, _depth)?;
3808            fidl::decode!(u64, D, &mut self.count, decoder, offset + 8, _depth)?;
3809            Ok(())
3810        }
3811    }
3812
3813    impl PartitionInfo {
3814        #[inline(always)]
3815        fn max_ordinal_present(&self) -> u64 {
3816            if let Some(_) = self.flags {
3817                return 6;
3818            }
3819            if let Some(_) = self.num_blocks {
3820                return 5;
3821            }
3822            if let Some(_) = self.start_block_offset {
3823                return 4;
3824            }
3825            if let Some(_) = self.instance_guid {
3826                return 3;
3827            }
3828            if let Some(_) = self.type_guid {
3829                return 2;
3830            }
3831            if let Some(_) = self.name {
3832                return 1;
3833            }
3834            0
3835        }
3836    }
3837
3838    impl fidl::encoding::ValueTypeMarker for PartitionInfo {
3839        type Borrowed<'a> = &'a Self;
3840        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3841            value
3842        }
3843    }
3844
3845    unsafe impl fidl::encoding::TypeMarker for PartitionInfo {
3846        type Owned = Self;
3847
3848        #[inline(always)]
3849        fn inline_align(_context: fidl::encoding::Context) -> usize {
3850            8
3851        }
3852
3853        #[inline(always)]
3854        fn inline_size(_context: fidl::encoding::Context) -> usize {
3855            16
3856        }
3857    }
3858
3859    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PartitionInfo, D>
3860        for &PartitionInfo
3861    {
3862        unsafe fn encode(
3863            self,
3864            encoder: &mut fidl::encoding::Encoder<'_, D>,
3865            offset: usize,
3866            mut depth: fidl::encoding::Depth,
3867        ) -> fidl::Result<()> {
3868            encoder.debug_check_bounds::<PartitionInfo>(offset);
3869            // Vector header
3870            let max_ordinal: u64 = self.max_ordinal_present();
3871            encoder.write_num(max_ordinal, offset);
3872            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3873            // Calling encoder.out_of_line_offset(0) is not allowed.
3874            if max_ordinal == 0 {
3875                return Ok(());
3876            }
3877            depth.increment()?;
3878            let envelope_size = 8;
3879            let bytes_len = max_ordinal as usize * envelope_size;
3880            #[allow(unused_variables)]
3881            let offset = encoder.out_of_line_offset(bytes_len);
3882            let mut _prev_end_offset: usize = 0;
3883            if 1 > max_ordinal {
3884                return Ok(());
3885            }
3886
3887            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3888            // are envelope_size bytes.
3889            let cur_offset: usize = (1 - 1) * envelope_size;
3890
3891            // Zero reserved fields.
3892            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3893
3894            // Safety:
3895            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3896            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3897            //   envelope_size bytes, there is always sufficient room.
3898            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
3899                self.name.as_ref().map(
3900                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
3901                ),
3902                encoder,
3903                offset + cur_offset,
3904                depth,
3905            )?;
3906
3907            _prev_end_offset = cur_offset + envelope_size;
3908            if 2 > max_ordinal {
3909                return Ok(());
3910            }
3911
3912            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3913            // are envelope_size bytes.
3914            let cur_offset: usize = (2 - 1) * envelope_size;
3915
3916            // Zero reserved fields.
3917            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3918
3919            // Safety:
3920            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3921            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3922            //   envelope_size bytes, there is always sufficient room.
3923            fidl::encoding::encode_in_envelope_optional::<Guid, D>(
3924                self.type_guid.as_ref().map(<Guid as fidl::encoding::ValueTypeMarker>::borrow),
3925                encoder,
3926                offset + cur_offset,
3927                depth,
3928            )?;
3929
3930            _prev_end_offset = cur_offset + envelope_size;
3931            if 3 > max_ordinal {
3932                return Ok(());
3933            }
3934
3935            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3936            // are envelope_size bytes.
3937            let cur_offset: usize = (3 - 1) * envelope_size;
3938
3939            // Zero reserved fields.
3940            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3941
3942            // Safety:
3943            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3944            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3945            //   envelope_size bytes, there is always sufficient room.
3946            fidl::encoding::encode_in_envelope_optional::<Guid, D>(
3947                self.instance_guid.as_ref().map(<Guid as fidl::encoding::ValueTypeMarker>::borrow),
3948                encoder,
3949                offset + cur_offset,
3950                depth,
3951            )?;
3952
3953            _prev_end_offset = cur_offset + envelope_size;
3954            if 4 > max_ordinal {
3955                return Ok(());
3956            }
3957
3958            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3959            // are envelope_size bytes.
3960            let cur_offset: usize = (4 - 1) * envelope_size;
3961
3962            // Zero reserved fields.
3963            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3964
3965            // Safety:
3966            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3967            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3968            //   envelope_size bytes, there is always sufficient room.
3969            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3970                self.start_block_offset
3971                    .as_ref()
3972                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3973                encoder,
3974                offset + cur_offset,
3975                depth,
3976            )?;
3977
3978            _prev_end_offset = cur_offset + envelope_size;
3979            if 5 > max_ordinal {
3980                return Ok(());
3981            }
3982
3983            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3984            // are envelope_size bytes.
3985            let cur_offset: usize = (5 - 1) * envelope_size;
3986
3987            // Zero reserved fields.
3988            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3989
3990            // Safety:
3991            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3992            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3993            //   envelope_size bytes, there is always sufficient room.
3994            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3995                self.num_blocks.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3996                encoder,
3997                offset + cur_offset,
3998                depth,
3999            )?;
4000
4001            _prev_end_offset = cur_offset + envelope_size;
4002            if 6 > max_ordinal {
4003                return Ok(());
4004            }
4005
4006            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4007            // are envelope_size bytes.
4008            let cur_offset: usize = (6 - 1) * envelope_size;
4009
4010            // Zero reserved fields.
4011            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4012
4013            // Safety:
4014            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4015            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4016            //   envelope_size bytes, there is always sufficient room.
4017            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4018                self.flags.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4019                encoder,
4020                offset + cur_offset,
4021                depth,
4022            )?;
4023
4024            _prev_end_offset = cur_offset + envelope_size;
4025
4026            Ok(())
4027        }
4028    }
4029
4030    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PartitionInfo {
4031        #[inline(always)]
4032        fn new_empty() -> Self {
4033            Self::default()
4034        }
4035
4036        unsafe fn decode(
4037            &mut self,
4038            decoder: &mut fidl::encoding::Decoder<'_, D>,
4039            offset: usize,
4040            mut depth: fidl::encoding::Depth,
4041        ) -> fidl::Result<()> {
4042            decoder.debug_check_bounds::<Self>(offset);
4043            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4044                None => return Err(fidl::Error::NotNullable),
4045                Some(len) => len,
4046            };
4047            // Calling decoder.out_of_line_offset(0) is not allowed.
4048            if len == 0 {
4049                return Ok(());
4050            };
4051            depth.increment()?;
4052            let envelope_size = 8;
4053            let bytes_len = len * envelope_size;
4054            let offset = decoder.out_of_line_offset(bytes_len)?;
4055            // Decode the envelope for each type.
4056            let mut _next_ordinal_to_read = 0;
4057            let mut next_offset = offset;
4058            let end_offset = offset + bytes_len;
4059            _next_ordinal_to_read += 1;
4060            if next_offset >= end_offset {
4061                return Ok(());
4062            }
4063
4064            // Decode unknown envelopes for gaps in ordinals.
4065            while _next_ordinal_to_read < 1 {
4066                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4067                _next_ordinal_to_read += 1;
4068                next_offset += envelope_size;
4069            }
4070
4071            let next_out_of_line = decoder.next_out_of_line();
4072            let handles_before = decoder.remaining_handles();
4073            if let Some((inlined, num_bytes, num_handles)) =
4074                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4075            {
4076                let member_inline_size =
4077                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
4078                        decoder.context,
4079                    );
4080                if inlined != (member_inline_size <= 4) {
4081                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4082                }
4083                let inner_offset;
4084                let mut inner_depth = depth.clone();
4085                if inlined {
4086                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4087                    inner_offset = next_offset;
4088                } else {
4089                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4090                    inner_depth.increment()?;
4091                }
4092                let val_ref = self
4093                    .name
4094                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
4095                fidl::decode!(
4096                    fidl::encoding::BoundedString<128>,
4097                    D,
4098                    val_ref,
4099                    decoder,
4100                    inner_offset,
4101                    inner_depth
4102                )?;
4103                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4104                {
4105                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4106                }
4107                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4108                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4109                }
4110            }
4111
4112            next_offset += envelope_size;
4113            _next_ordinal_to_read += 1;
4114            if next_offset >= end_offset {
4115                return Ok(());
4116            }
4117
4118            // Decode unknown envelopes for gaps in ordinals.
4119            while _next_ordinal_to_read < 2 {
4120                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4121                _next_ordinal_to_read += 1;
4122                next_offset += envelope_size;
4123            }
4124
4125            let next_out_of_line = decoder.next_out_of_line();
4126            let handles_before = decoder.remaining_handles();
4127            if let Some((inlined, num_bytes, num_handles)) =
4128                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4129            {
4130                let member_inline_size =
4131                    <Guid as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4132                if inlined != (member_inline_size <= 4) {
4133                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4134                }
4135                let inner_offset;
4136                let mut inner_depth = depth.clone();
4137                if inlined {
4138                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4139                    inner_offset = next_offset;
4140                } else {
4141                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4142                    inner_depth.increment()?;
4143                }
4144                let val_ref = self.type_guid.get_or_insert_with(|| fidl::new_empty!(Guid, D));
4145                fidl::decode!(Guid, D, val_ref, decoder, inner_offset, inner_depth)?;
4146                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4147                {
4148                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4149                }
4150                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4151                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4152                }
4153            }
4154
4155            next_offset += envelope_size;
4156            _next_ordinal_to_read += 1;
4157            if next_offset >= end_offset {
4158                return Ok(());
4159            }
4160
4161            // Decode unknown envelopes for gaps in ordinals.
4162            while _next_ordinal_to_read < 3 {
4163                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4164                _next_ordinal_to_read += 1;
4165                next_offset += envelope_size;
4166            }
4167
4168            let next_out_of_line = decoder.next_out_of_line();
4169            let handles_before = decoder.remaining_handles();
4170            if let Some((inlined, num_bytes, num_handles)) =
4171                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4172            {
4173                let member_inline_size =
4174                    <Guid as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4175                if inlined != (member_inline_size <= 4) {
4176                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4177                }
4178                let inner_offset;
4179                let mut inner_depth = depth.clone();
4180                if inlined {
4181                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4182                    inner_offset = next_offset;
4183                } else {
4184                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4185                    inner_depth.increment()?;
4186                }
4187                let val_ref = self.instance_guid.get_or_insert_with(|| fidl::new_empty!(Guid, D));
4188                fidl::decode!(Guid, D, val_ref, decoder, inner_offset, inner_depth)?;
4189                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4190                {
4191                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4192                }
4193                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4194                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4195                }
4196            }
4197
4198            next_offset += envelope_size;
4199            _next_ordinal_to_read += 1;
4200            if next_offset >= end_offset {
4201                return Ok(());
4202            }
4203
4204            // Decode unknown envelopes for gaps in ordinals.
4205            while _next_ordinal_to_read < 4 {
4206                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4207                _next_ordinal_to_read += 1;
4208                next_offset += envelope_size;
4209            }
4210
4211            let next_out_of_line = decoder.next_out_of_line();
4212            let handles_before = decoder.remaining_handles();
4213            if let Some((inlined, num_bytes, num_handles)) =
4214                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4215            {
4216                let member_inline_size =
4217                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4218                if inlined != (member_inline_size <= 4) {
4219                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4220                }
4221                let inner_offset;
4222                let mut inner_depth = depth.clone();
4223                if inlined {
4224                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4225                    inner_offset = next_offset;
4226                } else {
4227                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4228                    inner_depth.increment()?;
4229                }
4230                let val_ref =
4231                    self.start_block_offset.get_or_insert_with(|| fidl::new_empty!(u64, D));
4232                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4233                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4234                {
4235                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4236                }
4237                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4238                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4239                }
4240            }
4241
4242            next_offset += envelope_size;
4243            _next_ordinal_to_read += 1;
4244            if next_offset >= end_offset {
4245                return Ok(());
4246            }
4247
4248            // Decode unknown envelopes for gaps in ordinals.
4249            while _next_ordinal_to_read < 5 {
4250                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4251                _next_ordinal_to_read += 1;
4252                next_offset += envelope_size;
4253            }
4254
4255            let next_out_of_line = decoder.next_out_of_line();
4256            let handles_before = decoder.remaining_handles();
4257            if let Some((inlined, num_bytes, num_handles)) =
4258                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4259            {
4260                let member_inline_size =
4261                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4262                if inlined != (member_inline_size <= 4) {
4263                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4264                }
4265                let inner_offset;
4266                let mut inner_depth = depth.clone();
4267                if inlined {
4268                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4269                    inner_offset = next_offset;
4270                } else {
4271                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4272                    inner_depth.increment()?;
4273                }
4274                let val_ref = self.num_blocks.get_or_insert_with(|| fidl::new_empty!(u64, D));
4275                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4276                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4277                {
4278                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4279                }
4280                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4281                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4282                }
4283            }
4284
4285            next_offset += envelope_size;
4286            _next_ordinal_to_read += 1;
4287            if next_offset >= end_offset {
4288                return Ok(());
4289            }
4290
4291            // Decode unknown envelopes for gaps in ordinals.
4292            while _next_ordinal_to_read < 6 {
4293                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4294                _next_ordinal_to_read += 1;
4295                next_offset += envelope_size;
4296            }
4297
4298            let next_out_of_line = decoder.next_out_of_line();
4299            let handles_before = decoder.remaining_handles();
4300            if let Some((inlined, num_bytes, num_handles)) =
4301                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4302            {
4303                let member_inline_size =
4304                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4305                if inlined != (member_inline_size <= 4) {
4306                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4307                }
4308                let inner_offset;
4309                let mut inner_depth = depth.clone();
4310                if inlined {
4311                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4312                    inner_offset = next_offset;
4313                } else {
4314                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4315                    inner_depth.increment()?;
4316                }
4317                let val_ref = self.flags.get_or_insert_with(|| fidl::new_empty!(u64, D));
4318                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4319                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4320                {
4321                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4322                }
4323                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4324                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4325                }
4326            }
4327
4328            next_offset += envelope_size;
4329
4330            // Decode the remaining unknown envelopes.
4331            while next_offset < end_offset {
4332                _next_ordinal_to_read += 1;
4333                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4334                next_offset += envelope_size;
4335            }
4336
4337            Ok(())
4338        }
4339    }
4340}