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 #[deprecated = "Strict enums should not use `is_unknown`"]
37 #[inline]
38 pub fn is_unknown(&self) -> bool {
39 false
40 }
41}
42
43#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
45pub enum KeyPurpose {
46 Metadata,
48 Data,
50 #[doc(hidden)]
51 __SourceBreaking { unknown_ordinal: u32 },
52}
53
54#[macro_export]
56macro_rules! KeyPurposeUnknown {
57 () => {
58 _
59 };
60}
61
62impl KeyPurpose {
63 #[inline]
64 pub fn from_primitive(prim: u32) -> Option<Self> {
65 match prim {
66 1 => Some(Self::Metadata),
67 2 => Some(Self::Data),
68 _ => None,
69 }
70 }
71
72 #[inline]
73 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
74 match prim {
75 1 => Self::Metadata,
76 2 => Self::Data,
77 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
78 }
79 }
80
81 #[inline]
82 pub fn unknown() -> Self {
83 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
84 }
85
86 #[inline]
87 pub const fn into_primitive(self) -> u32 {
88 match self {
89 Self::Metadata => 1,
90 Self::Data => 2,
91 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
92 }
93 }
94
95 #[inline]
96 pub fn is_unknown(&self) -> bool {
97 match self {
98 Self::__SourceBreaking { unknown_ordinal: _ } => true,
99 _ => false,
100 }
101 }
102}
103
104#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
105pub struct BlobCreatorCreateRequest {
106 pub hash: [u8; 32],
107 pub allow_existing: bool,
108}
109
110impl fidl::Persistable for BlobCreatorCreateRequest {}
111
112#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
113#[repr(C)]
114pub struct BlobReaderGetVmoRequest {
115 pub blob_hash: [u8; 32],
116}
117
118impl fidl::Persistable for BlobReaderGetVmoRequest {}
119
120#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
121#[repr(C)]
122pub struct BlobWriterBytesReadyRequest {
123 pub bytes_written: u64,
124}
125
126impl fidl::Persistable for BlobWriterBytesReadyRequest {}
127
128#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
129#[repr(C)]
130pub struct BlobWriterGetVmoRequest {
131 pub size: u64,
132}
133
134impl fidl::Persistable for BlobWriterGetVmoRequest {}
135
136#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
138#[repr(C)]
139pub struct BytesAndNodes {
140 pub bytes: u64,
141 pub nodes: u64,
142}
143
144impl fidl::Persistable for BytesAndNodes {}
145
146#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
147pub struct CryptCreateKeyRequest {
148 pub owner: u64,
149 pub purpose: KeyPurpose,
150}
151
152impl fidl::Persistable for CryptCreateKeyRequest {}
153
154#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
155#[repr(C)]
156pub struct CryptCreateKeyWithIdRequest {
157 pub owner: u64,
158 pub wrapping_key_id: [u8; 16],
159}
160
161impl fidl::Persistable for CryptCreateKeyWithIdRequest {}
162
163#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
164pub struct CryptManagementAddWrappingKeyRequest {
165 pub wrapping_key_id: [u8; 16],
166 pub key: Vec<u8>,
167}
168
169impl fidl::Persistable for CryptManagementAddWrappingKeyRequest {}
170
171#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
172#[repr(C)]
173pub struct CryptManagementForgetWrappingKeyRequest {
174 pub wrapping_key_id: [u8; 16],
175}
176
177impl fidl::Persistable for CryptManagementForgetWrappingKeyRequest {}
178
179#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
180pub struct CryptManagementSetActiveKeyRequest {
181 pub purpose: KeyPurpose,
182 pub wrapping_key_id: [u8; 16],
183}
184
185impl fidl::Persistable for CryptManagementSetActiveKeyRequest {}
186
187#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
188pub struct CryptUnwrapKeyRequest {
189 pub wrapping_key_id: [u8; 16],
190 pub owner: u64,
191 pub key: Vec<u8>,
192}
193
194impl fidl::Persistable for CryptUnwrapKeyRequest {}
195
196#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
197pub struct CryptCreateKeyWithIdResponse {
198 pub wrapped_key: Vec<u8>,
199 pub unwrapped_key: Vec<u8>,
200}
201
202impl fidl::Persistable for CryptCreateKeyWithIdResponse {}
203
204#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
205pub struct CryptCreateKeyResponse {
206 pub wrapping_key_id: [u8; 16],
207 pub wrapped_key: Vec<u8>,
208 pub unwrapped_key: Vec<u8>,
209}
210
211impl fidl::Persistable for CryptCreateKeyResponse {}
212
213#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
214pub struct CryptUnwrapKeyResponse {
215 pub unwrapped_key: Vec<u8>,
216}
217
218impl fidl::Persistable for CryptUnwrapKeyResponse {}
219
220#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
221pub struct DebugDeleteProfileRequest {
222 pub volume: String,
223 pub profile: String,
224}
225
226impl fidl::Persistable for DebugDeleteProfileRequest {}
227
228#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
229#[repr(C)]
230pub struct ProjectIdClearForNodeRequest {
231 pub node_id: u64,
232}
233
234impl fidl::Persistable for ProjectIdClearForNodeRequest {}
235
236#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
237#[repr(C)]
238pub struct ProjectIdClearRequest {
239 pub project_id: u64,
240}
241
242impl fidl::Persistable for ProjectIdClearRequest {}
243
244#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
245#[repr(C)]
246pub struct ProjectIdGetForNodeRequest {
247 pub node_id: u64,
248}
249
250impl fidl::Persistable for ProjectIdGetForNodeRequest {}
251
252#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
253#[repr(C)]
254pub struct ProjectIdInfoRequest {
255 pub project_id: u64,
256}
257
258impl fidl::Persistable for ProjectIdInfoRequest {}
259
260#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
261pub struct ProjectIdListRequest {
262 pub token: Option<Box<ProjectIterToken>>,
263}
264
265impl fidl::Persistable for ProjectIdListRequest {}
266
267#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
268#[repr(C)]
269pub struct ProjectIdSetForNodeRequest {
270 pub node_id: u64,
271 pub project_id: u64,
272}
273
274impl fidl::Persistable for ProjectIdSetForNodeRequest {}
275
276#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
277#[repr(C)]
278pub struct ProjectIdSetLimitRequest {
279 pub project_id: u64,
280 pub bytes: u64,
281 pub nodes: u64,
282}
283
284impl fidl::Persistable for ProjectIdSetLimitRequest {}
285
286#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
287#[repr(C)]
288pub struct ProjectIdGetForNodeResponse {
289 pub project_id: u64,
290}
291
292impl fidl::Persistable for ProjectIdGetForNodeResponse {}
293
294#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
295#[repr(C)]
296pub struct ProjectIdInfoResponse {
297 pub limit: BytesAndNodes,
298 pub usage: BytesAndNodes,
299}
300
301impl fidl::Persistable for ProjectIdInfoResponse {}
302
303#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
304pub struct ProjectIdListResponse {
305 pub entries: Vec<u64>,
306 pub next_token: Option<Box<ProjectIterToken>>,
307}
308
309impl fidl::Persistable for ProjectIdListResponse {}
310
311#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
315#[repr(C)]
316pub struct ProjectIterToken {
317 pub value: u64,
318}
319
320impl fidl::Persistable for ProjectIterToken {}
321
322#[derive(Clone, Debug, Default, PartialEq)]
323pub struct CryptSettings {
324 pub active_data_wrapping_key_id: Option<[u8; 16]>,
325 pub active_metadata_wrapping_key_id: Option<[u8; 16]>,
326 #[doc(hidden)]
327 pub __source_breaking: fidl::marker::SourceBreaking,
328}
329
330impl fidl::Persistable for CryptSettings {}
331
332mod internal {
333 use super::*;
334 unsafe impl fidl::encoding::TypeMarker for CreateBlobError {
335 type Owned = Self;
336
337 #[inline(always)]
338 fn inline_align(_context: fidl::encoding::Context) -> usize {
339 std::mem::align_of::<u32>()
340 }
341
342 #[inline(always)]
343 fn inline_size(_context: fidl::encoding::Context) -> usize {
344 std::mem::size_of::<u32>()
345 }
346
347 #[inline(always)]
348 fn encode_is_copy() -> bool {
349 true
350 }
351
352 #[inline(always)]
353 fn decode_is_copy() -> bool {
354 false
355 }
356 }
357
358 impl fidl::encoding::ValueTypeMarker for CreateBlobError {
359 type Borrowed<'a> = Self;
360 #[inline(always)]
361 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
362 *value
363 }
364 }
365
366 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
367 for CreateBlobError
368 {
369 #[inline]
370 unsafe fn encode(
371 self,
372 encoder: &mut fidl::encoding::Encoder<'_, D>,
373 offset: usize,
374 _depth: fidl::encoding::Depth,
375 ) -> fidl::Result<()> {
376 encoder.debug_check_bounds::<Self>(offset);
377 encoder.write_num(self.into_primitive(), offset);
378 Ok(())
379 }
380 }
381
382 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CreateBlobError {
383 #[inline(always)]
384 fn new_empty() -> Self {
385 Self::AlreadyExists
386 }
387
388 #[inline]
389 unsafe fn decode(
390 &mut self,
391 decoder: &mut fidl::encoding::Decoder<'_, D>,
392 offset: usize,
393 _depth: fidl::encoding::Depth,
394 ) -> fidl::Result<()> {
395 decoder.debug_check_bounds::<Self>(offset);
396 let prim = decoder.read_num::<u32>(offset);
397
398 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
399 Ok(())
400 }
401 }
402 unsafe impl fidl::encoding::TypeMarker for KeyPurpose {
403 type Owned = Self;
404
405 #[inline(always)]
406 fn inline_align(_context: fidl::encoding::Context) -> usize {
407 std::mem::align_of::<u32>()
408 }
409
410 #[inline(always)]
411 fn inline_size(_context: fidl::encoding::Context) -> usize {
412 std::mem::size_of::<u32>()
413 }
414
415 #[inline(always)]
416 fn encode_is_copy() -> bool {
417 false
418 }
419
420 #[inline(always)]
421 fn decode_is_copy() -> bool {
422 false
423 }
424 }
425
426 impl fidl::encoding::ValueTypeMarker for KeyPurpose {
427 type Borrowed<'a> = Self;
428 #[inline(always)]
429 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
430 *value
431 }
432 }
433
434 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for KeyPurpose {
435 #[inline]
436 unsafe fn encode(
437 self,
438 encoder: &mut fidl::encoding::Encoder<'_, D>,
439 offset: usize,
440 _depth: fidl::encoding::Depth,
441 ) -> fidl::Result<()> {
442 encoder.debug_check_bounds::<Self>(offset);
443 encoder.write_num(self.into_primitive(), offset);
444 Ok(())
445 }
446 }
447
448 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for KeyPurpose {
449 #[inline(always)]
450 fn new_empty() -> Self {
451 Self::unknown()
452 }
453
454 #[inline]
455 unsafe fn decode(
456 &mut self,
457 decoder: &mut fidl::encoding::Decoder<'_, D>,
458 offset: usize,
459 _depth: fidl::encoding::Depth,
460 ) -> fidl::Result<()> {
461 decoder.debug_check_bounds::<Self>(offset);
462 let prim = decoder.read_num::<u32>(offset);
463
464 *self = Self::from_primitive_allow_unknown(prim);
465 Ok(())
466 }
467 }
468
469 impl fidl::encoding::ValueTypeMarker for BlobCreatorCreateRequest {
470 type Borrowed<'a> = &'a Self;
471 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
472 value
473 }
474 }
475
476 unsafe impl fidl::encoding::TypeMarker for BlobCreatorCreateRequest {
477 type Owned = Self;
478
479 #[inline(always)]
480 fn inline_align(_context: fidl::encoding::Context) -> usize {
481 1
482 }
483
484 #[inline(always)]
485 fn inline_size(_context: fidl::encoding::Context) -> usize {
486 33
487 }
488 }
489
490 unsafe impl<D: fidl::encoding::ResourceDialect>
491 fidl::encoding::Encode<BlobCreatorCreateRequest, D> for &BlobCreatorCreateRequest
492 {
493 #[inline]
494 unsafe fn encode(
495 self,
496 encoder: &mut fidl::encoding::Encoder<'_, D>,
497 offset: usize,
498 _depth: fidl::encoding::Depth,
499 ) -> fidl::Result<()> {
500 encoder.debug_check_bounds::<BlobCreatorCreateRequest>(offset);
501 fidl::encoding::Encode::<BlobCreatorCreateRequest, D>::encode(
503 (
504 <fidl::encoding::Array<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(
505 &self.hash,
506 ),
507 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.allow_existing),
508 ),
509 encoder,
510 offset,
511 _depth,
512 )
513 }
514 }
515 unsafe impl<
516 D: fidl::encoding::ResourceDialect,
517 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 32>, D>,
518 T1: fidl::encoding::Encode<bool, D>,
519 > fidl::encoding::Encode<BlobCreatorCreateRequest, D> for (T0, T1)
520 {
521 #[inline]
522 unsafe fn encode(
523 self,
524 encoder: &mut fidl::encoding::Encoder<'_, D>,
525 offset: usize,
526 depth: fidl::encoding::Depth,
527 ) -> fidl::Result<()> {
528 encoder.debug_check_bounds::<BlobCreatorCreateRequest>(offset);
529 self.0.encode(encoder, offset + 0, depth)?;
533 self.1.encode(encoder, offset + 32, depth)?;
534 Ok(())
535 }
536 }
537
538 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
539 for BlobCreatorCreateRequest
540 {
541 #[inline(always)]
542 fn new_empty() -> Self {
543 Self {
544 hash: fidl::new_empty!(fidl::encoding::Array<u8, 32>, D),
545 allow_existing: fidl::new_empty!(bool, D),
546 }
547 }
548
549 #[inline]
550 unsafe fn decode(
551 &mut self,
552 decoder: &mut fidl::encoding::Decoder<'_, D>,
553 offset: usize,
554 _depth: fidl::encoding::Depth,
555 ) -> fidl::Result<()> {
556 decoder.debug_check_bounds::<Self>(offset);
557 fidl::decode!(fidl::encoding::Array<u8, 32>, D, &mut self.hash, decoder, offset + 0, _depth)?;
559 fidl::decode!(bool, D, &mut self.allow_existing, decoder, offset + 32, _depth)?;
560 Ok(())
561 }
562 }
563
564 impl fidl::encoding::ValueTypeMarker for BlobReaderGetVmoRequest {
565 type Borrowed<'a> = &'a Self;
566 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
567 value
568 }
569 }
570
571 unsafe impl fidl::encoding::TypeMarker for BlobReaderGetVmoRequest {
572 type Owned = Self;
573
574 #[inline(always)]
575 fn inline_align(_context: fidl::encoding::Context) -> usize {
576 1
577 }
578
579 #[inline(always)]
580 fn inline_size(_context: fidl::encoding::Context) -> usize {
581 32
582 }
583 #[inline(always)]
584 fn encode_is_copy() -> bool {
585 true
586 }
587
588 #[inline(always)]
589 fn decode_is_copy() -> bool {
590 true
591 }
592 }
593
594 unsafe impl<D: fidl::encoding::ResourceDialect>
595 fidl::encoding::Encode<BlobReaderGetVmoRequest, D> for &BlobReaderGetVmoRequest
596 {
597 #[inline]
598 unsafe fn encode(
599 self,
600 encoder: &mut fidl::encoding::Encoder<'_, D>,
601 offset: usize,
602 _depth: fidl::encoding::Depth,
603 ) -> fidl::Result<()> {
604 encoder.debug_check_bounds::<BlobReaderGetVmoRequest>(offset);
605 unsafe {
606 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
608 (buf_ptr as *mut BlobReaderGetVmoRequest)
609 .write_unaligned((self as *const BlobReaderGetVmoRequest).read());
610 }
613 Ok(())
614 }
615 }
616 unsafe impl<
617 D: fidl::encoding::ResourceDialect,
618 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 32>, D>,
619 > fidl::encoding::Encode<BlobReaderGetVmoRequest, D> for (T0,)
620 {
621 #[inline]
622 unsafe fn encode(
623 self,
624 encoder: &mut fidl::encoding::Encoder<'_, D>,
625 offset: usize,
626 depth: fidl::encoding::Depth,
627 ) -> fidl::Result<()> {
628 encoder.debug_check_bounds::<BlobReaderGetVmoRequest>(offset);
629 self.0.encode(encoder, offset + 0, depth)?;
633 Ok(())
634 }
635 }
636
637 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
638 for BlobReaderGetVmoRequest
639 {
640 #[inline(always)]
641 fn new_empty() -> Self {
642 Self { blob_hash: fidl::new_empty!(fidl::encoding::Array<u8, 32>, D) }
643 }
644
645 #[inline]
646 unsafe fn decode(
647 &mut self,
648 decoder: &mut fidl::encoding::Decoder<'_, D>,
649 offset: usize,
650 _depth: fidl::encoding::Depth,
651 ) -> fidl::Result<()> {
652 decoder.debug_check_bounds::<Self>(offset);
653 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
654 unsafe {
657 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
658 }
659 Ok(())
660 }
661 }
662
663 impl fidl::encoding::ValueTypeMarker for BlobWriterBytesReadyRequest {
664 type Borrowed<'a> = &'a Self;
665 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
666 value
667 }
668 }
669
670 unsafe impl fidl::encoding::TypeMarker for BlobWriterBytesReadyRequest {
671 type Owned = Self;
672
673 #[inline(always)]
674 fn inline_align(_context: fidl::encoding::Context) -> usize {
675 8
676 }
677
678 #[inline(always)]
679 fn inline_size(_context: fidl::encoding::Context) -> usize {
680 8
681 }
682 #[inline(always)]
683 fn encode_is_copy() -> bool {
684 true
685 }
686
687 #[inline(always)]
688 fn decode_is_copy() -> bool {
689 true
690 }
691 }
692
693 unsafe impl<D: fidl::encoding::ResourceDialect>
694 fidl::encoding::Encode<BlobWriterBytesReadyRequest, D> for &BlobWriterBytesReadyRequest
695 {
696 #[inline]
697 unsafe fn encode(
698 self,
699 encoder: &mut fidl::encoding::Encoder<'_, D>,
700 offset: usize,
701 _depth: fidl::encoding::Depth,
702 ) -> fidl::Result<()> {
703 encoder.debug_check_bounds::<BlobWriterBytesReadyRequest>(offset);
704 unsafe {
705 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
707 (buf_ptr as *mut BlobWriterBytesReadyRequest)
708 .write_unaligned((self as *const BlobWriterBytesReadyRequest).read());
709 }
712 Ok(())
713 }
714 }
715 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
716 fidl::encoding::Encode<BlobWriterBytesReadyRequest, D> for (T0,)
717 {
718 #[inline]
719 unsafe fn encode(
720 self,
721 encoder: &mut fidl::encoding::Encoder<'_, D>,
722 offset: usize,
723 depth: fidl::encoding::Depth,
724 ) -> fidl::Result<()> {
725 encoder.debug_check_bounds::<BlobWriterBytesReadyRequest>(offset);
726 self.0.encode(encoder, offset + 0, depth)?;
730 Ok(())
731 }
732 }
733
734 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
735 for BlobWriterBytesReadyRequest
736 {
737 #[inline(always)]
738 fn new_empty() -> Self {
739 Self { bytes_written: fidl::new_empty!(u64, D) }
740 }
741
742 #[inline]
743 unsafe fn decode(
744 &mut self,
745 decoder: &mut fidl::encoding::Decoder<'_, D>,
746 offset: usize,
747 _depth: fidl::encoding::Depth,
748 ) -> fidl::Result<()> {
749 decoder.debug_check_bounds::<Self>(offset);
750 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
751 unsafe {
754 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
755 }
756 Ok(())
757 }
758 }
759
760 impl fidl::encoding::ValueTypeMarker for BlobWriterGetVmoRequest {
761 type Borrowed<'a> = &'a Self;
762 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
763 value
764 }
765 }
766
767 unsafe impl fidl::encoding::TypeMarker for BlobWriterGetVmoRequest {
768 type Owned = Self;
769
770 #[inline(always)]
771 fn inline_align(_context: fidl::encoding::Context) -> usize {
772 8
773 }
774
775 #[inline(always)]
776 fn inline_size(_context: fidl::encoding::Context) -> usize {
777 8
778 }
779 #[inline(always)]
780 fn encode_is_copy() -> bool {
781 true
782 }
783
784 #[inline(always)]
785 fn decode_is_copy() -> bool {
786 true
787 }
788 }
789
790 unsafe impl<D: fidl::encoding::ResourceDialect>
791 fidl::encoding::Encode<BlobWriterGetVmoRequest, D> for &BlobWriterGetVmoRequest
792 {
793 #[inline]
794 unsafe fn encode(
795 self,
796 encoder: &mut fidl::encoding::Encoder<'_, D>,
797 offset: usize,
798 _depth: fidl::encoding::Depth,
799 ) -> fidl::Result<()> {
800 encoder.debug_check_bounds::<BlobWriterGetVmoRequest>(offset);
801 unsafe {
802 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
804 (buf_ptr as *mut BlobWriterGetVmoRequest)
805 .write_unaligned((self as *const BlobWriterGetVmoRequest).read());
806 }
809 Ok(())
810 }
811 }
812 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
813 fidl::encoding::Encode<BlobWriterGetVmoRequest, D> for (T0,)
814 {
815 #[inline]
816 unsafe fn encode(
817 self,
818 encoder: &mut fidl::encoding::Encoder<'_, D>,
819 offset: usize,
820 depth: fidl::encoding::Depth,
821 ) -> fidl::Result<()> {
822 encoder.debug_check_bounds::<BlobWriterGetVmoRequest>(offset);
823 self.0.encode(encoder, offset + 0, depth)?;
827 Ok(())
828 }
829 }
830
831 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
832 for BlobWriterGetVmoRequest
833 {
834 #[inline(always)]
835 fn new_empty() -> Self {
836 Self { size: fidl::new_empty!(u64, D) }
837 }
838
839 #[inline]
840 unsafe fn decode(
841 &mut self,
842 decoder: &mut fidl::encoding::Decoder<'_, D>,
843 offset: usize,
844 _depth: fidl::encoding::Depth,
845 ) -> fidl::Result<()> {
846 decoder.debug_check_bounds::<Self>(offset);
847 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
848 unsafe {
851 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
852 }
853 Ok(())
854 }
855 }
856
857 impl fidl::encoding::ValueTypeMarker for BytesAndNodes {
858 type Borrowed<'a> = &'a Self;
859 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
860 value
861 }
862 }
863
864 unsafe impl fidl::encoding::TypeMarker for BytesAndNodes {
865 type Owned = Self;
866
867 #[inline(always)]
868 fn inline_align(_context: fidl::encoding::Context) -> usize {
869 8
870 }
871
872 #[inline(always)]
873 fn inline_size(_context: fidl::encoding::Context) -> usize {
874 16
875 }
876 #[inline(always)]
877 fn encode_is_copy() -> bool {
878 true
879 }
880
881 #[inline(always)]
882 fn decode_is_copy() -> bool {
883 true
884 }
885 }
886
887 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BytesAndNodes, D>
888 for &BytesAndNodes
889 {
890 #[inline]
891 unsafe fn encode(
892 self,
893 encoder: &mut fidl::encoding::Encoder<'_, D>,
894 offset: usize,
895 _depth: fidl::encoding::Depth,
896 ) -> fidl::Result<()> {
897 encoder.debug_check_bounds::<BytesAndNodes>(offset);
898 unsafe {
899 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
901 (buf_ptr as *mut BytesAndNodes)
902 .write_unaligned((self as *const BytesAndNodes).read());
903 }
906 Ok(())
907 }
908 }
909 unsafe impl<
910 D: fidl::encoding::ResourceDialect,
911 T0: fidl::encoding::Encode<u64, D>,
912 T1: fidl::encoding::Encode<u64, D>,
913 > fidl::encoding::Encode<BytesAndNodes, D> for (T0, T1)
914 {
915 #[inline]
916 unsafe fn encode(
917 self,
918 encoder: &mut fidl::encoding::Encoder<'_, D>,
919 offset: usize,
920 depth: fidl::encoding::Depth,
921 ) -> fidl::Result<()> {
922 encoder.debug_check_bounds::<BytesAndNodes>(offset);
923 self.0.encode(encoder, offset + 0, depth)?;
927 self.1.encode(encoder, offset + 8, depth)?;
928 Ok(())
929 }
930 }
931
932 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BytesAndNodes {
933 #[inline(always)]
934 fn new_empty() -> Self {
935 Self { bytes: fidl::new_empty!(u64, D), nodes: fidl::new_empty!(u64, D) }
936 }
937
938 #[inline]
939 unsafe fn decode(
940 &mut self,
941 decoder: &mut fidl::encoding::Decoder<'_, D>,
942 offset: usize,
943 _depth: fidl::encoding::Depth,
944 ) -> fidl::Result<()> {
945 decoder.debug_check_bounds::<Self>(offset);
946 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
947 unsafe {
950 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
951 }
952 Ok(())
953 }
954 }
955
956 impl fidl::encoding::ValueTypeMarker for CryptCreateKeyRequest {
957 type Borrowed<'a> = &'a Self;
958 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
959 value
960 }
961 }
962
963 unsafe impl fidl::encoding::TypeMarker for CryptCreateKeyRequest {
964 type Owned = Self;
965
966 #[inline(always)]
967 fn inline_align(_context: fidl::encoding::Context) -> usize {
968 8
969 }
970
971 #[inline(always)]
972 fn inline_size(_context: fidl::encoding::Context) -> usize {
973 16
974 }
975 }
976
977 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CryptCreateKeyRequest, D>
978 for &CryptCreateKeyRequest
979 {
980 #[inline]
981 unsafe fn encode(
982 self,
983 encoder: &mut fidl::encoding::Encoder<'_, D>,
984 offset: usize,
985 _depth: fidl::encoding::Depth,
986 ) -> fidl::Result<()> {
987 encoder.debug_check_bounds::<CryptCreateKeyRequest>(offset);
988 fidl::encoding::Encode::<CryptCreateKeyRequest, D>::encode(
990 (
991 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.owner),
992 <KeyPurpose as fidl::encoding::ValueTypeMarker>::borrow(&self.purpose),
993 ),
994 encoder,
995 offset,
996 _depth,
997 )
998 }
999 }
1000 unsafe impl<
1001 D: fidl::encoding::ResourceDialect,
1002 T0: fidl::encoding::Encode<u64, D>,
1003 T1: fidl::encoding::Encode<KeyPurpose, D>,
1004 > fidl::encoding::Encode<CryptCreateKeyRequest, D> for (T0, T1)
1005 {
1006 #[inline]
1007 unsafe fn encode(
1008 self,
1009 encoder: &mut fidl::encoding::Encoder<'_, D>,
1010 offset: usize,
1011 depth: fidl::encoding::Depth,
1012 ) -> fidl::Result<()> {
1013 encoder.debug_check_bounds::<CryptCreateKeyRequest>(offset);
1014 unsafe {
1017 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
1018 (ptr as *mut u64).write_unaligned(0);
1019 }
1020 self.0.encode(encoder, offset + 0, depth)?;
1022 self.1.encode(encoder, offset + 8, depth)?;
1023 Ok(())
1024 }
1025 }
1026
1027 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CryptCreateKeyRequest {
1028 #[inline(always)]
1029 fn new_empty() -> Self {
1030 Self { owner: fidl::new_empty!(u64, D), purpose: fidl::new_empty!(KeyPurpose, D) }
1031 }
1032
1033 #[inline]
1034 unsafe fn decode(
1035 &mut self,
1036 decoder: &mut fidl::encoding::Decoder<'_, D>,
1037 offset: usize,
1038 _depth: fidl::encoding::Depth,
1039 ) -> fidl::Result<()> {
1040 decoder.debug_check_bounds::<Self>(offset);
1041 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
1043 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1044 let mask = 0xffffffff00000000u64;
1045 let maskedval = padval & mask;
1046 if maskedval != 0 {
1047 return Err(fidl::Error::NonZeroPadding {
1048 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
1049 });
1050 }
1051 fidl::decode!(u64, D, &mut self.owner, decoder, offset + 0, _depth)?;
1052 fidl::decode!(KeyPurpose, D, &mut self.purpose, decoder, offset + 8, _depth)?;
1053 Ok(())
1054 }
1055 }
1056
1057 impl fidl::encoding::ValueTypeMarker for CryptCreateKeyWithIdRequest {
1058 type Borrowed<'a> = &'a Self;
1059 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1060 value
1061 }
1062 }
1063
1064 unsafe impl fidl::encoding::TypeMarker for CryptCreateKeyWithIdRequest {
1065 type Owned = Self;
1066
1067 #[inline(always)]
1068 fn inline_align(_context: fidl::encoding::Context) -> usize {
1069 8
1070 }
1071
1072 #[inline(always)]
1073 fn inline_size(_context: fidl::encoding::Context) -> usize {
1074 24
1075 }
1076 #[inline(always)]
1077 fn encode_is_copy() -> bool {
1078 true
1079 }
1080
1081 #[inline(always)]
1082 fn decode_is_copy() -> bool {
1083 true
1084 }
1085 }
1086
1087 unsafe impl<D: fidl::encoding::ResourceDialect>
1088 fidl::encoding::Encode<CryptCreateKeyWithIdRequest, D> for &CryptCreateKeyWithIdRequest
1089 {
1090 #[inline]
1091 unsafe fn encode(
1092 self,
1093 encoder: &mut fidl::encoding::Encoder<'_, D>,
1094 offset: usize,
1095 _depth: fidl::encoding::Depth,
1096 ) -> fidl::Result<()> {
1097 encoder.debug_check_bounds::<CryptCreateKeyWithIdRequest>(offset);
1098 unsafe {
1099 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1101 (buf_ptr as *mut CryptCreateKeyWithIdRequest)
1102 .write_unaligned((self as *const CryptCreateKeyWithIdRequest).read());
1103 }
1106 Ok(())
1107 }
1108 }
1109 unsafe impl<
1110 D: fidl::encoding::ResourceDialect,
1111 T0: fidl::encoding::Encode<u64, D>,
1112 T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
1113 > fidl::encoding::Encode<CryptCreateKeyWithIdRequest, D> for (T0, T1)
1114 {
1115 #[inline]
1116 unsafe fn encode(
1117 self,
1118 encoder: &mut fidl::encoding::Encoder<'_, D>,
1119 offset: usize,
1120 depth: fidl::encoding::Depth,
1121 ) -> fidl::Result<()> {
1122 encoder.debug_check_bounds::<CryptCreateKeyWithIdRequest>(offset);
1123 self.0.encode(encoder, offset + 0, depth)?;
1127 self.1.encode(encoder, offset + 8, depth)?;
1128 Ok(())
1129 }
1130 }
1131
1132 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1133 for CryptCreateKeyWithIdRequest
1134 {
1135 #[inline(always)]
1136 fn new_empty() -> Self {
1137 Self {
1138 owner: fidl::new_empty!(u64, D),
1139 wrapping_key_id: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D),
1140 }
1141 }
1142
1143 #[inline]
1144 unsafe fn decode(
1145 &mut self,
1146 decoder: &mut fidl::encoding::Decoder<'_, D>,
1147 offset: usize,
1148 _depth: fidl::encoding::Depth,
1149 ) -> fidl::Result<()> {
1150 decoder.debug_check_bounds::<Self>(offset);
1151 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1152 unsafe {
1155 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
1156 }
1157 Ok(())
1158 }
1159 }
1160
1161 impl fidl::encoding::ValueTypeMarker for CryptManagementAddWrappingKeyRequest {
1162 type Borrowed<'a> = &'a Self;
1163 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1164 value
1165 }
1166 }
1167
1168 unsafe impl fidl::encoding::TypeMarker for CryptManagementAddWrappingKeyRequest {
1169 type Owned = Self;
1170
1171 #[inline(always)]
1172 fn inline_align(_context: fidl::encoding::Context) -> usize {
1173 8
1174 }
1175
1176 #[inline(always)]
1177 fn inline_size(_context: fidl::encoding::Context) -> usize {
1178 32
1179 }
1180 }
1181
1182 unsafe impl<D: fidl::encoding::ResourceDialect>
1183 fidl::encoding::Encode<CryptManagementAddWrappingKeyRequest, D>
1184 for &CryptManagementAddWrappingKeyRequest
1185 {
1186 #[inline]
1187 unsafe fn encode(
1188 self,
1189 encoder: &mut fidl::encoding::Encoder<'_, D>,
1190 offset: usize,
1191 _depth: fidl::encoding::Depth,
1192 ) -> fidl::Result<()> {
1193 encoder.debug_check_bounds::<CryptManagementAddWrappingKeyRequest>(offset);
1194 fidl::encoding::Encode::<CryptManagementAddWrappingKeyRequest, D>::encode(
1196 (
1197 <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow(
1198 &self.wrapping_key_id,
1199 ),
1200 <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(
1201 &self.key,
1202 ),
1203 ),
1204 encoder,
1205 offset,
1206 _depth,
1207 )
1208 }
1209 }
1210 unsafe impl<
1211 D: fidl::encoding::ResourceDialect,
1212 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
1213 T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 32>, D>,
1214 > fidl::encoding::Encode<CryptManagementAddWrappingKeyRequest, D> for (T0, T1)
1215 {
1216 #[inline]
1217 unsafe fn encode(
1218 self,
1219 encoder: &mut fidl::encoding::Encoder<'_, D>,
1220 offset: usize,
1221 depth: fidl::encoding::Depth,
1222 ) -> fidl::Result<()> {
1223 encoder.debug_check_bounds::<CryptManagementAddWrappingKeyRequest>(offset);
1224 self.0.encode(encoder, offset + 0, depth)?;
1228 self.1.encode(encoder, offset + 16, depth)?;
1229 Ok(())
1230 }
1231 }
1232
1233 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1234 for CryptManagementAddWrappingKeyRequest
1235 {
1236 #[inline(always)]
1237 fn new_empty() -> Self {
1238 Self {
1239 wrapping_key_id: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D),
1240 key: fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D),
1241 }
1242 }
1243
1244 #[inline]
1245 unsafe fn decode(
1246 &mut self,
1247 decoder: &mut fidl::encoding::Decoder<'_, D>,
1248 offset: usize,
1249 _depth: fidl::encoding::Depth,
1250 ) -> fidl::Result<()> {
1251 decoder.debug_check_bounds::<Self>(offset);
1252 fidl::decode!(fidl::encoding::Array<u8, 16>, D, &mut self.wrapping_key_id, decoder, offset + 0, _depth)?;
1254 fidl::decode!(fidl::encoding::Vector<u8, 32>, D, &mut self.key, decoder, offset + 16, _depth)?;
1255 Ok(())
1256 }
1257 }
1258
1259 impl fidl::encoding::ValueTypeMarker for CryptManagementForgetWrappingKeyRequest {
1260 type Borrowed<'a> = &'a Self;
1261 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1262 value
1263 }
1264 }
1265
1266 unsafe impl fidl::encoding::TypeMarker for CryptManagementForgetWrappingKeyRequest {
1267 type Owned = Self;
1268
1269 #[inline(always)]
1270 fn inline_align(_context: fidl::encoding::Context) -> usize {
1271 1
1272 }
1273
1274 #[inline(always)]
1275 fn inline_size(_context: fidl::encoding::Context) -> usize {
1276 16
1277 }
1278 #[inline(always)]
1279 fn encode_is_copy() -> bool {
1280 true
1281 }
1282
1283 #[inline(always)]
1284 fn decode_is_copy() -> bool {
1285 true
1286 }
1287 }
1288
1289 unsafe impl<D: fidl::encoding::ResourceDialect>
1290 fidl::encoding::Encode<CryptManagementForgetWrappingKeyRequest, D>
1291 for &CryptManagementForgetWrappingKeyRequest
1292 {
1293 #[inline]
1294 unsafe fn encode(
1295 self,
1296 encoder: &mut fidl::encoding::Encoder<'_, D>,
1297 offset: usize,
1298 _depth: fidl::encoding::Depth,
1299 ) -> fidl::Result<()> {
1300 encoder.debug_check_bounds::<CryptManagementForgetWrappingKeyRequest>(offset);
1301 unsafe {
1302 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1304 (buf_ptr as *mut CryptManagementForgetWrappingKeyRequest).write_unaligned(
1305 (self as *const CryptManagementForgetWrappingKeyRequest).read(),
1306 );
1307 }
1310 Ok(())
1311 }
1312 }
1313 unsafe impl<
1314 D: fidl::encoding::ResourceDialect,
1315 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
1316 > fidl::encoding::Encode<CryptManagementForgetWrappingKeyRequest, D> for (T0,)
1317 {
1318 #[inline]
1319 unsafe fn encode(
1320 self,
1321 encoder: &mut fidl::encoding::Encoder<'_, D>,
1322 offset: usize,
1323 depth: fidl::encoding::Depth,
1324 ) -> fidl::Result<()> {
1325 encoder.debug_check_bounds::<CryptManagementForgetWrappingKeyRequest>(offset);
1326 self.0.encode(encoder, offset + 0, depth)?;
1330 Ok(())
1331 }
1332 }
1333
1334 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1335 for CryptManagementForgetWrappingKeyRequest
1336 {
1337 #[inline(always)]
1338 fn new_empty() -> Self {
1339 Self { wrapping_key_id: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D) }
1340 }
1341
1342 #[inline]
1343 unsafe fn decode(
1344 &mut self,
1345 decoder: &mut fidl::encoding::Decoder<'_, D>,
1346 offset: usize,
1347 _depth: fidl::encoding::Depth,
1348 ) -> fidl::Result<()> {
1349 decoder.debug_check_bounds::<Self>(offset);
1350 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1351 unsafe {
1354 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
1355 }
1356 Ok(())
1357 }
1358 }
1359
1360 impl fidl::encoding::ValueTypeMarker for CryptManagementSetActiveKeyRequest {
1361 type Borrowed<'a> = &'a Self;
1362 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1363 value
1364 }
1365 }
1366
1367 unsafe impl fidl::encoding::TypeMarker for CryptManagementSetActiveKeyRequest {
1368 type Owned = Self;
1369
1370 #[inline(always)]
1371 fn inline_align(_context: fidl::encoding::Context) -> usize {
1372 4
1373 }
1374
1375 #[inline(always)]
1376 fn inline_size(_context: fidl::encoding::Context) -> usize {
1377 20
1378 }
1379 }
1380
1381 unsafe impl<D: fidl::encoding::ResourceDialect>
1382 fidl::encoding::Encode<CryptManagementSetActiveKeyRequest, D>
1383 for &CryptManagementSetActiveKeyRequest
1384 {
1385 #[inline]
1386 unsafe fn encode(
1387 self,
1388 encoder: &mut fidl::encoding::Encoder<'_, D>,
1389 offset: usize,
1390 _depth: fidl::encoding::Depth,
1391 ) -> fidl::Result<()> {
1392 encoder.debug_check_bounds::<CryptManagementSetActiveKeyRequest>(offset);
1393 fidl::encoding::Encode::<CryptManagementSetActiveKeyRequest, D>::encode(
1395 (
1396 <KeyPurpose as fidl::encoding::ValueTypeMarker>::borrow(&self.purpose),
1397 <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow(
1398 &self.wrapping_key_id,
1399 ),
1400 ),
1401 encoder,
1402 offset,
1403 _depth,
1404 )
1405 }
1406 }
1407 unsafe impl<
1408 D: fidl::encoding::ResourceDialect,
1409 T0: fidl::encoding::Encode<KeyPurpose, D>,
1410 T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
1411 > fidl::encoding::Encode<CryptManagementSetActiveKeyRequest, D> for (T0, T1)
1412 {
1413 #[inline]
1414 unsafe fn encode(
1415 self,
1416 encoder: &mut fidl::encoding::Encoder<'_, D>,
1417 offset: usize,
1418 depth: fidl::encoding::Depth,
1419 ) -> fidl::Result<()> {
1420 encoder.debug_check_bounds::<CryptManagementSetActiveKeyRequest>(offset);
1421 self.0.encode(encoder, offset + 0, depth)?;
1425 self.1.encode(encoder, offset + 4, depth)?;
1426 Ok(())
1427 }
1428 }
1429
1430 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1431 for CryptManagementSetActiveKeyRequest
1432 {
1433 #[inline(always)]
1434 fn new_empty() -> Self {
1435 Self {
1436 purpose: fidl::new_empty!(KeyPurpose, D),
1437 wrapping_key_id: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D),
1438 }
1439 }
1440
1441 #[inline]
1442 unsafe fn decode(
1443 &mut self,
1444 decoder: &mut fidl::encoding::Decoder<'_, D>,
1445 offset: usize,
1446 _depth: fidl::encoding::Depth,
1447 ) -> fidl::Result<()> {
1448 decoder.debug_check_bounds::<Self>(offset);
1449 fidl::decode!(KeyPurpose, D, &mut self.purpose, decoder, offset + 0, _depth)?;
1451 fidl::decode!(fidl::encoding::Array<u8, 16>, D, &mut self.wrapping_key_id, decoder, offset + 4, _depth)?;
1452 Ok(())
1453 }
1454 }
1455
1456 impl fidl::encoding::ValueTypeMarker for CryptUnwrapKeyRequest {
1457 type Borrowed<'a> = &'a Self;
1458 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1459 value
1460 }
1461 }
1462
1463 unsafe impl fidl::encoding::TypeMarker for CryptUnwrapKeyRequest {
1464 type Owned = Self;
1465
1466 #[inline(always)]
1467 fn inline_align(_context: fidl::encoding::Context) -> usize {
1468 8
1469 }
1470
1471 #[inline(always)]
1472 fn inline_size(_context: fidl::encoding::Context) -> usize {
1473 40
1474 }
1475 }
1476
1477 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CryptUnwrapKeyRequest, D>
1478 for &CryptUnwrapKeyRequest
1479 {
1480 #[inline]
1481 unsafe fn encode(
1482 self,
1483 encoder: &mut fidl::encoding::Encoder<'_, D>,
1484 offset: usize,
1485 _depth: fidl::encoding::Depth,
1486 ) -> fidl::Result<()> {
1487 encoder.debug_check_bounds::<CryptUnwrapKeyRequest>(offset);
1488 fidl::encoding::Encode::<CryptUnwrapKeyRequest, D>::encode(
1490 (
1491 <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow(
1492 &self.wrapping_key_id,
1493 ),
1494 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.owner),
1495 <fidl::encoding::Vector<u8, 132> as fidl::encoding::ValueTypeMarker>::borrow(
1496 &self.key,
1497 ),
1498 ),
1499 encoder,
1500 offset,
1501 _depth,
1502 )
1503 }
1504 }
1505 unsafe impl<
1506 D: fidl::encoding::ResourceDialect,
1507 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
1508 T1: fidl::encoding::Encode<u64, D>,
1509 T2: fidl::encoding::Encode<fidl::encoding::Vector<u8, 132>, D>,
1510 > fidl::encoding::Encode<CryptUnwrapKeyRequest, D> for (T0, T1, T2)
1511 {
1512 #[inline]
1513 unsafe fn encode(
1514 self,
1515 encoder: &mut fidl::encoding::Encoder<'_, D>,
1516 offset: usize,
1517 depth: fidl::encoding::Depth,
1518 ) -> fidl::Result<()> {
1519 encoder.debug_check_bounds::<CryptUnwrapKeyRequest>(offset);
1520 self.0.encode(encoder, offset + 0, depth)?;
1524 self.1.encode(encoder, offset + 16, depth)?;
1525 self.2.encode(encoder, offset + 24, depth)?;
1526 Ok(())
1527 }
1528 }
1529
1530 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CryptUnwrapKeyRequest {
1531 #[inline(always)]
1532 fn new_empty() -> Self {
1533 Self {
1534 wrapping_key_id: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D),
1535 owner: fidl::new_empty!(u64, D),
1536 key: fidl::new_empty!(fidl::encoding::Vector<u8, 132>, D),
1537 }
1538 }
1539
1540 #[inline]
1541 unsafe fn decode(
1542 &mut self,
1543 decoder: &mut fidl::encoding::Decoder<'_, D>,
1544 offset: usize,
1545 _depth: fidl::encoding::Depth,
1546 ) -> fidl::Result<()> {
1547 decoder.debug_check_bounds::<Self>(offset);
1548 fidl::decode!(fidl::encoding::Array<u8, 16>, D, &mut self.wrapping_key_id, decoder, offset + 0, _depth)?;
1550 fidl::decode!(u64, D, &mut self.owner, decoder, offset + 16, _depth)?;
1551 fidl::decode!(fidl::encoding::Vector<u8, 132>, D, &mut self.key, decoder, offset + 24, _depth)?;
1552 Ok(())
1553 }
1554 }
1555
1556 impl fidl::encoding::ValueTypeMarker for CryptCreateKeyWithIdResponse {
1557 type Borrowed<'a> = &'a Self;
1558 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1559 value
1560 }
1561 }
1562
1563 unsafe impl fidl::encoding::TypeMarker for CryptCreateKeyWithIdResponse {
1564 type Owned = Self;
1565
1566 #[inline(always)]
1567 fn inline_align(_context: fidl::encoding::Context) -> usize {
1568 8
1569 }
1570
1571 #[inline(always)]
1572 fn inline_size(_context: fidl::encoding::Context) -> usize {
1573 32
1574 }
1575 }
1576
1577 unsafe impl<D: fidl::encoding::ResourceDialect>
1578 fidl::encoding::Encode<CryptCreateKeyWithIdResponse, D> for &CryptCreateKeyWithIdResponse
1579 {
1580 #[inline]
1581 unsafe fn encode(
1582 self,
1583 encoder: &mut fidl::encoding::Encoder<'_, D>,
1584 offset: usize,
1585 _depth: fidl::encoding::Depth,
1586 ) -> fidl::Result<()> {
1587 encoder.debug_check_bounds::<CryptCreateKeyWithIdResponse>(offset);
1588 fidl::encoding::Encode::<CryptCreateKeyWithIdResponse, D>::encode(
1590 (
1591 <fidl::encoding::Vector<u8, 132> as fidl::encoding::ValueTypeMarker>::borrow(
1592 &self.wrapped_key,
1593 ),
1594 <fidl::encoding::Vector<u8, 80> as fidl::encoding::ValueTypeMarker>::borrow(
1595 &self.unwrapped_key,
1596 ),
1597 ),
1598 encoder,
1599 offset,
1600 _depth,
1601 )
1602 }
1603 }
1604 unsafe impl<
1605 D: fidl::encoding::ResourceDialect,
1606 T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 132>, D>,
1607 T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 80>, D>,
1608 > fidl::encoding::Encode<CryptCreateKeyWithIdResponse, D> for (T0, T1)
1609 {
1610 #[inline]
1611 unsafe fn encode(
1612 self,
1613 encoder: &mut fidl::encoding::Encoder<'_, D>,
1614 offset: usize,
1615 depth: fidl::encoding::Depth,
1616 ) -> fidl::Result<()> {
1617 encoder.debug_check_bounds::<CryptCreateKeyWithIdResponse>(offset);
1618 self.0.encode(encoder, offset + 0, depth)?;
1622 self.1.encode(encoder, offset + 16, depth)?;
1623 Ok(())
1624 }
1625 }
1626
1627 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1628 for CryptCreateKeyWithIdResponse
1629 {
1630 #[inline(always)]
1631 fn new_empty() -> Self {
1632 Self {
1633 wrapped_key: fidl::new_empty!(fidl::encoding::Vector<u8, 132>, D),
1634 unwrapped_key: fidl::new_empty!(fidl::encoding::Vector<u8, 80>, D),
1635 }
1636 }
1637
1638 #[inline]
1639 unsafe fn decode(
1640 &mut self,
1641 decoder: &mut fidl::encoding::Decoder<'_, D>,
1642 offset: usize,
1643 _depth: fidl::encoding::Depth,
1644 ) -> fidl::Result<()> {
1645 decoder.debug_check_bounds::<Self>(offset);
1646 fidl::decode!(fidl::encoding::Vector<u8, 132>, D, &mut self.wrapped_key, decoder, offset + 0, _depth)?;
1648 fidl::decode!(fidl::encoding::Vector<u8, 80>, D, &mut self.unwrapped_key, decoder, offset + 16, _depth)?;
1649 Ok(())
1650 }
1651 }
1652
1653 impl fidl::encoding::ValueTypeMarker for CryptCreateKeyResponse {
1654 type Borrowed<'a> = &'a Self;
1655 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1656 value
1657 }
1658 }
1659
1660 unsafe impl fidl::encoding::TypeMarker for CryptCreateKeyResponse {
1661 type Owned = Self;
1662
1663 #[inline(always)]
1664 fn inline_align(_context: fidl::encoding::Context) -> usize {
1665 8
1666 }
1667
1668 #[inline(always)]
1669 fn inline_size(_context: fidl::encoding::Context) -> usize {
1670 48
1671 }
1672 }
1673
1674 unsafe impl<D: fidl::encoding::ResourceDialect>
1675 fidl::encoding::Encode<CryptCreateKeyResponse, D> for &CryptCreateKeyResponse
1676 {
1677 #[inline]
1678 unsafe fn encode(
1679 self,
1680 encoder: &mut fidl::encoding::Encoder<'_, D>,
1681 offset: usize,
1682 _depth: fidl::encoding::Depth,
1683 ) -> fidl::Result<()> {
1684 encoder.debug_check_bounds::<CryptCreateKeyResponse>(offset);
1685 fidl::encoding::Encode::<CryptCreateKeyResponse, D>::encode(
1687 (
1688 <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow(
1689 &self.wrapping_key_id,
1690 ),
1691 <fidl::encoding::Vector<u8, 132> as fidl::encoding::ValueTypeMarker>::borrow(
1692 &self.wrapped_key,
1693 ),
1694 <fidl::encoding::Vector<u8, 80> as fidl::encoding::ValueTypeMarker>::borrow(
1695 &self.unwrapped_key,
1696 ),
1697 ),
1698 encoder,
1699 offset,
1700 _depth,
1701 )
1702 }
1703 }
1704 unsafe impl<
1705 D: fidl::encoding::ResourceDialect,
1706 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
1707 T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 132>, D>,
1708 T2: fidl::encoding::Encode<fidl::encoding::Vector<u8, 80>, D>,
1709 > fidl::encoding::Encode<CryptCreateKeyResponse, D> for (T0, T1, T2)
1710 {
1711 #[inline]
1712 unsafe fn encode(
1713 self,
1714 encoder: &mut fidl::encoding::Encoder<'_, D>,
1715 offset: usize,
1716 depth: fidl::encoding::Depth,
1717 ) -> fidl::Result<()> {
1718 encoder.debug_check_bounds::<CryptCreateKeyResponse>(offset);
1719 self.0.encode(encoder, offset + 0, depth)?;
1723 self.1.encode(encoder, offset + 16, depth)?;
1724 self.2.encode(encoder, offset + 32, depth)?;
1725 Ok(())
1726 }
1727 }
1728
1729 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1730 for CryptCreateKeyResponse
1731 {
1732 #[inline(always)]
1733 fn new_empty() -> Self {
1734 Self {
1735 wrapping_key_id: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D),
1736 wrapped_key: fidl::new_empty!(fidl::encoding::Vector<u8, 132>, D),
1737 unwrapped_key: fidl::new_empty!(fidl::encoding::Vector<u8, 80>, D),
1738 }
1739 }
1740
1741 #[inline]
1742 unsafe fn decode(
1743 &mut self,
1744 decoder: &mut fidl::encoding::Decoder<'_, D>,
1745 offset: usize,
1746 _depth: fidl::encoding::Depth,
1747 ) -> fidl::Result<()> {
1748 decoder.debug_check_bounds::<Self>(offset);
1749 fidl::decode!(fidl::encoding::Array<u8, 16>, D, &mut self.wrapping_key_id, decoder, offset + 0, _depth)?;
1751 fidl::decode!(fidl::encoding::Vector<u8, 132>, D, &mut self.wrapped_key, decoder, offset + 16, _depth)?;
1752 fidl::decode!(fidl::encoding::Vector<u8, 80>, D, &mut self.unwrapped_key, decoder, offset + 32, _depth)?;
1753 Ok(())
1754 }
1755 }
1756
1757 impl fidl::encoding::ValueTypeMarker for CryptUnwrapKeyResponse {
1758 type Borrowed<'a> = &'a Self;
1759 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1760 value
1761 }
1762 }
1763
1764 unsafe impl fidl::encoding::TypeMarker for CryptUnwrapKeyResponse {
1765 type Owned = Self;
1766
1767 #[inline(always)]
1768 fn inline_align(_context: fidl::encoding::Context) -> usize {
1769 8
1770 }
1771
1772 #[inline(always)]
1773 fn inline_size(_context: fidl::encoding::Context) -> usize {
1774 16
1775 }
1776 }
1777
1778 unsafe impl<D: fidl::encoding::ResourceDialect>
1779 fidl::encoding::Encode<CryptUnwrapKeyResponse, D> for &CryptUnwrapKeyResponse
1780 {
1781 #[inline]
1782 unsafe fn encode(
1783 self,
1784 encoder: &mut fidl::encoding::Encoder<'_, D>,
1785 offset: usize,
1786 _depth: fidl::encoding::Depth,
1787 ) -> fidl::Result<()> {
1788 encoder.debug_check_bounds::<CryptUnwrapKeyResponse>(offset);
1789 fidl::encoding::Encode::<CryptUnwrapKeyResponse, D>::encode(
1791 (<fidl::encoding::Vector<u8, 80> as fidl::encoding::ValueTypeMarker>::borrow(
1792 &self.unwrapped_key,
1793 ),),
1794 encoder,
1795 offset,
1796 _depth,
1797 )
1798 }
1799 }
1800 unsafe impl<
1801 D: fidl::encoding::ResourceDialect,
1802 T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 80>, D>,
1803 > fidl::encoding::Encode<CryptUnwrapKeyResponse, D> for (T0,)
1804 {
1805 #[inline]
1806 unsafe fn encode(
1807 self,
1808 encoder: &mut fidl::encoding::Encoder<'_, D>,
1809 offset: usize,
1810 depth: fidl::encoding::Depth,
1811 ) -> fidl::Result<()> {
1812 encoder.debug_check_bounds::<CryptUnwrapKeyResponse>(offset);
1813 self.0.encode(encoder, offset + 0, depth)?;
1817 Ok(())
1818 }
1819 }
1820
1821 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1822 for CryptUnwrapKeyResponse
1823 {
1824 #[inline(always)]
1825 fn new_empty() -> Self {
1826 Self { unwrapped_key: fidl::new_empty!(fidl::encoding::Vector<u8, 80>, D) }
1827 }
1828
1829 #[inline]
1830 unsafe fn decode(
1831 &mut self,
1832 decoder: &mut fidl::encoding::Decoder<'_, D>,
1833 offset: usize,
1834 _depth: fidl::encoding::Depth,
1835 ) -> fidl::Result<()> {
1836 decoder.debug_check_bounds::<Self>(offset);
1837 fidl::decode!(fidl::encoding::Vector<u8, 80>, D, &mut self.unwrapped_key, decoder, offset + 0, _depth)?;
1839 Ok(())
1840 }
1841 }
1842
1843 impl fidl::encoding::ValueTypeMarker for DebugDeleteProfileRequest {
1844 type Borrowed<'a> = &'a Self;
1845 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1846 value
1847 }
1848 }
1849
1850 unsafe impl fidl::encoding::TypeMarker for DebugDeleteProfileRequest {
1851 type Owned = Self;
1852
1853 #[inline(always)]
1854 fn inline_align(_context: fidl::encoding::Context) -> usize {
1855 8
1856 }
1857
1858 #[inline(always)]
1859 fn inline_size(_context: fidl::encoding::Context) -> usize {
1860 32
1861 }
1862 }
1863
1864 unsafe impl<D: fidl::encoding::ResourceDialect>
1865 fidl::encoding::Encode<DebugDeleteProfileRequest, D> for &DebugDeleteProfileRequest
1866 {
1867 #[inline]
1868 unsafe fn encode(
1869 self,
1870 encoder: &mut fidl::encoding::Encoder<'_, D>,
1871 offset: usize,
1872 _depth: fidl::encoding::Depth,
1873 ) -> fidl::Result<()> {
1874 encoder.debug_check_bounds::<DebugDeleteProfileRequest>(offset);
1875 fidl::encoding::Encode::<DebugDeleteProfileRequest, D>::encode(
1877 (
1878 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
1879 &self.volume,
1880 ),
1881 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
1882 &self.profile,
1883 ),
1884 ),
1885 encoder,
1886 offset,
1887 _depth,
1888 )
1889 }
1890 }
1891 unsafe impl<
1892 D: fidl::encoding::ResourceDialect,
1893 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
1894 T1: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
1895 > fidl::encoding::Encode<DebugDeleteProfileRequest, D> for (T0, T1)
1896 {
1897 #[inline]
1898 unsafe fn encode(
1899 self,
1900 encoder: &mut fidl::encoding::Encoder<'_, D>,
1901 offset: usize,
1902 depth: fidl::encoding::Depth,
1903 ) -> fidl::Result<()> {
1904 encoder.debug_check_bounds::<DebugDeleteProfileRequest>(offset);
1905 self.0.encode(encoder, offset + 0, depth)?;
1909 self.1.encode(encoder, offset + 16, depth)?;
1910 Ok(())
1911 }
1912 }
1913
1914 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1915 for DebugDeleteProfileRequest
1916 {
1917 #[inline(always)]
1918 fn new_empty() -> Self {
1919 Self {
1920 volume: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
1921 profile: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
1922 }
1923 }
1924
1925 #[inline]
1926 unsafe fn decode(
1927 &mut self,
1928 decoder: &mut fidl::encoding::Decoder<'_, D>,
1929 offset: usize,
1930 _depth: fidl::encoding::Depth,
1931 ) -> fidl::Result<()> {
1932 decoder.debug_check_bounds::<Self>(offset);
1933 fidl::decode!(
1935 fidl::encoding::BoundedString<255>,
1936 D,
1937 &mut self.volume,
1938 decoder,
1939 offset + 0,
1940 _depth
1941 )?;
1942 fidl::decode!(
1943 fidl::encoding::BoundedString<255>,
1944 D,
1945 &mut self.profile,
1946 decoder,
1947 offset + 16,
1948 _depth
1949 )?;
1950 Ok(())
1951 }
1952 }
1953
1954 impl fidl::encoding::ValueTypeMarker for ProjectIdClearForNodeRequest {
1955 type Borrowed<'a> = &'a Self;
1956 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1957 value
1958 }
1959 }
1960
1961 unsafe impl fidl::encoding::TypeMarker for ProjectIdClearForNodeRequest {
1962 type Owned = Self;
1963
1964 #[inline(always)]
1965 fn inline_align(_context: fidl::encoding::Context) -> usize {
1966 8
1967 }
1968
1969 #[inline(always)]
1970 fn inline_size(_context: fidl::encoding::Context) -> usize {
1971 8
1972 }
1973 #[inline(always)]
1974 fn encode_is_copy() -> bool {
1975 true
1976 }
1977
1978 #[inline(always)]
1979 fn decode_is_copy() -> bool {
1980 true
1981 }
1982 }
1983
1984 unsafe impl<D: fidl::encoding::ResourceDialect>
1985 fidl::encoding::Encode<ProjectIdClearForNodeRequest, D> for &ProjectIdClearForNodeRequest
1986 {
1987 #[inline]
1988 unsafe fn encode(
1989 self,
1990 encoder: &mut fidl::encoding::Encoder<'_, D>,
1991 offset: usize,
1992 _depth: fidl::encoding::Depth,
1993 ) -> fidl::Result<()> {
1994 encoder.debug_check_bounds::<ProjectIdClearForNodeRequest>(offset);
1995 unsafe {
1996 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1998 (buf_ptr as *mut ProjectIdClearForNodeRequest)
1999 .write_unaligned((self as *const ProjectIdClearForNodeRequest).read());
2000 }
2003 Ok(())
2004 }
2005 }
2006 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2007 fidl::encoding::Encode<ProjectIdClearForNodeRequest, D> for (T0,)
2008 {
2009 #[inline]
2010 unsafe fn encode(
2011 self,
2012 encoder: &mut fidl::encoding::Encoder<'_, D>,
2013 offset: usize,
2014 depth: fidl::encoding::Depth,
2015 ) -> fidl::Result<()> {
2016 encoder.debug_check_bounds::<ProjectIdClearForNodeRequest>(offset);
2017 self.0.encode(encoder, offset + 0, depth)?;
2021 Ok(())
2022 }
2023 }
2024
2025 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2026 for ProjectIdClearForNodeRequest
2027 {
2028 #[inline(always)]
2029 fn new_empty() -> Self {
2030 Self { node_id: fidl::new_empty!(u64, D) }
2031 }
2032
2033 #[inline]
2034 unsafe fn decode(
2035 &mut self,
2036 decoder: &mut fidl::encoding::Decoder<'_, D>,
2037 offset: usize,
2038 _depth: fidl::encoding::Depth,
2039 ) -> fidl::Result<()> {
2040 decoder.debug_check_bounds::<Self>(offset);
2041 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2042 unsafe {
2045 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2046 }
2047 Ok(())
2048 }
2049 }
2050
2051 impl fidl::encoding::ValueTypeMarker for ProjectIdClearRequest {
2052 type Borrowed<'a> = &'a Self;
2053 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2054 value
2055 }
2056 }
2057
2058 unsafe impl fidl::encoding::TypeMarker for ProjectIdClearRequest {
2059 type Owned = Self;
2060
2061 #[inline(always)]
2062 fn inline_align(_context: fidl::encoding::Context) -> usize {
2063 8
2064 }
2065
2066 #[inline(always)]
2067 fn inline_size(_context: fidl::encoding::Context) -> usize {
2068 8
2069 }
2070 #[inline(always)]
2071 fn encode_is_copy() -> bool {
2072 true
2073 }
2074
2075 #[inline(always)]
2076 fn decode_is_copy() -> bool {
2077 true
2078 }
2079 }
2080
2081 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProjectIdClearRequest, D>
2082 for &ProjectIdClearRequest
2083 {
2084 #[inline]
2085 unsafe fn encode(
2086 self,
2087 encoder: &mut fidl::encoding::Encoder<'_, D>,
2088 offset: usize,
2089 _depth: fidl::encoding::Depth,
2090 ) -> fidl::Result<()> {
2091 encoder.debug_check_bounds::<ProjectIdClearRequest>(offset);
2092 unsafe {
2093 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2095 (buf_ptr as *mut ProjectIdClearRequest)
2096 .write_unaligned((self as *const ProjectIdClearRequest).read());
2097 }
2100 Ok(())
2101 }
2102 }
2103 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2104 fidl::encoding::Encode<ProjectIdClearRequest, D> for (T0,)
2105 {
2106 #[inline]
2107 unsafe fn encode(
2108 self,
2109 encoder: &mut fidl::encoding::Encoder<'_, D>,
2110 offset: usize,
2111 depth: fidl::encoding::Depth,
2112 ) -> fidl::Result<()> {
2113 encoder.debug_check_bounds::<ProjectIdClearRequest>(offset);
2114 self.0.encode(encoder, offset + 0, depth)?;
2118 Ok(())
2119 }
2120 }
2121
2122 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIdClearRequest {
2123 #[inline(always)]
2124 fn new_empty() -> Self {
2125 Self { project_id: fidl::new_empty!(u64, D) }
2126 }
2127
2128 #[inline]
2129 unsafe fn decode(
2130 &mut self,
2131 decoder: &mut fidl::encoding::Decoder<'_, D>,
2132 offset: usize,
2133 _depth: fidl::encoding::Depth,
2134 ) -> fidl::Result<()> {
2135 decoder.debug_check_bounds::<Self>(offset);
2136 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2137 unsafe {
2140 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2141 }
2142 Ok(())
2143 }
2144 }
2145
2146 impl fidl::encoding::ValueTypeMarker for ProjectIdGetForNodeRequest {
2147 type Borrowed<'a> = &'a Self;
2148 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2149 value
2150 }
2151 }
2152
2153 unsafe impl fidl::encoding::TypeMarker for ProjectIdGetForNodeRequest {
2154 type Owned = Self;
2155
2156 #[inline(always)]
2157 fn inline_align(_context: fidl::encoding::Context) -> usize {
2158 8
2159 }
2160
2161 #[inline(always)]
2162 fn inline_size(_context: fidl::encoding::Context) -> usize {
2163 8
2164 }
2165 #[inline(always)]
2166 fn encode_is_copy() -> bool {
2167 true
2168 }
2169
2170 #[inline(always)]
2171 fn decode_is_copy() -> bool {
2172 true
2173 }
2174 }
2175
2176 unsafe impl<D: fidl::encoding::ResourceDialect>
2177 fidl::encoding::Encode<ProjectIdGetForNodeRequest, D> for &ProjectIdGetForNodeRequest
2178 {
2179 #[inline]
2180 unsafe fn encode(
2181 self,
2182 encoder: &mut fidl::encoding::Encoder<'_, D>,
2183 offset: usize,
2184 _depth: fidl::encoding::Depth,
2185 ) -> fidl::Result<()> {
2186 encoder.debug_check_bounds::<ProjectIdGetForNodeRequest>(offset);
2187 unsafe {
2188 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2190 (buf_ptr as *mut ProjectIdGetForNodeRequest)
2191 .write_unaligned((self as *const ProjectIdGetForNodeRequest).read());
2192 }
2195 Ok(())
2196 }
2197 }
2198 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2199 fidl::encoding::Encode<ProjectIdGetForNodeRequest, D> for (T0,)
2200 {
2201 #[inline]
2202 unsafe fn encode(
2203 self,
2204 encoder: &mut fidl::encoding::Encoder<'_, D>,
2205 offset: usize,
2206 depth: fidl::encoding::Depth,
2207 ) -> fidl::Result<()> {
2208 encoder.debug_check_bounds::<ProjectIdGetForNodeRequest>(offset);
2209 self.0.encode(encoder, offset + 0, depth)?;
2213 Ok(())
2214 }
2215 }
2216
2217 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2218 for ProjectIdGetForNodeRequest
2219 {
2220 #[inline(always)]
2221 fn new_empty() -> Self {
2222 Self { node_id: fidl::new_empty!(u64, D) }
2223 }
2224
2225 #[inline]
2226 unsafe fn decode(
2227 &mut self,
2228 decoder: &mut fidl::encoding::Decoder<'_, D>,
2229 offset: usize,
2230 _depth: fidl::encoding::Depth,
2231 ) -> fidl::Result<()> {
2232 decoder.debug_check_bounds::<Self>(offset);
2233 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2234 unsafe {
2237 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2238 }
2239 Ok(())
2240 }
2241 }
2242
2243 impl fidl::encoding::ValueTypeMarker for ProjectIdInfoRequest {
2244 type Borrowed<'a> = &'a Self;
2245 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2246 value
2247 }
2248 }
2249
2250 unsafe impl fidl::encoding::TypeMarker for ProjectIdInfoRequest {
2251 type Owned = Self;
2252
2253 #[inline(always)]
2254 fn inline_align(_context: fidl::encoding::Context) -> usize {
2255 8
2256 }
2257
2258 #[inline(always)]
2259 fn inline_size(_context: fidl::encoding::Context) -> usize {
2260 8
2261 }
2262 #[inline(always)]
2263 fn encode_is_copy() -> bool {
2264 true
2265 }
2266
2267 #[inline(always)]
2268 fn decode_is_copy() -> bool {
2269 true
2270 }
2271 }
2272
2273 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProjectIdInfoRequest, D>
2274 for &ProjectIdInfoRequest
2275 {
2276 #[inline]
2277 unsafe fn encode(
2278 self,
2279 encoder: &mut fidl::encoding::Encoder<'_, D>,
2280 offset: usize,
2281 _depth: fidl::encoding::Depth,
2282 ) -> fidl::Result<()> {
2283 encoder.debug_check_bounds::<ProjectIdInfoRequest>(offset);
2284 unsafe {
2285 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2287 (buf_ptr as *mut ProjectIdInfoRequest)
2288 .write_unaligned((self as *const ProjectIdInfoRequest).read());
2289 }
2292 Ok(())
2293 }
2294 }
2295 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2296 fidl::encoding::Encode<ProjectIdInfoRequest, D> for (T0,)
2297 {
2298 #[inline]
2299 unsafe fn encode(
2300 self,
2301 encoder: &mut fidl::encoding::Encoder<'_, D>,
2302 offset: usize,
2303 depth: fidl::encoding::Depth,
2304 ) -> fidl::Result<()> {
2305 encoder.debug_check_bounds::<ProjectIdInfoRequest>(offset);
2306 self.0.encode(encoder, offset + 0, depth)?;
2310 Ok(())
2311 }
2312 }
2313
2314 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIdInfoRequest {
2315 #[inline(always)]
2316 fn new_empty() -> Self {
2317 Self { project_id: fidl::new_empty!(u64, D) }
2318 }
2319
2320 #[inline]
2321 unsafe fn decode(
2322 &mut self,
2323 decoder: &mut fidl::encoding::Decoder<'_, D>,
2324 offset: usize,
2325 _depth: fidl::encoding::Depth,
2326 ) -> fidl::Result<()> {
2327 decoder.debug_check_bounds::<Self>(offset);
2328 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2329 unsafe {
2332 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2333 }
2334 Ok(())
2335 }
2336 }
2337
2338 impl fidl::encoding::ValueTypeMarker for ProjectIdListRequest {
2339 type Borrowed<'a> = &'a Self;
2340 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2341 value
2342 }
2343 }
2344
2345 unsafe impl fidl::encoding::TypeMarker for ProjectIdListRequest {
2346 type Owned = Self;
2347
2348 #[inline(always)]
2349 fn inline_align(_context: fidl::encoding::Context) -> usize {
2350 8
2351 }
2352
2353 #[inline(always)]
2354 fn inline_size(_context: fidl::encoding::Context) -> usize {
2355 8
2356 }
2357 }
2358
2359 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProjectIdListRequest, D>
2360 for &ProjectIdListRequest
2361 {
2362 #[inline]
2363 unsafe fn encode(
2364 self,
2365 encoder: &mut fidl::encoding::Encoder<'_, D>,
2366 offset: usize,
2367 _depth: fidl::encoding::Depth,
2368 ) -> fidl::Result<()> {
2369 encoder.debug_check_bounds::<ProjectIdListRequest>(offset);
2370 fidl::encoding::Encode::<ProjectIdListRequest, D>::encode(
2372 (
2373 <fidl::encoding::Boxed<ProjectIterToken> as fidl::encoding::ValueTypeMarker>::borrow(&self.token),
2374 ),
2375 encoder, offset, _depth
2376 )
2377 }
2378 }
2379 unsafe impl<
2380 D: fidl::encoding::ResourceDialect,
2381 T0: fidl::encoding::Encode<fidl::encoding::Boxed<ProjectIterToken>, D>,
2382 > fidl::encoding::Encode<ProjectIdListRequest, D> for (T0,)
2383 {
2384 #[inline]
2385 unsafe fn encode(
2386 self,
2387 encoder: &mut fidl::encoding::Encoder<'_, D>,
2388 offset: usize,
2389 depth: fidl::encoding::Depth,
2390 ) -> fidl::Result<()> {
2391 encoder.debug_check_bounds::<ProjectIdListRequest>(offset);
2392 self.0.encode(encoder, offset + 0, depth)?;
2396 Ok(())
2397 }
2398 }
2399
2400 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIdListRequest {
2401 #[inline(always)]
2402 fn new_empty() -> Self {
2403 Self { token: fidl::new_empty!(fidl::encoding::Boxed<ProjectIterToken>, D) }
2404 }
2405
2406 #[inline]
2407 unsafe fn decode(
2408 &mut self,
2409 decoder: &mut fidl::encoding::Decoder<'_, D>,
2410 offset: usize,
2411 _depth: fidl::encoding::Depth,
2412 ) -> fidl::Result<()> {
2413 decoder.debug_check_bounds::<Self>(offset);
2414 fidl::decode!(
2416 fidl::encoding::Boxed<ProjectIterToken>,
2417 D,
2418 &mut self.token,
2419 decoder,
2420 offset + 0,
2421 _depth
2422 )?;
2423 Ok(())
2424 }
2425 }
2426
2427 impl fidl::encoding::ValueTypeMarker for ProjectIdSetForNodeRequest {
2428 type Borrowed<'a> = &'a Self;
2429 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2430 value
2431 }
2432 }
2433
2434 unsafe impl fidl::encoding::TypeMarker for ProjectIdSetForNodeRequest {
2435 type Owned = Self;
2436
2437 #[inline(always)]
2438 fn inline_align(_context: fidl::encoding::Context) -> usize {
2439 8
2440 }
2441
2442 #[inline(always)]
2443 fn inline_size(_context: fidl::encoding::Context) -> usize {
2444 16
2445 }
2446 #[inline(always)]
2447 fn encode_is_copy() -> bool {
2448 true
2449 }
2450
2451 #[inline(always)]
2452 fn decode_is_copy() -> bool {
2453 true
2454 }
2455 }
2456
2457 unsafe impl<D: fidl::encoding::ResourceDialect>
2458 fidl::encoding::Encode<ProjectIdSetForNodeRequest, D> for &ProjectIdSetForNodeRequest
2459 {
2460 #[inline]
2461 unsafe fn encode(
2462 self,
2463 encoder: &mut fidl::encoding::Encoder<'_, D>,
2464 offset: usize,
2465 _depth: fidl::encoding::Depth,
2466 ) -> fidl::Result<()> {
2467 encoder.debug_check_bounds::<ProjectIdSetForNodeRequest>(offset);
2468 unsafe {
2469 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2471 (buf_ptr as *mut ProjectIdSetForNodeRequest)
2472 .write_unaligned((self as *const ProjectIdSetForNodeRequest).read());
2473 }
2476 Ok(())
2477 }
2478 }
2479 unsafe impl<
2480 D: fidl::encoding::ResourceDialect,
2481 T0: fidl::encoding::Encode<u64, D>,
2482 T1: fidl::encoding::Encode<u64, D>,
2483 > fidl::encoding::Encode<ProjectIdSetForNodeRequest, D> for (T0, T1)
2484 {
2485 #[inline]
2486 unsafe fn encode(
2487 self,
2488 encoder: &mut fidl::encoding::Encoder<'_, D>,
2489 offset: usize,
2490 depth: fidl::encoding::Depth,
2491 ) -> fidl::Result<()> {
2492 encoder.debug_check_bounds::<ProjectIdSetForNodeRequest>(offset);
2493 self.0.encode(encoder, offset + 0, depth)?;
2497 self.1.encode(encoder, offset + 8, depth)?;
2498 Ok(())
2499 }
2500 }
2501
2502 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2503 for ProjectIdSetForNodeRequest
2504 {
2505 #[inline(always)]
2506 fn new_empty() -> Self {
2507 Self { node_id: fidl::new_empty!(u64, D), project_id: fidl::new_empty!(u64, D) }
2508 }
2509
2510 #[inline]
2511 unsafe fn decode(
2512 &mut self,
2513 decoder: &mut fidl::encoding::Decoder<'_, D>,
2514 offset: usize,
2515 _depth: fidl::encoding::Depth,
2516 ) -> fidl::Result<()> {
2517 decoder.debug_check_bounds::<Self>(offset);
2518 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2519 unsafe {
2522 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2523 }
2524 Ok(())
2525 }
2526 }
2527
2528 impl fidl::encoding::ValueTypeMarker for ProjectIdSetLimitRequest {
2529 type Borrowed<'a> = &'a Self;
2530 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2531 value
2532 }
2533 }
2534
2535 unsafe impl fidl::encoding::TypeMarker for ProjectIdSetLimitRequest {
2536 type Owned = Self;
2537
2538 #[inline(always)]
2539 fn inline_align(_context: fidl::encoding::Context) -> usize {
2540 8
2541 }
2542
2543 #[inline(always)]
2544 fn inline_size(_context: fidl::encoding::Context) -> usize {
2545 24
2546 }
2547 #[inline(always)]
2548 fn encode_is_copy() -> bool {
2549 true
2550 }
2551
2552 #[inline(always)]
2553 fn decode_is_copy() -> bool {
2554 true
2555 }
2556 }
2557
2558 unsafe impl<D: fidl::encoding::ResourceDialect>
2559 fidl::encoding::Encode<ProjectIdSetLimitRequest, D> for &ProjectIdSetLimitRequest
2560 {
2561 #[inline]
2562 unsafe fn encode(
2563 self,
2564 encoder: &mut fidl::encoding::Encoder<'_, D>,
2565 offset: usize,
2566 _depth: fidl::encoding::Depth,
2567 ) -> fidl::Result<()> {
2568 encoder.debug_check_bounds::<ProjectIdSetLimitRequest>(offset);
2569 unsafe {
2570 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2572 (buf_ptr as *mut ProjectIdSetLimitRequest)
2573 .write_unaligned((self as *const ProjectIdSetLimitRequest).read());
2574 }
2577 Ok(())
2578 }
2579 }
2580 unsafe impl<
2581 D: fidl::encoding::ResourceDialect,
2582 T0: fidl::encoding::Encode<u64, D>,
2583 T1: fidl::encoding::Encode<u64, D>,
2584 T2: fidl::encoding::Encode<u64, D>,
2585 > fidl::encoding::Encode<ProjectIdSetLimitRequest, D> for (T0, T1, T2)
2586 {
2587 #[inline]
2588 unsafe fn encode(
2589 self,
2590 encoder: &mut fidl::encoding::Encoder<'_, D>,
2591 offset: usize,
2592 depth: fidl::encoding::Depth,
2593 ) -> fidl::Result<()> {
2594 encoder.debug_check_bounds::<ProjectIdSetLimitRequest>(offset);
2595 self.0.encode(encoder, offset + 0, depth)?;
2599 self.1.encode(encoder, offset + 8, depth)?;
2600 self.2.encode(encoder, offset + 16, depth)?;
2601 Ok(())
2602 }
2603 }
2604
2605 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2606 for ProjectIdSetLimitRequest
2607 {
2608 #[inline(always)]
2609 fn new_empty() -> Self {
2610 Self {
2611 project_id: fidl::new_empty!(u64, D),
2612 bytes: fidl::new_empty!(u64, D),
2613 nodes: fidl::new_empty!(u64, D),
2614 }
2615 }
2616
2617 #[inline]
2618 unsafe fn decode(
2619 &mut self,
2620 decoder: &mut fidl::encoding::Decoder<'_, D>,
2621 offset: usize,
2622 _depth: fidl::encoding::Depth,
2623 ) -> fidl::Result<()> {
2624 decoder.debug_check_bounds::<Self>(offset);
2625 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2626 unsafe {
2629 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
2630 }
2631 Ok(())
2632 }
2633 }
2634
2635 impl fidl::encoding::ValueTypeMarker for ProjectIdGetForNodeResponse {
2636 type Borrowed<'a> = &'a Self;
2637 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2638 value
2639 }
2640 }
2641
2642 unsafe impl fidl::encoding::TypeMarker for ProjectIdGetForNodeResponse {
2643 type Owned = Self;
2644
2645 #[inline(always)]
2646 fn inline_align(_context: fidl::encoding::Context) -> usize {
2647 8
2648 }
2649
2650 #[inline(always)]
2651 fn inline_size(_context: fidl::encoding::Context) -> usize {
2652 8
2653 }
2654 #[inline(always)]
2655 fn encode_is_copy() -> bool {
2656 true
2657 }
2658
2659 #[inline(always)]
2660 fn decode_is_copy() -> bool {
2661 true
2662 }
2663 }
2664
2665 unsafe impl<D: fidl::encoding::ResourceDialect>
2666 fidl::encoding::Encode<ProjectIdGetForNodeResponse, D> for &ProjectIdGetForNodeResponse
2667 {
2668 #[inline]
2669 unsafe fn encode(
2670 self,
2671 encoder: &mut fidl::encoding::Encoder<'_, D>,
2672 offset: usize,
2673 _depth: fidl::encoding::Depth,
2674 ) -> fidl::Result<()> {
2675 encoder.debug_check_bounds::<ProjectIdGetForNodeResponse>(offset);
2676 unsafe {
2677 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2679 (buf_ptr as *mut ProjectIdGetForNodeResponse)
2680 .write_unaligned((self as *const ProjectIdGetForNodeResponse).read());
2681 }
2684 Ok(())
2685 }
2686 }
2687 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2688 fidl::encoding::Encode<ProjectIdGetForNodeResponse, D> for (T0,)
2689 {
2690 #[inline]
2691 unsafe fn encode(
2692 self,
2693 encoder: &mut fidl::encoding::Encoder<'_, D>,
2694 offset: usize,
2695 depth: fidl::encoding::Depth,
2696 ) -> fidl::Result<()> {
2697 encoder.debug_check_bounds::<ProjectIdGetForNodeResponse>(offset);
2698 self.0.encode(encoder, offset + 0, depth)?;
2702 Ok(())
2703 }
2704 }
2705
2706 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2707 for ProjectIdGetForNodeResponse
2708 {
2709 #[inline(always)]
2710 fn new_empty() -> Self {
2711 Self { project_id: fidl::new_empty!(u64, D) }
2712 }
2713
2714 #[inline]
2715 unsafe fn decode(
2716 &mut self,
2717 decoder: &mut fidl::encoding::Decoder<'_, D>,
2718 offset: usize,
2719 _depth: fidl::encoding::Depth,
2720 ) -> fidl::Result<()> {
2721 decoder.debug_check_bounds::<Self>(offset);
2722 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2723 unsafe {
2726 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2727 }
2728 Ok(())
2729 }
2730 }
2731
2732 impl fidl::encoding::ValueTypeMarker for ProjectIdInfoResponse {
2733 type Borrowed<'a> = &'a Self;
2734 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2735 value
2736 }
2737 }
2738
2739 unsafe impl fidl::encoding::TypeMarker for ProjectIdInfoResponse {
2740 type Owned = Self;
2741
2742 #[inline(always)]
2743 fn inline_align(_context: fidl::encoding::Context) -> usize {
2744 8
2745 }
2746
2747 #[inline(always)]
2748 fn inline_size(_context: fidl::encoding::Context) -> usize {
2749 32
2750 }
2751 #[inline(always)]
2752 fn encode_is_copy() -> bool {
2753 true
2754 }
2755
2756 #[inline(always)]
2757 fn decode_is_copy() -> bool {
2758 true
2759 }
2760 }
2761
2762 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProjectIdInfoResponse, D>
2763 for &ProjectIdInfoResponse
2764 {
2765 #[inline]
2766 unsafe fn encode(
2767 self,
2768 encoder: &mut fidl::encoding::Encoder<'_, D>,
2769 offset: usize,
2770 _depth: fidl::encoding::Depth,
2771 ) -> fidl::Result<()> {
2772 encoder.debug_check_bounds::<ProjectIdInfoResponse>(offset);
2773 unsafe {
2774 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2776 (buf_ptr as *mut ProjectIdInfoResponse)
2777 .write_unaligned((self as *const ProjectIdInfoResponse).read());
2778 }
2781 Ok(())
2782 }
2783 }
2784 unsafe impl<
2785 D: fidl::encoding::ResourceDialect,
2786 T0: fidl::encoding::Encode<BytesAndNodes, D>,
2787 T1: fidl::encoding::Encode<BytesAndNodes, D>,
2788 > fidl::encoding::Encode<ProjectIdInfoResponse, D> for (T0, T1)
2789 {
2790 #[inline]
2791 unsafe fn encode(
2792 self,
2793 encoder: &mut fidl::encoding::Encoder<'_, D>,
2794 offset: usize,
2795 depth: fidl::encoding::Depth,
2796 ) -> fidl::Result<()> {
2797 encoder.debug_check_bounds::<ProjectIdInfoResponse>(offset);
2798 self.0.encode(encoder, offset + 0, depth)?;
2802 self.1.encode(encoder, offset + 16, depth)?;
2803 Ok(())
2804 }
2805 }
2806
2807 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIdInfoResponse {
2808 #[inline(always)]
2809 fn new_empty() -> Self {
2810 Self {
2811 limit: fidl::new_empty!(BytesAndNodes, D),
2812 usage: fidl::new_empty!(BytesAndNodes, D),
2813 }
2814 }
2815
2816 #[inline]
2817 unsafe fn decode(
2818 &mut self,
2819 decoder: &mut fidl::encoding::Decoder<'_, D>,
2820 offset: usize,
2821 _depth: fidl::encoding::Depth,
2822 ) -> fidl::Result<()> {
2823 decoder.debug_check_bounds::<Self>(offset);
2824 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2825 unsafe {
2828 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
2829 }
2830 Ok(())
2831 }
2832 }
2833
2834 impl fidl::encoding::ValueTypeMarker for ProjectIdListResponse {
2835 type Borrowed<'a> = &'a Self;
2836 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2837 value
2838 }
2839 }
2840
2841 unsafe impl fidl::encoding::TypeMarker for ProjectIdListResponse {
2842 type Owned = Self;
2843
2844 #[inline(always)]
2845 fn inline_align(_context: fidl::encoding::Context) -> usize {
2846 8
2847 }
2848
2849 #[inline(always)]
2850 fn inline_size(_context: fidl::encoding::Context) -> usize {
2851 24
2852 }
2853 }
2854
2855 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProjectIdListResponse, D>
2856 for &ProjectIdListResponse
2857 {
2858 #[inline]
2859 unsafe fn encode(
2860 self,
2861 encoder: &mut fidl::encoding::Encoder<'_, D>,
2862 offset: usize,
2863 _depth: fidl::encoding::Depth,
2864 ) -> fidl::Result<()> {
2865 encoder.debug_check_bounds::<ProjectIdListResponse>(offset);
2866 fidl::encoding::Encode::<ProjectIdListResponse, D>::encode(
2868 (
2869 <fidl::encoding::UnboundedVector<u64> as fidl::encoding::ValueTypeMarker>::borrow(&self.entries),
2870 <fidl::encoding::Boxed<ProjectIterToken> as fidl::encoding::ValueTypeMarker>::borrow(&self.next_token),
2871 ),
2872 encoder, offset, _depth
2873 )
2874 }
2875 }
2876 unsafe impl<
2877 D: fidl::encoding::ResourceDialect,
2878 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u64>, D>,
2879 T1: fidl::encoding::Encode<fidl::encoding::Boxed<ProjectIterToken>, D>,
2880 > fidl::encoding::Encode<ProjectIdListResponse, D> for (T0, T1)
2881 {
2882 #[inline]
2883 unsafe fn encode(
2884 self,
2885 encoder: &mut fidl::encoding::Encoder<'_, D>,
2886 offset: usize,
2887 depth: fidl::encoding::Depth,
2888 ) -> fidl::Result<()> {
2889 encoder.debug_check_bounds::<ProjectIdListResponse>(offset);
2890 self.0.encode(encoder, offset + 0, depth)?;
2894 self.1.encode(encoder, offset + 16, depth)?;
2895 Ok(())
2896 }
2897 }
2898
2899 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIdListResponse {
2900 #[inline(always)]
2901 fn new_empty() -> Self {
2902 Self {
2903 entries: fidl::new_empty!(fidl::encoding::UnboundedVector<u64>, D),
2904 next_token: fidl::new_empty!(fidl::encoding::Boxed<ProjectIterToken>, D),
2905 }
2906 }
2907
2908 #[inline]
2909 unsafe fn decode(
2910 &mut self,
2911 decoder: &mut fidl::encoding::Decoder<'_, D>,
2912 offset: usize,
2913 _depth: fidl::encoding::Depth,
2914 ) -> fidl::Result<()> {
2915 decoder.debug_check_bounds::<Self>(offset);
2916 fidl::decode!(
2918 fidl::encoding::UnboundedVector<u64>,
2919 D,
2920 &mut self.entries,
2921 decoder,
2922 offset + 0,
2923 _depth
2924 )?;
2925 fidl::decode!(
2926 fidl::encoding::Boxed<ProjectIterToken>,
2927 D,
2928 &mut self.next_token,
2929 decoder,
2930 offset + 16,
2931 _depth
2932 )?;
2933 Ok(())
2934 }
2935 }
2936
2937 impl fidl::encoding::ValueTypeMarker for ProjectIterToken {
2938 type Borrowed<'a> = &'a Self;
2939 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2940 value
2941 }
2942 }
2943
2944 unsafe impl fidl::encoding::TypeMarker for ProjectIterToken {
2945 type Owned = Self;
2946
2947 #[inline(always)]
2948 fn inline_align(_context: fidl::encoding::Context) -> usize {
2949 8
2950 }
2951
2952 #[inline(always)]
2953 fn inline_size(_context: fidl::encoding::Context) -> usize {
2954 8
2955 }
2956 #[inline(always)]
2957 fn encode_is_copy() -> bool {
2958 true
2959 }
2960
2961 #[inline(always)]
2962 fn decode_is_copy() -> bool {
2963 true
2964 }
2965 }
2966
2967 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProjectIterToken, D>
2968 for &ProjectIterToken
2969 {
2970 #[inline]
2971 unsafe fn encode(
2972 self,
2973 encoder: &mut fidl::encoding::Encoder<'_, D>,
2974 offset: usize,
2975 _depth: fidl::encoding::Depth,
2976 ) -> fidl::Result<()> {
2977 encoder.debug_check_bounds::<ProjectIterToken>(offset);
2978 unsafe {
2979 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2981 (buf_ptr as *mut ProjectIterToken)
2982 .write_unaligned((self as *const ProjectIterToken).read());
2983 }
2986 Ok(())
2987 }
2988 }
2989 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2990 fidl::encoding::Encode<ProjectIterToken, D> for (T0,)
2991 {
2992 #[inline]
2993 unsafe fn encode(
2994 self,
2995 encoder: &mut fidl::encoding::Encoder<'_, D>,
2996 offset: usize,
2997 depth: fidl::encoding::Depth,
2998 ) -> fidl::Result<()> {
2999 encoder.debug_check_bounds::<ProjectIterToken>(offset);
3000 self.0.encode(encoder, offset + 0, depth)?;
3004 Ok(())
3005 }
3006 }
3007
3008 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIterToken {
3009 #[inline(always)]
3010 fn new_empty() -> Self {
3011 Self { value: fidl::new_empty!(u64, D) }
3012 }
3013
3014 #[inline]
3015 unsafe fn decode(
3016 &mut self,
3017 decoder: &mut fidl::encoding::Decoder<'_, D>,
3018 offset: usize,
3019 _depth: fidl::encoding::Depth,
3020 ) -> fidl::Result<()> {
3021 decoder.debug_check_bounds::<Self>(offset);
3022 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3023 unsafe {
3026 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3027 }
3028 Ok(())
3029 }
3030 }
3031
3032 impl CryptSettings {
3033 #[inline(always)]
3034 fn max_ordinal_present(&self) -> u64 {
3035 if let Some(_) = self.active_metadata_wrapping_key_id {
3036 return 2;
3037 }
3038 if let Some(_) = self.active_data_wrapping_key_id {
3039 return 1;
3040 }
3041 0
3042 }
3043 }
3044
3045 impl fidl::encoding::ValueTypeMarker for CryptSettings {
3046 type Borrowed<'a> = &'a Self;
3047 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3048 value
3049 }
3050 }
3051
3052 unsafe impl fidl::encoding::TypeMarker for CryptSettings {
3053 type Owned = Self;
3054
3055 #[inline(always)]
3056 fn inline_align(_context: fidl::encoding::Context) -> usize {
3057 8
3058 }
3059
3060 #[inline(always)]
3061 fn inline_size(_context: fidl::encoding::Context) -> usize {
3062 16
3063 }
3064 }
3065
3066 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CryptSettings, D>
3067 for &CryptSettings
3068 {
3069 unsafe fn encode(
3070 self,
3071 encoder: &mut fidl::encoding::Encoder<'_, D>,
3072 offset: usize,
3073 mut depth: fidl::encoding::Depth,
3074 ) -> fidl::Result<()> {
3075 encoder.debug_check_bounds::<CryptSettings>(offset);
3076 let max_ordinal: u64 = self.max_ordinal_present();
3078 encoder.write_num(max_ordinal, offset);
3079 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3080 if max_ordinal == 0 {
3082 return Ok(());
3083 }
3084 depth.increment()?;
3085 let envelope_size = 8;
3086 let bytes_len = max_ordinal as usize * envelope_size;
3087 #[allow(unused_variables)]
3088 let offset = encoder.out_of_line_offset(bytes_len);
3089 let mut _prev_end_offset: usize = 0;
3090 if 1 > max_ordinal {
3091 return Ok(());
3092 }
3093
3094 let cur_offset: usize = (1 - 1) * envelope_size;
3097
3098 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3100
3101 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 16>, D>(
3106 self.active_data_wrapping_key_id.as_ref().map(
3107 <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
3108 ),
3109 encoder,
3110 offset + cur_offset,
3111 depth,
3112 )?;
3113
3114 _prev_end_offset = cur_offset + envelope_size;
3115 if 2 > max_ordinal {
3116 return Ok(());
3117 }
3118
3119 let cur_offset: usize = (2 - 1) * envelope_size;
3122
3123 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3125
3126 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 16>, D>(
3131 self.active_metadata_wrapping_key_id.as_ref().map(
3132 <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
3133 ),
3134 encoder,
3135 offset + cur_offset,
3136 depth,
3137 )?;
3138
3139 _prev_end_offset = cur_offset + envelope_size;
3140
3141 Ok(())
3142 }
3143 }
3144
3145 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CryptSettings {
3146 #[inline(always)]
3147 fn new_empty() -> Self {
3148 Self::default()
3149 }
3150
3151 unsafe fn decode(
3152 &mut self,
3153 decoder: &mut fidl::encoding::Decoder<'_, D>,
3154 offset: usize,
3155 mut depth: fidl::encoding::Depth,
3156 ) -> fidl::Result<()> {
3157 decoder.debug_check_bounds::<Self>(offset);
3158 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3159 None => return Err(fidl::Error::NotNullable),
3160 Some(len) => len,
3161 };
3162 if len == 0 {
3164 return Ok(());
3165 };
3166 depth.increment()?;
3167 let envelope_size = 8;
3168 let bytes_len = len * envelope_size;
3169 let offset = decoder.out_of_line_offset(bytes_len)?;
3170 let mut _next_ordinal_to_read = 0;
3172 let mut next_offset = offset;
3173 let end_offset = offset + bytes_len;
3174 _next_ordinal_to_read += 1;
3175 if next_offset >= end_offset {
3176 return Ok(());
3177 }
3178
3179 while _next_ordinal_to_read < 1 {
3181 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3182 _next_ordinal_to_read += 1;
3183 next_offset += envelope_size;
3184 }
3185
3186 let next_out_of_line = decoder.next_out_of_line();
3187 let handles_before = decoder.remaining_handles();
3188 if let Some((inlined, num_bytes, num_handles)) =
3189 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3190 {
3191 let member_inline_size =
3192 <fidl::encoding::Array<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
3193 decoder.context,
3194 );
3195 if inlined != (member_inline_size <= 4) {
3196 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3197 }
3198 let inner_offset;
3199 let mut inner_depth = depth.clone();
3200 if inlined {
3201 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3202 inner_offset = next_offset;
3203 } else {
3204 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3205 inner_depth.increment()?;
3206 }
3207 let val_ref = self
3208 .active_data_wrapping_key_id
3209 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
3210 fidl::decode!(fidl::encoding::Array<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
3211 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3212 {
3213 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3214 }
3215 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3216 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3217 }
3218 }
3219
3220 next_offset += envelope_size;
3221 _next_ordinal_to_read += 1;
3222 if next_offset >= end_offset {
3223 return Ok(());
3224 }
3225
3226 while _next_ordinal_to_read < 2 {
3228 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3229 _next_ordinal_to_read += 1;
3230 next_offset += envelope_size;
3231 }
3232
3233 let next_out_of_line = decoder.next_out_of_line();
3234 let handles_before = decoder.remaining_handles();
3235 if let Some((inlined, num_bytes, num_handles)) =
3236 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3237 {
3238 let member_inline_size =
3239 <fidl::encoding::Array<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
3240 decoder.context,
3241 );
3242 if inlined != (member_inline_size <= 4) {
3243 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3244 }
3245 let inner_offset;
3246 let mut inner_depth = depth.clone();
3247 if inlined {
3248 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3249 inner_offset = next_offset;
3250 } else {
3251 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3252 inner_depth.increment()?;
3253 }
3254 let val_ref = self
3255 .active_metadata_wrapping_key_id
3256 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
3257 fidl::decode!(fidl::encoding::Array<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
3258 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3259 {
3260 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3261 }
3262 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3263 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3264 }
3265 }
3266
3267 next_offset += envelope_size;
3268
3269 while next_offset < end_offset {
3271 _next_ordinal_to_read += 1;
3272 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3273 next_offset += envelope_size;
3274 }
3275
3276 Ok(())
3277 }
3278 }
3279}