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