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