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