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