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