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