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