1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
13#[repr(u32)]
14pub enum CreateBlobError {
15 AlreadyExists = 1,
17 Internal = 2,
19}
20
21impl CreateBlobError {
22 #[inline]
23 pub fn from_primitive(prim: u32) -> Option<Self> {
24 match prim {
25 1 => Some(Self::AlreadyExists),
26 2 => Some(Self::Internal),
27 _ => None,
28 }
29 }
30
31 #[inline]
32 pub const fn into_primitive(self) -> u32 {
33 self as u32
34 }
35}
36
37#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
39pub enum KeyPurpose {
40 Metadata,
42 Data,
44 #[doc(hidden)]
45 __SourceBreaking { unknown_ordinal: u32 },
46}
47
48#[macro_export]
50macro_rules! KeyPurposeUnknown {
51 () => {
52 _
53 };
54}
55
56impl KeyPurpose {
57 #[inline]
58 pub fn from_primitive(prim: u32) -> Option<Self> {
59 match prim {
60 1 => Some(Self::Metadata),
61 2 => Some(Self::Data),
62 _ => None,
63 }
64 }
65
66 #[inline]
67 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
68 match prim {
69 1 => Self::Metadata,
70 2 => Self::Data,
71 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
72 }
73 }
74
75 #[inline]
76 pub fn unknown() -> Self {
77 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
78 }
79
80 #[inline]
81 pub const fn into_primitive(self) -> u32 {
82 match self {
83 Self::Metadata => 1,
84 Self::Data => 2,
85 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
86 }
87 }
88
89 #[inline]
90 pub fn is_unknown(&self) -> bool {
91 match self {
92 Self::__SourceBreaking { unknown_ordinal: _ } => true,
93 _ => false,
94 }
95 }
96}
97
98#[derive(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#[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 FscryptInoLblk32DirKey {
229 pub key_identifier: [u8; 16],
230 pub filesystem_uuid: [u8; 16],
231 pub nonce: [u8; 16],
232}
233
234impl fidl::Persistable for FscryptInoLblk32DirKey {}
235
236#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
237#[repr(C)]
238pub struct FscryptInoLblk32FileKey {
239 pub key_identifier: [u8; 16],
240 pub filesystem_uuid: [u8; 16],
241}
242
243impl fidl::Persistable for FscryptInoLblk32FileKey {}
244
245#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
246#[repr(C)]
247pub struct FxfsWrapped {
248 pub wrapping_key_id: [u8; 16],
249 pub wrapped_key: [u8; 48],
250}
251
252impl fidl::Persistable for FxfsWrapped {}
253
254#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
255#[repr(C)]
256pub struct ProjectIdClearForNodeRequest {
257 pub node_id: u64,
258}
259
260impl fidl::Persistable for ProjectIdClearForNodeRequest {}
261
262#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
263#[repr(C)]
264pub struct ProjectIdClearRequest {
265 pub project_id: u64,
266}
267
268impl fidl::Persistable for ProjectIdClearRequest {}
269
270#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
271#[repr(C)]
272pub struct ProjectIdGetForNodeRequest {
273 pub node_id: u64,
274}
275
276impl fidl::Persistable for ProjectIdGetForNodeRequest {}
277
278#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
279#[repr(C)]
280pub struct ProjectIdInfoRequest {
281 pub project_id: u64,
282}
283
284impl fidl::Persistable for ProjectIdInfoRequest {}
285
286#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
287pub struct ProjectIdListRequest {
288 pub token: Option<Box<ProjectIterToken>>,
289}
290
291impl fidl::Persistable for ProjectIdListRequest {}
292
293#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
294#[repr(C)]
295pub struct ProjectIdSetForNodeRequest {
296 pub node_id: u64,
297 pub project_id: u64,
298}
299
300impl fidl::Persistable for ProjectIdSetForNodeRequest {}
301
302#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
303#[repr(C)]
304pub struct ProjectIdSetLimitRequest {
305 pub project_id: u64,
306 pub bytes: u64,
307 pub nodes: u64,
308}
309
310impl fidl::Persistable for ProjectIdSetLimitRequest {}
311
312#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
313#[repr(C)]
314pub struct ProjectIdGetForNodeResponse {
315 pub project_id: u64,
316}
317
318impl fidl::Persistable for ProjectIdGetForNodeResponse {}
319
320#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
321#[repr(C)]
322pub struct ProjectIdInfoResponse {
323 pub limit: BytesAndNodes,
324 pub usage: BytesAndNodes,
325}
326
327impl fidl::Persistable for ProjectIdInfoResponse {}
328
329#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
330pub struct ProjectIdListResponse {
331 pub entries: Vec<u64>,
332 pub next_token: Option<Box<ProjectIterToken>>,
333}
334
335impl fidl::Persistable for ProjectIdListResponse {}
336
337#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
341#[repr(C)]
342pub struct ProjectIterToken {
343 pub value: u64,
344}
345
346impl fidl::Persistable for ProjectIterToken {}
347
348#[derive(Clone, Debug, Default, PartialEq)]
349pub struct CryptSettings {
350 pub active_data_wrapping_key_id: Option<[u8; 16]>,
351 pub active_metadata_wrapping_key_id: Option<[u8; 16]>,
352 #[doc(hidden)]
353 pub __source_breaking: fidl::marker::SourceBreaking,
354}
355
356impl fidl::Persistable for CryptSettings {}
357
358#[derive(Clone, Debug)]
359pub enum WrappedKey {
360 FxfsWrapped(FxfsWrapped),
364 Zxcrypt(Vec<u8>),
368 FscryptInoLblk32Dir(FscryptInoLblk32DirKey),
372 FscryptInoLblk32File(FscryptInoLblk32FileKey),
376 DmDefaultKey(EmptyStruct),
380 #[doc(hidden)]
381 __SourceBreaking { unknown_ordinal: u64 },
382}
383
384#[macro_export]
386macro_rules! WrappedKeyUnknown {
387 () => {
388 _
389 };
390}
391
392impl PartialEq for WrappedKey {
394 fn eq(&self, other: &Self) -> bool {
395 match (self, other) {
396 (Self::FxfsWrapped(x), Self::FxfsWrapped(y)) => *x == *y,
397 (Self::Zxcrypt(x), Self::Zxcrypt(y)) => *x == *y,
398 (Self::FscryptInoLblk32Dir(x), Self::FscryptInoLblk32Dir(y)) => *x == *y,
399 (Self::FscryptInoLblk32File(x), Self::FscryptInoLblk32File(y)) => *x == *y,
400 (Self::DmDefaultKey(x), Self::DmDefaultKey(y)) => *x == *y,
401 _ => false,
402 }
403 }
404}
405
406impl WrappedKey {
407 #[inline]
408 pub fn ordinal(&self) -> u64 {
409 match *self {
410 Self::FxfsWrapped(_) => 1,
411 Self::Zxcrypt(_) => 2,
412 Self::FscryptInoLblk32Dir(_) => 3,
413 Self::FscryptInoLblk32File(_) => 4,
414 Self::DmDefaultKey(_) => 5,
415 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
416 }
417 }
418
419 #[inline]
420 pub fn unknown_variant_for_testing() -> Self {
421 Self::__SourceBreaking { unknown_ordinal: 0 }
422 }
423
424 #[inline]
425 pub fn is_unknown(&self) -> bool {
426 match self {
427 Self::__SourceBreaking { .. } => true,
428 _ => false,
429 }
430 }
431}
432
433impl fidl::Persistable for WrappedKey {}
434
435pub mod blob_creator_ordinals {
436 pub const CREATE: u64 = 0x4288fe720cca70d7;
437}
438
439pub mod blob_reader_ordinals {
440 pub const GET_VMO: u64 = 0x2fa72823ef7f11f4;
441}
442
443pub mod blob_writer_ordinals {
444 pub const GET_VMO: u64 = 0x50c8988b12b6f893;
445 pub const BYTES_READY: u64 = 0x7b308b473606c573;
446}
447
448pub mod crypt_ordinals {
449 pub const CREATE_KEY: u64 = 0x6ec69b3aee7fdbba;
450 pub const CREATE_KEY_WITH_ID: u64 = 0x21e8076688700b50;
451 pub const UNWRAP_KEY: u64 = 0x6ec34e2b64d46be9;
452}
453
454pub mod crypt_management_ordinals {
455 pub const ADD_WRAPPING_KEY: u64 = 0x59a5076762318bf;
456 pub const SET_ACTIVE_KEY: u64 = 0x5e81d600442f2872;
457 pub const FORGET_WRAPPING_KEY: u64 = 0x436d6d27696dfcf4;
458}
459
460pub mod debug_ordinals {
461 pub const COMPACT: u64 = 0x6553eb197306e489;
462 pub const DELETE_PROFILE: u64 = 0x54d9d4c9cf300a1e;
463 pub const STOP_PROFILE_TASKS: u64 = 0x1657b945dd629177;
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 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 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 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 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 }
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 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 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 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 }
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 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 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 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 }
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 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 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 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 }
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 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 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 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 unsafe {
1161 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
1162 (ptr as *mut u64).write_unaligned(0);
1163 }
1164 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 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 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 }
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 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 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 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 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 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 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 }
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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 FscryptInoLblk32DirKey {
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 FscryptInoLblk32DirKey {
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 48
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>
2175 fidl::encoding::Encode<FscryptInoLblk32DirKey, D> for &FscryptInoLblk32DirKey
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::<FscryptInoLblk32DirKey>(offset);
2185 unsafe {
2186 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2188 (buf_ptr as *mut FscryptInoLblk32DirKey)
2189 .write_unaligned((self as *const FscryptInoLblk32DirKey).read());
2190 }
2193 Ok(())
2194 }
2195 }
2196 unsafe impl<
2197 D: fidl::encoding::ResourceDialect,
2198 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
2199 T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
2200 T2: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
2201 > fidl::encoding::Encode<FscryptInoLblk32DirKey, D> for (T0, T1, T2)
2202 {
2203 #[inline]
2204 unsafe fn encode(
2205 self,
2206 encoder: &mut fidl::encoding::Encoder<'_, D>,
2207 offset: usize,
2208 depth: fidl::encoding::Depth,
2209 ) -> fidl::Result<()> {
2210 encoder.debug_check_bounds::<FscryptInoLblk32DirKey>(offset);
2211 self.0.encode(encoder, offset + 0, depth)?;
2215 self.1.encode(encoder, offset + 16, depth)?;
2216 self.2.encode(encoder, offset + 32, depth)?;
2217 Ok(())
2218 }
2219 }
2220
2221 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2222 for FscryptInoLblk32DirKey
2223 {
2224 #[inline(always)]
2225 fn new_empty() -> Self {
2226 Self {
2227 key_identifier: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D),
2228 filesystem_uuid: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D),
2229 nonce: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D),
2230 }
2231 }
2232
2233 #[inline]
2234 unsafe fn decode(
2235 &mut self,
2236 decoder: &mut fidl::encoding::Decoder<'_, D>,
2237 offset: usize,
2238 _depth: fidl::encoding::Depth,
2239 ) -> fidl::Result<()> {
2240 decoder.debug_check_bounds::<Self>(offset);
2241 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2242 unsafe {
2245 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 48);
2246 }
2247 Ok(())
2248 }
2249 }
2250
2251 impl fidl::encoding::ValueTypeMarker for FscryptInoLblk32FileKey {
2252 type Borrowed<'a> = &'a Self;
2253 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2254 value
2255 }
2256 }
2257
2258 unsafe impl fidl::encoding::TypeMarker for FscryptInoLblk32FileKey {
2259 type Owned = Self;
2260
2261 #[inline(always)]
2262 fn inline_align(_context: fidl::encoding::Context) -> usize {
2263 1
2264 }
2265
2266 #[inline(always)]
2267 fn inline_size(_context: fidl::encoding::Context) -> usize {
2268 32
2269 }
2270 #[inline(always)]
2271 fn encode_is_copy() -> bool {
2272 true
2273 }
2274
2275 #[inline(always)]
2276 fn decode_is_copy() -> bool {
2277 true
2278 }
2279 }
2280
2281 unsafe impl<D: fidl::encoding::ResourceDialect>
2282 fidl::encoding::Encode<FscryptInoLblk32FileKey, D> for &FscryptInoLblk32FileKey
2283 {
2284 #[inline]
2285 unsafe fn encode(
2286 self,
2287 encoder: &mut fidl::encoding::Encoder<'_, D>,
2288 offset: usize,
2289 _depth: fidl::encoding::Depth,
2290 ) -> fidl::Result<()> {
2291 encoder.debug_check_bounds::<FscryptInoLblk32FileKey>(offset);
2292 unsafe {
2293 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2295 (buf_ptr as *mut FscryptInoLblk32FileKey)
2296 .write_unaligned((self as *const FscryptInoLblk32FileKey).read());
2297 }
2300 Ok(())
2301 }
2302 }
2303 unsafe impl<
2304 D: fidl::encoding::ResourceDialect,
2305 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
2306 T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
2307 > fidl::encoding::Encode<FscryptInoLblk32FileKey, D> for (T0, T1)
2308 {
2309 #[inline]
2310 unsafe fn encode(
2311 self,
2312 encoder: &mut fidl::encoding::Encoder<'_, D>,
2313 offset: usize,
2314 depth: fidl::encoding::Depth,
2315 ) -> fidl::Result<()> {
2316 encoder.debug_check_bounds::<FscryptInoLblk32FileKey>(offset);
2317 self.0.encode(encoder, offset + 0, depth)?;
2321 self.1.encode(encoder, offset + 16, depth)?;
2322 Ok(())
2323 }
2324 }
2325
2326 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2327 for FscryptInoLblk32FileKey
2328 {
2329 #[inline(always)]
2330 fn new_empty() -> Self {
2331 Self {
2332 key_identifier: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D),
2333 filesystem_uuid: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D),
2334 }
2335 }
2336
2337 #[inline]
2338 unsafe fn decode(
2339 &mut self,
2340 decoder: &mut fidl::encoding::Decoder<'_, D>,
2341 offset: usize,
2342 _depth: fidl::encoding::Depth,
2343 ) -> fidl::Result<()> {
2344 decoder.debug_check_bounds::<Self>(offset);
2345 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2346 unsafe {
2349 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
2350 }
2351 Ok(())
2352 }
2353 }
2354
2355 impl fidl::encoding::ValueTypeMarker for FxfsWrapped {
2356 type Borrowed<'a> = &'a Self;
2357 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2358 value
2359 }
2360 }
2361
2362 unsafe impl fidl::encoding::TypeMarker for FxfsWrapped {
2363 type Owned = Self;
2364
2365 #[inline(always)]
2366 fn inline_align(_context: fidl::encoding::Context) -> usize {
2367 1
2368 }
2369
2370 #[inline(always)]
2371 fn inline_size(_context: fidl::encoding::Context) -> usize {
2372 64
2373 }
2374 #[inline(always)]
2375 fn encode_is_copy() -> bool {
2376 true
2377 }
2378
2379 #[inline(always)]
2380 fn decode_is_copy() -> bool {
2381 true
2382 }
2383 }
2384
2385 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FxfsWrapped, D>
2386 for &FxfsWrapped
2387 {
2388 #[inline]
2389 unsafe fn encode(
2390 self,
2391 encoder: &mut fidl::encoding::Encoder<'_, D>,
2392 offset: usize,
2393 _depth: fidl::encoding::Depth,
2394 ) -> fidl::Result<()> {
2395 encoder.debug_check_bounds::<FxfsWrapped>(offset);
2396 unsafe {
2397 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2399 (buf_ptr as *mut FxfsWrapped).write_unaligned((self as *const FxfsWrapped).read());
2400 }
2403 Ok(())
2404 }
2405 }
2406 unsafe impl<
2407 D: fidl::encoding::ResourceDialect,
2408 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
2409 T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 48>, D>,
2410 > fidl::encoding::Encode<FxfsWrapped, D> for (T0, T1)
2411 {
2412 #[inline]
2413 unsafe fn encode(
2414 self,
2415 encoder: &mut fidl::encoding::Encoder<'_, D>,
2416 offset: usize,
2417 depth: fidl::encoding::Depth,
2418 ) -> fidl::Result<()> {
2419 encoder.debug_check_bounds::<FxfsWrapped>(offset);
2420 self.0.encode(encoder, offset + 0, depth)?;
2424 self.1.encode(encoder, offset + 16, depth)?;
2425 Ok(())
2426 }
2427 }
2428
2429 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FxfsWrapped {
2430 #[inline(always)]
2431 fn new_empty() -> Self {
2432 Self {
2433 wrapping_key_id: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D),
2434 wrapped_key: fidl::new_empty!(fidl::encoding::Array<u8, 48>, D),
2435 }
2436 }
2437
2438 #[inline]
2439 unsafe fn decode(
2440 &mut self,
2441 decoder: &mut fidl::encoding::Decoder<'_, D>,
2442 offset: usize,
2443 _depth: fidl::encoding::Depth,
2444 ) -> fidl::Result<()> {
2445 decoder.debug_check_bounds::<Self>(offset);
2446 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2447 unsafe {
2450 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 64);
2451 }
2452 Ok(())
2453 }
2454 }
2455
2456 impl fidl::encoding::ValueTypeMarker for ProjectIdClearForNodeRequest {
2457 type Borrowed<'a> = &'a Self;
2458 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2459 value
2460 }
2461 }
2462
2463 unsafe impl fidl::encoding::TypeMarker for ProjectIdClearForNodeRequest {
2464 type Owned = Self;
2465
2466 #[inline(always)]
2467 fn inline_align(_context: fidl::encoding::Context) -> usize {
2468 8
2469 }
2470
2471 #[inline(always)]
2472 fn inline_size(_context: fidl::encoding::Context) -> usize {
2473 8
2474 }
2475 #[inline(always)]
2476 fn encode_is_copy() -> bool {
2477 true
2478 }
2479
2480 #[inline(always)]
2481 fn decode_is_copy() -> bool {
2482 true
2483 }
2484 }
2485
2486 unsafe impl<D: fidl::encoding::ResourceDialect>
2487 fidl::encoding::Encode<ProjectIdClearForNodeRequest, D> for &ProjectIdClearForNodeRequest
2488 {
2489 #[inline]
2490 unsafe fn encode(
2491 self,
2492 encoder: &mut fidl::encoding::Encoder<'_, D>,
2493 offset: usize,
2494 _depth: fidl::encoding::Depth,
2495 ) -> fidl::Result<()> {
2496 encoder.debug_check_bounds::<ProjectIdClearForNodeRequest>(offset);
2497 unsafe {
2498 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2500 (buf_ptr as *mut ProjectIdClearForNodeRequest)
2501 .write_unaligned((self as *const ProjectIdClearForNodeRequest).read());
2502 }
2505 Ok(())
2506 }
2507 }
2508 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2509 fidl::encoding::Encode<ProjectIdClearForNodeRequest, D> for (T0,)
2510 {
2511 #[inline]
2512 unsafe fn encode(
2513 self,
2514 encoder: &mut fidl::encoding::Encoder<'_, D>,
2515 offset: usize,
2516 depth: fidl::encoding::Depth,
2517 ) -> fidl::Result<()> {
2518 encoder.debug_check_bounds::<ProjectIdClearForNodeRequest>(offset);
2519 self.0.encode(encoder, offset + 0, depth)?;
2523 Ok(())
2524 }
2525 }
2526
2527 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2528 for ProjectIdClearForNodeRequest
2529 {
2530 #[inline(always)]
2531 fn new_empty() -> Self {
2532 Self { node_id: fidl::new_empty!(u64, D) }
2533 }
2534
2535 #[inline]
2536 unsafe fn decode(
2537 &mut self,
2538 decoder: &mut fidl::encoding::Decoder<'_, D>,
2539 offset: usize,
2540 _depth: fidl::encoding::Depth,
2541 ) -> fidl::Result<()> {
2542 decoder.debug_check_bounds::<Self>(offset);
2543 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2544 unsafe {
2547 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2548 }
2549 Ok(())
2550 }
2551 }
2552
2553 impl fidl::encoding::ValueTypeMarker for ProjectIdClearRequest {
2554 type Borrowed<'a> = &'a Self;
2555 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2556 value
2557 }
2558 }
2559
2560 unsafe impl fidl::encoding::TypeMarker for ProjectIdClearRequest {
2561 type Owned = Self;
2562
2563 #[inline(always)]
2564 fn inline_align(_context: fidl::encoding::Context) -> usize {
2565 8
2566 }
2567
2568 #[inline(always)]
2569 fn inline_size(_context: fidl::encoding::Context) -> usize {
2570 8
2571 }
2572 #[inline(always)]
2573 fn encode_is_copy() -> bool {
2574 true
2575 }
2576
2577 #[inline(always)]
2578 fn decode_is_copy() -> bool {
2579 true
2580 }
2581 }
2582
2583 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProjectIdClearRequest, D>
2584 for &ProjectIdClearRequest
2585 {
2586 #[inline]
2587 unsafe fn encode(
2588 self,
2589 encoder: &mut fidl::encoding::Encoder<'_, D>,
2590 offset: usize,
2591 _depth: fidl::encoding::Depth,
2592 ) -> fidl::Result<()> {
2593 encoder.debug_check_bounds::<ProjectIdClearRequest>(offset);
2594 unsafe {
2595 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2597 (buf_ptr as *mut ProjectIdClearRequest)
2598 .write_unaligned((self as *const ProjectIdClearRequest).read());
2599 }
2602 Ok(())
2603 }
2604 }
2605 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2606 fidl::encoding::Encode<ProjectIdClearRequest, D> for (T0,)
2607 {
2608 #[inline]
2609 unsafe fn encode(
2610 self,
2611 encoder: &mut fidl::encoding::Encoder<'_, D>,
2612 offset: usize,
2613 depth: fidl::encoding::Depth,
2614 ) -> fidl::Result<()> {
2615 encoder.debug_check_bounds::<ProjectIdClearRequest>(offset);
2616 self.0.encode(encoder, offset + 0, depth)?;
2620 Ok(())
2621 }
2622 }
2623
2624 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIdClearRequest {
2625 #[inline(always)]
2626 fn new_empty() -> Self {
2627 Self { project_id: fidl::new_empty!(u64, D) }
2628 }
2629
2630 #[inline]
2631 unsafe fn decode(
2632 &mut self,
2633 decoder: &mut fidl::encoding::Decoder<'_, D>,
2634 offset: usize,
2635 _depth: fidl::encoding::Depth,
2636 ) -> fidl::Result<()> {
2637 decoder.debug_check_bounds::<Self>(offset);
2638 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2639 unsafe {
2642 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2643 }
2644 Ok(())
2645 }
2646 }
2647
2648 impl fidl::encoding::ValueTypeMarker for ProjectIdGetForNodeRequest {
2649 type Borrowed<'a> = &'a Self;
2650 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2651 value
2652 }
2653 }
2654
2655 unsafe impl fidl::encoding::TypeMarker for ProjectIdGetForNodeRequest {
2656 type Owned = Self;
2657
2658 #[inline(always)]
2659 fn inline_align(_context: fidl::encoding::Context) -> usize {
2660 8
2661 }
2662
2663 #[inline(always)]
2664 fn inline_size(_context: fidl::encoding::Context) -> usize {
2665 8
2666 }
2667 #[inline(always)]
2668 fn encode_is_copy() -> bool {
2669 true
2670 }
2671
2672 #[inline(always)]
2673 fn decode_is_copy() -> bool {
2674 true
2675 }
2676 }
2677
2678 unsafe impl<D: fidl::encoding::ResourceDialect>
2679 fidl::encoding::Encode<ProjectIdGetForNodeRequest, D> for &ProjectIdGetForNodeRequest
2680 {
2681 #[inline]
2682 unsafe fn encode(
2683 self,
2684 encoder: &mut fidl::encoding::Encoder<'_, D>,
2685 offset: usize,
2686 _depth: fidl::encoding::Depth,
2687 ) -> fidl::Result<()> {
2688 encoder.debug_check_bounds::<ProjectIdGetForNodeRequest>(offset);
2689 unsafe {
2690 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2692 (buf_ptr as *mut ProjectIdGetForNodeRequest)
2693 .write_unaligned((self as *const ProjectIdGetForNodeRequest).read());
2694 }
2697 Ok(())
2698 }
2699 }
2700 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2701 fidl::encoding::Encode<ProjectIdGetForNodeRequest, D> for (T0,)
2702 {
2703 #[inline]
2704 unsafe fn encode(
2705 self,
2706 encoder: &mut fidl::encoding::Encoder<'_, D>,
2707 offset: usize,
2708 depth: fidl::encoding::Depth,
2709 ) -> fidl::Result<()> {
2710 encoder.debug_check_bounds::<ProjectIdGetForNodeRequest>(offset);
2711 self.0.encode(encoder, offset + 0, depth)?;
2715 Ok(())
2716 }
2717 }
2718
2719 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2720 for ProjectIdGetForNodeRequest
2721 {
2722 #[inline(always)]
2723 fn new_empty() -> Self {
2724 Self { node_id: fidl::new_empty!(u64, D) }
2725 }
2726
2727 #[inline]
2728 unsafe fn decode(
2729 &mut self,
2730 decoder: &mut fidl::encoding::Decoder<'_, D>,
2731 offset: usize,
2732 _depth: fidl::encoding::Depth,
2733 ) -> fidl::Result<()> {
2734 decoder.debug_check_bounds::<Self>(offset);
2735 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2736 unsafe {
2739 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2740 }
2741 Ok(())
2742 }
2743 }
2744
2745 impl fidl::encoding::ValueTypeMarker for ProjectIdInfoRequest {
2746 type Borrowed<'a> = &'a Self;
2747 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2748 value
2749 }
2750 }
2751
2752 unsafe impl fidl::encoding::TypeMarker for ProjectIdInfoRequest {
2753 type Owned = Self;
2754
2755 #[inline(always)]
2756 fn inline_align(_context: fidl::encoding::Context) -> usize {
2757 8
2758 }
2759
2760 #[inline(always)]
2761 fn inline_size(_context: fidl::encoding::Context) -> usize {
2762 8
2763 }
2764 #[inline(always)]
2765 fn encode_is_copy() -> bool {
2766 true
2767 }
2768
2769 #[inline(always)]
2770 fn decode_is_copy() -> bool {
2771 true
2772 }
2773 }
2774
2775 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProjectIdInfoRequest, D>
2776 for &ProjectIdInfoRequest
2777 {
2778 #[inline]
2779 unsafe fn encode(
2780 self,
2781 encoder: &mut fidl::encoding::Encoder<'_, D>,
2782 offset: usize,
2783 _depth: fidl::encoding::Depth,
2784 ) -> fidl::Result<()> {
2785 encoder.debug_check_bounds::<ProjectIdInfoRequest>(offset);
2786 unsafe {
2787 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2789 (buf_ptr as *mut ProjectIdInfoRequest)
2790 .write_unaligned((self as *const ProjectIdInfoRequest).read());
2791 }
2794 Ok(())
2795 }
2796 }
2797 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2798 fidl::encoding::Encode<ProjectIdInfoRequest, D> for (T0,)
2799 {
2800 #[inline]
2801 unsafe fn encode(
2802 self,
2803 encoder: &mut fidl::encoding::Encoder<'_, D>,
2804 offset: usize,
2805 depth: fidl::encoding::Depth,
2806 ) -> fidl::Result<()> {
2807 encoder.debug_check_bounds::<ProjectIdInfoRequest>(offset);
2808 self.0.encode(encoder, offset + 0, depth)?;
2812 Ok(())
2813 }
2814 }
2815
2816 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIdInfoRequest {
2817 #[inline(always)]
2818 fn new_empty() -> Self {
2819 Self { project_id: fidl::new_empty!(u64, D) }
2820 }
2821
2822 #[inline]
2823 unsafe fn decode(
2824 &mut self,
2825 decoder: &mut fidl::encoding::Decoder<'_, D>,
2826 offset: usize,
2827 _depth: fidl::encoding::Depth,
2828 ) -> fidl::Result<()> {
2829 decoder.debug_check_bounds::<Self>(offset);
2830 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2831 unsafe {
2834 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2835 }
2836 Ok(())
2837 }
2838 }
2839
2840 impl fidl::encoding::ValueTypeMarker for ProjectIdListRequest {
2841 type Borrowed<'a> = &'a Self;
2842 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2843 value
2844 }
2845 }
2846
2847 unsafe impl fidl::encoding::TypeMarker for ProjectIdListRequest {
2848 type Owned = Self;
2849
2850 #[inline(always)]
2851 fn inline_align(_context: fidl::encoding::Context) -> usize {
2852 8
2853 }
2854
2855 #[inline(always)]
2856 fn inline_size(_context: fidl::encoding::Context) -> usize {
2857 8
2858 }
2859 }
2860
2861 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProjectIdListRequest, D>
2862 for &ProjectIdListRequest
2863 {
2864 #[inline]
2865 unsafe fn encode(
2866 self,
2867 encoder: &mut fidl::encoding::Encoder<'_, D>,
2868 offset: usize,
2869 _depth: fidl::encoding::Depth,
2870 ) -> fidl::Result<()> {
2871 encoder.debug_check_bounds::<ProjectIdListRequest>(offset);
2872 fidl::encoding::Encode::<ProjectIdListRequest, D>::encode(
2874 (
2875 <fidl::encoding::Boxed<ProjectIterToken> as fidl::encoding::ValueTypeMarker>::borrow(&self.token),
2876 ),
2877 encoder, offset, _depth
2878 )
2879 }
2880 }
2881 unsafe impl<
2882 D: fidl::encoding::ResourceDialect,
2883 T0: fidl::encoding::Encode<fidl::encoding::Boxed<ProjectIterToken>, D>,
2884 > fidl::encoding::Encode<ProjectIdListRequest, D> for (T0,)
2885 {
2886 #[inline]
2887 unsafe fn encode(
2888 self,
2889 encoder: &mut fidl::encoding::Encoder<'_, D>,
2890 offset: usize,
2891 depth: fidl::encoding::Depth,
2892 ) -> fidl::Result<()> {
2893 encoder.debug_check_bounds::<ProjectIdListRequest>(offset);
2894 self.0.encode(encoder, offset + 0, depth)?;
2898 Ok(())
2899 }
2900 }
2901
2902 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIdListRequest {
2903 #[inline(always)]
2904 fn new_empty() -> Self {
2905 Self { token: fidl::new_empty!(fidl::encoding::Boxed<ProjectIterToken>, D) }
2906 }
2907
2908 #[inline]
2909 unsafe fn decode(
2910 &mut self,
2911 decoder: &mut fidl::encoding::Decoder<'_, D>,
2912 offset: usize,
2913 _depth: fidl::encoding::Depth,
2914 ) -> fidl::Result<()> {
2915 decoder.debug_check_bounds::<Self>(offset);
2916 fidl::decode!(
2918 fidl::encoding::Boxed<ProjectIterToken>,
2919 D,
2920 &mut self.token,
2921 decoder,
2922 offset + 0,
2923 _depth
2924 )?;
2925 Ok(())
2926 }
2927 }
2928
2929 impl fidl::encoding::ValueTypeMarker for ProjectIdSetForNodeRequest {
2930 type Borrowed<'a> = &'a Self;
2931 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2932 value
2933 }
2934 }
2935
2936 unsafe impl fidl::encoding::TypeMarker for ProjectIdSetForNodeRequest {
2937 type Owned = Self;
2938
2939 #[inline(always)]
2940 fn inline_align(_context: fidl::encoding::Context) -> usize {
2941 8
2942 }
2943
2944 #[inline(always)]
2945 fn inline_size(_context: fidl::encoding::Context) -> usize {
2946 16
2947 }
2948 #[inline(always)]
2949 fn encode_is_copy() -> bool {
2950 true
2951 }
2952
2953 #[inline(always)]
2954 fn decode_is_copy() -> bool {
2955 true
2956 }
2957 }
2958
2959 unsafe impl<D: fidl::encoding::ResourceDialect>
2960 fidl::encoding::Encode<ProjectIdSetForNodeRequest, D> for &ProjectIdSetForNodeRequest
2961 {
2962 #[inline]
2963 unsafe fn encode(
2964 self,
2965 encoder: &mut fidl::encoding::Encoder<'_, D>,
2966 offset: usize,
2967 _depth: fidl::encoding::Depth,
2968 ) -> fidl::Result<()> {
2969 encoder.debug_check_bounds::<ProjectIdSetForNodeRequest>(offset);
2970 unsafe {
2971 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2973 (buf_ptr as *mut ProjectIdSetForNodeRequest)
2974 .write_unaligned((self as *const ProjectIdSetForNodeRequest).read());
2975 }
2978 Ok(())
2979 }
2980 }
2981 unsafe impl<
2982 D: fidl::encoding::ResourceDialect,
2983 T0: fidl::encoding::Encode<u64, D>,
2984 T1: fidl::encoding::Encode<u64, D>,
2985 > fidl::encoding::Encode<ProjectIdSetForNodeRequest, D> for (T0, T1)
2986 {
2987 #[inline]
2988 unsafe fn encode(
2989 self,
2990 encoder: &mut fidl::encoding::Encoder<'_, D>,
2991 offset: usize,
2992 depth: fidl::encoding::Depth,
2993 ) -> fidl::Result<()> {
2994 encoder.debug_check_bounds::<ProjectIdSetForNodeRequest>(offset);
2995 self.0.encode(encoder, offset + 0, depth)?;
2999 self.1.encode(encoder, offset + 8, depth)?;
3000 Ok(())
3001 }
3002 }
3003
3004 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3005 for ProjectIdSetForNodeRequest
3006 {
3007 #[inline(always)]
3008 fn new_empty() -> Self {
3009 Self { node_id: fidl::new_empty!(u64, D), project_id: fidl::new_empty!(u64, D) }
3010 }
3011
3012 #[inline]
3013 unsafe fn decode(
3014 &mut self,
3015 decoder: &mut fidl::encoding::Decoder<'_, D>,
3016 offset: usize,
3017 _depth: fidl::encoding::Depth,
3018 ) -> fidl::Result<()> {
3019 decoder.debug_check_bounds::<Self>(offset);
3020 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3021 unsafe {
3024 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
3025 }
3026 Ok(())
3027 }
3028 }
3029
3030 impl fidl::encoding::ValueTypeMarker for ProjectIdSetLimitRequest {
3031 type Borrowed<'a> = &'a Self;
3032 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3033 value
3034 }
3035 }
3036
3037 unsafe impl fidl::encoding::TypeMarker for ProjectIdSetLimitRequest {
3038 type Owned = Self;
3039
3040 #[inline(always)]
3041 fn inline_align(_context: fidl::encoding::Context) -> usize {
3042 8
3043 }
3044
3045 #[inline(always)]
3046 fn inline_size(_context: fidl::encoding::Context) -> usize {
3047 24
3048 }
3049 #[inline(always)]
3050 fn encode_is_copy() -> bool {
3051 true
3052 }
3053
3054 #[inline(always)]
3055 fn decode_is_copy() -> bool {
3056 true
3057 }
3058 }
3059
3060 unsafe impl<D: fidl::encoding::ResourceDialect>
3061 fidl::encoding::Encode<ProjectIdSetLimitRequest, D> for &ProjectIdSetLimitRequest
3062 {
3063 #[inline]
3064 unsafe fn encode(
3065 self,
3066 encoder: &mut fidl::encoding::Encoder<'_, D>,
3067 offset: usize,
3068 _depth: fidl::encoding::Depth,
3069 ) -> fidl::Result<()> {
3070 encoder.debug_check_bounds::<ProjectIdSetLimitRequest>(offset);
3071 unsafe {
3072 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3074 (buf_ptr as *mut ProjectIdSetLimitRequest)
3075 .write_unaligned((self as *const ProjectIdSetLimitRequest).read());
3076 }
3079 Ok(())
3080 }
3081 }
3082 unsafe impl<
3083 D: fidl::encoding::ResourceDialect,
3084 T0: fidl::encoding::Encode<u64, D>,
3085 T1: fidl::encoding::Encode<u64, D>,
3086 T2: fidl::encoding::Encode<u64, D>,
3087 > fidl::encoding::Encode<ProjectIdSetLimitRequest, D> for (T0, T1, T2)
3088 {
3089 #[inline]
3090 unsafe fn encode(
3091 self,
3092 encoder: &mut fidl::encoding::Encoder<'_, D>,
3093 offset: usize,
3094 depth: fidl::encoding::Depth,
3095 ) -> fidl::Result<()> {
3096 encoder.debug_check_bounds::<ProjectIdSetLimitRequest>(offset);
3097 self.0.encode(encoder, offset + 0, depth)?;
3101 self.1.encode(encoder, offset + 8, depth)?;
3102 self.2.encode(encoder, offset + 16, depth)?;
3103 Ok(())
3104 }
3105 }
3106
3107 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3108 for ProjectIdSetLimitRequest
3109 {
3110 #[inline(always)]
3111 fn new_empty() -> Self {
3112 Self {
3113 project_id: fidl::new_empty!(u64, D),
3114 bytes: fidl::new_empty!(u64, D),
3115 nodes: fidl::new_empty!(u64, D),
3116 }
3117 }
3118
3119 #[inline]
3120 unsafe fn decode(
3121 &mut self,
3122 decoder: &mut fidl::encoding::Decoder<'_, D>,
3123 offset: usize,
3124 _depth: fidl::encoding::Depth,
3125 ) -> fidl::Result<()> {
3126 decoder.debug_check_bounds::<Self>(offset);
3127 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3128 unsafe {
3131 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
3132 }
3133 Ok(())
3134 }
3135 }
3136
3137 impl fidl::encoding::ValueTypeMarker for ProjectIdGetForNodeResponse {
3138 type Borrowed<'a> = &'a Self;
3139 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3140 value
3141 }
3142 }
3143
3144 unsafe impl fidl::encoding::TypeMarker for ProjectIdGetForNodeResponse {
3145 type Owned = Self;
3146
3147 #[inline(always)]
3148 fn inline_align(_context: fidl::encoding::Context) -> usize {
3149 8
3150 }
3151
3152 #[inline(always)]
3153 fn inline_size(_context: fidl::encoding::Context) -> usize {
3154 8
3155 }
3156 #[inline(always)]
3157 fn encode_is_copy() -> bool {
3158 true
3159 }
3160
3161 #[inline(always)]
3162 fn decode_is_copy() -> bool {
3163 true
3164 }
3165 }
3166
3167 unsafe impl<D: fidl::encoding::ResourceDialect>
3168 fidl::encoding::Encode<ProjectIdGetForNodeResponse, D> for &ProjectIdGetForNodeResponse
3169 {
3170 #[inline]
3171 unsafe fn encode(
3172 self,
3173 encoder: &mut fidl::encoding::Encoder<'_, D>,
3174 offset: usize,
3175 _depth: fidl::encoding::Depth,
3176 ) -> fidl::Result<()> {
3177 encoder.debug_check_bounds::<ProjectIdGetForNodeResponse>(offset);
3178 unsafe {
3179 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3181 (buf_ptr as *mut ProjectIdGetForNodeResponse)
3182 .write_unaligned((self as *const ProjectIdGetForNodeResponse).read());
3183 }
3186 Ok(())
3187 }
3188 }
3189 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
3190 fidl::encoding::Encode<ProjectIdGetForNodeResponse, D> for (T0,)
3191 {
3192 #[inline]
3193 unsafe fn encode(
3194 self,
3195 encoder: &mut fidl::encoding::Encoder<'_, D>,
3196 offset: usize,
3197 depth: fidl::encoding::Depth,
3198 ) -> fidl::Result<()> {
3199 encoder.debug_check_bounds::<ProjectIdGetForNodeResponse>(offset);
3200 self.0.encode(encoder, offset + 0, depth)?;
3204 Ok(())
3205 }
3206 }
3207
3208 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3209 for ProjectIdGetForNodeResponse
3210 {
3211 #[inline(always)]
3212 fn new_empty() -> Self {
3213 Self { project_id: fidl::new_empty!(u64, D) }
3214 }
3215
3216 #[inline]
3217 unsafe fn decode(
3218 &mut self,
3219 decoder: &mut fidl::encoding::Decoder<'_, D>,
3220 offset: usize,
3221 _depth: fidl::encoding::Depth,
3222 ) -> fidl::Result<()> {
3223 decoder.debug_check_bounds::<Self>(offset);
3224 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3225 unsafe {
3228 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3229 }
3230 Ok(())
3231 }
3232 }
3233
3234 impl fidl::encoding::ValueTypeMarker for ProjectIdInfoResponse {
3235 type Borrowed<'a> = &'a Self;
3236 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3237 value
3238 }
3239 }
3240
3241 unsafe impl fidl::encoding::TypeMarker for ProjectIdInfoResponse {
3242 type Owned = Self;
3243
3244 #[inline(always)]
3245 fn inline_align(_context: fidl::encoding::Context) -> usize {
3246 8
3247 }
3248
3249 #[inline(always)]
3250 fn inline_size(_context: fidl::encoding::Context) -> usize {
3251 32
3252 }
3253 #[inline(always)]
3254 fn encode_is_copy() -> bool {
3255 true
3256 }
3257
3258 #[inline(always)]
3259 fn decode_is_copy() -> bool {
3260 true
3261 }
3262 }
3263
3264 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProjectIdInfoResponse, D>
3265 for &ProjectIdInfoResponse
3266 {
3267 #[inline]
3268 unsafe fn encode(
3269 self,
3270 encoder: &mut fidl::encoding::Encoder<'_, D>,
3271 offset: usize,
3272 _depth: fidl::encoding::Depth,
3273 ) -> fidl::Result<()> {
3274 encoder.debug_check_bounds::<ProjectIdInfoResponse>(offset);
3275 unsafe {
3276 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3278 (buf_ptr as *mut ProjectIdInfoResponse)
3279 .write_unaligned((self as *const ProjectIdInfoResponse).read());
3280 }
3283 Ok(())
3284 }
3285 }
3286 unsafe impl<
3287 D: fidl::encoding::ResourceDialect,
3288 T0: fidl::encoding::Encode<BytesAndNodes, D>,
3289 T1: fidl::encoding::Encode<BytesAndNodes, D>,
3290 > fidl::encoding::Encode<ProjectIdInfoResponse, D> for (T0, T1)
3291 {
3292 #[inline]
3293 unsafe fn encode(
3294 self,
3295 encoder: &mut fidl::encoding::Encoder<'_, D>,
3296 offset: usize,
3297 depth: fidl::encoding::Depth,
3298 ) -> fidl::Result<()> {
3299 encoder.debug_check_bounds::<ProjectIdInfoResponse>(offset);
3300 self.0.encode(encoder, offset + 0, depth)?;
3304 self.1.encode(encoder, offset + 16, depth)?;
3305 Ok(())
3306 }
3307 }
3308
3309 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIdInfoResponse {
3310 #[inline(always)]
3311 fn new_empty() -> Self {
3312 Self {
3313 limit: fidl::new_empty!(BytesAndNodes, D),
3314 usage: fidl::new_empty!(BytesAndNodes, D),
3315 }
3316 }
3317
3318 #[inline]
3319 unsafe fn decode(
3320 &mut self,
3321 decoder: &mut fidl::encoding::Decoder<'_, D>,
3322 offset: usize,
3323 _depth: fidl::encoding::Depth,
3324 ) -> fidl::Result<()> {
3325 decoder.debug_check_bounds::<Self>(offset);
3326 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3327 unsafe {
3330 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
3331 }
3332 Ok(())
3333 }
3334 }
3335
3336 impl fidl::encoding::ValueTypeMarker for ProjectIdListResponse {
3337 type Borrowed<'a> = &'a Self;
3338 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3339 value
3340 }
3341 }
3342
3343 unsafe impl fidl::encoding::TypeMarker for ProjectIdListResponse {
3344 type Owned = Self;
3345
3346 #[inline(always)]
3347 fn inline_align(_context: fidl::encoding::Context) -> usize {
3348 8
3349 }
3350
3351 #[inline(always)]
3352 fn inline_size(_context: fidl::encoding::Context) -> usize {
3353 24
3354 }
3355 }
3356
3357 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProjectIdListResponse, D>
3358 for &ProjectIdListResponse
3359 {
3360 #[inline]
3361 unsafe fn encode(
3362 self,
3363 encoder: &mut fidl::encoding::Encoder<'_, D>,
3364 offset: usize,
3365 _depth: fidl::encoding::Depth,
3366 ) -> fidl::Result<()> {
3367 encoder.debug_check_bounds::<ProjectIdListResponse>(offset);
3368 fidl::encoding::Encode::<ProjectIdListResponse, D>::encode(
3370 (
3371 <fidl::encoding::UnboundedVector<u64> as fidl::encoding::ValueTypeMarker>::borrow(&self.entries),
3372 <fidl::encoding::Boxed<ProjectIterToken> as fidl::encoding::ValueTypeMarker>::borrow(&self.next_token),
3373 ),
3374 encoder, offset, _depth
3375 )
3376 }
3377 }
3378 unsafe impl<
3379 D: fidl::encoding::ResourceDialect,
3380 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u64>, D>,
3381 T1: fidl::encoding::Encode<fidl::encoding::Boxed<ProjectIterToken>, D>,
3382 > fidl::encoding::Encode<ProjectIdListResponse, D> for (T0, T1)
3383 {
3384 #[inline]
3385 unsafe fn encode(
3386 self,
3387 encoder: &mut fidl::encoding::Encoder<'_, D>,
3388 offset: usize,
3389 depth: fidl::encoding::Depth,
3390 ) -> fidl::Result<()> {
3391 encoder.debug_check_bounds::<ProjectIdListResponse>(offset);
3392 self.0.encode(encoder, offset + 0, depth)?;
3396 self.1.encode(encoder, offset + 16, depth)?;
3397 Ok(())
3398 }
3399 }
3400
3401 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIdListResponse {
3402 #[inline(always)]
3403 fn new_empty() -> Self {
3404 Self {
3405 entries: fidl::new_empty!(fidl::encoding::UnboundedVector<u64>, D),
3406 next_token: fidl::new_empty!(fidl::encoding::Boxed<ProjectIterToken>, D),
3407 }
3408 }
3409
3410 #[inline]
3411 unsafe fn decode(
3412 &mut self,
3413 decoder: &mut fidl::encoding::Decoder<'_, D>,
3414 offset: usize,
3415 _depth: fidl::encoding::Depth,
3416 ) -> fidl::Result<()> {
3417 decoder.debug_check_bounds::<Self>(offset);
3418 fidl::decode!(
3420 fidl::encoding::UnboundedVector<u64>,
3421 D,
3422 &mut self.entries,
3423 decoder,
3424 offset + 0,
3425 _depth
3426 )?;
3427 fidl::decode!(
3428 fidl::encoding::Boxed<ProjectIterToken>,
3429 D,
3430 &mut self.next_token,
3431 decoder,
3432 offset + 16,
3433 _depth
3434 )?;
3435 Ok(())
3436 }
3437 }
3438
3439 impl fidl::encoding::ValueTypeMarker for ProjectIterToken {
3440 type Borrowed<'a> = &'a Self;
3441 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3442 value
3443 }
3444 }
3445
3446 unsafe impl fidl::encoding::TypeMarker for ProjectIterToken {
3447 type Owned = Self;
3448
3449 #[inline(always)]
3450 fn inline_align(_context: fidl::encoding::Context) -> usize {
3451 8
3452 }
3453
3454 #[inline(always)]
3455 fn inline_size(_context: fidl::encoding::Context) -> usize {
3456 8
3457 }
3458 #[inline(always)]
3459 fn encode_is_copy() -> bool {
3460 true
3461 }
3462
3463 #[inline(always)]
3464 fn decode_is_copy() -> bool {
3465 true
3466 }
3467 }
3468
3469 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProjectIterToken, D>
3470 for &ProjectIterToken
3471 {
3472 #[inline]
3473 unsafe fn encode(
3474 self,
3475 encoder: &mut fidl::encoding::Encoder<'_, D>,
3476 offset: usize,
3477 _depth: fidl::encoding::Depth,
3478 ) -> fidl::Result<()> {
3479 encoder.debug_check_bounds::<ProjectIterToken>(offset);
3480 unsafe {
3481 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3483 (buf_ptr as *mut ProjectIterToken)
3484 .write_unaligned((self as *const ProjectIterToken).read());
3485 }
3488 Ok(())
3489 }
3490 }
3491 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
3492 fidl::encoding::Encode<ProjectIterToken, D> for (T0,)
3493 {
3494 #[inline]
3495 unsafe fn encode(
3496 self,
3497 encoder: &mut fidl::encoding::Encoder<'_, D>,
3498 offset: usize,
3499 depth: fidl::encoding::Depth,
3500 ) -> fidl::Result<()> {
3501 encoder.debug_check_bounds::<ProjectIterToken>(offset);
3502 self.0.encode(encoder, offset + 0, depth)?;
3506 Ok(())
3507 }
3508 }
3509
3510 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIterToken {
3511 #[inline(always)]
3512 fn new_empty() -> Self {
3513 Self { value: fidl::new_empty!(u64, D) }
3514 }
3515
3516 #[inline]
3517 unsafe fn decode(
3518 &mut self,
3519 decoder: &mut fidl::encoding::Decoder<'_, D>,
3520 offset: usize,
3521 _depth: fidl::encoding::Depth,
3522 ) -> fidl::Result<()> {
3523 decoder.debug_check_bounds::<Self>(offset);
3524 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3525 unsafe {
3528 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3529 }
3530 Ok(())
3531 }
3532 }
3533
3534 impl CryptSettings {
3535 #[inline(always)]
3536 fn max_ordinal_present(&self) -> u64 {
3537 if let Some(_) = self.active_metadata_wrapping_key_id {
3538 return 2;
3539 }
3540 if let Some(_) = self.active_data_wrapping_key_id {
3541 return 1;
3542 }
3543 0
3544 }
3545 }
3546
3547 impl fidl::encoding::ValueTypeMarker for CryptSettings {
3548 type Borrowed<'a> = &'a Self;
3549 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3550 value
3551 }
3552 }
3553
3554 unsafe impl fidl::encoding::TypeMarker for CryptSettings {
3555 type Owned = Self;
3556
3557 #[inline(always)]
3558 fn inline_align(_context: fidl::encoding::Context) -> usize {
3559 8
3560 }
3561
3562 #[inline(always)]
3563 fn inline_size(_context: fidl::encoding::Context) -> usize {
3564 16
3565 }
3566 }
3567
3568 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CryptSettings, D>
3569 for &CryptSettings
3570 {
3571 unsafe fn encode(
3572 self,
3573 encoder: &mut fidl::encoding::Encoder<'_, D>,
3574 offset: usize,
3575 mut depth: fidl::encoding::Depth,
3576 ) -> fidl::Result<()> {
3577 encoder.debug_check_bounds::<CryptSettings>(offset);
3578 let max_ordinal: u64 = self.max_ordinal_present();
3580 encoder.write_num(max_ordinal, offset);
3581 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3582 if max_ordinal == 0 {
3584 return Ok(());
3585 }
3586 depth.increment()?;
3587 let envelope_size = 8;
3588 let bytes_len = max_ordinal as usize * envelope_size;
3589 #[allow(unused_variables)]
3590 let offset = encoder.out_of_line_offset(bytes_len);
3591 let mut _prev_end_offset: usize = 0;
3592 if 1 > max_ordinal {
3593 return Ok(());
3594 }
3595
3596 let cur_offset: usize = (1 - 1) * envelope_size;
3599
3600 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3602
3603 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 16>, D>(
3608 self.active_data_wrapping_key_id.as_ref().map(
3609 <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
3610 ),
3611 encoder,
3612 offset + cur_offset,
3613 depth,
3614 )?;
3615
3616 _prev_end_offset = cur_offset + envelope_size;
3617 if 2 > max_ordinal {
3618 return Ok(());
3619 }
3620
3621 let cur_offset: usize = (2 - 1) * envelope_size;
3624
3625 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3627
3628 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 16>, D>(
3633 self.active_metadata_wrapping_key_id.as_ref().map(
3634 <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
3635 ),
3636 encoder,
3637 offset + cur_offset,
3638 depth,
3639 )?;
3640
3641 _prev_end_offset = cur_offset + envelope_size;
3642
3643 Ok(())
3644 }
3645 }
3646
3647 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CryptSettings {
3648 #[inline(always)]
3649 fn new_empty() -> Self {
3650 Self::default()
3651 }
3652
3653 unsafe fn decode(
3654 &mut self,
3655 decoder: &mut fidl::encoding::Decoder<'_, D>,
3656 offset: usize,
3657 mut depth: fidl::encoding::Depth,
3658 ) -> fidl::Result<()> {
3659 decoder.debug_check_bounds::<Self>(offset);
3660 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3661 None => return Err(fidl::Error::NotNullable),
3662 Some(len) => len,
3663 };
3664 if len == 0 {
3666 return Ok(());
3667 };
3668 depth.increment()?;
3669 let envelope_size = 8;
3670 let bytes_len = len * envelope_size;
3671 let offset = decoder.out_of_line_offset(bytes_len)?;
3672 let mut _next_ordinal_to_read = 0;
3674 let mut next_offset = offset;
3675 let end_offset = offset + bytes_len;
3676 _next_ordinal_to_read += 1;
3677 if next_offset >= end_offset {
3678 return Ok(());
3679 }
3680
3681 while _next_ordinal_to_read < 1 {
3683 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3684 _next_ordinal_to_read += 1;
3685 next_offset += envelope_size;
3686 }
3687
3688 let next_out_of_line = decoder.next_out_of_line();
3689 let handles_before = decoder.remaining_handles();
3690 if let Some((inlined, num_bytes, num_handles)) =
3691 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3692 {
3693 let member_inline_size =
3694 <fidl::encoding::Array<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
3695 decoder.context,
3696 );
3697 if inlined != (member_inline_size <= 4) {
3698 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3699 }
3700 let inner_offset;
3701 let mut inner_depth = depth.clone();
3702 if inlined {
3703 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3704 inner_offset = next_offset;
3705 } else {
3706 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3707 inner_depth.increment()?;
3708 }
3709 let val_ref = self
3710 .active_data_wrapping_key_id
3711 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
3712 fidl::decode!(fidl::encoding::Array<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
3713 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3714 {
3715 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3716 }
3717 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3718 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3719 }
3720 }
3721
3722 next_offset += envelope_size;
3723 _next_ordinal_to_read += 1;
3724 if next_offset >= end_offset {
3725 return Ok(());
3726 }
3727
3728 while _next_ordinal_to_read < 2 {
3730 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3731 _next_ordinal_to_read += 1;
3732 next_offset += envelope_size;
3733 }
3734
3735 let next_out_of_line = decoder.next_out_of_line();
3736 let handles_before = decoder.remaining_handles();
3737 if let Some((inlined, num_bytes, num_handles)) =
3738 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3739 {
3740 let member_inline_size =
3741 <fidl::encoding::Array<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
3742 decoder.context,
3743 );
3744 if inlined != (member_inline_size <= 4) {
3745 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3746 }
3747 let inner_offset;
3748 let mut inner_depth = depth.clone();
3749 if inlined {
3750 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3751 inner_offset = next_offset;
3752 } else {
3753 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3754 inner_depth.increment()?;
3755 }
3756 let val_ref = self
3757 .active_metadata_wrapping_key_id
3758 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
3759 fidl::decode!(fidl::encoding::Array<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
3760 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3761 {
3762 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3763 }
3764 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3765 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3766 }
3767 }
3768
3769 next_offset += envelope_size;
3770
3771 while next_offset < end_offset {
3773 _next_ordinal_to_read += 1;
3774 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3775 next_offset += envelope_size;
3776 }
3777
3778 Ok(())
3779 }
3780 }
3781
3782 impl fidl::encoding::ValueTypeMarker for WrappedKey {
3783 type Borrowed<'a> = &'a Self;
3784 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3785 value
3786 }
3787 }
3788
3789 unsafe impl fidl::encoding::TypeMarker for WrappedKey {
3790 type Owned = Self;
3791
3792 #[inline(always)]
3793 fn inline_align(_context: fidl::encoding::Context) -> usize {
3794 8
3795 }
3796
3797 #[inline(always)]
3798 fn inline_size(_context: fidl::encoding::Context) -> usize {
3799 16
3800 }
3801 }
3802
3803 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WrappedKey, D>
3804 for &WrappedKey
3805 {
3806 #[inline]
3807 unsafe fn encode(
3808 self,
3809 encoder: &mut fidl::encoding::Encoder<'_, D>,
3810 offset: usize,
3811 _depth: fidl::encoding::Depth,
3812 ) -> fidl::Result<()> {
3813 encoder.debug_check_bounds::<WrappedKey>(offset);
3814 encoder.write_num::<u64>(self.ordinal(), offset);
3815 match self {
3816 WrappedKey::FxfsWrapped(ref val) => {
3817 fidl::encoding::encode_in_envelope::<FxfsWrapped, D>(
3818 <FxfsWrapped as fidl::encoding::ValueTypeMarker>::borrow(val),
3819 encoder,
3820 offset + 8,
3821 _depth,
3822 )
3823 }
3824 WrappedKey::Zxcrypt(ref val) => fidl::encoding::encode_in_envelope::<
3825 fidl::encoding::Vector<u8, 132>,
3826 D,
3827 >(
3828 <fidl::encoding::Vector<u8, 132> as fidl::encoding::ValueTypeMarker>::borrow(
3829 val,
3830 ),
3831 encoder,
3832 offset + 8,
3833 _depth,
3834 ),
3835 WrappedKey::FscryptInoLblk32Dir(ref val) => {
3836 fidl::encoding::encode_in_envelope::<FscryptInoLblk32DirKey, D>(
3837 <FscryptInoLblk32DirKey as fidl::encoding::ValueTypeMarker>::borrow(val),
3838 encoder,
3839 offset + 8,
3840 _depth,
3841 )
3842 }
3843 WrappedKey::FscryptInoLblk32File(ref val) => {
3844 fidl::encoding::encode_in_envelope::<FscryptInoLblk32FileKey, D>(
3845 <FscryptInoLblk32FileKey as fidl::encoding::ValueTypeMarker>::borrow(val),
3846 encoder,
3847 offset + 8,
3848 _depth,
3849 )
3850 }
3851 WrappedKey::DmDefaultKey(ref val) => {
3852 fidl::encoding::encode_in_envelope::<EmptyStruct, D>(
3853 <EmptyStruct as fidl::encoding::ValueTypeMarker>::borrow(val),
3854 encoder,
3855 offset + 8,
3856 _depth,
3857 )
3858 }
3859 WrappedKey::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
3860 }
3861 }
3862 }
3863
3864 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WrappedKey {
3865 #[inline(always)]
3866 fn new_empty() -> Self {
3867 Self::__SourceBreaking { unknown_ordinal: 0 }
3868 }
3869
3870 #[inline]
3871 unsafe fn decode(
3872 &mut self,
3873 decoder: &mut fidl::encoding::Decoder<'_, D>,
3874 offset: usize,
3875 mut depth: fidl::encoding::Depth,
3876 ) -> fidl::Result<()> {
3877 decoder.debug_check_bounds::<Self>(offset);
3878 #[allow(unused_variables)]
3879 let next_out_of_line = decoder.next_out_of_line();
3880 let handles_before = decoder.remaining_handles();
3881 let (ordinal, inlined, num_bytes, num_handles) =
3882 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
3883
3884 let member_inline_size = match ordinal {
3885 1 => <FxfsWrapped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3886 2 => <fidl::encoding::Vector<u8, 132> as fidl::encoding::TypeMarker>::inline_size(
3887 decoder.context,
3888 ),
3889 3 => <FscryptInoLblk32DirKey as fidl::encoding::TypeMarker>::inline_size(
3890 decoder.context,
3891 ),
3892 4 => <FscryptInoLblk32FileKey as fidl::encoding::TypeMarker>::inline_size(
3893 decoder.context,
3894 ),
3895 5 => <EmptyStruct as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3896 0 => return Err(fidl::Error::UnknownUnionTag),
3897 _ => num_bytes as usize,
3898 };
3899
3900 if inlined != (member_inline_size <= 4) {
3901 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3902 }
3903 let _inner_offset;
3904 if inlined {
3905 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
3906 _inner_offset = offset + 8;
3907 } else {
3908 depth.increment()?;
3909 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3910 }
3911 match ordinal {
3912 1 => {
3913 #[allow(irrefutable_let_patterns)]
3914 if let WrappedKey::FxfsWrapped(_) = self {
3915 } else {
3917 *self = WrappedKey::FxfsWrapped(fidl::new_empty!(FxfsWrapped, D));
3919 }
3920 #[allow(irrefutable_let_patterns)]
3921 if let WrappedKey::FxfsWrapped(ref mut val) = self {
3922 fidl::decode!(FxfsWrapped, D, val, decoder, _inner_offset, depth)?;
3923 } else {
3924 unreachable!()
3925 }
3926 }
3927 2 => {
3928 #[allow(irrefutable_let_patterns)]
3929 if let WrappedKey::Zxcrypt(_) = self {
3930 } else {
3932 *self = WrappedKey::Zxcrypt(
3934 fidl::new_empty!(fidl::encoding::Vector<u8, 132>, D),
3935 );
3936 }
3937 #[allow(irrefutable_let_patterns)]
3938 if let WrappedKey::Zxcrypt(ref mut val) = self {
3939 fidl::decode!(fidl::encoding::Vector<u8, 132>, D, val, decoder, _inner_offset, depth)?;
3940 } else {
3941 unreachable!()
3942 }
3943 }
3944 3 => {
3945 #[allow(irrefutable_let_patterns)]
3946 if let WrappedKey::FscryptInoLblk32Dir(_) = self {
3947 } else {
3949 *self = WrappedKey::FscryptInoLblk32Dir(fidl::new_empty!(
3951 FscryptInoLblk32DirKey,
3952 D
3953 ));
3954 }
3955 #[allow(irrefutable_let_patterns)]
3956 if let WrappedKey::FscryptInoLblk32Dir(ref mut val) = self {
3957 fidl::decode!(
3958 FscryptInoLblk32DirKey,
3959 D,
3960 val,
3961 decoder,
3962 _inner_offset,
3963 depth
3964 )?;
3965 } else {
3966 unreachable!()
3967 }
3968 }
3969 4 => {
3970 #[allow(irrefutable_let_patterns)]
3971 if let WrappedKey::FscryptInoLblk32File(_) = self {
3972 } else {
3974 *self = WrappedKey::FscryptInoLblk32File(fidl::new_empty!(
3976 FscryptInoLblk32FileKey,
3977 D
3978 ));
3979 }
3980 #[allow(irrefutable_let_patterns)]
3981 if let WrappedKey::FscryptInoLblk32File(ref mut val) = self {
3982 fidl::decode!(
3983 FscryptInoLblk32FileKey,
3984 D,
3985 val,
3986 decoder,
3987 _inner_offset,
3988 depth
3989 )?;
3990 } else {
3991 unreachable!()
3992 }
3993 }
3994 5 => {
3995 #[allow(irrefutable_let_patterns)]
3996 if let WrappedKey::DmDefaultKey(_) = self {
3997 } else {
3999 *self = WrappedKey::DmDefaultKey(fidl::new_empty!(EmptyStruct, D));
4001 }
4002 #[allow(irrefutable_let_patterns)]
4003 if let WrappedKey::DmDefaultKey(ref mut val) = self {
4004 fidl::decode!(EmptyStruct, D, val, decoder, _inner_offset, depth)?;
4005 } else {
4006 unreachable!()
4007 }
4008 }
4009 #[allow(deprecated)]
4010 ordinal => {
4011 for _ in 0..num_handles {
4012 decoder.drop_next_handle()?;
4013 }
4014 *self = WrappedKey::__SourceBreaking { unknown_ordinal: ordinal };
4015 }
4016 }
4017 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
4018 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4019 }
4020 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4021 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4022 }
4023 Ok(())
4024 }
4025 }
4026}