fidl_fuchsia_hardware_block_volume__common/
fidl_fuchsia_hardware_block_volume__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
15/// An arbitrary cap on the number of slices which may be requested when querying
16/// for allocation information from a volume.
17pub const MAX_SLICE_REQUESTS: u32 = 16;
18
19#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
20#[repr(C)]
21pub struct VolumeDestroyResponse {
22    pub status: i32,
23}
24
25impl fidl::Persistable for VolumeDestroyResponse {}
26
27#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
28#[repr(C)]
29pub struct VolumeExtendRequest {
30    pub start_slice: u64,
31    pub slice_count: u64,
32}
33
34impl fidl::Persistable for VolumeExtendRequest {}
35
36#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37#[repr(C)]
38pub struct VolumeExtendResponse {
39    pub status: i32,
40}
41
42impl fidl::Persistable for VolumeExtendResponse {}
43
44#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
45pub struct VolumeGetVolumeInfoResponse {
46    pub status: i32,
47    pub manager: Option<Box<VolumeManagerInfo>>,
48    pub volume: Option<Box<VolumeInfo>>,
49}
50
51impl fidl::Persistable for VolumeGetVolumeInfoResponse {}
52
53#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
54#[repr(C)]
55pub struct VolumeInfo {
56    /// Number of slices allocated to the volume.
57    pub partition_slice_count: u64,
58    /// Limit on the maximum slices assigned to this partition, if there is one. If the size of the
59    /// partition is not limited, this value will be 0. Partitions can grow into free slices
60    /// available in the volume manager as long as their slices are less than or equal to this
61    /// value.
62    ///
63    /// The partition may be larger than this limit if a smaller limit was applied after the
64    /// partition had already grown to the current size.
65    ///
66    /// See `VolumeManager.GetPartitionLimit()`
67    pub slice_limit: u64,
68}
69
70impl fidl::Persistable for VolumeInfo {}
71
72#[derive(Clone, Debug, PartialEq)]
73pub struct VolumeManagerActivateRequest {
74    pub old_guid: fidl_fuchsia_hardware_block_partition__common::Guid,
75    pub new_guid: fidl_fuchsia_hardware_block_partition__common::Guid,
76}
77
78impl fidl::Persistable for VolumeManagerActivateRequest {}
79
80#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
81#[repr(C)]
82pub struct VolumeManagerActivateResponse {
83    pub status: i32,
84}
85
86impl fidl::Persistable for VolumeManagerActivateResponse {}
87
88#[derive(Clone, Debug, PartialEq)]
89pub struct VolumeManagerAllocatePartitionRequest {
90    pub slice_count: u64,
91    pub type_: fidl_fuchsia_hardware_block_partition__common::Guid,
92    pub instance: fidl_fuchsia_hardware_block_partition__common::Guid,
93    pub name: String,
94    pub flags: u32,
95}
96
97impl fidl::Persistable for VolumeManagerAllocatePartitionRequest {}
98
99#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
100#[repr(C)]
101pub struct VolumeManagerAllocatePartitionResponse {
102    pub status: i32,
103}
104
105impl fidl::Persistable for VolumeManagerAllocatePartitionResponse {}
106
107#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
108pub struct VolumeManagerGetInfoResponse {
109    pub status: i32,
110    pub info: Option<Box<VolumeManagerInfo>>,
111}
112
113impl fidl::Persistable for VolumeManagerGetInfoResponse {}
114
115#[derive(Clone, Debug, PartialEq)]
116pub struct VolumeManagerGetPartitionLimitRequest {
117    pub guid: fidl_fuchsia_hardware_block_partition__common::Guid,
118}
119
120impl fidl::Persistable for VolumeManagerGetPartitionLimitRequest {}
121
122#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
123#[repr(C)]
124pub struct VolumeManagerGetPartitionLimitResponse {
125    pub status: i32,
126    pub slice_count: u64,
127}
128
129impl fidl::Persistable for VolumeManagerGetPartitionLimitResponse {}
130
131/// VolumeManagerInfo describes the properties of the volume manager and not each individual volume.
132#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
133#[repr(C)]
134pub struct VolumeManagerInfo {
135    /// Size of a single slice, in bytes.
136    pub slice_size: u64,
137    /// Number of slices the volume manager is able use right now. This counts the
138    /// allocated_slice_count plus the number of available slices.
139    pub slice_count: u64,
140    /// Number of slices currently assigned to partitions.
141    pub assigned_slice_count: u64,
142    /// The maximum capacity which the Volume Manager could grow to utilize if the partition
143    /// containing the Volume Manager itself expands (i.e., the Volume Manager is initialized on a
144    /// GPT partition that has extended beyond the originally allocated capacity). This value is
145    /// the number of entries reserved in the volume manager header and is not related to the size
146    /// of the physical device (which may be larger or smaller).
147    pub maximum_slice_count: u64,
148    /// Largest value that can be used for a virtual slice number.
149    pub max_virtual_slice: u64,
150}
151
152impl fidl::Persistable for VolumeManagerInfo {}
153
154#[derive(Clone, Debug, PartialEq)]
155pub struct VolumeManagerSetPartitionLimitRequest {
156    pub guid: fidl_fuchsia_hardware_block_partition__common::Guid,
157    pub slice_count: u64,
158}
159
160impl fidl::Persistable for VolumeManagerSetPartitionLimitRequest {}
161
162#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
163#[repr(C)]
164pub struct VolumeManagerSetPartitionLimitResponse {
165    pub status: i32,
166}
167
168impl fidl::Persistable for VolumeManagerSetPartitionLimitResponse {}
169
170#[derive(Clone, Debug, PartialEq)]
171pub struct VolumeManagerSetPartitionNameRequest {
172    pub guid: fidl_fuchsia_hardware_block_partition__common::Guid,
173    pub name: String,
174}
175
176impl fidl::Persistable for VolumeManagerSetPartitionNameRequest {}
177
178#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
179pub struct VolumeQuerySlicesRequest {
180    pub start_slices: Vec<u64>,
181}
182
183impl fidl::Persistable for VolumeQuerySlicesRequest {}
184
185#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
186pub struct VolumeQuerySlicesResponse {
187    pub status: i32,
188    pub response: [VsliceRange; 16],
189    pub response_count: u64,
190}
191
192impl fidl::Persistable for VolumeQuerySlicesResponse {}
193
194#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
195#[repr(C)]
196pub struct VolumeShrinkRequest {
197    pub start_slice: u64,
198    pub slice_count: u64,
199}
200
201impl fidl::Persistable for VolumeShrinkRequest {}
202
203#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
204#[repr(C)]
205pub struct VolumeShrinkResponse {
206    pub status: i32,
207}
208
209impl fidl::Persistable for VolumeShrinkResponse {}
210
211/// VsliceRange describes a range of virtual slices: start, length, and allocated status.
212///
213/// These ranges are returned in an ordered container, which implicitly describes the
214/// starting offset, starting from the "index zero" slice.
215#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
216pub struct VsliceRange {
217    /// True if the virtual slices are allocated, false otherwise.
218    pub allocated: bool,
219    /// The number of contiguous virtual slices.
220    pub count: u64,
221}
222
223impl fidl::Persistable for VsliceRange {}
224
225pub mod volume_ordinals {
226    pub const GET_INFO: u64 = 0x79df1a5cdb6cc6a3;
227    pub const GET_STATS: u64 = 0x53d9542a778385ae;
228    pub const OPEN_SESSION: u64 = 0x7241c68d17614a31;
229    pub const OPEN_SESSION_WITH_OFFSET_MAP: u64 = 0x7a8d3ba3d8bfa10f;
230    pub const GET_TYPE_GUID: u64 = 0x111843d737a9b847;
231    pub const GET_INSTANCE_GUID: u64 = 0x14a5a573b275d435;
232    pub const GET_NAME: u64 = 0x7e3c6f0b0937fc02;
233    pub const GET_METADATA: u64 = 0x42d1464c96c3f3ff;
234    pub const QUERY_SLICES: u64 = 0x589a96828a3e2aa1;
235    pub const GET_VOLUME_INFO: u64 = 0x60417b6cf9e34c80;
236    pub const EXTEND: u64 = 0xdddf872f5039d37;
237    pub const SHRINK: u64 = 0x27ab5ed4f6fdcd29;
238    pub const DESTROY: u64 = 0x732bf4bea39b5e87;
239}
240
241pub mod volume_manager_ordinals {
242    pub const ALLOCATE_PARTITION: u64 = 0x4e79f24ed059e394;
243    pub const GET_INFO: u64 = 0x735b3548582b2c9;
244    pub const ACTIVATE: u64 = 0xc8cef57012874d0;
245    pub const GET_PARTITION_LIMIT: u64 = 0x6e32f6df9fa2a919;
246    pub const SET_PARTITION_LIMIT: u64 = 0x2e09076ef266fa35;
247    pub const SET_PARTITION_NAME: u64 = 0x4539a9b95cba0397;
248}
249
250mod internal {
251    use super::*;
252
253    impl fidl::encoding::ValueTypeMarker for VolumeDestroyResponse {
254        type Borrowed<'a> = &'a Self;
255        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
256            value
257        }
258    }
259
260    unsafe impl fidl::encoding::TypeMarker for VolumeDestroyResponse {
261        type Owned = Self;
262
263        #[inline(always)]
264        fn inline_align(_context: fidl::encoding::Context) -> usize {
265            4
266        }
267
268        #[inline(always)]
269        fn inline_size(_context: fidl::encoding::Context) -> usize {
270            4
271        }
272        #[inline(always)]
273        fn encode_is_copy() -> bool {
274            true
275        }
276
277        #[inline(always)]
278        fn decode_is_copy() -> bool {
279            true
280        }
281    }
282
283    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeDestroyResponse, D>
284        for &VolumeDestroyResponse
285    {
286        #[inline]
287        unsafe fn encode(
288            self,
289            encoder: &mut fidl::encoding::Encoder<'_, D>,
290            offset: usize,
291            _depth: fidl::encoding::Depth,
292        ) -> fidl::Result<()> {
293            encoder.debug_check_bounds::<VolumeDestroyResponse>(offset);
294            unsafe {
295                // Copy the object into the buffer.
296                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
297                (buf_ptr as *mut VolumeDestroyResponse)
298                    .write_unaligned((self as *const VolumeDestroyResponse).read());
299                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
300                // done second because the memcpy will write garbage to these bytes.
301            }
302            Ok(())
303        }
304    }
305    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
306        fidl::encoding::Encode<VolumeDestroyResponse, D> for (T0,)
307    {
308        #[inline]
309        unsafe fn encode(
310            self,
311            encoder: &mut fidl::encoding::Encoder<'_, D>,
312            offset: usize,
313            depth: fidl::encoding::Depth,
314        ) -> fidl::Result<()> {
315            encoder.debug_check_bounds::<VolumeDestroyResponse>(offset);
316            // Zero out padding regions. There's no need to apply masks
317            // because the unmasked parts will be overwritten by fields.
318            // Write the fields.
319            self.0.encode(encoder, offset + 0, depth)?;
320            Ok(())
321        }
322    }
323
324    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeDestroyResponse {
325        #[inline(always)]
326        fn new_empty() -> Self {
327            Self { status: fidl::new_empty!(i32, D) }
328        }
329
330        #[inline]
331        unsafe fn decode(
332            &mut self,
333            decoder: &mut fidl::encoding::Decoder<'_, D>,
334            offset: usize,
335            _depth: fidl::encoding::Depth,
336        ) -> fidl::Result<()> {
337            decoder.debug_check_bounds::<Self>(offset);
338            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
339            // Verify that padding bytes are zero.
340            // Copy from the buffer into the object.
341            unsafe {
342                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
343            }
344            Ok(())
345        }
346    }
347
348    impl fidl::encoding::ValueTypeMarker for VolumeExtendRequest {
349        type Borrowed<'a> = &'a Self;
350        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
351            value
352        }
353    }
354
355    unsafe impl fidl::encoding::TypeMarker for VolumeExtendRequest {
356        type Owned = Self;
357
358        #[inline(always)]
359        fn inline_align(_context: fidl::encoding::Context) -> usize {
360            8
361        }
362
363        #[inline(always)]
364        fn inline_size(_context: fidl::encoding::Context) -> usize {
365            16
366        }
367        #[inline(always)]
368        fn encode_is_copy() -> bool {
369            true
370        }
371
372        #[inline(always)]
373        fn decode_is_copy() -> bool {
374            true
375        }
376    }
377
378    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeExtendRequest, D>
379        for &VolumeExtendRequest
380    {
381        #[inline]
382        unsafe fn encode(
383            self,
384            encoder: &mut fidl::encoding::Encoder<'_, D>,
385            offset: usize,
386            _depth: fidl::encoding::Depth,
387        ) -> fidl::Result<()> {
388            encoder.debug_check_bounds::<VolumeExtendRequest>(offset);
389            unsafe {
390                // Copy the object into the buffer.
391                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
392                (buf_ptr as *mut VolumeExtendRequest)
393                    .write_unaligned((self as *const VolumeExtendRequest).read());
394                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
395                // done second because the memcpy will write garbage to these bytes.
396            }
397            Ok(())
398        }
399    }
400    unsafe impl<
401            D: fidl::encoding::ResourceDialect,
402            T0: fidl::encoding::Encode<u64, D>,
403            T1: fidl::encoding::Encode<u64, D>,
404        > fidl::encoding::Encode<VolumeExtendRequest, D> for (T0, T1)
405    {
406        #[inline]
407        unsafe fn encode(
408            self,
409            encoder: &mut fidl::encoding::Encoder<'_, D>,
410            offset: usize,
411            depth: fidl::encoding::Depth,
412        ) -> fidl::Result<()> {
413            encoder.debug_check_bounds::<VolumeExtendRequest>(offset);
414            // Zero out padding regions. There's no need to apply masks
415            // because the unmasked parts will be overwritten by fields.
416            // Write the fields.
417            self.0.encode(encoder, offset + 0, depth)?;
418            self.1.encode(encoder, offset + 8, depth)?;
419            Ok(())
420        }
421    }
422
423    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeExtendRequest {
424        #[inline(always)]
425        fn new_empty() -> Self {
426            Self { start_slice: fidl::new_empty!(u64, D), slice_count: fidl::new_empty!(u64, D) }
427        }
428
429        #[inline]
430        unsafe fn decode(
431            &mut self,
432            decoder: &mut fidl::encoding::Decoder<'_, D>,
433            offset: usize,
434            _depth: fidl::encoding::Depth,
435        ) -> fidl::Result<()> {
436            decoder.debug_check_bounds::<Self>(offset);
437            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
438            // Verify that padding bytes are zero.
439            // Copy from the buffer into the object.
440            unsafe {
441                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
442            }
443            Ok(())
444        }
445    }
446
447    impl fidl::encoding::ValueTypeMarker for VolumeExtendResponse {
448        type Borrowed<'a> = &'a Self;
449        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
450            value
451        }
452    }
453
454    unsafe impl fidl::encoding::TypeMarker for VolumeExtendResponse {
455        type Owned = Self;
456
457        #[inline(always)]
458        fn inline_align(_context: fidl::encoding::Context) -> usize {
459            4
460        }
461
462        #[inline(always)]
463        fn inline_size(_context: fidl::encoding::Context) -> usize {
464            4
465        }
466        #[inline(always)]
467        fn encode_is_copy() -> bool {
468            true
469        }
470
471        #[inline(always)]
472        fn decode_is_copy() -> bool {
473            true
474        }
475    }
476
477    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeExtendResponse, D>
478        for &VolumeExtendResponse
479    {
480        #[inline]
481        unsafe fn encode(
482            self,
483            encoder: &mut fidl::encoding::Encoder<'_, D>,
484            offset: usize,
485            _depth: fidl::encoding::Depth,
486        ) -> fidl::Result<()> {
487            encoder.debug_check_bounds::<VolumeExtendResponse>(offset);
488            unsafe {
489                // Copy the object into the buffer.
490                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
491                (buf_ptr as *mut VolumeExtendResponse)
492                    .write_unaligned((self as *const VolumeExtendResponse).read());
493                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
494                // done second because the memcpy will write garbage to these bytes.
495            }
496            Ok(())
497        }
498    }
499    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
500        fidl::encoding::Encode<VolumeExtendResponse, D> for (T0,)
501    {
502        #[inline]
503        unsafe fn encode(
504            self,
505            encoder: &mut fidl::encoding::Encoder<'_, D>,
506            offset: usize,
507            depth: fidl::encoding::Depth,
508        ) -> fidl::Result<()> {
509            encoder.debug_check_bounds::<VolumeExtendResponse>(offset);
510            // Zero out padding regions. There's no need to apply masks
511            // because the unmasked parts will be overwritten by fields.
512            // Write the fields.
513            self.0.encode(encoder, offset + 0, depth)?;
514            Ok(())
515        }
516    }
517
518    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeExtendResponse {
519        #[inline(always)]
520        fn new_empty() -> Self {
521            Self { status: fidl::new_empty!(i32, D) }
522        }
523
524        #[inline]
525        unsafe fn decode(
526            &mut self,
527            decoder: &mut fidl::encoding::Decoder<'_, D>,
528            offset: usize,
529            _depth: fidl::encoding::Depth,
530        ) -> fidl::Result<()> {
531            decoder.debug_check_bounds::<Self>(offset);
532            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
533            // Verify that padding bytes are zero.
534            // Copy from the buffer into the object.
535            unsafe {
536                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
537            }
538            Ok(())
539        }
540    }
541
542    impl fidl::encoding::ValueTypeMarker for VolumeGetVolumeInfoResponse {
543        type Borrowed<'a> = &'a Self;
544        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
545            value
546        }
547    }
548
549    unsafe impl fidl::encoding::TypeMarker for VolumeGetVolumeInfoResponse {
550        type Owned = Self;
551
552        #[inline(always)]
553        fn inline_align(_context: fidl::encoding::Context) -> usize {
554            8
555        }
556
557        #[inline(always)]
558        fn inline_size(_context: fidl::encoding::Context) -> usize {
559            24
560        }
561    }
562
563    unsafe impl<D: fidl::encoding::ResourceDialect>
564        fidl::encoding::Encode<VolumeGetVolumeInfoResponse, D> for &VolumeGetVolumeInfoResponse
565    {
566        #[inline]
567        unsafe fn encode(
568            self,
569            encoder: &mut fidl::encoding::Encoder<'_, D>,
570            offset: usize,
571            _depth: fidl::encoding::Depth,
572        ) -> fidl::Result<()> {
573            encoder.debug_check_bounds::<VolumeGetVolumeInfoResponse>(offset);
574            // Delegate to tuple encoding.
575            fidl::encoding::Encode::<VolumeGetVolumeInfoResponse, D>::encode(
576                (
577                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
578                    <fidl::encoding::Boxed<VolumeManagerInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.manager),
579                    <fidl::encoding::Boxed<VolumeInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.volume),
580                ),
581                encoder, offset, _depth
582            )
583        }
584    }
585    unsafe impl<
586            D: fidl::encoding::ResourceDialect,
587            T0: fidl::encoding::Encode<i32, D>,
588            T1: fidl::encoding::Encode<fidl::encoding::Boxed<VolumeManagerInfo>, D>,
589            T2: fidl::encoding::Encode<fidl::encoding::Boxed<VolumeInfo>, D>,
590        > fidl::encoding::Encode<VolumeGetVolumeInfoResponse, D> for (T0, T1, T2)
591    {
592        #[inline]
593        unsafe fn encode(
594            self,
595            encoder: &mut fidl::encoding::Encoder<'_, D>,
596            offset: usize,
597            depth: fidl::encoding::Depth,
598        ) -> fidl::Result<()> {
599            encoder.debug_check_bounds::<VolumeGetVolumeInfoResponse>(offset);
600            // Zero out padding regions. There's no need to apply masks
601            // because the unmasked parts will be overwritten by fields.
602            unsafe {
603                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
604                (ptr as *mut u64).write_unaligned(0);
605            }
606            // Write the fields.
607            self.0.encode(encoder, offset + 0, depth)?;
608            self.1.encode(encoder, offset + 8, depth)?;
609            self.2.encode(encoder, offset + 16, depth)?;
610            Ok(())
611        }
612    }
613
614    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
615        for VolumeGetVolumeInfoResponse
616    {
617        #[inline(always)]
618        fn new_empty() -> Self {
619            Self {
620                status: fidl::new_empty!(i32, D),
621                manager: fidl::new_empty!(fidl::encoding::Boxed<VolumeManagerInfo>, D),
622                volume: fidl::new_empty!(fidl::encoding::Boxed<VolumeInfo>, D),
623            }
624        }
625
626        #[inline]
627        unsafe fn decode(
628            &mut self,
629            decoder: &mut fidl::encoding::Decoder<'_, D>,
630            offset: usize,
631            _depth: fidl::encoding::Depth,
632        ) -> fidl::Result<()> {
633            decoder.debug_check_bounds::<Self>(offset);
634            // Verify that padding bytes are zero.
635            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
636            let padval = unsafe { (ptr as *const u64).read_unaligned() };
637            let mask = 0xffffffff00000000u64;
638            let maskedval = padval & mask;
639            if maskedval != 0 {
640                return Err(fidl::Error::NonZeroPadding {
641                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
642                });
643            }
644            fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
645            fidl::decode!(
646                fidl::encoding::Boxed<VolumeManagerInfo>,
647                D,
648                &mut self.manager,
649                decoder,
650                offset + 8,
651                _depth
652            )?;
653            fidl::decode!(
654                fidl::encoding::Boxed<VolumeInfo>,
655                D,
656                &mut self.volume,
657                decoder,
658                offset + 16,
659                _depth
660            )?;
661            Ok(())
662        }
663    }
664
665    impl fidl::encoding::ValueTypeMarker for VolumeInfo {
666        type Borrowed<'a> = &'a Self;
667        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
668            value
669        }
670    }
671
672    unsafe impl fidl::encoding::TypeMarker for VolumeInfo {
673        type Owned = Self;
674
675        #[inline(always)]
676        fn inline_align(_context: fidl::encoding::Context) -> usize {
677            8
678        }
679
680        #[inline(always)]
681        fn inline_size(_context: fidl::encoding::Context) -> usize {
682            16
683        }
684        #[inline(always)]
685        fn encode_is_copy() -> bool {
686            true
687        }
688
689        #[inline(always)]
690        fn decode_is_copy() -> bool {
691            true
692        }
693    }
694
695    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeInfo, D>
696        for &VolumeInfo
697    {
698        #[inline]
699        unsafe fn encode(
700            self,
701            encoder: &mut fidl::encoding::Encoder<'_, D>,
702            offset: usize,
703            _depth: fidl::encoding::Depth,
704        ) -> fidl::Result<()> {
705            encoder.debug_check_bounds::<VolumeInfo>(offset);
706            unsafe {
707                // Copy the object into the buffer.
708                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
709                (buf_ptr as *mut VolumeInfo).write_unaligned((self as *const VolumeInfo).read());
710                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
711                // done second because the memcpy will write garbage to these bytes.
712            }
713            Ok(())
714        }
715    }
716    unsafe impl<
717            D: fidl::encoding::ResourceDialect,
718            T0: fidl::encoding::Encode<u64, D>,
719            T1: fidl::encoding::Encode<u64, D>,
720        > fidl::encoding::Encode<VolumeInfo, D> for (T0, T1)
721    {
722        #[inline]
723        unsafe fn encode(
724            self,
725            encoder: &mut fidl::encoding::Encoder<'_, D>,
726            offset: usize,
727            depth: fidl::encoding::Depth,
728        ) -> fidl::Result<()> {
729            encoder.debug_check_bounds::<VolumeInfo>(offset);
730            // Zero out padding regions. There's no need to apply masks
731            // because the unmasked parts will be overwritten by fields.
732            // Write the fields.
733            self.0.encode(encoder, offset + 0, depth)?;
734            self.1.encode(encoder, offset + 8, depth)?;
735            Ok(())
736        }
737    }
738
739    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeInfo {
740        #[inline(always)]
741        fn new_empty() -> Self {
742            Self {
743                partition_slice_count: fidl::new_empty!(u64, D),
744                slice_limit: fidl::new_empty!(u64, D),
745            }
746        }
747
748        #[inline]
749        unsafe fn decode(
750            &mut self,
751            decoder: &mut fidl::encoding::Decoder<'_, D>,
752            offset: usize,
753            _depth: fidl::encoding::Depth,
754        ) -> fidl::Result<()> {
755            decoder.debug_check_bounds::<Self>(offset);
756            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
757            // Verify that padding bytes are zero.
758            // Copy from the buffer into the object.
759            unsafe {
760                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
761            }
762            Ok(())
763        }
764    }
765
766    impl fidl::encoding::ValueTypeMarker for VolumeManagerActivateRequest {
767        type Borrowed<'a> = &'a Self;
768        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
769            value
770        }
771    }
772
773    unsafe impl fidl::encoding::TypeMarker for VolumeManagerActivateRequest {
774        type Owned = Self;
775
776        #[inline(always)]
777        fn inline_align(_context: fidl::encoding::Context) -> usize {
778            1
779        }
780
781        #[inline(always)]
782        fn inline_size(_context: fidl::encoding::Context) -> usize {
783            32
784        }
785    }
786
787    unsafe impl<D: fidl::encoding::ResourceDialect>
788        fidl::encoding::Encode<VolumeManagerActivateRequest, D> for &VolumeManagerActivateRequest
789    {
790        #[inline]
791        unsafe fn encode(
792            self,
793            encoder: &mut fidl::encoding::Encoder<'_, D>,
794            offset: usize,
795            _depth: fidl::encoding::Depth,
796        ) -> fidl::Result<()> {
797            encoder.debug_check_bounds::<VolumeManagerActivateRequest>(offset);
798            // Delegate to tuple encoding.
799            fidl::encoding::Encode::<VolumeManagerActivateRequest, D>::encode(
800                (
801                    <fidl_fuchsia_hardware_block_partition__common::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.old_guid),
802                    <fidl_fuchsia_hardware_block_partition__common::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.new_guid),
803                ),
804                encoder, offset, _depth
805            )
806        }
807    }
808    unsafe impl<
809            D: fidl::encoding::ResourceDialect,
810            T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition__common::Guid, D>,
811            T1: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition__common::Guid, D>,
812        > fidl::encoding::Encode<VolumeManagerActivateRequest, D> for (T0, T1)
813    {
814        #[inline]
815        unsafe fn encode(
816            self,
817            encoder: &mut fidl::encoding::Encoder<'_, D>,
818            offset: usize,
819            depth: fidl::encoding::Depth,
820        ) -> fidl::Result<()> {
821            encoder.debug_check_bounds::<VolumeManagerActivateRequest>(offset);
822            // Zero out padding regions. There's no need to apply masks
823            // because the unmasked parts will be overwritten by fields.
824            // Write the fields.
825            self.0.encode(encoder, offset + 0, depth)?;
826            self.1.encode(encoder, offset + 16, depth)?;
827            Ok(())
828        }
829    }
830
831    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
832        for VolumeManagerActivateRequest
833    {
834        #[inline(always)]
835        fn new_empty() -> Self {
836            Self {
837                old_guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition__common::Guid, D),
838                new_guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition__common::Guid, D),
839            }
840        }
841
842        #[inline]
843        unsafe fn decode(
844            &mut self,
845            decoder: &mut fidl::encoding::Decoder<'_, D>,
846            offset: usize,
847            _depth: fidl::encoding::Depth,
848        ) -> fidl::Result<()> {
849            decoder.debug_check_bounds::<Self>(offset);
850            // Verify that padding bytes are zero.
851            fidl::decode!(
852                fidl_fuchsia_hardware_block_partition__common::Guid,
853                D,
854                &mut self.old_guid,
855                decoder,
856                offset + 0,
857                _depth
858            )?;
859            fidl::decode!(
860                fidl_fuchsia_hardware_block_partition__common::Guid,
861                D,
862                &mut self.new_guid,
863                decoder,
864                offset + 16,
865                _depth
866            )?;
867            Ok(())
868        }
869    }
870
871    impl fidl::encoding::ValueTypeMarker for VolumeManagerActivateResponse {
872        type Borrowed<'a> = &'a Self;
873        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
874            value
875        }
876    }
877
878    unsafe impl fidl::encoding::TypeMarker for VolumeManagerActivateResponse {
879        type Owned = Self;
880
881        #[inline(always)]
882        fn inline_align(_context: fidl::encoding::Context) -> usize {
883            4
884        }
885
886        #[inline(always)]
887        fn inline_size(_context: fidl::encoding::Context) -> usize {
888            4
889        }
890        #[inline(always)]
891        fn encode_is_copy() -> bool {
892            true
893        }
894
895        #[inline(always)]
896        fn decode_is_copy() -> bool {
897            true
898        }
899    }
900
901    unsafe impl<D: fidl::encoding::ResourceDialect>
902        fidl::encoding::Encode<VolumeManagerActivateResponse, D>
903        for &VolumeManagerActivateResponse
904    {
905        #[inline]
906        unsafe fn encode(
907            self,
908            encoder: &mut fidl::encoding::Encoder<'_, D>,
909            offset: usize,
910            _depth: fidl::encoding::Depth,
911        ) -> fidl::Result<()> {
912            encoder.debug_check_bounds::<VolumeManagerActivateResponse>(offset);
913            unsafe {
914                // Copy the object into the buffer.
915                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
916                (buf_ptr as *mut VolumeManagerActivateResponse)
917                    .write_unaligned((self as *const VolumeManagerActivateResponse).read());
918                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
919                // done second because the memcpy will write garbage to these bytes.
920            }
921            Ok(())
922        }
923    }
924    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
925        fidl::encoding::Encode<VolumeManagerActivateResponse, D> for (T0,)
926    {
927        #[inline]
928        unsafe fn encode(
929            self,
930            encoder: &mut fidl::encoding::Encoder<'_, D>,
931            offset: usize,
932            depth: fidl::encoding::Depth,
933        ) -> fidl::Result<()> {
934            encoder.debug_check_bounds::<VolumeManagerActivateResponse>(offset);
935            // Zero out padding regions. There's no need to apply masks
936            // because the unmasked parts will be overwritten by fields.
937            // Write the fields.
938            self.0.encode(encoder, offset + 0, depth)?;
939            Ok(())
940        }
941    }
942
943    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
944        for VolumeManagerActivateResponse
945    {
946        #[inline(always)]
947        fn new_empty() -> Self {
948            Self { status: fidl::new_empty!(i32, D) }
949        }
950
951        #[inline]
952        unsafe fn decode(
953            &mut self,
954            decoder: &mut fidl::encoding::Decoder<'_, D>,
955            offset: usize,
956            _depth: fidl::encoding::Depth,
957        ) -> fidl::Result<()> {
958            decoder.debug_check_bounds::<Self>(offset);
959            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
960            // Verify that padding bytes are zero.
961            // Copy from the buffer into the object.
962            unsafe {
963                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
964            }
965            Ok(())
966        }
967    }
968
969    impl fidl::encoding::ValueTypeMarker for VolumeManagerAllocatePartitionRequest {
970        type Borrowed<'a> = &'a Self;
971        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
972            value
973        }
974    }
975
976    unsafe impl fidl::encoding::TypeMarker for VolumeManagerAllocatePartitionRequest {
977        type Owned = Self;
978
979        #[inline(always)]
980        fn inline_align(_context: fidl::encoding::Context) -> usize {
981            8
982        }
983
984        #[inline(always)]
985        fn inline_size(_context: fidl::encoding::Context) -> usize {
986            64
987        }
988    }
989
990    unsafe impl<D: fidl::encoding::ResourceDialect>
991        fidl::encoding::Encode<VolumeManagerAllocatePartitionRequest, D>
992        for &VolumeManagerAllocatePartitionRequest
993    {
994        #[inline]
995        unsafe fn encode(
996            self,
997            encoder: &mut fidl::encoding::Encoder<'_, D>,
998            offset: usize,
999            _depth: fidl::encoding::Depth,
1000        ) -> fidl::Result<()> {
1001            encoder.debug_check_bounds::<VolumeManagerAllocatePartitionRequest>(offset);
1002            // Delegate to tuple encoding.
1003            fidl::encoding::Encode::<VolumeManagerAllocatePartitionRequest, D>::encode(
1004                (
1005                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.slice_count),
1006                    <fidl_fuchsia_hardware_block_partition__common::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
1007                    <fidl_fuchsia_hardware_block_partition__common::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.instance),
1008                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
1009                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
1010                ),
1011                encoder, offset, _depth
1012            )
1013        }
1014    }
1015    unsafe impl<
1016            D: fidl::encoding::ResourceDialect,
1017            T0: fidl::encoding::Encode<u64, D>,
1018            T1: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition__common::Guid, D>,
1019            T2: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition__common::Guid, D>,
1020            T3: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
1021            T4: fidl::encoding::Encode<u32, D>,
1022        > fidl::encoding::Encode<VolumeManagerAllocatePartitionRequest, D>
1023        for (T0, T1, T2, T3, T4)
1024    {
1025        #[inline]
1026        unsafe fn encode(
1027            self,
1028            encoder: &mut fidl::encoding::Encoder<'_, D>,
1029            offset: usize,
1030            depth: fidl::encoding::Depth,
1031        ) -> fidl::Result<()> {
1032            encoder.debug_check_bounds::<VolumeManagerAllocatePartitionRequest>(offset);
1033            // Zero out padding regions. There's no need to apply masks
1034            // because the unmasked parts will be overwritten by fields.
1035            unsafe {
1036                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(56);
1037                (ptr as *mut u64).write_unaligned(0);
1038            }
1039            // Write the fields.
1040            self.0.encode(encoder, offset + 0, depth)?;
1041            self.1.encode(encoder, offset + 8, depth)?;
1042            self.2.encode(encoder, offset + 24, depth)?;
1043            self.3.encode(encoder, offset + 40, depth)?;
1044            self.4.encode(encoder, offset + 56, depth)?;
1045            Ok(())
1046        }
1047    }
1048
1049    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1050        for VolumeManagerAllocatePartitionRequest
1051    {
1052        #[inline(always)]
1053        fn new_empty() -> Self {
1054            Self {
1055                slice_count: fidl::new_empty!(u64, D),
1056                type_: fidl::new_empty!(fidl_fuchsia_hardware_block_partition__common::Guid, D),
1057                instance: fidl::new_empty!(fidl_fuchsia_hardware_block_partition__common::Guid, D),
1058                name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
1059                flags: fidl::new_empty!(u32, D),
1060            }
1061        }
1062
1063        #[inline]
1064        unsafe fn decode(
1065            &mut self,
1066            decoder: &mut fidl::encoding::Decoder<'_, D>,
1067            offset: usize,
1068            _depth: fidl::encoding::Depth,
1069        ) -> fidl::Result<()> {
1070            decoder.debug_check_bounds::<Self>(offset);
1071            // Verify that padding bytes are zero.
1072            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(56) };
1073            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1074            let mask = 0xffffffff00000000u64;
1075            let maskedval = padval & mask;
1076            if maskedval != 0 {
1077                return Err(fidl::Error::NonZeroPadding {
1078                    padding_start: offset + 56 + ((mask as u64).trailing_zeros() / 8) as usize,
1079                });
1080            }
1081            fidl::decode!(u64, D, &mut self.slice_count, decoder, offset + 0, _depth)?;
1082            fidl::decode!(
1083                fidl_fuchsia_hardware_block_partition__common::Guid,
1084                D,
1085                &mut self.type_,
1086                decoder,
1087                offset + 8,
1088                _depth
1089            )?;
1090            fidl::decode!(
1091                fidl_fuchsia_hardware_block_partition__common::Guid,
1092                D,
1093                &mut self.instance,
1094                decoder,
1095                offset + 24,
1096                _depth
1097            )?;
1098            fidl::decode!(
1099                fidl::encoding::BoundedString<128>,
1100                D,
1101                &mut self.name,
1102                decoder,
1103                offset + 40,
1104                _depth
1105            )?;
1106            fidl::decode!(u32, D, &mut self.flags, decoder, offset + 56, _depth)?;
1107            Ok(())
1108        }
1109    }
1110
1111    impl fidl::encoding::ValueTypeMarker for VolumeManagerAllocatePartitionResponse {
1112        type Borrowed<'a> = &'a Self;
1113        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1114            value
1115        }
1116    }
1117
1118    unsafe impl fidl::encoding::TypeMarker for VolumeManagerAllocatePartitionResponse {
1119        type Owned = Self;
1120
1121        #[inline(always)]
1122        fn inline_align(_context: fidl::encoding::Context) -> usize {
1123            4
1124        }
1125
1126        #[inline(always)]
1127        fn inline_size(_context: fidl::encoding::Context) -> usize {
1128            4
1129        }
1130        #[inline(always)]
1131        fn encode_is_copy() -> bool {
1132            true
1133        }
1134
1135        #[inline(always)]
1136        fn decode_is_copy() -> bool {
1137            true
1138        }
1139    }
1140
1141    unsafe impl<D: fidl::encoding::ResourceDialect>
1142        fidl::encoding::Encode<VolumeManagerAllocatePartitionResponse, D>
1143        for &VolumeManagerAllocatePartitionResponse
1144    {
1145        #[inline]
1146        unsafe fn encode(
1147            self,
1148            encoder: &mut fidl::encoding::Encoder<'_, D>,
1149            offset: usize,
1150            _depth: fidl::encoding::Depth,
1151        ) -> fidl::Result<()> {
1152            encoder.debug_check_bounds::<VolumeManagerAllocatePartitionResponse>(offset);
1153            unsafe {
1154                // Copy the object into the buffer.
1155                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1156                (buf_ptr as *mut VolumeManagerAllocatePartitionResponse).write_unaligned(
1157                    (self as *const VolumeManagerAllocatePartitionResponse).read(),
1158                );
1159                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1160                // done second because the memcpy will write garbage to these bytes.
1161            }
1162            Ok(())
1163        }
1164    }
1165    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1166        fidl::encoding::Encode<VolumeManagerAllocatePartitionResponse, D> for (T0,)
1167    {
1168        #[inline]
1169        unsafe fn encode(
1170            self,
1171            encoder: &mut fidl::encoding::Encoder<'_, D>,
1172            offset: usize,
1173            depth: fidl::encoding::Depth,
1174        ) -> fidl::Result<()> {
1175            encoder.debug_check_bounds::<VolumeManagerAllocatePartitionResponse>(offset);
1176            // Zero out padding regions. There's no need to apply masks
1177            // because the unmasked parts will be overwritten by fields.
1178            // Write the fields.
1179            self.0.encode(encoder, offset + 0, depth)?;
1180            Ok(())
1181        }
1182    }
1183
1184    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1185        for VolumeManagerAllocatePartitionResponse
1186    {
1187        #[inline(always)]
1188        fn new_empty() -> Self {
1189            Self { status: fidl::new_empty!(i32, D) }
1190        }
1191
1192        #[inline]
1193        unsafe fn decode(
1194            &mut self,
1195            decoder: &mut fidl::encoding::Decoder<'_, D>,
1196            offset: usize,
1197            _depth: fidl::encoding::Depth,
1198        ) -> fidl::Result<()> {
1199            decoder.debug_check_bounds::<Self>(offset);
1200            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1201            // Verify that padding bytes are zero.
1202            // Copy from the buffer into the object.
1203            unsafe {
1204                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1205            }
1206            Ok(())
1207        }
1208    }
1209
1210    impl fidl::encoding::ValueTypeMarker for VolumeManagerGetInfoResponse {
1211        type Borrowed<'a> = &'a Self;
1212        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1213            value
1214        }
1215    }
1216
1217    unsafe impl fidl::encoding::TypeMarker for VolumeManagerGetInfoResponse {
1218        type Owned = Self;
1219
1220        #[inline(always)]
1221        fn inline_align(_context: fidl::encoding::Context) -> usize {
1222            8
1223        }
1224
1225        #[inline(always)]
1226        fn inline_size(_context: fidl::encoding::Context) -> usize {
1227            16
1228        }
1229    }
1230
1231    unsafe impl<D: fidl::encoding::ResourceDialect>
1232        fidl::encoding::Encode<VolumeManagerGetInfoResponse, D> for &VolumeManagerGetInfoResponse
1233    {
1234        #[inline]
1235        unsafe fn encode(
1236            self,
1237            encoder: &mut fidl::encoding::Encoder<'_, D>,
1238            offset: usize,
1239            _depth: fidl::encoding::Depth,
1240        ) -> fidl::Result<()> {
1241            encoder.debug_check_bounds::<VolumeManagerGetInfoResponse>(offset);
1242            // Delegate to tuple encoding.
1243            fidl::encoding::Encode::<VolumeManagerGetInfoResponse, D>::encode(
1244                (
1245                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
1246                    <fidl::encoding::Boxed<VolumeManagerInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1247                ),
1248                encoder, offset, _depth
1249            )
1250        }
1251    }
1252    unsafe impl<
1253            D: fidl::encoding::ResourceDialect,
1254            T0: fidl::encoding::Encode<i32, D>,
1255            T1: fidl::encoding::Encode<fidl::encoding::Boxed<VolumeManagerInfo>, D>,
1256        > fidl::encoding::Encode<VolumeManagerGetInfoResponse, D> for (T0, T1)
1257    {
1258        #[inline]
1259        unsafe fn encode(
1260            self,
1261            encoder: &mut fidl::encoding::Encoder<'_, D>,
1262            offset: usize,
1263            depth: fidl::encoding::Depth,
1264        ) -> fidl::Result<()> {
1265            encoder.debug_check_bounds::<VolumeManagerGetInfoResponse>(offset);
1266            // Zero out padding regions. There's no need to apply masks
1267            // because the unmasked parts will be overwritten by fields.
1268            unsafe {
1269                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1270                (ptr as *mut u64).write_unaligned(0);
1271            }
1272            // Write the fields.
1273            self.0.encode(encoder, offset + 0, depth)?;
1274            self.1.encode(encoder, offset + 8, depth)?;
1275            Ok(())
1276        }
1277    }
1278
1279    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1280        for VolumeManagerGetInfoResponse
1281    {
1282        #[inline(always)]
1283        fn new_empty() -> Self {
1284            Self {
1285                status: fidl::new_empty!(i32, D),
1286                info: fidl::new_empty!(fidl::encoding::Boxed<VolumeManagerInfo>, D),
1287            }
1288        }
1289
1290        #[inline]
1291        unsafe fn decode(
1292            &mut self,
1293            decoder: &mut fidl::encoding::Decoder<'_, D>,
1294            offset: usize,
1295            _depth: fidl::encoding::Depth,
1296        ) -> fidl::Result<()> {
1297            decoder.debug_check_bounds::<Self>(offset);
1298            // Verify that padding bytes are zero.
1299            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1300            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1301            let mask = 0xffffffff00000000u64;
1302            let maskedval = padval & mask;
1303            if maskedval != 0 {
1304                return Err(fidl::Error::NonZeroPadding {
1305                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1306                });
1307            }
1308            fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
1309            fidl::decode!(
1310                fidl::encoding::Boxed<VolumeManagerInfo>,
1311                D,
1312                &mut self.info,
1313                decoder,
1314                offset + 8,
1315                _depth
1316            )?;
1317            Ok(())
1318        }
1319    }
1320
1321    impl fidl::encoding::ValueTypeMarker for VolumeManagerGetPartitionLimitRequest {
1322        type Borrowed<'a> = &'a Self;
1323        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1324            value
1325        }
1326    }
1327
1328    unsafe impl fidl::encoding::TypeMarker for VolumeManagerGetPartitionLimitRequest {
1329        type Owned = Self;
1330
1331        #[inline(always)]
1332        fn inline_align(_context: fidl::encoding::Context) -> usize {
1333            1
1334        }
1335
1336        #[inline(always)]
1337        fn inline_size(_context: fidl::encoding::Context) -> usize {
1338            16
1339        }
1340    }
1341
1342    unsafe impl<D: fidl::encoding::ResourceDialect>
1343        fidl::encoding::Encode<VolumeManagerGetPartitionLimitRequest, D>
1344        for &VolumeManagerGetPartitionLimitRequest
1345    {
1346        #[inline]
1347        unsafe fn encode(
1348            self,
1349            encoder: &mut fidl::encoding::Encoder<'_, D>,
1350            offset: usize,
1351            _depth: fidl::encoding::Depth,
1352        ) -> fidl::Result<()> {
1353            encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitRequest>(offset);
1354            // Delegate to tuple encoding.
1355            fidl::encoding::Encode::<VolumeManagerGetPartitionLimitRequest, D>::encode(
1356                (
1357                    <fidl_fuchsia_hardware_block_partition__common::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.guid),
1358                ),
1359                encoder, offset, _depth
1360            )
1361        }
1362    }
1363    unsafe impl<
1364            D: fidl::encoding::ResourceDialect,
1365            T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition__common::Guid, D>,
1366        > fidl::encoding::Encode<VolumeManagerGetPartitionLimitRequest, D> for (T0,)
1367    {
1368        #[inline]
1369        unsafe fn encode(
1370            self,
1371            encoder: &mut fidl::encoding::Encoder<'_, D>,
1372            offset: usize,
1373            depth: fidl::encoding::Depth,
1374        ) -> fidl::Result<()> {
1375            encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitRequest>(offset);
1376            // Zero out padding regions. There's no need to apply masks
1377            // because the unmasked parts will be overwritten by fields.
1378            // Write the fields.
1379            self.0.encode(encoder, offset + 0, depth)?;
1380            Ok(())
1381        }
1382    }
1383
1384    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1385        for VolumeManagerGetPartitionLimitRequest
1386    {
1387        #[inline(always)]
1388        fn new_empty() -> Self {
1389            Self { guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition__common::Guid, D) }
1390        }
1391
1392        #[inline]
1393        unsafe fn decode(
1394            &mut self,
1395            decoder: &mut fidl::encoding::Decoder<'_, D>,
1396            offset: usize,
1397            _depth: fidl::encoding::Depth,
1398        ) -> fidl::Result<()> {
1399            decoder.debug_check_bounds::<Self>(offset);
1400            // Verify that padding bytes are zero.
1401            fidl::decode!(
1402                fidl_fuchsia_hardware_block_partition__common::Guid,
1403                D,
1404                &mut self.guid,
1405                decoder,
1406                offset + 0,
1407                _depth
1408            )?;
1409            Ok(())
1410        }
1411    }
1412
1413    impl fidl::encoding::ValueTypeMarker for VolumeManagerGetPartitionLimitResponse {
1414        type Borrowed<'a> = &'a Self;
1415        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1416            value
1417        }
1418    }
1419
1420    unsafe impl fidl::encoding::TypeMarker for VolumeManagerGetPartitionLimitResponse {
1421        type Owned = Self;
1422
1423        #[inline(always)]
1424        fn inline_align(_context: fidl::encoding::Context) -> usize {
1425            8
1426        }
1427
1428        #[inline(always)]
1429        fn inline_size(_context: fidl::encoding::Context) -> usize {
1430            16
1431        }
1432    }
1433
1434    unsafe impl<D: fidl::encoding::ResourceDialect>
1435        fidl::encoding::Encode<VolumeManagerGetPartitionLimitResponse, D>
1436        for &VolumeManagerGetPartitionLimitResponse
1437    {
1438        #[inline]
1439        unsafe fn encode(
1440            self,
1441            encoder: &mut fidl::encoding::Encoder<'_, D>,
1442            offset: usize,
1443            _depth: fidl::encoding::Depth,
1444        ) -> fidl::Result<()> {
1445            encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitResponse>(offset);
1446            unsafe {
1447                // Copy the object into the buffer.
1448                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1449                (buf_ptr as *mut VolumeManagerGetPartitionLimitResponse).write_unaligned(
1450                    (self as *const VolumeManagerGetPartitionLimitResponse).read(),
1451                );
1452                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1453                // done second because the memcpy will write garbage to these bytes.
1454                let padding_ptr = buf_ptr.offset(0) as *mut u64;
1455                let padding_mask = 0xffffffff00000000u64;
1456                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
1457            }
1458            Ok(())
1459        }
1460    }
1461    unsafe impl<
1462            D: fidl::encoding::ResourceDialect,
1463            T0: fidl::encoding::Encode<i32, D>,
1464            T1: fidl::encoding::Encode<u64, D>,
1465        > fidl::encoding::Encode<VolumeManagerGetPartitionLimitResponse, D> for (T0, T1)
1466    {
1467        #[inline]
1468        unsafe fn encode(
1469            self,
1470            encoder: &mut fidl::encoding::Encoder<'_, D>,
1471            offset: usize,
1472            depth: fidl::encoding::Depth,
1473        ) -> fidl::Result<()> {
1474            encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitResponse>(offset);
1475            // Zero out padding regions. There's no need to apply masks
1476            // because the unmasked parts will be overwritten by fields.
1477            unsafe {
1478                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1479                (ptr as *mut u64).write_unaligned(0);
1480            }
1481            // Write the fields.
1482            self.0.encode(encoder, offset + 0, depth)?;
1483            self.1.encode(encoder, offset + 8, depth)?;
1484            Ok(())
1485        }
1486    }
1487
1488    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1489        for VolumeManagerGetPartitionLimitResponse
1490    {
1491        #[inline(always)]
1492        fn new_empty() -> Self {
1493            Self { status: fidl::new_empty!(i32, D), slice_count: fidl::new_empty!(u64, D) }
1494        }
1495
1496        #[inline]
1497        unsafe fn decode(
1498            &mut self,
1499            decoder: &mut fidl::encoding::Decoder<'_, D>,
1500            offset: usize,
1501            _depth: fidl::encoding::Depth,
1502        ) -> fidl::Result<()> {
1503            decoder.debug_check_bounds::<Self>(offset);
1504            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1505            // Verify that padding bytes are zero.
1506            let ptr = unsafe { buf_ptr.offset(0) };
1507            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1508            let mask = 0xffffffff00000000u64;
1509            let maskedval = padval & mask;
1510            if maskedval != 0 {
1511                return Err(fidl::Error::NonZeroPadding {
1512                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1513                });
1514            }
1515            // Copy from the buffer into the object.
1516            unsafe {
1517                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
1518            }
1519            Ok(())
1520        }
1521    }
1522
1523    impl fidl::encoding::ValueTypeMarker for VolumeManagerInfo {
1524        type Borrowed<'a> = &'a Self;
1525        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1526            value
1527        }
1528    }
1529
1530    unsafe impl fidl::encoding::TypeMarker for VolumeManagerInfo {
1531        type Owned = Self;
1532
1533        #[inline(always)]
1534        fn inline_align(_context: fidl::encoding::Context) -> usize {
1535            8
1536        }
1537
1538        #[inline(always)]
1539        fn inline_size(_context: fidl::encoding::Context) -> usize {
1540            40
1541        }
1542        #[inline(always)]
1543        fn encode_is_copy() -> bool {
1544            true
1545        }
1546
1547        #[inline(always)]
1548        fn decode_is_copy() -> bool {
1549            true
1550        }
1551    }
1552
1553    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeManagerInfo, D>
1554        for &VolumeManagerInfo
1555    {
1556        #[inline]
1557        unsafe fn encode(
1558            self,
1559            encoder: &mut fidl::encoding::Encoder<'_, D>,
1560            offset: usize,
1561            _depth: fidl::encoding::Depth,
1562        ) -> fidl::Result<()> {
1563            encoder.debug_check_bounds::<VolumeManagerInfo>(offset);
1564            unsafe {
1565                // Copy the object into the buffer.
1566                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1567                (buf_ptr as *mut VolumeManagerInfo)
1568                    .write_unaligned((self as *const VolumeManagerInfo).read());
1569                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1570                // done second because the memcpy will write garbage to these bytes.
1571            }
1572            Ok(())
1573        }
1574    }
1575    unsafe impl<
1576            D: fidl::encoding::ResourceDialect,
1577            T0: fidl::encoding::Encode<u64, D>,
1578            T1: fidl::encoding::Encode<u64, D>,
1579            T2: fidl::encoding::Encode<u64, D>,
1580            T3: fidl::encoding::Encode<u64, D>,
1581            T4: fidl::encoding::Encode<u64, D>,
1582        > fidl::encoding::Encode<VolumeManagerInfo, D> for (T0, T1, T2, T3, T4)
1583    {
1584        #[inline]
1585        unsafe fn encode(
1586            self,
1587            encoder: &mut fidl::encoding::Encoder<'_, D>,
1588            offset: usize,
1589            depth: fidl::encoding::Depth,
1590        ) -> fidl::Result<()> {
1591            encoder.debug_check_bounds::<VolumeManagerInfo>(offset);
1592            // Zero out padding regions. There's no need to apply masks
1593            // because the unmasked parts will be overwritten by fields.
1594            // Write the fields.
1595            self.0.encode(encoder, offset + 0, depth)?;
1596            self.1.encode(encoder, offset + 8, depth)?;
1597            self.2.encode(encoder, offset + 16, depth)?;
1598            self.3.encode(encoder, offset + 24, depth)?;
1599            self.4.encode(encoder, offset + 32, depth)?;
1600            Ok(())
1601        }
1602    }
1603
1604    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeManagerInfo {
1605        #[inline(always)]
1606        fn new_empty() -> Self {
1607            Self {
1608                slice_size: fidl::new_empty!(u64, D),
1609                slice_count: fidl::new_empty!(u64, D),
1610                assigned_slice_count: fidl::new_empty!(u64, D),
1611                maximum_slice_count: fidl::new_empty!(u64, D),
1612                max_virtual_slice: fidl::new_empty!(u64, D),
1613            }
1614        }
1615
1616        #[inline]
1617        unsafe fn decode(
1618            &mut self,
1619            decoder: &mut fidl::encoding::Decoder<'_, D>,
1620            offset: usize,
1621            _depth: fidl::encoding::Depth,
1622        ) -> fidl::Result<()> {
1623            decoder.debug_check_bounds::<Self>(offset);
1624            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1625            // Verify that padding bytes are zero.
1626            // Copy from the buffer into the object.
1627            unsafe {
1628                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 40);
1629            }
1630            Ok(())
1631        }
1632    }
1633
1634    impl fidl::encoding::ValueTypeMarker for VolumeManagerSetPartitionLimitRequest {
1635        type Borrowed<'a> = &'a Self;
1636        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1637            value
1638        }
1639    }
1640
1641    unsafe impl fidl::encoding::TypeMarker for VolumeManagerSetPartitionLimitRequest {
1642        type Owned = Self;
1643
1644        #[inline(always)]
1645        fn inline_align(_context: fidl::encoding::Context) -> usize {
1646            8
1647        }
1648
1649        #[inline(always)]
1650        fn inline_size(_context: fidl::encoding::Context) -> usize {
1651            24
1652        }
1653    }
1654
1655    unsafe impl<D: fidl::encoding::ResourceDialect>
1656        fidl::encoding::Encode<VolumeManagerSetPartitionLimitRequest, D>
1657        for &VolumeManagerSetPartitionLimitRequest
1658    {
1659        #[inline]
1660        unsafe fn encode(
1661            self,
1662            encoder: &mut fidl::encoding::Encoder<'_, D>,
1663            offset: usize,
1664            _depth: fidl::encoding::Depth,
1665        ) -> fidl::Result<()> {
1666            encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitRequest>(offset);
1667            // Delegate to tuple encoding.
1668            fidl::encoding::Encode::<VolumeManagerSetPartitionLimitRequest, D>::encode(
1669                (
1670                    <fidl_fuchsia_hardware_block_partition__common::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.guid),
1671                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.slice_count),
1672                ),
1673                encoder, offset, _depth
1674            )
1675        }
1676    }
1677    unsafe impl<
1678            D: fidl::encoding::ResourceDialect,
1679            T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition__common::Guid, D>,
1680            T1: fidl::encoding::Encode<u64, D>,
1681        > fidl::encoding::Encode<VolumeManagerSetPartitionLimitRequest, D> for (T0, T1)
1682    {
1683        #[inline]
1684        unsafe fn encode(
1685            self,
1686            encoder: &mut fidl::encoding::Encoder<'_, D>,
1687            offset: usize,
1688            depth: fidl::encoding::Depth,
1689        ) -> fidl::Result<()> {
1690            encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitRequest>(offset);
1691            // Zero out padding regions. There's no need to apply masks
1692            // because the unmasked parts will be overwritten by fields.
1693            // Write the fields.
1694            self.0.encode(encoder, offset + 0, depth)?;
1695            self.1.encode(encoder, offset + 16, depth)?;
1696            Ok(())
1697        }
1698    }
1699
1700    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1701        for VolumeManagerSetPartitionLimitRequest
1702    {
1703        #[inline(always)]
1704        fn new_empty() -> Self {
1705            Self {
1706                guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition__common::Guid, D),
1707                slice_count: fidl::new_empty!(u64, D),
1708            }
1709        }
1710
1711        #[inline]
1712        unsafe fn decode(
1713            &mut self,
1714            decoder: &mut fidl::encoding::Decoder<'_, D>,
1715            offset: usize,
1716            _depth: fidl::encoding::Depth,
1717        ) -> fidl::Result<()> {
1718            decoder.debug_check_bounds::<Self>(offset);
1719            // Verify that padding bytes are zero.
1720            fidl::decode!(
1721                fidl_fuchsia_hardware_block_partition__common::Guid,
1722                D,
1723                &mut self.guid,
1724                decoder,
1725                offset + 0,
1726                _depth
1727            )?;
1728            fidl::decode!(u64, D, &mut self.slice_count, decoder, offset + 16, _depth)?;
1729            Ok(())
1730        }
1731    }
1732
1733    impl fidl::encoding::ValueTypeMarker for VolumeManagerSetPartitionLimitResponse {
1734        type Borrowed<'a> = &'a Self;
1735        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1736            value
1737        }
1738    }
1739
1740    unsafe impl fidl::encoding::TypeMarker for VolumeManagerSetPartitionLimitResponse {
1741        type Owned = Self;
1742
1743        #[inline(always)]
1744        fn inline_align(_context: fidl::encoding::Context) -> usize {
1745            4
1746        }
1747
1748        #[inline(always)]
1749        fn inline_size(_context: fidl::encoding::Context) -> usize {
1750            4
1751        }
1752        #[inline(always)]
1753        fn encode_is_copy() -> bool {
1754            true
1755        }
1756
1757        #[inline(always)]
1758        fn decode_is_copy() -> bool {
1759            true
1760        }
1761    }
1762
1763    unsafe impl<D: fidl::encoding::ResourceDialect>
1764        fidl::encoding::Encode<VolumeManagerSetPartitionLimitResponse, D>
1765        for &VolumeManagerSetPartitionLimitResponse
1766    {
1767        #[inline]
1768        unsafe fn encode(
1769            self,
1770            encoder: &mut fidl::encoding::Encoder<'_, D>,
1771            offset: usize,
1772            _depth: fidl::encoding::Depth,
1773        ) -> fidl::Result<()> {
1774            encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitResponse>(offset);
1775            unsafe {
1776                // Copy the object into the buffer.
1777                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1778                (buf_ptr as *mut VolumeManagerSetPartitionLimitResponse).write_unaligned(
1779                    (self as *const VolumeManagerSetPartitionLimitResponse).read(),
1780                );
1781                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1782                // done second because the memcpy will write garbage to these bytes.
1783            }
1784            Ok(())
1785        }
1786    }
1787    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1788        fidl::encoding::Encode<VolumeManagerSetPartitionLimitResponse, D> for (T0,)
1789    {
1790        #[inline]
1791        unsafe fn encode(
1792            self,
1793            encoder: &mut fidl::encoding::Encoder<'_, D>,
1794            offset: usize,
1795            depth: fidl::encoding::Depth,
1796        ) -> fidl::Result<()> {
1797            encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitResponse>(offset);
1798            // Zero out padding regions. There's no need to apply masks
1799            // because the unmasked parts will be overwritten by fields.
1800            // Write the fields.
1801            self.0.encode(encoder, offset + 0, depth)?;
1802            Ok(())
1803        }
1804    }
1805
1806    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1807        for VolumeManagerSetPartitionLimitResponse
1808    {
1809        #[inline(always)]
1810        fn new_empty() -> Self {
1811            Self { status: fidl::new_empty!(i32, D) }
1812        }
1813
1814        #[inline]
1815        unsafe fn decode(
1816            &mut self,
1817            decoder: &mut fidl::encoding::Decoder<'_, D>,
1818            offset: usize,
1819            _depth: fidl::encoding::Depth,
1820        ) -> fidl::Result<()> {
1821            decoder.debug_check_bounds::<Self>(offset);
1822            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1823            // Verify that padding bytes are zero.
1824            // Copy from the buffer into the object.
1825            unsafe {
1826                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1827            }
1828            Ok(())
1829        }
1830    }
1831
1832    impl fidl::encoding::ValueTypeMarker for VolumeManagerSetPartitionNameRequest {
1833        type Borrowed<'a> = &'a Self;
1834        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1835            value
1836        }
1837    }
1838
1839    unsafe impl fidl::encoding::TypeMarker for VolumeManagerSetPartitionNameRequest {
1840        type Owned = Self;
1841
1842        #[inline(always)]
1843        fn inline_align(_context: fidl::encoding::Context) -> usize {
1844            8
1845        }
1846
1847        #[inline(always)]
1848        fn inline_size(_context: fidl::encoding::Context) -> usize {
1849            32
1850        }
1851    }
1852
1853    unsafe impl<D: fidl::encoding::ResourceDialect>
1854        fidl::encoding::Encode<VolumeManagerSetPartitionNameRequest, D>
1855        for &VolumeManagerSetPartitionNameRequest
1856    {
1857        #[inline]
1858        unsafe fn encode(
1859            self,
1860            encoder: &mut fidl::encoding::Encoder<'_, D>,
1861            offset: usize,
1862            _depth: fidl::encoding::Depth,
1863        ) -> fidl::Result<()> {
1864            encoder.debug_check_bounds::<VolumeManagerSetPartitionNameRequest>(offset);
1865            // Delegate to tuple encoding.
1866            fidl::encoding::Encode::<VolumeManagerSetPartitionNameRequest, D>::encode(
1867                (
1868                    <fidl_fuchsia_hardware_block_partition__common::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.guid),
1869                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
1870                ),
1871                encoder, offset, _depth
1872            )
1873        }
1874    }
1875    unsafe impl<
1876            D: fidl::encoding::ResourceDialect,
1877            T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition__common::Guid, D>,
1878            T1: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
1879        > fidl::encoding::Encode<VolumeManagerSetPartitionNameRequest, D> for (T0, T1)
1880    {
1881        #[inline]
1882        unsafe fn encode(
1883            self,
1884            encoder: &mut fidl::encoding::Encoder<'_, D>,
1885            offset: usize,
1886            depth: fidl::encoding::Depth,
1887        ) -> fidl::Result<()> {
1888            encoder.debug_check_bounds::<VolumeManagerSetPartitionNameRequest>(offset);
1889            // Zero out padding regions. There's no need to apply masks
1890            // because the unmasked parts will be overwritten by fields.
1891            // Write the fields.
1892            self.0.encode(encoder, offset + 0, depth)?;
1893            self.1.encode(encoder, offset + 16, depth)?;
1894            Ok(())
1895        }
1896    }
1897
1898    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1899        for VolumeManagerSetPartitionNameRequest
1900    {
1901        #[inline(always)]
1902        fn new_empty() -> Self {
1903            Self {
1904                guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition__common::Guid, D),
1905                name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
1906            }
1907        }
1908
1909        #[inline]
1910        unsafe fn decode(
1911            &mut self,
1912            decoder: &mut fidl::encoding::Decoder<'_, D>,
1913            offset: usize,
1914            _depth: fidl::encoding::Depth,
1915        ) -> fidl::Result<()> {
1916            decoder.debug_check_bounds::<Self>(offset);
1917            // Verify that padding bytes are zero.
1918            fidl::decode!(
1919                fidl_fuchsia_hardware_block_partition__common::Guid,
1920                D,
1921                &mut self.guid,
1922                decoder,
1923                offset + 0,
1924                _depth
1925            )?;
1926            fidl::decode!(
1927                fidl::encoding::BoundedString<128>,
1928                D,
1929                &mut self.name,
1930                decoder,
1931                offset + 16,
1932                _depth
1933            )?;
1934            Ok(())
1935        }
1936    }
1937
1938    impl fidl::encoding::ValueTypeMarker for VolumeQuerySlicesRequest {
1939        type Borrowed<'a> = &'a Self;
1940        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1941            value
1942        }
1943    }
1944
1945    unsafe impl fidl::encoding::TypeMarker for VolumeQuerySlicesRequest {
1946        type Owned = Self;
1947
1948        #[inline(always)]
1949        fn inline_align(_context: fidl::encoding::Context) -> usize {
1950            8
1951        }
1952
1953        #[inline(always)]
1954        fn inline_size(_context: fidl::encoding::Context) -> usize {
1955            16
1956        }
1957    }
1958
1959    unsafe impl<D: fidl::encoding::ResourceDialect>
1960        fidl::encoding::Encode<VolumeQuerySlicesRequest, D> for &VolumeQuerySlicesRequest
1961    {
1962        #[inline]
1963        unsafe fn encode(
1964            self,
1965            encoder: &mut fidl::encoding::Encoder<'_, D>,
1966            offset: usize,
1967            _depth: fidl::encoding::Depth,
1968        ) -> fidl::Result<()> {
1969            encoder.debug_check_bounds::<VolumeQuerySlicesRequest>(offset);
1970            // Delegate to tuple encoding.
1971            fidl::encoding::Encode::<VolumeQuerySlicesRequest, D>::encode(
1972                (<fidl::encoding::Vector<u64, 16> as fidl::encoding::ValueTypeMarker>::borrow(
1973                    &self.start_slices,
1974                ),),
1975                encoder,
1976                offset,
1977                _depth,
1978            )
1979        }
1980    }
1981    unsafe impl<
1982            D: fidl::encoding::ResourceDialect,
1983            T0: fidl::encoding::Encode<fidl::encoding::Vector<u64, 16>, D>,
1984        > fidl::encoding::Encode<VolumeQuerySlicesRequest, D> for (T0,)
1985    {
1986        #[inline]
1987        unsafe fn encode(
1988            self,
1989            encoder: &mut fidl::encoding::Encoder<'_, D>,
1990            offset: usize,
1991            depth: fidl::encoding::Depth,
1992        ) -> fidl::Result<()> {
1993            encoder.debug_check_bounds::<VolumeQuerySlicesRequest>(offset);
1994            // Zero out padding regions. There's no need to apply masks
1995            // because the unmasked parts will be overwritten by fields.
1996            // Write the fields.
1997            self.0.encode(encoder, offset + 0, depth)?;
1998            Ok(())
1999        }
2000    }
2001
2002    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2003        for VolumeQuerySlicesRequest
2004    {
2005        #[inline(always)]
2006        fn new_empty() -> Self {
2007            Self { start_slices: fidl::new_empty!(fidl::encoding::Vector<u64, 16>, D) }
2008        }
2009
2010        #[inline]
2011        unsafe fn decode(
2012            &mut self,
2013            decoder: &mut fidl::encoding::Decoder<'_, D>,
2014            offset: usize,
2015            _depth: fidl::encoding::Depth,
2016        ) -> fidl::Result<()> {
2017            decoder.debug_check_bounds::<Self>(offset);
2018            // Verify that padding bytes are zero.
2019            fidl::decode!(fidl::encoding::Vector<u64, 16>, D, &mut self.start_slices, decoder, offset + 0, _depth)?;
2020            Ok(())
2021        }
2022    }
2023
2024    impl fidl::encoding::ValueTypeMarker for VolumeQuerySlicesResponse {
2025        type Borrowed<'a> = &'a Self;
2026        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2027            value
2028        }
2029    }
2030
2031    unsafe impl fidl::encoding::TypeMarker for VolumeQuerySlicesResponse {
2032        type Owned = Self;
2033
2034        #[inline(always)]
2035        fn inline_align(_context: fidl::encoding::Context) -> usize {
2036            8
2037        }
2038
2039        #[inline(always)]
2040        fn inline_size(_context: fidl::encoding::Context) -> usize {
2041            272
2042        }
2043    }
2044
2045    unsafe impl<D: fidl::encoding::ResourceDialect>
2046        fidl::encoding::Encode<VolumeQuerySlicesResponse, D> for &VolumeQuerySlicesResponse
2047    {
2048        #[inline]
2049        unsafe fn encode(
2050            self,
2051            encoder: &mut fidl::encoding::Encoder<'_, D>,
2052            offset: usize,
2053            _depth: fidl::encoding::Depth,
2054        ) -> fidl::Result<()> {
2055            encoder.debug_check_bounds::<VolumeQuerySlicesResponse>(offset);
2056            // Delegate to tuple encoding.
2057            fidl::encoding::Encode::<VolumeQuerySlicesResponse, D>::encode(
2058                (
2059                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
2060                    <fidl::encoding::Array<VsliceRange, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.response),
2061                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.response_count),
2062                ),
2063                encoder, offset, _depth
2064            )
2065        }
2066    }
2067    unsafe impl<
2068            D: fidl::encoding::ResourceDialect,
2069            T0: fidl::encoding::Encode<i32, D>,
2070            T1: fidl::encoding::Encode<fidl::encoding::Array<VsliceRange, 16>, D>,
2071            T2: fidl::encoding::Encode<u64, D>,
2072        > fidl::encoding::Encode<VolumeQuerySlicesResponse, D> for (T0, T1, T2)
2073    {
2074        #[inline]
2075        unsafe fn encode(
2076            self,
2077            encoder: &mut fidl::encoding::Encoder<'_, D>,
2078            offset: usize,
2079            depth: fidl::encoding::Depth,
2080        ) -> fidl::Result<()> {
2081            encoder.debug_check_bounds::<VolumeQuerySlicesResponse>(offset);
2082            // Zero out padding regions. There's no need to apply masks
2083            // because the unmasked parts will be overwritten by fields.
2084            unsafe {
2085                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2086                (ptr as *mut u64).write_unaligned(0);
2087            }
2088            // Write the fields.
2089            self.0.encode(encoder, offset + 0, depth)?;
2090            self.1.encode(encoder, offset + 8, depth)?;
2091            self.2.encode(encoder, offset + 264, depth)?;
2092            Ok(())
2093        }
2094    }
2095
2096    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2097        for VolumeQuerySlicesResponse
2098    {
2099        #[inline(always)]
2100        fn new_empty() -> Self {
2101            Self {
2102                status: fidl::new_empty!(i32, D),
2103                response: fidl::new_empty!(fidl::encoding::Array<VsliceRange, 16>, D),
2104                response_count: fidl::new_empty!(u64, D),
2105            }
2106        }
2107
2108        #[inline]
2109        unsafe fn decode(
2110            &mut self,
2111            decoder: &mut fidl::encoding::Decoder<'_, D>,
2112            offset: usize,
2113            _depth: fidl::encoding::Depth,
2114        ) -> fidl::Result<()> {
2115            decoder.debug_check_bounds::<Self>(offset);
2116            // Verify that padding bytes are zero.
2117            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2118            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2119            let mask = 0xffffffff00000000u64;
2120            let maskedval = padval & mask;
2121            if maskedval != 0 {
2122                return Err(fidl::Error::NonZeroPadding {
2123                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2124                });
2125            }
2126            fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
2127            fidl::decode!(fidl::encoding::Array<VsliceRange, 16>, D, &mut self.response, decoder, offset + 8, _depth)?;
2128            fidl::decode!(u64, D, &mut self.response_count, decoder, offset + 264, _depth)?;
2129            Ok(())
2130        }
2131    }
2132
2133    impl fidl::encoding::ValueTypeMarker for VolumeShrinkRequest {
2134        type Borrowed<'a> = &'a Self;
2135        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2136            value
2137        }
2138    }
2139
2140    unsafe impl fidl::encoding::TypeMarker for VolumeShrinkRequest {
2141        type Owned = Self;
2142
2143        #[inline(always)]
2144        fn inline_align(_context: fidl::encoding::Context) -> usize {
2145            8
2146        }
2147
2148        #[inline(always)]
2149        fn inline_size(_context: fidl::encoding::Context) -> usize {
2150            16
2151        }
2152        #[inline(always)]
2153        fn encode_is_copy() -> bool {
2154            true
2155        }
2156
2157        #[inline(always)]
2158        fn decode_is_copy() -> bool {
2159            true
2160        }
2161    }
2162
2163    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeShrinkRequest, D>
2164        for &VolumeShrinkRequest
2165    {
2166        #[inline]
2167        unsafe fn encode(
2168            self,
2169            encoder: &mut fidl::encoding::Encoder<'_, D>,
2170            offset: usize,
2171            _depth: fidl::encoding::Depth,
2172        ) -> fidl::Result<()> {
2173            encoder.debug_check_bounds::<VolumeShrinkRequest>(offset);
2174            unsafe {
2175                // Copy the object into the buffer.
2176                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2177                (buf_ptr as *mut VolumeShrinkRequest)
2178                    .write_unaligned((self as *const VolumeShrinkRequest).read());
2179                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2180                // done second because the memcpy will write garbage to these bytes.
2181            }
2182            Ok(())
2183        }
2184    }
2185    unsafe impl<
2186            D: fidl::encoding::ResourceDialect,
2187            T0: fidl::encoding::Encode<u64, D>,
2188            T1: fidl::encoding::Encode<u64, D>,
2189        > fidl::encoding::Encode<VolumeShrinkRequest, D> for (T0, T1)
2190    {
2191        #[inline]
2192        unsafe fn encode(
2193            self,
2194            encoder: &mut fidl::encoding::Encoder<'_, D>,
2195            offset: usize,
2196            depth: fidl::encoding::Depth,
2197        ) -> fidl::Result<()> {
2198            encoder.debug_check_bounds::<VolumeShrinkRequest>(offset);
2199            // Zero out padding regions. There's no need to apply masks
2200            // because the unmasked parts will be overwritten by fields.
2201            // Write the fields.
2202            self.0.encode(encoder, offset + 0, depth)?;
2203            self.1.encode(encoder, offset + 8, depth)?;
2204            Ok(())
2205        }
2206    }
2207
2208    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeShrinkRequest {
2209        #[inline(always)]
2210        fn new_empty() -> Self {
2211            Self { start_slice: fidl::new_empty!(u64, D), slice_count: fidl::new_empty!(u64, D) }
2212        }
2213
2214        #[inline]
2215        unsafe fn decode(
2216            &mut self,
2217            decoder: &mut fidl::encoding::Decoder<'_, D>,
2218            offset: usize,
2219            _depth: fidl::encoding::Depth,
2220        ) -> fidl::Result<()> {
2221            decoder.debug_check_bounds::<Self>(offset);
2222            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2223            // Verify that padding bytes are zero.
2224            // Copy from the buffer into the object.
2225            unsafe {
2226                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2227            }
2228            Ok(())
2229        }
2230    }
2231
2232    impl fidl::encoding::ValueTypeMarker for VolumeShrinkResponse {
2233        type Borrowed<'a> = &'a Self;
2234        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2235            value
2236        }
2237    }
2238
2239    unsafe impl fidl::encoding::TypeMarker for VolumeShrinkResponse {
2240        type Owned = Self;
2241
2242        #[inline(always)]
2243        fn inline_align(_context: fidl::encoding::Context) -> usize {
2244            4
2245        }
2246
2247        #[inline(always)]
2248        fn inline_size(_context: fidl::encoding::Context) -> usize {
2249            4
2250        }
2251        #[inline(always)]
2252        fn encode_is_copy() -> bool {
2253            true
2254        }
2255
2256        #[inline(always)]
2257        fn decode_is_copy() -> bool {
2258            true
2259        }
2260    }
2261
2262    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeShrinkResponse, D>
2263        for &VolumeShrinkResponse
2264    {
2265        #[inline]
2266        unsafe fn encode(
2267            self,
2268            encoder: &mut fidl::encoding::Encoder<'_, D>,
2269            offset: usize,
2270            _depth: fidl::encoding::Depth,
2271        ) -> fidl::Result<()> {
2272            encoder.debug_check_bounds::<VolumeShrinkResponse>(offset);
2273            unsafe {
2274                // Copy the object into the buffer.
2275                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2276                (buf_ptr as *mut VolumeShrinkResponse)
2277                    .write_unaligned((self as *const VolumeShrinkResponse).read());
2278                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2279                // done second because the memcpy will write garbage to these bytes.
2280            }
2281            Ok(())
2282        }
2283    }
2284    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2285        fidl::encoding::Encode<VolumeShrinkResponse, D> for (T0,)
2286    {
2287        #[inline]
2288        unsafe fn encode(
2289            self,
2290            encoder: &mut fidl::encoding::Encoder<'_, D>,
2291            offset: usize,
2292            depth: fidl::encoding::Depth,
2293        ) -> fidl::Result<()> {
2294            encoder.debug_check_bounds::<VolumeShrinkResponse>(offset);
2295            // Zero out padding regions. There's no need to apply masks
2296            // because the unmasked parts will be overwritten by fields.
2297            // Write the fields.
2298            self.0.encode(encoder, offset + 0, depth)?;
2299            Ok(())
2300        }
2301    }
2302
2303    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeShrinkResponse {
2304        #[inline(always)]
2305        fn new_empty() -> Self {
2306            Self { status: fidl::new_empty!(i32, D) }
2307        }
2308
2309        #[inline]
2310        unsafe fn decode(
2311            &mut self,
2312            decoder: &mut fidl::encoding::Decoder<'_, D>,
2313            offset: usize,
2314            _depth: fidl::encoding::Depth,
2315        ) -> fidl::Result<()> {
2316            decoder.debug_check_bounds::<Self>(offset);
2317            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2318            // Verify that padding bytes are zero.
2319            // Copy from the buffer into the object.
2320            unsafe {
2321                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2322            }
2323            Ok(())
2324        }
2325    }
2326
2327    impl fidl::encoding::ValueTypeMarker for VsliceRange {
2328        type Borrowed<'a> = &'a Self;
2329        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2330            value
2331        }
2332    }
2333
2334    unsafe impl fidl::encoding::TypeMarker for VsliceRange {
2335        type Owned = Self;
2336
2337        #[inline(always)]
2338        fn inline_align(_context: fidl::encoding::Context) -> usize {
2339            8
2340        }
2341
2342        #[inline(always)]
2343        fn inline_size(_context: fidl::encoding::Context) -> usize {
2344            16
2345        }
2346    }
2347
2348    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VsliceRange, D>
2349        for &VsliceRange
2350    {
2351        #[inline]
2352        unsafe fn encode(
2353            self,
2354            encoder: &mut fidl::encoding::Encoder<'_, D>,
2355            offset: usize,
2356            _depth: fidl::encoding::Depth,
2357        ) -> fidl::Result<()> {
2358            encoder.debug_check_bounds::<VsliceRange>(offset);
2359            // Delegate to tuple encoding.
2360            fidl::encoding::Encode::<VsliceRange, D>::encode(
2361                (
2362                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.allocated),
2363                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.count),
2364                ),
2365                encoder,
2366                offset,
2367                _depth,
2368            )
2369        }
2370    }
2371    unsafe impl<
2372            D: fidl::encoding::ResourceDialect,
2373            T0: fidl::encoding::Encode<bool, D>,
2374            T1: fidl::encoding::Encode<u64, D>,
2375        > fidl::encoding::Encode<VsliceRange, D> for (T0, T1)
2376    {
2377        #[inline]
2378        unsafe fn encode(
2379            self,
2380            encoder: &mut fidl::encoding::Encoder<'_, D>,
2381            offset: usize,
2382            depth: fidl::encoding::Depth,
2383        ) -> fidl::Result<()> {
2384            encoder.debug_check_bounds::<VsliceRange>(offset);
2385            // Zero out padding regions. There's no need to apply masks
2386            // because the unmasked parts will be overwritten by fields.
2387            unsafe {
2388                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2389                (ptr as *mut u64).write_unaligned(0);
2390            }
2391            // Write the fields.
2392            self.0.encode(encoder, offset + 0, depth)?;
2393            self.1.encode(encoder, offset + 8, depth)?;
2394            Ok(())
2395        }
2396    }
2397
2398    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VsliceRange {
2399        #[inline(always)]
2400        fn new_empty() -> Self {
2401            Self { allocated: fidl::new_empty!(bool, D), count: fidl::new_empty!(u64, D) }
2402        }
2403
2404        #[inline]
2405        unsafe fn decode(
2406            &mut self,
2407            decoder: &mut fidl::encoding::Decoder<'_, D>,
2408            offset: usize,
2409            _depth: fidl::encoding::Depth,
2410        ) -> fidl::Result<()> {
2411            decoder.debug_check_bounds::<Self>(offset);
2412            // Verify that padding bytes are zero.
2413            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2414            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2415            let mask = 0xffffffffffffff00u64;
2416            let maskedval = padval & mask;
2417            if maskedval != 0 {
2418                return Err(fidl::Error::NonZeroPadding {
2419                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2420                });
2421            }
2422            fidl::decode!(bool, D, &mut self.allocated, decoder, offset + 0, _depth)?;
2423            fidl::decode!(u64, D, &mut self.count, decoder, offset + 8, _depth)?;
2424            Ok(())
2425        }
2426    }
2427}