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