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