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
11pub const MAX_FIRMWARE_TYPE_LENGTH: u32 = 256;
12
13pub const MAX_PENDING_BOOT_ATTEMPTS: u8 = 7;
22
23#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
26#[repr(u32)]
27pub enum Asset {
28 Kernel = 1,
30 VerifiedBootMetadata = 2,
32}
33
34impl Asset {
35 #[inline]
36 pub fn from_primitive(prim: u32) -> Option<Self> {
37 match prim {
38 1 => Some(Self::Kernel),
39 2 => Some(Self::VerifiedBootMetadata),
40 _ => None,
41 }
42 }
43
44 #[inline]
45 pub const fn into_primitive(self) -> u32 {
46 self as u32
47 }
48}
49
50#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
52#[repr(u32)]
53pub enum Configuration {
54 A = 1,
55 B = 2,
56 Recovery = 3,
57}
58
59impl Configuration {
60 #[inline]
61 pub fn from_primitive(prim: u32) -> Option<Self> {
62 match prim {
63 1 => Some(Self::A),
64 2 => Some(Self::B),
65 3 => Some(Self::Recovery),
66 _ => None,
67 }
68 }
69
70 #[inline]
71 pub const fn into_primitive(self) -> u32 {
72 self as u32
73 }
74}
75
76#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
78#[repr(u32)]
79pub enum ConfigurationStatus {
80 Healthy = 1,
82 Pending = 2,
84 Unbootable = 3,
86}
87
88impl ConfigurationStatus {
89 #[inline]
90 pub fn from_primitive(prim: u32) -> Option<Self> {
91 match prim {
92 1 => Some(Self::Healthy),
93 2 => Some(Self::Pending),
94 3 => Some(Self::Unbootable),
95 _ => None,
96 }
97 }
98
99 #[inline]
100 pub const fn into_primitive(self) -> u32 {
101 self as u32
102 }
103}
104
105#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
107pub enum UnbootableReason {
108 None,
111 NoMoreTries,
113 OsRequested,
115 VerificationFailure,
117 #[doc(hidden)]
118 __SourceBreaking { unknown_ordinal: u32 },
119}
120
121#[macro_export]
123macro_rules! UnbootableReasonUnknown {
124 () => {
125 _
126 };
127}
128
129impl UnbootableReason {
130 #[inline]
131 pub fn from_primitive(prim: u32) -> Option<Self> {
132 match prim {
133 0 => Some(Self::None),
134 1 => Some(Self::NoMoreTries),
135 2 => Some(Self::OsRequested),
136 3 => Some(Self::VerificationFailure),
137 _ => None,
138 }
139 }
140
141 #[inline]
142 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
143 match prim {
144 0 => Self::None,
145 1 => Self::NoMoreTries,
146 2 => Self::OsRequested,
147 3 => Self::VerificationFailure,
148 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
149 }
150 }
151
152 #[inline]
153 pub fn unknown() -> Self {
154 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
155 }
156
157 #[inline]
158 pub const fn into_primitive(self) -> u32 {
159 match self {
160 Self::None => 0,
161 Self::NoMoreTries => 1,
162 Self::OsRequested => 2,
163 Self::VerificationFailure => 3,
164 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
165 }
166 }
167
168 #[inline]
169 pub fn is_unknown(&self) -> bool {
170 match self {
171 Self::__SourceBreaking { unknown_ordinal: _ } => true,
172 _ => false,
173 }
174 }
175}
176
177#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
178#[repr(C)]
179pub struct BootManagerFlushResponse {
180 pub status: i32,
181}
182
183impl fidl::Persistable for BootManagerFlushResponse {}
184
185#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
186pub struct BootManagerQueryConfigurationStatusAndBootAttemptsRequest {
187 pub configuration: Configuration,
188}
189
190impl fidl::Persistable for BootManagerQueryConfigurationStatusAndBootAttemptsRequest {}
191
192#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
193pub struct BootManagerQueryConfigurationStatusRequest {
194 pub configuration: Configuration,
195}
196
197impl fidl::Persistable for BootManagerQueryConfigurationStatusRequest {}
198
199#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
200pub struct BootManagerSetConfigurationActiveRequest {
201 pub configuration: Configuration,
202}
203
204impl fidl::Persistable for BootManagerSetConfigurationActiveRequest {}
205
206#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
207#[repr(C)]
208pub struct BootManagerSetConfigurationActiveResponse {
209 pub status: i32,
210}
211
212impl fidl::Persistable for BootManagerSetConfigurationActiveResponse {}
213
214#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
215pub struct BootManagerSetConfigurationHealthyRequest {
216 pub configuration: Configuration,
217}
218
219impl fidl::Persistable for BootManagerSetConfigurationHealthyRequest {}
220
221#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
222#[repr(C)]
223pub struct BootManagerSetConfigurationHealthyResponse {
224 pub status: i32,
225}
226
227impl fidl::Persistable for BootManagerSetConfigurationHealthyResponse {}
228
229#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
230pub struct BootManagerSetConfigurationUnbootableRequest {
231 pub configuration: Configuration,
232}
233
234impl fidl::Persistable for BootManagerSetConfigurationUnbootableRequest {}
235
236#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
237#[repr(C)]
238pub struct BootManagerSetConfigurationUnbootableResponse {
239 pub status: i32,
240}
241
242impl fidl::Persistable for BootManagerSetConfigurationUnbootableResponse {}
243
244#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
245pub struct BootManagerQueryActiveConfigurationResponse {
246 pub configuration: Configuration,
247}
248
249impl fidl::Persistable for BootManagerQueryActiveConfigurationResponse {}
250
251#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
252pub struct BootManagerQueryConfigurationLastSetActiveResponse {
253 pub configuration: Configuration,
254}
255
256impl fidl::Persistable for BootManagerQueryConfigurationLastSetActiveResponse {}
257
258#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
259pub struct BootManagerQueryConfigurationStatusResponse {
260 pub status: ConfigurationStatus,
261}
262
263impl fidl::Persistable for BootManagerQueryConfigurationStatusResponse {}
264
265#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
266pub struct BootManagerQueryCurrentConfigurationResponse {
267 pub configuration: Configuration,
268}
269
270impl fidl::Persistable for BootManagerQueryCurrentConfigurationResponse {}
271
272#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
273#[repr(C)]
274pub struct DataSinkFlushResponse {
275 pub status: i32,
276}
277
278impl fidl::Persistable for DataSinkFlushResponse {}
279
280#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
281pub struct DataSinkReadAssetRequest {
282 pub configuration: Configuration,
283 pub asset: Asset,
284}
285
286impl fidl::Persistable for DataSinkReadAssetRequest {}
287
288#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
289#[repr(C)]
290pub struct DataSinkWriteAssetResponse {
291 pub status: i32,
292}
293
294impl fidl::Persistable for DataSinkWriteAssetResponse {}
295
296#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
297pub struct DataSinkWriteFirmwareResponse {
298 pub result: WriteFirmwareResult,
299}
300
301impl fidl::Persistable for DataSinkWriteFirmwareResponse {}
302
303#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
304#[repr(C)]
305pub struct DynamicDataSinkInitializePartitionTablesResponse {
306 pub status: i32,
307}
308
309impl fidl::Persistable for DynamicDataSinkInitializePartitionTablesResponse {}
310
311#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
312#[repr(C)]
313pub struct DynamicDataSinkWipePartitionTablesResponse {
314 pub status: i32,
315}
316
317impl fidl::Persistable for DynamicDataSinkWipePartitionTablesResponse {}
318
319#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
320#[repr(C)]
321pub struct ReadInfo {
322 pub offset: u64,
324 pub size: u64,
326}
327
328impl fidl::Persistable for ReadInfo {}
329
330#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
331#[repr(C)]
332pub struct SysconfigFlushResponse {
333 pub status: i32,
334}
335
336impl fidl::Persistable for SysconfigFlushResponse {}
337
338#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
339#[repr(C)]
340pub struct SysconfigWipeResponse {
341 pub status: i32,
342}
343
344impl fidl::Persistable for SysconfigWipeResponse {}
345
346#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
347#[repr(C)]
348pub struct SysconfigWriteResponse {
349 pub status: i32,
350}
351
352impl fidl::Persistable for SysconfigWriteResponse {}
353
354#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
355#[repr(C)]
356pub struct SysconfigGetPartitionSizeResponse {
357 pub size: u64,
358}
359
360impl fidl::Persistable for SysconfigGetPartitionSizeResponse {}
361
362#[derive(Clone, Debug, Default, PartialEq)]
363pub struct BootManagerQueryConfigurationStatusAndBootAttemptsResponse {
364 pub status: Option<ConfigurationStatus>,
365 pub boot_attempts: Option<u8>,
366 pub unbootable_reason: Option<UnbootableReason>,
367 #[doc(hidden)]
368 pub __source_breaking: fidl::marker::SourceBreaking,
369}
370
371impl fidl::Persistable for BootManagerQueryConfigurationStatusAndBootAttemptsResponse {}
372
373#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
374pub enum ReadResult {
375 Err(i32),
377 Eof(bool),
379 Info(ReadInfo),
381}
382
383impl ReadResult {
384 #[inline]
385 pub fn ordinal(&self) -> u64 {
386 match *self {
387 Self::Err(_) => 1,
388 Self::Eof(_) => 2,
389 Self::Info(_) => 3,
390 }
391 }
392}
393
394impl fidl::Persistable for ReadResult {}
395
396#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
397pub enum WriteFirmwareResult {
398 Status(i32),
400 Unsupported(bool),
407}
408
409impl WriteFirmwareResult {
410 #[inline]
411 pub fn ordinal(&self) -> u64 {
412 match *self {
413 Self::Status(_) => 1,
414 Self::Unsupported(_) => 2,
415 }
416 }
417}
418
419impl fidl::Persistable for WriteFirmwareResult {}
420
421pub mod boot_manager_ordinals {
422 pub const QUERY_CURRENT_CONFIGURATION: u64 = 0xc213298cbc9c371;
423 pub const QUERY_ACTIVE_CONFIGURATION: u64 = 0x71d52acdf59947a4;
424 pub const QUERY_CONFIGURATION_LAST_SET_ACTIVE: u64 = 0x6bcad87311b3345;
425 pub const QUERY_CONFIGURATION_STATUS: u64 = 0x40822ca9ca68b19a;
426 pub const QUERY_CONFIGURATION_STATUS_AND_BOOT_ATTEMPTS: u64 = 0x27f851d5809cfb3d;
427 pub const SET_CONFIGURATION_ACTIVE: u64 = 0x14c64074f81f9a7f;
428 pub const SET_CONFIGURATION_UNBOOTABLE: u64 = 0x6f8716bf306d197f;
429 pub const SET_CONFIGURATION_HEALTHY: u64 = 0x5dfe31714c8ec4be;
430 pub const SET_ONE_SHOT_RECOVERY: u64 = 0x7a5af0a28354f24d;
431 pub const FLUSH: u64 = 0x2f29ec2322d62d3e;
432}
433
434pub mod data_sink_ordinals {
435 pub const READ_ASSET: u64 = 0x125a23e561007898;
436 pub const WRITE_ASSET: u64 = 0x516839ce76c4d0a9;
437 pub const WRITE_FIRMWARE: u64 = 0x514b93454ac0be97;
438 pub const READ_FIRMWARE: u64 = 0xcb67f9830cae9c3;
439 pub const WRITE_OPAQUE_VOLUME: u64 = 0x4884b6ebaf660d79;
440 pub const WRITE_SPARSE_VOLUME: u64 = 0x340f5370c5b1e026;
441 pub const FLUSH: u64 = 0x3b59d3e2338e3139;
442}
443
444pub mod dynamic_data_sink_ordinals {
445 pub const READ_ASSET: u64 = 0x125a23e561007898;
446 pub const WRITE_ASSET: u64 = 0x516839ce76c4d0a9;
447 pub const WRITE_FIRMWARE: u64 = 0x514b93454ac0be97;
448 pub const READ_FIRMWARE: u64 = 0xcb67f9830cae9c3;
449 pub const WRITE_OPAQUE_VOLUME: u64 = 0x4884b6ebaf660d79;
450 pub const WRITE_SPARSE_VOLUME: u64 = 0x340f5370c5b1e026;
451 pub const FLUSH: u64 = 0x3b59d3e2338e3139;
452 pub const INITIALIZE_PARTITION_TABLES: u64 = 0x4c798b3813ea9f7e;
453 pub const WIPE_PARTITION_TABLES: u64 = 0x797c0ebeedaf2cc;
454}
455
456pub mod paver_ordinals {
457 pub const FIND_DATA_SINK: u64 = 0x710a34c6f9c8a0e9;
458 pub const FIND_PARTITION_TABLE_MANAGER: u64 = 0x10991ecc6fb9f47b;
459 pub const FIND_BOOT_MANAGER: u64 = 0x5d500b0633102443;
460 pub const FIND_SYSCONFIG: u64 = 0x542cdb5be9b5c02d;
461}
462
463pub mod sysconfig_ordinals {
464 pub const READ: u64 = 0x350c317c53c226fc;
465 pub const WRITE: u64 = 0x393786c114caf171;
466 pub const GET_PARTITION_SIZE: u64 = 0x2570c58b74fb8957;
467 pub const FLUSH: u64 = 0xc6c1bb233d003c6;
468 pub const WIPE: u64 = 0x34a634965ebfb702;
469}
470
471mod internal {
472 use super::*;
473 unsafe impl fidl::encoding::TypeMarker for Asset {
474 type Owned = Self;
475
476 #[inline(always)]
477 fn inline_align(_context: fidl::encoding::Context) -> usize {
478 std::mem::align_of::<u32>()
479 }
480
481 #[inline(always)]
482 fn inline_size(_context: fidl::encoding::Context) -> usize {
483 std::mem::size_of::<u32>()
484 }
485
486 #[inline(always)]
487 fn encode_is_copy() -> bool {
488 true
489 }
490
491 #[inline(always)]
492 fn decode_is_copy() -> bool {
493 false
494 }
495 }
496
497 impl fidl::encoding::ValueTypeMarker for Asset {
498 type Borrowed<'a> = Self;
499 #[inline(always)]
500 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
501 *value
502 }
503 }
504
505 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Asset {
506 #[inline]
507 unsafe fn encode(
508 self,
509 encoder: &mut fidl::encoding::Encoder<'_, D>,
510 offset: usize,
511 _depth: fidl::encoding::Depth,
512 ) -> fidl::Result<()> {
513 encoder.debug_check_bounds::<Self>(offset);
514 encoder.write_num(self.into_primitive(), offset);
515 Ok(())
516 }
517 }
518
519 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Asset {
520 #[inline(always)]
521 fn new_empty() -> Self {
522 Self::Kernel
523 }
524
525 #[inline]
526 unsafe fn decode(
527 &mut self,
528 decoder: &mut fidl::encoding::Decoder<'_, D>,
529 offset: usize,
530 _depth: fidl::encoding::Depth,
531 ) -> fidl::Result<()> {
532 decoder.debug_check_bounds::<Self>(offset);
533 let prim = decoder.read_num::<u32>(offset);
534
535 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
536 Ok(())
537 }
538 }
539 unsafe impl fidl::encoding::TypeMarker for Configuration {
540 type Owned = Self;
541
542 #[inline(always)]
543 fn inline_align(_context: fidl::encoding::Context) -> usize {
544 std::mem::align_of::<u32>()
545 }
546
547 #[inline(always)]
548 fn inline_size(_context: fidl::encoding::Context) -> usize {
549 std::mem::size_of::<u32>()
550 }
551
552 #[inline(always)]
553 fn encode_is_copy() -> bool {
554 true
555 }
556
557 #[inline(always)]
558 fn decode_is_copy() -> bool {
559 false
560 }
561 }
562
563 impl fidl::encoding::ValueTypeMarker for Configuration {
564 type Borrowed<'a> = Self;
565 #[inline(always)]
566 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
567 *value
568 }
569 }
570
571 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Configuration {
572 #[inline]
573 unsafe fn encode(
574 self,
575 encoder: &mut fidl::encoding::Encoder<'_, D>,
576 offset: usize,
577 _depth: fidl::encoding::Depth,
578 ) -> fidl::Result<()> {
579 encoder.debug_check_bounds::<Self>(offset);
580 encoder.write_num(self.into_primitive(), offset);
581 Ok(())
582 }
583 }
584
585 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Configuration {
586 #[inline(always)]
587 fn new_empty() -> Self {
588 Self::A
589 }
590
591 #[inline]
592 unsafe fn decode(
593 &mut self,
594 decoder: &mut fidl::encoding::Decoder<'_, D>,
595 offset: usize,
596 _depth: fidl::encoding::Depth,
597 ) -> fidl::Result<()> {
598 decoder.debug_check_bounds::<Self>(offset);
599 let prim = decoder.read_num::<u32>(offset);
600
601 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
602 Ok(())
603 }
604 }
605 unsafe impl fidl::encoding::TypeMarker for ConfigurationStatus {
606 type Owned = Self;
607
608 #[inline(always)]
609 fn inline_align(_context: fidl::encoding::Context) -> usize {
610 std::mem::align_of::<u32>()
611 }
612
613 #[inline(always)]
614 fn inline_size(_context: fidl::encoding::Context) -> usize {
615 std::mem::size_of::<u32>()
616 }
617
618 #[inline(always)]
619 fn encode_is_copy() -> bool {
620 true
621 }
622
623 #[inline(always)]
624 fn decode_is_copy() -> bool {
625 false
626 }
627 }
628
629 impl fidl::encoding::ValueTypeMarker for ConfigurationStatus {
630 type Borrowed<'a> = Self;
631 #[inline(always)]
632 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
633 *value
634 }
635 }
636
637 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
638 for ConfigurationStatus
639 {
640 #[inline]
641 unsafe fn encode(
642 self,
643 encoder: &mut fidl::encoding::Encoder<'_, D>,
644 offset: usize,
645 _depth: fidl::encoding::Depth,
646 ) -> fidl::Result<()> {
647 encoder.debug_check_bounds::<Self>(offset);
648 encoder.write_num(self.into_primitive(), offset);
649 Ok(())
650 }
651 }
652
653 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigurationStatus {
654 #[inline(always)]
655 fn new_empty() -> Self {
656 Self::Healthy
657 }
658
659 #[inline]
660 unsafe fn decode(
661 &mut self,
662 decoder: &mut fidl::encoding::Decoder<'_, D>,
663 offset: usize,
664 _depth: fidl::encoding::Depth,
665 ) -> fidl::Result<()> {
666 decoder.debug_check_bounds::<Self>(offset);
667 let prim = decoder.read_num::<u32>(offset);
668
669 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
670 Ok(())
671 }
672 }
673 unsafe impl fidl::encoding::TypeMarker for UnbootableReason {
674 type Owned = Self;
675
676 #[inline(always)]
677 fn inline_align(_context: fidl::encoding::Context) -> usize {
678 std::mem::align_of::<u32>()
679 }
680
681 #[inline(always)]
682 fn inline_size(_context: fidl::encoding::Context) -> usize {
683 std::mem::size_of::<u32>()
684 }
685
686 #[inline(always)]
687 fn encode_is_copy() -> bool {
688 false
689 }
690
691 #[inline(always)]
692 fn decode_is_copy() -> bool {
693 false
694 }
695 }
696
697 impl fidl::encoding::ValueTypeMarker for UnbootableReason {
698 type Borrowed<'a> = Self;
699 #[inline(always)]
700 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
701 *value
702 }
703 }
704
705 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
706 for UnbootableReason
707 {
708 #[inline]
709 unsafe fn encode(
710 self,
711 encoder: &mut fidl::encoding::Encoder<'_, D>,
712 offset: usize,
713 _depth: fidl::encoding::Depth,
714 ) -> fidl::Result<()> {
715 encoder.debug_check_bounds::<Self>(offset);
716 encoder.write_num(self.into_primitive(), offset);
717 Ok(())
718 }
719 }
720
721 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UnbootableReason {
722 #[inline(always)]
723 fn new_empty() -> Self {
724 Self::unknown()
725 }
726
727 #[inline]
728 unsafe fn decode(
729 &mut self,
730 decoder: &mut fidl::encoding::Decoder<'_, D>,
731 offset: usize,
732 _depth: fidl::encoding::Depth,
733 ) -> fidl::Result<()> {
734 decoder.debug_check_bounds::<Self>(offset);
735 let prim = decoder.read_num::<u32>(offset);
736
737 *self = Self::from_primitive_allow_unknown(prim);
738 Ok(())
739 }
740 }
741
742 impl fidl::encoding::ValueTypeMarker for BootManagerFlushResponse {
743 type Borrowed<'a> = &'a Self;
744 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
745 value
746 }
747 }
748
749 unsafe impl fidl::encoding::TypeMarker for BootManagerFlushResponse {
750 type Owned = Self;
751
752 #[inline(always)]
753 fn inline_align(_context: fidl::encoding::Context) -> usize {
754 4
755 }
756
757 #[inline(always)]
758 fn inline_size(_context: fidl::encoding::Context) -> usize {
759 4
760 }
761 #[inline(always)]
762 fn encode_is_copy() -> bool {
763 true
764 }
765
766 #[inline(always)]
767 fn decode_is_copy() -> bool {
768 true
769 }
770 }
771
772 unsafe impl<D: fidl::encoding::ResourceDialect>
773 fidl::encoding::Encode<BootManagerFlushResponse, D> for &BootManagerFlushResponse
774 {
775 #[inline]
776 unsafe fn encode(
777 self,
778 encoder: &mut fidl::encoding::Encoder<'_, D>,
779 offset: usize,
780 _depth: fidl::encoding::Depth,
781 ) -> fidl::Result<()> {
782 encoder.debug_check_bounds::<BootManagerFlushResponse>(offset);
783 unsafe {
784 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
786 (buf_ptr as *mut BootManagerFlushResponse)
787 .write_unaligned((self as *const BootManagerFlushResponse).read());
788 }
791 Ok(())
792 }
793 }
794 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
795 fidl::encoding::Encode<BootManagerFlushResponse, D> for (T0,)
796 {
797 #[inline]
798 unsafe fn encode(
799 self,
800 encoder: &mut fidl::encoding::Encoder<'_, D>,
801 offset: usize,
802 depth: fidl::encoding::Depth,
803 ) -> fidl::Result<()> {
804 encoder.debug_check_bounds::<BootManagerFlushResponse>(offset);
805 self.0.encode(encoder, offset + 0, depth)?;
809 Ok(())
810 }
811 }
812
813 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
814 for BootManagerFlushResponse
815 {
816 #[inline(always)]
817 fn new_empty() -> Self {
818 Self { status: fidl::new_empty!(i32, D) }
819 }
820
821 #[inline]
822 unsafe fn decode(
823 &mut self,
824 decoder: &mut fidl::encoding::Decoder<'_, D>,
825 offset: usize,
826 _depth: fidl::encoding::Depth,
827 ) -> fidl::Result<()> {
828 decoder.debug_check_bounds::<Self>(offset);
829 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
830 unsafe {
833 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
834 }
835 Ok(())
836 }
837 }
838
839 impl fidl::encoding::ValueTypeMarker for BootManagerQueryConfigurationStatusAndBootAttemptsRequest {
840 type Borrowed<'a> = &'a Self;
841 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
842 value
843 }
844 }
845
846 unsafe impl fidl::encoding::TypeMarker
847 for BootManagerQueryConfigurationStatusAndBootAttemptsRequest
848 {
849 type Owned = Self;
850
851 #[inline(always)]
852 fn inline_align(_context: fidl::encoding::Context) -> usize {
853 4
854 }
855
856 #[inline(always)]
857 fn inline_size(_context: fidl::encoding::Context) -> usize {
858 4
859 }
860 }
861
862 unsafe impl<D: fidl::encoding::ResourceDialect>
863 fidl::encoding::Encode<BootManagerQueryConfigurationStatusAndBootAttemptsRequest, D>
864 for &BootManagerQueryConfigurationStatusAndBootAttemptsRequest
865 {
866 #[inline]
867 unsafe fn encode(
868 self,
869 encoder: &mut fidl::encoding::Encoder<'_, D>,
870 offset: usize,
871 _depth: fidl::encoding::Depth,
872 ) -> fidl::Result<()> {
873 encoder
874 .debug_check_bounds::<BootManagerQueryConfigurationStatusAndBootAttemptsRequest>(
875 offset,
876 );
877 fidl::encoding::Encode::<BootManagerQueryConfigurationStatusAndBootAttemptsRequest, D>::encode(
879 (
880 <Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),
881 ),
882 encoder, offset, _depth
883 )
884 }
885 }
886 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
887 fidl::encoding::Encode<BootManagerQueryConfigurationStatusAndBootAttemptsRequest, D>
888 for (T0,)
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
898 .debug_check_bounds::<BootManagerQueryConfigurationStatusAndBootAttemptsRequest>(
899 offset,
900 );
901 self.0.encode(encoder, offset + 0, depth)?;
905 Ok(())
906 }
907 }
908
909 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
910 for BootManagerQueryConfigurationStatusAndBootAttemptsRequest
911 {
912 #[inline(always)]
913 fn new_empty() -> Self {
914 Self { configuration: fidl::new_empty!(Configuration, D) }
915 }
916
917 #[inline]
918 unsafe fn decode(
919 &mut self,
920 decoder: &mut fidl::encoding::Decoder<'_, D>,
921 offset: usize,
922 _depth: fidl::encoding::Depth,
923 ) -> fidl::Result<()> {
924 decoder.debug_check_bounds::<Self>(offset);
925 fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
927 Ok(())
928 }
929 }
930
931 impl fidl::encoding::ValueTypeMarker for BootManagerQueryConfigurationStatusRequest {
932 type Borrowed<'a> = &'a Self;
933 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
934 value
935 }
936 }
937
938 unsafe impl fidl::encoding::TypeMarker for BootManagerQueryConfigurationStatusRequest {
939 type Owned = Self;
940
941 #[inline(always)]
942 fn inline_align(_context: fidl::encoding::Context) -> usize {
943 4
944 }
945
946 #[inline(always)]
947 fn inline_size(_context: fidl::encoding::Context) -> usize {
948 4
949 }
950 }
951
952 unsafe impl<D: fidl::encoding::ResourceDialect>
953 fidl::encoding::Encode<BootManagerQueryConfigurationStatusRequest, D>
954 for &BootManagerQueryConfigurationStatusRequest
955 {
956 #[inline]
957 unsafe fn encode(
958 self,
959 encoder: &mut fidl::encoding::Encoder<'_, D>,
960 offset: usize,
961 _depth: fidl::encoding::Depth,
962 ) -> fidl::Result<()> {
963 encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusRequest>(offset);
964 fidl::encoding::Encode::<BootManagerQueryConfigurationStatusRequest, D>::encode(
966 (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
967 encoder,
968 offset,
969 _depth,
970 )
971 }
972 }
973 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
974 fidl::encoding::Encode<BootManagerQueryConfigurationStatusRequest, D> for (T0,)
975 {
976 #[inline]
977 unsafe fn encode(
978 self,
979 encoder: &mut fidl::encoding::Encoder<'_, D>,
980 offset: usize,
981 depth: fidl::encoding::Depth,
982 ) -> fidl::Result<()> {
983 encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusRequest>(offset);
984 self.0.encode(encoder, offset + 0, depth)?;
988 Ok(())
989 }
990 }
991
992 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
993 for BootManagerQueryConfigurationStatusRequest
994 {
995 #[inline(always)]
996 fn new_empty() -> Self {
997 Self { configuration: fidl::new_empty!(Configuration, D) }
998 }
999
1000 #[inline]
1001 unsafe fn decode(
1002 &mut self,
1003 decoder: &mut fidl::encoding::Decoder<'_, D>,
1004 offset: usize,
1005 _depth: fidl::encoding::Depth,
1006 ) -> fidl::Result<()> {
1007 decoder.debug_check_bounds::<Self>(offset);
1008 fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
1010 Ok(())
1011 }
1012 }
1013
1014 impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationActiveRequest {
1015 type Borrowed<'a> = &'a Self;
1016 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1017 value
1018 }
1019 }
1020
1021 unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationActiveRequest {
1022 type Owned = Self;
1023
1024 #[inline(always)]
1025 fn inline_align(_context: fidl::encoding::Context) -> usize {
1026 4
1027 }
1028
1029 #[inline(always)]
1030 fn inline_size(_context: fidl::encoding::Context) -> usize {
1031 4
1032 }
1033 }
1034
1035 unsafe impl<D: fidl::encoding::ResourceDialect>
1036 fidl::encoding::Encode<BootManagerSetConfigurationActiveRequest, D>
1037 for &BootManagerSetConfigurationActiveRequest
1038 {
1039 #[inline]
1040 unsafe fn encode(
1041 self,
1042 encoder: &mut fidl::encoding::Encoder<'_, D>,
1043 offset: usize,
1044 _depth: fidl::encoding::Depth,
1045 ) -> fidl::Result<()> {
1046 encoder.debug_check_bounds::<BootManagerSetConfigurationActiveRequest>(offset);
1047 fidl::encoding::Encode::<BootManagerSetConfigurationActiveRequest, D>::encode(
1049 (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
1050 encoder,
1051 offset,
1052 _depth,
1053 )
1054 }
1055 }
1056 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
1057 fidl::encoding::Encode<BootManagerSetConfigurationActiveRequest, D> for (T0,)
1058 {
1059 #[inline]
1060 unsafe fn encode(
1061 self,
1062 encoder: &mut fidl::encoding::Encoder<'_, D>,
1063 offset: usize,
1064 depth: fidl::encoding::Depth,
1065 ) -> fidl::Result<()> {
1066 encoder.debug_check_bounds::<BootManagerSetConfigurationActiveRequest>(offset);
1067 self.0.encode(encoder, offset + 0, depth)?;
1071 Ok(())
1072 }
1073 }
1074
1075 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1076 for BootManagerSetConfigurationActiveRequest
1077 {
1078 #[inline(always)]
1079 fn new_empty() -> Self {
1080 Self { configuration: fidl::new_empty!(Configuration, D) }
1081 }
1082
1083 #[inline]
1084 unsafe fn decode(
1085 &mut self,
1086 decoder: &mut fidl::encoding::Decoder<'_, D>,
1087 offset: usize,
1088 _depth: fidl::encoding::Depth,
1089 ) -> fidl::Result<()> {
1090 decoder.debug_check_bounds::<Self>(offset);
1091 fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
1093 Ok(())
1094 }
1095 }
1096
1097 impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationActiveResponse {
1098 type Borrowed<'a> = &'a Self;
1099 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1100 value
1101 }
1102 }
1103
1104 unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationActiveResponse {
1105 type Owned = Self;
1106
1107 #[inline(always)]
1108 fn inline_align(_context: fidl::encoding::Context) -> usize {
1109 4
1110 }
1111
1112 #[inline(always)]
1113 fn inline_size(_context: fidl::encoding::Context) -> usize {
1114 4
1115 }
1116 #[inline(always)]
1117 fn encode_is_copy() -> bool {
1118 true
1119 }
1120
1121 #[inline(always)]
1122 fn decode_is_copy() -> bool {
1123 true
1124 }
1125 }
1126
1127 unsafe impl<D: fidl::encoding::ResourceDialect>
1128 fidl::encoding::Encode<BootManagerSetConfigurationActiveResponse, D>
1129 for &BootManagerSetConfigurationActiveResponse
1130 {
1131 #[inline]
1132 unsafe fn encode(
1133 self,
1134 encoder: &mut fidl::encoding::Encoder<'_, D>,
1135 offset: usize,
1136 _depth: fidl::encoding::Depth,
1137 ) -> fidl::Result<()> {
1138 encoder.debug_check_bounds::<BootManagerSetConfigurationActiveResponse>(offset);
1139 unsafe {
1140 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1142 (buf_ptr as *mut BootManagerSetConfigurationActiveResponse).write_unaligned(
1143 (self as *const BootManagerSetConfigurationActiveResponse).read(),
1144 );
1145 }
1148 Ok(())
1149 }
1150 }
1151 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1152 fidl::encoding::Encode<BootManagerSetConfigurationActiveResponse, D> for (T0,)
1153 {
1154 #[inline]
1155 unsafe fn encode(
1156 self,
1157 encoder: &mut fidl::encoding::Encoder<'_, D>,
1158 offset: usize,
1159 depth: fidl::encoding::Depth,
1160 ) -> fidl::Result<()> {
1161 encoder.debug_check_bounds::<BootManagerSetConfigurationActiveResponse>(offset);
1162 self.0.encode(encoder, offset + 0, depth)?;
1166 Ok(())
1167 }
1168 }
1169
1170 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1171 for BootManagerSetConfigurationActiveResponse
1172 {
1173 #[inline(always)]
1174 fn new_empty() -> Self {
1175 Self { status: fidl::new_empty!(i32, D) }
1176 }
1177
1178 #[inline]
1179 unsafe fn decode(
1180 &mut self,
1181 decoder: &mut fidl::encoding::Decoder<'_, D>,
1182 offset: usize,
1183 _depth: fidl::encoding::Depth,
1184 ) -> fidl::Result<()> {
1185 decoder.debug_check_bounds::<Self>(offset);
1186 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1187 unsafe {
1190 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1191 }
1192 Ok(())
1193 }
1194 }
1195
1196 impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationHealthyRequest {
1197 type Borrowed<'a> = &'a Self;
1198 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1199 value
1200 }
1201 }
1202
1203 unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationHealthyRequest {
1204 type Owned = Self;
1205
1206 #[inline(always)]
1207 fn inline_align(_context: fidl::encoding::Context) -> usize {
1208 4
1209 }
1210
1211 #[inline(always)]
1212 fn inline_size(_context: fidl::encoding::Context) -> usize {
1213 4
1214 }
1215 }
1216
1217 unsafe impl<D: fidl::encoding::ResourceDialect>
1218 fidl::encoding::Encode<BootManagerSetConfigurationHealthyRequest, D>
1219 for &BootManagerSetConfigurationHealthyRequest
1220 {
1221 #[inline]
1222 unsafe fn encode(
1223 self,
1224 encoder: &mut fidl::encoding::Encoder<'_, D>,
1225 offset: usize,
1226 _depth: fidl::encoding::Depth,
1227 ) -> fidl::Result<()> {
1228 encoder.debug_check_bounds::<BootManagerSetConfigurationHealthyRequest>(offset);
1229 fidl::encoding::Encode::<BootManagerSetConfigurationHealthyRequest, D>::encode(
1231 (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
1232 encoder,
1233 offset,
1234 _depth,
1235 )
1236 }
1237 }
1238 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
1239 fidl::encoding::Encode<BootManagerSetConfigurationHealthyRequest, D> for (T0,)
1240 {
1241 #[inline]
1242 unsafe fn encode(
1243 self,
1244 encoder: &mut fidl::encoding::Encoder<'_, D>,
1245 offset: usize,
1246 depth: fidl::encoding::Depth,
1247 ) -> fidl::Result<()> {
1248 encoder.debug_check_bounds::<BootManagerSetConfigurationHealthyRequest>(offset);
1249 self.0.encode(encoder, offset + 0, depth)?;
1253 Ok(())
1254 }
1255 }
1256
1257 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1258 for BootManagerSetConfigurationHealthyRequest
1259 {
1260 #[inline(always)]
1261 fn new_empty() -> Self {
1262 Self { configuration: fidl::new_empty!(Configuration, D) }
1263 }
1264
1265 #[inline]
1266 unsafe fn decode(
1267 &mut self,
1268 decoder: &mut fidl::encoding::Decoder<'_, D>,
1269 offset: usize,
1270 _depth: fidl::encoding::Depth,
1271 ) -> fidl::Result<()> {
1272 decoder.debug_check_bounds::<Self>(offset);
1273 fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
1275 Ok(())
1276 }
1277 }
1278
1279 impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationHealthyResponse {
1280 type Borrowed<'a> = &'a Self;
1281 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1282 value
1283 }
1284 }
1285
1286 unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationHealthyResponse {
1287 type Owned = Self;
1288
1289 #[inline(always)]
1290 fn inline_align(_context: fidl::encoding::Context) -> usize {
1291 4
1292 }
1293
1294 #[inline(always)]
1295 fn inline_size(_context: fidl::encoding::Context) -> usize {
1296 4
1297 }
1298 #[inline(always)]
1299 fn encode_is_copy() -> bool {
1300 true
1301 }
1302
1303 #[inline(always)]
1304 fn decode_is_copy() -> bool {
1305 true
1306 }
1307 }
1308
1309 unsafe impl<D: fidl::encoding::ResourceDialect>
1310 fidl::encoding::Encode<BootManagerSetConfigurationHealthyResponse, D>
1311 for &BootManagerSetConfigurationHealthyResponse
1312 {
1313 #[inline]
1314 unsafe fn encode(
1315 self,
1316 encoder: &mut fidl::encoding::Encoder<'_, D>,
1317 offset: usize,
1318 _depth: fidl::encoding::Depth,
1319 ) -> fidl::Result<()> {
1320 encoder.debug_check_bounds::<BootManagerSetConfigurationHealthyResponse>(offset);
1321 unsafe {
1322 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1324 (buf_ptr as *mut BootManagerSetConfigurationHealthyResponse).write_unaligned(
1325 (self as *const BootManagerSetConfigurationHealthyResponse).read(),
1326 );
1327 }
1330 Ok(())
1331 }
1332 }
1333 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1334 fidl::encoding::Encode<BootManagerSetConfigurationHealthyResponse, D> for (T0,)
1335 {
1336 #[inline]
1337 unsafe fn encode(
1338 self,
1339 encoder: &mut fidl::encoding::Encoder<'_, D>,
1340 offset: usize,
1341 depth: fidl::encoding::Depth,
1342 ) -> fidl::Result<()> {
1343 encoder.debug_check_bounds::<BootManagerSetConfigurationHealthyResponse>(offset);
1344 self.0.encode(encoder, offset + 0, depth)?;
1348 Ok(())
1349 }
1350 }
1351
1352 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1353 for BootManagerSetConfigurationHealthyResponse
1354 {
1355 #[inline(always)]
1356 fn new_empty() -> Self {
1357 Self { status: fidl::new_empty!(i32, D) }
1358 }
1359
1360 #[inline]
1361 unsafe fn decode(
1362 &mut self,
1363 decoder: &mut fidl::encoding::Decoder<'_, D>,
1364 offset: usize,
1365 _depth: fidl::encoding::Depth,
1366 ) -> fidl::Result<()> {
1367 decoder.debug_check_bounds::<Self>(offset);
1368 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1369 unsafe {
1372 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1373 }
1374 Ok(())
1375 }
1376 }
1377
1378 impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationUnbootableRequest {
1379 type Borrowed<'a> = &'a Self;
1380 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1381 value
1382 }
1383 }
1384
1385 unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationUnbootableRequest {
1386 type Owned = Self;
1387
1388 #[inline(always)]
1389 fn inline_align(_context: fidl::encoding::Context) -> usize {
1390 4
1391 }
1392
1393 #[inline(always)]
1394 fn inline_size(_context: fidl::encoding::Context) -> usize {
1395 4
1396 }
1397 }
1398
1399 unsafe impl<D: fidl::encoding::ResourceDialect>
1400 fidl::encoding::Encode<BootManagerSetConfigurationUnbootableRequest, D>
1401 for &BootManagerSetConfigurationUnbootableRequest
1402 {
1403 #[inline]
1404 unsafe fn encode(
1405 self,
1406 encoder: &mut fidl::encoding::Encoder<'_, D>,
1407 offset: usize,
1408 _depth: fidl::encoding::Depth,
1409 ) -> fidl::Result<()> {
1410 encoder.debug_check_bounds::<BootManagerSetConfigurationUnbootableRequest>(offset);
1411 fidl::encoding::Encode::<BootManagerSetConfigurationUnbootableRequest, D>::encode(
1413 (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
1414 encoder,
1415 offset,
1416 _depth,
1417 )
1418 }
1419 }
1420 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
1421 fidl::encoding::Encode<BootManagerSetConfigurationUnbootableRequest, D> for (T0,)
1422 {
1423 #[inline]
1424 unsafe fn encode(
1425 self,
1426 encoder: &mut fidl::encoding::Encoder<'_, D>,
1427 offset: usize,
1428 depth: fidl::encoding::Depth,
1429 ) -> fidl::Result<()> {
1430 encoder.debug_check_bounds::<BootManagerSetConfigurationUnbootableRequest>(offset);
1431 self.0.encode(encoder, offset + 0, depth)?;
1435 Ok(())
1436 }
1437 }
1438
1439 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1440 for BootManagerSetConfigurationUnbootableRequest
1441 {
1442 #[inline(always)]
1443 fn new_empty() -> Self {
1444 Self { configuration: fidl::new_empty!(Configuration, D) }
1445 }
1446
1447 #[inline]
1448 unsafe fn decode(
1449 &mut self,
1450 decoder: &mut fidl::encoding::Decoder<'_, D>,
1451 offset: usize,
1452 _depth: fidl::encoding::Depth,
1453 ) -> fidl::Result<()> {
1454 decoder.debug_check_bounds::<Self>(offset);
1455 fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
1457 Ok(())
1458 }
1459 }
1460
1461 impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationUnbootableResponse {
1462 type Borrowed<'a> = &'a Self;
1463 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1464 value
1465 }
1466 }
1467
1468 unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationUnbootableResponse {
1469 type Owned = Self;
1470
1471 #[inline(always)]
1472 fn inline_align(_context: fidl::encoding::Context) -> usize {
1473 4
1474 }
1475
1476 #[inline(always)]
1477 fn inline_size(_context: fidl::encoding::Context) -> usize {
1478 4
1479 }
1480 #[inline(always)]
1481 fn encode_is_copy() -> bool {
1482 true
1483 }
1484
1485 #[inline(always)]
1486 fn decode_is_copy() -> bool {
1487 true
1488 }
1489 }
1490
1491 unsafe impl<D: fidl::encoding::ResourceDialect>
1492 fidl::encoding::Encode<BootManagerSetConfigurationUnbootableResponse, D>
1493 for &BootManagerSetConfigurationUnbootableResponse
1494 {
1495 #[inline]
1496 unsafe fn encode(
1497 self,
1498 encoder: &mut fidl::encoding::Encoder<'_, D>,
1499 offset: usize,
1500 _depth: fidl::encoding::Depth,
1501 ) -> fidl::Result<()> {
1502 encoder.debug_check_bounds::<BootManagerSetConfigurationUnbootableResponse>(offset);
1503 unsafe {
1504 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1506 (buf_ptr as *mut BootManagerSetConfigurationUnbootableResponse).write_unaligned(
1507 (self as *const BootManagerSetConfigurationUnbootableResponse).read(),
1508 );
1509 }
1512 Ok(())
1513 }
1514 }
1515 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1516 fidl::encoding::Encode<BootManagerSetConfigurationUnbootableResponse, D> for (T0,)
1517 {
1518 #[inline]
1519 unsafe fn encode(
1520 self,
1521 encoder: &mut fidl::encoding::Encoder<'_, D>,
1522 offset: usize,
1523 depth: fidl::encoding::Depth,
1524 ) -> fidl::Result<()> {
1525 encoder.debug_check_bounds::<BootManagerSetConfigurationUnbootableResponse>(offset);
1526 self.0.encode(encoder, offset + 0, depth)?;
1530 Ok(())
1531 }
1532 }
1533
1534 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1535 for BootManagerSetConfigurationUnbootableResponse
1536 {
1537 #[inline(always)]
1538 fn new_empty() -> Self {
1539 Self { status: fidl::new_empty!(i32, D) }
1540 }
1541
1542 #[inline]
1543 unsafe fn decode(
1544 &mut self,
1545 decoder: &mut fidl::encoding::Decoder<'_, D>,
1546 offset: usize,
1547 _depth: fidl::encoding::Depth,
1548 ) -> fidl::Result<()> {
1549 decoder.debug_check_bounds::<Self>(offset);
1550 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1551 unsafe {
1554 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1555 }
1556 Ok(())
1557 }
1558 }
1559
1560 impl fidl::encoding::ValueTypeMarker for BootManagerQueryActiveConfigurationResponse {
1561 type Borrowed<'a> = &'a Self;
1562 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1563 value
1564 }
1565 }
1566
1567 unsafe impl fidl::encoding::TypeMarker for BootManagerQueryActiveConfigurationResponse {
1568 type Owned = Self;
1569
1570 #[inline(always)]
1571 fn inline_align(_context: fidl::encoding::Context) -> usize {
1572 4
1573 }
1574
1575 #[inline(always)]
1576 fn inline_size(_context: fidl::encoding::Context) -> usize {
1577 4
1578 }
1579 }
1580
1581 unsafe impl<D: fidl::encoding::ResourceDialect>
1582 fidl::encoding::Encode<BootManagerQueryActiveConfigurationResponse, D>
1583 for &BootManagerQueryActiveConfigurationResponse
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::<BootManagerQueryActiveConfigurationResponse>(offset);
1593 fidl::encoding::Encode::<BootManagerQueryActiveConfigurationResponse, D>::encode(
1595 (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
1596 encoder,
1597 offset,
1598 _depth,
1599 )
1600 }
1601 }
1602 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
1603 fidl::encoding::Encode<BootManagerQueryActiveConfigurationResponse, D> for (T0,)
1604 {
1605 #[inline]
1606 unsafe fn encode(
1607 self,
1608 encoder: &mut fidl::encoding::Encoder<'_, D>,
1609 offset: usize,
1610 depth: fidl::encoding::Depth,
1611 ) -> fidl::Result<()> {
1612 encoder.debug_check_bounds::<BootManagerQueryActiveConfigurationResponse>(offset);
1613 self.0.encode(encoder, offset + 0, depth)?;
1617 Ok(())
1618 }
1619 }
1620
1621 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1622 for BootManagerQueryActiveConfigurationResponse
1623 {
1624 #[inline(always)]
1625 fn new_empty() -> Self {
1626 Self { configuration: fidl::new_empty!(Configuration, D) }
1627 }
1628
1629 #[inline]
1630 unsafe fn decode(
1631 &mut self,
1632 decoder: &mut fidl::encoding::Decoder<'_, D>,
1633 offset: usize,
1634 _depth: fidl::encoding::Depth,
1635 ) -> fidl::Result<()> {
1636 decoder.debug_check_bounds::<Self>(offset);
1637 fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
1639 Ok(())
1640 }
1641 }
1642
1643 impl fidl::encoding::ValueTypeMarker for BootManagerQueryConfigurationLastSetActiveResponse {
1644 type Borrowed<'a> = &'a Self;
1645 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1646 value
1647 }
1648 }
1649
1650 unsafe impl fidl::encoding::TypeMarker for BootManagerQueryConfigurationLastSetActiveResponse {
1651 type Owned = Self;
1652
1653 #[inline(always)]
1654 fn inline_align(_context: fidl::encoding::Context) -> usize {
1655 4
1656 }
1657
1658 #[inline(always)]
1659 fn inline_size(_context: fidl::encoding::Context) -> usize {
1660 4
1661 }
1662 }
1663
1664 unsafe impl<D: fidl::encoding::ResourceDialect>
1665 fidl::encoding::Encode<BootManagerQueryConfigurationLastSetActiveResponse, D>
1666 for &BootManagerQueryConfigurationLastSetActiveResponse
1667 {
1668 #[inline]
1669 unsafe fn encode(
1670 self,
1671 encoder: &mut fidl::encoding::Encoder<'_, D>,
1672 offset: usize,
1673 _depth: fidl::encoding::Depth,
1674 ) -> fidl::Result<()> {
1675 encoder
1676 .debug_check_bounds::<BootManagerQueryConfigurationLastSetActiveResponse>(offset);
1677 fidl::encoding::Encode::<BootManagerQueryConfigurationLastSetActiveResponse, D>::encode(
1679 (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
1680 encoder,
1681 offset,
1682 _depth,
1683 )
1684 }
1685 }
1686 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
1687 fidl::encoding::Encode<BootManagerQueryConfigurationLastSetActiveResponse, D> for (T0,)
1688 {
1689 #[inline]
1690 unsafe fn encode(
1691 self,
1692 encoder: &mut fidl::encoding::Encoder<'_, D>,
1693 offset: usize,
1694 depth: fidl::encoding::Depth,
1695 ) -> fidl::Result<()> {
1696 encoder
1697 .debug_check_bounds::<BootManagerQueryConfigurationLastSetActiveResponse>(offset);
1698 self.0.encode(encoder, offset + 0, depth)?;
1702 Ok(())
1703 }
1704 }
1705
1706 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1707 for BootManagerQueryConfigurationLastSetActiveResponse
1708 {
1709 #[inline(always)]
1710 fn new_empty() -> Self {
1711 Self { configuration: fidl::new_empty!(Configuration, D) }
1712 }
1713
1714 #[inline]
1715 unsafe fn decode(
1716 &mut self,
1717 decoder: &mut fidl::encoding::Decoder<'_, D>,
1718 offset: usize,
1719 _depth: fidl::encoding::Depth,
1720 ) -> fidl::Result<()> {
1721 decoder.debug_check_bounds::<Self>(offset);
1722 fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
1724 Ok(())
1725 }
1726 }
1727
1728 impl fidl::encoding::ValueTypeMarker for BootManagerQueryConfigurationStatusResponse {
1729 type Borrowed<'a> = &'a Self;
1730 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1731 value
1732 }
1733 }
1734
1735 unsafe impl fidl::encoding::TypeMarker for BootManagerQueryConfigurationStatusResponse {
1736 type Owned = Self;
1737
1738 #[inline(always)]
1739 fn inline_align(_context: fidl::encoding::Context) -> usize {
1740 4
1741 }
1742
1743 #[inline(always)]
1744 fn inline_size(_context: fidl::encoding::Context) -> usize {
1745 4
1746 }
1747 }
1748
1749 unsafe impl<D: fidl::encoding::ResourceDialect>
1750 fidl::encoding::Encode<BootManagerQueryConfigurationStatusResponse, D>
1751 for &BootManagerQueryConfigurationStatusResponse
1752 {
1753 #[inline]
1754 unsafe fn encode(
1755 self,
1756 encoder: &mut fidl::encoding::Encoder<'_, D>,
1757 offset: usize,
1758 _depth: fidl::encoding::Depth,
1759 ) -> fidl::Result<()> {
1760 encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusResponse>(offset);
1761 fidl::encoding::Encode::<BootManagerQueryConfigurationStatusResponse, D>::encode(
1763 (<ConfigurationStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
1764 encoder,
1765 offset,
1766 _depth,
1767 )
1768 }
1769 }
1770 unsafe impl<
1771 D: fidl::encoding::ResourceDialect,
1772 T0: fidl::encoding::Encode<ConfigurationStatus, D>,
1773 > fidl::encoding::Encode<BootManagerQueryConfigurationStatusResponse, D> for (T0,)
1774 {
1775 #[inline]
1776 unsafe fn encode(
1777 self,
1778 encoder: &mut fidl::encoding::Encoder<'_, D>,
1779 offset: usize,
1780 depth: fidl::encoding::Depth,
1781 ) -> fidl::Result<()> {
1782 encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusResponse>(offset);
1783 self.0.encode(encoder, offset + 0, depth)?;
1787 Ok(())
1788 }
1789 }
1790
1791 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1792 for BootManagerQueryConfigurationStatusResponse
1793 {
1794 #[inline(always)]
1795 fn new_empty() -> Self {
1796 Self { status: fidl::new_empty!(ConfigurationStatus, D) }
1797 }
1798
1799 #[inline]
1800 unsafe fn decode(
1801 &mut self,
1802 decoder: &mut fidl::encoding::Decoder<'_, D>,
1803 offset: usize,
1804 _depth: fidl::encoding::Depth,
1805 ) -> fidl::Result<()> {
1806 decoder.debug_check_bounds::<Self>(offset);
1807 fidl::decode!(ConfigurationStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
1809 Ok(())
1810 }
1811 }
1812
1813 impl fidl::encoding::ValueTypeMarker for BootManagerQueryCurrentConfigurationResponse {
1814 type Borrowed<'a> = &'a Self;
1815 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1816 value
1817 }
1818 }
1819
1820 unsafe impl fidl::encoding::TypeMarker for BootManagerQueryCurrentConfigurationResponse {
1821 type Owned = Self;
1822
1823 #[inline(always)]
1824 fn inline_align(_context: fidl::encoding::Context) -> usize {
1825 4
1826 }
1827
1828 #[inline(always)]
1829 fn inline_size(_context: fidl::encoding::Context) -> usize {
1830 4
1831 }
1832 }
1833
1834 unsafe impl<D: fidl::encoding::ResourceDialect>
1835 fidl::encoding::Encode<BootManagerQueryCurrentConfigurationResponse, D>
1836 for &BootManagerQueryCurrentConfigurationResponse
1837 {
1838 #[inline]
1839 unsafe fn encode(
1840 self,
1841 encoder: &mut fidl::encoding::Encoder<'_, D>,
1842 offset: usize,
1843 _depth: fidl::encoding::Depth,
1844 ) -> fidl::Result<()> {
1845 encoder.debug_check_bounds::<BootManagerQueryCurrentConfigurationResponse>(offset);
1846 fidl::encoding::Encode::<BootManagerQueryCurrentConfigurationResponse, D>::encode(
1848 (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
1849 encoder,
1850 offset,
1851 _depth,
1852 )
1853 }
1854 }
1855 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
1856 fidl::encoding::Encode<BootManagerQueryCurrentConfigurationResponse, D> for (T0,)
1857 {
1858 #[inline]
1859 unsafe fn encode(
1860 self,
1861 encoder: &mut fidl::encoding::Encoder<'_, D>,
1862 offset: usize,
1863 depth: fidl::encoding::Depth,
1864 ) -> fidl::Result<()> {
1865 encoder.debug_check_bounds::<BootManagerQueryCurrentConfigurationResponse>(offset);
1866 self.0.encode(encoder, offset + 0, depth)?;
1870 Ok(())
1871 }
1872 }
1873
1874 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1875 for BootManagerQueryCurrentConfigurationResponse
1876 {
1877 #[inline(always)]
1878 fn new_empty() -> Self {
1879 Self { configuration: fidl::new_empty!(Configuration, D) }
1880 }
1881
1882 #[inline]
1883 unsafe fn decode(
1884 &mut self,
1885 decoder: &mut fidl::encoding::Decoder<'_, D>,
1886 offset: usize,
1887 _depth: fidl::encoding::Depth,
1888 ) -> fidl::Result<()> {
1889 decoder.debug_check_bounds::<Self>(offset);
1890 fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
1892 Ok(())
1893 }
1894 }
1895
1896 impl fidl::encoding::ValueTypeMarker for DataSinkFlushResponse {
1897 type Borrowed<'a> = &'a Self;
1898 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1899 value
1900 }
1901 }
1902
1903 unsafe impl fidl::encoding::TypeMarker for DataSinkFlushResponse {
1904 type Owned = Self;
1905
1906 #[inline(always)]
1907 fn inline_align(_context: fidl::encoding::Context) -> usize {
1908 4
1909 }
1910
1911 #[inline(always)]
1912 fn inline_size(_context: fidl::encoding::Context) -> usize {
1913 4
1914 }
1915 #[inline(always)]
1916 fn encode_is_copy() -> bool {
1917 true
1918 }
1919
1920 #[inline(always)]
1921 fn decode_is_copy() -> bool {
1922 true
1923 }
1924 }
1925
1926 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DataSinkFlushResponse, D>
1927 for &DataSinkFlushResponse
1928 {
1929 #[inline]
1930 unsafe fn encode(
1931 self,
1932 encoder: &mut fidl::encoding::Encoder<'_, D>,
1933 offset: usize,
1934 _depth: fidl::encoding::Depth,
1935 ) -> fidl::Result<()> {
1936 encoder.debug_check_bounds::<DataSinkFlushResponse>(offset);
1937 unsafe {
1938 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1940 (buf_ptr as *mut DataSinkFlushResponse)
1941 .write_unaligned((self as *const DataSinkFlushResponse).read());
1942 }
1945 Ok(())
1946 }
1947 }
1948 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1949 fidl::encoding::Encode<DataSinkFlushResponse, D> for (T0,)
1950 {
1951 #[inline]
1952 unsafe fn encode(
1953 self,
1954 encoder: &mut fidl::encoding::Encoder<'_, D>,
1955 offset: usize,
1956 depth: fidl::encoding::Depth,
1957 ) -> fidl::Result<()> {
1958 encoder.debug_check_bounds::<DataSinkFlushResponse>(offset);
1959 self.0.encode(encoder, offset + 0, depth)?;
1963 Ok(())
1964 }
1965 }
1966
1967 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DataSinkFlushResponse {
1968 #[inline(always)]
1969 fn new_empty() -> Self {
1970 Self { status: fidl::new_empty!(i32, D) }
1971 }
1972
1973 #[inline]
1974 unsafe fn decode(
1975 &mut self,
1976 decoder: &mut fidl::encoding::Decoder<'_, D>,
1977 offset: usize,
1978 _depth: fidl::encoding::Depth,
1979 ) -> fidl::Result<()> {
1980 decoder.debug_check_bounds::<Self>(offset);
1981 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1982 unsafe {
1985 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1986 }
1987 Ok(())
1988 }
1989 }
1990
1991 impl fidl::encoding::ValueTypeMarker for DataSinkReadAssetRequest {
1992 type Borrowed<'a> = &'a Self;
1993 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1994 value
1995 }
1996 }
1997
1998 unsafe impl fidl::encoding::TypeMarker for DataSinkReadAssetRequest {
1999 type Owned = Self;
2000
2001 #[inline(always)]
2002 fn inline_align(_context: fidl::encoding::Context) -> usize {
2003 4
2004 }
2005
2006 #[inline(always)]
2007 fn inline_size(_context: fidl::encoding::Context) -> usize {
2008 8
2009 }
2010 }
2011
2012 unsafe impl<D: fidl::encoding::ResourceDialect>
2013 fidl::encoding::Encode<DataSinkReadAssetRequest, D> for &DataSinkReadAssetRequest
2014 {
2015 #[inline]
2016 unsafe fn encode(
2017 self,
2018 encoder: &mut fidl::encoding::Encoder<'_, D>,
2019 offset: usize,
2020 _depth: fidl::encoding::Depth,
2021 ) -> fidl::Result<()> {
2022 encoder.debug_check_bounds::<DataSinkReadAssetRequest>(offset);
2023 fidl::encoding::Encode::<DataSinkReadAssetRequest, D>::encode(
2025 (
2026 <Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),
2027 <Asset as fidl::encoding::ValueTypeMarker>::borrow(&self.asset),
2028 ),
2029 encoder,
2030 offset,
2031 _depth,
2032 )
2033 }
2034 }
2035 unsafe impl<
2036 D: fidl::encoding::ResourceDialect,
2037 T0: fidl::encoding::Encode<Configuration, D>,
2038 T1: fidl::encoding::Encode<Asset, D>,
2039 > fidl::encoding::Encode<DataSinkReadAssetRequest, D> for (T0, T1)
2040 {
2041 #[inline]
2042 unsafe fn encode(
2043 self,
2044 encoder: &mut fidl::encoding::Encoder<'_, D>,
2045 offset: usize,
2046 depth: fidl::encoding::Depth,
2047 ) -> fidl::Result<()> {
2048 encoder.debug_check_bounds::<DataSinkReadAssetRequest>(offset);
2049 self.0.encode(encoder, offset + 0, depth)?;
2053 self.1.encode(encoder, offset + 4, depth)?;
2054 Ok(())
2055 }
2056 }
2057
2058 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2059 for DataSinkReadAssetRequest
2060 {
2061 #[inline(always)]
2062 fn new_empty() -> Self {
2063 Self {
2064 configuration: fidl::new_empty!(Configuration, D),
2065 asset: fidl::new_empty!(Asset, D),
2066 }
2067 }
2068
2069 #[inline]
2070 unsafe fn decode(
2071 &mut self,
2072 decoder: &mut fidl::encoding::Decoder<'_, D>,
2073 offset: usize,
2074 _depth: fidl::encoding::Depth,
2075 ) -> fidl::Result<()> {
2076 decoder.debug_check_bounds::<Self>(offset);
2077 fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
2079 fidl::decode!(Asset, D, &mut self.asset, decoder, offset + 4, _depth)?;
2080 Ok(())
2081 }
2082 }
2083
2084 impl fidl::encoding::ValueTypeMarker for DataSinkWriteAssetResponse {
2085 type Borrowed<'a> = &'a Self;
2086 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2087 value
2088 }
2089 }
2090
2091 unsafe impl fidl::encoding::TypeMarker for DataSinkWriteAssetResponse {
2092 type Owned = Self;
2093
2094 #[inline(always)]
2095 fn inline_align(_context: fidl::encoding::Context) -> usize {
2096 4
2097 }
2098
2099 #[inline(always)]
2100 fn inline_size(_context: fidl::encoding::Context) -> usize {
2101 4
2102 }
2103 #[inline(always)]
2104 fn encode_is_copy() -> bool {
2105 true
2106 }
2107
2108 #[inline(always)]
2109 fn decode_is_copy() -> bool {
2110 true
2111 }
2112 }
2113
2114 unsafe impl<D: fidl::encoding::ResourceDialect>
2115 fidl::encoding::Encode<DataSinkWriteAssetResponse, D> for &DataSinkWriteAssetResponse
2116 {
2117 #[inline]
2118 unsafe fn encode(
2119 self,
2120 encoder: &mut fidl::encoding::Encoder<'_, D>,
2121 offset: usize,
2122 _depth: fidl::encoding::Depth,
2123 ) -> fidl::Result<()> {
2124 encoder.debug_check_bounds::<DataSinkWriteAssetResponse>(offset);
2125 unsafe {
2126 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2128 (buf_ptr as *mut DataSinkWriteAssetResponse)
2129 .write_unaligned((self as *const DataSinkWriteAssetResponse).read());
2130 }
2133 Ok(())
2134 }
2135 }
2136 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2137 fidl::encoding::Encode<DataSinkWriteAssetResponse, D> for (T0,)
2138 {
2139 #[inline]
2140 unsafe fn encode(
2141 self,
2142 encoder: &mut fidl::encoding::Encoder<'_, D>,
2143 offset: usize,
2144 depth: fidl::encoding::Depth,
2145 ) -> fidl::Result<()> {
2146 encoder.debug_check_bounds::<DataSinkWriteAssetResponse>(offset);
2147 self.0.encode(encoder, offset + 0, depth)?;
2151 Ok(())
2152 }
2153 }
2154
2155 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2156 for DataSinkWriteAssetResponse
2157 {
2158 #[inline(always)]
2159 fn new_empty() -> Self {
2160 Self { status: fidl::new_empty!(i32, D) }
2161 }
2162
2163 #[inline]
2164 unsafe fn decode(
2165 &mut self,
2166 decoder: &mut fidl::encoding::Decoder<'_, D>,
2167 offset: usize,
2168 _depth: fidl::encoding::Depth,
2169 ) -> fidl::Result<()> {
2170 decoder.debug_check_bounds::<Self>(offset);
2171 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2172 unsafe {
2175 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2176 }
2177 Ok(())
2178 }
2179 }
2180
2181 impl fidl::encoding::ValueTypeMarker for DataSinkWriteFirmwareResponse {
2182 type Borrowed<'a> = &'a Self;
2183 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2184 value
2185 }
2186 }
2187
2188 unsafe impl fidl::encoding::TypeMarker for DataSinkWriteFirmwareResponse {
2189 type Owned = Self;
2190
2191 #[inline(always)]
2192 fn inline_align(_context: fidl::encoding::Context) -> usize {
2193 8
2194 }
2195
2196 #[inline(always)]
2197 fn inline_size(_context: fidl::encoding::Context) -> usize {
2198 16
2199 }
2200 }
2201
2202 unsafe impl<D: fidl::encoding::ResourceDialect>
2203 fidl::encoding::Encode<DataSinkWriteFirmwareResponse, D>
2204 for &DataSinkWriteFirmwareResponse
2205 {
2206 #[inline]
2207 unsafe fn encode(
2208 self,
2209 encoder: &mut fidl::encoding::Encoder<'_, D>,
2210 offset: usize,
2211 _depth: fidl::encoding::Depth,
2212 ) -> fidl::Result<()> {
2213 encoder.debug_check_bounds::<DataSinkWriteFirmwareResponse>(offset);
2214 fidl::encoding::Encode::<DataSinkWriteFirmwareResponse, D>::encode(
2216 (<WriteFirmwareResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
2217 encoder,
2218 offset,
2219 _depth,
2220 )
2221 }
2222 }
2223 unsafe impl<
2224 D: fidl::encoding::ResourceDialect,
2225 T0: fidl::encoding::Encode<WriteFirmwareResult, D>,
2226 > fidl::encoding::Encode<DataSinkWriteFirmwareResponse, D> for (T0,)
2227 {
2228 #[inline]
2229 unsafe fn encode(
2230 self,
2231 encoder: &mut fidl::encoding::Encoder<'_, D>,
2232 offset: usize,
2233 depth: fidl::encoding::Depth,
2234 ) -> fidl::Result<()> {
2235 encoder.debug_check_bounds::<DataSinkWriteFirmwareResponse>(offset);
2236 self.0.encode(encoder, offset + 0, depth)?;
2240 Ok(())
2241 }
2242 }
2243
2244 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2245 for DataSinkWriteFirmwareResponse
2246 {
2247 #[inline(always)]
2248 fn new_empty() -> Self {
2249 Self { result: fidl::new_empty!(WriteFirmwareResult, D) }
2250 }
2251
2252 #[inline]
2253 unsafe fn decode(
2254 &mut self,
2255 decoder: &mut fidl::encoding::Decoder<'_, D>,
2256 offset: usize,
2257 _depth: fidl::encoding::Depth,
2258 ) -> fidl::Result<()> {
2259 decoder.debug_check_bounds::<Self>(offset);
2260 fidl::decode!(WriteFirmwareResult, D, &mut self.result, decoder, offset + 0, _depth)?;
2262 Ok(())
2263 }
2264 }
2265
2266 impl fidl::encoding::ValueTypeMarker for DynamicDataSinkInitializePartitionTablesResponse {
2267 type Borrowed<'a> = &'a Self;
2268 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2269 value
2270 }
2271 }
2272
2273 unsafe impl fidl::encoding::TypeMarker for DynamicDataSinkInitializePartitionTablesResponse {
2274 type Owned = Self;
2275
2276 #[inline(always)]
2277 fn inline_align(_context: fidl::encoding::Context) -> usize {
2278 4
2279 }
2280
2281 #[inline(always)]
2282 fn inline_size(_context: fidl::encoding::Context) -> usize {
2283 4
2284 }
2285 #[inline(always)]
2286 fn encode_is_copy() -> bool {
2287 true
2288 }
2289
2290 #[inline(always)]
2291 fn decode_is_copy() -> bool {
2292 true
2293 }
2294 }
2295
2296 unsafe impl<D: fidl::encoding::ResourceDialect>
2297 fidl::encoding::Encode<DynamicDataSinkInitializePartitionTablesResponse, D>
2298 for &DynamicDataSinkInitializePartitionTablesResponse
2299 {
2300 #[inline]
2301 unsafe fn encode(
2302 self,
2303 encoder: &mut fidl::encoding::Encoder<'_, D>,
2304 offset: usize,
2305 _depth: fidl::encoding::Depth,
2306 ) -> fidl::Result<()> {
2307 encoder.debug_check_bounds::<DynamicDataSinkInitializePartitionTablesResponse>(offset);
2308 unsafe {
2309 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2311 (buf_ptr as *mut DynamicDataSinkInitializePartitionTablesResponse).write_unaligned(
2312 (self as *const DynamicDataSinkInitializePartitionTablesResponse).read(),
2313 );
2314 }
2317 Ok(())
2318 }
2319 }
2320 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2321 fidl::encoding::Encode<DynamicDataSinkInitializePartitionTablesResponse, D> for (T0,)
2322 {
2323 #[inline]
2324 unsafe fn encode(
2325 self,
2326 encoder: &mut fidl::encoding::Encoder<'_, D>,
2327 offset: usize,
2328 depth: fidl::encoding::Depth,
2329 ) -> fidl::Result<()> {
2330 encoder.debug_check_bounds::<DynamicDataSinkInitializePartitionTablesResponse>(offset);
2331 self.0.encode(encoder, offset + 0, depth)?;
2335 Ok(())
2336 }
2337 }
2338
2339 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2340 for DynamicDataSinkInitializePartitionTablesResponse
2341 {
2342 #[inline(always)]
2343 fn new_empty() -> Self {
2344 Self { status: fidl::new_empty!(i32, D) }
2345 }
2346
2347 #[inline]
2348 unsafe fn decode(
2349 &mut self,
2350 decoder: &mut fidl::encoding::Decoder<'_, D>,
2351 offset: usize,
2352 _depth: fidl::encoding::Depth,
2353 ) -> fidl::Result<()> {
2354 decoder.debug_check_bounds::<Self>(offset);
2355 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2356 unsafe {
2359 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2360 }
2361 Ok(())
2362 }
2363 }
2364
2365 impl fidl::encoding::ValueTypeMarker for DynamicDataSinkWipePartitionTablesResponse {
2366 type Borrowed<'a> = &'a Self;
2367 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2368 value
2369 }
2370 }
2371
2372 unsafe impl fidl::encoding::TypeMarker for DynamicDataSinkWipePartitionTablesResponse {
2373 type Owned = Self;
2374
2375 #[inline(always)]
2376 fn inline_align(_context: fidl::encoding::Context) -> usize {
2377 4
2378 }
2379
2380 #[inline(always)]
2381 fn inline_size(_context: fidl::encoding::Context) -> usize {
2382 4
2383 }
2384 #[inline(always)]
2385 fn encode_is_copy() -> bool {
2386 true
2387 }
2388
2389 #[inline(always)]
2390 fn decode_is_copy() -> bool {
2391 true
2392 }
2393 }
2394
2395 unsafe impl<D: fidl::encoding::ResourceDialect>
2396 fidl::encoding::Encode<DynamicDataSinkWipePartitionTablesResponse, D>
2397 for &DynamicDataSinkWipePartitionTablesResponse
2398 {
2399 #[inline]
2400 unsafe fn encode(
2401 self,
2402 encoder: &mut fidl::encoding::Encoder<'_, D>,
2403 offset: usize,
2404 _depth: fidl::encoding::Depth,
2405 ) -> fidl::Result<()> {
2406 encoder.debug_check_bounds::<DynamicDataSinkWipePartitionTablesResponse>(offset);
2407 unsafe {
2408 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2410 (buf_ptr as *mut DynamicDataSinkWipePartitionTablesResponse).write_unaligned(
2411 (self as *const DynamicDataSinkWipePartitionTablesResponse).read(),
2412 );
2413 }
2416 Ok(())
2417 }
2418 }
2419 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2420 fidl::encoding::Encode<DynamicDataSinkWipePartitionTablesResponse, D> for (T0,)
2421 {
2422 #[inline]
2423 unsafe fn encode(
2424 self,
2425 encoder: &mut fidl::encoding::Encoder<'_, D>,
2426 offset: usize,
2427 depth: fidl::encoding::Depth,
2428 ) -> fidl::Result<()> {
2429 encoder.debug_check_bounds::<DynamicDataSinkWipePartitionTablesResponse>(offset);
2430 self.0.encode(encoder, offset + 0, depth)?;
2434 Ok(())
2435 }
2436 }
2437
2438 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2439 for DynamicDataSinkWipePartitionTablesResponse
2440 {
2441 #[inline(always)]
2442 fn new_empty() -> Self {
2443 Self { status: fidl::new_empty!(i32, D) }
2444 }
2445
2446 #[inline]
2447 unsafe fn decode(
2448 &mut self,
2449 decoder: &mut fidl::encoding::Decoder<'_, D>,
2450 offset: usize,
2451 _depth: fidl::encoding::Depth,
2452 ) -> fidl::Result<()> {
2453 decoder.debug_check_bounds::<Self>(offset);
2454 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2455 unsafe {
2458 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2459 }
2460 Ok(())
2461 }
2462 }
2463
2464 impl fidl::encoding::ValueTypeMarker for ReadInfo {
2465 type Borrowed<'a> = &'a Self;
2466 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2467 value
2468 }
2469 }
2470
2471 unsafe impl fidl::encoding::TypeMarker for ReadInfo {
2472 type Owned = Self;
2473
2474 #[inline(always)]
2475 fn inline_align(_context: fidl::encoding::Context) -> usize {
2476 8
2477 }
2478
2479 #[inline(always)]
2480 fn inline_size(_context: fidl::encoding::Context) -> usize {
2481 16
2482 }
2483 #[inline(always)]
2484 fn encode_is_copy() -> bool {
2485 true
2486 }
2487
2488 #[inline(always)]
2489 fn decode_is_copy() -> bool {
2490 true
2491 }
2492 }
2493
2494 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReadInfo, D> for &ReadInfo {
2495 #[inline]
2496 unsafe fn encode(
2497 self,
2498 encoder: &mut fidl::encoding::Encoder<'_, D>,
2499 offset: usize,
2500 _depth: fidl::encoding::Depth,
2501 ) -> fidl::Result<()> {
2502 encoder.debug_check_bounds::<ReadInfo>(offset);
2503 unsafe {
2504 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2506 (buf_ptr as *mut ReadInfo).write_unaligned((self as *const ReadInfo).read());
2507 }
2510 Ok(())
2511 }
2512 }
2513 unsafe impl<
2514 D: fidl::encoding::ResourceDialect,
2515 T0: fidl::encoding::Encode<u64, D>,
2516 T1: fidl::encoding::Encode<u64, D>,
2517 > fidl::encoding::Encode<ReadInfo, D> for (T0, T1)
2518 {
2519 #[inline]
2520 unsafe fn encode(
2521 self,
2522 encoder: &mut fidl::encoding::Encoder<'_, D>,
2523 offset: usize,
2524 depth: fidl::encoding::Depth,
2525 ) -> fidl::Result<()> {
2526 encoder.debug_check_bounds::<ReadInfo>(offset);
2527 self.0.encode(encoder, offset + 0, depth)?;
2531 self.1.encode(encoder, offset + 8, depth)?;
2532 Ok(())
2533 }
2534 }
2535
2536 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReadInfo {
2537 #[inline(always)]
2538 fn new_empty() -> Self {
2539 Self { offset: fidl::new_empty!(u64, D), size: fidl::new_empty!(u64, D) }
2540 }
2541
2542 #[inline]
2543 unsafe fn decode(
2544 &mut self,
2545 decoder: &mut fidl::encoding::Decoder<'_, D>,
2546 offset: usize,
2547 _depth: fidl::encoding::Depth,
2548 ) -> fidl::Result<()> {
2549 decoder.debug_check_bounds::<Self>(offset);
2550 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2551 unsafe {
2554 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2555 }
2556 Ok(())
2557 }
2558 }
2559
2560 impl fidl::encoding::ValueTypeMarker for SysconfigFlushResponse {
2561 type Borrowed<'a> = &'a Self;
2562 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2563 value
2564 }
2565 }
2566
2567 unsafe impl fidl::encoding::TypeMarker for SysconfigFlushResponse {
2568 type Owned = Self;
2569
2570 #[inline(always)]
2571 fn inline_align(_context: fidl::encoding::Context) -> usize {
2572 4
2573 }
2574
2575 #[inline(always)]
2576 fn inline_size(_context: fidl::encoding::Context) -> usize {
2577 4
2578 }
2579 #[inline(always)]
2580 fn encode_is_copy() -> bool {
2581 true
2582 }
2583
2584 #[inline(always)]
2585 fn decode_is_copy() -> bool {
2586 true
2587 }
2588 }
2589
2590 unsafe impl<D: fidl::encoding::ResourceDialect>
2591 fidl::encoding::Encode<SysconfigFlushResponse, D> for &SysconfigFlushResponse
2592 {
2593 #[inline]
2594 unsafe fn encode(
2595 self,
2596 encoder: &mut fidl::encoding::Encoder<'_, D>,
2597 offset: usize,
2598 _depth: fidl::encoding::Depth,
2599 ) -> fidl::Result<()> {
2600 encoder.debug_check_bounds::<SysconfigFlushResponse>(offset);
2601 unsafe {
2602 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2604 (buf_ptr as *mut SysconfigFlushResponse)
2605 .write_unaligned((self as *const SysconfigFlushResponse).read());
2606 }
2609 Ok(())
2610 }
2611 }
2612 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2613 fidl::encoding::Encode<SysconfigFlushResponse, D> for (T0,)
2614 {
2615 #[inline]
2616 unsafe fn encode(
2617 self,
2618 encoder: &mut fidl::encoding::Encoder<'_, D>,
2619 offset: usize,
2620 depth: fidl::encoding::Depth,
2621 ) -> fidl::Result<()> {
2622 encoder.debug_check_bounds::<SysconfigFlushResponse>(offset);
2623 self.0.encode(encoder, offset + 0, depth)?;
2627 Ok(())
2628 }
2629 }
2630
2631 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2632 for SysconfigFlushResponse
2633 {
2634 #[inline(always)]
2635 fn new_empty() -> Self {
2636 Self { status: fidl::new_empty!(i32, D) }
2637 }
2638
2639 #[inline]
2640 unsafe fn decode(
2641 &mut self,
2642 decoder: &mut fidl::encoding::Decoder<'_, D>,
2643 offset: usize,
2644 _depth: fidl::encoding::Depth,
2645 ) -> fidl::Result<()> {
2646 decoder.debug_check_bounds::<Self>(offset);
2647 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2648 unsafe {
2651 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2652 }
2653 Ok(())
2654 }
2655 }
2656
2657 impl fidl::encoding::ValueTypeMarker for SysconfigWipeResponse {
2658 type Borrowed<'a> = &'a Self;
2659 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2660 value
2661 }
2662 }
2663
2664 unsafe impl fidl::encoding::TypeMarker for SysconfigWipeResponse {
2665 type Owned = Self;
2666
2667 #[inline(always)]
2668 fn inline_align(_context: fidl::encoding::Context) -> usize {
2669 4
2670 }
2671
2672 #[inline(always)]
2673 fn inline_size(_context: fidl::encoding::Context) -> usize {
2674 4
2675 }
2676 #[inline(always)]
2677 fn encode_is_copy() -> bool {
2678 true
2679 }
2680
2681 #[inline(always)]
2682 fn decode_is_copy() -> bool {
2683 true
2684 }
2685 }
2686
2687 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SysconfigWipeResponse, D>
2688 for &SysconfigWipeResponse
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::<SysconfigWipeResponse>(offset);
2698 unsafe {
2699 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2701 (buf_ptr as *mut SysconfigWipeResponse)
2702 .write_unaligned((self as *const SysconfigWipeResponse).read());
2703 }
2706 Ok(())
2707 }
2708 }
2709 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2710 fidl::encoding::Encode<SysconfigWipeResponse, D> for (T0,)
2711 {
2712 #[inline]
2713 unsafe fn encode(
2714 self,
2715 encoder: &mut fidl::encoding::Encoder<'_, D>,
2716 offset: usize,
2717 depth: fidl::encoding::Depth,
2718 ) -> fidl::Result<()> {
2719 encoder.debug_check_bounds::<SysconfigWipeResponse>(offset);
2720 self.0.encode(encoder, offset + 0, depth)?;
2724 Ok(())
2725 }
2726 }
2727
2728 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SysconfigWipeResponse {
2729 #[inline(always)]
2730 fn new_empty() -> Self {
2731 Self { status: fidl::new_empty!(i32, D) }
2732 }
2733
2734 #[inline]
2735 unsafe fn decode(
2736 &mut self,
2737 decoder: &mut fidl::encoding::Decoder<'_, D>,
2738 offset: usize,
2739 _depth: fidl::encoding::Depth,
2740 ) -> fidl::Result<()> {
2741 decoder.debug_check_bounds::<Self>(offset);
2742 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2743 unsafe {
2746 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2747 }
2748 Ok(())
2749 }
2750 }
2751
2752 impl fidl::encoding::ValueTypeMarker for SysconfigWriteResponse {
2753 type Borrowed<'a> = &'a Self;
2754 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2755 value
2756 }
2757 }
2758
2759 unsafe impl fidl::encoding::TypeMarker for SysconfigWriteResponse {
2760 type Owned = Self;
2761
2762 #[inline(always)]
2763 fn inline_align(_context: fidl::encoding::Context) -> usize {
2764 4
2765 }
2766
2767 #[inline(always)]
2768 fn inline_size(_context: fidl::encoding::Context) -> usize {
2769 4
2770 }
2771 #[inline(always)]
2772 fn encode_is_copy() -> bool {
2773 true
2774 }
2775
2776 #[inline(always)]
2777 fn decode_is_copy() -> bool {
2778 true
2779 }
2780 }
2781
2782 unsafe impl<D: fidl::encoding::ResourceDialect>
2783 fidl::encoding::Encode<SysconfigWriteResponse, D> for &SysconfigWriteResponse
2784 {
2785 #[inline]
2786 unsafe fn encode(
2787 self,
2788 encoder: &mut fidl::encoding::Encoder<'_, D>,
2789 offset: usize,
2790 _depth: fidl::encoding::Depth,
2791 ) -> fidl::Result<()> {
2792 encoder.debug_check_bounds::<SysconfigWriteResponse>(offset);
2793 unsafe {
2794 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2796 (buf_ptr as *mut SysconfigWriteResponse)
2797 .write_unaligned((self as *const SysconfigWriteResponse).read());
2798 }
2801 Ok(())
2802 }
2803 }
2804 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2805 fidl::encoding::Encode<SysconfigWriteResponse, D> for (T0,)
2806 {
2807 #[inline]
2808 unsafe fn encode(
2809 self,
2810 encoder: &mut fidl::encoding::Encoder<'_, D>,
2811 offset: usize,
2812 depth: fidl::encoding::Depth,
2813 ) -> fidl::Result<()> {
2814 encoder.debug_check_bounds::<SysconfigWriteResponse>(offset);
2815 self.0.encode(encoder, offset + 0, depth)?;
2819 Ok(())
2820 }
2821 }
2822
2823 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2824 for SysconfigWriteResponse
2825 {
2826 #[inline(always)]
2827 fn new_empty() -> Self {
2828 Self { status: fidl::new_empty!(i32, D) }
2829 }
2830
2831 #[inline]
2832 unsafe fn decode(
2833 &mut self,
2834 decoder: &mut fidl::encoding::Decoder<'_, D>,
2835 offset: usize,
2836 _depth: fidl::encoding::Depth,
2837 ) -> fidl::Result<()> {
2838 decoder.debug_check_bounds::<Self>(offset);
2839 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2840 unsafe {
2843 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2844 }
2845 Ok(())
2846 }
2847 }
2848
2849 impl fidl::encoding::ValueTypeMarker for SysconfigGetPartitionSizeResponse {
2850 type Borrowed<'a> = &'a Self;
2851 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2852 value
2853 }
2854 }
2855
2856 unsafe impl fidl::encoding::TypeMarker for SysconfigGetPartitionSizeResponse {
2857 type Owned = Self;
2858
2859 #[inline(always)]
2860 fn inline_align(_context: fidl::encoding::Context) -> usize {
2861 8
2862 }
2863
2864 #[inline(always)]
2865 fn inline_size(_context: fidl::encoding::Context) -> usize {
2866 8
2867 }
2868 #[inline(always)]
2869 fn encode_is_copy() -> bool {
2870 true
2871 }
2872
2873 #[inline(always)]
2874 fn decode_is_copy() -> bool {
2875 true
2876 }
2877 }
2878
2879 unsafe impl<D: fidl::encoding::ResourceDialect>
2880 fidl::encoding::Encode<SysconfigGetPartitionSizeResponse, D>
2881 for &SysconfigGetPartitionSizeResponse
2882 {
2883 #[inline]
2884 unsafe fn encode(
2885 self,
2886 encoder: &mut fidl::encoding::Encoder<'_, D>,
2887 offset: usize,
2888 _depth: fidl::encoding::Depth,
2889 ) -> fidl::Result<()> {
2890 encoder.debug_check_bounds::<SysconfigGetPartitionSizeResponse>(offset);
2891 unsafe {
2892 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2894 (buf_ptr as *mut SysconfigGetPartitionSizeResponse)
2895 .write_unaligned((self as *const SysconfigGetPartitionSizeResponse).read());
2896 }
2899 Ok(())
2900 }
2901 }
2902 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2903 fidl::encoding::Encode<SysconfigGetPartitionSizeResponse, D> for (T0,)
2904 {
2905 #[inline]
2906 unsafe fn encode(
2907 self,
2908 encoder: &mut fidl::encoding::Encoder<'_, D>,
2909 offset: usize,
2910 depth: fidl::encoding::Depth,
2911 ) -> fidl::Result<()> {
2912 encoder.debug_check_bounds::<SysconfigGetPartitionSizeResponse>(offset);
2913 self.0.encode(encoder, offset + 0, depth)?;
2917 Ok(())
2918 }
2919 }
2920
2921 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2922 for SysconfigGetPartitionSizeResponse
2923 {
2924 #[inline(always)]
2925 fn new_empty() -> Self {
2926 Self { size: fidl::new_empty!(u64, D) }
2927 }
2928
2929 #[inline]
2930 unsafe fn decode(
2931 &mut self,
2932 decoder: &mut fidl::encoding::Decoder<'_, D>,
2933 offset: usize,
2934 _depth: fidl::encoding::Depth,
2935 ) -> fidl::Result<()> {
2936 decoder.debug_check_bounds::<Self>(offset);
2937 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2938 unsafe {
2941 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2942 }
2943 Ok(())
2944 }
2945 }
2946
2947 impl BootManagerQueryConfigurationStatusAndBootAttemptsResponse {
2948 #[inline(always)]
2949 fn max_ordinal_present(&self) -> u64 {
2950 if let Some(_) = self.unbootable_reason {
2951 return 3;
2952 }
2953 if let Some(_) = self.boot_attempts {
2954 return 2;
2955 }
2956 if let Some(_) = self.status {
2957 return 1;
2958 }
2959 0
2960 }
2961 }
2962
2963 impl fidl::encoding::ValueTypeMarker
2964 for BootManagerQueryConfigurationStatusAndBootAttemptsResponse
2965 {
2966 type Borrowed<'a> = &'a Self;
2967 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2968 value
2969 }
2970 }
2971
2972 unsafe impl fidl::encoding::TypeMarker
2973 for BootManagerQueryConfigurationStatusAndBootAttemptsResponse
2974 {
2975 type Owned = Self;
2976
2977 #[inline(always)]
2978 fn inline_align(_context: fidl::encoding::Context) -> usize {
2979 8
2980 }
2981
2982 #[inline(always)]
2983 fn inline_size(_context: fidl::encoding::Context) -> usize {
2984 16
2985 }
2986 }
2987
2988 unsafe impl<D: fidl::encoding::ResourceDialect>
2989 fidl::encoding::Encode<BootManagerQueryConfigurationStatusAndBootAttemptsResponse, D>
2990 for &BootManagerQueryConfigurationStatusAndBootAttemptsResponse
2991 {
2992 unsafe fn encode(
2993 self,
2994 encoder: &mut fidl::encoding::Encoder<'_, D>,
2995 offset: usize,
2996 mut depth: fidl::encoding::Depth,
2997 ) -> fidl::Result<()> {
2998 encoder
2999 .debug_check_bounds::<BootManagerQueryConfigurationStatusAndBootAttemptsResponse>(
3000 offset,
3001 );
3002 let max_ordinal: u64 = self.max_ordinal_present();
3004 encoder.write_num(max_ordinal, offset);
3005 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3006 if max_ordinal == 0 {
3008 return Ok(());
3009 }
3010 depth.increment()?;
3011 let envelope_size = 8;
3012 let bytes_len = max_ordinal as usize * envelope_size;
3013 #[allow(unused_variables)]
3014 let offset = encoder.out_of_line_offset(bytes_len);
3015 let mut _prev_end_offset: usize = 0;
3016 if 1 > max_ordinal {
3017 return Ok(());
3018 }
3019
3020 let cur_offset: usize = (1 - 1) * envelope_size;
3023
3024 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3026
3027 fidl::encoding::encode_in_envelope_optional::<ConfigurationStatus, D>(
3032 self.status
3033 .as_ref()
3034 .map(<ConfigurationStatus as fidl::encoding::ValueTypeMarker>::borrow),
3035 encoder,
3036 offset + cur_offset,
3037 depth,
3038 )?;
3039
3040 _prev_end_offset = cur_offset + envelope_size;
3041 if 2 > max_ordinal {
3042 return Ok(());
3043 }
3044
3045 let cur_offset: usize = (2 - 1) * envelope_size;
3048
3049 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3051
3052 fidl::encoding::encode_in_envelope_optional::<u8, D>(
3057 self.boot_attempts.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
3058 encoder,
3059 offset + cur_offset,
3060 depth,
3061 )?;
3062
3063 _prev_end_offset = cur_offset + envelope_size;
3064 if 3 > max_ordinal {
3065 return Ok(());
3066 }
3067
3068 let cur_offset: usize = (3 - 1) * envelope_size;
3071
3072 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3074
3075 fidl::encoding::encode_in_envelope_optional::<UnbootableReason, D>(
3080 self.unbootable_reason
3081 .as_ref()
3082 .map(<UnbootableReason as fidl::encoding::ValueTypeMarker>::borrow),
3083 encoder,
3084 offset + cur_offset,
3085 depth,
3086 )?;
3087
3088 _prev_end_offset = cur_offset + envelope_size;
3089
3090 Ok(())
3091 }
3092 }
3093
3094 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3095 for BootManagerQueryConfigurationStatusAndBootAttemptsResponse
3096 {
3097 #[inline(always)]
3098 fn new_empty() -> Self {
3099 Self::default()
3100 }
3101
3102 unsafe fn decode(
3103 &mut self,
3104 decoder: &mut fidl::encoding::Decoder<'_, D>,
3105 offset: usize,
3106 mut depth: fidl::encoding::Depth,
3107 ) -> fidl::Result<()> {
3108 decoder.debug_check_bounds::<Self>(offset);
3109 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3110 None => return Err(fidl::Error::NotNullable),
3111 Some(len) => len,
3112 };
3113 if len == 0 {
3115 return Ok(());
3116 };
3117 depth.increment()?;
3118 let envelope_size = 8;
3119 let bytes_len = len * envelope_size;
3120 let offset = decoder.out_of_line_offset(bytes_len)?;
3121 let mut _next_ordinal_to_read = 0;
3123 let mut next_offset = offset;
3124 let end_offset = offset + bytes_len;
3125 _next_ordinal_to_read += 1;
3126 if next_offset >= end_offset {
3127 return Ok(());
3128 }
3129
3130 while _next_ordinal_to_read < 1 {
3132 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3133 _next_ordinal_to_read += 1;
3134 next_offset += envelope_size;
3135 }
3136
3137 let next_out_of_line = decoder.next_out_of_line();
3138 let handles_before = decoder.remaining_handles();
3139 if let Some((inlined, num_bytes, num_handles)) =
3140 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3141 {
3142 let member_inline_size =
3143 <ConfigurationStatus as fidl::encoding::TypeMarker>::inline_size(
3144 decoder.context,
3145 );
3146 if inlined != (member_inline_size <= 4) {
3147 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3148 }
3149 let inner_offset;
3150 let mut inner_depth = depth.clone();
3151 if inlined {
3152 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3153 inner_offset = next_offset;
3154 } else {
3155 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3156 inner_depth.increment()?;
3157 }
3158 let val_ref =
3159 self.status.get_or_insert_with(|| fidl::new_empty!(ConfigurationStatus, D));
3160 fidl::decode!(ConfigurationStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
3161 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3162 {
3163 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3164 }
3165 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3166 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3167 }
3168 }
3169
3170 next_offset += envelope_size;
3171 _next_ordinal_to_read += 1;
3172 if next_offset >= end_offset {
3173 return Ok(());
3174 }
3175
3176 while _next_ordinal_to_read < 2 {
3178 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3179 _next_ordinal_to_read += 1;
3180 next_offset += envelope_size;
3181 }
3182
3183 let next_out_of_line = decoder.next_out_of_line();
3184 let handles_before = decoder.remaining_handles();
3185 if let Some((inlined, num_bytes, num_handles)) =
3186 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3187 {
3188 let member_inline_size =
3189 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3190 if inlined != (member_inline_size <= 4) {
3191 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3192 }
3193 let inner_offset;
3194 let mut inner_depth = depth.clone();
3195 if inlined {
3196 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3197 inner_offset = next_offset;
3198 } else {
3199 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3200 inner_depth.increment()?;
3201 }
3202 let val_ref = self.boot_attempts.get_or_insert_with(|| fidl::new_empty!(u8, D));
3203 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
3204 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3205 {
3206 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3207 }
3208 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3209 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3210 }
3211 }
3212
3213 next_offset += envelope_size;
3214 _next_ordinal_to_read += 1;
3215 if next_offset >= end_offset {
3216 return Ok(());
3217 }
3218
3219 while _next_ordinal_to_read < 3 {
3221 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3222 _next_ordinal_to_read += 1;
3223 next_offset += envelope_size;
3224 }
3225
3226 let next_out_of_line = decoder.next_out_of_line();
3227 let handles_before = decoder.remaining_handles();
3228 if let Some((inlined, num_bytes, num_handles)) =
3229 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3230 {
3231 let member_inline_size =
3232 <UnbootableReason as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3233 if inlined != (member_inline_size <= 4) {
3234 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3235 }
3236 let inner_offset;
3237 let mut inner_depth = depth.clone();
3238 if inlined {
3239 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3240 inner_offset = next_offset;
3241 } else {
3242 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3243 inner_depth.increment()?;
3244 }
3245 let val_ref = self
3246 .unbootable_reason
3247 .get_or_insert_with(|| fidl::new_empty!(UnbootableReason, D));
3248 fidl::decode!(UnbootableReason, D, val_ref, decoder, inner_offset, inner_depth)?;
3249 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3250 {
3251 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3252 }
3253 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3254 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3255 }
3256 }
3257
3258 next_offset += envelope_size;
3259
3260 while next_offset < end_offset {
3262 _next_ordinal_to_read += 1;
3263 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3264 next_offset += envelope_size;
3265 }
3266
3267 Ok(())
3268 }
3269 }
3270
3271 impl fidl::encoding::ValueTypeMarker for ReadResult {
3272 type Borrowed<'a> = &'a Self;
3273 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3274 value
3275 }
3276 }
3277
3278 unsafe impl fidl::encoding::TypeMarker for ReadResult {
3279 type Owned = Self;
3280
3281 #[inline(always)]
3282 fn inline_align(_context: fidl::encoding::Context) -> usize {
3283 8
3284 }
3285
3286 #[inline(always)]
3287 fn inline_size(_context: fidl::encoding::Context) -> usize {
3288 16
3289 }
3290 }
3291
3292 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReadResult, D>
3293 for &ReadResult
3294 {
3295 #[inline]
3296 unsafe fn encode(
3297 self,
3298 encoder: &mut fidl::encoding::Encoder<'_, D>,
3299 offset: usize,
3300 _depth: fidl::encoding::Depth,
3301 ) -> fidl::Result<()> {
3302 encoder.debug_check_bounds::<ReadResult>(offset);
3303 encoder.write_num::<u64>(self.ordinal(), offset);
3304 match self {
3305 ReadResult::Err(ref val) => fidl::encoding::encode_in_envelope::<i32, D>(
3306 <i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
3307 encoder,
3308 offset + 8,
3309 _depth,
3310 ),
3311 ReadResult::Eof(ref val) => fidl::encoding::encode_in_envelope::<bool, D>(
3312 <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
3313 encoder,
3314 offset + 8,
3315 _depth,
3316 ),
3317 ReadResult::Info(ref val) => fidl::encoding::encode_in_envelope::<ReadInfo, D>(
3318 <ReadInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
3319 encoder,
3320 offset + 8,
3321 _depth,
3322 ),
3323 }
3324 }
3325 }
3326
3327 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReadResult {
3328 #[inline(always)]
3329 fn new_empty() -> Self {
3330 Self::Err(fidl::new_empty!(i32, D))
3331 }
3332
3333 #[inline]
3334 unsafe fn decode(
3335 &mut self,
3336 decoder: &mut fidl::encoding::Decoder<'_, D>,
3337 offset: usize,
3338 mut depth: fidl::encoding::Depth,
3339 ) -> fidl::Result<()> {
3340 decoder.debug_check_bounds::<Self>(offset);
3341 #[allow(unused_variables)]
3342 let next_out_of_line = decoder.next_out_of_line();
3343 let handles_before = decoder.remaining_handles();
3344 let (ordinal, inlined, num_bytes, num_handles) =
3345 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
3346
3347 let member_inline_size = match ordinal {
3348 1 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3349 2 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3350 3 => <ReadInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3351 _ => return Err(fidl::Error::UnknownUnionTag),
3352 };
3353
3354 if inlined != (member_inline_size <= 4) {
3355 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3356 }
3357 let _inner_offset;
3358 if inlined {
3359 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
3360 _inner_offset = offset + 8;
3361 } else {
3362 depth.increment()?;
3363 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3364 }
3365 match ordinal {
3366 1 => {
3367 #[allow(irrefutable_let_patterns)]
3368 if let ReadResult::Err(_) = self {
3369 } else {
3371 *self = ReadResult::Err(fidl::new_empty!(i32, D));
3373 }
3374 #[allow(irrefutable_let_patterns)]
3375 if let ReadResult::Err(ref mut val) = self {
3376 fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
3377 } else {
3378 unreachable!()
3379 }
3380 }
3381 2 => {
3382 #[allow(irrefutable_let_patterns)]
3383 if let ReadResult::Eof(_) = self {
3384 } else {
3386 *self = ReadResult::Eof(fidl::new_empty!(bool, D));
3388 }
3389 #[allow(irrefutable_let_patterns)]
3390 if let ReadResult::Eof(ref mut val) = self {
3391 fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
3392 } else {
3393 unreachable!()
3394 }
3395 }
3396 3 => {
3397 #[allow(irrefutable_let_patterns)]
3398 if let ReadResult::Info(_) = self {
3399 } else {
3401 *self = ReadResult::Info(fidl::new_empty!(ReadInfo, D));
3403 }
3404 #[allow(irrefutable_let_patterns)]
3405 if let ReadResult::Info(ref mut val) = self {
3406 fidl::decode!(ReadInfo, D, val, decoder, _inner_offset, depth)?;
3407 } else {
3408 unreachable!()
3409 }
3410 }
3411 ordinal => panic!("unexpected ordinal {:?}", ordinal),
3412 }
3413 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
3414 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3415 }
3416 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3417 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3418 }
3419 Ok(())
3420 }
3421 }
3422
3423 impl fidl::encoding::ValueTypeMarker for WriteFirmwareResult {
3424 type Borrowed<'a> = &'a Self;
3425 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3426 value
3427 }
3428 }
3429
3430 unsafe impl fidl::encoding::TypeMarker for WriteFirmwareResult {
3431 type Owned = Self;
3432
3433 #[inline(always)]
3434 fn inline_align(_context: fidl::encoding::Context) -> usize {
3435 8
3436 }
3437
3438 #[inline(always)]
3439 fn inline_size(_context: fidl::encoding::Context) -> usize {
3440 16
3441 }
3442 }
3443
3444 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WriteFirmwareResult, D>
3445 for &WriteFirmwareResult
3446 {
3447 #[inline]
3448 unsafe fn encode(
3449 self,
3450 encoder: &mut fidl::encoding::Encoder<'_, D>,
3451 offset: usize,
3452 _depth: fidl::encoding::Depth,
3453 ) -> fidl::Result<()> {
3454 encoder.debug_check_bounds::<WriteFirmwareResult>(offset);
3455 encoder.write_num::<u64>(self.ordinal(), offset);
3456 match self {
3457 WriteFirmwareResult::Status(ref val) => {
3458 fidl::encoding::encode_in_envelope::<i32, D>(
3459 <i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
3460 encoder,
3461 offset + 8,
3462 _depth,
3463 )
3464 }
3465 WriteFirmwareResult::Unsupported(ref val) => {
3466 fidl::encoding::encode_in_envelope::<bool, D>(
3467 <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
3468 encoder,
3469 offset + 8,
3470 _depth,
3471 )
3472 }
3473 }
3474 }
3475 }
3476
3477 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WriteFirmwareResult {
3478 #[inline(always)]
3479 fn new_empty() -> Self {
3480 Self::Status(fidl::new_empty!(i32, D))
3481 }
3482
3483 #[inline]
3484 unsafe fn decode(
3485 &mut self,
3486 decoder: &mut fidl::encoding::Decoder<'_, D>,
3487 offset: usize,
3488 mut depth: fidl::encoding::Depth,
3489 ) -> fidl::Result<()> {
3490 decoder.debug_check_bounds::<Self>(offset);
3491 #[allow(unused_variables)]
3492 let next_out_of_line = decoder.next_out_of_line();
3493 let handles_before = decoder.remaining_handles();
3494 let (ordinal, inlined, num_bytes, num_handles) =
3495 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
3496
3497 let member_inline_size = match ordinal {
3498 1 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3499 2 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3500 _ => return Err(fidl::Error::UnknownUnionTag),
3501 };
3502
3503 if inlined != (member_inline_size <= 4) {
3504 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3505 }
3506 let _inner_offset;
3507 if inlined {
3508 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
3509 _inner_offset = offset + 8;
3510 } else {
3511 depth.increment()?;
3512 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3513 }
3514 match ordinal {
3515 1 => {
3516 #[allow(irrefutable_let_patterns)]
3517 if let WriteFirmwareResult::Status(_) = self {
3518 } else {
3520 *self = WriteFirmwareResult::Status(fidl::new_empty!(i32, D));
3522 }
3523 #[allow(irrefutable_let_patterns)]
3524 if let WriteFirmwareResult::Status(ref mut val) = self {
3525 fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
3526 } else {
3527 unreachable!()
3528 }
3529 }
3530 2 => {
3531 #[allow(irrefutable_let_patterns)]
3532 if let WriteFirmwareResult::Unsupported(_) = self {
3533 } else {
3535 *self = WriteFirmwareResult::Unsupported(fidl::new_empty!(bool, D));
3537 }
3538 #[allow(irrefutable_let_patterns)]
3539 if let WriteFirmwareResult::Unsupported(ref mut val) = self {
3540 fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
3541 } else {
3542 unreachable!()
3543 }
3544 }
3545 ordinal => panic!("unexpected ordinal {:?}", ordinal),
3546 }
3547 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
3548 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3549 }
3550 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3551 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3552 }
3553 Ok(())
3554 }
3555 }
3556}