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