fidl_fuchsia_paver__common/
fidl_fuchsia_paver__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![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
13/// The maximum number of times the firmware will attempt to boot into a `PENDING` configuration.
14///
15/// If the boot attempts are all exhausted without the configuration being updated to `HEALTHY`,
16/// the configuration will switch to `UNBOOTABLE` which will cause the next boot to fall back to
17/// the next usable slot.
18///
19/// `HEALTHY` and `UNBOOTABLE` configurations do not count boot attempts; it is assumed that once a
20/// device is in these states it will remain so until the configuration is manually modified.
21pub const MAX_PENDING_BOOT_ATTEMPTS: u8 = 7;
22
23/// Describes assets which may be updated. Each asset has 3 versions, each tied to a particular
24/// configuration.
25#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
26#[repr(u32)]
27pub enum Asset {
28    /// Zircon Boot Image (ZBI) containing the kernel image as well as bootfs.
29    Kernel = 1,
30    /// Metadata used for verified boot purposes.
31    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/// Describes the version of an asset.
51#[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/// Set of states configuration may be in.
77#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
78#[repr(u32)]
79pub enum ConfigurationStatus {
80    /// Bootable and health checked.
81    Healthy = 1,
82    /// Bootable but not yet marked healthy.
83    Pending = 2,
84    /// Unbootable.
85    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/// Reasons why a configuration may be marked unbootable.
106#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
107pub enum UnbootableReason {
108    /// No reason known; generally indicates that whatever code wrote the underlying metadata does
109    /// not yet support unbootable reasons.
110    None,
111    /// The configuration ran out of boot attempts without being marked `HEALTHY`.
112    NoMoreTries,
113    /// The OS set the configuration unbootable via `BootManager::SetConfigurationUnbootable`.
114    OsRequested,
115    /// Kernel verification failed.
116    VerificationFailure,
117    #[doc(hidden)]
118    __SourceBreaking { unknown_ordinal: u32 },
119}
120
121/// Pattern that matches an unknown `UnbootableReason` member.
122#[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 DataSinkWriteVolumesResponse {
306    pub status: i32,
307}
308
309impl fidl::Persistable for DataSinkWriteVolumesResponse {}
310
311#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
312#[repr(C)]
313pub struct DynamicDataSinkInitializePartitionTablesResponse {
314    pub status: i32,
315}
316
317impl fidl::Persistable for DynamicDataSinkInitializePartitionTablesResponse {}
318
319#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
320#[repr(C)]
321pub struct DynamicDataSinkWipePartitionTablesResponse {
322    pub status: i32,
323}
324
325impl fidl::Persistable for DynamicDataSinkWipePartitionTablesResponse {}
326
327#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
328pub struct PayloadStreamReadDataResponse {
329    pub result: ReadResult,
330}
331
332impl fidl::Persistable for PayloadStreamReadDataResponse {}
333
334#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
335#[repr(C)]
336pub struct PayloadStreamRegisterVmoResponse {
337    pub status: i32,
338}
339
340impl fidl::Persistable for PayloadStreamRegisterVmoResponse {}
341
342#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
343#[repr(C)]
344pub struct ReadInfo {
345    /// Offset into VMO where read data starts.
346    pub offset: u64,
347    /// Size of read data.
348    pub size: u64,
349}
350
351impl fidl::Persistable for ReadInfo {}
352
353#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
354#[repr(C)]
355pub struct SysconfigFlushResponse {
356    pub status: i32,
357}
358
359impl fidl::Persistable for SysconfigFlushResponse {}
360
361#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
362#[repr(C)]
363pub struct SysconfigWipeResponse {
364    pub status: i32,
365}
366
367impl fidl::Persistable for SysconfigWipeResponse {}
368
369#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
370#[repr(C)]
371pub struct SysconfigWriteResponse {
372    pub status: i32,
373}
374
375impl fidl::Persistable for SysconfigWriteResponse {}
376
377#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
378#[repr(C)]
379pub struct SysconfigGetPartitionSizeResponse {
380    pub size: u64,
381}
382
383impl fidl::Persistable for SysconfigGetPartitionSizeResponse {}
384
385#[derive(Clone, Debug, Default, PartialEq)]
386pub struct BootManagerQueryConfigurationStatusAndBootAttemptsResponse {
387    pub status: Option<ConfigurationStatus>,
388    pub boot_attempts: Option<u8>,
389    pub unbootable_reason: Option<UnbootableReason>,
390    #[doc(hidden)]
391    pub __source_breaking: fidl::marker::SourceBreaking,
392}
393
394impl fidl::Persistable for BootManagerQueryConfigurationStatusAndBootAttemptsResponse {}
395
396#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
397pub enum ReadResult {
398    /// Error encountered while reading data.
399    Err(i32),
400    /// End of file reached.
401    Eof(bool),
402    /// Information about location of successfully read data within pre-registered VMO.
403    Info(ReadInfo),
404}
405
406impl ReadResult {
407    #[inline]
408    pub fn ordinal(&self) -> u64 {
409        match *self {
410            Self::Err(_) => 1,
411            Self::Eof(_) => 2,
412            Self::Info(_) => 3,
413        }
414    }
415}
416
417impl fidl::Persistable for ReadResult {}
418
419#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
420pub enum WriteFirmwareResult {
421    /// The result status if a write was attempted.
422    Status(i32),
423    /// True if a write was not attempted due to unsupported firmware. This could
424    /// be either unsupported content type or unsupported A/B configuration.
425    ///
426    /// Callers must not treat this as a fatal error, but instead ignore it and
427    /// continue to update the device. This is important to be able to add new
428    /// items to an update package without breaking updates on older devices.
429    Unsupported(bool),
430}
431
432impl WriteFirmwareResult {
433    #[inline]
434    pub fn ordinal(&self) -> u64 {
435        match *self {
436            Self::Status(_) => 1,
437            Self::Unsupported(_) => 2,
438        }
439    }
440}
441
442impl fidl::Persistable for WriteFirmwareResult {}
443
444mod internal {
445    use super::*;
446    unsafe impl fidl::encoding::TypeMarker for Asset {
447        type Owned = Self;
448
449        #[inline(always)]
450        fn inline_align(_context: fidl::encoding::Context) -> usize {
451            std::mem::align_of::<u32>()
452        }
453
454        #[inline(always)]
455        fn inline_size(_context: fidl::encoding::Context) -> usize {
456            std::mem::size_of::<u32>()
457        }
458
459        #[inline(always)]
460        fn encode_is_copy() -> bool {
461            true
462        }
463
464        #[inline(always)]
465        fn decode_is_copy() -> bool {
466            false
467        }
468    }
469
470    impl fidl::encoding::ValueTypeMarker for Asset {
471        type Borrowed<'a> = Self;
472        #[inline(always)]
473        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
474            *value
475        }
476    }
477
478    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Asset {
479        #[inline]
480        unsafe fn encode(
481            self,
482            encoder: &mut fidl::encoding::Encoder<'_, D>,
483            offset: usize,
484            _depth: fidl::encoding::Depth,
485        ) -> fidl::Result<()> {
486            encoder.debug_check_bounds::<Self>(offset);
487            encoder.write_num(self.into_primitive(), offset);
488            Ok(())
489        }
490    }
491
492    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Asset {
493        #[inline(always)]
494        fn new_empty() -> Self {
495            Self::Kernel
496        }
497
498        #[inline]
499        unsafe fn decode(
500            &mut self,
501            decoder: &mut fidl::encoding::Decoder<'_, D>,
502            offset: usize,
503            _depth: fidl::encoding::Depth,
504        ) -> fidl::Result<()> {
505            decoder.debug_check_bounds::<Self>(offset);
506            let prim = decoder.read_num::<u32>(offset);
507
508            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
509            Ok(())
510        }
511    }
512    unsafe impl fidl::encoding::TypeMarker for Configuration {
513        type Owned = Self;
514
515        #[inline(always)]
516        fn inline_align(_context: fidl::encoding::Context) -> usize {
517            std::mem::align_of::<u32>()
518        }
519
520        #[inline(always)]
521        fn inline_size(_context: fidl::encoding::Context) -> usize {
522            std::mem::size_of::<u32>()
523        }
524
525        #[inline(always)]
526        fn encode_is_copy() -> bool {
527            true
528        }
529
530        #[inline(always)]
531        fn decode_is_copy() -> bool {
532            false
533        }
534    }
535
536    impl fidl::encoding::ValueTypeMarker for Configuration {
537        type Borrowed<'a> = Self;
538        #[inline(always)]
539        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
540            *value
541        }
542    }
543
544    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Configuration {
545        #[inline]
546        unsafe fn encode(
547            self,
548            encoder: &mut fidl::encoding::Encoder<'_, D>,
549            offset: usize,
550            _depth: fidl::encoding::Depth,
551        ) -> fidl::Result<()> {
552            encoder.debug_check_bounds::<Self>(offset);
553            encoder.write_num(self.into_primitive(), offset);
554            Ok(())
555        }
556    }
557
558    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Configuration {
559        #[inline(always)]
560        fn new_empty() -> Self {
561            Self::A
562        }
563
564        #[inline]
565        unsafe fn decode(
566            &mut self,
567            decoder: &mut fidl::encoding::Decoder<'_, D>,
568            offset: usize,
569            _depth: fidl::encoding::Depth,
570        ) -> fidl::Result<()> {
571            decoder.debug_check_bounds::<Self>(offset);
572            let prim = decoder.read_num::<u32>(offset);
573
574            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
575            Ok(())
576        }
577    }
578    unsafe impl fidl::encoding::TypeMarker for ConfigurationStatus {
579        type Owned = Self;
580
581        #[inline(always)]
582        fn inline_align(_context: fidl::encoding::Context) -> usize {
583            std::mem::align_of::<u32>()
584        }
585
586        #[inline(always)]
587        fn inline_size(_context: fidl::encoding::Context) -> usize {
588            std::mem::size_of::<u32>()
589        }
590
591        #[inline(always)]
592        fn encode_is_copy() -> bool {
593            true
594        }
595
596        #[inline(always)]
597        fn decode_is_copy() -> bool {
598            false
599        }
600    }
601
602    impl fidl::encoding::ValueTypeMarker for ConfigurationStatus {
603        type Borrowed<'a> = Self;
604        #[inline(always)]
605        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
606            *value
607        }
608    }
609
610    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
611        for ConfigurationStatus
612    {
613        #[inline]
614        unsafe fn encode(
615            self,
616            encoder: &mut fidl::encoding::Encoder<'_, D>,
617            offset: usize,
618            _depth: fidl::encoding::Depth,
619        ) -> fidl::Result<()> {
620            encoder.debug_check_bounds::<Self>(offset);
621            encoder.write_num(self.into_primitive(), offset);
622            Ok(())
623        }
624    }
625
626    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigurationStatus {
627        #[inline(always)]
628        fn new_empty() -> Self {
629            Self::Healthy
630        }
631
632        #[inline]
633        unsafe fn decode(
634            &mut self,
635            decoder: &mut fidl::encoding::Decoder<'_, D>,
636            offset: usize,
637            _depth: fidl::encoding::Depth,
638        ) -> fidl::Result<()> {
639            decoder.debug_check_bounds::<Self>(offset);
640            let prim = decoder.read_num::<u32>(offset);
641
642            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
643            Ok(())
644        }
645    }
646    unsafe impl fidl::encoding::TypeMarker for UnbootableReason {
647        type Owned = Self;
648
649        #[inline(always)]
650        fn inline_align(_context: fidl::encoding::Context) -> usize {
651            std::mem::align_of::<u32>()
652        }
653
654        #[inline(always)]
655        fn inline_size(_context: fidl::encoding::Context) -> usize {
656            std::mem::size_of::<u32>()
657        }
658
659        #[inline(always)]
660        fn encode_is_copy() -> bool {
661            false
662        }
663
664        #[inline(always)]
665        fn decode_is_copy() -> bool {
666            false
667        }
668    }
669
670    impl fidl::encoding::ValueTypeMarker for UnbootableReason {
671        type Borrowed<'a> = Self;
672        #[inline(always)]
673        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
674            *value
675        }
676    }
677
678    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
679        for UnbootableReason
680    {
681        #[inline]
682        unsafe fn encode(
683            self,
684            encoder: &mut fidl::encoding::Encoder<'_, D>,
685            offset: usize,
686            _depth: fidl::encoding::Depth,
687        ) -> fidl::Result<()> {
688            encoder.debug_check_bounds::<Self>(offset);
689            encoder.write_num(self.into_primitive(), offset);
690            Ok(())
691        }
692    }
693
694    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UnbootableReason {
695        #[inline(always)]
696        fn new_empty() -> Self {
697            Self::unknown()
698        }
699
700        #[inline]
701        unsafe fn decode(
702            &mut self,
703            decoder: &mut fidl::encoding::Decoder<'_, D>,
704            offset: usize,
705            _depth: fidl::encoding::Depth,
706        ) -> fidl::Result<()> {
707            decoder.debug_check_bounds::<Self>(offset);
708            let prim = decoder.read_num::<u32>(offset);
709
710            *self = Self::from_primitive_allow_unknown(prim);
711            Ok(())
712        }
713    }
714
715    impl fidl::encoding::ValueTypeMarker for BootManagerFlushResponse {
716        type Borrowed<'a> = &'a Self;
717        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
718            value
719        }
720    }
721
722    unsafe impl fidl::encoding::TypeMarker for BootManagerFlushResponse {
723        type Owned = Self;
724
725        #[inline(always)]
726        fn inline_align(_context: fidl::encoding::Context) -> usize {
727            4
728        }
729
730        #[inline(always)]
731        fn inline_size(_context: fidl::encoding::Context) -> usize {
732            4
733        }
734        #[inline(always)]
735        fn encode_is_copy() -> bool {
736            true
737        }
738
739        #[inline(always)]
740        fn decode_is_copy() -> bool {
741            true
742        }
743    }
744
745    unsafe impl<D: fidl::encoding::ResourceDialect>
746        fidl::encoding::Encode<BootManagerFlushResponse, D> for &BootManagerFlushResponse
747    {
748        #[inline]
749        unsafe fn encode(
750            self,
751            encoder: &mut fidl::encoding::Encoder<'_, D>,
752            offset: usize,
753            _depth: fidl::encoding::Depth,
754        ) -> fidl::Result<()> {
755            encoder.debug_check_bounds::<BootManagerFlushResponse>(offset);
756            unsafe {
757                // Copy the object into the buffer.
758                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
759                (buf_ptr as *mut BootManagerFlushResponse)
760                    .write_unaligned((self as *const BootManagerFlushResponse).read());
761                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
762                // done second because the memcpy will write garbage to these bytes.
763            }
764            Ok(())
765        }
766    }
767    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
768        fidl::encoding::Encode<BootManagerFlushResponse, D> for (T0,)
769    {
770        #[inline]
771        unsafe fn encode(
772            self,
773            encoder: &mut fidl::encoding::Encoder<'_, D>,
774            offset: usize,
775            depth: fidl::encoding::Depth,
776        ) -> fidl::Result<()> {
777            encoder.debug_check_bounds::<BootManagerFlushResponse>(offset);
778            // Zero out padding regions. There's no need to apply masks
779            // because the unmasked parts will be overwritten by fields.
780            // Write the fields.
781            self.0.encode(encoder, offset + 0, depth)?;
782            Ok(())
783        }
784    }
785
786    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
787        for BootManagerFlushResponse
788    {
789        #[inline(always)]
790        fn new_empty() -> Self {
791            Self { status: fidl::new_empty!(i32, D) }
792        }
793
794        #[inline]
795        unsafe fn decode(
796            &mut self,
797            decoder: &mut fidl::encoding::Decoder<'_, D>,
798            offset: usize,
799            _depth: fidl::encoding::Depth,
800        ) -> fidl::Result<()> {
801            decoder.debug_check_bounds::<Self>(offset);
802            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
803            // Verify that padding bytes are zero.
804            // Copy from the buffer into the object.
805            unsafe {
806                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
807            }
808            Ok(())
809        }
810    }
811
812    impl fidl::encoding::ValueTypeMarker for BootManagerQueryConfigurationStatusAndBootAttemptsRequest {
813        type Borrowed<'a> = &'a Self;
814        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
815            value
816        }
817    }
818
819    unsafe impl fidl::encoding::TypeMarker
820        for BootManagerQueryConfigurationStatusAndBootAttemptsRequest
821    {
822        type Owned = Self;
823
824        #[inline(always)]
825        fn inline_align(_context: fidl::encoding::Context) -> usize {
826            4
827        }
828
829        #[inline(always)]
830        fn inline_size(_context: fidl::encoding::Context) -> usize {
831            4
832        }
833    }
834
835    unsafe impl<D: fidl::encoding::ResourceDialect>
836        fidl::encoding::Encode<BootManagerQueryConfigurationStatusAndBootAttemptsRequest, D>
837        for &BootManagerQueryConfigurationStatusAndBootAttemptsRequest
838    {
839        #[inline]
840        unsafe fn encode(
841            self,
842            encoder: &mut fidl::encoding::Encoder<'_, D>,
843            offset: usize,
844            _depth: fidl::encoding::Depth,
845        ) -> fidl::Result<()> {
846            encoder
847                .debug_check_bounds::<BootManagerQueryConfigurationStatusAndBootAttemptsRequest>(
848                    offset,
849                );
850            // Delegate to tuple encoding.
851            fidl::encoding::Encode::<BootManagerQueryConfigurationStatusAndBootAttemptsRequest, D>::encode(
852                (
853                    <Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),
854                ),
855                encoder, offset, _depth
856            )
857        }
858    }
859    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
860        fidl::encoding::Encode<BootManagerQueryConfigurationStatusAndBootAttemptsRequest, D>
861        for (T0,)
862    {
863        #[inline]
864        unsafe fn encode(
865            self,
866            encoder: &mut fidl::encoding::Encoder<'_, D>,
867            offset: usize,
868            depth: fidl::encoding::Depth,
869        ) -> fidl::Result<()> {
870            encoder
871                .debug_check_bounds::<BootManagerQueryConfigurationStatusAndBootAttemptsRequest>(
872                    offset,
873                );
874            // Zero out padding regions. There's no need to apply masks
875            // because the unmasked parts will be overwritten by fields.
876            // Write the fields.
877            self.0.encode(encoder, offset + 0, depth)?;
878            Ok(())
879        }
880    }
881
882    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
883        for BootManagerQueryConfigurationStatusAndBootAttemptsRequest
884    {
885        #[inline(always)]
886        fn new_empty() -> Self {
887            Self { configuration: fidl::new_empty!(Configuration, D) }
888        }
889
890        #[inline]
891        unsafe fn decode(
892            &mut self,
893            decoder: &mut fidl::encoding::Decoder<'_, D>,
894            offset: usize,
895            _depth: fidl::encoding::Depth,
896        ) -> fidl::Result<()> {
897            decoder.debug_check_bounds::<Self>(offset);
898            // Verify that padding bytes are zero.
899            fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
900            Ok(())
901        }
902    }
903
904    impl fidl::encoding::ValueTypeMarker for BootManagerQueryConfigurationStatusRequest {
905        type Borrowed<'a> = &'a Self;
906        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
907            value
908        }
909    }
910
911    unsafe impl fidl::encoding::TypeMarker for BootManagerQueryConfigurationStatusRequest {
912        type Owned = Self;
913
914        #[inline(always)]
915        fn inline_align(_context: fidl::encoding::Context) -> usize {
916            4
917        }
918
919        #[inline(always)]
920        fn inline_size(_context: fidl::encoding::Context) -> usize {
921            4
922        }
923    }
924
925    unsafe impl<D: fidl::encoding::ResourceDialect>
926        fidl::encoding::Encode<BootManagerQueryConfigurationStatusRequest, D>
927        for &BootManagerQueryConfigurationStatusRequest
928    {
929        #[inline]
930        unsafe fn encode(
931            self,
932            encoder: &mut fidl::encoding::Encoder<'_, D>,
933            offset: usize,
934            _depth: fidl::encoding::Depth,
935        ) -> fidl::Result<()> {
936            encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusRequest>(offset);
937            // Delegate to tuple encoding.
938            fidl::encoding::Encode::<BootManagerQueryConfigurationStatusRequest, D>::encode(
939                (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
940                encoder,
941                offset,
942                _depth,
943            )
944        }
945    }
946    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
947        fidl::encoding::Encode<BootManagerQueryConfigurationStatusRequest, D> for (T0,)
948    {
949        #[inline]
950        unsafe fn encode(
951            self,
952            encoder: &mut fidl::encoding::Encoder<'_, D>,
953            offset: usize,
954            depth: fidl::encoding::Depth,
955        ) -> fidl::Result<()> {
956            encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusRequest>(offset);
957            // Zero out padding regions. There's no need to apply masks
958            // because the unmasked parts will be overwritten by fields.
959            // Write the fields.
960            self.0.encode(encoder, offset + 0, depth)?;
961            Ok(())
962        }
963    }
964
965    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
966        for BootManagerQueryConfigurationStatusRequest
967    {
968        #[inline(always)]
969        fn new_empty() -> Self {
970            Self { configuration: fidl::new_empty!(Configuration, D) }
971        }
972
973        #[inline]
974        unsafe fn decode(
975            &mut self,
976            decoder: &mut fidl::encoding::Decoder<'_, D>,
977            offset: usize,
978            _depth: fidl::encoding::Depth,
979        ) -> fidl::Result<()> {
980            decoder.debug_check_bounds::<Self>(offset);
981            // Verify that padding bytes are zero.
982            fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
983            Ok(())
984        }
985    }
986
987    impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationActiveRequest {
988        type Borrowed<'a> = &'a Self;
989        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
990            value
991        }
992    }
993
994    unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationActiveRequest {
995        type Owned = Self;
996
997        #[inline(always)]
998        fn inline_align(_context: fidl::encoding::Context) -> usize {
999            4
1000        }
1001
1002        #[inline(always)]
1003        fn inline_size(_context: fidl::encoding::Context) -> usize {
1004            4
1005        }
1006    }
1007
1008    unsafe impl<D: fidl::encoding::ResourceDialect>
1009        fidl::encoding::Encode<BootManagerSetConfigurationActiveRequest, D>
1010        for &BootManagerSetConfigurationActiveRequest
1011    {
1012        #[inline]
1013        unsafe fn encode(
1014            self,
1015            encoder: &mut fidl::encoding::Encoder<'_, D>,
1016            offset: usize,
1017            _depth: fidl::encoding::Depth,
1018        ) -> fidl::Result<()> {
1019            encoder.debug_check_bounds::<BootManagerSetConfigurationActiveRequest>(offset);
1020            // Delegate to tuple encoding.
1021            fidl::encoding::Encode::<BootManagerSetConfigurationActiveRequest, D>::encode(
1022                (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
1023                encoder,
1024                offset,
1025                _depth,
1026            )
1027        }
1028    }
1029    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
1030        fidl::encoding::Encode<BootManagerSetConfigurationActiveRequest, D> for (T0,)
1031    {
1032        #[inline]
1033        unsafe fn encode(
1034            self,
1035            encoder: &mut fidl::encoding::Encoder<'_, D>,
1036            offset: usize,
1037            depth: fidl::encoding::Depth,
1038        ) -> fidl::Result<()> {
1039            encoder.debug_check_bounds::<BootManagerSetConfigurationActiveRequest>(offset);
1040            // Zero out padding regions. There's no need to apply masks
1041            // because the unmasked parts will be overwritten by fields.
1042            // Write the fields.
1043            self.0.encode(encoder, offset + 0, depth)?;
1044            Ok(())
1045        }
1046    }
1047
1048    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1049        for BootManagerSetConfigurationActiveRequest
1050    {
1051        #[inline(always)]
1052        fn new_empty() -> Self {
1053            Self { configuration: fidl::new_empty!(Configuration, D) }
1054        }
1055
1056        #[inline]
1057        unsafe fn decode(
1058            &mut self,
1059            decoder: &mut fidl::encoding::Decoder<'_, D>,
1060            offset: usize,
1061            _depth: fidl::encoding::Depth,
1062        ) -> fidl::Result<()> {
1063            decoder.debug_check_bounds::<Self>(offset);
1064            // Verify that padding bytes are zero.
1065            fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
1066            Ok(())
1067        }
1068    }
1069
1070    impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationActiveResponse {
1071        type Borrowed<'a> = &'a Self;
1072        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1073            value
1074        }
1075    }
1076
1077    unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationActiveResponse {
1078        type Owned = Self;
1079
1080        #[inline(always)]
1081        fn inline_align(_context: fidl::encoding::Context) -> usize {
1082            4
1083        }
1084
1085        #[inline(always)]
1086        fn inline_size(_context: fidl::encoding::Context) -> usize {
1087            4
1088        }
1089        #[inline(always)]
1090        fn encode_is_copy() -> bool {
1091            true
1092        }
1093
1094        #[inline(always)]
1095        fn decode_is_copy() -> bool {
1096            true
1097        }
1098    }
1099
1100    unsafe impl<D: fidl::encoding::ResourceDialect>
1101        fidl::encoding::Encode<BootManagerSetConfigurationActiveResponse, D>
1102        for &BootManagerSetConfigurationActiveResponse
1103    {
1104        #[inline]
1105        unsafe fn encode(
1106            self,
1107            encoder: &mut fidl::encoding::Encoder<'_, D>,
1108            offset: usize,
1109            _depth: fidl::encoding::Depth,
1110        ) -> fidl::Result<()> {
1111            encoder.debug_check_bounds::<BootManagerSetConfigurationActiveResponse>(offset);
1112            unsafe {
1113                // Copy the object into the buffer.
1114                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1115                (buf_ptr as *mut BootManagerSetConfigurationActiveResponse).write_unaligned(
1116                    (self as *const BootManagerSetConfigurationActiveResponse).read(),
1117                );
1118                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1119                // done second because the memcpy will write garbage to these bytes.
1120            }
1121            Ok(())
1122        }
1123    }
1124    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1125        fidl::encoding::Encode<BootManagerSetConfigurationActiveResponse, D> for (T0,)
1126    {
1127        #[inline]
1128        unsafe fn encode(
1129            self,
1130            encoder: &mut fidl::encoding::Encoder<'_, D>,
1131            offset: usize,
1132            depth: fidl::encoding::Depth,
1133        ) -> fidl::Result<()> {
1134            encoder.debug_check_bounds::<BootManagerSetConfigurationActiveResponse>(offset);
1135            // Zero out padding regions. There's no need to apply masks
1136            // because the unmasked parts will be overwritten by fields.
1137            // Write the fields.
1138            self.0.encode(encoder, offset + 0, depth)?;
1139            Ok(())
1140        }
1141    }
1142
1143    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1144        for BootManagerSetConfigurationActiveResponse
1145    {
1146        #[inline(always)]
1147        fn new_empty() -> Self {
1148            Self { status: fidl::new_empty!(i32, D) }
1149        }
1150
1151        #[inline]
1152        unsafe fn decode(
1153            &mut self,
1154            decoder: &mut fidl::encoding::Decoder<'_, D>,
1155            offset: usize,
1156            _depth: fidl::encoding::Depth,
1157        ) -> fidl::Result<()> {
1158            decoder.debug_check_bounds::<Self>(offset);
1159            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1160            // Verify that padding bytes are zero.
1161            // Copy from the buffer into the object.
1162            unsafe {
1163                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1164            }
1165            Ok(())
1166        }
1167    }
1168
1169    impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationHealthyRequest {
1170        type Borrowed<'a> = &'a Self;
1171        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1172            value
1173        }
1174    }
1175
1176    unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationHealthyRequest {
1177        type Owned = Self;
1178
1179        #[inline(always)]
1180        fn inline_align(_context: fidl::encoding::Context) -> usize {
1181            4
1182        }
1183
1184        #[inline(always)]
1185        fn inline_size(_context: fidl::encoding::Context) -> usize {
1186            4
1187        }
1188    }
1189
1190    unsafe impl<D: fidl::encoding::ResourceDialect>
1191        fidl::encoding::Encode<BootManagerSetConfigurationHealthyRequest, D>
1192        for &BootManagerSetConfigurationHealthyRequest
1193    {
1194        #[inline]
1195        unsafe fn encode(
1196            self,
1197            encoder: &mut fidl::encoding::Encoder<'_, D>,
1198            offset: usize,
1199            _depth: fidl::encoding::Depth,
1200        ) -> fidl::Result<()> {
1201            encoder.debug_check_bounds::<BootManagerSetConfigurationHealthyRequest>(offset);
1202            // Delegate to tuple encoding.
1203            fidl::encoding::Encode::<BootManagerSetConfigurationHealthyRequest, D>::encode(
1204                (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
1205                encoder,
1206                offset,
1207                _depth,
1208            )
1209        }
1210    }
1211    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
1212        fidl::encoding::Encode<BootManagerSetConfigurationHealthyRequest, D> for (T0,)
1213    {
1214        #[inline]
1215        unsafe fn encode(
1216            self,
1217            encoder: &mut fidl::encoding::Encoder<'_, D>,
1218            offset: usize,
1219            depth: fidl::encoding::Depth,
1220        ) -> fidl::Result<()> {
1221            encoder.debug_check_bounds::<BootManagerSetConfigurationHealthyRequest>(offset);
1222            // Zero out padding regions. There's no need to apply masks
1223            // because the unmasked parts will be overwritten by fields.
1224            // Write the fields.
1225            self.0.encode(encoder, offset + 0, depth)?;
1226            Ok(())
1227        }
1228    }
1229
1230    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1231        for BootManagerSetConfigurationHealthyRequest
1232    {
1233        #[inline(always)]
1234        fn new_empty() -> Self {
1235            Self { configuration: fidl::new_empty!(Configuration, D) }
1236        }
1237
1238        #[inline]
1239        unsafe fn decode(
1240            &mut self,
1241            decoder: &mut fidl::encoding::Decoder<'_, D>,
1242            offset: usize,
1243            _depth: fidl::encoding::Depth,
1244        ) -> fidl::Result<()> {
1245            decoder.debug_check_bounds::<Self>(offset);
1246            // Verify that padding bytes are zero.
1247            fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
1248            Ok(())
1249        }
1250    }
1251
1252    impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationHealthyResponse {
1253        type Borrowed<'a> = &'a Self;
1254        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1255            value
1256        }
1257    }
1258
1259    unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationHealthyResponse {
1260        type Owned = Self;
1261
1262        #[inline(always)]
1263        fn inline_align(_context: fidl::encoding::Context) -> usize {
1264            4
1265        }
1266
1267        #[inline(always)]
1268        fn inline_size(_context: fidl::encoding::Context) -> usize {
1269            4
1270        }
1271        #[inline(always)]
1272        fn encode_is_copy() -> bool {
1273            true
1274        }
1275
1276        #[inline(always)]
1277        fn decode_is_copy() -> bool {
1278            true
1279        }
1280    }
1281
1282    unsafe impl<D: fidl::encoding::ResourceDialect>
1283        fidl::encoding::Encode<BootManagerSetConfigurationHealthyResponse, D>
1284        for &BootManagerSetConfigurationHealthyResponse
1285    {
1286        #[inline]
1287        unsafe fn encode(
1288            self,
1289            encoder: &mut fidl::encoding::Encoder<'_, D>,
1290            offset: usize,
1291            _depth: fidl::encoding::Depth,
1292        ) -> fidl::Result<()> {
1293            encoder.debug_check_bounds::<BootManagerSetConfigurationHealthyResponse>(offset);
1294            unsafe {
1295                // Copy the object into the buffer.
1296                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1297                (buf_ptr as *mut BootManagerSetConfigurationHealthyResponse).write_unaligned(
1298                    (self as *const BootManagerSetConfigurationHealthyResponse).read(),
1299                );
1300                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1301                // done second because the memcpy will write garbage to these bytes.
1302            }
1303            Ok(())
1304        }
1305    }
1306    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1307        fidl::encoding::Encode<BootManagerSetConfigurationHealthyResponse, D> for (T0,)
1308    {
1309        #[inline]
1310        unsafe fn encode(
1311            self,
1312            encoder: &mut fidl::encoding::Encoder<'_, D>,
1313            offset: usize,
1314            depth: fidl::encoding::Depth,
1315        ) -> fidl::Result<()> {
1316            encoder.debug_check_bounds::<BootManagerSetConfigurationHealthyResponse>(offset);
1317            // Zero out padding regions. There's no need to apply masks
1318            // because the unmasked parts will be overwritten by fields.
1319            // Write the fields.
1320            self.0.encode(encoder, offset + 0, depth)?;
1321            Ok(())
1322        }
1323    }
1324
1325    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1326        for BootManagerSetConfigurationHealthyResponse
1327    {
1328        #[inline(always)]
1329        fn new_empty() -> Self {
1330            Self { status: fidl::new_empty!(i32, D) }
1331        }
1332
1333        #[inline]
1334        unsafe fn decode(
1335            &mut self,
1336            decoder: &mut fidl::encoding::Decoder<'_, D>,
1337            offset: usize,
1338            _depth: fidl::encoding::Depth,
1339        ) -> fidl::Result<()> {
1340            decoder.debug_check_bounds::<Self>(offset);
1341            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1342            // Verify that padding bytes are zero.
1343            // Copy from the buffer into the object.
1344            unsafe {
1345                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1346            }
1347            Ok(())
1348        }
1349    }
1350
1351    impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationUnbootableRequest {
1352        type Borrowed<'a> = &'a Self;
1353        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1354            value
1355        }
1356    }
1357
1358    unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationUnbootableRequest {
1359        type Owned = Self;
1360
1361        #[inline(always)]
1362        fn inline_align(_context: fidl::encoding::Context) -> usize {
1363            4
1364        }
1365
1366        #[inline(always)]
1367        fn inline_size(_context: fidl::encoding::Context) -> usize {
1368            4
1369        }
1370    }
1371
1372    unsafe impl<D: fidl::encoding::ResourceDialect>
1373        fidl::encoding::Encode<BootManagerSetConfigurationUnbootableRequest, D>
1374        for &BootManagerSetConfigurationUnbootableRequest
1375    {
1376        #[inline]
1377        unsafe fn encode(
1378            self,
1379            encoder: &mut fidl::encoding::Encoder<'_, D>,
1380            offset: usize,
1381            _depth: fidl::encoding::Depth,
1382        ) -> fidl::Result<()> {
1383            encoder.debug_check_bounds::<BootManagerSetConfigurationUnbootableRequest>(offset);
1384            // Delegate to tuple encoding.
1385            fidl::encoding::Encode::<BootManagerSetConfigurationUnbootableRequest, D>::encode(
1386                (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
1387                encoder,
1388                offset,
1389                _depth,
1390            )
1391        }
1392    }
1393    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
1394        fidl::encoding::Encode<BootManagerSetConfigurationUnbootableRequest, D> for (T0,)
1395    {
1396        #[inline]
1397        unsafe fn encode(
1398            self,
1399            encoder: &mut fidl::encoding::Encoder<'_, D>,
1400            offset: usize,
1401            depth: fidl::encoding::Depth,
1402        ) -> fidl::Result<()> {
1403            encoder.debug_check_bounds::<BootManagerSetConfigurationUnbootableRequest>(offset);
1404            // Zero out padding regions. There's no need to apply masks
1405            // because the unmasked parts will be overwritten by fields.
1406            // Write the fields.
1407            self.0.encode(encoder, offset + 0, depth)?;
1408            Ok(())
1409        }
1410    }
1411
1412    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1413        for BootManagerSetConfigurationUnbootableRequest
1414    {
1415        #[inline(always)]
1416        fn new_empty() -> Self {
1417            Self { configuration: fidl::new_empty!(Configuration, D) }
1418        }
1419
1420        #[inline]
1421        unsafe fn decode(
1422            &mut self,
1423            decoder: &mut fidl::encoding::Decoder<'_, D>,
1424            offset: usize,
1425            _depth: fidl::encoding::Depth,
1426        ) -> fidl::Result<()> {
1427            decoder.debug_check_bounds::<Self>(offset);
1428            // Verify that padding bytes are zero.
1429            fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
1430            Ok(())
1431        }
1432    }
1433
1434    impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationUnbootableResponse {
1435        type Borrowed<'a> = &'a Self;
1436        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1437            value
1438        }
1439    }
1440
1441    unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationUnbootableResponse {
1442        type Owned = Self;
1443
1444        #[inline(always)]
1445        fn inline_align(_context: fidl::encoding::Context) -> usize {
1446            4
1447        }
1448
1449        #[inline(always)]
1450        fn inline_size(_context: fidl::encoding::Context) -> usize {
1451            4
1452        }
1453        #[inline(always)]
1454        fn encode_is_copy() -> bool {
1455            true
1456        }
1457
1458        #[inline(always)]
1459        fn decode_is_copy() -> bool {
1460            true
1461        }
1462    }
1463
1464    unsafe impl<D: fidl::encoding::ResourceDialect>
1465        fidl::encoding::Encode<BootManagerSetConfigurationUnbootableResponse, D>
1466        for &BootManagerSetConfigurationUnbootableResponse
1467    {
1468        #[inline]
1469        unsafe fn encode(
1470            self,
1471            encoder: &mut fidl::encoding::Encoder<'_, D>,
1472            offset: usize,
1473            _depth: fidl::encoding::Depth,
1474        ) -> fidl::Result<()> {
1475            encoder.debug_check_bounds::<BootManagerSetConfigurationUnbootableResponse>(offset);
1476            unsafe {
1477                // Copy the object into the buffer.
1478                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1479                (buf_ptr as *mut BootManagerSetConfigurationUnbootableResponse).write_unaligned(
1480                    (self as *const BootManagerSetConfigurationUnbootableResponse).read(),
1481                );
1482                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1483                // done second because the memcpy will write garbage to these bytes.
1484            }
1485            Ok(())
1486        }
1487    }
1488    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1489        fidl::encoding::Encode<BootManagerSetConfigurationUnbootableResponse, D> for (T0,)
1490    {
1491        #[inline]
1492        unsafe fn encode(
1493            self,
1494            encoder: &mut fidl::encoding::Encoder<'_, D>,
1495            offset: usize,
1496            depth: fidl::encoding::Depth,
1497        ) -> fidl::Result<()> {
1498            encoder.debug_check_bounds::<BootManagerSetConfigurationUnbootableResponse>(offset);
1499            // Zero out padding regions. There's no need to apply masks
1500            // because the unmasked parts will be overwritten by fields.
1501            // Write the fields.
1502            self.0.encode(encoder, offset + 0, depth)?;
1503            Ok(())
1504        }
1505    }
1506
1507    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1508        for BootManagerSetConfigurationUnbootableResponse
1509    {
1510        #[inline(always)]
1511        fn new_empty() -> Self {
1512            Self { status: fidl::new_empty!(i32, D) }
1513        }
1514
1515        #[inline]
1516        unsafe fn decode(
1517            &mut self,
1518            decoder: &mut fidl::encoding::Decoder<'_, D>,
1519            offset: usize,
1520            _depth: fidl::encoding::Depth,
1521        ) -> fidl::Result<()> {
1522            decoder.debug_check_bounds::<Self>(offset);
1523            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1524            // Verify that padding bytes are zero.
1525            // Copy from the buffer into the object.
1526            unsafe {
1527                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1528            }
1529            Ok(())
1530        }
1531    }
1532
1533    impl fidl::encoding::ValueTypeMarker for BootManagerQueryActiveConfigurationResponse {
1534        type Borrowed<'a> = &'a Self;
1535        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1536            value
1537        }
1538    }
1539
1540    unsafe impl fidl::encoding::TypeMarker for BootManagerQueryActiveConfigurationResponse {
1541        type Owned = Self;
1542
1543        #[inline(always)]
1544        fn inline_align(_context: fidl::encoding::Context) -> usize {
1545            4
1546        }
1547
1548        #[inline(always)]
1549        fn inline_size(_context: fidl::encoding::Context) -> usize {
1550            4
1551        }
1552    }
1553
1554    unsafe impl<D: fidl::encoding::ResourceDialect>
1555        fidl::encoding::Encode<BootManagerQueryActiveConfigurationResponse, D>
1556        for &BootManagerQueryActiveConfigurationResponse
1557    {
1558        #[inline]
1559        unsafe fn encode(
1560            self,
1561            encoder: &mut fidl::encoding::Encoder<'_, D>,
1562            offset: usize,
1563            _depth: fidl::encoding::Depth,
1564        ) -> fidl::Result<()> {
1565            encoder.debug_check_bounds::<BootManagerQueryActiveConfigurationResponse>(offset);
1566            // Delegate to tuple encoding.
1567            fidl::encoding::Encode::<BootManagerQueryActiveConfigurationResponse, D>::encode(
1568                (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
1569                encoder,
1570                offset,
1571                _depth,
1572            )
1573        }
1574    }
1575    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
1576        fidl::encoding::Encode<BootManagerQueryActiveConfigurationResponse, D> for (T0,)
1577    {
1578        #[inline]
1579        unsafe fn encode(
1580            self,
1581            encoder: &mut fidl::encoding::Encoder<'_, D>,
1582            offset: usize,
1583            depth: fidl::encoding::Depth,
1584        ) -> fidl::Result<()> {
1585            encoder.debug_check_bounds::<BootManagerQueryActiveConfigurationResponse>(offset);
1586            // Zero out padding regions. There's no need to apply masks
1587            // because the unmasked parts will be overwritten by fields.
1588            // Write the fields.
1589            self.0.encode(encoder, offset + 0, depth)?;
1590            Ok(())
1591        }
1592    }
1593
1594    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1595        for BootManagerQueryActiveConfigurationResponse
1596    {
1597        #[inline(always)]
1598        fn new_empty() -> Self {
1599            Self { configuration: fidl::new_empty!(Configuration, D) }
1600        }
1601
1602        #[inline]
1603        unsafe fn decode(
1604            &mut self,
1605            decoder: &mut fidl::encoding::Decoder<'_, D>,
1606            offset: usize,
1607            _depth: fidl::encoding::Depth,
1608        ) -> fidl::Result<()> {
1609            decoder.debug_check_bounds::<Self>(offset);
1610            // Verify that padding bytes are zero.
1611            fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
1612            Ok(())
1613        }
1614    }
1615
1616    impl fidl::encoding::ValueTypeMarker for BootManagerQueryConfigurationLastSetActiveResponse {
1617        type Borrowed<'a> = &'a Self;
1618        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1619            value
1620        }
1621    }
1622
1623    unsafe impl fidl::encoding::TypeMarker for BootManagerQueryConfigurationLastSetActiveResponse {
1624        type Owned = Self;
1625
1626        #[inline(always)]
1627        fn inline_align(_context: fidl::encoding::Context) -> usize {
1628            4
1629        }
1630
1631        #[inline(always)]
1632        fn inline_size(_context: fidl::encoding::Context) -> usize {
1633            4
1634        }
1635    }
1636
1637    unsafe impl<D: fidl::encoding::ResourceDialect>
1638        fidl::encoding::Encode<BootManagerQueryConfigurationLastSetActiveResponse, D>
1639        for &BootManagerQueryConfigurationLastSetActiveResponse
1640    {
1641        #[inline]
1642        unsafe fn encode(
1643            self,
1644            encoder: &mut fidl::encoding::Encoder<'_, D>,
1645            offset: usize,
1646            _depth: fidl::encoding::Depth,
1647        ) -> fidl::Result<()> {
1648            encoder
1649                .debug_check_bounds::<BootManagerQueryConfigurationLastSetActiveResponse>(offset);
1650            // Delegate to tuple encoding.
1651            fidl::encoding::Encode::<BootManagerQueryConfigurationLastSetActiveResponse, D>::encode(
1652                (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
1653                encoder,
1654                offset,
1655                _depth,
1656            )
1657        }
1658    }
1659    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
1660        fidl::encoding::Encode<BootManagerQueryConfigurationLastSetActiveResponse, D> for (T0,)
1661    {
1662        #[inline]
1663        unsafe fn encode(
1664            self,
1665            encoder: &mut fidl::encoding::Encoder<'_, D>,
1666            offset: usize,
1667            depth: fidl::encoding::Depth,
1668        ) -> fidl::Result<()> {
1669            encoder
1670                .debug_check_bounds::<BootManagerQueryConfigurationLastSetActiveResponse>(offset);
1671            // Zero out padding regions. There's no need to apply masks
1672            // because the unmasked parts will be overwritten by fields.
1673            // Write the fields.
1674            self.0.encode(encoder, offset + 0, depth)?;
1675            Ok(())
1676        }
1677    }
1678
1679    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1680        for BootManagerQueryConfigurationLastSetActiveResponse
1681    {
1682        #[inline(always)]
1683        fn new_empty() -> Self {
1684            Self { configuration: fidl::new_empty!(Configuration, D) }
1685        }
1686
1687        #[inline]
1688        unsafe fn decode(
1689            &mut self,
1690            decoder: &mut fidl::encoding::Decoder<'_, D>,
1691            offset: usize,
1692            _depth: fidl::encoding::Depth,
1693        ) -> fidl::Result<()> {
1694            decoder.debug_check_bounds::<Self>(offset);
1695            // Verify that padding bytes are zero.
1696            fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
1697            Ok(())
1698        }
1699    }
1700
1701    impl fidl::encoding::ValueTypeMarker for BootManagerQueryConfigurationStatusResponse {
1702        type Borrowed<'a> = &'a Self;
1703        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1704            value
1705        }
1706    }
1707
1708    unsafe impl fidl::encoding::TypeMarker for BootManagerQueryConfigurationStatusResponse {
1709        type Owned = Self;
1710
1711        #[inline(always)]
1712        fn inline_align(_context: fidl::encoding::Context) -> usize {
1713            4
1714        }
1715
1716        #[inline(always)]
1717        fn inline_size(_context: fidl::encoding::Context) -> usize {
1718            4
1719        }
1720    }
1721
1722    unsafe impl<D: fidl::encoding::ResourceDialect>
1723        fidl::encoding::Encode<BootManagerQueryConfigurationStatusResponse, D>
1724        for &BootManagerQueryConfigurationStatusResponse
1725    {
1726        #[inline]
1727        unsafe fn encode(
1728            self,
1729            encoder: &mut fidl::encoding::Encoder<'_, D>,
1730            offset: usize,
1731            _depth: fidl::encoding::Depth,
1732        ) -> fidl::Result<()> {
1733            encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusResponse>(offset);
1734            // Delegate to tuple encoding.
1735            fidl::encoding::Encode::<BootManagerQueryConfigurationStatusResponse, D>::encode(
1736                (<ConfigurationStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
1737                encoder,
1738                offset,
1739                _depth,
1740            )
1741        }
1742    }
1743    unsafe impl<
1744            D: fidl::encoding::ResourceDialect,
1745            T0: fidl::encoding::Encode<ConfigurationStatus, D>,
1746        > fidl::encoding::Encode<BootManagerQueryConfigurationStatusResponse, D> for (T0,)
1747    {
1748        #[inline]
1749        unsafe fn encode(
1750            self,
1751            encoder: &mut fidl::encoding::Encoder<'_, D>,
1752            offset: usize,
1753            depth: fidl::encoding::Depth,
1754        ) -> fidl::Result<()> {
1755            encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusResponse>(offset);
1756            // Zero out padding regions. There's no need to apply masks
1757            // because the unmasked parts will be overwritten by fields.
1758            // Write the fields.
1759            self.0.encode(encoder, offset + 0, depth)?;
1760            Ok(())
1761        }
1762    }
1763
1764    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1765        for BootManagerQueryConfigurationStatusResponse
1766    {
1767        #[inline(always)]
1768        fn new_empty() -> Self {
1769            Self { status: fidl::new_empty!(ConfigurationStatus, D) }
1770        }
1771
1772        #[inline]
1773        unsafe fn decode(
1774            &mut self,
1775            decoder: &mut fidl::encoding::Decoder<'_, D>,
1776            offset: usize,
1777            _depth: fidl::encoding::Depth,
1778        ) -> fidl::Result<()> {
1779            decoder.debug_check_bounds::<Self>(offset);
1780            // Verify that padding bytes are zero.
1781            fidl::decode!(ConfigurationStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
1782            Ok(())
1783        }
1784    }
1785
1786    impl fidl::encoding::ValueTypeMarker for BootManagerQueryCurrentConfigurationResponse {
1787        type Borrowed<'a> = &'a Self;
1788        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1789            value
1790        }
1791    }
1792
1793    unsafe impl fidl::encoding::TypeMarker for BootManagerQueryCurrentConfigurationResponse {
1794        type Owned = Self;
1795
1796        #[inline(always)]
1797        fn inline_align(_context: fidl::encoding::Context) -> usize {
1798            4
1799        }
1800
1801        #[inline(always)]
1802        fn inline_size(_context: fidl::encoding::Context) -> usize {
1803            4
1804        }
1805    }
1806
1807    unsafe impl<D: fidl::encoding::ResourceDialect>
1808        fidl::encoding::Encode<BootManagerQueryCurrentConfigurationResponse, D>
1809        for &BootManagerQueryCurrentConfigurationResponse
1810    {
1811        #[inline]
1812        unsafe fn encode(
1813            self,
1814            encoder: &mut fidl::encoding::Encoder<'_, D>,
1815            offset: usize,
1816            _depth: fidl::encoding::Depth,
1817        ) -> fidl::Result<()> {
1818            encoder.debug_check_bounds::<BootManagerQueryCurrentConfigurationResponse>(offset);
1819            // Delegate to tuple encoding.
1820            fidl::encoding::Encode::<BootManagerQueryCurrentConfigurationResponse, D>::encode(
1821                (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
1822                encoder,
1823                offset,
1824                _depth,
1825            )
1826        }
1827    }
1828    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
1829        fidl::encoding::Encode<BootManagerQueryCurrentConfigurationResponse, D> for (T0,)
1830    {
1831        #[inline]
1832        unsafe fn encode(
1833            self,
1834            encoder: &mut fidl::encoding::Encoder<'_, D>,
1835            offset: usize,
1836            depth: fidl::encoding::Depth,
1837        ) -> fidl::Result<()> {
1838            encoder.debug_check_bounds::<BootManagerQueryCurrentConfigurationResponse>(offset);
1839            // Zero out padding regions. There's no need to apply masks
1840            // because the unmasked parts will be overwritten by fields.
1841            // Write the fields.
1842            self.0.encode(encoder, offset + 0, depth)?;
1843            Ok(())
1844        }
1845    }
1846
1847    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1848        for BootManagerQueryCurrentConfigurationResponse
1849    {
1850        #[inline(always)]
1851        fn new_empty() -> Self {
1852            Self { configuration: fidl::new_empty!(Configuration, D) }
1853        }
1854
1855        #[inline]
1856        unsafe fn decode(
1857            &mut self,
1858            decoder: &mut fidl::encoding::Decoder<'_, D>,
1859            offset: usize,
1860            _depth: fidl::encoding::Depth,
1861        ) -> fidl::Result<()> {
1862            decoder.debug_check_bounds::<Self>(offset);
1863            // Verify that padding bytes are zero.
1864            fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
1865            Ok(())
1866        }
1867    }
1868
1869    impl fidl::encoding::ValueTypeMarker for DataSinkFlushResponse {
1870        type Borrowed<'a> = &'a Self;
1871        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1872            value
1873        }
1874    }
1875
1876    unsafe impl fidl::encoding::TypeMarker for DataSinkFlushResponse {
1877        type Owned = Self;
1878
1879        #[inline(always)]
1880        fn inline_align(_context: fidl::encoding::Context) -> usize {
1881            4
1882        }
1883
1884        #[inline(always)]
1885        fn inline_size(_context: fidl::encoding::Context) -> usize {
1886            4
1887        }
1888        #[inline(always)]
1889        fn encode_is_copy() -> bool {
1890            true
1891        }
1892
1893        #[inline(always)]
1894        fn decode_is_copy() -> bool {
1895            true
1896        }
1897    }
1898
1899    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DataSinkFlushResponse, D>
1900        for &DataSinkFlushResponse
1901    {
1902        #[inline]
1903        unsafe fn encode(
1904            self,
1905            encoder: &mut fidl::encoding::Encoder<'_, D>,
1906            offset: usize,
1907            _depth: fidl::encoding::Depth,
1908        ) -> fidl::Result<()> {
1909            encoder.debug_check_bounds::<DataSinkFlushResponse>(offset);
1910            unsafe {
1911                // Copy the object into the buffer.
1912                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1913                (buf_ptr as *mut DataSinkFlushResponse)
1914                    .write_unaligned((self as *const DataSinkFlushResponse).read());
1915                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1916                // done second because the memcpy will write garbage to these bytes.
1917            }
1918            Ok(())
1919        }
1920    }
1921    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1922        fidl::encoding::Encode<DataSinkFlushResponse, D> for (T0,)
1923    {
1924        #[inline]
1925        unsafe fn encode(
1926            self,
1927            encoder: &mut fidl::encoding::Encoder<'_, D>,
1928            offset: usize,
1929            depth: fidl::encoding::Depth,
1930        ) -> fidl::Result<()> {
1931            encoder.debug_check_bounds::<DataSinkFlushResponse>(offset);
1932            // Zero out padding regions. There's no need to apply masks
1933            // because the unmasked parts will be overwritten by fields.
1934            // Write the fields.
1935            self.0.encode(encoder, offset + 0, depth)?;
1936            Ok(())
1937        }
1938    }
1939
1940    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DataSinkFlushResponse {
1941        #[inline(always)]
1942        fn new_empty() -> Self {
1943            Self { status: fidl::new_empty!(i32, D) }
1944        }
1945
1946        #[inline]
1947        unsafe fn decode(
1948            &mut self,
1949            decoder: &mut fidl::encoding::Decoder<'_, D>,
1950            offset: usize,
1951            _depth: fidl::encoding::Depth,
1952        ) -> fidl::Result<()> {
1953            decoder.debug_check_bounds::<Self>(offset);
1954            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1955            // Verify that padding bytes are zero.
1956            // Copy from the buffer into the object.
1957            unsafe {
1958                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1959            }
1960            Ok(())
1961        }
1962    }
1963
1964    impl fidl::encoding::ValueTypeMarker for DataSinkReadAssetRequest {
1965        type Borrowed<'a> = &'a Self;
1966        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1967            value
1968        }
1969    }
1970
1971    unsafe impl fidl::encoding::TypeMarker for DataSinkReadAssetRequest {
1972        type Owned = Self;
1973
1974        #[inline(always)]
1975        fn inline_align(_context: fidl::encoding::Context) -> usize {
1976            4
1977        }
1978
1979        #[inline(always)]
1980        fn inline_size(_context: fidl::encoding::Context) -> usize {
1981            8
1982        }
1983    }
1984
1985    unsafe impl<D: fidl::encoding::ResourceDialect>
1986        fidl::encoding::Encode<DataSinkReadAssetRequest, D> for &DataSinkReadAssetRequest
1987    {
1988        #[inline]
1989        unsafe fn encode(
1990            self,
1991            encoder: &mut fidl::encoding::Encoder<'_, D>,
1992            offset: usize,
1993            _depth: fidl::encoding::Depth,
1994        ) -> fidl::Result<()> {
1995            encoder.debug_check_bounds::<DataSinkReadAssetRequest>(offset);
1996            // Delegate to tuple encoding.
1997            fidl::encoding::Encode::<DataSinkReadAssetRequest, D>::encode(
1998                (
1999                    <Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),
2000                    <Asset as fidl::encoding::ValueTypeMarker>::borrow(&self.asset),
2001                ),
2002                encoder,
2003                offset,
2004                _depth,
2005            )
2006        }
2007    }
2008    unsafe impl<
2009            D: fidl::encoding::ResourceDialect,
2010            T0: fidl::encoding::Encode<Configuration, D>,
2011            T1: fidl::encoding::Encode<Asset, D>,
2012        > fidl::encoding::Encode<DataSinkReadAssetRequest, D> for (T0, T1)
2013    {
2014        #[inline]
2015        unsafe fn encode(
2016            self,
2017            encoder: &mut fidl::encoding::Encoder<'_, D>,
2018            offset: usize,
2019            depth: fidl::encoding::Depth,
2020        ) -> fidl::Result<()> {
2021            encoder.debug_check_bounds::<DataSinkReadAssetRequest>(offset);
2022            // Zero out padding regions. There's no need to apply masks
2023            // because the unmasked parts will be overwritten by fields.
2024            // Write the fields.
2025            self.0.encode(encoder, offset + 0, depth)?;
2026            self.1.encode(encoder, offset + 4, depth)?;
2027            Ok(())
2028        }
2029    }
2030
2031    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2032        for DataSinkReadAssetRequest
2033    {
2034        #[inline(always)]
2035        fn new_empty() -> Self {
2036            Self {
2037                configuration: fidl::new_empty!(Configuration, D),
2038                asset: fidl::new_empty!(Asset, D),
2039            }
2040        }
2041
2042        #[inline]
2043        unsafe fn decode(
2044            &mut self,
2045            decoder: &mut fidl::encoding::Decoder<'_, D>,
2046            offset: usize,
2047            _depth: fidl::encoding::Depth,
2048        ) -> fidl::Result<()> {
2049            decoder.debug_check_bounds::<Self>(offset);
2050            // Verify that padding bytes are zero.
2051            fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
2052            fidl::decode!(Asset, D, &mut self.asset, decoder, offset + 4, _depth)?;
2053            Ok(())
2054        }
2055    }
2056
2057    impl fidl::encoding::ValueTypeMarker for DataSinkWriteAssetResponse {
2058        type Borrowed<'a> = &'a Self;
2059        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2060            value
2061        }
2062    }
2063
2064    unsafe impl fidl::encoding::TypeMarker for DataSinkWriteAssetResponse {
2065        type Owned = Self;
2066
2067        #[inline(always)]
2068        fn inline_align(_context: fidl::encoding::Context) -> usize {
2069            4
2070        }
2071
2072        #[inline(always)]
2073        fn inline_size(_context: fidl::encoding::Context) -> usize {
2074            4
2075        }
2076        #[inline(always)]
2077        fn encode_is_copy() -> bool {
2078            true
2079        }
2080
2081        #[inline(always)]
2082        fn decode_is_copy() -> bool {
2083            true
2084        }
2085    }
2086
2087    unsafe impl<D: fidl::encoding::ResourceDialect>
2088        fidl::encoding::Encode<DataSinkWriteAssetResponse, D> for &DataSinkWriteAssetResponse
2089    {
2090        #[inline]
2091        unsafe fn encode(
2092            self,
2093            encoder: &mut fidl::encoding::Encoder<'_, D>,
2094            offset: usize,
2095            _depth: fidl::encoding::Depth,
2096        ) -> fidl::Result<()> {
2097            encoder.debug_check_bounds::<DataSinkWriteAssetResponse>(offset);
2098            unsafe {
2099                // Copy the object into the buffer.
2100                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2101                (buf_ptr as *mut DataSinkWriteAssetResponse)
2102                    .write_unaligned((self as *const DataSinkWriteAssetResponse).read());
2103                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2104                // done second because the memcpy will write garbage to these bytes.
2105            }
2106            Ok(())
2107        }
2108    }
2109    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2110        fidl::encoding::Encode<DataSinkWriteAssetResponse, D> for (T0,)
2111    {
2112        #[inline]
2113        unsafe fn encode(
2114            self,
2115            encoder: &mut fidl::encoding::Encoder<'_, D>,
2116            offset: usize,
2117            depth: fidl::encoding::Depth,
2118        ) -> fidl::Result<()> {
2119            encoder.debug_check_bounds::<DataSinkWriteAssetResponse>(offset);
2120            // Zero out padding regions. There's no need to apply masks
2121            // because the unmasked parts will be overwritten by fields.
2122            // Write the fields.
2123            self.0.encode(encoder, offset + 0, depth)?;
2124            Ok(())
2125        }
2126    }
2127
2128    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2129        for DataSinkWriteAssetResponse
2130    {
2131        #[inline(always)]
2132        fn new_empty() -> Self {
2133            Self { status: fidl::new_empty!(i32, D) }
2134        }
2135
2136        #[inline]
2137        unsafe fn decode(
2138            &mut self,
2139            decoder: &mut fidl::encoding::Decoder<'_, D>,
2140            offset: usize,
2141            _depth: fidl::encoding::Depth,
2142        ) -> fidl::Result<()> {
2143            decoder.debug_check_bounds::<Self>(offset);
2144            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2145            // Verify that padding bytes are zero.
2146            // Copy from the buffer into the object.
2147            unsafe {
2148                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2149            }
2150            Ok(())
2151        }
2152    }
2153
2154    impl fidl::encoding::ValueTypeMarker for DataSinkWriteFirmwareResponse {
2155        type Borrowed<'a> = &'a Self;
2156        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2157            value
2158        }
2159    }
2160
2161    unsafe impl fidl::encoding::TypeMarker for DataSinkWriteFirmwareResponse {
2162        type Owned = Self;
2163
2164        #[inline(always)]
2165        fn inline_align(_context: fidl::encoding::Context) -> usize {
2166            8
2167        }
2168
2169        #[inline(always)]
2170        fn inline_size(_context: fidl::encoding::Context) -> usize {
2171            16
2172        }
2173    }
2174
2175    unsafe impl<D: fidl::encoding::ResourceDialect>
2176        fidl::encoding::Encode<DataSinkWriteFirmwareResponse, D>
2177        for &DataSinkWriteFirmwareResponse
2178    {
2179        #[inline]
2180        unsafe fn encode(
2181            self,
2182            encoder: &mut fidl::encoding::Encoder<'_, D>,
2183            offset: usize,
2184            _depth: fidl::encoding::Depth,
2185        ) -> fidl::Result<()> {
2186            encoder.debug_check_bounds::<DataSinkWriteFirmwareResponse>(offset);
2187            // Delegate to tuple encoding.
2188            fidl::encoding::Encode::<DataSinkWriteFirmwareResponse, D>::encode(
2189                (<WriteFirmwareResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
2190                encoder,
2191                offset,
2192                _depth,
2193            )
2194        }
2195    }
2196    unsafe impl<
2197            D: fidl::encoding::ResourceDialect,
2198            T0: fidl::encoding::Encode<WriteFirmwareResult, D>,
2199        > fidl::encoding::Encode<DataSinkWriteFirmwareResponse, D> for (T0,)
2200    {
2201        #[inline]
2202        unsafe fn encode(
2203            self,
2204            encoder: &mut fidl::encoding::Encoder<'_, D>,
2205            offset: usize,
2206            depth: fidl::encoding::Depth,
2207        ) -> fidl::Result<()> {
2208            encoder.debug_check_bounds::<DataSinkWriteFirmwareResponse>(offset);
2209            // Zero out padding regions. There's no need to apply masks
2210            // because the unmasked parts will be overwritten by fields.
2211            // Write the fields.
2212            self.0.encode(encoder, offset + 0, depth)?;
2213            Ok(())
2214        }
2215    }
2216
2217    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2218        for DataSinkWriteFirmwareResponse
2219    {
2220        #[inline(always)]
2221        fn new_empty() -> Self {
2222            Self { result: fidl::new_empty!(WriteFirmwareResult, D) }
2223        }
2224
2225        #[inline]
2226        unsafe fn decode(
2227            &mut self,
2228            decoder: &mut fidl::encoding::Decoder<'_, D>,
2229            offset: usize,
2230            _depth: fidl::encoding::Depth,
2231        ) -> fidl::Result<()> {
2232            decoder.debug_check_bounds::<Self>(offset);
2233            // Verify that padding bytes are zero.
2234            fidl::decode!(WriteFirmwareResult, D, &mut self.result, decoder, offset + 0, _depth)?;
2235            Ok(())
2236        }
2237    }
2238
2239    impl fidl::encoding::ValueTypeMarker for DataSinkWriteVolumesResponse {
2240        type Borrowed<'a> = &'a Self;
2241        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2242            value
2243        }
2244    }
2245
2246    unsafe impl fidl::encoding::TypeMarker for DataSinkWriteVolumesResponse {
2247        type Owned = Self;
2248
2249        #[inline(always)]
2250        fn inline_align(_context: fidl::encoding::Context) -> usize {
2251            4
2252        }
2253
2254        #[inline(always)]
2255        fn inline_size(_context: fidl::encoding::Context) -> usize {
2256            4
2257        }
2258        #[inline(always)]
2259        fn encode_is_copy() -> bool {
2260            true
2261        }
2262
2263        #[inline(always)]
2264        fn decode_is_copy() -> bool {
2265            true
2266        }
2267    }
2268
2269    unsafe impl<D: fidl::encoding::ResourceDialect>
2270        fidl::encoding::Encode<DataSinkWriteVolumesResponse, D> for &DataSinkWriteVolumesResponse
2271    {
2272        #[inline]
2273        unsafe fn encode(
2274            self,
2275            encoder: &mut fidl::encoding::Encoder<'_, D>,
2276            offset: usize,
2277            _depth: fidl::encoding::Depth,
2278        ) -> fidl::Result<()> {
2279            encoder.debug_check_bounds::<DataSinkWriteVolumesResponse>(offset);
2280            unsafe {
2281                // Copy the object into the buffer.
2282                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2283                (buf_ptr as *mut DataSinkWriteVolumesResponse)
2284                    .write_unaligned((self as *const DataSinkWriteVolumesResponse).read());
2285                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2286                // done second because the memcpy will write garbage to these bytes.
2287            }
2288            Ok(())
2289        }
2290    }
2291    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2292        fidl::encoding::Encode<DataSinkWriteVolumesResponse, D> for (T0,)
2293    {
2294        #[inline]
2295        unsafe fn encode(
2296            self,
2297            encoder: &mut fidl::encoding::Encoder<'_, D>,
2298            offset: usize,
2299            depth: fidl::encoding::Depth,
2300        ) -> fidl::Result<()> {
2301            encoder.debug_check_bounds::<DataSinkWriteVolumesResponse>(offset);
2302            // Zero out padding regions. There's no need to apply masks
2303            // because the unmasked parts will be overwritten by fields.
2304            // Write the fields.
2305            self.0.encode(encoder, offset + 0, depth)?;
2306            Ok(())
2307        }
2308    }
2309
2310    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2311        for DataSinkWriteVolumesResponse
2312    {
2313        #[inline(always)]
2314        fn new_empty() -> Self {
2315            Self { status: fidl::new_empty!(i32, D) }
2316        }
2317
2318        #[inline]
2319        unsafe fn decode(
2320            &mut self,
2321            decoder: &mut fidl::encoding::Decoder<'_, D>,
2322            offset: usize,
2323            _depth: fidl::encoding::Depth,
2324        ) -> fidl::Result<()> {
2325            decoder.debug_check_bounds::<Self>(offset);
2326            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2327            // Verify that padding bytes are zero.
2328            // Copy from the buffer into the object.
2329            unsafe {
2330                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2331            }
2332            Ok(())
2333        }
2334    }
2335
2336    impl fidl::encoding::ValueTypeMarker for DynamicDataSinkInitializePartitionTablesResponse {
2337        type Borrowed<'a> = &'a Self;
2338        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2339            value
2340        }
2341    }
2342
2343    unsafe impl fidl::encoding::TypeMarker for DynamicDataSinkInitializePartitionTablesResponse {
2344        type Owned = Self;
2345
2346        #[inline(always)]
2347        fn inline_align(_context: fidl::encoding::Context) -> usize {
2348            4
2349        }
2350
2351        #[inline(always)]
2352        fn inline_size(_context: fidl::encoding::Context) -> usize {
2353            4
2354        }
2355        #[inline(always)]
2356        fn encode_is_copy() -> bool {
2357            true
2358        }
2359
2360        #[inline(always)]
2361        fn decode_is_copy() -> bool {
2362            true
2363        }
2364    }
2365
2366    unsafe impl<D: fidl::encoding::ResourceDialect>
2367        fidl::encoding::Encode<DynamicDataSinkInitializePartitionTablesResponse, D>
2368        for &DynamicDataSinkInitializePartitionTablesResponse
2369    {
2370        #[inline]
2371        unsafe fn encode(
2372            self,
2373            encoder: &mut fidl::encoding::Encoder<'_, D>,
2374            offset: usize,
2375            _depth: fidl::encoding::Depth,
2376        ) -> fidl::Result<()> {
2377            encoder.debug_check_bounds::<DynamicDataSinkInitializePartitionTablesResponse>(offset);
2378            unsafe {
2379                // Copy the object into the buffer.
2380                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2381                (buf_ptr as *mut DynamicDataSinkInitializePartitionTablesResponse).write_unaligned(
2382                    (self as *const DynamicDataSinkInitializePartitionTablesResponse).read(),
2383                );
2384                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2385                // done second because the memcpy will write garbage to these bytes.
2386            }
2387            Ok(())
2388        }
2389    }
2390    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2391        fidl::encoding::Encode<DynamicDataSinkInitializePartitionTablesResponse, D> for (T0,)
2392    {
2393        #[inline]
2394        unsafe fn encode(
2395            self,
2396            encoder: &mut fidl::encoding::Encoder<'_, D>,
2397            offset: usize,
2398            depth: fidl::encoding::Depth,
2399        ) -> fidl::Result<()> {
2400            encoder.debug_check_bounds::<DynamicDataSinkInitializePartitionTablesResponse>(offset);
2401            // Zero out padding regions. There's no need to apply masks
2402            // because the unmasked parts will be overwritten by fields.
2403            // Write the fields.
2404            self.0.encode(encoder, offset + 0, depth)?;
2405            Ok(())
2406        }
2407    }
2408
2409    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2410        for DynamicDataSinkInitializePartitionTablesResponse
2411    {
2412        #[inline(always)]
2413        fn new_empty() -> Self {
2414            Self { status: fidl::new_empty!(i32, D) }
2415        }
2416
2417        #[inline]
2418        unsafe fn decode(
2419            &mut self,
2420            decoder: &mut fidl::encoding::Decoder<'_, D>,
2421            offset: usize,
2422            _depth: fidl::encoding::Depth,
2423        ) -> fidl::Result<()> {
2424            decoder.debug_check_bounds::<Self>(offset);
2425            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2426            // Verify that padding bytes are zero.
2427            // Copy from the buffer into the object.
2428            unsafe {
2429                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2430            }
2431            Ok(())
2432        }
2433    }
2434
2435    impl fidl::encoding::ValueTypeMarker for DynamicDataSinkWipePartitionTablesResponse {
2436        type Borrowed<'a> = &'a Self;
2437        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2438            value
2439        }
2440    }
2441
2442    unsafe impl fidl::encoding::TypeMarker for DynamicDataSinkWipePartitionTablesResponse {
2443        type Owned = Self;
2444
2445        #[inline(always)]
2446        fn inline_align(_context: fidl::encoding::Context) -> usize {
2447            4
2448        }
2449
2450        #[inline(always)]
2451        fn inline_size(_context: fidl::encoding::Context) -> usize {
2452            4
2453        }
2454        #[inline(always)]
2455        fn encode_is_copy() -> bool {
2456            true
2457        }
2458
2459        #[inline(always)]
2460        fn decode_is_copy() -> bool {
2461            true
2462        }
2463    }
2464
2465    unsafe impl<D: fidl::encoding::ResourceDialect>
2466        fidl::encoding::Encode<DynamicDataSinkWipePartitionTablesResponse, D>
2467        for &DynamicDataSinkWipePartitionTablesResponse
2468    {
2469        #[inline]
2470        unsafe fn encode(
2471            self,
2472            encoder: &mut fidl::encoding::Encoder<'_, D>,
2473            offset: usize,
2474            _depth: fidl::encoding::Depth,
2475        ) -> fidl::Result<()> {
2476            encoder.debug_check_bounds::<DynamicDataSinkWipePartitionTablesResponse>(offset);
2477            unsafe {
2478                // Copy the object into the buffer.
2479                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2480                (buf_ptr as *mut DynamicDataSinkWipePartitionTablesResponse).write_unaligned(
2481                    (self as *const DynamicDataSinkWipePartitionTablesResponse).read(),
2482                );
2483                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2484                // done second because the memcpy will write garbage to these bytes.
2485            }
2486            Ok(())
2487        }
2488    }
2489    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2490        fidl::encoding::Encode<DynamicDataSinkWipePartitionTablesResponse, D> for (T0,)
2491    {
2492        #[inline]
2493        unsafe fn encode(
2494            self,
2495            encoder: &mut fidl::encoding::Encoder<'_, D>,
2496            offset: usize,
2497            depth: fidl::encoding::Depth,
2498        ) -> fidl::Result<()> {
2499            encoder.debug_check_bounds::<DynamicDataSinkWipePartitionTablesResponse>(offset);
2500            // Zero out padding regions. There's no need to apply masks
2501            // because the unmasked parts will be overwritten by fields.
2502            // Write the fields.
2503            self.0.encode(encoder, offset + 0, depth)?;
2504            Ok(())
2505        }
2506    }
2507
2508    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2509        for DynamicDataSinkWipePartitionTablesResponse
2510    {
2511        #[inline(always)]
2512        fn new_empty() -> Self {
2513            Self { status: fidl::new_empty!(i32, D) }
2514        }
2515
2516        #[inline]
2517        unsafe fn decode(
2518            &mut self,
2519            decoder: &mut fidl::encoding::Decoder<'_, D>,
2520            offset: usize,
2521            _depth: fidl::encoding::Depth,
2522        ) -> fidl::Result<()> {
2523            decoder.debug_check_bounds::<Self>(offset);
2524            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2525            // Verify that padding bytes are zero.
2526            // Copy from the buffer into the object.
2527            unsafe {
2528                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2529            }
2530            Ok(())
2531        }
2532    }
2533
2534    impl fidl::encoding::ValueTypeMarker for PayloadStreamReadDataResponse {
2535        type Borrowed<'a> = &'a Self;
2536        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2537            value
2538        }
2539    }
2540
2541    unsafe impl fidl::encoding::TypeMarker for PayloadStreamReadDataResponse {
2542        type Owned = Self;
2543
2544        #[inline(always)]
2545        fn inline_align(_context: fidl::encoding::Context) -> usize {
2546            8
2547        }
2548
2549        #[inline(always)]
2550        fn inline_size(_context: fidl::encoding::Context) -> usize {
2551            16
2552        }
2553    }
2554
2555    unsafe impl<D: fidl::encoding::ResourceDialect>
2556        fidl::encoding::Encode<PayloadStreamReadDataResponse, D>
2557        for &PayloadStreamReadDataResponse
2558    {
2559        #[inline]
2560        unsafe fn encode(
2561            self,
2562            encoder: &mut fidl::encoding::Encoder<'_, D>,
2563            offset: usize,
2564            _depth: fidl::encoding::Depth,
2565        ) -> fidl::Result<()> {
2566            encoder.debug_check_bounds::<PayloadStreamReadDataResponse>(offset);
2567            // Delegate to tuple encoding.
2568            fidl::encoding::Encode::<PayloadStreamReadDataResponse, D>::encode(
2569                (<ReadResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
2570                encoder,
2571                offset,
2572                _depth,
2573            )
2574        }
2575    }
2576    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ReadResult, D>>
2577        fidl::encoding::Encode<PayloadStreamReadDataResponse, D> for (T0,)
2578    {
2579        #[inline]
2580        unsafe fn encode(
2581            self,
2582            encoder: &mut fidl::encoding::Encoder<'_, D>,
2583            offset: usize,
2584            depth: fidl::encoding::Depth,
2585        ) -> fidl::Result<()> {
2586            encoder.debug_check_bounds::<PayloadStreamReadDataResponse>(offset);
2587            // Zero out padding regions. There's no need to apply masks
2588            // because the unmasked parts will be overwritten by fields.
2589            // Write the fields.
2590            self.0.encode(encoder, offset + 0, depth)?;
2591            Ok(())
2592        }
2593    }
2594
2595    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2596        for PayloadStreamReadDataResponse
2597    {
2598        #[inline(always)]
2599        fn new_empty() -> Self {
2600            Self { result: fidl::new_empty!(ReadResult, D) }
2601        }
2602
2603        #[inline]
2604        unsafe fn decode(
2605            &mut self,
2606            decoder: &mut fidl::encoding::Decoder<'_, D>,
2607            offset: usize,
2608            _depth: fidl::encoding::Depth,
2609        ) -> fidl::Result<()> {
2610            decoder.debug_check_bounds::<Self>(offset);
2611            // Verify that padding bytes are zero.
2612            fidl::decode!(ReadResult, D, &mut self.result, decoder, offset + 0, _depth)?;
2613            Ok(())
2614        }
2615    }
2616
2617    impl fidl::encoding::ValueTypeMarker for PayloadStreamRegisterVmoResponse {
2618        type Borrowed<'a> = &'a Self;
2619        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2620            value
2621        }
2622    }
2623
2624    unsafe impl fidl::encoding::TypeMarker for PayloadStreamRegisterVmoResponse {
2625        type Owned = Self;
2626
2627        #[inline(always)]
2628        fn inline_align(_context: fidl::encoding::Context) -> usize {
2629            4
2630        }
2631
2632        #[inline(always)]
2633        fn inline_size(_context: fidl::encoding::Context) -> usize {
2634            4
2635        }
2636        #[inline(always)]
2637        fn encode_is_copy() -> bool {
2638            true
2639        }
2640
2641        #[inline(always)]
2642        fn decode_is_copy() -> bool {
2643            true
2644        }
2645    }
2646
2647    unsafe impl<D: fidl::encoding::ResourceDialect>
2648        fidl::encoding::Encode<PayloadStreamRegisterVmoResponse, D>
2649        for &PayloadStreamRegisterVmoResponse
2650    {
2651        #[inline]
2652        unsafe fn encode(
2653            self,
2654            encoder: &mut fidl::encoding::Encoder<'_, D>,
2655            offset: usize,
2656            _depth: fidl::encoding::Depth,
2657        ) -> fidl::Result<()> {
2658            encoder.debug_check_bounds::<PayloadStreamRegisterVmoResponse>(offset);
2659            unsafe {
2660                // Copy the object into the buffer.
2661                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2662                (buf_ptr as *mut PayloadStreamRegisterVmoResponse)
2663                    .write_unaligned((self as *const PayloadStreamRegisterVmoResponse).read());
2664                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2665                // done second because the memcpy will write garbage to these bytes.
2666            }
2667            Ok(())
2668        }
2669    }
2670    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2671        fidl::encoding::Encode<PayloadStreamRegisterVmoResponse, D> for (T0,)
2672    {
2673        #[inline]
2674        unsafe fn encode(
2675            self,
2676            encoder: &mut fidl::encoding::Encoder<'_, D>,
2677            offset: usize,
2678            depth: fidl::encoding::Depth,
2679        ) -> fidl::Result<()> {
2680            encoder.debug_check_bounds::<PayloadStreamRegisterVmoResponse>(offset);
2681            // Zero out padding regions. There's no need to apply masks
2682            // because the unmasked parts will be overwritten by fields.
2683            // Write the fields.
2684            self.0.encode(encoder, offset + 0, depth)?;
2685            Ok(())
2686        }
2687    }
2688
2689    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2690        for PayloadStreamRegisterVmoResponse
2691    {
2692        #[inline(always)]
2693        fn new_empty() -> Self {
2694            Self { status: fidl::new_empty!(i32, D) }
2695        }
2696
2697        #[inline]
2698        unsafe fn decode(
2699            &mut self,
2700            decoder: &mut fidl::encoding::Decoder<'_, D>,
2701            offset: usize,
2702            _depth: fidl::encoding::Depth,
2703        ) -> fidl::Result<()> {
2704            decoder.debug_check_bounds::<Self>(offset);
2705            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2706            // Verify that padding bytes are zero.
2707            // Copy from the buffer into the object.
2708            unsafe {
2709                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2710            }
2711            Ok(())
2712        }
2713    }
2714
2715    impl fidl::encoding::ValueTypeMarker for ReadInfo {
2716        type Borrowed<'a> = &'a Self;
2717        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2718            value
2719        }
2720    }
2721
2722    unsafe impl fidl::encoding::TypeMarker for ReadInfo {
2723        type Owned = Self;
2724
2725        #[inline(always)]
2726        fn inline_align(_context: fidl::encoding::Context) -> usize {
2727            8
2728        }
2729
2730        #[inline(always)]
2731        fn inline_size(_context: fidl::encoding::Context) -> usize {
2732            16
2733        }
2734        #[inline(always)]
2735        fn encode_is_copy() -> bool {
2736            true
2737        }
2738
2739        #[inline(always)]
2740        fn decode_is_copy() -> bool {
2741            true
2742        }
2743    }
2744
2745    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReadInfo, D> for &ReadInfo {
2746        #[inline]
2747        unsafe fn encode(
2748            self,
2749            encoder: &mut fidl::encoding::Encoder<'_, D>,
2750            offset: usize,
2751            _depth: fidl::encoding::Depth,
2752        ) -> fidl::Result<()> {
2753            encoder.debug_check_bounds::<ReadInfo>(offset);
2754            unsafe {
2755                // Copy the object into the buffer.
2756                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2757                (buf_ptr as *mut ReadInfo).write_unaligned((self as *const ReadInfo).read());
2758                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2759                // done second because the memcpy will write garbage to these bytes.
2760            }
2761            Ok(())
2762        }
2763    }
2764    unsafe impl<
2765            D: fidl::encoding::ResourceDialect,
2766            T0: fidl::encoding::Encode<u64, D>,
2767            T1: fidl::encoding::Encode<u64, D>,
2768        > fidl::encoding::Encode<ReadInfo, D> for (T0, T1)
2769    {
2770        #[inline]
2771        unsafe fn encode(
2772            self,
2773            encoder: &mut fidl::encoding::Encoder<'_, D>,
2774            offset: usize,
2775            depth: fidl::encoding::Depth,
2776        ) -> fidl::Result<()> {
2777            encoder.debug_check_bounds::<ReadInfo>(offset);
2778            // Zero out padding regions. There's no need to apply masks
2779            // because the unmasked parts will be overwritten by fields.
2780            // Write the fields.
2781            self.0.encode(encoder, offset + 0, depth)?;
2782            self.1.encode(encoder, offset + 8, depth)?;
2783            Ok(())
2784        }
2785    }
2786
2787    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReadInfo {
2788        #[inline(always)]
2789        fn new_empty() -> Self {
2790            Self { offset: fidl::new_empty!(u64, D), size: fidl::new_empty!(u64, D) }
2791        }
2792
2793        #[inline]
2794        unsafe fn decode(
2795            &mut self,
2796            decoder: &mut fidl::encoding::Decoder<'_, D>,
2797            offset: usize,
2798            _depth: fidl::encoding::Depth,
2799        ) -> fidl::Result<()> {
2800            decoder.debug_check_bounds::<Self>(offset);
2801            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2802            // Verify that padding bytes are zero.
2803            // Copy from the buffer into the object.
2804            unsafe {
2805                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2806            }
2807            Ok(())
2808        }
2809    }
2810
2811    impl fidl::encoding::ValueTypeMarker for SysconfigFlushResponse {
2812        type Borrowed<'a> = &'a Self;
2813        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2814            value
2815        }
2816    }
2817
2818    unsafe impl fidl::encoding::TypeMarker for SysconfigFlushResponse {
2819        type Owned = Self;
2820
2821        #[inline(always)]
2822        fn inline_align(_context: fidl::encoding::Context) -> usize {
2823            4
2824        }
2825
2826        #[inline(always)]
2827        fn inline_size(_context: fidl::encoding::Context) -> usize {
2828            4
2829        }
2830        #[inline(always)]
2831        fn encode_is_copy() -> bool {
2832            true
2833        }
2834
2835        #[inline(always)]
2836        fn decode_is_copy() -> bool {
2837            true
2838        }
2839    }
2840
2841    unsafe impl<D: fidl::encoding::ResourceDialect>
2842        fidl::encoding::Encode<SysconfigFlushResponse, D> for &SysconfigFlushResponse
2843    {
2844        #[inline]
2845        unsafe fn encode(
2846            self,
2847            encoder: &mut fidl::encoding::Encoder<'_, D>,
2848            offset: usize,
2849            _depth: fidl::encoding::Depth,
2850        ) -> fidl::Result<()> {
2851            encoder.debug_check_bounds::<SysconfigFlushResponse>(offset);
2852            unsafe {
2853                // Copy the object into the buffer.
2854                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2855                (buf_ptr as *mut SysconfigFlushResponse)
2856                    .write_unaligned((self as *const SysconfigFlushResponse).read());
2857                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2858                // done second because the memcpy will write garbage to these bytes.
2859            }
2860            Ok(())
2861        }
2862    }
2863    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2864        fidl::encoding::Encode<SysconfigFlushResponse, D> for (T0,)
2865    {
2866        #[inline]
2867        unsafe fn encode(
2868            self,
2869            encoder: &mut fidl::encoding::Encoder<'_, D>,
2870            offset: usize,
2871            depth: fidl::encoding::Depth,
2872        ) -> fidl::Result<()> {
2873            encoder.debug_check_bounds::<SysconfigFlushResponse>(offset);
2874            // Zero out padding regions. There's no need to apply masks
2875            // because the unmasked parts will be overwritten by fields.
2876            // Write the fields.
2877            self.0.encode(encoder, offset + 0, depth)?;
2878            Ok(())
2879        }
2880    }
2881
2882    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2883        for SysconfigFlushResponse
2884    {
2885        #[inline(always)]
2886        fn new_empty() -> Self {
2887            Self { status: fidl::new_empty!(i32, D) }
2888        }
2889
2890        #[inline]
2891        unsafe fn decode(
2892            &mut self,
2893            decoder: &mut fidl::encoding::Decoder<'_, D>,
2894            offset: usize,
2895            _depth: fidl::encoding::Depth,
2896        ) -> fidl::Result<()> {
2897            decoder.debug_check_bounds::<Self>(offset);
2898            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2899            // Verify that padding bytes are zero.
2900            // Copy from the buffer into the object.
2901            unsafe {
2902                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2903            }
2904            Ok(())
2905        }
2906    }
2907
2908    impl fidl::encoding::ValueTypeMarker for SysconfigWipeResponse {
2909        type Borrowed<'a> = &'a Self;
2910        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2911            value
2912        }
2913    }
2914
2915    unsafe impl fidl::encoding::TypeMarker for SysconfigWipeResponse {
2916        type Owned = Self;
2917
2918        #[inline(always)]
2919        fn inline_align(_context: fidl::encoding::Context) -> usize {
2920            4
2921        }
2922
2923        #[inline(always)]
2924        fn inline_size(_context: fidl::encoding::Context) -> usize {
2925            4
2926        }
2927        #[inline(always)]
2928        fn encode_is_copy() -> bool {
2929            true
2930        }
2931
2932        #[inline(always)]
2933        fn decode_is_copy() -> bool {
2934            true
2935        }
2936    }
2937
2938    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SysconfigWipeResponse, D>
2939        for &SysconfigWipeResponse
2940    {
2941        #[inline]
2942        unsafe fn encode(
2943            self,
2944            encoder: &mut fidl::encoding::Encoder<'_, D>,
2945            offset: usize,
2946            _depth: fidl::encoding::Depth,
2947        ) -> fidl::Result<()> {
2948            encoder.debug_check_bounds::<SysconfigWipeResponse>(offset);
2949            unsafe {
2950                // Copy the object into the buffer.
2951                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2952                (buf_ptr as *mut SysconfigWipeResponse)
2953                    .write_unaligned((self as *const SysconfigWipeResponse).read());
2954                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2955                // done second because the memcpy will write garbage to these bytes.
2956            }
2957            Ok(())
2958        }
2959    }
2960    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2961        fidl::encoding::Encode<SysconfigWipeResponse, D> for (T0,)
2962    {
2963        #[inline]
2964        unsafe fn encode(
2965            self,
2966            encoder: &mut fidl::encoding::Encoder<'_, D>,
2967            offset: usize,
2968            depth: fidl::encoding::Depth,
2969        ) -> fidl::Result<()> {
2970            encoder.debug_check_bounds::<SysconfigWipeResponse>(offset);
2971            // Zero out padding regions. There's no need to apply masks
2972            // because the unmasked parts will be overwritten by fields.
2973            // Write the fields.
2974            self.0.encode(encoder, offset + 0, depth)?;
2975            Ok(())
2976        }
2977    }
2978
2979    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SysconfigWipeResponse {
2980        #[inline(always)]
2981        fn new_empty() -> Self {
2982            Self { status: fidl::new_empty!(i32, D) }
2983        }
2984
2985        #[inline]
2986        unsafe fn decode(
2987            &mut self,
2988            decoder: &mut fidl::encoding::Decoder<'_, D>,
2989            offset: usize,
2990            _depth: fidl::encoding::Depth,
2991        ) -> fidl::Result<()> {
2992            decoder.debug_check_bounds::<Self>(offset);
2993            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2994            // Verify that padding bytes are zero.
2995            // Copy from the buffer into the object.
2996            unsafe {
2997                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2998            }
2999            Ok(())
3000        }
3001    }
3002
3003    impl fidl::encoding::ValueTypeMarker for SysconfigWriteResponse {
3004        type Borrowed<'a> = &'a Self;
3005        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3006            value
3007        }
3008    }
3009
3010    unsafe impl fidl::encoding::TypeMarker for SysconfigWriteResponse {
3011        type Owned = Self;
3012
3013        #[inline(always)]
3014        fn inline_align(_context: fidl::encoding::Context) -> usize {
3015            4
3016        }
3017
3018        #[inline(always)]
3019        fn inline_size(_context: fidl::encoding::Context) -> usize {
3020            4
3021        }
3022        #[inline(always)]
3023        fn encode_is_copy() -> bool {
3024            true
3025        }
3026
3027        #[inline(always)]
3028        fn decode_is_copy() -> bool {
3029            true
3030        }
3031    }
3032
3033    unsafe impl<D: fidl::encoding::ResourceDialect>
3034        fidl::encoding::Encode<SysconfigWriteResponse, D> for &SysconfigWriteResponse
3035    {
3036        #[inline]
3037        unsafe fn encode(
3038            self,
3039            encoder: &mut fidl::encoding::Encoder<'_, D>,
3040            offset: usize,
3041            _depth: fidl::encoding::Depth,
3042        ) -> fidl::Result<()> {
3043            encoder.debug_check_bounds::<SysconfigWriteResponse>(offset);
3044            unsafe {
3045                // Copy the object into the buffer.
3046                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3047                (buf_ptr as *mut SysconfigWriteResponse)
3048                    .write_unaligned((self as *const SysconfigWriteResponse).read());
3049                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3050                // done second because the memcpy will write garbage to these bytes.
3051            }
3052            Ok(())
3053        }
3054    }
3055    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
3056        fidl::encoding::Encode<SysconfigWriteResponse, D> for (T0,)
3057    {
3058        #[inline]
3059        unsafe fn encode(
3060            self,
3061            encoder: &mut fidl::encoding::Encoder<'_, D>,
3062            offset: usize,
3063            depth: fidl::encoding::Depth,
3064        ) -> fidl::Result<()> {
3065            encoder.debug_check_bounds::<SysconfigWriteResponse>(offset);
3066            // Zero out padding regions. There's no need to apply masks
3067            // because the unmasked parts will be overwritten by fields.
3068            // Write the fields.
3069            self.0.encode(encoder, offset + 0, depth)?;
3070            Ok(())
3071        }
3072    }
3073
3074    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3075        for SysconfigWriteResponse
3076    {
3077        #[inline(always)]
3078        fn new_empty() -> Self {
3079            Self { status: fidl::new_empty!(i32, D) }
3080        }
3081
3082        #[inline]
3083        unsafe fn decode(
3084            &mut self,
3085            decoder: &mut fidl::encoding::Decoder<'_, D>,
3086            offset: usize,
3087            _depth: fidl::encoding::Depth,
3088        ) -> fidl::Result<()> {
3089            decoder.debug_check_bounds::<Self>(offset);
3090            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3091            // Verify that padding bytes are zero.
3092            // Copy from the buffer into the object.
3093            unsafe {
3094                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3095            }
3096            Ok(())
3097        }
3098    }
3099
3100    impl fidl::encoding::ValueTypeMarker for SysconfigGetPartitionSizeResponse {
3101        type Borrowed<'a> = &'a Self;
3102        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3103            value
3104        }
3105    }
3106
3107    unsafe impl fidl::encoding::TypeMarker for SysconfigGetPartitionSizeResponse {
3108        type Owned = Self;
3109
3110        #[inline(always)]
3111        fn inline_align(_context: fidl::encoding::Context) -> usize {
3112            8
3113        }
3114
3115        #[inline(always)]
3116        fn inline_size(_context: fidl::encoding::Context) -> usize {
3117            8
3118        }
3119        #[inline(always)]
3120        fn encode_is_copy() -> bool {
3121            true
3122        }
3123
3124        #[inline(always)]
3125        fn decode_is_copy() -> bool {
3126            true
3127        }
3128    }
3129
3130    unsafe impl<D: fidl::encoding::ResourceDialect>
3131        fidl::encoding::Encode<SysconfigGetPartitionSizeResponse, D>
3132        for &SysconfigGetPartitionSizeResponse
3133    {
3134        #[inline]
3135        unsafe fn encode(
3136            self,
3137            encoder: &mut fidl::encoding::Encoder<'_, D>,
3138            offset: usize,
3139            _depth: fidl::encoding::Depth,
3140        ) -> fidl::Result<()> {
3141            encoder.debug_check_bounds::<SysconfigGetPartitionSizeResponse>(offset);
3142            unsafe {
3143                // Copy the object into the buffer.
3144                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3145                (buf_ptr as *mut SysconfigGetPartitionSizeResponse)
3146                    .write_unaligned((self as *const SysconfigGetPartitionSizeResponse).read());
3147                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3148                // done second because the memcpy will write garbage to these bytes.
3149            }
3150            Ok(())
3151        }
3152    }
3153    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
3154        fidl::encoding::Encode<SysconfigGetPartitionSizeResponse, D> for (T0,)
3155    {
3156        #[inline]
3157        unsafe fn encode(
3158            self,
3159            encoder: &mut fidl::encoding::Encoder<'_, D>,
3160            offset: usize,
3161            depth: fidl::encoding::Depth,
3162        ) -> fidl::Result<()> {
3163            encoder.debug_check_bounds::<SysconfigGetPartitionSizeResponse>(offset);
3164            // Zero out padding regions. There's no need to apply masks
3165            // because the unmasked parts will be overwritten by fields.
3166            // Write the fields.
3167            self.0.encode(encoder, offset + 0, depth)?;
3168            Ok(())
3169        }
3170    }
3171
3172    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3173        for SysconfigGetPartitionSizeResponse
3174    {
3175        #[inline(always)]
3176        fn new_empty() -> Self {
3177            Self { size: fidl::new_empty!(u64, D) }
3178        }
3179
3180        #[inline]
3181        unsafe fn decode(
3182            &mut self,
3183            decoder: &mut fidl::encoding::Decoder<'_, D>,
3184            offset: usize,
3185            _depth: fidl::encoding::Depth,
3186        ) -> fidl::Result<()> {
3187            decoder.debug_check_bounds::<Self>(offset);
3188            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3189            // Verify that padding bytes are zero.
3190            // Copy from the buffer into the object.
3191            unsafe {
3192                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3193            }
3194            Ok(())
3195        }
3196    }
3197
3198    impl BootManagerQueryConfigurationStatusAndBootAttemptsResponse {
3199        #[inline(always)]
3200        fn max_ordinal_present(&self) -> u64 {
3201            if let Some(_) = self.unbootable_reason {
3202                return 3;
3203            }
3204            if let Some(_) = self.boot_attempts {
3205                return 2;
3206            }
3207            if let Some(_) = self.status {
3208                return 1;
3209            }
3210            0
3211        }
3212    }
3213
3214    impl fidl::encoding::ValueTypeMarker
3215        for BootManagerQueryConfigurationStatusAndBootAttemptsResponse
3216    {
3217        type Borrowed<'a> = &'a Self;
3218        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3219            value
3220        }
3221    }
3222
3223    unsafe impl fidl::encoding::TypeMarker
3224        for BootManagerQueryConfigurationStatusAndBootAttemptsResponse
3225    {
3226        type Owned = Self;
3227
3228        #[inline(always)]
3229        fn inline_align(_context: fidl::encoding::Context) -> usize {
3230            8
3231        }
3232
3233        #[inline(always)]
3234        fn inline_size(_context: fidl::encoding::Context) -> usize {
3235            16
3236        }
3237    }
3238
3239    unsafe impl<D: fidl::encoding::ResourceDialect>
3240        fidl::encoding::Encode<BootManagerQueryConfigurationStatusAndBootAttemptsResponse, D>
3241        for &BootManagerQueryConfigurationStatusAndBootAttemptsResponse
3242    {
3243        unsafe fn encode(
3244            self,
3245            encoder: &mut fidl::encoding::Encoder<'_, D>,
3246            offset: usize,
3247            mut depth: fidl::encoding::Depth,
3248        ) -> fidl::Result<()> {
3249            encoder
3250                .debug_check_bounds::<BootManagerQueryConfigurationStatusAndBootAttemptsResponse>(
3251                    offset,
3252                );
3253            // Vector header
3254            let max_ordinal: u64 = self.max_ordinal_present();
3255            encoder.write_num(max_ordinal, offset);
3256            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3257            // Calling encoder.out_of_line_offset(0) is not allowed.
3258            if max_ordinal == 0 {
3259                return Ok(());
3260            }
3261            depth.increment()?;
3262            let envelope_size = 8;
3263            let bytes_len = max_ordinal as usize * envelope_size;
3264            #[allow(unused_variables)]
3265            let offset = encoder.out_of_line_offset(bytes_len);
3266            let mut _prev_end_offset: usize = 0;
3267            if 1 > max_ordinal {
3268                return Ok(());
3269            }
3270
3271            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3272            // are envelope_size bytes.
3273            let cur_offset: usize = (1 - 1) * envelope_size;
3274
3275            // Zero reserved fields.
3276            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3277
3278            // Safety:
3279            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3280            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3281            //   envelope_size bytes, there is always sufficient room.
3282            fidl::encoding::encode_in_envelope_optional::<ConfigurationStatus, D>(
3283                self.status
3284                    .as_ref()
3285                    .map(<ConfigurationStatus as fidl::encoding::ValueTypeMarker>::borrow),
3286                encoder,
3287                offset + cur_offset,
3288                depth,
3289            )?;
3290
3291            _prev_end_offset = cur_offset + envelope_size;
3292            if 2 > max_ordinal {
3293                return Ok(());
3294            }
3295
3296            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3297            // are envelope_size bytes.
3298            let cur_offset: usize = (2 - 1) * envelope_size;
3299
3300            // Zero reserved fields.
3301            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3302
3303            // Safety:
3304            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3305            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3306            //   envelope_size bytes, there is always sufficient room.
3307            fidl::encoding::encode_in_envelope_optional::<u8, D>(
3308                self.boot_attempts.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
3309                encoder,
3310                offset + cur_offset,
3311                depth,
3312            )?;
3313
3314            _prev_end_offset = cur_offset + envelope_size;
3315            if 3 > max_ordinal {
3316                return Ok(());
3317            }
3318
3319            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3320            // are envelope_size bytes.
3321            let cur_offset: usize = (3 - 1) * envelope_size;
3322
3323            // Zero reserved fields.
3324            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3325
3326            // Safety:
3327            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3328            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3329            //   envelope_size bytes, there is always sufficient room.
3330            fidl::encoding::encode_in_envelope_optional::<UnbootableReason, D>(
3331                self.unbootable_reason
3332                    .as_ref()
3333                    .map(<UnbootableReason as fidl::encoding::ValueTypeMarker>::borrow),
3334                encoder,
3335                offset + cur_offset,
3336                depth,
3337            )?;
3338
3339            _prev_end_offset = cur_offset + envelope_size;
3340
3341            Ok(())
3342        }
3343    }
3344
3345    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3346        for BootManagerQueryConfigurationStatusAndBootAttemptsResponse
3347    {
3348        #[inline(always)]
3349        fn new_empty() -> Self {
3350            Self::default()
3351        }
3352
3353        unsafe fn decode(
3354            &mut self,
3355            decoder: &mut fidl::encoding::Decoder<'_, D>,
3356            offset: usize,
3357            mut depth: fidl::encoding::Depth,
3358        ) -> fidl::Result<()> {
3359            decoder.debug_check_bounds::<Self>(offset);
3360            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3361                None => return Err(fidl::Error::NotNullable),
3362                Some(len) => len,
3363            };
3364            // Calling decoder.out_of_line_offset(0) is not allowed.
3365            if len == 0 {
3366                return Ok(());
3367            };
3368            depth.increment()?;
3369            let envelope_size = 8;
3370            let bytes_len = len * envelope_size;
3371            let offset = decoder.out_of_line_offset(bytes_len)?;
3372            // Decode the envelope for each type.
3373            let mut _next_ordinal_to_read = 0;
3374            let mut next_offset = offset;
3375            let end_offset = offset + bytes_len;
3376            _next_ordinal_to_read += 1;
3377            if next_offset >= end_offset {
3378                return Ok(());
3379            }
3380
3381            // Decode unknown envelopes for gaps in ordinals.
3382            while _next_ordinal_to_read < 1 {
3383                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3384                _next_ordinal_to_read += 1;
3385                next_offset += envelope_size;
3386            }
3387
3388            let next_out_of_line = decoder.next_out_of_line();
3389            let handles_before = decoder.remaining_handles();
3390            if let Some((inlined, num_bytes, num_handles)) =
3391                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3392            {
3393                let member_inline_size =
3394                    <ConfigurationStatus as fidl::encoding::TypeMarker>::inline_size(
3395                        decoder.context,
3396                    );
3397                if inlined != (member_inline_size <= 4) {
3398                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3399                }
3400                let inner_offset;
3401                let mut inner_depth = depth.clone();
3402                if inlined {
3403                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3404                    inner_offset = next_offset;
3405                } else {
3406                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3407                    inner_depth.increment()?;
3408                }
3409                let val_ref =
3410                    self.status.get_or_insert_with(|| fidl::new_empty!(ConfigurationStatus, D));
3411                fidl::decode!(ConfigurationStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
3412                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3413                {
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            }
3420
3421            next_offset += envelope_size;
3422            _next_ordinal_to_read += 1;
3423            if next_offset >= end_offset {
3424                return Ok(());
3425            }
3426
3427            // Decode unknown envelopes for gaps in ordinals.
3428            while _next_ordinal_to_read < 2 {
3429                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3430                _next_ordinal_to_read += 1;
3431                next_offset += envelope_size;
3432            }
3433
3434            let next_out_of_line = decoder.next_out_of_line();
3435            let handles_before = decoder.remaining_handles();
3436            if let Some((inlined, num_bytes, num_handles)) =
3437                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3438            {
3439                let member_inline_size =
3440                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3441                if inlined != (member_inline_size <= 4) {
3442                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3443                }
3444                let inner_offset;
3445                let mut inner_depth = depth.clone();
3446                if inlined {
3447                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3448                    inner_offset = next_offset;
3449                } else {
3450                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3451                    inner_depth.increment()?;
3452                }
3453                let val_ref = self.boot_attempts.get_or_insert_with(|| fidl::new_empty!(u8, D));
3454                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
3455                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3456                {
3457                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3458                }
3459                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3460                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3461                }
3462            }
3463
3464            next_offset += envelope_size;
3465            _next_ordinal_to_read += 1;
3466            if next_offset >= end_offset {
3467                return Ok(());
3468            }
3469
3470            // Decode unknown envelopes for gaps in ordinals.
3471            while _next_ordinal_to_read < 3 {
3472                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3473                _next_ordinal_to_read += 1;
3474                next_offset += envelope_size;
3475            }
3476
3477            let next_out_of_line = decoder.next_out_of_line();
3478            let handles_before = decoder.remaining_handles();
3479            if let Some((inlined, num_bytes, num_handles)) =
3480                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3481            {
3482                let member_inline_size =
3483                    <UnbootableReason as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3484                if inlined != (member_inline_size <= 4) {
3485                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3486                }
3487                let inner_offset;
3488                let mut inner_depth = depth.clone();
3489                if inlined {
3490                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3491                    inner_offset = next_offset;
3492                } else {
3493                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3494                    inner_depth.increment()?;
3495                }
3496                let val_ref = self
3497                    .unbootable_reason
3498                    .get_or_insert_with(|| fidl::new_empty!(UnbootableReason, D));
3499                fidl::decode!(UnbootableReason, D, val_ref, decoder, inner_offset, inner_depth)?;
3500                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3501                {
3502                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3503                }
3504                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3505                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3506                }
3507            }
3508
3509            next_offset += envelope_size;
3510
3511            // Decode the remaining unknown envelopes.
3512            while next_offset < end_offset {
3513                _next_ordinal_to_read += 1;
3514                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3515                next_offset += envelope_size;
3516            }
3517
3518            Ok(())
3519        }
3520    }
3521
3522    impl fidl::encoding::ValueTypeMarker for ReadResult {
3523        type Borrowed<'a> = &'a Self;
3524        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3525            value
3526        }
3527    }
3528
3529    unsafe impl fidl::encoding::TypeMarker for ReadResult {
3530        type Owned = Self;
3531
3532        #[inline(always)]
3533        fn inline_align(_context: fidl::encoding::Context) -> usize {
3534            8
3535        }
3536
3537        #[inline(always)]
3538        fn inline_size(_context: fidl::encoding::Context) -> usize {
3539            16
3540        }
3541    }
3542
3543    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReadResult, D>
3544        for &ReadResult
3545    {
3546        #[inline]
3547        unsafe fn encode(
3548            self,
3549            encoder: &mut fidl::encoding::Encoder<'_, D>,
3550            offset: usize,
3551            _depth: fidl::encoding::Depth,
3552        ) -> fidl::Result<()> {
3553            encoder.debug_check_bounds::<ReadResult>(offset);
3554            encoder.write_num::<u64>(self.ordinal(), offset);
3555            match self {
3556                ReadResult::Err(ref val) => fidl::encoding::encode_in_envelope::<i32, D>(
3557                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
3558                    encoder,
3559                    offset + 8,
3560                    _depth,
3561                ),
3562                ReadResult::Eof(ref val) => fidl::encoding::encode_in_envelope::<bool, D>(
3563                    <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
3564                    encoder,
3565                    offset + 8,
3566                    _depth,
3567                ),
3568                ReadResult::Info(ref val) => fidl::encoding::encode_in_envelope::<ReadInfo, D>(
3569                    <ReadInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
3570                    encoder,
3571                    offset + 8,
3572                    _depth,
3573                ),
3574            }
3575        }
3576    }
3577
3578    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReadResult {
3579        #[inline(always)]
3580        fn new_empty() -> Self {
3581            Self::Err(fidl::new_empty!(i32, D))
3582        }
3583
3584        #[inline]
3585        unsafe fn decode(
3586            &mut self,
3587            decoder: &mut fidl::encoding::Decoder<'_, D>,
3588            offset: usize,
3589            mut depth: fidl::encoding::Depth,
3590        ) -> fidl::Result<()> {
3591            decoder.debug_check_bounds::<Self>(offset);
3592            #[allow(unused_variables)]
3593            let next_out_of_line = decoder.next_out_of_line();
3594            let handles_before = decoder.remaining_handles();
3595            let (ordinal, inlined, num_bytes, num_handles) =
3596                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
3597
3598            let member_inline_size = match ordinal {
3599                1 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3600                2 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3601                3 => <ReadInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3602                _ => return Err(fidl::Error::UnknownUnionTag),
3603            };
3604
3605            if inlined != (member_inline_size <= 4) {
3606                return Err(fidl::Error::InvalidInlineBitInEnvelope);
3607            }
3608            let _inner_offset;
3609            if inlined {
3610                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
3611                _inner_offset = offset + 8;
3612            } else {
3613                depth.increment()?;
3614                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3615            }
3616            match ordinal {
3617                1 => {
3618                    #[allow(irrefutable_let_patterns)]
3619                    if let ReadResult::Err(_) = self {
3620                        // Do nothing, read the value into the object
3621                    } else {
3622                        // Initialize `self` to the right variant
3623                        *self = ReadResult::Err(fidl::new_empty!(i32, D));
3624                    }
3625                    #[allow(irrefutable_let_patterns)]
3626                    if let ReadResult::Err(ref mut val) = self {
3627                        fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
3628                    } else {
3629                        unreachable!()
3630                    }
3631                }
3632                2 => {
3633                    #[allow(irrefutable_let_patterns)]
3634                    if let ReadResult::Eof(_) = self {
3635                        // Do nothing, read the value into the object
3636                    } else {
3637                        // Initialize `self` to the right variant
3638                        *self = ReadResult::Eof(fidl::new_empty!(bool, D));
3639                    }
3640                    #[allow(irrefutable_let_patterns)]
3641                    if let ReadResult::Eof(ref mut val) = self {
3642                        fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
3643                    } else {
3644                        unreachable!()
3645                    }
3646                }
3647                3 => {
3648                    #[allow(irrefutable_let_patterns)]
3649                    if let ReadResult::Info(_) = self {
3650                        // Do nothing, read the value into the object
3651                    } else {
3652                        // Initialize `self` to the right variant
3653                        *self = ReadResult::Info(fidl::new_empty!(ReadInfo, D));
3654                    }
3655                    #[allow(irrefutable_let_patterns)]
3656                    if let ReadResult::Info(ref mut val) = self {
3657                        fidl::decode!(ReadInfo, D, val, decoder, _inner_offset, depth)?;
3658                    } else {
3659                        unreachable!()
3660                    }
3661                }
3662                ordinal => panic!("unexpected ordinal {:?}", ordinal),
3663            }
3664            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
3665                return Err(fidl::Error::InvalidNumBytesInEnvelope);
3666            }
3667            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3668                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3669            }
3670            Ok(())
3671        }
3672    }
3673
3674    impl fidl::encoding::ValueTypeMarker for WriteFirmwareResult {
3675        type Borrowed<'a> = &'a Self;
3676        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3677            value
3678        }
3679    }
3680
3681    unsafe impl fidl::encoding::TypeMarker for WriteFirmwareResult {
3682        type Owned = Self;
3683
3684        #[inline(always)]
3685        fn inline_align(_context: fidl::encoding::Context) -> usize {
3686            8
3687        }
3688
3689        #[inline(always)]
3690        fn inline_size(_context: fidl::encoding::Context) -> usize {
3691            16
3692        }
3693    }
3694
3695    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WriteFirmwareResult, D>
3696        for &WriteFirmwareResult
3697    {
3698        #[inline]
3699        unsafe fn encode(
3700            self,
3701            encoder: &mut fidl::encoding::Encoder<'_, D>,
3702            offset: usize,
3703            _depth: fidl::encoding::Depth,
3704        ) -> fidl::Result<()> {
3705            encoder.debug_check_bounds::<WriteFirmwareResult>(offset);
3706            encoder.write_num::<u64>(self.ordinal(), offset);
3707            match self {
3708                WriteFirmwareResult::Status(ref val) => {
3709                    fidl::encoding::encode_in_envelope::<i32, D>(
3710                        <i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
3711                        encoder,
3712                        offset + 8,
3713                        _depth,
3714                    )
3715                }
3716                WriteFirmwareResult::Unsupported(ref val) => {
3717                    fidl::encoding::encode_in_envelope::<bool, D>(
3718                        <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
3719                        encoder,
3720                        offset + 8,
3721                        _depth,
3722                    )
3723                }
3724            }
3725        }
3726    }
3727
3728    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WriteFirmwareResult {
3729        #[inline(always)]
3730        fn new_empty() -> Self {
3731            Self::Status(fidl::new_empty!(i32, D))
3732        }
3733
3734        #[inline]
3735        unsafe fn decode(
3736            &mut self,
3737            decoder: &mut fidl::encoding::Decoder<'_, D>,
3738            offset: usize,
3739            mut depth: fidl::encoding::Depth,
3740        ) -> fidl::Result<()> {
3741            decoder.debug_check_bounds::<Self>(offset);
3742            #[allow(unused_variables)]
3743            let next_out_of_line = decoder.next_out_of_line();
3744            let handles_before = decoder.remaining_handles();
3745            let (ordinal, inlined, num_bytes, num_handles) =
3746                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
3747
3748            let member_inline_size = match ordinal {
3749                1 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3750                2 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3751                _ => return Err(fidl::Error::UnknownUnionTag),
3752            };
3753
3754            if inlined != (member_inline_size <= 4) {
3755                return Err(fidl::Error::InvalidInlineBitInEnvelope);
3756            }
3757            let _inner_offset;
3758            if inlined {
3759                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
3760                _inner_offset = offset + 8;
3761            } else {
3762                depth.increment()?;
3763                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3764            }
3765            match ordinal {
3766                1 => {
3767                    #[allow(irrefutable_let_patterns)]
3768                    if let WriteFirmwareResult::Status(_) = self {
3769                        // Do nothing, read the value into the object
3770                    } else {
3771                        // Initialize `self` to the right variant
3772                        *self = WriteFirmwareResult::Status(fidl::new_empty!(i32, D));
3773                    }
3774                    #[allow(irrefutable_let_patterns)]
3775                    if let WriteFirmwareResult::Status(ref mut val) = self {
3776                        fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
3777                    } else {
3778                        unreachable!()
3779                    }
3780                }
3781                2 => {
3782                    #[allow(irrefutable_let_patterns)]
3783                    if let WriteFirmwareResult::Unsupported(_) = self {
3784                        // Do nothing, read the value into the object
3785                    } else {
3786                        // Initialize `self` to the right variant
3787                        *self = WriteFirmwareResult::Unsupported(fidl::new_empty!(bool, D));
3788                    }
3789                    #[allow(irrefutable_let_patterns)]
3790                    if let WriteFirmwareResult::Unsupported(ref mut val) = self {
3791                        fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
3792                    } else {
3793                        unreachable!()
3794                    }
3795                }
3796                ordinal => panic!("unexpected ordinal {:?}", ordinal),
3797            }
3798            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
3799                return Err(fidl::Error::InvalidNumBytesInEnvelope);
3800            }
3801            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3802                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3803            }
3804            Ok(())
3805        }
3806    }
3807}