Skip to main content

fidl_fuchsia_fxfs__common/
fidl_fuchsia_fxfs__common.rs

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