fidl_fuchsia_update_installer_common/
fidl_fuchsia_update_installer_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 type AttemptId = String;
12
13/// Why cancel failed.
14#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
15#[repr(u32)]
16pub enum CancelError {
17    /// There is no update attempt in progress.
18    NoUpdateInProgress = 1,
19    /// The update attempt has past the point that can be canceled.
20    UpdateCannotBeCanceled = 2,
21    /// The given attempt id does not match the current update attempt.
22    AttemptIdMismatch = 3,
23    /// The number of cancel requests has exceeded the limit.
24    CancelLimitExceeded = 4,
25}
26
27impl CancelError {
28    #[inline]
29    pub fn from_primitive(prim: u32) -> Option<Self> {
30        match prim {
31            1 => Some(Self::NoUpdateInProgress),
32            2 => Some(Self::UpdateCannotBeCanceled),
33            3 => Some(Self::AttemptIdMismatch),
34            4 => Some(Self::CancelLimitExceeded),
35            _ => None,
36        }
37    }
38
39    #[inline]
40    pub const fn into_primitive(self) -> u32 {
41        self as u32
42    }
43
44    #[deprecated = "Strict enums should not use `is_unknown`"]
45    #[inline]
46    pub fn is_unknown(&self) -> bool {
47        false
48    }
49}
50
51/// The set of values provided when an installation attempt fails on [`State.fetch`].
52#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
53#[repr(u32)]
54pub enum FetchFailureReason {
55    /// The fetch failed because of some other reason.
56    Internal = 0,
57    /// The fetch failed because the system does not have enough space to fetch a package.
58    OutOfSpace = 1,
59}
60
61impl FetchFailureReason {
62    #[inline]
63    pub fn from_primitive(prim: u32) -> Option<Self> {
64        match prim {
65            0 => Some(Self::Internal),
66            1 => Some(Self::OutOfSpace),
67            _ => None,
68        }
69    }
70
71    #[inline]
72    pub const fn into_primitive(self) -> u32 {
73        self as u32
74    }
75
76    #[deprecated = "Strict enums should not use `is_unknown`"]
77    #[inline]
78    pub fn is_unknown(&self) -> bool {
79        false
80    }
81}
82
83/// Who or what initiated the update installation.
84#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
85#[repr(u32)]
86pub enum Initiator {
87    /// The install was initiated by an interactive user, or the user is
88    /// otherwise blocked and waiting for the result of this update.
89    User = 0,
90    /// The install was initiated by a service, in the background.
91    Service = 1,
92}
93
94impl Initiator {
95    #[inline]
96    pub fn from_primitive(prim: u32) -> Option<Self> {
97        match prim {
98            0 => Some(Self::User),
99            1 => Some(Self::Service),
100            _ => None,
101        }
102    }
103
104    #[inline]
105    pub const fn into_primitive(self) -> u32 {
106        self as u32
107    }
108
109    #[deprecated = "Strict enums should not use `is_unknown`"]
110    #[inline]
111    pub fn is_unknown(&self) -> bool {
112        false
113    }
114}
115
116/// The set of values provided when an installation attempt fails on [`State.prepare`].
117#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
118#[repr(u32)]
119pub enum PrepareFailureReason {
120    /// The prepare failed because of some other reason.
121    Internal = 0,
122    /// The prepare failed because the system does not have enough space to fetch
123    /// the update package.
124    OutOfSpace = 1,
125    /// The prepare failed because the system cannot downgrade across a version boundary. Not all
126    /// unsupported downgrades will fail with this error -- just the ones the system can detect. For
127    /// more context, see [RFC-0071](/docs/contribute/governance/rfcs/0071_ota_backstop.md).
128    UnsupportedDowngrade = 2,
129}
130
131impl PrepareFailureReason {
132    #[inline]
133    pub fn from_primitive(prim: u32) -> Option<Self> {
134        match prim {
135            0 => Some(Self::Internal),
136            1 => Some(Self::OutOfSpace),
137            2 => Some(Self::UnsupportedDowngrade),
138            _ => None,
139        }
140    }
141
142    #[inline]
143    pub const fn into_primitive(self) -> u32 {
144        self as u32
145    }
146
147    #[deprecated = "Strict enums should not use `is_unknown`"]
148    #[inline]
149    pub fn is_unknown(&self) -> bool {
150        false
151    }
152}
153
154/// Why resume failed.
155#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
156#[repr(u32)]
157pub enum ResumeError {
158    /// There is no update attempt in progress.
159    NoUpdateInProgress = 1,
160    /// The given attempt id does not match the current update attempt.
161    AttemptIdMismatch = 2,
162}
163
164impl ResumeError {
165    #[inline]
166    pub fn from_primitive(prim: u32) -> Option<Self> {
167        match prim {
168            1 => Some(Self::NoUpdateInProgress),
169            2 => Some(Self::AttemptIdMismatch),
170            _ => None,
171        }
172    }
173
174    #[inline]
175    pub const fn into_primitive(self) -> u32 {
176        self as u32
177    }
178
179    #[deprecated = "Strict enums should not use `is_unknown`"]
180    #[inline]
181    pub fn is_unknown(&self) -> bool {
182        false
183    }
184}
185
186/// The set of values provided when an installation attempt fails on [`State.stage`].
187#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
188#[repr(u32)]
189pub enum StageFailureReason {
190    /// The stage failed because of some other reason.
191    Internal = 0,
192    /// The stage failed because the system does not have enough space to fetch a package.
193    OutOfSpace = 1,
194}
195
196impl StageFailureReason {
197    #[inline]
198    pub fn from_primitive(prim: u32) -> Option<Self> {
199        match prim {
200            0 => Some(Self::Internal),
201            1 => Some(Self::OutOfSpace),
202            _ => None,
203        }
204    }
205
206    #[inline]
207    pub const fn into_primitive(self) -> u32 {
208        self as u32
209    }
210
211    #[deprecated = "Strict enums should not use `is_unknown`"]
212    #[inline]
213    pub fn is_unknown(&self) -> bool {
214        false
215    }
216}
217
218/// Why suspend failed.
219#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
220#[repr(u32)]
221pub enum SuspendError {
222    /// There is no update attempt in progress.
223    NoUpdateInProgress = 1,
224    /// The current update attempt has reached its suspend limit.
225    SuspendLimitExceeded = 2,
226    /// The given attempt id does not match the current update attempt.
227    AttemptIdMismatch = 3,
228}
229
230impl SuspendError {
231    #[inline]
232    pub fn from_primitive(prim: u32) -> Option<Self> {
233        match prim {
234            1 => Some(Self::NoUpdateInProgress),
235            2 => Some(Self::SuspendLimitExceeded),
236            3 => Some(Self::AttemptIdMismatch),
237            _ => None,
238        }
239    }
240
241    #[inline]
242    pub const fn into_primitive(self) -> u32 {
243        self as u32
244    }
245
246    #[deprecated = "Strict enums should not use `is_unknown`"]
247    #[inline]
248    pub fn is_unknown(&self) -> bool {
249        false
250    }
251}
252
253/// The set of values that are returned by an request to start an update.
254#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
255#[repr(u32)]
256pub enum UpdateNotStartedReason {
257    /// There was already another update attempt in progress when this request was
258    /// made.  A new update attempt will not be started.
259    AlreadyInProgress = 1,
260}
261
262impl UpdateNotStartedReason {
263    #[inline]
264    pub fn from_primitive(prim: u32) -> Option<Self> {
265        match prim {
266            1 => Some(Self::AlreadyInProgress),
267            _ => None,
268        }
269    }
270
271    #[inline]
272    pub const fn into_primitive(self) -> u32 {
273        self as u32
274    }
275
276    #[deprecated = "Strict enums should not use `is_unknown`"]
277    #[inline]
278    pub fn is_unknown(&self) -> bool {
279        false
280    }
281}
282
283#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
284pub struct InstallerCancelUpdateRequest {
285    pub attempt_id: Option<String>,
286}
287
288impl fidl::Persistable for InstallerCancelUpdateRequest {}
289
290#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
291pub struct InstallerMonitorUpdateResponse {
292    pub attached: bool,
293}
294
295impl fidl::Persistable for InstallerMonitorUpdateResponse {}
296
297#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
298pub struct InstallerResumeUpdateRequest {
299    pub attempt_id: Option<String>,
300}
301
302impl fidl::Persistable for InstallerResumeUpdateRequest {}
303
304#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
305pub struct InstallerSuspendUpdateRequest {
306    pub attempt_id: Option<String>,
307}
308
309impl fidl::Persistable for InstallerSuspendUpdateRequest {}
310
311#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
312pub struct InstallerStartUpdateResponse {
313    pub attempt_id: String,
314}
315
316impl fidl::Persistable for InstallerStartUpdateResponse {}
317
318#[derive(Clone, Debug, PartialEq)]
319pub struct MonitorOnStateRequest {
320    pub state: State,
321}
322
323impl fidl::Persistable for MonitorOnStateRequest {}
324
325/// Data associated with [`State.canceled`].
326#[derive(Clone, Debug, Default, PartialEq)]
327pub struct CanceledData {
328    #[doc(hidden)]
329    pub __source_breaking: fidl::marker::SourceBreaking,
330}
331
332impl fidl::Persistable for CanceledData {}
333
334/// Data associated with [`State.commit`].
335#[derive(Clone, Debug, Default, PartialEq)]
336pub struct CommitData {
337    pub info: Option<UpdateInfo>,
338    pub progress: Option<InstallationProgress>,
339    #[doc(hidden)]
340    pub __source_breaking: fidl::marker::SourceBreaking,
341}
342
343impl fidl::Persistable for CommitData {}
344
345/// Data associated with [`State.complete`].
346#[derive(Clone, Debug, Default, PartialEq)]
347pub struct CompleteData {
348    pub info: Option<UpdateInfo>,
349    pub progress: Option<InstallationProgress>,
350    #[doc(hidden)]
351    pub __source_breaking: fidl::marker::SourceBreaking,
352}
353
354impl fidl::Persistable for CompleteData {}
355
356/// Data associated with [`State.defer_reboot`].
357#[derive(Clone, Debug, Default, PartialEq)]
358pub struct DeferRebootData {
359    pub info: Option<UpdateInfo>,
360    pub progress: Option<InstallationProgress>,
361    #[doc(hidden)]
362    pub __source_breaking: fidl::marker::SourceBreaking,
363}
364
365impl fidl::Persistable for DeferRebootData {}
366
367/// Data associated with [`State.fail_commit`].
368#[derive(Clone, Debug, Default, PartialEq)]
369pub struct FailCommitData {
370    pub info: Option<UpdateInfo>,
371    pub progress: Option<InstallationProgress>,
372    #[doc(hidden)]
373    pub __source_breaking: fidl::marker::SourceBreaking,
374}
375
376impl fidl::Persistable for FailCommitData {}
377
378/// Data associated with [`State.fail_fetch`].
379#[derive(Clone, Debug, Default, PartialEq)]
380pub struct FailFetchData {
381    pub info: Option<UpdateInfo>,
382    pub progress: Option<InstallationProgress>,
383    pub reason: Option<FetchFailureReason>,
384    #[doc(hidden)]
385    pub __source_breaking: fidl::marker::SourceBreaking,
386}
387
388impl fidl::Persistable for FailFetchData {}
389
390/// Data associated with [`State.fail_prepare`].
391#[derive(Clone, Debug, Default, PartialEq)]
392pub struct FailPrepareData {
393    pub reason: Option<PrepareFailureReason>,
394    #[doc(hidden)]
395    pub __source_breaking: fidl::marker::SourceBreaking,
396}
397
398impl fidl::Persistable for FailPrepareData {}
399
400/// Data associated with [`State.fail_stage`].
401#[derive(Clone, Debug, Default, PartialEq)]
402pub struct FailStageData {
403    pub info: Option<UpdateInfo>,
404    pub progress: Option<InstallationProgress>,
405    pub reason: Option<StageFailureReason>,
406    #[doc(hidden)]
407    pub __source_breaking: fidl::marker::SourceBreaking,
408}
409
410impl fidl::Persistable for FailStageData {}
411
412/// Data associated with [`State.fetch`].
413#[derive(Clone, Debug, Default, PartialEq)]
414pub struct FetchData {
415    pub info: Option<UpdateInfo>,
416    pub progress: Option<InstallationProgress>,
417    #[doc(hidden)]
418    pub __source_breaking: fidl::marker::SourceBreaking,
419}
420
421impl fidl::Persistable for FetchData {}
422
423/// Current progress for an installation attempt.
424#[derive(Clone, Debug, Default, PartialEq)]
425pub struct InstallationProgress {
426    /// The fraction [0-1.0f] of the installation that has been completed.
427    pub fraction_completed: Option<f32>,
428    /// The number of bytes downloaded during this installation attempt. Less
429    /// than or equal to [`UpdateInfo.download_size`] and only present if that
430    /// field is also present.
431    pub bytes_downloaded: Option<u64>,
432    #[doc(hidden)]
433    pub __source_breaking: fidl::marker::SourceBreaking,
434}
435
436impl fidl::Persistable for InstallationProgress {}
437
438/// Configuration options for an update attempt.
439#[derive(Clone, Debug, Default, PartialEq)]
440pub struct Options {
441    /// What initiated this update attempt. Required.
442    pub initiator: Option<Initiator>,
443    /// If an update is already in progress, it's acceptable to instead attach a
444    /// Monitor to that in-progress update instead of failing this request to
445    /// install the update.  Setting this option to true may convert situations
446    /// that would have resulted in the ALREADY_IN_PROGRESS to be treated as
447    /// non-error cases. A controller, if provided, will be ignored if the
448    /// running update attempt already has a controller.
449    pub allow_attach_to_existing_attempt: Option<bool>,
450    /// Determines if the installer should update the recovery partition if an
451    /// update is available.  Defaults to true.
452    pub should_write_recovery: Option<bool>,
453    #[doc(hidden)]
454    pub __source_breaking: fidl::marker::SourceBreaking,
455}
456
457impl fidl::Persistable for Options {}
458
459/// Data associated with [`State.prepare`].
460#[derive(Clone, Debug, Default, PartialEq)]
461pub struct PrepareData {
462    #[doc(hidden)]
463    pub __source_breaking: fidl::marker::SourceBreaking,
464}
465
466impl fidl::Persistable for PrepareData {}
467
468/// Data associated with [`State.reboot`].
469#[derive(Clone, Debug, Default, PartialEq)]
470pub struct RebootData {
471    pub info: Option<UpdateInfo>,
472    pub progress: Option<InstallationProgress>,
473    #[doc(hidden)]
474    pub __source_breaking: fidl::marker::SourceBreaking,
475}
476
477impl fidl::Persistable for RebootData {}
478
479/// Data associated with [`State.stage`].
480#[derive(Clone, Debug, Default, PartialEq)]
481pub struct StageData {
482    pub info: Option<UpdateInfo>,
483    pub progress: Option<InstallationProgress>,
484    #[doc(hidden)]
485    pub __source_breaking: fidl::marker::SourceBreaking,
486}
487
488impl fidl::Persistable for StageData {}
489
490/// Metadata for an update.  Once a field is populated during an installation
491/// attempt, the value will not change.
492#[derive(Clone, Debug, Default, PartialEq)]
493pub struct UpdateInfo {
494    /// The total number of bytes that may be downloaded to apply this update.
495    /// Optional, the installer may not be able to provide this value.
496    pub download_size: Option<u64>,
497    #[doc(hidden)]
498    pub __source_breaking: fidl::marker::SourceBreaking,
499}
500
501impl fidl::Persistable for UpdateInfo {}
502
503/// Data associated with [`State.wait_to_reboot`].
504#[derive(Clone, Debug, Default, PartialEq)]
505pub struct WaitToRebootData {
506    pub info: Option<UpdateInfo>,
507    pub progress: Option<InstallationProgress>,
508    #[doc(hidden)]
509    pub __source_breaking: fidl::marker::SourceBreaking,
510}
511
512impl fidl::Persistable for WaitToRebootData {}
513
514/// The set of states that a [`Monitor`] can receive during an update
515/// installation attempt.
516///
517/// An installation attempt ends when it enters a terminal state, denoted below
518/// as the states on the right-hand side of the diagram with no arrows leading
519/// out of them.
520///
521/// # State Machine Diagram
522///
523/// ```
524///                       +----------------+     +----------------+
525///            +----------|    prepare     |---->|  fail_prepare  |
526///            |          +----------------+     +----------------+
527///            |                  |
528///            |                  v
529///            |          +----------------+     +----------------+
530///            +----------|     stage      |---->|   fail_stage   |
531///            |          +----------------+     +----------------+
532///            |                  |
533///            |                  v
534///            |          +----------------+     +----------------+
535///            +----------|     fetch      |---->|   fail_fetch   |
536///            |          +----------------+     +----------------+
537///            |                  |
538///            |                  v
539///            |          +----------------+     +----------------+
540///            +----------|     commit     |---->|   fail_commit  |
541///            |          +----------------+     +----------------+
542///            v                  |
543///    +----------------+         |              +----------------+
544///    |    canceled    |         +------------> |    complete    |
545///    +----------------+         |              +----------------+
546///                               v
547///                       +----------------+     +----------------+
548///                       | wait_to_reboot |---->|  defer_reboot  |
549///                       +----------------+     +----------------+
550///                               |
551///                               |              +----------------+
552///                               +------------->|     reboot     |
553///                                              +----------------+
554/// ```
555#[derive(Clone, Debug, PartialEq)]
556pub enum State {
557    /// Fetching required metadata to begin the update and verifying system
558    /// state.
559    ///
560    /// Next States:
561    /// * `stage` system is ready to install the update.
562    /// * `fail_prepare` on error.
563    /// * `canceled` on cancel.
564    Prepare(PrepareData),
565    /// Fetching and writing kernel and firmware images.
566    ///
567    /// Next States:
568    /// * `fetch`  required kernel and firmware images are written.
569    /// * `fail_stage`  on error.
570    /// * `canceled` on cancel.
571    Stage(StageData),
572    /// Fetching packages.
573    ///
574    /// Next States:
575    /// * `commit` packages were fetched successfully.
576    /// * `fail_fetch` on error.
577    /// * `canceled` on cancel.
578    Fetch(FetchData),
579    /// Prepare to switch over to the new system by writing the packages
580    /// and switching the active partition.
581    ///
582    /// Next States:
583    /// * `wait_to_reboot` if a reboot is necessary to complete the update.
584    /// * `complete` if no reboot is necessary to complete the update.
585    /// * `fail_commit` on error.
586    /// * `canceled` on cancel.
587    Commit(CommitData),
588    /// The system is configured to boot the updated OS on next boot, and the
589    /// installer is waiting for the trigger to reboot the system.
590    ///
591    /// Next States:
592    /// * `reboot` when the installer decides it is time to initiate the reboot.
593    /// * `defer_reboot` if the initiator specifically requests to not reboot.
594    WaitToReboot(WaitToRebootData),
595    /// The installer has initiated a system reboot into the updated OS.
596    ///
597    /// **This is a terminal state**
598    Reboot(RebootData),
599    /// The initiator specifically requested to skip the reboot, but a reboot is
600    /// still required to complete the update.
601    ///
602    /// **This is a terminal state**
603    DeferReboot(DeferRebootData),
604    /// The update is complete and no reboot was required.
605    ///
606    /// **This is a terminal state**
607    Complete(CompleteData),
608    /// An error occurred while preparing the install.
609    ///
610    /// **This is a terminal state**
611    FailPrepare(FailPrepareData),
612    /// An error occurred while staging the images for the OS.
613    ///
614    /// **This is a terminal state**
615    FailStage(FailStageData),
616    /// An error occurred while fetching the required artifacts.
617    ///
618    /// **This is a terminal state**
619    FailFetch(FailFetchData),
620    /// An error occured while switching partitions.
621    ///
622    /// **This is a terminal state**
623    FailCommit(FailCommitData),
624    /// The update is canceled.
625    ///
626    /// **This is a terminal state**
627    Canceled(CanceledData),
628}
629
630impl State {
631    #[inline]
632    pub fn ordinal(&self) -> u64 {
633        match *self {
634            Self::Prepare(_) => 1,
635            Self::Stage(_) => 2,
636            Self::Fetch(_) => 3,
637            Self::Commit(_) => 4,
638            Self::WaitToReboot(_) => 5,
639            Self::Reboot(_) => 6,
640            Self::DeferReboot(_) => 7,
641            Self::Complete(_) => 8,
642            Self::FailPrepare(_) => 9,
643            Self::FailStage(_) => 10,
644            Self::FailFetch(_) => 11,
645            Self::FailCommit(_) => 12,
646            Self::Canceled(_) => 13,
647        }
648    }
649
650    #[deprecated = "Strict unions should not use `is_unknown`"]
651    #[inline]
652    pub fn is_unknown(&self) -> bool {
653        false
654    }
655}
656
657impl fidl::Persistable for State {}
658
659mod internal {
660    use super::*;
661    unsafe impl fidl::encoding::TypeMarker for CancelError {
662        type Owned = Self;
663
664        #[inline(always)]
665        fn inline_align(_context: fidl::encoding::Context) -> usize {
666            std::mem::align_of::<u32>()
667        }
668
669        #[inline(always)]
670        fn inline_size(_context: fidl::encoding::Context) -> usize {
671            std::mem::size_of::<u32>()
672        }
673
674        #[inline(always)]
675        fn encode_is_copy() -> bool {
676            true
677        }
678
679        #[inline(always)]
680        fn decode_is_copy() -> bool {
681            false
682        }
683    }
684
685    impl fidl::encoding::ValueTypeMarker for CancelError {
686        type Borrowed<'a> = Self;
687        #[inline(always)]
688        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
689            *value
690        }
691    }
692
693    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CancelError {
694        #[inline]
695        unsafe fn encode(
696            self,
697            encoder: &mut fidl::encoding::Encoder<'_, D>,
698            offset: usize,
699            _depth: fidl::encoding::Depth,
700        ) -> fidl::Result<()> {
701            encoder.debug_check_bounds::<Self>(offset);
702            encoder.write_num(self.into_primitive(), offset);
703            Ok(())
704        }
705    }
706
707    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CancelError {
708        #[inline(always)]
709        fn new_empty() -> Self {
710            Self::NoUpdateInProgress
711        }
712
713        #[inline]
714        unsafe fn decode(
715            &mut self,
716            decoder: &mut fidl::encoding::Decoder<'_, D>,
717            offset: usize,
718            _depth: fidl::encoding::Depth,
719        ) -> fidl::Result<()> {
720            decoder.debug_check_bounds::<Self>(offset);
721            let prim = decoder.read_num::<u32>(offset);
722
723            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
724            Ok(())
725        }
726    }
727    unsafe impl fidl::encoding::TypeMarker for FetchFailureReason {
728        type Owned = Self;
729
730        #[inline(always)]
731        fn inline_align(_context: fidl::encoding::Context) -> usize {
732            std::mem::align_of::<u32>()
733        }
734
735        #[inline(always)]
736        fn inline_size(_context: fidl::encoding::Context) -> usize {
737            std::mem::size_of::<u32>()
738        }
739
740        #[inline(always)]
741        fn encode_is_copy() -> bool {
742            true
743        }
744
745        #[inline(always)]
746        fn decode_is_copy() -> bool {
747            false
748        }
749    }
750
751    impl fidl::encoding::ValueTypeMarker for FetchFailureReason {
752        type Borrowed<'a> = Self;
753        #[inline(always)]
754        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
755            *value
756        }
757    }
758
759    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
760        for FetchFailureReason
761    {
762        #[inline]
763        unsafe fn encode(
764            self,
765            encoder: &mut fidl::encoding::Encoder<'_, D>,
766            offset: usize,
767            _depth: fidl::encoding::Depth,
768        ) -> fidl::Result<()> {
769            encoder.debug_check_bounds::<Self>(offset);
770            encoder.write_num(self.into_primitive(), offset);
771            Ok(())
772        }
773    }
774
775    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FetchFailureReason {
776        #[inline(always)]
777        fn new_empty() -> Self {
778            Self::Internal
779        }
780
781        #[inline]
782        unsafe fn decode(
783            &mut self,
784            decoder: &mut fidl::encoding::Decoder<'_, D>,
785            offset: usize,
786            _depth: fidl::encoding::Depth,
787        ) -> fidl::Result<()> {
788            decoder.debug_check_bounds::<Self>(offset);
789            let prim = decoder.read_num::<u32>(offset);
790
791            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
792            Ok(())
793        }
794    }
795    unsafe impl fidl::encoding::TypeMarker for Initiator {
796        type Owned = Self;
797
798        #[inline(always)]
799        fn inline_align(_context: fidl::encoding::Context) -> usize {
800            std::mem::align_of::<u32>()
801        }
802
803        #[inline(always)]
804        fn inline_size(_context: fidl::encoding::Context) -> usize {
805            std::mem::size_of::<u32>()
806        }
807
808        #[inline(always)]
809        fn encode_is_copy() -> bool {
810            true
811        }
812
813        #[inline(always)]
814        fn decode_is_copy() -> bool {
815            false
816        }
817    }
818
819    impl fidl::encoding::ValueTypeMarker for Initiator {
820        type Borrowed<'a> = Self;
821        #[inline(always)]
822        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
823            *value
824        }
825    }
826
827    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Initiator {
828        #[inline]
829        unsafe fn encode(
830            self,
831            encoder: &mut fidl::encoding::Encoder<'_, D>,
832            offset: usize,
833            _depth: fidl::encoding::Depth,
834        ) -> fidl::Result<()> {
835            encoder.debug_check_bounds::<Self>(offset);
836            encoder.write_num(self.into_primitive(), offset);
837            Ok(())
838        }
839    }
840
841    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Initiator {
842        #[inline(always)]
843        fn new_empty() -> Self {
844            Self::User
845        }
846
847        #[inline]
848        unsafe fn decode(
849            &mut self,
850            decoder: &mut fidl::encoding::Decoder<'_, D>,
851            offset: usize,
852            _depth: fidl::encoding::Depth,
853        ) -> fidl::Result<()> {
854            decoder.debug_check_bounds::<Self>(offset);
855            let prim = decoder.read_num::<u32>(offset);
856
857            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
858            Ok(())
859        }
860    }
861    unsafe impl fidl::encoding::TypeMarker for PrepareFailureReason {
862        type Owned = Self;
863
864        #[inline(always)]
865        fn inline_align(_context: fidl::encoding::Context) -> usize {
866            std::mem::align_of::<u32>()
867        }
868
869        #[inline(always)]
870        fn inline_size(_context: fidl::encoding::Context) -> usize {
871            std::mem::size_of::<u32>()
872        }
873
874        #[inline(always)]
875        fn encode_is_copy() -> bool {
876            true
877        }
878
879        #[inline(always)]
880        fn decode_is_copy() -> bool {
881            false
882        }
883    }
884
885    impl fidl::encoding::ValueTypeMarker for PrepareFailureReason {
886        type Borrowed<'a> = Self;
887        #[inline(always)]
888        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
889            *value
890        }
891    }
892
893    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
894        for PrepareFailureReason
895    {
896        #[inline]
897        unsafe fn encode(
898            self,
899            encoder: &mut fidl::encoding::Encoder<'_, D>,
900            offset: usize,
901            _depth: fidl::encoding::Depth,
902        ) -> fidl::Result<()> {
903            encoder.debug_check_bounds::<Self>(offset);
904            encoder.write_num(self.into_primitive(), offset);
905            Ok(())
906        }
907    }
908
909    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PrepareFailureReason {
910        #[inline(always)]
911        fn new_empty() -> Self {
912            Self::Internal
913        }
914
915        #[inline]
916        unsafe fn decode(
917            &mut self,
918            decoder: &mut fidl::encoding::Decoder<'_, D>,
919            offset: usize,
920            _depth: fidl::encoding::Depth,
921        ) -> fidl::Result<()> {
922            decoder.debug_check_bounds::<Self>(offset);
923            let prim = decoder.read_num::<u32>(offset);
924
925            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
926            Ok(())
927        }
928    }
929    unsafe impl fidl::encoding::TypeMarker for ResumeError {
930        type Owned = Self;
931
932        #[inline(always)]
933        fn inline_align(_context: fidl::encoding::Context) -> usize {
934            std::mem::align_of::<u32>()
935        }
936
937        #[inline(always)]
938        fn inline_size(_context: fidl::encoding::Context) -> usize {
939            std::mem::size_of::<u32>()
940        }
941
942        #[inline(always)]
943        fn encode_is_copy() -> bool {
944            true
945        }
946
947        #[inline(always)]
948        fn decode_is_copy() -> bool {
949            false
950        }
951    }
952
953    impl fidl::encoding::ValueTypeMarker for ResumeError {
954        type Borrowed<'a> = Self;
955        #[inline(always)]
956        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
957            *value
958        }
959    }
960
961    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ResumeError {
962        #[inline]
963        unsafe fn encode(
964            self,
965            encoder: &mut fidl::encoding::Encoder<'_, D>,
966            offset: usize,
967            _depth: fidl::encoding::Depth,
968        ) -> fidl::Result<()> {
969            encoder.debug_check_bounds::<Self>(offset);
970            encoder.write_num(self.into_primitive(), offset);
971            Ok(())
972        }
973    }
974
975    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResumeError {
976        #[inline(always)]
977        fn new_empty() -> Self {
978            Self::NoUpdateInProgress
979        }
980
981        #[inline]
982        unsafe fn decode(
983            &mut self,
984            decoder: &mut fidl::encoding::Decoder<'_, D>,
985            offset: usize,
986            _depth: fidl::encoding::Depth,
987        ) -> fidl::Result<()> {
988            decoder.debug_check_bounds::<Self>(offset);
989            let prim = decoder.read_num::<u32>(offset);
990
991            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
992            Ok(())
993        }
994    }
995    unsafe impl fidl::encoding::TypeMarker for StageFailureReason {
996        type Owned = Self;
997
998        #[inline(always)]
999        fn inline_align(_context: fidl::encoding::Context) -> usize {
1000            std::mem::align_of::<u32>()
1001        }
1002
1003        #[inline(always)]
1004        fn inline_size(_context: fidl::encoding::Context) -> usize {
1005            std::mem::size_of::<u32>()
1006        }
1007
1008        #[inline(always)]
1009        fn encode_is_copy() -> bool {
1010            true
1011        }
1012
1013        #[inline(always)]
1014        fn decode_is_copy() -> bool {
1015            false
1016        }
1017    }
1018
1019    impl fidl::encoding::ValueTypeMarker for StageFailureReason {
1020        type Borrowed<'a> = Self;
1021        #[inline(always)]
1022        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1023            *value
1024        }
1025    }
1026
1027    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1028        for StageFailureReason
1029    {
1030        #[inline]
1031        unsafe fn encode(
1032            self,
1033            encoder: &mut fidl::encoding::Encoder<'_, D>,
1034            offset: usize,
1035            _depth: fidl::encoding::Depth,
1036        ) -> fidl::Result<()> {
1037            encoder.debug_check_bounds::<Self>(offset);
1038            encoder.write_num(self.into_primitive(), offset);
1039            Ok(())
1040        }
1041    }
1042
1043    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StageFailureReason {
1044        #[inline(always)]
1045        fn new_empty() -> Self {
1046            Self::Internal
1047        }
1048
1049        #[inline]
1050        unsafe fn decode(
1051            &mut self,
1052            decoder: &mut fidl::encoding::Decoder<'_, D>,
1053            offset: usize,
1054            _depth: fidl::encoding::Depth,
1055        ) -> fidl::Result<()> {
1056            decoder.debug_check_bounds::<Self>(offset);
1057            let prim = decoder.read_num::<u32>(offset);
1058
1059            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1060            Ok(())
1061        }
1062    }
1063    unsafe impl fidl::encoding::TypeMarker for SuspendError {
1064        type Owned = Self;
1065
1066        #[inline(always)]
1067        fn inline_align(_context: fidl::encoding::Context) -> usize {
1068            std::mem::align_of::<u32>()
1069        }
1070
1071        #[inline(always)]
1072        fn inline_size(_context: fidl::encoding::Context) -> usize {
1073            std::mem::size_of::<u32>()
1074        }
1075
1076        #[inline(always)]
1077        fn encode_is_copy() -> bool {
1078            true
1079        }
1080
1081        #[inline(always)]
1082        fn decode_is_copy() -> bool {
1083            false
1084        }
1085    }
1086
1087    impl fidl::encoding::ValueTypeMarker for SuspendError {
1088        type Borrowed<'a> = Self;
1089        #[inline(always)]
1090        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1091            *value
1092        }
1093    }
1094
1095    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SuspendError {
1096        #[inline]
1097        unsafe fn encode(
1098            self,
1099            encoder: &mut fidl::encoding::Encoder<'_, D>,
1100            offset: usize,
1101            _depth: fidl::encoding::Depth,
1102        ) -> fidl::Result<()> {
1103            encoder.debug_check_bounds::<Self>(offset);
1104            encoder.write_num(self.into_primitive(), offset);
1105            Ok(())
1106        }
1107    }
1108
1109    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SuspendError {
1110        #[inline(always)]
1111        fn new_empty() -> Self {
1112            Self::NoUpdateInProgress
1113        }
1114
1115        #[inline]
1116        unsafe fn decode(
1117            &mut self,
1118            decoder: &mut fidl::encoding::Decoder<'_, D>,
1119            offset: usize,
1120            _depth: fidl::encoding::Depth,
1121        ) -> fidl::Result<()> {
1122            decoder.debug_check_bounds::<Self>(offset);
1123            let prim = decoder.read_num::<u32>(offset);
1124
1125            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1126            Ok(())
1127        }
1128    }
1129    unsafe impl fidl::encoding::TypeMarker for UpdateNotStartedReason {
1130        type Owned = Self;
1131
1132        #[inline(always)]
1133        fn inline_align(_context: fidl::encoding::Context) -> usize {
1134            std::mem::align_of::<u32>()
1135        }
1136
1137        #[inline(always)]
1138        fn inline_size(_context: fidl::encoding::Context) -> usize {
1139            std::mem::size_of::<u32>()
1140        }
1141
1142        #[inline(always)]
1143        fn encode_is_copy() -> bool {
1144            true
1145        }
1146
1147        #[inline(always)]
1148        fn decode_is_copy() -> bool {
1149            false
1150        }
1151    }
1152
1153    impl fidl::encoding::ValueTypeMarker for UpdateNotStartedReason {
1154        type Borrowed<'a> = Self;
1155        #[inline(always)]
1156        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1157            *value
1158        }
1159    }
1160
1161    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1162        for UpdateNotStartedReason
1163    {
1164        #[inline]
1165        unsafe fn encode(
1166            self,
1167            encoder: &mut fidl::encoding::Encoder<'_, D>,
1168            offset: usize,
1169            _depth: fidl::encoding::Depth,
1170        ) -> fidl::Result<()> {
1171            encoder.debug_check_bounds::<Self>(offset);
1172            encoder.write_num(self.into_primitive(), offset);
1173            Ok(())
1174        }
1175    }
1176
1177    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1178        for UpdateNotStartedReason
1179    {
1180        #[inline(always)]
1181        fn new_empty() -> Self {
1182            Self::AlreadyInProgress
1183        }
1184
1185        #[inline]
1186        unsafe fn decode(
1187            &mut self,
1188            decoder: &mut fidl::encoding::Decoder<'_, D>,
1189            offset: usize,
1190            _depth: fidl::encoding::Depth,
1191        ) -> fidl::Result<()> {
1192            decoder.debug_check_bounds::<Self>(offset);
1193            let prim = decoder.read_num::<u32>(offset);
1194
1195            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1196            Ok(())
1197        }
1198    }
1199
1200    impl fidl::encoding::ValueTypeMarker for InstallerCancelUpdateRequest {
1201        type Borrowed<'a> = &'a Self;
1202        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1203            value
1204        }
1205    }
1206
1207    unsafe impl fidl::encoding::TypeMarker for InstallerCancelUpdateRequest {
1208        type Owned = Self;
1209
1210        #[inline(always)]
1211        fn inline_align(_context: fidl::encoding::Context) -> usize {
1212            8
1213        }
1214
1215        #[inline(always)]
1216        fn inline_size(_context: fidl::encoding::Context) -> usize {
1217            16
1218        }
1219    }
1220
1221    unsafe impl<D: fidl::encoding::ResourceDialect>
1222        fidl::encoding::Encode<InstallerCancelUpdateRequest, D> for &InstallerCancelUpdateRequest
1223    {
1224        #[inline]
1225        unsafe fn encode(
1226            self,
1227            encoder: &mut fidl::encoding::Encoder<'_, D>,
1228            offset: usize,
1229            _depth: fidl::encoding::Depth,
1230        ) -> fidl::Result<()> {
1231            encoder.debug_check_bounds::<InstallerCancelUpdateRequest>(offset);
1232            // Delegate to tuple encoding.
1233            fidl::encoding::Encode::<InstallerCancelUpdateRequest, D>::encode(
1234                (
1235                    <fidl::encoding::Optional<fidl::encoding::BoundedString<36>> as fidl::encoding::ValueTypeMarker>::borrow(&self.attempt_id),
1236                ),
1237                encoder, offset, _depth
1238            )
1239        }
1240    }
1241    unsafe impl<
1242            D: fidl::encoding::ResourceDialect,
1243            T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<36>>, D>,
1244        > fidl::encoding::Encode<InstallerCancelUpdateRequest, D> for (T0,)
1245    {
1246        #[inline]
1247        unsafe fn encode(
1248            self,
1249            encoder: &mut fidl::encoding::Encoder<'_, D>,
1250            offset: usize,
1251            depth: fidl::encoding::Depth,
1252        ) -> fidl::Result<()> {
1253            encoder.debug_check_bounds::<InstallerCancelUpdateRequest>(offset);
1254            // Zero out padding regions. There's no need to apply masks
1255            // because the unmasked parts will be overwritten by fields.
1256            // Write the fields.
1257            self.0.encode(encoder, offset + 0, depth)?;
1258            Ok(())
1259        }
1260    }
1261
1262    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1263        for InstallerCancelUpdateRequest
1264    {
1265        #[inline(always)]
1266        fn new_empty() -> Self {
1267            Self {
1268                attempt_id: fidl::new_empty!(
1269                    fidl::encoding::Optional<fidl::encoding::BoundedString<36>>,
1270                    D
1271                ),
1272            }
1273        }
1274
1275        #[inline]
1276        unsafe fn decode(
1277            &mut self,
1278            decoder: &mut fidl::encoding::Decoder<'_, D>,
1279            offset: usize,
1280            _depth: fidl::encoding::Depth,
1281        ) -> fidl::Result<()> {
1282            decoder.debug_check_bounds::<Self>(offset);
1283            // Verify that padding bytes are zero.
1284            fidl::decode!(
1285                fidl::encoding::Optional<fidl::encoding::BoundedString<36>>,
1286                D,
1287                &mut self.attempt_id,
1288                decoder,
1289                offset + 0,
1290                _depth
1291            )?;
1292            Ok(())
1293        }
1294    }
1295
1296    impl fidl::encoding::ValueTypeMarker for InstallerMonitorUpdateResponse {
1297        type Borrowed<'a> = &'a Self;
1298        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1299            value
1300        }
1301    }
1302
1303    unsafe impl fidl::encoding::TypeMarker for InstallerMonitorUpdateResponse {
1304        type Owned = Self;
1305
1306        #[inline(always)]
1307        fn inline_align(_context: fidl::encoding::Context) -> usize {
1308            1
1309        }
1310
1311        #[inline(always)]
1312        fn inline_size(_context: fidl::encoding::Context) -> usize {
1313            1
1314        }
1315    }
1316
1317    unsafe impl<D: fidl::encoding::ResourceDialect>
1318        fidl::encoding::Encode<InstallerMonitorUpdateResponse, D>
1319        for &InstallerMonitorUpdateResponse
1320    {
1321        #[inline]
1322        unsafe fn encode(
1323            self,
1324            encoder: &mut fidl::encoding::Encoder<'_, D>,
1325            offset: usize,
1326            _depth: fidl::encoding::Depth,
1327        ) -> fidl::Result<()> {
1328            encoder.debug_check_bounds::<InstallerMonitorUpdateResponse>(offset);
1329            // Delegate to tuple encoding.
1330            fidl::encoding::Encode::<InstallerMonitorUpdateResponse, D>::encode(
1331                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.attached),),
1332                encoder,
1333                offset,
1334                _depth,
1335            )
1336        }
1337    }
1338    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1339        fidl::encoding::Encode<InstallerMonitorUpdateResponse, D> for (T0,)
1340    {
1341        #[inline]
1342        unsafe fn encode(
1343            self,
1344            encoder: &mut fidl::encoding::Encoder<'_, D>,
1345            offset: usize,
1346            depth: fidl::encoding::Depth,
1347        ) -> fidl::Result<()> {
1348            encoder.debug_check_bounds::<InstallerMonitorUpdateResponse>(offset);
1349            // Zero out padding regions. There's no need to apply masks
1350            // because the unmasked parts will be overwritten by fields.
1351            // Write the fields.
1352            self.0.encode(encoder, offset + 0, depth)?;
1353            Ok(())
1354        }
1355    }
1356
1357    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1358        for InstallerMonitorUpdateResponse
1359    {
1360        #[inline(always)]
1361        fn new_empty() -> Self {
1362            Self { attached: fidl::new_empty!(bool, D) }
1363        }
1364
1365        #[inline]
1366        unsafe fn decode(
1367            &mut self,
1368            decoder: &mut fidl::encoding::Decoder<'_, D>,
1369            offset: usize,
1370            _depth: fidl::encoding::Depth,
1371        ) -> fidl::Result<()> {
1372            decoder.debug_check_bounds::<Self>(offset);
1373            // Verify that padding bytes are zero.
1374            fidl::decode!(bool, D, &mut self.attached, decoder, offset + 0, _depth)?;
1375            Ok(())
1376        }
1377    }
1378
1379    impl fidl::encoding::ValueTypeMarker for InstallerResumeUpdateRequest {
1380        type Borrowed<'a> = &'a Self;
1381        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1382            value
1383        }
1384    }
1385
1386    unsafe impl fidl::encoding::TypeMarker for InstallerResumeUpdateRequest {
1387        type Owned = Self;
1388
1389        #[inline(always)]
1390        fn inline_align(_context: fidl::encoding::Context) -> usize {
1391            8
1392        }
1393
1394        #[inline(always)]
1395        fn inline_size(_context: fidl::encoding::Context) -> usize {
1396            16
1397        }
1398    }
1399
1400    unsafe impl<D: fidl::encoding::ResourceDialect>
1401        fidl::encoding::Encode<InstallerResumeUpdateRequest, D> for &InstallerResumeUpdateRequest
1402    {
1403        #[inline]
1404        unsafe fn encode(
1405            self,
1406            encoder: &mut fidl::encoding::Encoder<'_, D>,
1407            offset: usize,
1408            _depth: fidl::encoding::Depth,
1409        ) -> fidl::Result<()> {
1410            encoder.debug_check_bounds::<InstallerResumeUpdateRequest>(offset);
1411            // Delegate to tuple encoding.
1412            fidl::encoding::Encode::<InstallerResumeUpdateRequest, D>::encode(
1413                (
1414                    <fidl::encoding::Optional<fidl::encoding::BoundedString<36>> as fidl::encoding::ValueTypeMarker>::borrow(&self.attempt_id),
1415                ),
1416                encoder, offset, _depth
1417            )
1418        }
1419    }
1420    unsafe impl<
1421            D: fidl::encoding::ResourceDialect,
1422            T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<36>>, D>,
1423        > fidl::encoding::Encode<InstallerResumeUpdateRequest, D> for (T0,)
1424    {
1425        #[inline]
1426        unsafe fn encode(
1427            self,
1428            encoder: &mut fidl::encoding::Encoder<'_, D>,
1429            offset: usize,
1430            depth: fidl::encoding::Depth,
1431        ) -> fidl::Result<()> {
1432            encoder.debug_check_bounds::<InstallerResumeUpdateRequest>(offset);
1433            // Zero out padding regions. There's no need to apply masks
1434            // because the unmasked parts will be overwritten by fields.
1435            // Write the fields.
1436            self.0.encode(encoder, offset + 0, depth)?;
1437            Ok(())
1438        }
1439    }
1440
1441    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1442        for InstallerResumeUpdateRequest
1443    {
1444        #[inline(always)]
1445        fn new_empty() -> Self {
1446            Self {
1447                attempt_id: fidl::new_empty!(
1448                    fidl::encoding::Optional<fidl::encoding::BoundedString<36>>,
1449                    D
1450                ),
1451            }
1452        }
1453
1454        #[inline]
1455        unsafe fn decode(
1456            &mut self,
1457            decoder: &mut fidl::encoding::Decoder<'_, D>,
1458            offset: usize,
1459            _depth: fidl::encoding::Depth,
1460        ) -> fidl::Result<()> {
1461            decoder.debug_check_bounds::<Self>(offset);
1462            // Verify that padding bytes are zero.
1463            fidl::decode!(
1464                fidl::encoding::Optional<fidl::encoding::BoundedString<36>>,
1465                D,
1466                &mut self.attempt_id,
1467                decoder,
1468                offset + 0,
1469                _depth
1470            )?;
1471            Ok(())
1472        }
1473    }
1474
1475    impl fidl::encoding::ValueTypeMarker for InstallerSuspendUpdateRequest {
1476        type Borrowed<'a> = &'a Self;
1477        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1478            value
1479        }
1480    }
1481
1482    unsafe impl fidl::encoding::TypeMarker for InstallerSuspendUpdateRequest {
1483        type Owned = Self;
1484
1485        #[inline(always)]
1486        fn inline_align(_context: fidl::encoding::Context) -> usize {
1487            8
1488        }
1489
1490        #[inline(always)]
1491        fn inline_size(_context: fidl::encoding::Context) -> usize {
1492            16
1493        }
1494    }
1495
1496    unsafe impl<D: fidl::encoding::ResourceDialect>
1497        fidl::encoding::Encode<InstallerSuspendUpdateRequest, D>
1498        for &InstallerSuspendUpdateRequest
1499    {
1500        #[inline]
1501        unsafe fn encode(
1502            self,
1503            encoder: &mut fidl::encoding::Encoder<'_, D>,
1504            offset: usize,
1505            _depth: fidl::encoding::Depth,
1506        ) -> fidl::Result<()> {
1507            encoder.debug_check_bounds::<InstallerSuspendUpdateRequest>(offset);
1508            // Delegate to tuple encoding.
1509            fidl::encoding::Encode::<InstallerSuspendUpdateRequest, D>::encode(
1510                (
1511                    <fidl::encoding::Optional<fidl::encoding::BoundedString<36>> as fidl::encoding::ValueTypeMarker>::borrow(&self.attempt_id),
1512                ),
1513                encoder, offset, _depth
1514            )
1515        }
1516    }
1517    unsafe impl<
1518            D: fidl::encoding::ResourceDialect,
1519            T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<36>>, D>,
1520        > fidl::encoding::Encode<InstallerSuspendUpdateRequest, D> for (T0,)
1521    {
1522        #[inline]
1523        unsafe fn encode(
1524            self,
1525            encoder: &mut fidl::encoding::Encoder<'_, D>,
1526            offset: usize,
1527            depth: fidl::encoding::Depth,
1528        ) -> fidl::Result<()> {
1529            encoder.debug_check_bounds::<InstallerSuspendUpdateRequest>(offset);
1530            // Zero out padding regions. There's no need to apply masks
1531            // because the unmasked parts will be overwritten by fields.
1532            // Write the fields.
1533            self.0.encode(encoder, offset + 0, depth)?;
1534            Ok(())
1535        }
1536    }
1537
1538    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1539        for InstallerSuspendUpdateRequest
1540    {
1541        #[inline(always)]
1542        fn new_empty() -> Self {
1543            Self {
1544                attempt_id: fidl::new_empty!(
1545                    fidl::encoding::Optional<fidl::encoding::BoundedString<36>>,
1546                    D
1547                ),
1548            }
1549        }
1550
1551        #[inline]
1552        unsafe fn decode(
1553            &mut self,
1554            decoder: &mut fidl::encoding::Decoder<'_, D>,
1555            offset: usize,
1556            _depth: fidl::encoding::Depth,
1557        ) -> fidl::Result<()> {
1558            decoder.debug_check_bounds::<Self>(offset);
1559            // Verify that padding bytes are zero.
1560            fidl::decode!(
1561                fidl::encoding::Optional<fidl::encoding::BoundedString<36>>,
1562                D,
1563                &mut self.attempt_id,
1564                decoder,
1565                offset + 0,
1566                _depth
1567            )?;
1568            Ok(())
1569        }
1570    }
1571
1572    impl fidl::encoding::ValueTypeMarker for InstallerStartUpdateResponse {
1573        type Borrowed<'a> = &'a Self;
1574        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1575            value
1576        }
1577    }
1578
1579    unsafe impl fidl::encoding::TypeMarker for InstallerStartUpdateResponse {
1580        type Owned = Self;
1581
1582        #[inline(always)]
1583        fn inline_align(_context: fidl::encoding::Context) -> usize {
1584            8
1585        }
1586
1587        #[inline(always)]
1588        fn inline_size(_context: fidl::encoding::Context) -> usize {
1589            16
1590        }
1591    }
1592
1593    unsafe impl<D: fidl::encoding::ResourceDialect>
1594        fidl::encoding::Encode<InstallerStartUpdateResponse, D> for &InstallerStartUpdateResponse
1595    {
1596        #[inline]
1597        unsafe fn encode(
1598            self,
1599            encoder: &mut fidl::encoding::Encoder<'_, D>,
1600            offset: usize,
1601            _depth: fidl::encoding::Depth,
1602        ) -> fidl::Result<()> {
1603            encoder.debug_check_bounds::<InstallerStartUpdateResponse>(offset);
1604            // Delegate to tuple encoding.
1605            fidl::encoding::Encode::<InstallerStartUpdateResponse, D>::encode(
1606                (<fidl::encoding::BoundedString<36> as fidl::encoding::ValueTypeMarker>::borrow(
1607                    &self.attempt_id,
1608                ),),
1609                encoder,
1610                offset,
1611                _depth,
1612            )
1613        }
1614    }
1615    unsafe impl<
1616            D: fidl::encoding::ResourceDialect,
1617            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<36>, D>,
1618        > fidl::encoding::Encode<InstallerStartUpdateResponse, D> for (T0,)
1619    {
1620        #[inline]
1621        unsafe fn encode(
1622            self,
1623            encoder: &mut fidl::encoding::Encoder<'_, D>,
1624            offset: usize,
1625            depth: fidl::encoding::Depth,
1626        ) -> fidl::Result<()> {
1627            encoder.debug_check_bounds::<InstallerStartUpdateResponse>(offset);
1628            // Zero out padding regions. There's no need to apply masks
1629            // because the unmasked parts will be overwritten by fields.
1630            // Write the fields.
1631            self.0.encode(encoder, offset + 0, depth)?;
1632            Ok(())
1633        }
1634    }
1635
1636    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1637        for InstallerStartUpdateResponse
1638    {
1639        #[inline(always)]
1640        fn new_empty() -> Self {
1641            Self { attempt_id: fidl::new_empty!(fidl::encoding::BoundedString<36>, D) }
1642        }
1643
1644        #[inline]
1645        unsafe fn decode(
1646            &mut self,
1647            decoder: &mut fidl::encoding::Decoder<'_, D>,
1648            offset: usize,
1649            _depth: fidl::encoding::Depth,
1650        ) -> fidl::Result<()> {
1651            decoder.debug_check_bounds::<Self>(offset);
1652            // Verify that padding bytes are zero.
1653            fidl::decode!(
1654                fidl::encoding::BoundedString<36>,
1655                D,
1656                &mut self.attempt_id,
1657                decoder,
1658                offset + 0,
1659                _depth
1660            )?;
1661            Ok(())
1662        }
1663    }
1664
1665    impl fidl::encoding::ValueTypeMarker for MonitorOnStateRequest {
1666        type Borrowed<'a> = &'a Self;
1667        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1668            value
1669        }
1670    }
1671
1672    unsafe impl fidl::encoding::TypeMarker for MonitorOnStateRequest {
1673        type Owned = Self;
1674
1675        #[inline(always)]
1676        fn inline_align(_context: fidl::encoding::Context) -> usize {
1677            8
1678        }
1679
1680        #[inline(always)]
1681        fn inline_size(_context: fidl::encoding::Context) -> usize {
1682            16
1683        }
1684    }
1685
1686    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MonitorOnStateRequest, D>
1687        for &MonitorOnStateRequest
1688    {
1689        #[inline]
1690        unsafe fn encode(
1691            self,
1692            encoder: &mut fidl::encoding::Encoder<'_, D>,
1693            offset: usize,
1694            _depth: fidl::encoding::Depth,
1695        ) -> fidl::Result<()> {
1696            encoder.debug_check_bounds::<MonitorOnStateRequest>(offset);
1697            // Delegate to tuple encoding.
1698            fidl::encoding::Encode::<MonitorOnStateRequest, D>::encode(
1699                (<State as fidl::encoding::ValueTypeMarker>::borrow(&self.state),),
1700                encoder,
1701                offset,
1702                _depth,
1703            )
1704        }
1705    }
1706    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<State, D>>
1707        fidl::encoding::Encode<MonitorOnStateRequest, D> for (T0,)
1708    {
1709        #[inline]
1710        unsafe fn encode(
1711            self,
1712            encoder: &mut fidl::encoding::Encoder<'_, D>,
1713            offset: usize,
1714            depth: fidl::encoding::Depth,
1715        ) -> fidl::Result<()> {
1716            encoder.debug_check_bounds::<MonitorOnStateRequest>(offset);
1717            // Zero out padding regions. There's no need to apply masks
1718            // because the unmasked parts will be overwritten by fields.
1719            // Write the fields.
1720            self.0.encode(encoder, offset + 0, depth)?;
1721            Ok(())
1722        }
1723    }
1724
1725    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MonitorOnStateRequest {
1726        #[inline(always)]
1727        fn new_empty() -> Self {
1728            Self { state: fidl::new_empty!(State, D) }
1729        }
1730
1731        #[inline]
1732        unsafe fn decode(
1733            &mut self,
1734            decoder: &mut fidl::encoding::Decoder<'_, D>,
1735            offset: usize,
1736            _depth: fidl::encoding::Depth,
1737        ) -> fidl::Result<()> {
1738            decoder.debug_check_bounds::<Self>(offset);
1739            // Verify that padding bytes are zero.
1740            fidl::decode!(State, D, &mut self.state, decoder, offset + 0, _depth)?;
1741            Ok(())
1742        }
1743    }
1744
1745    impl CanceledData {
1746        #[inline(always)]
1747        fn max_ordinal_present(&self) -> u64 {
1748            0
1749        }
1750    }
1751
1752    impl fidl::encoding::ValueTypeMarker for CanceledData {
1753        type Borrowed<'a> = &'a Self;
1754        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1755            value
1756        }
1757    }
1758
1759    unsafe impl fidl::encoding::TypeMarker for CanceledData {
1760        type Owned = Self;
1761
1762        #[inline(always)]
1763        fn inline_align(_context: fidl::encoding::Context) -> usize {
1764            8
1765        }
1766
1767        #[inline(always)]
1768        fn inline_size(_context: fidl::encoding::Context) -> usize {
1769            16
1770        }
1771    }
1772
1773    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CanceledData, D>
1774        for &CanceledData
1775    {
1776        unsafe fn encode(
1777            self,
1778            encoder: &mut fidl::encoding::Encoder<'_, D>,
1779            offset: usize,
1780            mut depth: fidl::encoding::Depth,
1781        ) -> fidl::Result<()> {
1782            encoder.debug_check_bounds::<CanceledData>(offset);
1783            // Vector header
1784            let max_ordinal: u64 = self.max_ordinal_present();
1785            encoder.write_num(max_ordinal, offset);
1786            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1787            // Calling encoder.out_of_line_offset(0) is not allowed.
1788            if max_ordinal == 0 {
1789                return Ok(());
1790            }
1791            depth.increment()?;
1792            let envelope_size = 8;
1793            let bytes_len = max_ordinal as usize * envelope_size;
1794            #[allow(unused_variables)]
1795            let offset = encoder.out_of_line_offset(bytes_len);
1796            let mut _prev_end_offset: usize = 0;
1797
1798            Ok(())
1799        }
1800    }
1801
1802    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CanceledData {
1803        #[inline(always)]
1804        fn new_empty() -> Self {
1805            Self::default()
1806        }
1807
1808        unsafe fn decode(
1809            &mut self,
1810            decoder: &mut fidl::encoding::Decoder<'_, D>,
1811            offset: usize,
1812            mut depth: fidl::encoding::Depth,
1813        ) -> fidl::Result<()> {
1814            decoder.debug_check_bounds::<Self>(offset);
1815            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1816                None => return Err(fidl::Error::NotNullable),
1817                Some(len) => len,
1818            };
1819            // Calling decoder.out_of_line_offset(0) is not allowed.
1820            if len == 0 {
1821                return Ok(());
1822            };
1823            depth.increment()?;
1824            let envelope_size = 8;
1825            let bytes_len = len * envelope_size;
1826            let offset = decoder.out_of_line_offset(bytes_len)?;
1827            // Decode the envelope for each type.
1828            let mut _next_ordinal_to_read = 0;
1829            let mut next_offset = offset;
1830            let end_offset = offset + bytes_len;
1831
1832            // Decode the remaining unknown envelopes.
1833            while next_offset < end_offset {
1834                _next_ordinal_to_read += 1;
1835                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1836                next_offset += envelope_size;
1837            }
1838
1839            Ok(())
1840        }
1841    }
1842
1843    impl CommitData {
1844        #[inline(always)]
1845        fn max_ordinal_present(&self) -> u64 {
1846            if let Some(_) = self.progress {
1847                return 2;
1848            }
1849            if let Some(_) = self.info {
1850                return 1;
1851            }
1852            0
1853        }
1854    }
1855
1856    impl fidl::encoding::ValueTypeMarker for CommitData {
1857        type Borrowed<'a> = &'a Self;
1858        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1859            value
1860        }
1861    }
1862
1863    unsafe impl fidl::encoding::TypeMarker for CommitData {
1864        type Owned = Self;
1865
1866        #[inline(always)]
1867        fn inline_align(_context: fidl::encoding::Context) -> usize {
1868            8
1869        }
1870
1871        #[inline(always)]
1872        fn inline_size(_context: fidl::encoding::Context) -> usize {
1873            16
1874        }
1875    }
1876
1877    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CommitData, D>
1878        for &CommitData
1879    {
1880        unsafe fn encode(
1881            self,
1882            encoder: &mut fidl::encoding::Encoder<'_, D>,
1883            offset: usize,
1884            mut depth: fidl::encoding::Depth,
1885        ) -> fidl::Result<()> {
1886            encoder.debug_check_bounds::<CommitData>(offset);
1887            // Vector header
1888            let max_ordinal: u64 = self.max_ordinal_present();
1889            encoder.write_num(max_ordinal, offset);
1890            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1891            // Calling encoder.out_of_line_offset(0) is not allowed.
1892            if max_ordinal == 0 {
1893                return Ok(());
1894            }
1895            depth.increment()?;
1896            let envelope_size = 8;
1897            let bytes_len = max_ordinal as usize * envelope_size;
1898            #[allow(unused_variables)]
1899            let offset = encoder.out_of_line_offset(bytes_len);
1900            let mut _prev_end_offset: usize = 0;
1901            if 1 > max_ordinal {
1902                return Ok(());
1903            }
1904
1905            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1906            // are envelope_size bytes.
1907            let cur_offset: usize = (1 - 1) * envelope_size;
1908
1909            // Zero reserved fields.
1910            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1911
1912            // Safety:
1913            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1914            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1915            //   envelope_size bytes, there is always sufficient room.
1916            fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
1917                self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
1918                encoder,
1919                offset + cur_offset,
1920                depth,
1921            )?;
1922
1923            _prev_end_offset = cur_offset + envelope_size;
1924            if 2 > max_ordinal {
1925                return Ok(());
1926            }
1927
1928            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1929            // are envelope_size bytes.
1930            let cur_offset: usize = (2 - 1) * envelope_size;
1931
1932            // Zero reserved fields.
1933            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1934
1935            // Safety:
1936            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1937            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1938            //   envelope_size bytes, there is always sufficient room.
1939            fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
1940                self.progress
1941                    .as_ref()
1942                    .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
1943                encoder,
1944                offset + cur_offset,
1945                depth,
1946            )?;
1947
1948            _prev_end_offset = cur_offset + envelope_size;
1949
1950            Ok(())
1951        }
1952    }
1953
1954    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CommitData {
1955        #[inline(always)]
1956        fn new_empty() -> Self {
1957            Self::default()
1958        }
1959
1960        unsafe fn decode(
1961            &mut self,
1962            decoder: &mut fidl::encoding::Decoder<'_, D>,
1963            offset: usize,
1964            mut depth: fidl::encoding::Depth,
1965        ) -> fidl::Result<()> {
1966            decoder.debug_check_bounds::<Self>(offset);
1967            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1968                None => return Err(fidl::Error::NotNullable),
1969                Some(len) => len,
1970            };
1971            // Calling decoder.out_of_line_offset(0) is not allowed.
1972            if len == 0 {
1973                return Ok(());
1974            };
1975            depth.increment()?;
1976            let envelope_size = 8;
1977            let bytes_len = len * envelope_size;
1978            let offset = decoder.out_of_line_offset(bytes_len)?;
1979            // Decode the envelope for each type.
1980            let mut _next_ordinal_to_read = 0;
1981            let mut next_offset = offset;
1982            let end_offset = offset + bytes_len;
1983            _next_ordinal_to_read += 1;
1984            if next_offset >= end_offset {
1985                return Ok(());
1986            }
1987
1988            // Decode unknown envelopes for gaps in ordinals.
1989            while _next_ordinal_to_read < 1 {
1990                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1991                _next_ordinal_to_read += 1;
1992                next_offset += envelope_size;
1993            }
1994
1995            let next_out_of_line = decoder.next_out_of_line();
1996            let handles_before = decoder.remaining_handles();
1997            if let Some((inlined, num_bytes, num_handles)) =
1998                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1999            {
2000                let member_inline_size =
2001                    <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2002                if inlined != (member_inline_size <= 4) {
2003                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2004                }
2005                let inner_offset;
2006                let mut inner_depth = depth.clone();
2007                if inlined {
2008                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2009                    inner_offset = next_offset;
2010                } else {
2011                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2012                    inner_depth.increment()?;
2013                }
2014                let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
2015                fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
2016                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2017                {
2018                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2019                }
2020                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2021                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2022                }
2023            }
2024
2025            next_offset += envelope_size;
2026            _next_ordinal_to_read += 1;
2027            if next_offset >= end_offset {
2028                return Ok(());
2029            }
2030
2031            // Decode unknown envelopes for gaps in ordinals.
2032            while _next_ordinal_to_read < 2 {
2033                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2034                _next_ordinal_to_read += 1;
2035                next_offset += envelope_size;
2036            }
2037
2038            let next_out_of_line = decoder.next_out_of_line();
2039            let handles_before = decoder.remaining_handles();
2040            if let Some((inlined, num_bytes, num_handles)) =
2041                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2042            {
2043                let member_inline_size =
2044                    <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
2045                        decoder.context,
2046                    );
2047                if inlined != (member_inline_size <= 4) {
2048                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2049                }
2050                let inner_offset;
2051                let mut inner_depth = depth.clone();
2052                if inlined {
2053                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2054                    inner_offset = next_offset;
2055                } else {
2056                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2057                    inner_depth.increment()?;
2058                }
2059                let val_ref =
2060                    self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
2061                fidl::decode!(
2062                    InstallationProgress,
2063                    D,
2064                    val_ref,
2065                    decoder,
2066                    inner_offset,
2067                    inner_depth
2068                )?;
2069                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2070                {
2071                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2072                }
2073                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2074                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2075                }
2076            }
2077
2078            next_offset += envelope_size;
2079
2080            // Decode the remaining unknown envelopes.
2081            while next_offset < end_offset {
2082                _next_ordinal_to_read += 1;
2083                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2084                next_offset += envelope_size;
2085            }
2086
2087            Ok(())
2088        }
2089    }
2090
2091    impl CompleteData {
2092        #[inline(always)]
2093        fn max_ordinal_present(&self) -> u64 {
2094            if let Some(_) = self.progress {
2095                return 2;
2096            }
2097            if let Some(_) = self.info {
2098                return 1;
2099            }
2100            0
2101        }
2102    }
2103
2104    impl fidl::encoding::ValueTypeMarker for CompleteData {
2105        type Borrowed<'a> = &'a Self;
2106        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2107            value
2108        }
2109    }
2110
2111    unsafe impl fidl::encoding::TypeMarker for CompleteData {
2112        type Owned = Self;
2113
2114        #[inline(always)]
2115        fn inline_align(_context: fidl::encoding::Context) -> usize {
2116            8
2117        }
2118
2119        #[inline(always)]
2120        fn inline_size(_context: fidl::encoding::Context) -> usize {
2121            16
2122        }
2123    }
2124
2125    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CompleteData, D>
2126        for &CompleteData
2127    {
2128        unsafe fn encode(
2129            self,
2130            encoder: &mut fidl::encoding::Encoder<'_, D>,
2131            offset: usize,
2132            mut depth: fidl::encoding::Depth,
2133        ) -> fidl::Result<()> {
2134            encoder.debug_check_bounds::<CompleteData>(offset);
2135            // Vector header
2136            let max_ordinal: u64 = self.max_ordinal_present();
2137            encoder.write_num(max_ordinal, offset);
2138            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2139            // Calling encoder.out_of_line_offset(0) is not allowed.
2140            if max_ordinal == 0 {
2141                return Ok(());
2142            }
2143            depth.increment()?;
2144            let envelope_size = 8;
2145            let bytes_len = max_ordinal as usize * envelope_size;
2146            #[allow(unused_variables)]
2147            let offset = encoder.out_of_line_offset(bytes_len);
2148            let mut _prev_end_offset: usize = 0;
2149            if 1 > max_ordinal {
2150                return Ok(());
2151            }
2152
2153            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2154            // are envelope_size bytes.
2155            let cur_offset: usize = (1 - 1) * envelope_size;
2156
2157            // Zero reserved fields.
2158            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2159
2160            // Safety:
2161            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2162            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2163            //   envelope_size bytes, there is always sufficient room.
2164            fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
2165                self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
2166                encoder,
2167                offset + cur_offset,
2168                depth,
2169            )?;
2170
2171            _prev_end_offset = cur_offset + envelope_size;
2172            if 2 > max_ordinal {
2173                return Ok(());
2174            }
2175
2176            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2177            // are envelope_size bytes.
2178            let cur_offset: usize = (2 - 1) * envelope_size;
2179
2180            // Zero reserved fields.
2181            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2182
2183            // Safety:
2184            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2185            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2186            //   envelope_size bytes, there is always sufficient room.
2187            fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
2188                self.progress
2189                    .as_ref()
2190                    .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
2191                encoder,
2192                offset + cur_offset,
2193                depth,
2194            )?;
2195
2196            _prev_end_offset = cur_offset + envelope_size;
2197
2198            Ok(())
2199        }
2200    }
2201
2202    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CompleteData {
2203        #[inline(always)]
2204        fn new_empty() -> Self {
2205            Self::default()
2206        }
2207
2208        unsafe fn decode(
2209            &mut self,
2210            decoder: &mut fidl::encoding::Decoder<'_, D>,
2211            offset: usize,
2212            mut depth: fidl::encoding::Depth,
2213        ) -> fidl::Result<()> {
2214            decoder.debug_check_bounds::<Self>(offset);
2215            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2216                None => return Err(fidl::Error::NotNullable),
2217                Some(len) => len,
2218            };
2219            // Calling decoder.out_of_line_offset(0) is not allowed.
2220            if len == 0 {
2221                return Ok(());
2222            };
2223            depth.increment()?;
2224            let envelope_size = 8;
2225            let bytes_len = len * envelope_size;
2226            let offset = decoder.out_of_line_offset(bytes_len)?;
2227            // Decode the envelope for each type.
2228            let mut _next_ordinal_to_read = 0;
2229            let mut next_offset = offset;
2230            let end_offset = offset + bytes_len;
2231            _next_ordinal_to_read += 1;
2232            if next_offset >= end_offset {
2233                return Ok(());
2234            }
2235
2236            // Decode unknown envelopes for gaps in ordinals.
2237            while _next_ordinal_to_read < 1 {
2238                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2239                _next_ordinal_to_read += 1;
2240                next_offset += envelope_size;
2241            }
2242
2243            let next_out_of_line = decoder.next_out_of_line();
2244            let handles_before = decoder.remaining_handles();
2245            if let Some((inlined, num_bytes, num_handles)) =
2246                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2247            {
2248                let member_inline_size =
2249                    <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2250                if inlined != (member_inline_size <= 4) {
2251                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2252                }
2253                let inner_offset;
2254                let mut inner_depth = depth.clone();
2255                if inlined {
2256                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2257                    inner_offset = next_offset;
2258                } else {
2259                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2260                    inner_depth.increment()?;
2261                }
2262                let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
2263                fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
2264                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2265                {
2266                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2267                }
2268                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2269                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2270                }
2271            }
2272
2273            next_offset += envelope_size;
2274            _next_ordinal_to_read += 1;
2275            if next_offset >= end_offset {
2276                return Ok(());
2277            }
2278
2279            // Decode unknown envelopes for gaps in ordinals.
2280            while _next_ordinal_to_read < 2 {
2281                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2282                _next_ordinal_to_read += 1;
2283                next_offset += envelope_size;
2284            }
2285
2286            let next_out_of_line = decoder.next_out_of_line();
2287            let handles_before = decoder.remaining_handles();
2288            if let Some((inlined, num_bytes, num_handles)) =
2289                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2290            {
2291                let member_inline_size =
2292                    <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
2293                        decoder.context,
2294                    );
2295                if inlined != (member_inline_size <= 4) {
2296                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2297                }
2298                let inner_offset;
2299                let mut inner_depth = depth.clone();
2300                if inlined {
2301                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2302                    inner_offset = next_offset;
2303                } else {
2304                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2305                    inner_depth.increment()?;
2306                }
2307                let val_ref =
2308                    self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
2309                fidl::decode!(
2310                    InstallationProgress,
2311                    D,
2312                    val_ref,
2313                    decoder,
2314                    inner_offset,
2315                    inner_depth
2316                )?;
2317                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2318                {
2319                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2320                }
2321                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2322                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2323                }
2324            }
2325
2326            next_offset += envelope_size;
2327
2328            // Decode the remaining unknown envelopes.
2329            while next_offset < end_offset {
2330                _next_ordinal_to_read += 1;
2331                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2332                next_offset += envelope_size;
2333            }
2334
2335            Ok(())
2336        }
2337    }
2338
2339    impl DeferRebootData {
2340        #[inline(always)]
2341        fn max_ordinal_present(&self) -> u64 {
2342            if let Some(_) = self.progress {
2343                return 2;
2344            }
2345            if let Some(_) = self.info {
2346                return 1;
2347            }
2348            0
2349        }
2350    }
2351
2352    impl fidl::encoding::ValueTypeMarker for DeferRebootData {
2353        type Borrowed<'a> = &'a Self;
2354        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2355            value
2356        }
2357    }
2358
2359    unsafe impl fidl::encoding::TypeMarker for DeferRebootData {
2360        type Owned = Self;
2361
2362        #[inline(always)]
2363        fn inline_align(_context: fidl::encoding::Context) -> usize {
2364            8
2365        }
2366
2367        #[inline(always)]
2368        fn inline_size(_context: fidl::encoding::Context) -> usize {
2369            16
2370        }
2371    }
2372
2373    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DeferRebootData, D>
2374        for &DeferRebootData
2375    {
2376        unsafe fn encode(
2377            self,
2378            encoder: &mut fidl::encoding::Encoder<'_, D>,
2379            offset: usize,
2380            mut depth: fidl::encoding::Depth,
2381        ) -> fidl::Result<()> {
2382            encoder.debug_check_bounds::<DeferRebootData>(offset);
2383            // Vector header
2384            let max_ordinal: u64 = self.max_ordinal_present();
2385            encoder.write_num(max_ordinal, offset);
2386            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2387            // Calling encoder.out_of_line_offset(0) is not allowed.
2388            if max_ordinal == 0 {
2389                return Ok(());
2390            }
2391            depth.increment()?;
2392            let envelope_size = 8;
2393            let bytes_len = max_ordinal as usize * envelope_size;
2394            #[allow(unused_variables)]
2395            let offset = encoder.out_of_line_offset(bytes_len);
2396            let mut _prev_end_offset: usize = 0;
2397            if 1 > max_ordinal {
2398                return Ok(());
2399            }
2400
2401            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2402            // are envelope_size bytes.
2403            let cur_offset: usize = (1 - 1) * envelope_size;
2404
2405            // Zero reserved fields.
2406            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2407
2408            // Safety:
2409            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2410            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2411            //   envelope_size bytes, there is always sufficient room.
2412            fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
2413                self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
2414                encoder,
2415                offset + cur_offset,
2416                depth,
2417            )?;
2418
2419            _prev_end_offset = cur_offset + envelope_size;
2420            if 2 > max_ordinal {
2421                return Ok(());
2422            }
2423
2424            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2425            // are envelope_size bytes.
2426            let cur_offset: usize = (2 - 1) * envelope_size;
2427
2428            // Zero reserved fields.
2429            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2430
2431            // Safety:
2432            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2433            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2434            //   envelope_size bytes, there is always sufficient room.
2435            fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
2436                self.progress
2437                    .as_ref()
2438                    .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
2439                encoder,
2440                offset + cur_offset,
2441                depth,
2442            )?;
2443
2444            _prev_end_offset = cur_offset + envelope_size;
2445
2446            Ok(())
2447        }
2448    }
2449
2450    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeferRebootData {
2451        #[inline(always)]
2452        fn new_empty() -> Self {
2453            Self::default()
2454        }
2455
2456        unsafe fn decode(
2457            &mut self,
2458            decoder: &mut fidl::encoding::Decoder<'_, D>,
2459            offset: usize,
2460            mut depth: fidl::encoding::Depth,
2461        ) -> fidl::Result<()> {
2462            decoder.debug_check_bounds::<Self>(offset);
2463            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2464                None => return Err(fidl::Error::NotNullable),
2465                Some(len) => len,
2466            };
2467            // Calling decoder.out_of_line_offset(0) is not allowed.
2468            if len == 0 {
2469                return Ok(());
2470            };
2471            depth.increment()?;
2472            let envelope_size = 8;
2473            let bytes_len = len * envelope_size;
2474            let offset = decoder.out_of_line_offset(bytes_len)?;
2475            // Decode the envelope for each type.
2476            let mut _next_ordinal_to_read = 0;
2477            let mut next_offset = offset;
2478            let end_offset = offset + bytes_len;
2479            _next_ordinal_to_read += 1;
2480            if next_offset >= end_offset {
2481                return Ok(());
2482            }
2483
2484            // Decode unknown envelopes for gaps in ordinals.
2485            while _next_ordinal_to_read < 1 {
2486                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2487                _next_ordinal_to_read += 1;
2488                next_offset += envelope_size;
2489            }
2490
2491            let next_out_of_line = decoder.next_out_of_line();
2492            let handles_before = decoder.remaining_handles();
2493            if let Some((inlined, num_bytes, num_handles)) =
2494                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2495            {
2496                let member_inline_size =
2497                    <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2498                if inlined != (member_inline_size <= 4) {
2499                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2500                }
2501                let inner_offset;
2502                let mut inner_depth = depth.clone();
2503                if inlined {
2504                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2505                    inner_offset = next_offset;
2506                } else {
2507                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2508                    inner_depth.increment()?;
2509                }
2510                let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
2511                fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
2512                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2513                {
2514                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2515                }
2516                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2517                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2518                }
2519            }
2520
2521            next_offset += envelope_size;
2522            _next_ordinal_to_read += 1;
2523            if next_offset >= end_offset {
2524                return Ok(());
2525            }
2526
2527            // Decode unknown envelopes for gaps in ordinals.
2528            while _next_ordinal_to_read < 2 {
2529                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2530                _next_ordinal_to_read += 1;
2531                next_offset += envelope_size;
2532            }
2533
2534            let next_out_of_line = decoder.next_out_of_line();
2535            let handles_before = decoder.remaining_handles();
2536            if let Some((inlined, num_bytes, num_handles)) =
2537                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2538            {
2539                let member_inline_size =
2540                    <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
2541                        decoder.context,
2542                    );
2543                if inlined != (member_inline_size <= 4) {
2544                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2545                }
2546                let inner_offset;
2547                let mut inner_depth = depth.clone();
2548                if inlined {
2549                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2550                    inner_offset = next_offset;
2551                } else {
2552                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2553                    inner_depth.increment()?;
2554                }
2555                let val_ref =
2556                    self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
2557                fidl::decode!(
2558                    InstallationProgress,
2559                    D,
2560                    val_ref,
2561                    decoder,
2562                    inner_offset,
2563                    inner_depth
2564                )?;
2565                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2566                {
2567                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2568                }
2569                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2570                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2571                }
2572            }
2573
2574            next_offset += envelope_size;
2575
2576            // Decode the remaining unknown envelopes.
2577            while next_offset < end_offset {
2578                _next_ordinal_to_read += 1;
2579                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2580                next_offset += envelope_size;
2581            }
2582
2583            Ok(())
2584        }
2585    }
2586
2587    impl FailCommitData {
2588        #[inline(always)]
2589        fn max_ordinal_present(&self) -> u64 {
2590            if let Some(_) = self.progress {
2591                return 2;
2592            }
2593            if let Some(_) = self.info {
2594                return 1;
2595            }
2596            0
2597        }
2598    }
2599
2600    impl fidl::encoding::ValueTypeMarker for FailCommitData {
2601        type Borrowed<'a> = &'a Self;
2602        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2603            value
2604        }
2605    }
2606
2607    unsafe impl fidl::encoding::TypeMarker for FailCommitData {
2608        type Owned = Self;
2609
2610        #[inline(always)]
2611        fn inline_align(_context: fidl::encoding::Context) -> usize {
2612            8
2613        }
2614
2615        #[inline(always)]
2616        fn inline_size(_context: fidl::encoding::Context) -> usize {
2617            16
2618        }
2619    }
2620
2621    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FailCommitData, D>
2622        for &FailCommitData
2623    {
2624        unsafe fn encode(
2625            self,
2626            encoder: &mut fidl::encoding::Encoder<'_, D>,
2627            offset: usize,
2628            mut depth: fidl::encoding::Depth,
2629        ) -> fidl::Result<()> {
2630            encoder.debug_check_bounds::<FailCommitData>(offset);
2631            // Vector header
2632            let max_ordinal: u64 = self.max_ordinal_present();
2633            encoder.write_num(max_ordinal, offset);
2634            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2635            // Calling encoder.out_of_line_offset(0) is not allowed.
2636            if max_ordinal == 0 {
2637                return Ok(());
2638            }
2639            depth.increment()?;
2640            let envelope_size = 8;
2641            let bytes_len = max_ordinal as usize * envelope_size;
2642            #[allow(unused_variables)]
2643            let offset = encoder.out_of_line_offset(bytes_len);
2644            let mut _prev_end_offset: usize = 0;
2645            if 1 > max_ordinal {
2646                return Ok(());
2647            }
2648
2649            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2650            // are envelope_size bytes.
2651            let cur_offset: usize = (1 - 1) * envelope_size;
2652
2653            // Zero reserved fields.
2654            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2655
2656            // Safety:
2657            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2658            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2659            //   envelope_size bytes, there is always sufficient room.
2660            fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
2661                self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
2662                encoder,
2663                offset + cur_offset,
2664                depth,
2665            )?;
2666
2667            _prev_end_offset = cur_offset + envelope_size;
2668            if 2 > max_ordinal {
2669                return Ok(());
2670            }
2671
2672            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2673            // are envelope_size bytes.
2674            let cur_offset: usize = (2 - 1) * envelope_size;
2675
2676            // Zero reserved fields.
2677            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2678
2679            // Safety:
2680            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2681            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2682            //   envelope_size bytes, there is always sufficient room.
2683            fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
2684                self.progress
2685                    .as_ref()
2686                    .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
2687                encoder,
2688                offset + cur_offset,
2689                depth,
2690            )?;
2691
2692            _prev_end_offset = cur_offset + envelope_size;
2693
2694            Ok(())
2695        }
2696    }
2697
2698    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FailCommitData {
2699        #[inline(always)]
2700        fn new_empty() -> Self {
2701            Self::default()
2702        }
2703
2704        unsafe fn decode(
2705            &mut self,
2706            decoder: &mut fidl::encoding::Decoder<'_, D>,
2707            offset: usize,
2708            mut depth: fidl::encoding::Depth,
2709        ) -> fidl::Result<()> {
2710            decoder.debug_check_bounds::<Self>(offset);
2711            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2712                None => return Err(fidl::Error::NotNullable),
2713                Some(len) => len,
2714            };
2715            // Calling decoder.out_of_line_offset(0) is not allowed.
2716            if len == 0 {
2717                return Ok(());
2718            };
2719            depth.increment()?;
2720            let envelope_size = 8;
2721            let bytes_len = len * envelope_size;
2722            let offset = decoder.out_of_line_offset(bytes_len)?;
2723            // Decode the envelope for each type.
2724            let mut _next_ordinal_to_read = 0;
2725            let mut next_offset = offset;
2726            let end_offset = offset + bytes_len;
2727            _next_ordinal_to_read += 1;
2728            if next_offset >= end_offset {
2729                return Ok(());
2730            }
2731
2732            // Decode unknown envelopes for gaps in ordinals.
2733            while _next_ordinal_to_read < 1 {
2734                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2735                _next_ordinal_to_read += 1;
2736                next_offset += envelope_size;
2737            }
2738
2739            let next_out_of_line = decoder.next_out_of_line();
2740            let handles_before = decoder.remaining_handles();
2741            if let Some((inlined, num_bytes, num_handles)) =
2742                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2743            {
2744                let member_inline_size =
2745                    <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2746                if inlined != (member_inline_size <= 4) {
2747                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2748                }
2749                let inner_offset;
2750                let mut inner_depth = depth.clone();
2751                if inlined {
2752                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2753                    inner_offset = next_offset;
2754                } else {
2755                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2756                    inner_depth.increment()?;
2757                }
2758                let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
2759                fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
2760                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2761                {
2762                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2763                }
2764                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2765                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2766                }
2767            }
2768
2769            next_offset += envelope_size;
2770            _next_ordinal_to_read += 1;
2771            if next_offset >= end_offset {
2772                return Ok(());
2773            }
2774
2775            // Decode unknown envelopes for gaps in ordinals.
2776            while _next_ordinal_to_read < 2 {
2777                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2778                _next_ordinal_to_read += 1;
2779                next_offset += envelope_size;
2780            }
2781
2782            let next_out_of_line = decoder.next_out_of_line();
2783            let handles_before = decoder.remaining_handles();
2784            if let Some((inlined, num_bytes, num_handles)) =
2785                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2786            {
2787                let member_inline_size =
2788                    <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
2789                        decoder.context,
2790                    );
2791                if inlined != (member_inline_size <= 4) {
2792                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2793                }
2794                let inner_offset;
2795                let mut inner_depth = depth.clone();
2796                if inlined {
2797                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2798                    inner_offset = next_offset;
2799                } else {
2800                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2801                    inner_depth.increment()?;
2802                }
2803                let val_ref =
2804                    self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
2805                fidl::decode!(
2806                    InstallationProgress,
2807                    D,
2808                    val_ref,
2809                    decoder,
2810                    inner_offset,
2811                    inner_depth
2812                )?;
2813                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2814                {
2815                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2816                }
2817                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2818                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2819                }
2820            }
2821
2822            next_offset += envelope_size;
2823
2824            // Decode the remaining unknown envelopes.
2825            while next_offset < end_offset {
2826                _next_ordinal_to_read += 1;
2827                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2828                next_offset += envelope_size;
2829            }
2830
2831            Ok(())
2832        }
2833    }
2834
2835    impl FailFetchData {
2836        #[inline(always)]
2837        fn max_ordinal_present(&self) -> u64 {
2838            if let Some(_) = self.reason {
2839                return 3;
2840            }
2841            if let Some(_) = self.progress {
2842                return 2;
2843            }
2844            if let Some(_) = self.info {
2845                return 1;
2846            }
2847            0
2848        }
2849    }
2850
2851    impl fidl::encoding::ValueTypeMarker for FailFetchData {
2852        type Borrowed<'a> = &'a Self;
2853        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2854            value
2855        }
2856    }
2857
2858    unsafe impl fidl::encoding::TypeMarker for FailFetchData {
2859        type Owned = Self;
2860
2861        #[inline(always)]
2862        fn inline_align(_context: fidl::encoding::Context) -> usize {
2863            8
2864        }
2865
2866        #[inline(always)]
2867        fn inline_size(_context: fidl::encoding::Context) -> usize {
2868            16
2869        }
2870    }
2871
2872    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FailFetchData, D>
2873        for &FailFetchData
2874    {
2875        unsafe fn encode(
2876            self,
2877            encoder: &mut fidl::encoding::Encoder<'_, D>,
2878            offset: usize,
2879            mut depth: fidl::encoding::Depth,
2880        ) -> fidl::Result<()> {
2881            encoder.debug_check_bounds::<FailFetchData>(offset);
2882            // Vector header
2883            let max_ordinal: u64 = self.max_ordinal_present();
2884            encoder.write_num(max_ordinal, offset);
2885            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2886            // Calling encoder.out_of_line_offset(0) is not allowed.
2887            if max_ordinal == 0 {
2888                return Ok(());
2889            }
2890            depth.increment()?;
2891            let envelope_size = 8;
2892            let bytes_len = max_ordinal as usize * envelope_size;
2893            #[allow(unused_variables)]
2894            let offset = encoder.out_of_line_offset(bytes_len);
2895            let mut _prev_end_offset: usize = 0;
2896            if 1 > max_ordinal {
2897                return Ok(());
2898            }
2899
2900            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2901            // are envelope_size bytes.
2902            let cur_offset: usize = (1 - 1) * envelope_size;
2903
2904            // Zero reserved fields.
2905            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2906
2907            // Safety:
2908            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2909            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2910            //   envelope_size bytes, there is always sufficient room.
2911            fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
2912                self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
2913                encoder,
2914                offset + cur_offset,
2915                depth,
2916            )?;
2917
2918            _prev_end_offset = cur_offset + envelope_size;
2919            if 2 > max_ordinal {
2920                return Ok(());
2921            }
2922
2923            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2924            // are envelope_size bytes.
2925            let cur_offset: usize = (2 - 1) * envelope_size;
2926
2927            // Zero reserved fields.
2928            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2929
2930            // Safety:
2931            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2932            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2933            //   envelope_size bytes, there is always sufficient room.
2934            fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
2935                self.progress
2936                    .as_ref()
2937                    .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
2938                encoder,
2939                offset + cur_offset,
2940                depth,
2941            )?;
2942
2943            _prev_end_offset = cur_offset + envelope_size;
2944            if 3 > max_ordinal {
2945                return Ok(());
2946            }
2947
2948            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2949            // are envelope_size bytes.
2950            let cur_offset: usize = (3 - 1) * envelope_size;
2951
2952            // Zero reserved fields.
2953            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2954
2955            // Safety:
2956            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2957            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2958            //   envelope_size bytes, there is always sufficient room.
2959            fidl::encoding::encode_in_envelope_optional::<FetchFailureReason, D>(
2960                self.reason
2961                    .as_ref()
2962                    .map(<FetchFailureReason as fidl::encoding::ValueTypeMarker>::borrow),
2963                encoder,
2964                offset + cur_offset,
2965                depth,
2966            )?;
2967
2968            _prev_end_offset = cur_offset + envelope_size;
2969
2970            Ok(())
2971        }
2972    }
2973
2974    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FailFetchData {
2975        #[inline(always)]
2976        fn new_empty() -> Self {
2977            Self::default()
2978        }
2979
2980        unsafe fn decode(
2981            &mut self,
2982            decoder: &mut fidl::encoding::Decoder<'_, D>,
2983            offset: usize,
2984            mut depth: fidl::encoding::Depth,
2985        ) -> fidl::Result<()> {
2986            decoder.debug_check_bounds::<Self>(offset);
2987            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2988                None => return Err(fidl::Error::NotNullable),
2989                Some(len) => len,
2990            };
2991            // Calling decoder.out_of_line_offset(0) is not allowed.
2992            if len == 0 {
2993                return Ok(());
2994            };
2995            depth.increment()?;
2996            let envelope_size = 8;
2997            let bytes_len = len * envelope_size;
2998            let offset = decoder.out_of_line_offset(bytes_len)?;
2999            // Decode the envelope for each type.
3000            let mut _next_ordinal_to_read = 0;
3001            let mut next_offset = offset;
3002            let end_offset = offset + bytes_len;
3003            _next_ordinal_to_read += 1;
3004            if next_offset >= end_offset {
3005                return Ok(());
3006            }
3007
3008            // Decode unknown envelopes for gaps in ordinals.
3009            while _next_ordinal_to_read < 1 {
3010                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3011                _next_ordinal_to_read += 1;
3012                next_offset += envelope_size;
3013            }
3014
3015            let next_out_of_line = decoder.next_out_of_line();
3016            let handles_before = decoder.remaining_handles();
3017            if let Some((inlined, num_bytes, num_handles)) =
3018                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3019            {
3020                let member_inline_size =
3021                    <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3022                if inlined != (member_inline_size <= 4) {
3023                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3024                }
3025                let inner_offset;
3026                let mut inner_depth = depth.clone();
3027                if inlined {
3028                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3029                    inner_offset = next_offset;
3030                } else {
3031                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3032                    inner_depth.increment()?;
3033                }
3034                let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
3035                fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
3036                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3037                {
3038                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3039                }
3040                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3041                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3042                }
3043            }
3044
3045            next_offset += envelope_size;
3046            _next_ordinal_to_read += 1;
3047            if next_offset >= end_offset {
3048                return Ok(());
3049            }
3050
3051            // Decode unknown envelopes for gaps in ordinals.
3052            while _next_ordinal_to_read < 2 {
3053                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3054                _next_ordinal_to_read += 1;
3055                next_offset += envelope_size;
3056            }
3057
3058            let next_out_of_line = decoder.next_out_of_line();
3059            let handles_before = decoder.remaining_handles();
3060            if let Some((inlined, num_bytes, num_handles)) =
3061                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3062            {
3063                let member_inline_size =
3064                    <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
3065                        decoder.context,
3066                    );
3067                if inlined != (member_inline_size <= 4) {
3068                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3069                }
3070                let inner_offset;
3071                let mut inner_depth = depth.clone();
3072                if inlined {
3073                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3074                    inner_offset = next_offset;
3075                } else {
3076                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3077                    inner_depth.increment()?;
3078                }
3079                let val_ref =
3080                    self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
3081                fidl::decode!(
3082                    InstallationProgress,
3083                    D,
3084                    val_ref,
3085                    decoder,
3086                    inner_offset,
3087                    inner_depth
3088                )?;
3089                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3090                {
3091                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3092                }
3093                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3094                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3095                }
3096            }
3097
3098            next_offset += envelope_size;
3099            _next_ordinal_to_read += 1;
3100            if next_offset >= end_offset {
3101                return Ok(());
3102            }
3103
3104            // Decode unknown envelopes for gaps in ordinals.
3105            while _next_ordinal_to_read < 3 {
3106                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3107                _next_ordinal_to_read += 1;
3108                next_offset += envelope_size;
3109            }
3110
3111            let next_out_of_line = decoder.next_out_of_line();
3112            let handles_before = decoder.remaining_handles();
3113            if let Some((inlined, num_bytes, num_handles)) =
3114                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3115            {
3116                let member_inline_size =
3117                    <FetchFailureReason as fidl::encoding::TypeMarker>::inline_size(
3118                        decoder.context,
3119                    );
3120                if inlined != (member_inline_size <= 4) {
3121                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3122                }
3123                let inner_offset;
3124                let mut inner_depth = depth.clone();
3125                if inlined {
3126                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3127                    inner_offset = next_offset;
3128                } else {
3129                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3130                    inner_depth.increment()?;
3131                }
3132                let val_ref =
3133                    self.reason.get_or_insert_with(|| fidl::new_empty!(FetchFailureReason, D));
3134                fidl::decode!(FetchFailureReason, D, val_ref, decoder, inner_offset, inner_depth)?;
3135                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3136                {
3137                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3138                }
3139                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3140                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3141                }
3142            }
3143
3144            next_offset += envelope_size;
3145
3146            // Decode the remaining unknown envelopes.
3147            while next_offset < end_offset {
3148                _next_ordinal_to_read += 1;
3149                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3150                next_offset += envelope_size;
3151            }
3152
3153            Ok(())
3154        }
3155    }
3156
3157    impl FailPrepareData {
3158        #[inline(always)]
3159        fn max_ordinal_present(&self) -> u64 {
3160            if let Some(_) = self.reason {
3161                return 1;
3162            }
3163            0
3164        }
3165    }
3166
3167    impl fidl::encoding::ValueTypeMarker for FailPrepareData {
3168        type Borrowed<'a> = &'a Self;
3169        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3170            value
3171        }
3172    }
3173
3174    unsafe impl fidl::encoding::TypeMarker for FailPrepareData {
3175        type Owned = Self;
3176
3177        #[inline(always)]
3178        fn inline_align(_context: fidl::encoding::Context) -> usize {
3179            8
3180        }
3181
3182        #[inline(always)]
3183        fn inline_size(_context: fidl::encoding::Context) -> usize {
3184            16
3185        }
3186    }
3187
3188    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FailPrepareData, D>
3189        for &FailPrepareData
3190    {
3191        unsafe fn encode(
3192            self,
3193            encoder: &mut fidl::encoding::Encoder<'_, D>,
3194            offset: usize,
3195            mut depth: fidl::encoding::Depth,
3196        ) -> fidl::Result<()> {
3197            encoder.debug_check_bounds::<FailPrepareData>(offset);
3198            // Vector header
3199            let max_ordinal: u64 = self.max_ordinal_present();
3200            encoder.write_num(max_ordinal, offset);
3201            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3202            // Calling encoder.out_of_line_offset(0) is not allowed.
3203            if max_ordinal == 0 {
3204                return Ok(());
3205            }
3206            depth.increment()?;
3207            let envelope_size = 8;
3208            let bytes_len = max_ordinal as usize * envelope_size;
3209            #[allow(unused_variables)]
3210            let offset = encoder.out_of_line_offset(bytes_len);
3211            let mut _prev_end_offset: usize = 0;
3212            if 1 > max_ordinal {
3213                return Ok(());
3214            }
3215
3216            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3217            // are envelope_size bytes.
3218            let cur_offset: usize = (1 - 1) * envelope_size;
3219
3220            // Zero reserved fields.
3221            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3222
3223            // Safety:
3224            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3225            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3226            //   envelope_size bytes, there is always sufficient room.
3227            fidl::encoding::encode_in_envelope_optional::<PrepareFailureReason, D>(
3228                self.reason
3229                    .as_ref()
3230                    .map(<PrepareFailureReason as fidl::encoding::ValueTypeMarker>::borrow),
3231                encoder,
3232                offset + cur_offset,
3233                depth,
3234            )?;
3235
3236            _prev_end_offset = cur_offset + envelope_size;
3237
3238            Ok(())
3239        }
3240    }
3241
3242    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FailPrepareData {
3243        #[inline(always)]
3244        fn new_empty() -> Self {
3245            Self::default()
3246        }
3247
3248        unsafe fn decode(
3249            &mut self,
3250            decoder: &mut fidl::encoding::Decoder<'_, D>,
3251            offset: usize,
3252            mut depth: fidl::encoding::Depth,
3253        ) -> fidl::Result<()> {
3254            decoder.debug_check_bounds::<Self>(offset);
3255            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3256                None => return Err(fidl::Error::NotNullable),
3257                Some(len) => len,
3258            };
3259            // Calling decoder.out_of_line_offset(0) is not allowed.
3260            if len == 0 {
3261                return Ok(());
3262            };
3263            depth.increment()?;
3264            let envelope_size = 8;
3265            let bytes_len = len * envelope_size;
3266            let offset = decoder.out_of_line_offset(bytes_len)?;
3267            // Decode the envelope for each type.
3268            let mut _next_ordinal_to_read = 0;
3269            let mut next_offset = offset;
3270            let end_offset = offset + bytes_len;
3271            _next_ordinal_to_read += 1;
3272            if next_offset >= end_offset {
3273                return Ok(());
3274            }
3275
3276            // Decode unknown envelopes for gaps in ordinals.
3277            while _next_ordinal_to_read < 1 {
3278                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3279                _next_ordinal_to_read += 1;
3280                next_offset += envelope_size;
3281            }
3282
3283            let next_out_of_line = decoder.next_out_of_line();
3284            let handles_before = decoder.remaining_handles();
3285            if let Some((inlined, num_bytes, num_handles)) =
3286                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3287            {
3288                let member_inline_size =
3289                    <PrepareFailureReason as fidl::encoding::TypeMarker>::inline_size(
3290                        decoder.context,
3291                    );
3292                if inlined != (member_inline_size <= 4) {
3293                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3294                }
3295                let inner_offset;
3296                let mut inner_depth = depth.clone();
3297                if inlined {
3298                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3299                    inner_offset = next_offset;
3300                } else {
3301                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3302                    inner_depth.increment()?;
3303                }
3304                let val_ref =
3305                    self.reason.get_or_insert_with(|| fidl::new_empty!(PrepareFailureReason, D));
3306                fidl::decode!(
3307                    PrepareFailureReason,
3308                    D,
3309                    val_ref,
3310                    decoder,
3311                    inner_offset,
3312                    inner_depth
3313                )?;
3314                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3315                {
3316                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3317                }
3318                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3319                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3320                }
3321            }
3322
3323            next_offset += envelope_size;
3324
3325            // Decode the remaining unknown envelopes.
3326            while next_offset < end_offset {
3327                _next_ordinal_to_read += 1;
3328                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3329                next_offset += envelope_size;
3330            }
3331
3332            Ok(())
3333        }
3334    }
3335
3336    impl FailStageData {
3337        #[inline(always)]
3338        fn max_ordinal_present(&self) -> u64 {
3339            if let Some(_) = self.reason {
3340                return 3;
3341            }
3342            if let Some(_) = self.progress {
3343                return 2;
3344            }
3345            if let Some(_) = self.info {
3346                return 1;
3347            }
3348            0
3349        }
3350    }
3351
3352    impl fidl::encoding::ValueTypeMarker for FailStageData {
3353        type Borrowed<'a> = &'a Self;
3354        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3355            value
3356        }
3357    }
3358
3359    unsafe impl fidl::encoding::TypeMarker for FailStageData {
3360        type Owned = Self;
3361
3362        #[inline(always)]
3363        fn inline_align(_context: fidl::encoding::Context) -> usize {
3364            8
3365        }
3366
3367        #[inline(always)]
3368        fn inline_size(_context: fidl::encoding::Context) -> usize {
3369            16
3370        }
3371    }
3372
3373    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FailStageData, D>
3374        for &FailStageData
3375    {
3376        unsafe fn encode(
3377            self,
3378            encoder: &mut fidl::encoding::Encoder<'_, D>,
3379            offset: usize,
3380            mut depth: fidl::encoding::Depth,
3381        ) -> fidl::Result<()> {
3382            encoder.debug_check_bounds::<FailStageData>(offset);
3383            // Vector header
3384            let max_ordinal: u64 = self.max_ordinal_present();
3385            encoder.write_num(max_ordinal, offset);
3386            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3387            // Calling encoder.out_of_line_offset(0) is not allowed.
3388            if max_ordinal == 0 {
3389                return Ok(());
3390            }
3391            depth.increment()?;
3392            let envelope_size = 8;
3393            let bytes_len = max_ordinal as usize * envelope_size;
3394            #[allow(unused_variables)]
3395            let offset = encoder.out_of_line_offset(bytes_len);
3396            let mut _prev_end_offset: usize = 0;
3397            if 1 > max_ordinal {
3398                return Ok(());
3399            }
3400
3401            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3402            // are envelope_size bytes.
3403            let cur_offset: usize = (1 - 1) * envelope_size;
3404
3405            // Zero reserved fields.
3406            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3407
3408            // Safety:
3409            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3410            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3411            //   envelope_size bytes, there is always sufficient room.
3412            fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
3413                self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
3414                encoder,
3415                offset + cur_offset,
3416                depth,
3417            )?;
3418
3419            _prev_end_offset = cur_offset + envelope_size;
3420            if 2 > max_ordinal {
3421                return Ok(());
3422            }
3423
3424            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3425            // are envelope_size bytes.
3426            let cur_offset: usize = (2 - 1) * envelope_size;
3427
3428            // Zero reserved fields.
3429            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3430
3431            // Safety:
3432            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3433            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3434            //   envelope_size bytes, there is always sufficient room.
3435            fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
3436                self.progress
3437                    .as_ref()
3438                    .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
3439                encoder,
3440                offset + cur_offset,
3441                depth,
3442            )?;
3443
3444            _prev_end_offset = cur_offset + envelope_size;
3445            if 3 > max_ordinal {
3446                return Ok(());
3447            }
3448
3449            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3450            // are envelope_size bytes.
3451            let cur_offset: usize = (3 - 1) * envelope_size;
3452
3453            // Zero reserved fields.
3454            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3455
3456            // Safety:
3457            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3458            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3459            //   envelope_size bytes, there is always sufficient room.
3460            fidl::encoding::encode_in_envelope_optional::<StageFailureReason, D>(
3461                self.reason
3462                    .as_ref()
3463                    .map(<StageFailureReason as fidl::encoding::ValueTypeMarker>::borrow),
3464                encoder,
3465                offset + cur_offset,
3466                depth,
3467            )?;
3468
3469            _prev_end_offset = cur_offset + envelope_size;
3470
3471            Ok(())
3472        }
3473    }
3474
3475    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FailStageData {
3476        #[inline(always)]
3477        fn new_empty() -> Self {
3478            Self::default()
3479        }
3480
3481        unsafe fn decode(
3482            &mut self,
3483            decoder: &mut fidl::encoding::Decoder<'_, D>,
3484            offset: usize,
3485            mut depth: fidl::encoding::Depth,
3486        ) -> fidl::Result<()> {
3487            decoder.debug_check_bounds::<Self>(offset);
3488            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3489                None => return Err(fidl::Error::NotNullable),
3490                Some(len) => len,
3491            };
3492            // Calling decoder.out_of_line_offset(0) is not allowed.
3493            if len == 0 {
3494                return Ok(());
3495            };
3496            depth.increment()?;
3497            let envelope_size = 8;
3498            let bytes_len = len * envelope_size;
3499            let offset = decoder.out_of_line_offset(bytes_len)?;
3500            // Decode the envelope for each type.
3501            let mut _next_ordinal_to_read = 0;
3502            let mut next_offset = offset;
3503            let end_offset = offset + bytes_len;
3504            _next_ordinal_to_read += 1;
3505            if next_offset >= end_offset {
3506                return Ok(());
3507            }
3508
3509            // Decode unknown envelopes for gaps in ordinals.
3510            while _next_ordinal_to_read < 1 {
3511                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3512                _next_ordinal_to_read += 1;
3513                next_offset += envelope_size;
3514            }
3515
3516            let next_out_of_line = decoder.next_out_of_line();
3517            let handles_before = decoder.remaining_handles();
3518            if let Some((inlined, num_bytes, num_handles)) =
3519                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3520            {
3521                let member_inline_size =
3522                    <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3523                if inlined != (member_inline_size <= 4) {
3524                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3525                }
3526                let inner_offset;
3527                let mut inner_depth = depth.clone();
3528                if inlined {
3529                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3530                    inner_offset = next_offset;
3531                } else {
3532                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3533                    inner_depth.increment()?;
3534                }
3535                let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
3536                fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
3537                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3538                {
3539                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3540                }
3541                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3542                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3543                }
3544            }
3545
3546            next_offset += envelope_size;
3547            _next_ordinal_to_read += 1;
3548            if next_offset >= end_offset {
3549                return Ok(());
3550            }
3551
3552            // Decode unknown envelopes for gaps in ordinals.
3553            while _next_ordinal_to_read < 2 {
3554                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3555                _next_ordinal_to_read += 1;
3556                next_offset += envelope_size;
3557            }
3558
3559            let next_out_of_line = decoder.next_out_of_line();
3560            let handles_before = decoder.remaining_handles();
3561            if let Some((inlined, num_bytes, num_handles)) =
3562                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3563            {
3564                let member_inline_size =
3565                    <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
3566                        decoder.context,
3567                    );
3568                if inlined != (member_inline_size <= 4) {
3569                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3570                }
3571                let inner_offset;
3572                let mut inner_depth = depth.clone();
3573                if inlined {
3574                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3575                    inner_offset = next_offset;
3576                } else {
3577                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3578                    inner_depth.increment()?;
3579                }
3580                let val_ref =
3581                    self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
3582                fidl::decode!(
3583                    InstallationProgress,
3584                    D,
3585                    val_ref,
3586                    decoder,
3587                    inner_offset,
3588                    inner_depth
3589                )?;
3590                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3591                {
3592                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3593                }
3594                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3595                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3596                }
3597            }
3598
3599            next_offset += envelope_size;
3600            _next_ordinal_to_read += 1;
3601            if next_offset >= end_offset {
3602                return Ok(());
3603            }
3604
3605            // Decode unknown envelopes for gaps in ordinals.
3606            while _next_ordinal_to_read < 3 {
3607                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3608                _next_ordinal_to_read += 1;
3609                next_offset += envelope_size;
3610            }
3611
3612            let next_out_of_line = decoder.next_out_of_line();
3613            let handles_before = decoder.remaining_handles();
3614            if let Some((inlined, num_bytes, num_handles)) =
3615                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3616            {
3617                let member_inline_size =
3618                    <StageFailureReason as fidl::encoding::TypeMarker>::inline_size(
3619                        decoder.context,
3620                    );
3621                if inlined != (member_inline_size <= 4) {
3622                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3623                }
3624                let inner_offset;
3625                let mut inner_depth = depth.clone();
3626                if inlined {
3627                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3628                    inner_offset = next_offset;
3629                } else {
3630                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3631                    inner_depth.increment()?;
3632                }
3633                let val_ref =
3634                    self.reason.get_or_insert_with(|| fidl::new_empty!(StageFailureReason, D));
3635                fidl::decode!(StageFailureReason, D, val_ref, decoder, inner_offset, inner_depth)?;
3636                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3637                {
3638                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3639                }
3640                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3641                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3642                }
3643            }
3644
3645            next_offset += envelope_size;
3646
3647            // Decode the remaining unknown envelopes.
3648            while next_offset < end_offset {
3649                _next_ordinal_to_read += 1;
3650                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3651                next_offset += envelope_size;
3652            }
3653
3654            Ok(())
3655        }
3656    }
3657
3658    impl FetchData {
3659        #[inline(always)]
3660        fn max_ordinal_present(&self) -> u64 {
3661            if let Some(_) = self.progress {
3662                return 2;
3663            }
3664            if let Some(_) = self.info {
3665                return 1;
3666            }
3667            0
3668        }
3669    }
3670
3671    impl fidl::encoding::ValueTypeMarker for FetchData {
3672        type Borrowed<'a> = &'a Self;
3673        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3674            value
3675        }
3676    }
3677
3678    unsafe impl fidl::encoding::TypeMarker for FetchData {
3679        type Owned = Self;
3680
3681        #[inline(always)]
3682        fn inline_align(_context: fidl::encoding::Context) -> usize {
3683            8
3684        }
3685
3686        #[inline(always)]
3687        fn inline_size(_context: fidl::encoding::Context) -> usize {
3688            16
3689        }
3690    }
3691
3692    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FetchData, D>
3693        for &FetchData
3694    {
3695        unsafe fn encode(
3696            self,
3697            encoder: &mut fidl::encoding::Encoder<'_, D>,
3698            offset: usize,
3699            mut depth: fidl::encoding::Depth,
3700        ) -> fidl::Result<()> {
3701            encoder.debug_check_bounds::<FetchData>(offset);
3702            // Vector header
3703            let max_ordinal: u64 = self.max_ordinal_present();
3704            encoder.write_num(max_ordinal, offset);
3705            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3706            // Calling encoder.out_of_line_offset(0) is not allowed.
3707            if max_ordinal == 0 {
3708                return Ok(());
3709            }
3710            depth.increment()?;
3711            let envelope_size = 8;
3712            let bytes_len = max_ordinal as usize * envelope_size;
3713            #[allow(unused_variables)]
3714            let offset = encoder.out_of_line_offset(bytes_len);
3715            let mut _prev_end_offset: usize = 0;
3716            if 1 > max_ordinal {
3717                return Ok(());
3718            }
3719
3720            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3721            // are envelope_size bytes.
3722            let cur_offset: usize = (1 - 1) * envelope_size;
3723
3724            // Zero reserved fields.
3725            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3726
3727            // Safety:
3728            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3729            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3730            //   envelope_size bytes, there is always sufficient room.
3731            fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
3732                self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
3733                encoder,
3734                offset + cur_offset,
3735                depth,
3736            )?;
3737
3738            _prev_end_offset = cur_offset + envelope_size;
3739            if 2 > max_ordinal {
3740                return Ok(());
3741            }
3742
3743            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3744            // are envelope_size bytes.
3745            let cur_offset: usize = (2 - 1) * envelope_size;
3746
3747            // Zero reserved fields.
3748            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3749
3750            // Safety:
3751            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3752            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3753            //   envelope_size bytes, there is always sufficient room.
3754            fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
3755                self.progress
3756                    .as_ref()
3757                    .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
3758                encoder,
3759                offset + cur_offset,
3760                depth,
3761            )?;
3762
3763            _prev_end_offset = cur_offset + envelope_size;
3764
3765            Ok(())
3766        }
3767    }
3768
3769    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FetchData {
3770        #[inline(always)]
3771        fn new_empty() -> Self {
3772            Self::default()
3773        }
3774
3775        unsafe fn decode(
3776            &mut self,
3777            decoder: &mut fidl::encoding::Decoder<'_, D>,
3778            offset: usize,
3779            mut depth: fidl::encoding::Depth,
3780        ) -> fidl::Result<()> {
3781            decoder.debug_check_bounds::<Self>(offset);
3782            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3783                None => return Err(fidl::Error::NotNullable),
3784                Some(len) => len,
3785            };
3786            // Calling decoder.out_of_line_offset(0) is not allowed.
3787            if len == 0 {
3788                return Ok(());
3789            };
3790            depth.increment()?;
3791            let envelope_size = 8;
3792            let bytes_len = len * envelope_size;
3793            let offset = decoder.out_of_line_offset(bytes_len)?;
3794            // Decode the envelope for each type.
3795            let mut _next_ordinal_to_read = 0;
3796            let mut next_offset = offset;
3797            let end_offset = offset + bytes_len;
3798            _next_ordinal_to_read += 1;
3799            if next_offset >= end_offset {
3800                return Ok(());
3801            }
3802
3803            // Decode unknown envelopes for gaps in ordinals.
3804            while _next_ordinal_to_read < 1 {
3805                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3806                _next_ordinal_to_read += 1;
3807                next_offset += envelope_size;
3808            }
3809
3810            let next_out_of_line = decoder.next_out_of_line();
3811            let handles_before = decoder.remaining_handles();
3812            if let Some((inlined, num_bytes, num_handles)) =
3813                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3814            {
3815                let member_inline_size =
3816                    <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3817                if inlined != (member_inline_size <= 4) {
3818                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3819                }
3820                let inner_offset;
3821                let mut inner_depth = depth.clone();
3822                if inlined {
3823                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3824                    inner_offset = next_offset;
3825                } else {
3826                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3827                    inner_depth.increment()?;
3828                }
3829                let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
3830                fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
3831                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3832                {
3833                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3834                }
3835                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3836                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3837                }
3838            }
3839
3840            next_offset += envelope_size;
3841            _next_ordinal_to_read += 1;
3842            if next_offset >= end_offset {
3843                return Ok(());
3844            }
3845
3846            // Decode unknown envelopes for gaps in ordinals.
3847            while _next_ordinal_to_read < 2 {
3848                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3849                _next_ordinal_to_read += 1;
3850                next_offset += envelope_size;
3851            }
3852
3853            let next_out_of_line = decoder.next_out_of_line();
3854            let handles_before = decoder.remaining_handles();
3855            if let Some((inlined, num_bytes, num_handles)) =
3856                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3857            {
3858                let member_inline_size =
3859                    <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
3860                        decoder.context,
3861                    );
3862                if inlined != (member_inline_size <= 4) {
3863                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3864                }
3865                let inner_offset;
3866                let mut inner_depth = depth.clone();
3867                if inlined {
3868                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3869                    inner_offset = next_offset;
3870                } else {
3871                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3872                    inner_depth.increment()?;
3873                }
3874                let val_ref =
3875                    self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
3876                fidl::decode!(
3877                    InstallationProgress,
3878                    D,
3879                    val_ref,
3880                    decoder,
3881                    inner_offset,
3882                    inner_depth
3883                )?;
3884                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3885                {
3886                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3887                }
3888                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3889                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3890                }
3891            }
3892
3893            next_offset += envelope_size;
3894
3895            // Decode the remaining unknown envelopes.
3896            while next_offset < end_offset {
3897                _next_ordinal_to_read += 1;
3898                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3899                next_offset += envelope_size;
3900            }
3901
3902            Ok(())
3903        }
3904    }
3905
3906    impl InstallationProgress {
3907        #[inline(always)]
3908        fn max_ordinal_present(&self) -> u64 {
3909            if let Some(_) = self.bytes_downloaded {
3910                return 2;
3911            }
3912            if let Some(_) = self.fraction_completed {
3913                return 1;
3914            }
3915            0
3916        }
3917    }
3918
3919    impl fidl::encoding::ValueTypeMarker for InstallationProgress {
3920        type Borrowed<'a> = &'a Self;
3921        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3922            value
3923        }
3924    }
3925
3926    unsafe impl fidl::encoding::TypeMarker for InstallationProgress {
3927        type Owned = Self;
3928
3929        #[inline(always)]
3930        fn inline_align(_context: fidl::encoding::Context) -> usize {
3931            8
3932        }
3933
3934        #[inline(always)]
3935        fn inline_size(_context: fidl::encoding::Context) -> usize {
3936            16
3937        }
3938    }
3939
3940    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InstallationProgress, D>
3941        for &InstallationProgress
3942    {
3943        unsafe fn encode(
3944            self,
3945            encoder: &mut fidl::encoding::Encoder<'_, D>,
3946            offset: usize,
3947            mut depth: fidl::encoding::Depth,
3948        ) -> fidl::Result<()> {
3949            encoder.debug_check_bounds::<InstallationProgress>(offset);
3950            // Vector header
3951            let max_ordinal: u64 = self.max_ordinal_present();
3952            encoder.write_num(max_ordinal, offset);
3953            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3954            // Calling encoder.out_of_line_offset(0) is not allowed.
3955            if max_ordinal == 0 {
3956                return Ok(());
3957            }
3958            depth.increment()?;
3959            let envelope_size = 8;
3960            let bytes_len = max_ordinal as usize * envelope_size;
3961            #[allow(unused_variables)]
3962            let offset = encoder.out_of_line_offset(bytes_len);
3963            let mut _prev_end_offset: usize = 0;
3964            if 1 > max_ordinal {
3965                return Ok(());
3966            }
3967
3968            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3969            // are envelope_size bytes.
3970            let cur_offset: usize = (1 - 1) * envelope_size;
3971
3972            // Zero reserved fields.
3973            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3974
3975            // Safety:
3976            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3977            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3978            //   envelope_size bytes, there is always sufficient room.
3979            fidl::encoding::encode_in_envelope_optional::<f32, D>(
3980                self.fraction_completed
3981                    .as_ref()
3982                    .map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
3983                encoder,
3984                offset + cur_offset,
3985                depth,
3986            )?;
3987
3988            _prev_end_offset = cur_offset + envelope_size;
3989            if 2 > max_ordinal {
3990                return Ok(());
3991            }
3992
3993            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3994            // are envelope_size bytes.
3995            let cur_offset: usize = (2 - 1) * envelope_size;
3996
3997            // Zero reserved fields.
3998            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3999
4000            // Safety:
4001            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4002            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4003            //   envelope_size bytes, there is always sufficient room.
4004            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4005                self.bytes_downloaded
4006                    .as_ref()
4007                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4008                encoder,
4009                offset + cur_offset,
4010                depth,
4011            )?;
4012
4013            _prev_end_offset = cur_offset + envelope_size;
4014
4015            Ok(())
4016        }
4017    }
4018
4019    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InstallationProgress {
4020        #[inline(always)]
4021        fn new_empty() -> Self {
4022            Self::default()
4023        }
4024
4025        unsafe fn decode(
4026            &mut self,
4027            decoder: &mut fidl::encoding::Decoder<'_, D>,
4028            offset: usize,
4029            mut depth: fidl::encoding::Depth,
4030        ) -> fidl::Result<()> {
4031            decoder.debug_check_bounds::<Self>(offset);
4032            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4033                None => return Err(fidl::Error::NotNullable),
4034                Some(len) => len,
4035            };
4036            // Calling decoder.out_of_line_offset(0) is not allowed.
4037            if len == 0 {
4038                return Ok(());
4039            };
4040            depth.increment()?;
4041            let envelope_size = 8;
4042            let bytes_len = len * envelope_size;
4043            let offset = decoder.out_of_line_offset(bytes_len)?;
4044            // Decode the envelope for each type.
4045            let mut _next_ordinal_to_read = 0;
4046            let mut next_offset = offset;
4047            let end_offset = offset + bytes_len;
4048            _next_ordinal_to_read += 1;
4049            if next_offset >= end_offset {
4050                return Ok(());
4051            }
4052
4053            // Decode unknown envelopes for gaps in ordinals.
4054            while _next_ordinal_to_read < 1 {
4055                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4056                _next_ordinal_to_read += 1;
4057                next_offset += envelope_size;
4058            }
4059
4060            let next_out_of_line = decoder.next_out_of_line();
4061            let handles_before = decoder.remaining_handles();
4062            if let Some((inlined, num_bytes, num_handles)) =
4063                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4064            {
4065                let member_inline_size =
4066                    <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4067                if inlined != (member_inline_size <= 4) {
4068                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4069                }
4070                let inner_offset;
4071                let mut inner_depth = depth.clone();
4072                if inlined {
4073                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4074                    inner_offset = next_offset;
4075                } else {
4076                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4077                    inner_depth.increment()?;
4078                }
4079                let val_ref =
4080                    self.fraction_completed.get_or_insert_with(|| fidl::new_empty!(f32, D));
4081                fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
4082                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4083                {
4084                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4085                }
4086                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4087                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4088                }
4089            }
4090
4091            next_offset += envelope_size;
4092            _next_ordinal_to_read += 1;
4093            if next_offset >= end_offset {
4094                return Ok(());
4095            }
4096
4097            // Decode unknown envelopes for gaps in ordinals.
4098            while _next_ordinal_to_read < 2 {
4099                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4100                _next_ordinal_to_read += 1;
4101                next_offset += envelope_size;
4102            }
4103
4104            let next_out_of_line = decoder.next_out_of_line();
4105            let handles_before = decoder.remaining_handles();
4106            if let Some((inlined, num_bytes, num_handles)) =
4107                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4108            {
4109                let member_inline_size =
4110                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4111                if inlined != (member_inline_size <= 4) {
4112                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4113                }
4114                let inner_offset;
4115                let mut inner_depth = depth.clone();
4116                if inlined {
4117                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4118                    inner_offset = next_offset;
4119                } else {
4120                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4121                    inner_depth.increment()?;
4122                }
4123                let val_ref = self.bytes_downloaded.get_or_insert_with(|| fidl::new_empty!(u64, D));
4124                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4125                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4126                {
4127                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4128                }
4129                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4130                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4131                }
4132            }
4133
4134            next_offset += envelope_size;
4135
4136            // Decode the remaining unknown envelopes.
4137            while next_offset < end_offset {
4138                _next_ordinal_to_read += 1;
4139                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4140                next_offset += envelope_size;
4141            }
4142
4143            Ok(())
4144        }
4145    }
4146
4147    impl Options {
4148        #[inline(always)]
4149        fn max_ordinal_present(&self) -> u64 {
4150            if let Some(_) = self.should_write_recovery {
4151                return 3;
4152            }
4153            if let Some(_) = self.allow_attach_to_existing_attempt {
4154                return 2;
4155            }
4156            if let Some(_) = self.initiator {
4157                return 1;
4158            }
4159            0
4160        }
4161    }
4162
4163    impl fidl::encoding::ValueTypeMarker for Options {
4164        type Borrowed<'a> = &'a Self;
4165        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4166            value
4167        }
4168    }
4169
4170    unsafe impl fidl::encoding::TypeMarker for Options {
4171        type Owned = Self;
4172
4173        #[inline(always)]
4174        fn inline_align(_context: fidl::encoding::Context) -> usize {
4175            8
4176        }
4177
4178        #[inline(always)]
4179        fn inline_size(_context: fidl::encoding::Context) -> usize {
4180            16
4181        }
4182    }
4183
4184    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Options, D> for &Options {
4185        unsafe fn encode(
4186            self,
4187            encoder: &mut fidl::encoding::Encoder<'_, D>,
4188            offset: usize,
4189            mut depth: fidl::encoding::Depth,
4190        ) -> fidl::Result<()> {
4191            encoder.debug_check_bounds::<Options>(offset);
4192            // Vector header
4193            let max_ordinal: u64 = self.max_ordinal_present();
4194            encoder.write_num(max_ordinal, offset);
4195            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4196            // Calling encoder.out_of_line_offset(0) is not allowed.
4197            if max_ordinal == 0 {
4198                return Ok(());
4199            }
4200            depth.increment()?;
4201            let envelope_size = 8;
4202            let bytes_len = max_ordinal as usize * envelope_size;
4203            #[allow(unused_variables)]
4204            let offset = encoder.out_of_line_offset(bytes_len);
4205            let mut _prev_end_offset: usize = 0;
4206            if 1 > max_ordinal {
4207                return Ok(());
4208            }
4209
4210            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4211            // are envelope_size bytes.
4212            let cur_offset: usize = (1 - 1) * envelope_size;
4213
4214            // Zero reserved fields.
4215            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4216
4217            // Safety:
4218            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4219            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4220            //   envelope_size bytes, there is always sufficient room.
4221            fidl::encoding::encode_in_envelope_optional::<Initiator, D>(
4222                self.initiator.as_ref().map(<Initiator as fidl::encoding::ValueTypeMarker>::borrow),
4223                encoder,
4224                offset + cur_offset,
4225                depth,
4226            )?;
4227
4228            _prev_end_offset = cur_offset + envelope_size;
4229            if 2 > max_ordinal {
4230                return Ok(());
4231            }
4232
4233            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4234            // are envelope_size bytes.
4235            let cur_offset: usize = (2 - 1) * envelope_size;
4236
4237            // Zero reserved fields.
4238            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4239
4240            // Safety:
4241            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4242            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4243            //   envelope_size bytes, there is always sufficient room.
4244            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4245                self.allow_attach_to_existing_attempt
4246                    .as_ref()
4247                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4248                encoder,
4249                offset + cur_offset,
4250                depth,
4251            )?;
4252
4253            _prev_end_offset = cur_offset + envelope_size;
4254            if 3 > max_ordinal {
4255                return Ok(());
4256            }
4257
4258            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4259            // are envelope_size bytes.
4260            let cur_offset: usize = (3 - 1) * envelope_size;
4261
4262            // Zero reserved fields.
4263            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4264
4265            // Safety:
4266            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4267            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4268            //   envelope_size bytes, there is always sufficient room.
4269            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4270                self.should_write_recovery
4271                    .as_ref()
4272                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4273                encoder,
4274                offset + cur_offset,
4275                depth,
4276            )?;
4277
4278            _prev_end_offset = cur_offset + envelope_size;
4279
4280            Ok(())
4281        }
4282    }
4283
4284    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Options {
4285        #[inline(always)]
4286        fn new_empty() -> Self {
4287            Self::default()
4288        }
4289
4290        unsafe fn decode(
4291            &mut self,
4292            decoder: &mut fidl::encoding::Decoder<'_, D>,
4293            offset: usize,
4294            mut depth: fidl::encoding::Depth,
4295        ) -> fidl::Result<()> {
4296            decoder.debug_check_bounds::<Self>(offset);
4297            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4298                None => return Err(fidl::Error::NotNullable),
4299                Some(len) => len,
4300            };
4301            // Calling decoder.out_of_line_offset(0) is not allowed.
4302            if len == 0 {
4303                return Ok(());
4304            };
4305            depth.increment()?;
4306            let envelope_size = 8;
4307            let bytes_len = len * envelope_size;
4308            let offset = decoder.out_of_line_offset(bytes_len)?;
4309            // Decode the envelope for each type.
4310            let mut _next_ordinal_to_read = 0;
4311            let mut next_offset = offset;
4312            let end_offset = offset + bytes_len;
4313            _next_ordinal_to_read += 1;
4314            if next_offset >= end_offset {
4315                return Ok(());
4316            }
4317
4318            // Decode unknown envelopes for gaps in ordinals.
4319            while _next_ordinal_to_read < 1 {
4320                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4321                _next_ordinal_to_read += 1;
4322                next_offset += envelope_size;
4323            }
4324
4325            let next_out_of_line = decoder.next_out_of_line();
4326            let handles_before = decoder.remaining_handles();
4327            if let Some((inlined, num_bytes, num_handles)) =
4328                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4329            {
4330                let member_inline_size =
4331                    <Initiator as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4332                if inlined != (member_inline_size <= 4) {
4333                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4334                }
4335                let inner_offset;
4336                let mut inner_depth = depth.clone();
4337                if inlined {
4338                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4339                    inner_offset = next_offset;
4340                } else {
4341                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4342                    inner_depth.increment()?;
4343                }
4344                let val_ref = self.initiator.get_or_insert_with(|| fidl::new_empty!(Initiator, D));
4345                fidl::decode!(Initiator, D, val_ref, decoder, inner_offset, inner_depth)?;
4346                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4347                {
4348                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4349                }
4350                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4351                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4352                }
4353            }
4354
4355            next_offset += envelope_size;
4356            _next_ordinal_to_read += 1;
4357            if next_offset >= end_offset {
4358                return Ok(());
4359            }
4360
4361            // Decode unknown envelopes for gaps in ordinals.
4362            while _next_ordinal_to_read < 2 {
4363                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4364                _next_ordinal_to_read += 1;
4365                next_offset += envelope_size;
4366            }
4367
4368            let next_out_of_line = decoder.next_out_of_line();
4369            let handles_before = decoder.remaining_handles();
4370            if let Some((inlined, num_bytes, num_handles)) =
4371                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4372            {
4373                let member_inline_size =
4374                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4375                if inlined != (member_inline_size <= 4) {
4376                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4377                }
4378                let inner_offset;
4379                let mut inner_depth = depth.clone();
4380                if inlined {
4381                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4382                    inner_offset = next_offset;
4383                } else {
4384                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4385                    inner_depth.increment()?;
4386                }
4387                let val_ref = self
4388                    .allow_attach_to_existing_attempt
4389                    .get_or_insert_with(|| fidl::new_empty!(bool, D));
4390                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4391                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4392                {
4393                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4394                }
4395                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4396                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4397                }
4398            }
4399
4400            next_offset += envelope_size;
4401            _next_ordinal_to_read += 1;
4402            if next_offset >= end_offset {
4403                return Ok(());
4404            }
4405
4406            // Decode unknown envelopes for gaps in ordinals.
4407            while _next_ordinal_to_read < 3 {
4408                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4409                _next_ordinal_to_read += 1;
4410                next_offset += envelope_size;
4411            }
4412
4413            let next_out_of_line = decoder.next_out_of_line();
4414            let handles_before = decoder.remaining_handles();
4415            if let Some((inlined, num_bytes, num_handles)) =
4416                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4417            {
4418                let member_inline_size =
4419                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4420                if inlined != (member_inline_size <= 4) {
4421                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4422                }
4423                let inner_offset;
4424                let mut inner_depth = depth.clone();
4425                if inlined {
4426                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4427                    inner_offset = next_offset;
4428                } else {
4429                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4430                    inner_depth.increment()?;
4431                }
4432                let val_ref =
4433                    self.should_write_recovery.get_or_insert_with(|| fidl::new_empty!(bool, D));
4434                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4435                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4436                {
4437                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4438                }
4439                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4440                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4441                }
4442            }
4443
4444            next_offset += envelope_size;
4445
4446            // Decode the remaining unknown envelopes.
4447            while next_offset < end_offset {
4448                _next_ordinal_to_read += 1;
4449                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4450                next_offset += envelope_size;
4451            }
4452
4453            Ok(())
4454        }
4455    }
4456
4457    impl PrepareData {
4458        #[inline(always)]
4459        fn max_ordinal_present(&self) -> u64 {
4460            0
4461        }
4462    }
4463
4464    impl fidl::encoding::ValueTypeMarker for PrepareData {
4465        type Borrowed<'a> = &'a Self;
4466        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4467            value
4468        }
4469    }
4470
4471    unsafe impl fidl::encoding::TypeMarker for PrepareData {
4472        type Owned = Self;
4473
4474        #[inline(always)]
4475        fn inline_align(_context: fidl::encoding::Context) -> usize {
4476            8
4477        }
4478
4479        #[inline(always)]
4480        fn inline_size(_context: fidl::encoding::Context) -> usize {
4481            16
4482        }
4483    }
4484
4485    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PrepareData, D>
4486        for &PrepareData
4487    {
4488        unsafe fn encode(
4489            self,
4490            encoder: &mut fidl::encoding::Encoder<'_, D>,
4491            offset: usize,
4492            mut depth: fidl::encoding::Depth,
4493        ) -> fidl::Result<()> {
4494            encoder.debug_check_bounds::<PrepareData>(offset);
4495            // Vector header
4496            let max_ordinal: u64 = self.max_ordinal_present();
4497            encoder.write_num(max_ordinal, offset);
4498            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4499            // Calling encoder.out_of_line_offset(0) is not allowed.
4500            if max_ordinal == 0 {
4501                return Ok(());
4502            }
4503            depth.increment()?;
4504            let envelope_size = 8;
4505            let bytes_len = max_ordinal as usize * envelope_size;
4506            #[allow(unused_variables)]
4507            let offset = encoder.out_of_line_offset(bytes_len);
4508            let mut _prev_end_offset: usize = 0;
4509
4510            Ok(())
4511        }
4512    }
4513
4514    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PrepareData {
4515        #[inline(always)]
4516        fn new_empty() -> Self {
4517            Self::default()
4518        }
4519
4520        unsafe fn decode(
4521            &mut self,
4522            decoder: &mut fidl::encoding::Decoder<'_, D>,
4523            offset: usize,
4524            mut depth: fidl::encoding::Depth,
4525        ) -> fidl::Result<()> {
4526            decoder.debug_check_bounds::<Self>(offset);
4527            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4528                None => return Err(fidl::Error::NotNullable),
4529                Some(len) => len,
4530            };
4531            // Calling decoder.out_of_line_offset(0) is not allowed.
4532            if len == 0 {
4533                return Ok(());
4534            };
4535            depth.increment()?;
4536            let envelope_size = 8;
4537            let bytes_len = len * envelope_size;
4538            let offset = decoder.out_of_line_offset(bytes_len)?;
4539            // Decode the envelope for each type.
4540            let mut _next_ordinal_to_read = 0;
4541            let mut next_offset = offset;
4542            let end_offset = offset + bytes_len;
4543
4544            // Decode the remaining unknown envelopes.
4545            while next_offset < end_offset {
4546                _next_ordinal_to_read += 1;
4547                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4548                next_offset += envelope_size;
4549            }
4550
4551            Ok(())
4552        }
4553    }
4554
4555    impl RebootData {
4556        #[inline(always)]
4557        fn max_ordinal_present(&self) -> u64 {
4558            if let Some(_) = self.progress {
4559                return 2;
4560            }
4561            if let Some(_) = self.info {
4562                return 1;
4563            }
4564            0
4565        }
4566    }
4567
4568    impl fidl::encoding::ValueTypeMarker for RebootData {
4569        type Borrowed<'a> = &'a Self;
4570        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4571            value
4572        }
4573    }
4574
4575    unsafe impl fidl::encoding::TypeMarker for RebootData {
4576        type Owned = Self;
4577
4578        #[inline(always)]
4579        fn inline_align(_context: fidl::encoding::Context) -> usize {
4580            8
4581        }
4582
4583        #[inline(always)]
4584        fn inline_size(_context: fidl::encoding::Context) -> usize {
4585            16
4586        }
4587    }
4588
4589    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RebootData, D>
4590        for &RebootData
4591    {
4592        unsafe fn encode(
4593            self,
4594            encoder: &mut fidl::encoding::Encoder<'_, D>,
4595            offset: usize,
4596            mut depth: fidl::encoding::Depth,
4597        ) -> fidl::Result<()> {
4598            encoder.debug_check_bounds::<RebootData>(offset);
4599            // Vector header
4600            let max_ordinal: u64 = self.max_ordinal_present();
4601            encoder.write_num(max_ordinal, offset);
4602            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4603            // Calling encoder.out_of_line_offset(0) is not allowed.
4604            if max_ordinal == 0 {
4605                return Ok(());
4606            }
4607            depth.increment()?;
4608            let envelope_size = 8;
4609            let bytes_len = max_ordinal as usize * envelope_size;
4610            #[allow(unused_variables)]
4611            let offset = encoder.out_of_line_offset(bytes_len);
4612            let mut _prev_end_offset: usize = 0;
4613            if 1 > max_ordinal {
4614                return Ok(());
4615            }
4616
4617            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4618            // are envelope_size bytes.
4619            let cur_offset: usize = (1 - 1) * envelope_size;
4620
4621            // Zero reserved fields.
4622            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4623
4624            // Safety:
4625            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4626            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4627            //   envelope_size bytes, there is always sufficient room.
4628            fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
4629                self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
4630                encoder,
4631                offset + cur_offset,
4632                depth,
4633            )?;
4634
4635            _prev_end_offset = cur_offset + envelope_size;
4636            if 2 > max_ordinal {
4637                return Ok(());
4638            }
4639
4640            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4641            // are envelope_size bytes.
4642            let cur_offset: usize = (2 - 1) * envelope_size;
4643
4644            // Zero reserved fields.
4645            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4646
4647            // Safety:
4648            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4649            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4650            //   envelope_size bytes, there is always sufficient room.
4651            fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
4652                self.progress
4653                    .as_ref()
4654                    .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
4655                encoder,
4656                offset + cur_offset,
4657                depth,
4658            )?;
4659
4660            _prev_end_offset = cur_offset + envelope_size;
4661
4662            Ok(())
4663        }
4664    }
4665
4666    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RebootData {
4667        #[inline(always)]
4668        fn new_empty() -> Self {
4669            Self::default()
4670        }
4671
4672        unsafe fn decode(
4673            &mut self,
4674            decoder: &mut fidl::encoding::Decoder<'_, D>,
4675            offset: usize,
4676            mut depth: fidl::encoding::Depth,
4677        ) -> fidl::Result<()> {
4678            decoder.debug_check_bounds::<Self>(offset);
4679            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4680                None => return Err(fidl::Error::NotNullable),
4681                Some(len) => len,
4682            };
4683            // Calling decoder.out_of_line_offset(0) is not allowed.
4684            if len == 0 {
4685                return Ok(());
4686            };
4687            depth.increment()?;
4688            let envelope_size = 8;
4689            let bytes_len = len * envelope_size;
4690            let offset = decoder.out_of_line_offset(bytes_len)?;
4691            // Decode the envelope for each type.
4692            let mut _next_ordinal_to_read = 0;
4693            let mut next_offset = offset;
4694            let end_offset = offset + bytes_len;
4695            _next_ordinal_to_read += 1;
4696            if next_offset >= end_offset {
4697                return Ok(());
4698            }
4699
4700            // Decode unknown envelopes for gaps in ordinals.
4701            while _next_ordinal_to_read < 1 {
4702                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4703                _next_ordinal_to_read += 1;
4704                next_offset += envelope_size;
4705            }
4706
4707            let next_out_of_line = decoder.next_out_of_line();
4708            let handles_before = decoder.remaining_handles();
4709            if let Some((inlined, num_bytes, num_handles)) =
4710                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4711            {
4712                let member_inline_size =
4713                    <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4714                if inlined != (member_inline_size <= 4) {
4715                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4716                }
4717                let inner_offset;
4718                let mut inner_depth = depth.clone();
4719                if inlined {
4720                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4721                    inner_offset = next_offset;
4722                } else {
4723                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4724                    inner_depth.increment()?;
4725                }
4726                let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
4727                fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
4728                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4729                {
4730                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4731                }
4732                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4733                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4734                }
4735            }
4736
4737            next_offset += envelope_size;
4738            _next_ordinal_to_read += 1;
4739            if next_offset >= end_offset {
4740                return Ok(());
4741            }
4742
4743            // Decode unknown envelopes for gaps in ordinals.
4744            while _next_ordinal_to_read < 2 {
4745                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4746                _next_ordinal_to_read += 1;
4747                next_offset += envelope_size;
4748            }
4749
4750            let next_out_of_line = decoder.next_out_of_line();
4751            let handles_before = decoder.remaining_handles();
4752            if let Some((inlined, num_bytes, num_handles)) =
4753                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4754            {
4755                let member_inline_size =
4756                    <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
4757                        decoder.context,
4758                    );
4759                if inlined != (member_inline_size <= 4) {
4760                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4761                }
4762                let inner_offset;
4763                let mut inner_depth = depth.clone();
4764                if inlined {
4765                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4766                    inner_offset = next_offset;
4767                } else {
4768                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4769                    inner_depth.increment()?;
4770                }
4771                let val_ref =
4772                    self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
4773                fidl::decode!(
4774                    InstallationProgress,
4775                    D,
4776                    val_ref,
4777                    decoder,
4778                    inner_offset,
4779                    inner_depth
4780                )?;
4781                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4782                {
4783                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4784                }
4785                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4786                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4787                }
4788            }
4789
4790            next_offset += envelope_size;
4791
4792            // Decode the remaining unknown envelopes.
4793            while next_offset < end_offset {
4794                _next_ordinal_to_read += 1;
4795                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4796                next_offset += envelope_size;
4797            }
4798
4799            Ok(())
4800        }
4801    }
4802
4803    impl StageData {
4804        #[inline(always)]
4805        fn max_ordinal_present(&self) -> u64 {
4806            if let Some(_) = self.progress {
4807                return 2;
4808            }
4809            if let Some(_) = self.info {
4810                return 1;
4811            }
4812            0
4813        }
4814    }
4815
4816    impl fidl::encoding::ValueTypeMarker for StageData {
4817        type Borrowed<'a> = &'a Self;
4818        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4819            value
4820        }
4821    }
4822
4823    unsafe impl fidl::encoding::TypeMarker for StageData {
4824        type Owned = Self;
4825
4826        #[inline(always)]
4827        fn inline_align(_context: fidl::encoding::Context) -> usize {
4828            8
4829        }
4830
4831        #[inline(always)]
4832        fn inline_size(_context: fidl::encoding::Context) -> usize {
4833            16
4834        }
4835    }
4836
4837    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StageData, D>
4838        for &StageData
4839    {
4840        unsafe fn encode(
4841            self,
4842            encoder: &mut fidl::encoding::Encoder<'_, D>,
4843            offset: usize,
4844            mut depth: fidl::encoding::Depth,
4845        ) -> fidl::Result<()> {
4846            encoder.debug_check_bounds::<StageData>(offset);
4847            // Vector header
4848            let max_ordinal: u64 = self.max_ordinal_present();
4849            encoder.write_num(max_ordinal, offset);
4850            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4851            // Calling encoder.out_of_line_offset(0) is not allowed.
4852            if max_ordinal == 0 {
4853                return Ok(());
4854            }
4855            depth.increment()?;
4856            let envelope_size = 8;
4857            let bytes_len = max_ordinal as usize * envelope_size;
4858            #[allow(unused_variables)]
4859            let offset = encoder.out_of_line_offset(bytes_len);
4860            let mut _prev_end_offset: usize = 0;
4861            if 1 > max_ordinal {
4862                return Ok(());
4863            }
4864
4865            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4866            // are envelope_size bytes.
4867            let cur_offset: usize = (1 - 1) * envelope_size;
4868
4869            // Zero reserved fields.
4870            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4871
4872            // Safety:
4873            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4874            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4875            //   envelope_size bytes, there is always sufficient room.
4876            fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
4877                self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
4878                encoder,
4879                offset + cur_offset,
4880                depth,
4881            )?;
4882
4883            _prev_end_offset = cur_offset + envelope_size;
4884            if 2 > max_ordinal {
4885                return Ok(());
4886            }
4887
4888            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4889            // are envelope_size bytes.
4890            let cur_offset: usize = (2 - 1) * envelope_size;
4891
4892            // Zero reserved fields.
4893            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4894
4895            // Safety:
4896            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4897            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4898            //   envelope_size bytes, there is always sufficient room.
4899            fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
4900                self.progress
4901                    .as_ref()
4902                    .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
4903                encoder,
4904                offset + cur_offset,
4905                depth,
4906            )?;
4907
4908            _prev_end_offset = cur_offset + envelope_size;
4909
4910            Ok(())
4911        }
4912    }
4913
4914    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StageData {
4915        #[inline(always)]
4916        fn new_empty() -> Self {
4917            Self::default()
4918        }
4919
4920        unsafe fn decode(
4921            &mut self,
4922            decoder: &mut fidl::encoding::Decoder<'_, D>,
4923            offset: usize,
4924            mut depth: fidl::encoding::Depth,
4925        ) -> fidl::Result<()> {
4926            decoder.debug_check_bounds::<Self>(offset);
4927            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4928                None => return Err(fidl::Error::NotNullable),
4929                Some(len) => len,
4930            };
4931            // Calling decoder.out_of_line_offset(0) is not allowed.
4932            if len == 0 {
4933                return Ok(());
4934            };
4935            depth.increment()?;
4936            let envelope_size = 8;
4937            let bytes_len = len * envelope_size;
4938            let offset = decoder.out_of_line_offset(bytes_len)?;
4939            // Decode the envelope for each type.
4940            let mut _next_ordinal_to_read = 0;
4941            let mut next_offset = offset;
4942            let end_offset = offset + bytes_len;
4943            _next_ordinal_to_read += 1;
4944            if next_offset >= end_offset {
4945                return Ok(());
4946            }
4947
4948            // Decode unknown envelopes for gaps in ordinals.
4949            while _next_ordinal_to_read < 1 {
4950                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4951                _next_ordinal_to_read += 1;
4952                next_offset += envelope_size;
4953            }
4954
4955            let next_out_of_line = decoder.next_out_of_line();
4956            let handles_before = decoder.remaining_handles();
4957            if let Some((inlined, num_bytes, num_handles)) =
4958                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4959            {
4960                let member_inline_size =
4961                    <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4962                if inlined != (member_inline_size <= 4) {
4963                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4964                }
4965                let inner_offset;
4966                let mut inner_depth = depth.clone();
4967                if inlined {
4968                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4969                    inner_offset = next_offset;
4970                } else {
4971                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4972                    inner_depth.increment()?;
4973                }
4974                let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
4975                fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
4976                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4977                {
4978                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4979                }
4980                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4981                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4982                }
4983            }
4984
4985            next_offset += envelope_size;
4986            _next_ordinal_to_read += 1;
4987            if next_offset >= end_offset {
4988                return Ok(());
4989            }
4990
4991            // Decode unknown envelopes for gaps in ordinals.
4992            while _next_ordinal_to_read < 2 {
4993                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4994                _next_ordinal_to_read += 1;
4995                next_offset += envelope_size;
4996            }
4997
4998            let next_out_of_line = decoder.next_out_of_line();
4999            let handles_before = decoder.remaining_handles();
5000            if let Some((inlined, num_bytes, num_handles)) =
5001                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5002            {
5003                let member_inline_size =
5004                    <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
5005                        decoder.context,
5006                    );
5007                if inlined != (member_inline_size <= 4) {
5008                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5009                }
5010                let inner_offset;
5011                let mut inner_depth = depth.clone();
5012                if inlined {
5013                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5014                    inner_offset = next_offset;
5015                } else {
5016                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5017                    inner_depth.increment()?;
5018                }
5019                let val_ref =
5020                    self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
5021                fidl::decode!(
5022                    InstallationProgress,
5023                    D,
5024                    val_ref,
5025                    decoder,
5026                    inner_offset,
5027                    inner_depth
5028                )?;
5029                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5030                {
5031                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5032                }
5033                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5034                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5035                }
5036            }
5037
5038            next_offset += envelope_size;
5039
5040            // Decode the remaining unknown envelopes.
5041            while next_offset < end_offset {
5042                _next_ordinal_to_read += 1;
5043                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5044                next_offset += envelope_size;
5045            }
5046
5047            Ok(())
5048        }
5049    }
5050
5051    impl UpdateInfo {
5052        #[inline(always)]
5053        fn max_ordinal_present(&self) -> u64 {
5054            if let Some(_) = self.download_size {
5055                return 1;
5056            }
5057            0
5058        }
5059    }
5060
5061    impl fidl::encoding::ValueTypeMarker for UpdateInfo {
5062        type Borrowed<'a> = &'a Self;
5063        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5064            value
5065        }
5066    }
5067
5068    unsafe impl fidl::encoding::TypeMarker for UpdateInfo {
5069        type Owned = Self;
5070
5071        #[inline(always)]
5072        fn inline_align(_context: fidl::encoding::Context) -> usize {
5073            8
5074        }
5075
5076        #[inline(always)]
5077        fn inline_size(_context: fidl::encoding::Context) -> usize {
5078            16
5079        }
5080    }
5081
5082    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UpdateInfo, D>
5083        for &UpdateInfo
5084    {
5085        unsafe fn encode(
5086            self,
5087            encoder: &mut fidl::encoding::Encoder<'_, D>,
5088            offset: usize,
5089            mut depth: fidl::encoding::Depth,
5090        ) -> fidl::Result<()> {
5091            encoder.debug_check_bounds::<UpdateInfo>(offset);
5092            // Vector header
5093            let max_ordinal: u64 = self.max_ordinal_present();
5094            encoder.write_num(max_ordinal, offset);
5095            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5096            // Calling encoder.out_of_line_offset(0) is not allowed.
5097            if max_ordinal == 0 {
5098                return Ok(());
5099            }
5100            depth.increment()?;
5101            let envelope_size = 8;
5102            let bytes_len = max_ordinal as usize * envelope_size;
5103            #[allow(unused_variables)]
5104            let offset = encoder.out_of_line_offset(bytes_len);
5105            let mut _prev_end_offset: usize = 0;
5106            if 1 > max_ordinal {
5107                return Ok(());
5108            }
5109
5110            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5111            // are envelope_size bytes.
5112            let cur_offset: usize = (1 - 1) * envelope_size;
5113
5114            // Zero reserved fields.
5115            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5116
5117            // Safety:
5118            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5119            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5120            //   envelope_size bytes, there is always sufficient room.
5121            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5122                self.download_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5123                encoder,
5124                offset + cur_offset,
5125                depth,
5126            )?;
5127
5128            _prev_end_offset = cur_offset + envelope_size;
5129
5130            Ok(())
5131        }
5132    }
5133
5134    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UpdateInfo {
5135        #[inline(always)]
5136        fn new_empty() -> Self {
5137            Self::default()
5138        }
5139
5140        unsafe fn decode(
5141            &mut self,
5142            decoder: &mut fidl::encoding::Decoder<'_, D>,
5143            offset: usize,
5144            mut depth: fidl::encoding::Depth,
5145        ) -> fidl::Result<()> {
5146            decoder.debug_check_bounds::<Self>(offset);
5147            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5148                None => return Err(fidl::Error::NotNullable),
5149                Some(len) => len,
5150            };
5151            // Calling decoder.out_of_line_offset(0) is not allowed.
5152            if len == 0 {
5153                return Ok(());
5154            };
5155            depth.increment()?;
5156            let envelope_size = 8;
5157            let bytes_len = len * envelope_size;
5158            let offset = decoder.out_of_line_offset(bytes_len)?;
5159            // Decode the envelope for each type.
5160            let mut _next_ordinal_to_read = 0;
5161            let mut next_offset = offset;
5162            let end_offset = offset + bytes_len;
5163            _next_ordinal_to_read += 1;
5164            if next_offset >= end_offset {
5165                return Ok(());
5166            }
5167
5168            // Decode unknown envelopes for gaps in ordinals.
5169            while _next_ordinal_to_read < 1 {
5170                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5171                _next_ordinal_to_read += 1;
5172                next_offset += envelope_size;
5173            }
5174
5175            let next_out_of_line = decoder.next_out_of_line();
5176            let handles_before = decoder.remaining_handles();
5177            if let Some((inlined, num_bytes, num_handles)) =
5178                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5179            {
5180                let member_inline_size =
5181                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5182                if inlined != (member_inline_size <= 4) {
5183                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5184                }
5185                let inner_offset;
5186                let mut inner_depth = depth.clone();
5187                if inlined {
5188                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5189                    inner_offset = next_offset;
5190                } else {
5191                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5192                    inner_depth.increment()?;
5193                }
5194                let val_ref = self.download_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
5195                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5196                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5197                {
5198                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5199                }
5200                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5201                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5202                }
5203            }
5204
5205            next_offset += envelope_size;
5206
5207            // Decode the remaining unknown envelopes.
5208            while next_offset < end_offset {
5209                _next_ordinal_to_read += 1;
5210                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5211                next_offset += envelope_size;
5212            }
5213
5214            Ok(())
5215        }
5216    }
5217
5218    impl WaitToRebootData {
5219        #[inline(always)]
5220        fn max_ordinal_present(&self) -> u64 {
5221            if let Some(_) = self.progress {
5222                return 2;
5223            }
5224            if let Some(_) = self.info {
5225                return 1;
5226            }
5227            0
5228        }
5229    }
5230
5231    impl fidl::encoding::ValueTypeMarker for WaitToRebootData {
5232        type Borrowed<'a> = &'a Self;
5233        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5234            value
5235        }
5236    }
5237
5238    unsafe impl fidl::encoding::TypeMarker for WaitToRebootData {
5239        type Owned = Self;
5240
5241        #[inline(always)]
5242        fn inline_align(_context: fidl::encoding::Context) -> usize {
5243            8
5244        }
5245
5246        #[inline(always)]
5247        fn inline_size(_context: fidl::encoding::Context) -> usize {
5248            16
5249        }
5250    }
5251
5252    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WaitToRebootData, D>
5253        for &WaitToRebootData
5254    {
5255        unsafe fn encode(
5256            self,
5257            encoder: &mut fidl::encoding::Encoder<'_, D>,
5258            offset: usize,
5259            mut depth: fidl::encoding::Depth,
5260        ) -> fidl::Result<()> {
5261            encoder.debug_check_bounds::<WaitToRebootData>(offset);
5262            // Vector header
5263            let max_ordinal: u64 = self.max_ordinal_present();
5264            encoder.write_num(max_ordinal, offset);
5265            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5266            // Calling encoder.out_of_line_offset(0) is not allowed.
5267            if max_ordinal == 0 {
5268                return Ok(());
5269            }
5270            depth.increment()?;
5271            let envelope_size = 8;
5272            let bytes_len = max_ordinal as usize * envelope_size;
5273            #[allow(unused_variables)]
5274            let offset = encoder.out_of_line_offset(bytes_len);
5275            let mut _prev_end_offset: usize = 0;
5276            if 1 > max_ordinal {
5277                return Ok(());
5278            }
5279
5280            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5281            // are envelope_size bytes.
5282            let cur_offset: usize = (1 - 1) * envelope_size;
5283
5284            // Zero reserved fields.
5285            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5286
5287            // Safety:
5288            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5289            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5290            //   envelope_size bytes, there is always sufficient room.
5291            fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
5292                self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
5293                encoder,
5294                offset + cur_offset,
5295                depth,
5296            )?;
5297
5298            _prev_end_offset = cur_offset + envelope_size;
5299            if 2 > max_ordinal {
5300                return Ok(());
5301            }
5302
5303            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5304            // are envelope_size bytes.
5305            let cur_offset: usize = (2 - 1) * envelope_size;
5306
5307            // Zero reserved fields.
5308            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5309
5310            // Safety:
5311            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5312            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5313            //   envelope_size bytes, there is always sufficient room.
5314            fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
5315                self.progress
5316                    .as_ref()
5317                    .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
5318                encoder,
5319                offset + cur_offset,
5320                depth,
5321            )?;
5322
5323            _prev_end_offset = cur_offset + envelope_size;
5324
5325            Ok(())
5326        }
5327    }
5328
5329    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WaitToRebootData {
5330        #[inline(always)]
5331        fn new_empty() -> Self {
5332            Self::default()
5333        }
5334
5335        unsafe fn decode(
5336            &mut self,
5337            decoder: &mut fidl::encoding::Decoder<'_, D>,
5338            offset: usize,
5339            mut depth: fidl::encoding::Depth,
5340        ) -> fidl::Result<()> {
5341            decoder.debug_check_bounds::<Self>(offset);
5342            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5343                None => return Err(fidl::Error::NotNullable),
5344                Some(len) => len,
5345            };
5346            // Calling decoder.out_of_line_offset(0) is not allowed.
5347            if len == 0 {
5348                return Ok(());
5349            };
5350            depth.increment()?;
5351            let envelope_size = 8;
5352            let bytes_len = len * envelope_size;
5353            let offset = decoder.out_of_line_offset(bytes_len)?;
5354            // Decode the envelope for each type.
5355            let mut _next_ordinal_to_read = 0;
5356            let mut next_offset = offset;
5357            let end_offset = offset + bytes_len;
5358            _next_ordinal_to_read += 1;
5359            if next_offset >= end_offset {
5360                return Ok(());
5361            }
5362
5363            // Decode unknown envelopes for gaps in ordinals.
5364            while _next_ordinal_to_read < 1 {
5365                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5366                _next_ordinal_to_read += 1;
5367                next_offset += envelope_size;
5368            }
5369
5370            let next_out_of_line = decoder.next_out_of_line();
5371            let handles_before = decoder.remaining_handles();
5372            if let Some((inlined, num_bytes, num_handles)) =
5373                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5374            {
5375                let member_inline_size =
5376                    <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5377                if inlined != (member_inline_size <= 4) {
5378                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5379                }
5380                let inner_offset;
5381                let mut inner_depth = depth.clone();
5382                if inlined {
5383                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5384                    inner_offset = next_offset;
5385                } else {
5386                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5387                    inner_depth.increment()?;
5388                }
5389                let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
5390                fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
5391                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5392                {
5393                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5394                }
5395                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5396                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5397                }
5398            }
5399
5400            next_offset += envelope_size;
5401            _next_ordinal_to_read += 1;
5402            if next_offset >= end_offset {
5403                return Ok(());
5404            }
5405
5406            // Decode unknown envelopes for gaps in ordinals.
5407            while _next_ordinal_to_read < 2 {
5408                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5409                _next_ordinal_to_read += 1;
5410                next_offset += envelope_size;
5411            }
5412
5413            let next_out_of_line = decoder.next_out_of_line();
5414            let handles_before = decoder.remaining_handles();
5415            if let Some((inlined, num_bytes, num_handles)) =
5416                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5417            {
5418                let member_inline_size =
5419                    <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
5420                        decoder.context,
5421                    );
5422                if inlined != (member_inline_size <= 4) {
5423                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5424                }
5425                let inner_offset;
5426                let mut inner_depth = depth.clone();
5427                if inlined {
5428                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5429                    inner_offset = next_offset;
5430                } else {
5431                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5432                    inner_depth.increment()?;
5433                }
5434                let val_ref =
5435                    self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
5436                fidl::decode!(
5437                    InstallationProgress,
5438                    D,
5439                    val_ref,
5440                    decoder,
5441                    inner_offset,
5442                    inner_depth
5443                )?;
5444                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5445                {
5446                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5447                }
5448                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5449                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5450                }
5451            }
5452
5453            next_offset += envelope_size;
5454
5455            // Decode the remaining unknown envelopes.
5456            while next_offset < end_offset {
5457                _next_ordinal_to_read += 1;
5458                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5459                next_offset += envelope_size;
5460            }
5461
5462            Ok(())
5463        }
5464    }
5465
5466    impl fidl::encoding::ValueTypeMarker for State {
5467        type Borrowed<'a> = &'a Self;
5468        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5469            value
5470        }
5471    }
5472
5473    unsafe impl fidl::encoding::TypeMarker for State {
5474        type Owned = Self;
5475
5476        #[inline(always)]
5477        fn inline_align(_context: fidl::encoding::Context) -> usize {
5478            8
5479        }
5480
5481        #[inline(always)]
5482        fn inline_size(_context: fidl::encoding::Context) -> usize {
5483            16
5484        }
5485    }
5486
5487    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<State, D> for &State {
5488        #[inline]
5489        unsafe fn encode(
5490            self,
5491            encoder: &mut fidl::encoding::Encoder<'_, D>,
5492            offset: usize,
5493            _depth: fidl::encoding::Depth,
5494        ) -> fidl::Result<()> {
5495            encoder.debug_check_bounds::<State>(offset);
5496            encoder.write_num::<u64>(self.ordinal(), offset);
5497            match self {
5498                State::Prepare(ref val) => fidl::encoding::encode_in_envelope::<PrepareData, D>(
5499                    <PrepareData as fidl::encoding::ValueTypeMarker>::borrow(val),
5500                    encoder,
5501                    offset + 8,
5502                    _depth,
5503                ),
5504                State::Stage(ref val) => fidl::encoding::encode_in_envelope::<StageData, D>(
5505                    <StageData as fidl::encoding::ValueTypeMarker>::borrow(val),
5506                    encoder,
5507                    offset + 8,
5508                    _depth,
5509                ),
5510                State::Fetch(ref val) => fidl::encoding::encode_in_envelope::<FetchData, D>(
5511                    <FetchData as fidl::encoding::ValueTypeMarker>::borrow(val),
5512                    encoder,
5513                    offset + 8,
5514                    _depth,
5515                ),
5516                State::Commit(ref val) => fidl::encoding::encode_in_envelope::<CommitData, D>(
5517                    <CommitData as fidl::encoding::ValueTypeMarker>::borrow(val),
5518                    encoder,
5519                    offset + 8,
5520                    _depth,
5521                ),
5522                State::WaitToReboot(ref val) => {
5523                    fidl::encoding::encode_in_envelope::<WaitToRebootData, D>(
5524                        <WaitToRebootData as fidl::encoding::ValueTypeMarker>::borrow(val),
5525                        encoder,
5526                        offset + 8,
5527                        _depth,
5528                    )
5529                }
5530                State::Reboot(ref val) => fidl::encoding::encode_in_envelope::<RebootData, D>(
5531                    <RebootData as fidl::encoding::ValueTypeMarker>::borrow(val),
5532                    encoder,
5533                    offset + 8,
5534                    _depth,
5535                ),
5536                State::DeferReboot(ref val) => {
5537                    fidl::encoding::encode_in_envelope::<DeferRebootData, D>(
5538                        <DeferRebootData as fidl::encoding::ValueTypeMarker>::borrow(val),
5539                        encoder,
5540                        offset + 8,
5541                        _depth,
5542                    )
5543                }
5544                State::Complete(ref val) => fidl::encoding::encode_in_envelope::<CompleteData, D>(
5545                    <CompleteData as fidl::encoding::ValueTypeMarker>::borrow(val),
5546                    encoder,
5547                    offset + 8,
5548                    _depth,
5549                ),
5550                State::FailPrepare(ref val) => {
5551                    fidl::encoding::encode_in_envelope::<FailPrepareData, D>(
5552                        <FailPrepareData as fidl::encoding::ValueTypeMarker>::borrow(val),
5553                        encoder,
5554                        offset + 8,
5555                        _depth,
5556                    )
5557                }
5558                State::FailStage(ref val) => {
5559                    fidl::encoding::encode_in_envelope::<FailStageData, D>(
5560                        <FailStageData as fidl::encoding::ValueTypeMarker>::borrow(val),
5561                        encoder,
5562                        offset + 8,
5563                        _depth,
5564                    )
5565                }
5566                State::FailFetch(ref val) => {
5567                    fidl::encoding::encode_in_envelope::<FailFetchData, D>(
5568                        <FailFetchData as fidl::encoding::ValueTypeMarker>::borrow(val),
5569                        encoder,
5570                        offset + 8,
5571                        _depth,
5572                    )
5573                }
5574                State::FailCommit(ref val) => {
5575                    fidl::encoding::encode_in_envelope::<FailCommitData, D>(
5576                        <FailCommitData as fidl::encoding::ValueTypeMarker>::borrow(val),
5577                        encoder,
5578                        offset + 8,
5579                        _depth,
5580                    )
5581                }
5582                State::Canceled(ref val) => fidl::encoding::encode_in_envelope::<CanceledData, D>(
5583                    <CanceledData as fidl::encoding::ValueTypeMarker>::borrow(val),
5584                    encoder,
5585                    offset + 8,
5586                    _depth,
5587                ),
5588            }
5589        }
5590    }
5591
5592    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for State {
5593        #[inline(always)]
5594        fn new_empty() -> Self {
5595            Self::Prepare(fidl::new_empty!(PrepareData, D))
5596        }
5597
5598        #[inline]
5599        unsafe fn decode(
5600            &mut self,
5601            decoder: &mut fidl::encoding::Decoder<'_, D>,
5602            offset: usize,
5603            mut depth: fidl::encoding::Depth,
5604        ) -> fidl::Result<()> {
5605            decoder.debug_check_bounds::<Self>(offset);
5606            #[allow(unused_variables)]
5607            let next_out_of_line = decoder.next_out_of_line();
5608            let handles_before = decoder.remaining_handles();
5609            let (ordinal, inlined, num_bytes, num_handles) =
5610                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5611
5612            let member_inline_size = match ordinal {
5613                1 => <PrepareData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5614                2 => <StageData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5615                3 => <FetchData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5616                4 => <CommitData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5617                5 => <WaitToRebootData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5618                6 => <RebootData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5619                7 => <DeferRebootData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5620                8 => <CompleteData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5621                9 => <FailPrepareData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5622                10 => <FailStageData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5623                11 => <FailFetchData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5624                12 => <FailCommitData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5625                13 => <CanceledData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5626                _ => return Err(fidl::Error::UnknownUnionTag),
5627            };
5628
5629            if inlined != (member_inline_size <= 4) {
5630                return Err(fidl::Error::InvalidInlineBitInEnvelope);
5631            }
5632            let _inner_offset;
5633            if inlined {
5634                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5635                _inner_offset = offset + 8;
5636            } else {
5637                depth.increment()?;
5638                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5639            }
5640            match ordinal {
5641                1 => {
5642                    #[allow(irrefutable_let_patterns)]
5643                    if let State::Prepare(_) = self {
5644                        // Do nothing, read the value into the object
5645                    } else {
5646                        // Initialize `self` to the right variant
5647                        *self = State::Prepare(fidl::new_empty!(PrepareData, D));
5648                    }
5649                    #[allow(irrefutable_let_patterns)]
5650                    if let State::Prepare(ref mut val) = self {
5651                        fidl::decode!(PrepareData, D, val, decoder, _inner_offset, depth)?;
5652                    } else {
5653                        unreachable!()
5654                    }
5655                }
5656                2 => {
5657                    #[allow(irrefutable_let_patterns)]
5658                    if let State::Stage(_) = self {
5659                        // Do nothing, read the value into the object
5660                    } else {
5661                        // Initialize `self` to the right variant
5662                        *self = State::Stage(fidl::new_empty!(StageData, D));
5663                    }
5664                    #[allow(irrefutable_let_patterns)]
5665                    if let State::Stage(ref mut val) = self {
5666                        fidl::decode!(StageData, D, val, decoder, _inner_offset, depth)?;
5667                    } else {
5668                        unreachable!()
5669                    }
5670                }
5671                3 => {
5672                    #[allow(irrefutable_let_patterns)]
5673                    if let State::Fetch(_) = self {
5674                        // Do nothing, read the value into the object
5675                    } else {
5676                        // Initialize `self` to the right variant
5677                        *self = State::Fetch(fidl::new_empty!(FetchData, D));
5678                    }
5679                    #[allow(irrefutable_let_patterns)]
5680                    if let State::Fetch(ref mut val) = self {
5681                        fidl::decode!(FetchData, D, val, decoder, _inner_offset, depth)?;
5682                    } else {
5683                        unreachable!()
5684                    }
5685                }
5686                4 => {
5687                    #[allow(irrefutable_let_patterns)]
5688                    if let State::Commit(_) = self {
5689                        // Do nothing, read the value into the object
5690                    } else {
5691                        // Initialize `self` to the right variant
5692                        *self = State::Commit(fidl::new_empty!(CommitData, D));
5693                    }
5694                    #[allow(irrefutable_let_patterns)]
5695                    if let State::Commit(ref mut val) = self {
5696                        fidl::decode!(CommitData, D, val, decoder, _inner_offset, depth)?;
5697                    } else {
5698                        unreachable!()
5699                    }
5700                }
5701                5 => {
5702                    #[allow(irrefutable_let_patterns)]
5703                    if let State::WaitToReboot(_) = self {
5704                        // Do nothing, read the value into the object
5705                    } else {
5706                        // Initialize `self` to the right variant
5707                        *self = State::WaitToReboot(fidl::new_empty!(WaitToRebootData, D));
5708                    }
5709                    #[allow(irrefutable_let_patterns)]
5710                    if let State::WaitToReboot(ref mut val) = self {
5711                        fidl::decode!(WaitToRebootData, D, val, decoder, _inner_offset, depth)?;
5712                    } else {
5713                        unreachable!()
5714                    }
5715                }
5716                6 => {
5717                    #[allow(irrefutable_let_patterns)]
5718                    if let State::Reboot(_) = self {
5719                        // Do nothing, read the value into the object
5720                    } else {
5721                        // Initialize `self` to the right variant
5722                        *self = State::Reboot(fidl::new_empty!(RebootData, D));
5723                    }
5724                    #[allow(irrefutable_let_patterns)]
5725                    if let State::Reboot(ref mut val) = self {
5726                        fidl::decode!(RebootData, D, val, decoder, _inner_offset, depth)?;
5727                    } else {
5728                        unreachable!()
5729                    }
5730                }
5731                7 => {
5732                    #[allow(irrefutable_let_patterns)]
5733                    if let State::DeferReboot(_) = self {
5734                        // Do nothing, read the value into the object
5735                    } else {
5736                        // Initialize `self` to the right variant
5737                        *self = State::DeferReboot(fidl::new_empty!(DeferRebootData, D));
5738                    }
5739                    #[allow(irrefutable_let_patterns)]
5740                    if let State::DeferReboot(ref mut val) = self {
5741                        fidl::decode!(DeferRebootData, D, val, decoder, _inner_offset, depth)?;
5742                    } else {
5743                        unreachable!()
5744                    }
5745                }
5746                8 => {
5747                    #[allow(irrefutable_let_patterns)]
5748                    if let State::Complete(_) = self {
5749                        // Do nothing, read the value into the object
5750                    } else {
5751                        // Initialize `self` to the right variant
5752                        *self = State::Complete(fidl::new_empty!(CompleteData, D));
5753                    }
5754                    #[allow(irrefutable_let_patterns)]
5755                    if let State::Complete(ref mut val) = self {
5756                        fidl::decode!(CompleteData, D, val, decoder, _inner_offset, depth)?;
5757                    } else {
5758                        unreachable!()
5759                    }
5760                }
5761                9 => {
5762                    #[allow(irrefutable_let_patterns)]
5763                    if let State::FailPrepare(_) = self {
5764                        // Do nothing, read the value into the object
5765                    } else {
5766                        // Initialize `self` to the right variant
5767                        *self = State::FailPrepare(fidl::new_empty!(FailPrepareData, D));
5768                    }
5769                    #[allow(irrefutable_let_patterns)]
5770                    if let State::FailPrepare(ref mut val) = self {
5771                        fidl::decode!(FailPrepareData, D, val, decoder, _inner_offset, depth)?;
5772                    } else {
5773                        unreachable!()
5774                    }
5775                }
5776                10 => {
5777                    #[allow(irrefutable_let_patterns)]
5778                    if let State::FailStage(_) = self {
5779                        // Do nothing, read the value into the object
5780                    } else {
5781                        // Initialize `self` to the right variant
5782                        *self = State::FailStage(fidl::new_empty!(FailStageData, D));
5783                    }
5784                    #[allow(irrefutable_let_patterns)]
5785                    if let State::FailStage(ref mut val) = self {
5786                        fidl::decode!(FailStageData, D, val, decoder, _inner_offset, depth)?;
5787                    } else {
5788                        unreachable!()
5789                    }
5790                }
5791                11 => {
5792                    #[allow(irrefutable_let_patterns)]
5793                    if let State::FailFetch(_) = self {
5794                        // Do nothing, read the value into the object
5795                    } else {
5796                        // Initialize `self` to the right variant
5797                        *self = State::FailFetch(fidl::new_empty!(FailFetchData, D));
5798                    }
5799                    #[allow(irrefutable_let_patterns)]
5800                    if let State::FailFetch(ref mut val) = self {
5801                        fidl::decode!(FailFetchData, D, val, decoder, _inner_offset, depth)?;
5802                    } else {
5803                        unreachable!()
5804                    }
5805                }
5806                12 => {
5807                    #[allow(irrefutable_let_patterns)]
5808                    if let State::FailCommit(_) = self {
5809                        // Do nothing, read the value into the object
5810                    } else {
5811                        // Initialize `self` to the right variant
5812                        *self = State::FailCommit(fidl::new_empty!(FailCommitData, D));
5813                    }
5814                    #[allow(irrefutable_let_patterns)]
5815                    if let State::FailCommit(ref mut val) = self {
5816                        fidl::decode!(FailCommitData, D, val, decoder, _inner_offset, depth)?;
5817                    } else {
5818                        unreachable!()
5819                    }
5820                }
5821                13 => {
5822                    #[allow(irrefutable_let_patterns)]
5823                    if let State::Canceled(_) = self {
5824                        // Do nothing, read the value into the object
5825                    } else {
5826                        // Initialize `self` to the right variant
5827                        *self = State::Canceled(fidl::new_empty!(CanceledData, D));
5828                    }
5829                    #[allow(irrefutable_let_patterns)]
5830                    if let State::Canceled(ref mut val) = self {
5831                        fidl::decode!(CanceledData, D, val, decoder, _inner_offset, depth)?;
5832                    } else {
5833                        unreachable!()
5834                    }
5835                }
5836                ordinal => panic!("unexpected ordinal {:?}", ordinal),
5837            }
5838            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5839                return Err(fidl::Error::InvalidNumBytesInEnvelope);
5840            }
5841            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5842                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5843            }
5844            Ok(())
5845        }
5846    }
5847}