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