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