fidl_fuchsia_feedback_common/
fidl_fuchsia_feedback_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
11/// Maximum length for an annotation's key.
12pub const MAX_ANNOTATION_KEY_LENGTH: u64 = 128;
13
14/// Maximum length for an annotation's value.
15pub const MAX_ANNOTATION_VALUE_LENGTH: u64 = 1024;
16
17pub const MAX_CRASH_SIGNATURE_LENGTH: u32 = 128;
18
19pub const MAX_EVENT_ID_LENGTH: u32 = 128;
20
21pub const MAX_EXCEPTION_MESSAGE_LENGTH: u32 = 4096;
22
23pub const MAX_EXCEPTION_TYPE_LENGTH: u32 = 128;
24
25pub const MAX_NAMESPACE_LENGTH: u32 = 32;
26
27pub const MAX_NUM_ANNOTATIONS2_PROVIDED: u32 = 512;
28
29pub const MAX_NUM_ANNOTATIONS_PER_CRASH_REPORT: u32 = 32;
30
31pub const MAX_NUM_ANNOTATIONS_PER_NAMESPACE: u32 = 16;
32
33/// # Deprecation
34///
35/// Feedback is getting close to the limit defined by MAX_NUM_ANNOTATIONS_PROVIDED. Clients
36/// should migrate to using MAX_NUM_ANNOTATIONS2_PROVIDED with |annotations2|, which will include
37/// all annotations included in |annotations| but has a higher limit for future growth.
38pub const MAX_NUM_ANNOTATIONS_PROVIDED: u32 = 64;
39
40pub const MAX_NUM_ATTACHMENTS_PER_CRASH_REPORT: u32 = 16;
41
42pub const MAX_PROCESS_NAME_LENGTH: u32 = 64;
43
44pub const MAX_PROGRAM_NAME_LENGTH: u32 = 1024;
45
46pub const MAX_REPORT_ID_LENGTH: u32 = 64;
47
48pub const MAX_THREAD_NAME_LENGTH: u32 = 64;
49
50#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
51pub enum FilingError {
52    Unknown,
53    InvalidArgsError,
54    ServerError,
55    PersistenceError,
56    QuotaReachedError,
57    #[doc(hidden)]
58    __SourceBreaking {
59        unknown_ordinal: u32,
60    },
61}
62
63/// Pattern that matches an unknown `FilingError` member.
64#[macro_export]
65macro_rules! FilingErrorUnknown {
66    () => {
67        _
68    };
69}
70
71impl FilingError {
72    #[inline]
73    pub fn from_primitive(prim: u32) -> Option<Self> {
74        match prim {
75            0 => Some(Self::Unknown),
76            1 => Some(Self::InvalidArgsError),
77            2 => Some(Self::ServerError),
78            3 => Some(Self::PersistenceError),
79            4 => Some(Self::QuotaReachedError),
80            _ => None,
81        }
82    }
83
84    #[inline]
85    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
86        match prim {
87            0 => Self::Unknown,
88            1 => Self::InvalidArgsError,
89            2 => Self::ServerError,
90            3 => Self::PersistenceError,
91            4 => Self::QuotaReachedError,
92            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
93        }
94    }
95
96    #[inline]
97    pub fn unknown() -> Self {
98        Self::__SourceBreaking { unknown_ordinal: 0x0 }
99    }
100
101    #[inline]
102    pub const fn into_primitive(self) -> u32 {
103        match self {
104            Self::Unknown => 0,
105            Self::InvalidArgsError => 1,
106            Self::ServerError => 2,
107            Self::PersistenceError => 3,
108            Self::QuotaReachedError => 4,
109            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
110        }
111    }
112
113    #[inline]
114    pub fn is_unknown(&self) -> bool {
115        match self {
116            Self::__SourceBreaking { unknown_ordinal: _ } => true,
117            _ => false,
118        }
119    }
120}
121
122/// "Memory" refers to a non-persistent location, e.g. a memory-backed
123/// filesystem.
124#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
125pub enum FilingSuccess {
126    Unknown,
127    ReportUploaded,
128    ReportOnDisk,
129    ReportInMemory,
130    ReportNotFiledUserOptedOut,
131    #[doc(hidden)]
132    __SourceBreaking {
133        unknown_ordinal: u32,
134    },
135}
136
137/// Pattern that matches an unknown `FilingSuccess` member.
138#[macro_export]
139macro_rules! FilingSuccessUnknown {
140    () => {
141        _
142    };
143}
144
145impl FilingSuccess {
146    #[inline]
147    pub fn from_primitive(prim: u32) -> Option<Self> {
148        match prim {
149            0 => Some(Self::Unknown),
150            1 => Some(Self::ReportUploaded),
151            2 => Some(Self::ReportOnDisk),
152            3 => Some(Self::ReportInMemory),
153            4 => Some(Self::ReportNotFiledUserOptedOut),
154            _ => None,
155        }
156    }
157
158    #[inline]
159    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
160        match prim {
161            0 => Self::Unknown,
162            1 => Self::ReportUploaded,
163            2 => Self::ReportOnDisk,
164            3 => Self::ReportInMemory,
165            4 => Self::ReportNotFiledUserOptedOut,
166            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
167        }
168    }
169
170    #[inline]
171    pub fn unknown() -> Self {
172        Self::__SourceBreaking { unknown_ordinal: 0x0 }
173    }
174
175    #[inline]
176    pub const fn into_primitive(self) -> u32 {
177        match self {
178            Self::Unknown => 0,
179            Self::ReportUploaded => 1,
180            Self::ReportOnDisk => 2,
181            Self::ReportInMemory => 3,
182            Self::ReportNotFiledUserOptedOut => 4,
183            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
184        }
185    }
186
187    #[inline]
188    pub fn is_unknown(&self) -> bool {
189        match self {
190            Self::__SourceBreaking { unknown_ordinal: _ } => true,
191            _ => false,
192        }
193    }
194}
195
196/// The encoding used for the image.
197///
198/// Today, only PNG is supported, but in the future the screenshot could be
199/// returned in other encodings if need arises.
200#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
201#[repr(u32)]
202pub enum ImageEncoding {
203    Png = 0,
204}
205
206impl ImageEncoding {
207    #[inline]
208    pub fn from_primitive(prim: u32) -> Option<Self> {
209        match prim {
210            0 => Some(Self::Png),
211            _ => None,
212        }
213    }
214
215    #[inline]
216    pub const fn into_primitive(self) -> u32 {
217        self as u32
218    }
219
220    #[deprecated = "Strict enums should not use `is_unknown`"]
221    #[inline]
222    pub fn is_unknown(&self) -> bool {
223        false
224    }
225}
226
227/// Reasons why a device last rebooted.
228#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
229pub enum RebootReason {
230    /// The client will get this value if the server is sending a new enum value that the client
231    /// was not compiled with.
232    Unknown,
233    /// The device booted from a cold state.
234    ///
235    /// This is most likely the result of an extended period of time without power or a device
236    /// booting with Fuchsia for the first time.
237    Cold,
238    /// The device rebooted due to a brief loss of power.
239    ///
240    /// On some hardware this could be the result of a user disconnecting, then reconnecting their
241    /// device's power supply in rapid succession.
242    BriefPowerLoss,
243    /// The device rebooted because its voltage dipped below an allowable level without going to 0.
244    Brownout,
245    KernelPanic,
246    SystemOutOfMemory,
247    HardwareWatchdogTimeout,
248    SoftwareWatchdogTimeout,
249    /// The device rebooted because the userspace root job was terminated, most likely because one
250    /// of its critical processes crashed.
251    RootJobTermination,
252    /// The device rebooted because a user of the device initiated the reboot. A user can be a
253    /// human or a program that interacts with the device on behalf of a human, such as SL4F or RCS.
254    UserRequest,
255    /// The device rebooted because applying the OTA failed and we want to retry.
256    RetrySystemUpdate,
257    /// The device rebooted because it was determined to be too hot.
258    HighTemperature,
259    /// The device rebooted because of an issue with a session or because the session manager was
260    /// unable to  recover from an error.
261    SessionFailure,
262    /// The device rebooted because the system manager (sysmgr) was unable to recover from an
263    /// error.
264    SysmgrFailure,
265    /// The device rebooted following a data reset to factory defaults.
266    /// See [`fuchsia.recovery.FactoryReset`].
267    FactoryDataReset,
268    /// The device rebooted because a critical component managed by sysmgr has failed.
269    CriticalComponentFailure,
270    /// The device rebooted to apply the swap of Zircon boot images.
271    ZbiSwap,
272    /// The device rebooted because of an OTA.
273    SystemUpdate,
274    /// The Netstack component is changing versions.
275    NetstackMigration,
276    #[doc(hidden)]
277    __SourceBreaking {
278        unknown_ordinal: u16,
279    },
280}
281
282/// Pattern that matches an unknown `RebootReason` member.
283#[macro_export]
284macro_rules! RebootReasonUnknown {
285    () => {
286        _
287    };
288}
289
290impl RebootReason {
291    #[inline]
292    pub fn from_primitive(prim: u16) -> Option<Self> {
293        match prim {
294            0 => Some(Self::Unknown),
295            2 => Some(Self::Cold),
296            3 => Some(Self::BriefPowerLoss),
297            4 => Some(Self::Brownout),
298            5 => Some(Self::KernelPanic),
299            6 => Some(Self::SystemOutOfMemory),
300            7 => Some(Self::HardwareWatchdogTimeout),
301            8 => Some(Self::SoftwareWatchdogTimeout),
302            19 => Some(Self::RootJobTermination),
303            9 => Some(Self::UserRequest),
304            17 => Some(Self::RetrySystemUpdate),
305            11 => Some(Self::HighTemperature),
306            12 => Some(Self::SessionFailure),
307            15 => Some(Self::SysmgrFailure),
308            14 => Some(Self::FactoryDataReset),
309            16 => Some(Self::CriticalComponentFailure),
310            18 => Some(Self::ZbiSwap),
311            10 => Some(Self::SystemUpdate),
312            20 => Some(Self::NetstackMigration),
313            _ => None,
314        }
315    }
316
317    #[inline]
318    pub fn from_primitive_allow_unknown(prim: u16) -> Self {
319        match prim {
320            0 => Self::Unknown,
321            2 => Self::Cold,
322            3 => Self::BriefPowerLoss,
323            4 => Self::Brownout,
324            5 => Self::KernelPanic,
325            6 => Self::SystemOutOfMemory,
326            7 => Self::HardwareWatchdogTimeout,
327            8 => Self::SoftwareWatchdogTimeout,
328            19 => Self::RootJobTermination,
329            9 => Self::UserRequest,
330            17 => Self::RetrySystemUpdate,
331            11 => Self::HighTemperature,
332            12 => Self::SessionFailure,
333            15 => Self::SysmgrFailure,
334            14 => Self::FactoryDataReset,
335            16 => Self::CriticalComponentFailure,
336            18 => Self::ZbiSwap,
337            10 => Self::SystemUpdate,
338            20 => Self::NetstackMigration,
339            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
340        }
341    }
342
343    #[inline]
344    pub fn unknown() -> Self {
345        Self::__SourceBreaking { unknown_ordinal: 0x0 }
346    }
347
348    #[inline]
349    pub const fn into_primitive(self) -> u16 {
350        match self {
351            Self::Unknown => 0,
352            Self::Cold => 2,
353            Self::BriefPowerLoss => 3,
354            Self::Brownout => 4,
355            Self::KernelPanic => 5,
356            Self::SystemOutOfMemory => 6,
357            Self::HardwareWatchdogTimeout => 7,
358            Self::SoftwareWatchdogTimeout => 8,
359            Self::RootJobTermination => 19,
360            Self::UserRequest => 9,
361            Self::RetrySystemUpdate => 17,
362            Self::HighTemperature => 11,
363            Self::SessionFailure => 12,
364            Self::SysmgrFailure => 15,
365            Self::FactoryDataReset => 14,
366            Self::CriticalComponentFailure => 16,
367            Self::ZbiSwap => 18,
368            Self::SystemUpdate => 10,
369            Self::NetstackMigration => 20,
370            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
371        }
372    }
373
374    #[inline]
375    pub fn is_unknown(&self) -> bool {
376        match self {
377            Self::__SourceBreaking { unknown_ordinal: _ } => true,
378            _ => false,
379        }
380    }
381}
382
383/// An annotation and its plain ASCII string key.
384/// Annotations are short strings, e.g., the board name or the build version.
385#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
386pub struct Annotation {
387    pub key: String,
388    pub value: String,
389}
390
391impl fidl::Persistable for Annotation {}
392
393#[derive(Clone, Debug, PartialEq)]
394pub struct ComponentDataRegisterUpsertRequest {
395    pub data: ComponentData,
396}
397
398impl fidl::Persistable for ComponentDataRegisterUpsertRequest {}
399
400#[derive(Clone, Debug, PartialEq)]
401pub struct CrashReporterFileReportResponse {
402    pub results: FileReportResults,
403}
404
405impl fidl::Persistable for CrashReporterFileReportResponse {}
406
407#[derive(Clone, Debug, PartialEq)]
408pub struct CrashReportingProductRegisterUpsertRequest {
409    pub component_url: String,
410    pub product: CrashReportingProduct,
411}
412
413impl fidl::Persistable for CrashReportingProductRegisterUpsertRequest {}
414
415#[derive(Clone, Debug, PartialEq)]
416pub struct CrashReportingProductRegisterUpsertWithAckRequest {
417    pub component_url: String,
418    pub product: CrashReportingProduct,
419}
420
421impl fidl::Persistable for CrashReportingProductRegisterUpsertWithAckRequest {}
422
423#[derive(Clone, Debug, PartialEq)]
424pub struct DataProviderGetAnnotationsRequest {
425    pub params: GetAnnotationsParameters,
426}
427
428impl fidl::Persistable for DataProviderGetAnnotationsRequest {}
429
430#[derive(Clone, Debug, PartialEq)]
431pub struct DataProviderGetAnnotationsResponse {
432    pub annotations: Annotations,
433}
434
435impl fidl::Persistable for DataProviderGetAnnotationsResponse {}
436
437#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
438pub struct DataProviderGetScreenshotRequest {
439    pub encoding: ImageEncoding,
440}
441
442impl fidl::Persistable for DataProviderGetScreenshotRequest {}
443
444#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
445pub struct DeviceIdProviderGetIdResponse {
446    pub feedback_id: String,
447}
448
449impl fidl::Persistable for DeviceIdProviderGetIdResponse {}
450
451#[derive(Clone, Debug, PartialEq)]
452pub struct LastRebootInfoProviderGetResponse {
453    pub last_reboot: LastReboot,
454}
455
456impl fidl::Persistable for LastRebootInfoProviderGetResponse {}
457
458/// Annotations about the device's state.
459///
460/// Clients typically upload the data straight to servers. So the data comes in the form of
461/// arbitrary key-value pairs that clients can directly forward to the servers.
462#[derive(Clone, Debug, Default, PartialEq)]
463pub struct Annotations {
464    /// A vector of key-value string pairs. Keys are guaranteed to be unique.
465    ///
466    /// # Deprecation
467    ///
468    /// Feedback is getting close to the limit defined by MAX_NUM_ANNOTATIONS_PROVIDED. Clients
469    /// should migrate to |annotations2|, which will include all annotations included in
470    /// |annotations| but has a higher limit for future growth.
471    pub annotations: Option<Vec<Annotation>>,
472    /// A vector of key-value string pairs. Keys are guaranteed to be unique.
473    pub annotations2: Option<Vec<Annotation>>,
474    #[doc(hidden)]
475    pub __source_breaking: fidl::marker::SourceBreaking,
476}
477
478impl fidl::Persistable for Annotations {}
479
480/// Data known to a component, but not exposed to the platform, to attach to feedback reports.
481#[derive(Clone, Debug, Default, PartialEq)]
482pub struct ComponentData {
483    /// The top-level namespace associated with the data:
484    /// * Is intended to group related data together and reduce data key collisions across
485    ///   namespaces.
486    /// * May be shared by multiple clients, e.g., there could be multiple clients within the same
487    ///   component or across components that want to expose related data and they would all use
488    ///   the same namespace.
489    /// * Will be prefixed to every data key passed within that namespace in all feedback reports,
490    ///   e.g., the annotation "version" would appear as "foo.version" in all feedback reports if
491    ///   the namespace is "foo".
492    /// * Must match [a-z\-]+, i.e. only lowercase letters and hyphens or this will result in a
493    ///   ZX_ERR_INVALID_ARGS epitaph.
494    /// * Must not match a reserved namespace used internally for platform data, e.g., "build", or
495    ///   this will result in a ZX_ERR_INVALID_ARGS epitaph. The list of reserved namespaces is
496    ///   internal and subject to change for now.
497    pub namespace: Option<String>,
498    /// A vector of key-value string pairs, e.g., `<"version", "1.2.3.45">`.
499    ///
500    /// Keys:
501    /// * Should be unique as only the latest value for a given key in the vector will be
502    ///   considered.
503    /// * Must match [a-z\-\.]+, i.e. only lowercase letters, hyphens and periods. Use periods for
504    ///   sub-namespacing, e.g., "build.label" and "build.type", so that related annotations are
505    ///   grouped together (here related to "build") when sorted lexicographically.
506    pub annotations: Option<Vec<Annotation>>,
507    #[doc(hidden)]
508    pub __source_breaking: fidl::marker::SourceBreaking,
509}
510
511impl fidl::Persistable for ComponentData {}
512
513/// Product information to report to the crash server.
514#[derive(Clone, Debug, Default, PartialEq)]
515pub struct CrashReportingProduct {
516    /// The product name on the crash server.
517    /// * The first character has to be alphanumeric. The remaining characters must be printable,
518    ///   but cannot be a space, which leaves values 33 to 127 in the ASCII table. Any other
519    ///   characters will result in a ZX_ERR_INVALID_ARGS epitaph.
520    /// * Missing this required field will result in a ZX_ERR_INVALID_ARGS epitaph.
521    pub name: Option<String>,
522    /// Optional product version of the component.
523    /// * The first character has to be alphanumeric. The remaining characters must be printable,
524    ///   but cannot be a space, which leaves values 33 to 127 in the ASCII table. Any other
525    ///   characters will result in a ZX_ERR_INVALID_ARGS epitaph.
526    ///
527    /// If no version is specified then none is reported to the crash server.
528    pub version: Option<String>,
529    /// Optional product release channel for the component, e.g., "canary", "beta", "stable".
530    ///
531    /// If no channel is specified then none is reported to the crash server.
532    pub channel: Option<String>,
533    #[doc(hidden)]
534    pub __source_breaking: fidl::marker::SourceBreaking,
535}
536
537impl fidl::Persistable for CrashReportingProduct {}
538
539#[derive(Clone, Debug, Default, PartialEq)]
540pub struct FileReportResults {
541    /// The success type.
542    pub result: Option<FilingSuccess>,
543    /// A non-empty value if |result| is FilingSuccess::REPORT_UPLOADED.
544    pub report_id: Option<String>,
545    #[doc(hidden)]
546    pub __source_breaking: fidl::marker::SourceBreaking,
547}
548
549impl fidl::Persistable for FileReportResults {}
550
551/// Parameters for the DataProvider::GetAnnotations() method.
552#[derive(Clone, Debug, Default, PartialEq)]
553pub struct GetAnnotationsParameters {
554    /// Annotations are collected in parallel from various places in the platform, each with a
555    /// timeout.
556    ///
557    /// `collection_timeout_per_annotation` allows clients to control how much time is given to
558    /// each annotation collection. It enables clients to get a partial set of annotations under a
559    /// certain time.
560    pub collection_timeout_per_annotation: Option<i64>,
561    #[doc(hidden)]
562    pub __source_breaking: fidl::marker::SourceBreaking,
563}
564
565impl fidl::Persistable for GetAnnotationsParameters {}
566
567/// Information about why a device last rebooted.
568#[derive(Clone, Debug, Default, PartialEq)]
569pub struct LastReboot {
570    /// Whether the last reboot was graceful, i.e. the device didn't reboot in response to an error
571    /// and rebooted in a controlled manner.
572    ///
573    /// This field allows clients to know whether the last reboot was graceful without having to
574    /// parse the optional |reason| field. This is useful when |reason| is not set, i.e. because
575    /// the system doesn't know more than the fact that the reboot was graceful, or when the API
576    /// evolves to support new RebootReason values and the clients hasn't been updated yet.
577    ///
578    /// This field is always has a value if |reason| is provided. However, |reason| might not
579    /// always have a value this field is provided.
580    pub graceful: Option<bool>,
581    /// Why a device last rebooted.
582    pub reason: Option<RebootReason>,
583    /// The uptime of the device before it rebooted. This is the amount of time since boot,
584    /// including any time spent in suspend-to-idle.
585    pub uptime: Option<i64>,
586    /// Whether the last reboot was planned, i.e. the device rebooted in accordance to a schedule
587    /// applied by the system.
588    ///
589    /// This field allows clients to know whether the last reboot was planned without having to
590    /// parse the |reason| field.
591    ///
592    /// Planned reboots are by nature, graceful.
593    pub planned: Option<bool>,
594    /// The runtime of the device before it rebooted. This is the amount of time since boot
595    /// excluding any time spent in suspend-to-idle.
596    pub runtime: Option<i64>,
597    #[doc(hidden)]
598    pub __source_breaking: fidl::marker::SourceBreaking,
599}
600
601impl fidl::Persistable for LastReboot {}
602
603mod internal {
604    use super::*;
605    unsafe impl fidl::encoding::TypeMarker for FilingError {
606        type Owned = Self;
607
608        #[inline(always)]
609        fn inline_align(_context: fidl::encoding::Context) -> usize {
610            std::mem::align_of::<u32>()
611        }
612
613        #[inline(always)]
614        fn inline_size(_context: fidl::encoding::Context) -> usize {
615            std::mem::size_of::<u32>()
616        }
617
618        #[inline(always)]
619        fn encode_is_copy() -> bool {
620            false
621        }
622
623        #[inline(always)]
624        fn decode_is_copy() -> bool {
625            false
626        }
627    }
628
629    impl fidl::encoding::ValueTypeMarker for FilingError {
630        type Borrowed<'a> = Self;
631        #[inline(always)]
632        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
633            *value
634        }
635    }
636
637    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilingError {
638        #[inline]
639        unsafe fn encode(
640            self,
641            encoder: &mut fidl::encoding::Encoder<'_, D>,
642            offset: usize,
643            _depth: fidl::encoding::Depth,
644        ) -> fidl::Result<()> {
645            encoder.debug_check_bounds::<Self>(offset);
646            encoder.write_num(self.into_primitive(), offset);
647            Ok(())
648        }
649    }
650
651    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilingError {
652        #[inline(always)]
653        fn new_empty() -> Self {
654            Self::unknown()
655        }
656
657        #[inline]
658        unsafe fn decode(
659            &mut self,
660            decoder: &mut fidl::encoding::Decoder<'_, D>,
661            offset: usize,
662            _depth: fidl::encoding::Depth,
663        ) -> fidl::Result<()> {
664            decoder.debug_check_bounds::<Self>(offset);
665            let prim = decoder.read_num::<u32>(offset);
666
667            *self = Self::from_primitive_allow_unknown(prim);
668            Ok(())
669        }
670    }
671    unsafe impl fidl::encoding::TypeMarker for FilingSuccess {
672        type Owned = Self;
673
674        #[inline(always)]
675        fn inline_align(_context: fidl::encoding::Context) -> usize {
676            std::mem::align_of::<u32>()
677        }
678
679        #[inline(always)]
680        fn inline_size(_context: fidl::encoding::Context) -> usize {
681            std::mem::size_of::<u32>()
682        }
683
684        #[inline(always)]
685        fn encode_is_copy() -> bool {
686            false
687        }
688
689        #[inline(always)]
690        fn decode_is_copy() -> bool {
691            false
692        }
693    }
694
695    impl fidl::encoding::ValueTypeMarker for FilingSuccess {
696        type Borrowed<'a> = Self;
697        #[inline(always)]
698        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
699            *value
700        }
701    }
702
703    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilingSuccess {
704        #[inline]
705        unsafe fn encode(
706            self,
707            encoder: &mut fidl::encoding::Encoder<'_, D>,
708            offset: usize,
709            _depth: fidl::encoding::Depth,
710        ) -> fidl::Result<()> {
711            encoder.debug_check_bounds::<Self>(offset);
712            encoder.write_num(self.into_primitive(), offset);
713            Ok(())
714        }
715    }
716
717    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilingSuccess {
718        #[inline(always)]
719        fn new_empty() -> Self {
720            Self::unknown()
721        }
722
723        #[inline]
724        unsafe fn decode(
725            &mut self,
726            decoder: &mut fidl::encoding::Decoder<'_, D>,
727            offset: usize,
728            _depth: fidl::encoding::Depth,
729        ) -> fidl::Result<()> {
730            decoder.debug_check_bounds::<Self>(offset);
731            let prim = decoder.read_num::<u32>(offset);
732
733            *self = Self::from_primitive_allow_unknown(prim);
734            Ok(())
735        }
736    }
737    unsafe impl fidl::encoding::TypeMarker for ImageEncoding {
738        type Owned = Self;
739
740        #[inline(always)]
741        fn inline_align(_context: fidl::encoding::Context) -> usize {
742            std::mem::align_of::<u32>()
743        }
744
745        #[inline(always)]
746        fn inline_size(_context: fidl::encoding::Context) -> usize {
747            std::mem::size_of::<u32>()
748        }
749
750        #[inline(always)]
751        fn encode_is_copy() -> bool {
752            true
753        }
754
755        #[inline(always)]
756        fn decode_is_copy() -> bool {
757            false
758        }
759    }
760
761    impl fidl::encoding::ValueTypeMarker for ImageEncoding {
762        type Borrowed<'a> = Self;
763        #[inline(always)]
764        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
765            *value
766        }
767    }
768
769    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ImageEncoding {
770        #[inline]
771        unsafe fn encode(
772            self,
773            encoder: &mut fidl::encoding::Encoder<'_, D>,
774            offset: usize,
775            _depth: fidl::encoding::Depth,
776        ) -> fidl::Result<()> {
777            encoder.debug_check_bounds::<Self>(offset);
778            encoder.write_num(self.into_primitive(), offset);
779            Ok(())
780        }
781    }
782
783    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageEncoding {
784        #[inline(always)]
785        fn new_empty() -> Self {
786            Self::Png
787        }
788
789        #[inline]
790        unsafe fn decode(
791            &mut self,
792            decoder: &mut fidl::encoding::Decoder<'_, D>,
793            offset: usize,
794            _depth: fidl::encoding::Depth,
795        ) -> fidl::Result<()> {
796            decoder.debug_check_bounds::<Self>(offset);
797            let prim = decoder.read_num::<u32>(offset);
798
799            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
800            Ok(())
801        }
802    }
803    unsafe impl fidl::encoding::TypeMarker for RebootReason {
804        type Owned = Self;
805
806        #[inline(always)]
807        fn inline_align(_context: fidl::encoding::Context) -> usize {
808            std::mem::align_of::<u16>()
809        }
810
811        #[inline(always)]
812        fn inline_size(_context: fidl::encoding::Context) -> usize {
813            std::mem::size_of::<u16>()
814        }
815
816        #[inline(always)]
817        fn encode_is_copy() -> bool {
818            false
819        }
820
821        #[inline(always)]
822        fn decode_is_copy() -> bool {
823            false
824        }
825    }
826
827    impl fidl::encoding::ValueTypeMarker for RebootReason {
828        type Borrowed<'a> = Self;
829        #[inline(always)]
830        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
831            *value
832        }
833    }
834
835    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RebootReason {
836        #[inline]
837        unsafe fn encode(
838            self,
839            encoder: &mut fidl::encoding::Encoder<'_, D>,
840            offset: usize,
841            _depth: fidl::encoding::Depth,
842        ) -> fidl::Result<()> {
843            encoder.debug_check_bounds::<Self>(offset);
844            encoder.write_num(self.into_primitive(), offset);
845            Ok(())
846        }
847    }
848
849    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RebootReason {
850        #[inline(always)]
851        fn new_empty() -> Self {
852            Self::unknown()
853        }
854
855        #[inline]
856        unsafe fn decode(
857            &mut self,
858            decoder: &mut fidl::encoding::Decoder<'_, D>,
859            offset: usize,
860            _depth: fidl::encoding::Depth,
861        ) -> fidl::Result<()> {
862            decoder.debug_check_bounds::<Self>(offset);
863            let prim = decoder.read_num::<u16>(offset);
864
865            *self = Self::from_primitive_allow_unknown(prim);
866            Ok(())
867        }
868    }
869
870    impl fidl::encoding::ValueTypeMarker for Annotation {
871        type Borrowed<'a> = &'a Self;
872        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
873            value
874        }
875    }
876
877    unsafe impl fidl::encoding::TypeMarker for Annotation {
878        type Owned = Self;
879
880        #[inline(always)]
881        fn inline_align(_context: fidl::encoding::Context) -> usize {
882            8
883        }
884
885        #[inline(always)]
886        fn inline_size(_context: fidl::encoding::Context) -> usize {
887            32
888        }
889    }
890
891    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Annotation, D>
892        for &Annotation
893    {
894        #[inline]
895        unsafe fn encode(
896            self,
897            encoder: &mut fidl::encoding::Encoder<'_, D>,
898            offset: usize,
899            _depth: fidl::encoding::Depth,
900        ) -> fidl::Result<()> {
901            encoder.debug_check_bounds::<Annotation>(offset);
902            // Delegate to tuple encoding.
903            fidl::encoding::Encode::<Annotation, D>::encode(
904                (
905                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
906                    <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
907                ),
908                encoder, offset, _depth
909            )
910        }
911    }
912    unsafe impl<
913            D: fidl::encoding::ResourceDialect,
914            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
915            T1: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>, D>,
916        > fidl::encoding::Encode<Annotation, D> for (T0, T1)
917    {
918        #[inline]
919        unsafe fn encode(
920            self,
921            encoder: &mut fidl::encoding::Encoder<'_, D>,
922            offset: usize,
923            depth: fidl::encoding::Depth,
924        ) -> fidl::Result<()> {
925            encoder.debug_check_bounds::<Annotation>(offset);
926            // Zero out padding regions. There's no need to apply masks
927            // because the unmasked parts will be overwritten by fields.
928            // Write the fields.
929            self.0.encode(encoder, offset + 0, depth)?;
930            self.1.encode(encoder, offset + 16, depth)?;
931            Ok(())
932        }
933    }
934
935    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Annotation {
936        #[inline(always)]
937        fn new_empty() -> Self {
938            Self {
939                key: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
940                value: fidl::new_empty!(fidl::encoding::BoundedString<1024>, D),
941            }
942        }
943
944        #[inline]
945        unsafe fn decode(
946            &mut self,
947            decoder: &mut fidl::encoding::Decoder<'_, D>,
948            offset: usize,
949            _depth: fidl::encoding::Depth,
950        ) -> fidl::Result<()> {
951            decoder.debug_check_bounds::<Self>(offset);
952            // Verify that padding bytes are zero.
953            fidl::decode!(
954                fidl::encoding::BoundedString<128>,
955                D,
956                &mut self.key,
957                decoder,
958                offset + 0,
959                _depth
960            )?;
961            fidl::decode!(
962                fidl::encoding::BoundedString<1024>,
963                D,
964                &mut self.value,
965                decoder,
966                offset + 16,
967                _depth
968            )?;
969            Ok(())
970        }
971    }
972
973    impl fidl::encoding::ValueTypeMarker for ComponentDataRegisterUpsertRequest {
974        type Borrowed<'a> = &'a Self;
975        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
976            value
977        }
978    }
979
980    unsafe impl fidl::encoding::TypeMarker for ComponentDataRegisterUpsertRequest {
981        type Owned = Self;
982
983        #[inline(always)]
984        fn inline_align(_context: fidl::encoding::Context) -> usize {
985            8
986        }
987
988        #[inline(always)]
989        fn inline_size(_context: fidl::encoding::Context) -> usize {
990            16
991        }
992    }
993
994    unsafe impl<D: fidl::encoding::ResourceDialect>
995        fidl::encoding::Encode<ComponentDataRegisterUpsertRequest, D>
996        for &ComponentDataRegisterUpsertRequest
997    {
998        #[inline]
999        unsafe fn encode(
1000            self,
1001            encoder: &mut fidl::encoding::Encoder<'_, D>,
1002            offset: usize,
1003            _depth: fidl::encoding::Depth,
1004        ) -> fidl::Result<()> {
1005            encoder.debug_check_bounds::<ComponentDataRegisterUpsertRequest>(offset);
1006            // Delegate to tuple encoding.
1007            fidl::encoding::Encode::<ComponentDataRegisterUpsertRequest, D>::encode(
1008                (<ComponentData as fidl::encoding::ValueTypeMarker>::borrow(&self.data),),
1009                encoder,
1010                offset,
1011                _depth,
1012            )
1013        }
1014    }
1015    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ComponentData, D>>
1016        fidl::encoding::Encode<ComponentDataRegisterUpsertRequest, D> for (T0,)
1017    {
1018        #[inline]
1019        unsafe fn encode(
1020            self,
1021            encoder: &mut fidl::encoding::Encoder<'_, D>,
1022            offset: usize,
1023            depth: fidl::encoding::Depth,
1024        ) -> fidl::Result<()> {
1025            encoder.debug_check_bounds::<ComponentDataRegisterUpsertRequest>(offset);
1026            // Zero out padding regions. There's no need to apply masks
1027            // because the unmasked parts will be overwritten by fields.
1028            // Write the fields.
1029            self.0.encode(encoder, offset + 0, depth)?;
1030            Ok(())
1031        }
1032    }
1033
1034    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1035        for ComponentDataRegisterUpsertRequest
1036    {
1037        #[inline(always)]
1038        fn new_empty() -> Self {
1039            Self { data: fidl::new_empty!(ComponentData, D) }
1040        }
1041
1042        #[inline]
1043        unsafe fn decode(
1044            &mut self,
1045            decoder: &mut fidl::encoding::Decoder<'_, D>,
1046            offset: usize,
1047            _depth: fidl::encoding::Depth,
1048        ) -> fidl::Result<()> {
1049            decoder.debug_check_bounds::<Self>(offset);
1050            // Verify that padding bytes are zero.
1051            fidl::decode!(ComponentData, D, &mut self.data, decoder, offset + 0, _depth)?;
1052            Ok(())
1053        }
1054    }
1055
1056    impl fidl::encoding::ValueTypeMarker for CrashReporterFileReportResponse {
1057        type Borrowed<'a> = &'a Self;
1058        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1059            value
1060        }
1061    }
1062
1063    unsafe impl fidl::encoding::TypeMarker for CrashReporterFileReportResponse {
1064        type Owned = Self;
1065
1066        #[inline(always)]
1067        fn inline_align(_context: fidl::encoding::Context) -> usize {
1068            8
1069        }
1070
1071        #[inline(always)]
1072        fn inline_size(_context: fidl::encoding::Context) -> usize {
1073            16
1074        }
1075    }
1076
1077    unsafe impl<D: fidl::encoding::ResourceDialect>
1078        fidl::encoding::Encode<CrashReporterFileReportResponse, D>
1079        for &CrashReporterFileReportResponse
1080    {
1081        #[inline]
1082        unsafe fn encode(
1083            self,
1084            encoder: &mut fidl::encoding::Encoder<'_, D>,
1085            offset: usize,
1086            _depth: fidl::encoding::Depth,
1087        ) -> fidl::Result<()> {
1088            encoder.debug_check_bounds::<CrashReporterFileReportResponse>(offset);
1089            // Delegate to tuple encoding.
1090            fidl::encoding::Encode::<CrashReporterFileReportResponse, D>::encode(
1091                (<FileReportResults as fidl::encoding::ValueTypeMarker>::borrow(&self.results),),
1092                encoder,
1093                offset,
1094                _depth,
1095            )
1096        }
1097    }
1098    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<FileReportResults, D>>
1099        fidl::encoding::Encode<CrashReporterFileReportResponse, D> for (T0,)
1100    {
1101        #[inline]
1102        unsafe fn encode(
1103            self,
1104            encoder: &mut fidl::encoding::Encoder<'_, D>,
1105            offset: usize,
1106            depth: fidl::encoding::Depth,
1107        ) -> fidl::Result<()> {
1108            encoder.debug_check_bounds::<CrashReporterFileReportResponse>(offset);
1109            // Zero out padding regions. There's no need to apply masks
1110            // because the unmasked parts will be overwritten by fields.
1111            // Write the fields.
1112            self.0.encode(encoder, offset + 0, depth)?;
1113            Ok(())
1114        }
1115    }
1116
1117    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1118        for CrashReporterFileReportResponse
1119    {
1120        #[inline(always)]
1121        fn new_empty() -> Self {
1122            Self { results: fidl::new_empty!(FileReportResults, D) }
1123        }
1124
1125        #[inline]
1126        unsafe fn decode(
1127            &mut self,
1128            decoder: &mut fidl::encoding::Decoder<'_, D>,
1129            offset: usize,
1130            _depth: fidl::encoding::Depth,
1131        ) -> fidl::Result<()> {
1132            decoder.debug_check_bounds::<Self>(offset);
1133            // Verify that padding bytes are zero.
1134            fidl::decode!(FileReportResults, D, &mut self.results, decoder, offset + 0, _depth)?;
1135            Ok(())
1136        }
1137    }
1138
1139    impl fidl::encoding::ValueTypeMarker for CrashReportingProductRegisterUpsertRequest {
1140        type Borrowed<'a> = &'a Self;
1141        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1142            value
1143        }
1144    }
1145
1146    unsafe impl fidl::encoding::TypeMarker for CrashReportingProductRegisterUpsertRequest {
1147        type Owned = Self;
1148
1149        #[inline(always)]
1150        fn inline_align(_context: fidl::encoding::Context) -> usize {
1151            8
1152        }
1153
1154        #[inline(always)]
1155        fn inline_size(_context: fidl::encoding::Context) -> usize {
1156            32
1157        }
1158    }
1159
1160    unsafe impl<D: fidl::encoding::ResourceDialect>
1161        fidl::encoding::Encode<CrashReportingProductRegisterUpsertRequest, D>
1162        for &CrashReportingProductRegisterUpsertRequest
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::<CrashReportingProductRegisterUpsertRequest>(offset);
1172            // Delegate to tuple encoding.
1173            fidl::encoding::Encode::<CrashReportingProductRegisterUpsertRequest, D>::encode(
1174                (
1175                    <fidl::encoding::BoundedString<2083> as fidl::encoding::ValueTypeMarker>::borrow(&self.component_url),
1176                    <CrashReportingProduct as fidl::encoding::ValueTypeMarker>::borrow(&self.product),
1177                ),
1178                encoder, offset, _depth
1179            )
1180        }
1181    }
1182    unsafe impl<
1183            D: fidl::encoding::ResourceDialect,
1184            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<2083>, D>,
1185            T1: fidl::encoding::Encode<CrashReportingProduct, D>,
1186        > fidl::encoding::Encode<CrashReportingProductRegisterUpsertRequest, D> for (T0, T1)
1187    {
1188        #[inline]
1189        unsafe fn encode(
1190            self,
1191            encoder: &mut fidl::encoding::Encoder<'_, D>,
1192            offset: usize,
1193            depth: fidl::encoding::Depth,
1194        ) -> fidl::Result<()> {
1195            encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertRequest>(offset);
1196            // Zero out padding regions. There's no need to apply masks
1197            // because the unmasked parts will be overwritten by fields.
1198            // Write the fields.
1199            self.0.encode(encoder, offset + 0, depth)?;
1200            self.1.encode(encoder, offset + 16, depth)?;
1201            Ok(())
1202        }
1203    }
1204
1205    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1206        for CrashReportingProductRegisterUpsertRequest
1207    {
1208        #[inline(always)]
1209        fn new_empty() -> Self {
1210            Self {
1211                component_url: fidl::new_empty!(fidl::encoding::BoundedString<2083>, D),
1212                product: fidl::new_empty!(CrashReportingProduct, D),
1213            }
1214        }
1215
1216        #[inline]
1217        unsafe fn decode(
1218            &mut self,
1219            decoder: &mut fidl::encoding::Decoder<'_, D>,
1220            offset: usize,
1221            _depth: fidl::encoding::Depth,
1222        ) -> fidl::Result<()> {
1223            decoder.debug_check_bounds::<Self>(offset);
1224            // Verify that padding bytes are zero.
1225            fidl::decode!(
1226                fidl::encoding::BoundedString<2083>,
1227                D,
1228                &mut self.component_url,
1229                decoder,
1230                offset + 0,
1231                _depth
1232            )?;
1233            fidl::decode!(
1234                CrashReportingProduct,
1235                D,
1236                &mut self.product,
1237                decoder,
1238                offset + 16,
1239                _depth
1240            )?;
1241            Ok(())
1242        }
1243    }
1244
1245    impl fidl::encoding::ValueTypeMarker for CrashReportingProductRegisterUpsertWithAckRequest {
1246        type Borrowed<'a> = &'a Self;
1247        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1248            value
1249        }
1250    }
1251
1252    unsafe impl fidl::encoding::TypeMarker for CrashReportingProductRegisterUpsertWithAckRequest {
1253        type Owned = Self;
1254
1255        #[inline(always)]
1256        fn inline_align(_context: fidl::encoding::Context) -> usize {
1257            8
1258        }
1259
1260        #[inline(always)]
1261        fn inline_size(_context: fidl::encoding::Context) -> usize {
1262            32
1263        }
1264    }
1265
1266    unsafe impl<D: fidl::encoding::ResourceDialect>
1267        fidl::encoding::Encode<CrashReportingProductRegisterUpsertWithAckRequest, D>
1268        for &CrashReportingProductRegisterUpsertWithAckRequest
1269    {
1270        #[inline]
1271        unsafe fn encode(
1272            self,
1273            encoder: &mut fidl::encoding::Encoder<'_, D>,
1274            offset: usize,
1275            _depth: fidl::encoding::Depth,
1276        ) -> fidl::Result<()> {
1277            encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertWithAckRequest>(offset);
1278            // Delegate to tuple encoding.
1279            fidl::encoding::Encode::<CrashReportingProductRegisterUpsertWithAckRequest, D>::encode(
1280                (
1281                    <fidl::encoding::BoundedString<2083> as fidl::encoding::ValueTypeMarker>::borrow(&self.component_url),
1282                    <CrashReportingProduct as fidl::encoding::ValueTypeMarker>::borrow(&self.product),
1283                ),
1284                encoder, offset, _depth
1285            )
1286        }
1287    }
1288    unsafe impl<
1289            D: fidl::encoding::ResourceDialect,
1290            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<2083>, D>,
1291            T1: fidl::encoding::Encode<CrashReportingProduct, D>,
1292        > fidl::encoding::Encode<CrashReportingProductRegisterUpsertWithAckRequest, D>
1293        for (T0, T1)
1294    {
1295        #[inline]
1296        unsafe fn encode(
1297            self,
1298            encoder: &mut fidl::encoding::Encoder<'_, D>,
1299            offset: usize,
1300            depth: fidl::encoding::Depth,
1301        ) -> fidl::Result<()> {
1302            encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertWithAckRequest>(offset);
1303            // Zero out padding regions. There's no need to apply masks
1304            // because the unmasked parts will be overwritten by fields.
1305            // Write the fields.
1306            self.0.encode(encoder, offset + 0, depth)?;
1307            self.1.encode(encoder, offset + 16, depth)?;
1308            Ok(())
1309        }
1310    }
1311
1312    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1313        for CrashReportingProductRegisterUpsertWithAckRequest
1314    {
1315        #[inline(always)]
1316        fn new_empty() -> Self {
1317            Self {
1318                component_url: fidl::new_empty!(fidl::encoding::BoundedString<2083>, D),
1319                product: fidl::new_empty!(CrashReportingProduct, D),
1320            }
1321        }
1322
1323        #[inline]
1324        unsafe fn decode(
1325            &mut self,
1326            decoder: &mut fidl::encoding::Decoder<'_, D>,
1327            offset: usize,
1328            _depth: fidl::encoding::Depth,
1329        ) -> fidl::Result<()> {
1330            decoder.debug_check_bounds::<Self>(offset);
1331            // Verify that padding bytes are zero.
1332            fidl::decode!(
1333                fidl::encoding::BoundedString<2083>,
1334                D,
1335                &mut self.component_url,
1336                decoder,
1337                offset + 0,
1338                _depth
1339            )?;
1340            fidl::decode!(
1341                CrashReportingProduct,
1342                D,
1343                &mut self.product,
1344                decoder,
1345                offset + 16,
1346                _depth
1347            )?;
1348            Ok(())
1349        }
1350    }
1351
1352    impl fidl::encoding::ValueTypeMarker for DataProviderGetAnnotationsRequest {
1353        type Borrowed<'a> = &'a Self;
1354        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1355            value
1356        }
1357    }
1358
1359    unsafe impl fidl::encoding::TypeMarker for DataProviderGetAnnotationsRequest {
1360        type Owned = Self;
1361
1362        #[inline(always)]
1363        fn inline_align(_context: fidl::encoding::Context) -> usize {
1364            8
1365        }
1366
1367        #[inline(always)]
1368        fn inline_size(_context: fidl::encoding::Context) -> usize {
1369            16
1370        }
1371    }
1372
1373    unsafe impl<D: fidl::encoding::ResourceDialect>
1374        fidl::encoding::Encode<DataProviderGetAnnotationsRequest, D>
1375        for &DataProviderGetAnnotationsRequest
1376    {
1377        #[inline]
1378        unsafe fn encode(
1379            self,
1380            encoder: &mut fidl::encoding::Encoder<'_, D>,
1381            offset: usize,
1382            _depth: fidl::encoding::Depth,
1383        ) -> fidl::Result<()> {
1384            encoder.debug_check_bounds::<DataProviderGetAnnotationsRequest>(offset);
1385            // Delegate to tuple encoding.
1386            fidl::encoding::Encode::<DataProviderGetAnnotationsRequest, D>::encode(
1387                (<GetAnnotationsParameters as fidl::encoding::ValueTypeMarker>::borrow(
1388                    &self.params,
1389                ),),
1390                encoder,
1391                offset,
1392                _depth,
1393            )
1394        }
1395    }
1396    unsafe impl<
1397            D: fidl::encoding::ResourceDialect,
1398            T0: fidl::encoding::Encode<GetAnnotationsParameters, D>,
1399        > fidl::encoding::Encode<DataProviderGetAnnotationsRequest, D> for (T0,)
1400    {
1401        #[inline]
1402        unsafe fn encode(
1403            self,
1404            encoder: &mut fidl::encoding::Encoder<'_, D>,
1405            offset: usize,
1406            depth: fidl::encoding::Depth,
1407        ) -> fidl::Result<()> {
1408            encoder.debug_check_bounds::<DataProviderGetAnnotationsRequest>(offset);
1409            // Zero out padding regions. There's no need to apply masks
1410            // because the unmasked parts will be overwritten by fields.
1411            // Write the fields.
1412            self.0.encode(encoder, offset + 0, depth)?;
1413            Ok(())
1414        }
1415    }
1416
1417    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1418        for DataProviderGetAnnotationsRequest
1419    {
1420        #[inline(always)]
1421        fn new_empty() -> Self {
1422            Self { params: fidl::new_empty!(GetAnnotationsParameters, D) }
1423        }
1424
1425        #[inline]
1426        unsafe fn decode(
1427            &mut self,
1428            decoder: &mut fidl::encoding::Decoder<'_, D>,
1429            offset: usize,
1430            _depth: fidl::encoding::Depth,
1431        ) -> fidl::Result<()> {
1432            decoder.debug_check_bounds::<Self>(offset);
1433            // Verify that padding bytes are zero.
1434            fidl::decode!(
1435                GetAnnotationsParameters,
1436                D,
1437                &mut self.params,
1438                decoder,
1439                offset + 0,
1440                _depth
1441            )?;
1442            Ok(())
1443        }
1444    }
1445
1446    impl fidl::encoding::ValueTypeMarker for DataProviderGetAnnotationsResponse {
1447        type Borrowed<'a> = &'a Self;
1448        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1449            value
1450        }
1451    }
1452
1453    unsafe impl fidl::encoding::TypeMarker for DataProviderGetAnnotationsResponse {
1454        type Owned = Self;
1455
1456        #[inline(always)]
1457        fn inline_align(_context: fidl::encoding::Context) -> usize {
1458            8
1459        }
1460
1461        #[inline(always)]
1462        fn inline_size(_context: fidl::encoding::Context) -> usize {
1463            16
1464        }
1465    }
1466
1467    unsafe impl<D: fidl::encoding::ResourceDialect>
1468        fidl::encoding::Encode<DataProviderGetAnnotationsResponse, D>
1469        for &DataProviderGetAnnotationsResponse
1470    {
1471        #[inline]
1472        unsafe fn encode(
1473            self,
1474            encoder: &mut fidl::encoding::Encoder<'_, D>,
1475            offset: usize,
1476            _depth: fidl::encoding::Depth,
1477        ) -> fidl::Result<()> {
1478            encoder.debug_check_bounds::<DataProviderGetAnnotationsResponse>(offset);
1479            // Delegate to tuple encoding.
1480            fidl::encoding::Encode::<DataProviderGetAnnotationsResponse, D>::encode(
1481                (<Annotations as fidl::encoding::ValueTypeMarker>::borrow(&self.annotations),),
1482                encoder,
1483                offset,
1484                _depth,
1485            )
1486        }
1487    }
1488    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Annotations, D>>
1489        fidl::encoding::Encode<DataProviderGetAnnotationsResponse, D> for (T0,)
1490    {
1491        #[inline]
1492        unsafe fn encode(
1493            self,
1494            encoder: &mut fidl::encoding::Encoder<'_, D>,
1495            offset: usize,
1496            depth: fidl::encoding::Depth,
1497        ) -> fidl::Result<()> {
1498            encoder.debug_check_bounds::<DataProviderGetAnnotationsResponse>(offset);
1499            // Zero out padding regions. There's no need to apply masks
1500            // because the unmasked parts will be overwritten by fields.
1501            // Write the fields.
1502            self.0.encode(encoder, offset + 0, depth)?;
1503            Ok(())
1504        }
1505    }
1506
1507    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1508        for DataProviderGetAnnotationsResponse
1509    {
1510        #[inline(always)]
1511        fn new_empty() -> Self {
1512            Self { annotations: fidl::new_empty!(Annotations, D) }
1513        }
1514
1515        #[inline]
1516        unsafe fn decode(
1517            &mut self,
1518            decoder: &mut fidl::encoding::Decoder<'_, D>,
1519            offset: usize,
1520            _depth: fidl::encoding::Depth,
1521        ) -> fidl::Result<()> {
1522            decoder.debug_check_bounds::<Self>(offset);
1523            // Verify that padding bytes are zero.
1524            fidl::decode!(Annotations, D, &mut self.annotations, decoder, offset + 0, _depth)?;
1525            Ok(())
1526        }
1527    }
1528
1529    impl fidl::encoding::ValueTypeMarker for DataProviderGetScreenshotRequest {
1530        type Borrowed<'a> = &'a Self;
1531        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1532            value
1533        }
1534    }
1535
1536    unsafe impl fidl::encoding::TypeMarker for DataProviderGetScreenshotRequest {
1537        type Owned = Self;
1538
1539        #[inline(always)]
1540        fn inline_align(_context: fidl::encoding::Context) -> usize {
1541            4
1542        }
1543
1544        #[inline(always)]
1545        fn inline_size(_context: fidl::encoding::Context) -> usize {
1546            4
1547        }
1548    }
1549
1550    unsafe impl<D: fidl::encoding::ResourceDialect>
1551        fidl::encoding::Encode<DataProviderGetScreenshotRequest, D>
1552        for &DataProviderGetScreenshotRequest
1553    {
1554        #[inline]
1555        unsafe fn encode(
1556            self,
1557            encoder: &mut fidl::encoding::Encoder<'_, D>,
1558            offset: usize,
1559            _depth: fidl::encoding::Depth,
1560        ) -> fidl::Result<()> {
1561            encoder.debug_check_bounds::<DataProviderGetScreenshotRequest>(offset);
1562            // Delegate to tuple encoding.
1563            fidl::encoding::Encode::<DataProviderGetScreenshotRequest, D>::encode(
1564                (<ImageEncoding as fidl::encoding::ValueTypeMarker>::borrow(&self.encoding),),
1565                encoder,
1566                offset,
1567                _depth,
1568            )
1569        }
1570    }
1571    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ImageEncoding, D>>
1572        fidl::encoding::Encode<DataProviderGetScreenshotRequest, D> for (T0,)
1573    {
1574        #[inline]
1575        unsafe fn encode(
1576            self,
1577            encoder: &mut fidl::encoding::Encoder<'_, D>,
1578            offset: usize,
1579            depth: fidl::encoding::Depth,
1580        ) -> fidl::Result<()> {
1581            encoder.debug_check_bounds::<DataProviderGetScreenshotRequest>(offset);
1582            // Zero out padding regions. There's no need to apply masks
1583            // because the unmasked parts will be overwritten by fields.
1584            // Write the fields.
1585            self.0.encode(encoder, offset + 0, depth)?;
1586            Ok(())
1587        }
1588    }
1589
1590    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1591        for DataProviderGetScreenshotRequest
1592    {
1593        #[inline(always)]
1594        fn new_empty() -> Self {
1595            Self { encoding: fidl::new_empty!(ImageEncoding, D) }
1596        }
1597
1598        #[inline]
1599        unsafe fn decode(
1600            &mut self,
1601            decoder: &mut fidl::encoding::Decoder<'_, D>,
1602            offset: usize,
1603            _depth: fidl::encoding::Depth,
1604        ) -> fidl::Result<()> {
1605            decoder.debug_check_bounds::<Self>(offset);
1606            // Verify that padding bytes are zero.
1607            fidl::decode!(ImageEncoding, D, &mut self.encoding, decoder, offset + 0, _depth)?;
1608            Ok(())
1609        }
1610    }
1611
1612    impl fidl::encoding::ValueTypeMarker for DeviceIdProviderGetIdResponse {
1613        type Borrowed<'a> = &'a Self;
1614        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1615            value
1616        }
1617    }
1618
1619    unsafe impl fidl::encoding::TypeMarker for DeviceIdProviderGetIdResponse {
1620        type Owned = Self;
1621
1622        #[inline(always)]
1623        fn inline_align(_context: fidl::encoding::Context) -> usize {
1624            8
1625        }
1626
1627        #[inline(always)]
1628        fn inline_size(_context: fidl::encoding::Context) -> usize {
1629            16
1630        }
1631    }
1632
1633    unsafe impl<D: fidl::encoding::ResourceDialect>
1634        fidl::encoding::Encode<DeviceIdProviderGetIdResponse, D>
1635        for &DeviceIdProviderGetIdResponse
1636    {
1637        #[inline]
1638        unsafe fn encode(
1639            self,
1640            encoder: &mut fidl::encoding::Encoder<'_, D>,
1641            offset: usize,
1642            _depth: fidl::encoding::Depth,
1643        ) -> fidl::Result<()> {
1644            encoder.debug_check_bounds::<DeviceIdProviderGetIdResponse>(offset);
1645            // Delegate to tuple encoding.
1646            fidl::encoding::Encode::<DeviceIdProviderGetIdResponse, D>::encode(
1647                (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
1648                    &self.feedback_id,
1649                ),),
1650                encoder,
1651                offset,
1652                _depth,
1653            )
1654        }
1655    }
1656    unsafe impl<
1657            D: fidl::encoding::ResourceDialect,
1658            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
1659        > fidl::encoding::Encode<DeviceIdProviderGetIdResponse, D> for (T0,)
1660    {
1661        #[inline]
1662        unsafe fn encode(
1663            self,
1664            encoder: &mut fidl::encoding::Encoder<'_, D>,
1665            offset: usize,
1666            depth: fidl::encoding::Depth,
1667        ) -> fidl::Result<()> {
1668            encoder.debug_check_bounds::<DeviceIdProviderGetIdResponse>(offset);
1669            // Zero out padding regions. There's no need to apply masks
1670            // because the unmasked parts will be overwritten by fields.
1671            // Write the fields.
1672            self.0.encode(encoder, offset + 0, depth)?;
1673            Ok(())
1674        }
1675    }
1676
1677    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1678        for DeviceIdProviderGetIdResponse
1679    {
1680        #[inline(always)]
1681        fn new_empty() -> Self {
1682            Self { feedback_id: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
1683        }
1684
1685        #[inline]
1686        unsafe fn decode(
1687            &mut self,
1688            decoder: &mut fidl::encoding::Decoder<'_, D>,
1689            offset: usize,
1690            _depth: fidl::encoding::Depth,
1691        ) -> fidl::Result<()> {
1692            decoder.debug_check_bounds::<Self>(offset);
1693            // Verify that padding bytes are zero.
1694            fidl::decode!(
1695                fidl::encoding::BoundedString<64>,
1696                D,
1697                &mut self.feedback_id,
1698                decoder,
1699                offset + 0,
1700                _depth
1701            )?;
1702            Ok(())
1703        }
1704    }
1705
1706    impl fidl::encoding::ValueTypeMarker for LastRebootInfoProviderGetResponse {
1707        type Borrowed<'a> = &'a Self;
1708        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1709            value
1710        }
1711    }
1712
1713    unsafe impl fidl::encoding::TypeMarker for LastRebootInfoProviderGetResponse {
1714        type Owned = Self;
1715
1716        #[inline(always)]
1717        fn inline_align(_context: fidl::encoding::Context) -> usize {
1718            8
1719        }
1720
1721        #[inline(always)]
1722        fn inline_size(_context: fidl::encoding::Context) -> usize {
1723            16
1724        }
1725    }
1726
1727    unsafe impl<D: fidl::encoding::ResourceDialect>
1728        fidl::encoding::Encode<LastRebootInfoProviderGetResponse, D>
1729        for &LastRebootInfoProviderGetResponse
1730    {
1731        #[inline]
1732        unsafe fn encode(
1733            self,
1734            encoder: &mut fidl::encoding::Encoder<'_, D>,
1735            offset: usize,
1736            _depth: fidl::encoding::Depth,
1737        ) -> fidl::Result<()> {
1738            encoder.debug_check_bounds::<LastRebootInfoProviderGetResponse>(offset);
1739            // Delegate to tuple encoding.
1740            fidl::encoding::Encode::<LastRebootInfoProviderGetResponse, D>::encode(
1741                (<LastReboot as fidl::encoding::ValueTypeMarker>::borrow(&self.last_reboot),),
1742                encoder,
1743                offset,
1744                _depth,
1745            )
1746        }
1747    }
1748    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LastReboot, D>>
1749        fidl::encoding::Encode<LastRebootInfoProviderGetResponse, D> for (T0,)
1750    {
1751        #[inline]
1752        unsafe fn encode(
1753            self,
1754            encoder: &mut fidl::encoding::Encoder<'_, D>,
1755            offset: usize,
1756            depth: fidl::encoding::Depth,
1757        ) -> fidl::Result<()> {
1758            encoder.debug_check_bounds::<LastRebootInfoProviderGetResponse>(offset);
1759            // Zero out padding regions. There's no need to apply masks
1760            // because the unmasked parts will be overwritten by fields.
1761            // Write the fields.
1762            self.0.encode(encoder, offset + 0, depth)?;
1763            Ok(())
1764        }
1765    }
1766
1767    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1768        for LastRebootInfoProviderGetResponse
1769    {
1770        #[inline(always)]
1771        fn new_empty() -> Self {
1772            Self { last_reboot: fidl::new_empty!(LastReboot, D) }
1773        }
1774
1775        #[inline]
1776        unsafe fn decode(
1777            &mut self,
1778            decoder: &mut fidl::encoding::Decoder<'_, D>,
1779            offset: usize,
1780            _depth: fidl::encoding::Depth,
1781        ) -> fidl::Result<()> {
1782            decoder.debug_check_bounds::<Self>(offset);
1783            // Verify that padding bytes are zero.
1784            fidl::decode!(LastReboot, D, &mut self.last_reboot, decoder, offset + 0, _depth)?;
1785            Ok(())
1786        }
1787    }
1788
1789    impl Annotations {
1790        #[inline(always)]
1791        fn max_ordinal_present(&self) -> u64 {
1792            if let Some(_) = self.annotations2 {
1793                return 2;
1794            }
1795            if let Some(_) = self.annotations {
1796                return 1;
1797            }
1798            0
1799        }
1800    }
1801
1802    impl fidl::encoding::ValueTypeMarker for Annotations {
1803        type Borrowed<'a> = &'a Self;
1804        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1805            value
1806        }
1807    }
1808
1809    unsafe impl fidl::encoding::TypeMarker for Annotations {
1810        type Owned = Self;
1811
1812        #[inline(always)]
1813        fn inline_align(_context: fidl::encoding::Context) -> usize {
1814            8
1815        }
1816
1817        #[inline(always)]
1818        fn inline_size(_context: fidl::encoding::Context) -> usize {
1819            16
1820        }
1821    }
1822
1823    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Annotations, D>
1824        for &Annotations
1825    {
1826        unsafe fn encode(
1827            self,
1828            encoder: &mut fidl::encoding::Encoder<'_, D>,
1829            offset: usize,
1830            mut depth: fidl::encoding::Depth,
1831        ) -> fidl::Result<()> {
1832            encoder.debug_check_bounds::<Annotations>(offset);
1833            // Vector header
1834            let max_ordinal: u64 = self.max_ordinal_present();
1835            encoder.write_num(max_ordinal, offset);
1836            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1837            // Calling encoder.out_of_line_offset(0) is not allowed.
1838            if max_ordinal == 0 {
1839                return Ok(());
1840            }
1841            depth.increment()?;
1842            let envelope_size = 8;
1843            let bytes_len = max_ordinal as usize * envelope_size;
1844            #[allow(unused_variables)]
1845            let offset = encoder.out_of_line_offset(bytes_len);
1846            let mut _prev_end_offset: usize = 0;
1847            if 1 > max_ordinal {
1848                return Ok(());
1849            }
1850
1851            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1852            // are envelope_size bytes.
1853            let cur_offset: usize = (1 - 1) * envelope_size;
1854
1855            // Zero reserved fields.
1856            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1857
1858            // Safety:
1859            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1860            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1861            //   envelope_size bytes, there is always sufficient room.
1862            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 64>, D>(
1863            self.annotations.as_ref().map(<fidl::encoding::Vector<Annotation, 64> as fidl::encoding::ValueTypeMarker>::borrow),
1864            encoder, offset + cur_offset, depth
1865        )?;
1866
1867            _prev_end_offset = cur_offset + envelope_size;
1868            if 2 > max_ordinal {
1869                return Ok(());
1870            }
1871
1872            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1873            // are envelope_size bytes.
1874            let cur_offset: usize = (2 - 1) * envelope_size;
1875
1876            // Zero reserved fields.
1877            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1878
1879            // Safety:
1880            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1881            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1882            //   envelope_size bytes, there is always sufficient room.
1883            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 512>, D>(
1884            self.annotations2.as_ref().map(<fidl::encoding::Vector<Annotation, 512> as fidl::encoding::ValueTypeMarker>::borrow),
1885            encoder, offset + cur_offset, depth
1886        )?;
1887
1888            _prev_end_offset = cur_offset + envelope_size;
1889
1890            Ok(())
1891        }
1892    }
1893
1894    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Annotations {
1895        #[inline(always)]
1896        fn new_empty() -> Self {
1897            Self::default()
1898        }
1899
1900        unsafe fn decode(
1901            &mut self,
1902            decoder: &mut fidl::encoding::Decoder<'_, D>,
1903            offset: usize,
1904            mut depth: fidl::encoding::Depth,
1905        ) -> fidl::Result<()> {
1906            decoder.debug_check_bounds::<Self>(offset);
1907            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1908                None => return Err(fidl::Error::NotNullable),
1909                Some(len) => len,
1910            };
1911            // Calling decoder.out_of_line_offset(0) is not allowed.
1912            if len == 0 {
1913                return Ok(());
1914            };
1915            depth.increment()?;
1916            let envelope_size = 8;
1917            let bytes_len = len * envelope_size;
1918            let offset = decoder.out_of_line_offset(bytes_len)?;
1919            // Decode the envelope for each type.
1920            let mut _next_ordinal_to_read = 0;
1921            let mut next_offset = offset;
1922            let end_offset = offset + bytes_len;
1923            _next_ordinal_to_read += 1;
1924            if next_offset >= end_offset {
1925                return Ok(());
1926            }
1927
1928            // Decode unknown envelopes for gaps in ordinals.
1929            while _next_ordinal_to_read < 1 {
1930                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1931                _next_ordinal_to_read += 1;
1932                next_offset += envelope_size;
1933            }
1934
1935            let next_out_of_line = decoder.next_out_of_line();
1936            let handles_before = decoder.remaining_handles();
1937            if let Some((inlined, num_bytes, num_handles)) =
1938                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1939            {
1940                let member_inline_size = <fidl::encoding::Vector<Annotation, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1941                if inlined != (member_inline_size <= 4) {
1942                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1943                }
1944                let inner_offset;
1945                let mut inner_depth = depth.clone();
1946                if inlined {
1947                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1948                    inner_offset = next_offset;
1949                } else {
1950                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1951                    inner_depth.increment()?;
1952                }
1953                let val_ref = self.annotations.get_or_insert_with(
1954                    || fidl::new_empty!(fidl::encoding::Vector<Annotation, 64>, D),
1955                );
1956                fidl::decode!(fidl::encoding::Vector<Annotation, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
1957                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1958                {
1959                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1960                }
1961                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1962                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1963                }
1964            }
1965
1966            next_offset += envelope_size;
1967            _next_ordinal_to_read += 1;
1968            if next_offset >= end_offset {
1969                return Ok(());
1970            }
1971
1972            // Decode unknown envelopes for gaps in ordinals.
1973            while _next_ordinal_to_read < 2 {
1974                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1975                _next_ordinal_to_read += 1;
1976                next_offset += envelope_size;
1977            }
1978
1979            let next_out_of_line = decoder.next_out_of_line();
1980            let handles_before = decoder.remaining_handles();
1981            if let Some((inlined, num_bytes, num_handles)) =
1982                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1983            {
1984                let member_inline_size = <fidl::encoding::Vector<Annotation, 512> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1985                if inlined != (member_inline_size <= 4) {
1986                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1987                }
1988                let inner_offset;
1989                let mut inner_depth = depth.clone();
1990                if inlined {
1991                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1992                    inner_offset = next_offset;
1993                } else {
1994                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1995                    inner_depth.increment()?;
1996                }
1997                let val_ref = self.annotations2.get_or_insert_with(
1998                    || fidl::new_empty!(fidl::encoding::Vector<Annotation, 512>, D),
1999                );
2000                fidl::decode!(fidl::encoding::Vector<Annotation, 512>, D, val_ref, decoder, inner_offset, inner_depth)?;
2001                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2002                {
2003                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2004                }
2005                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2006                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2007                }
2008            }
2009
2010            next_offset += envelope_size;
2011
2012            // Decode the remaining unknown envelopes.
2013            while next_offset < end_offset {
2014                _next_ordinal_to_read += 1;
2015                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2016                next_offset += envelope_size;
2017            }
2018
2019            Ok(())
2020        }
2021    }
2022
2023    impl ComponentData {
2024        #[inline(always)]
2025        fn max_ordinal_present(&self) -> u64 {
2026            if let Some(_) = self.annotations {
2027                return 2;
2028            }
2029            if let Some(_) = self.namespace {
2030                return 1;
2031            }
2032            0
2033        }
2034    }
2035
2036    impl fidl::encoding::ValueTypeMarker for ComponentData {
2037        type Borrowed<'a> = &'a Self;
2038        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2039            value
2040        }
2041    }
2042
2043    unsafe impl fidl::encoding::TypeMarker for ComponentData {
2044        type Owned = Self;
2045
2046        #[inline(always)]
2047        fn inline_align(_context: fidl::encoding::Context) -> usize {
2048            8
2049        }
2050
2051        #[inline(always)]
2052        fn inline_size(_context: fidl::encoding::Context) -> usize {
2053            16
2054        }
2055    }
2056
2057    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ComponentData, D>
2058        for &ComponentData
2059    {
2060        unsafe fn encode(
2061            self,
2062            encoder: &mut fidl::encoding::Encoder<'_, D>,
2063            offset: usize,
2064            mut depth: fidl::encoding::Depth,
2065        ) -> fidl::Result<()> {
2066            encoder.debug_check_bounds::<ComponentData>(offset);
2067            // Vector header
2068            let max_ordinal: u64 = self.max_ordinal_present();
2069            encoder.write_num(max_ordinal, offset);
2070            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2071            // Calling encoder.out_of_line_offset(0) is not allowed.
2072            if max_ordinal == 0 {
2073                return Ok(());
2074            }
2075            depth.increment()?;
2076            let envelope_size = 8;
2077            let bytes_len = max_ordinal as usize * envelope_size;
2078            #[allow(unused_variables)]
2079            let offset = encoder.out_of_line_offset(bytes_len);
2080            let mut _prev_end_offset: usize = 0;
2081            if 1 > max_ordinal {
2082                return Ok(());
2083            }
2084
2085            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2086            // are envelope_size bytes.
2087            let cur_offset: usize = (1 - 1) * envelope_size;
2088
2089            // Zero reserved fields.
2090            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2091
2092            // Safety:
2093            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2094            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2095            //   envelope_size bytes, there is always sufficient room.
2096            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<32>, D>(
2097                self.namespace.as_ref().map(
2098                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
2099                ),
2100                encoder,
2101                offset + cur_offset,
2102                depth,
2103            )?;
2104
2105            _prev_end_offset = cur_offset + envelope_size;
2106            if 2 > max_ordinal {
2107                return Ok(());
2108            }
2109
2110            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2111            // are envelope_size bytes.
2112            let cur_offset: usize = (2 - 1) * envelope_size;
2113
2114            // Zero reserved fields.
2115            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2116
2117            // Safety:
2118            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2119            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2120            //   envelope_size bytes, there is always sufficient room.
2121            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 16>, D>(
2122            self.annotations.as_ref().map(<fidl::encoding::Vector<Annotation, 16> as fidl::encoding::ValueTypeMarker>::borrow),
2123            encoder, offset + cur_offset, depth
2124        )?;
2125
2126            _prev_end_offset = cur_offset + envelope_size;
2127
2128            Ok(())
2129        }
2130    }
2131
2132    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ComponentData {
2133        #[inline(always)]
2134        fn new_empty() -> Self {
2135            Self::default()
2136        }
2137
2138        unsafe fn decode(
2139            &mut self,
2140            decoder: &mut fidl::encoding::Decoder<'_, D>,
2141            offset: usize,
2142            mut depth: fidl::encoding::Depth,
2143        ) -> fidl::Result<()> {
2144            decoder.debug_check_bounds::<Self>(offset);
2145            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2146                None => return Err(fidl::Error::NotNullable),
2147                Some(len) => len,
2148            };
2149            // Calling decoder.out_of_line_offset(0) is not allowed.
2150            if len == 0 {
2151                return Ok(());
2152            };
2153            depth.increment()?;
2154            let envelope_size = 8;
2155            let bytes_len = len * envelope_size;
2156            let offset = decoder.out_of_line_offset(bytes_len)?;
2157            // Decode the envelope for each type.
2158            let mut _next_ordinal_to_read = 0;
2159            let mut next_offset = offset;
2160            let end_offset = offset + bytes_len;
2161            _next_ordinal_to_read += 1;
2162            if next_offset >= end_offset {
2163                return Ok(());
2164            }
2165
2166            // Decode unknown envelopes for gaps in ordinals.
2167            while _next_ordinal_to_read < 1 {
2168                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2169                _next_ordinal_to_read += 1;
2170                next_offset += envelope_size;
2171            }
2172
2173            let next_out_of_line = decoder.next_out_of_line();
2174            let handles_before = decoder.remaining_handles();
2175            if let Some((inlined, num_bytes, num_handles)) =
2176                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2177            {
2178                let member_inline_size =
2179                    <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
2180                        decoder.context,
2181                    );
2182                if inlined != (member_inline_size <= 4) {
2183                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2184                }
2185                let inner_offset;
2186                let mut inner_depth = depth.clone();
2187                if inlined {
2188                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2189                    inner_offset = next_offset;
2190                } else {
2191                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2192                    inner_depth.increment()?;
2193                }
2194                let val_ref = self
2195                    .namespace
2196                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<32>, D));
2197                fidl::decode!(
2198                    fidl::encoding::BoundedString<32>,
2199                    D,
2200                    val_ref,
2201                    decoder,
2202                    inner_offset,
2203                    inner_depth
2204                )?;
2205                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2206                {
2207                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2208                }
2209                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2210                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2211                }
2212            }
2213
2214            next_offset += envelope_size;
2215            _next_ordinal_to_read += 1;
2216            if next_offset >= end_offset {
2217                return Ok(());
2218            }
2219
2220            // Decode unknown envelopes for gaps in ordinals.
2221            while _next_ordinal_to_read < 2 {
2222                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2223                _next_ordinal_to_read += 1;
2224                next_offset += envelope_size;
2225            }
2226
2227            let next_out_of_line = decoder.next_out_of_line();
2228            let handles_before = decoder.remaining_handles();
2229            if let Some((inlined, num_bytes, num_handles)) =
2230                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2231            {
2232                let member_inline_size = <fidl::encoding::Vector<Annotation, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2233                if inlined != (member_inline_size <= 4) {
2234                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2235                }
2236                let inner_offset;
2237                let mut inner_depth = depth.clone();
2238                if inlined {
2239                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2240                    inner_offset = next_offset;
2241                } else {
2242                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2243                    inner_depth.increment()?;
2244                }
2245                let val_ref = self.annotations.get_or_insert_with(
2246                    || fidl::new_empty!(fidl::encoding::Vector<Annotation, 16>, D),
2247                );
2248                fidl::decode!(fidl::encoding::Vector<Annotation, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
2249                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2250                {
2251                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2252                }
2253                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2254                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2255                }
2256            }
2257
2258            next_offset += envelope_size;
2259
2260            // Decode the remaining unknown envelopes.
2261            while next_offset < end_offset {
2262                _next_ordinal_to_read += 1;
2263                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2264                next_offset += envelope_size;
2265            }
2266
2267            Ok(())
2268        }
2269    }
2270
2271    impl CrashReportingProduct {
2272        #[inline(always)]
2273        fn max_ordinal_present(&self) -> u64 {
2274            if let Some(_) = self.channel {
2275                return 3;
2276            }
2277            if let Some(_) = self.version {
2278                return 2;
2279            }
2280            if let Some(_) = self.name {
2281                return 1;
2282            }
2283            0
2284        }
2285    }
2286
2287    impl fidl::encoding::ValueTypeMarker for CrashReportingProduct {
2288        type Borrowed<'a> = &'a Self;
2289        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2290            value
2291        }
2292    }
2293
2294    unsafe impl fidl::encoding::TypeMarker for CrashReportingProduct {
2295        type Owned = Self;
2296
2297        #[inline(always)]
2298        fn inline_align(_context: fidl::encoding::Context) -> usize {
2299            8
2300        }
2301
2302        #[inline(always)]
2303        fn inline_size(_context: fidl::encoding::Context) -> usize {
2304            16
2305        }
2306    }
2307
2308    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CrashReportingProduct, D>
2309        for &CrashReportingProduct
2310    {
2311        unsafe fn encode(
2312            self,
2313            encoder: &mut fidl::encoding::Encoder<'_, D>,
2314            offset: usize,
2315            mut depth: fidl::encoding::Depth,
2316        ) -> fidl::Result<()> {
2317            encoder.debug_check_bounds::<CrashReportingProduct>(offset);
2318            // Vector header
2319            let max_ordinal: u64 = self.max_ordinal_present();
2320            encoder.write_num(max_ordinal, offset);
2321            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2322            // Calling encoder.out_of_line_offset(0) is not allowed.
2323            if max_ordinal == 0 {
2324                return Ok(());
2325            }
2326            depth.increment()?;
2327            let envelope_size = 8;
2328            let bytes_len = max_ordinal as usize * envelope_size;
2329            #[allow(unused_variables)]
2330            let offset = encoder.out_of_line_offset(bytes_len);
2331            let mut _prev_end_offset: usize = 0;
2332            if 1 > max_ordinal {
2333                return Ok(());
2334            }
2335
2336            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2337            // are envelope_size bytes.
2338            let cur_offset: usize = (1 - 1) * envelope_size;
2339
2340            // Zero reserved fields.
2341            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2342
2343            // Safety:
2344            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2345            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2346            //   envelope_size bytes, there is always sufficient room.
2347            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2348                self.name.as_ref().map(
2349                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2350                ),
2351                encoder,
2352                offset + cur_offset,
2353                depth,
2354            )?;
2355
2356            _prev_end_offset = cur_offset + envelope_size;
2357            if 2 > max_ordinal {
2358                return Ok(());
2359            }
2360
2361            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2362            // are envelope_size bytes.
2363            let cur_offset: usize = (2 - 1) * envelope_size;
2364
2365            // Zero reserved fields.
2366            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2367
2368            // Safety:
2369            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2370            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2371            //   envelope_size bytes, there is always sufficient room.
2372            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2373                self.version.as_ref().map(
2374                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2375                ),
2376                encoder,
2377                offset + cur_offset,
2378                depth,
2379            )?;
2380
2381            _prev_end_offset = cur_offset + envelope_size;
2382            if 3 > max_ordinal {
2383                return Ok(());
2384            }
2385
2386            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2387            // are envelope_size bytes.
2388            let cur_offset: usize = (3 - 1) * envelope_size;
2389
2390            // Zero reserved fields.
2391            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2392
2393            // Safety:
2394            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2395            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2396            //   envelope_size bytes, there is always sufficient room.
2397            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2398                self.channel.as_ref().map(
2399                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2400                ),
2401                encoder,
2402                offset + cur_offset,
2403                depth,
2404            )?;
2405
2406            _prev_end_offset = cur_offset + envelope_size;
2407
2408            Ok(())
2409        }
2410    }
2411
2412    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CrashReportingProduct {
2413        #[inline(always)]
2414        fn new_empty() -> Self {
2415            Self::default()
2416        }
2417
2418        unsafe fn decode(
2419            &mut self,
2420            decoder: &mut fidl::encoding::Decoder<'_, D>,
2421            offset: usize,
2422            mut depth: fidl::encoding::Depth,
2423        ) -> fidl::Result<()> {
2424            decoder.debug_check_bounds::<Self>(offset);
2425            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2426                None => return Err(fidl::Error::NotNullable),
2427                Some(len) => len,
2428            };
2429            // Calling decoder.out_of_line_offset(0) is not allowed.
2430            if len == 0 {
2431                return Ok(());
2432            };
2433            depth.increment()?;
2434            let envelope_size = 8;
2435            let bytes_len = len * envelope_size;
2436            let offset = decoder.out_of_line_offset(bytes_len)?;
2437            // Decode the envelope for each type.
2438            let mut _next_ordinal_to_read = 0;
2439            let mut next_offset = offset;
2440            let end_offset = offset + bytes_len;
2441            _next_ordinal_to_read += 1;
2442            if next_offset >= end_offset {
2443                return Ok(());
2444            }
2445
2446            // Decode unknown envelopes for gaps in ordinals.
2447            while _next_ordinal_to_read < 1 {
2448                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2449                _next_ordinal_to_read += 1;
2450                next_offset += envelope_size;
2451            }
2452
2453            let next_out_of_line = decoder.next_out_of_line();
2454            let handles_before = decoder.remaining_handles();
2455            if let Some((inlined, num_bytes, num_handles)) =
2456                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2457            {
2458                let member_inline_size =
2459                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2460                        decoder.context,
2461                    );
2462                if inlined != (member_inline_size <= 4) {
2463                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2464                }
2465                let inner_offset;
2466                let mut inner_depth = depth.clone();
2467                if inlined {
2468                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2469                    inner_offset = next_offset;
2470                } else {
2471                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2472                    inner_depth.increment()?;
2473                }
2474                let val_ref = self
2475                    .name
2476                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2477                fidl::decode!(
2478                    fidl::encoding::UnboundedString,
2479                    D,
2480                    val_ref,
2481                    decoder,
2482                    inner_offset,
2483                    inner_depth
2484                )?;
2485                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2486                {
2487                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2488                }
2489                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2490                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2491                }
2492            }
2493
2494            next_offset += envelope_size;
2495            _next_ordinal_to_read += 1;
2496            if next_offset >= end_offset {
2497                return Ok(());
2498            }
2499
2500            // Decode unknown envelopes for gaps in ordinals.
2501            while _next_ordinal_to_read < 2 {
2502                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2503                _next_ordinal_to_read += 1;
2504                next_offset += envelope_size;
2505            }
2506
2507            let next_out_of_line = decoder.next_out_of_line();
2508            let handles_before = decoder.remaining_handles();
2509            if let Some((inlined, num_bytes, num_handles)) =
2510                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2511            {
2512                let member_inline_size =
2513                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2514                        decoder.context,
2515                    );
2516                if inlined != (member_inline_size <= 4) {
2517                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2518                }
2519                let inner_offset;
2520                let mut inner_depth = depth.clone();
2521                if inlined {
2522                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2523                    inner_offset = next_offset;
2524                } else {
2525                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2526                    inner_depth.increment()?;
2527                }
2528                let val_ref = self
2529                    .version
2530                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2531                fidl::decode!(
2532                    fidl::encoding::UnboundedString,
2533                    D,
2534                    val_ref,
2535                    decoder,
2536                    inner_offset,
2537                    inner_depth
2538                )?;
2539                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2540                {
2541                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2542                }
2543                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2544                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2545                }
2546            }
2547
2548            next_offset += envelope_size;
2549            _next_ordinal_to_read += 1;
2550            if next_offset >= end_offset {
2551                return Ok(());
2552            }
2553
2554            // Decode unknown envelopes for gaps in ordinals.
2555            while _next_ordinal_to_read < 3 {
2556                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2557                _next_ordinal_to_read += 1;
2558                next_offset += envelope_size;
2559            }
2560
2561            let next_out_of_line = decoder.next_out_of_line();
2562            let handles_before = decoder.remaining_handles();
2563            if let Some((inlined, num_bytes, num_handles)) =
2564                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2565            {
2566                let member_inline_size =
2567                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2568                        decoder.context,
2569                    );
2570                if inlined != (member_inline_size <= 4) {
2571                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2572                }
2573                let inner_offset;
2574                let mut inner_depth = depth.clone();
2575                if inlined {
2576                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2577                    inner_offset = next_offset;
2578                } else {
2579                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2580                    inner_depth.increment()?;
2581                }
2582                let val_ref = self
2583                    .channel
2584                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2585                fidl::decode!(
2586                    fidl::encoding::UnboundedString,
2587                    D,
2588                    val_ref,
2589                    decoder,
2590                    inner_offset,
2591                    inner_depth
2592                )?;
2593                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2594                {
2595                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2596                }
2597                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2598                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2599                }
2600            }
2601
2602            next_offset += envelope_size;
2603
2604            // Decode the remaining unknown envelopes.
2605            while next_offset < end_offset {
2606                _next_ordinal_to_read += 1;
2607                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2608                next_offset += envelope_size;
2609            }
2610
2611            Ok(())
2612        }
2613    }
2614
2615    impl FileReportResults {
2616        #[inline(always)]
2617        fn max_ordinal_present(&self) -> u64 {
2618            if let Some(_) = self.report_id {
2619                return 2;
2620            }
2621            if let Some(_) = self.result {
2622                return 1;
2623            }
2624            0
2625        }
2626    }
2627
2628    impl fidl::encoding::ValueTypeMarker for FileReportResults {
2629        type Borrowed<'a> = &'a Self;
2630        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2631            value
2632        }
2633    }
2634
2635    unsafe impl fidl::encoding::TypeMarker for FileReportResults {
2636        type Owned = Self;
2637
2638        #[inline(always)]
2639        fn inline_align(_context: fidl::encoding::Context) -> usize {
2640            8
2641        }
2642
2643        #[inline(always)]
2644        fn inline_size(_context: fidl::encoding::Context) -> usize {
2645            16
2646        }
2647    }
2648
2649    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileReportResults, D>
2650        for &FileReportResults
2651    {
2652        unsafe fn encode(
2653            self,
2654            encoder: &mut fidl::encoding::Encoder<'_, D>,
2655            offset: usize,
2656            mut depth: fidl::encoding::Depth,
2657        ) -> fidl::Result<()> {
2658            encoder.debug_check_bounds::<FileReportResults>(offset);
2659            // Vector header
2660            let max_ordinal: u64 = self.max_ordinal_present();
2661            encoder.write_num(max_ordinal, offset);
2662            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2663            // Calling encoder.out_of_line_offset(0) is not allowed.
2664            if max_ordinal == 0 {
2665                return Ok(());
2666            }
2667            depth.increment()?;
2668            let envelope_size = 8;
2669            let bytes_len = max_ordinal as usize * envelope_size;
2670            #[allow(unused_variables)]
2671            let offset = encoder.out_of_line_offset(bytes_len);
2672            let mut _prev_end_offset: usize = 0;
2673            if 1 > max_ordinal {
2674                return Ok(());
2675            }
2676
2677            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2678            // are envelope_size bytes.
2679            let cur_offset: usize = (1 - 1) * envelope_size;
2680
2681            // Zero reserved fields.
2682            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2683
2684            // Safety:
2685            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2686            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2687            //   envelope_size bytes, there is always sufficient room.
2688            fidl::encoding::encode_in_envelope_optional::<FilingSuccess, D>(
2689                self.result
2690                    .as_ref()
2691                    .map(<FilingSuccess as fidl::encoding::ValueTypeMarker>::borrow),
2692                encoder,
2693                offset + cur_offset,
2694                depth,
2695            )?;
2696
2697            _prev_end_offset = cur_offset + envelope_size;
2698            if 2 > max_ordinal {
2699                return Ok(());
2700            }
2701
2702            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2703            // are envelope_size bytes.
2704            let cur_offset: usize = (2 - 1) * envelope_size;
2705
2706            // Zero reserved fields.
2707            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2708
2709            // Safety:
2710            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2711            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2712            //   envelope_size bytes, there is always sufficient room.
2713            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<64>, D>(
2714                self.report_id.as_ref().map(
2715                    <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow,
2716                ),
2717                encoder,
2718                offset + cur_offset,
2719                depth,
2720            )?;
2721
2722            _prev_end_offset = cur_offset + envelope_size;
2723
2724            Ok(())
2725        }
2726    }
2727
2728    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileReportResults {
2729        #[inline(always)]
2730        fn new_empty() -> Self {
2731            Self::default()
2732        }
2733
2734        unsafe fn decode(
2735            &mut self,
2736            decoder: &mut fidl::encoding::Decoder<'_, D>,
2737            offset: usize,
2738            mut depth: fidl::encoding::Depth,
2739        ) -> fidl::Result<()> {
2740            decoder.debug_check_bounds::<Self>(offset);
2741            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2742                None => return Err(fidl::Error::NotNullable),
2743                Some(len) => len,
2744            };
2745            // Calling decoder.out_of_line_offset(0) is not allowed.
2746            if len == 0 {
2747                return Ok(());
2748            };
2749            depth.increment()?;
2750            let envelope_size = 8;
2751            let bytes_len = len * envelope_size;
2752            let offset = decoder.out_of_line_offset(bytes_len)?;
2753            // Decode the envelope for each type.
2754            let mut _next_ordinal_to_read = 0;
2755            let mut next_offset = offset;
2756            let end_offset = offset + bytes_len;
2757            _next_ordinal_to_read += 1;
2758            if next_offset >= end_offset {
2759                return Ok(());
2760            }
2761
2762            // Decode unknown envelopes for gaps in ordinals.
2763            while _next_ordinal_to_read < 1 {
2764                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2765                _next_ordinal_to_read += 1;
2766                next_offset += envelope_size;
2767            }
2768
2769            let next_out_of_line = decoder.next_out_of_line();
2770            let handles_before = decoder.remaining_handles();
2771            if let Some((inlined, num_bytes, num_handles)) =
2772                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2773            {
2774                let member_inline_size =
2775                    <FilingSuccess as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2776                if inlined != (member_inline_size <= 4) {
2777                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2778                }
2779                let inner_offset;
2780                let mut inner_depth = depth.clone();
2781                if inlined {
2782                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2783                    inner_offset = next_offset;
2784                } else {
2785                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2786                    inner_depth.increment()?;
2787                }
2788                let val_ref = self.result.get_or_insert_with(|| fidl::new_empty!(FilingSuccess, D));
2789                fidl::decode!(FilingSuccess, D, val_ref, decoder, inner_offset, inner_depth)?;
2790                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2791                {
2792                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2793                }
2794                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2795                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2796                }
2797            }
2798
2799            next_offset += envelope_size;
2800            _next_ordinal_to_read += 1;
2801            if next_offset >= end_offset {
2802                return Ok(());
2803            }
2804
2805            // Decode unknown envelopes for gaps in ordinals.
2806            while _next_ordinal_to_read < 2 {
2807                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2808                _next_ordinal_to_read += 1;
2809                next_offset += envelope_size;
2810            }
2811
2812            let next_out_of_line = decoder.next_out_of_line();
2813            let handles_before = decoder.remaining_handles();
2814            if let Some((inlined, num_bytes, num_handles)) =
2815                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2816            {
2817                let member_inline_size =
2818                    <fidl::encoding::BoundedString<64> as fidl::encoding::TypeMarker>::inline_size(
2819                        decoder.context,
2820                    );
2821                if inlined != (member_inline_size <= 4) {
2822                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2823                }
2824                let inner_offset;
2825                let mut inner_depth = depth.clone();
2826                if inlined {
2827                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2828                    inner_offset = next_offset;
2829                } else {
2830                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2831                    inner_depth.increment()?;
2832                }
2833                let val_ref = self
2834                    .report_id
2835                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<64>, D));
2836                fidl::decode!(
2837                    fidl::encoding::BoundedString<64>,
2838                    D,
2839                    val_ref,
2840                    decoder,
2841                    inner_offset,
2842                    inner_depth
2843                )?;
2844                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2845                {
2846                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2847                }
2848                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2849                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2850                }
2851            }
2852
2853            next_offset += envelope_size;
2854
2855            // Decode the remaining unknown envelopes.
2856            while next_offset < end_offset {
2857                _next_ordinal_to_read += 1;
2858                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2859                next_offset += envelope_size;
2860            }
2861
2862            Ok(())
2863        }
2864    }
2865
2866    impl GetAnnotationsParameters {
2867        #[inline(always)]
2868        fn max_ordinal_present(&self) -> u64 {
2869            if let Some(_) = self.collection_timeout_per_annotation {
2870                return 1;
2871            }
2872            0
2873        }
2874    }
2875
2876    impl fidl::encoding::ValueTypeMarker for GetAnnotationsParameters {
2877        type Borrowed<'a> = &'a Self;
2878        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2879            value
2880        }
2881    }
2882
2883    unsafe impl fidl::encoding::TypeMarker for GetAnnotationsParameters {
2884        type Owned = Self;
2885
2886        #[inline(always)]
2887        fn inline_align(_context: fidl::encoding::Context) -> usize {
2888            8
2889        }
2890
2891        #[inline(always)]
2892        fn inline_size(_context: fidl::encoding::Context) -> usize {
2893            16
2894        }
2895    }
2896
2897    unsafe impl<D: fidl::encoding::ResourceDialect>
2898        fidl::encoding::Encode<GetAnnotationsParameters, D> for &GetAnnotationsParameters
2899    {
2900        unsafe fn encode(
2901            self,
2902            encoder: &mut fidl::encoding::Encoder<'_, D>,
2903            offset: usize,
2904            mut depth: fidl::encoding::Depth,
2905        ) -> fidl::Result<()> {
2906            encoder.debug_check_bounds::<GetAnnotationsParameters>(offset);
2907            // Vector header
2908            let max_ordinal: u64 = self.max_ordinal_present();
2909            encoder.write_num(max_ordinal, offset);
2910            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2911            // Calling encoder.out_of_line_offset(0) is not allowed.
2912            if max_ordinal == 0 {
2913                return Ok(());
2914            }
2915            depth.increment()?;
2916            let envelope_size = 8;
2917            let bytes_len = max_ordinal as usize * envelope_size;
2918            #[allow(unused_variables)]
2919            let offset = encoder.out_of_line_offset(bytes_len);
2920            let mut _prev_end_offset: usize = 0;
2921            if 1 > max_ordinal {
2922                return Ok(());
2923            }
2924
2925            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2926            // are envelope_size bytes.
2927            let cur_offset: usize = (1 - 1) * envelope_size;
2928
2929            // Zero reserved fields.
2930            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2931
2932            // Safety:
2933            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2934            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2935            //   envelope_size bytes, there is always sufficient room.
2936            fidl::encoding::encode_in_envelope_optional::<i64, D>(
2937                self.collection_timeout_per_annotation
2938                    .as_ref()
2939                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2940                encoder,
2941                offset + cur_offset,
2942                depth,
2943            )?;
2944
2945            _prev_end_offset = cur_offset + envelope_size;
2946
2947            Ok(())
2948        }
2949    }
2950
2951    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2952        for GetAnnotationsParameters
2953    {
2954        #[inline(always)]
2955        fn new_empty() -> Self {
2956            Self::default()
2957        }
2958
2959        unsafe fn decode(
2960            &mut self,
2961            decoder: &mut fidl::encoding::Decoder<'_, D>,
2962            offset: usize,
2963            mut depth: fidl::encoding::Depth,
2964        ) -> fidl::Result<()> {
2965            decoder.debug_check_bounds::<Self>(offset);
2966            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2967                None => return Err(fidl::Error::NotNullable),
2968                Some(len) => len,
2969            };
2970            // Calling decoder.out_of_line_offset(0) is not allowed.
2971            if len == 0 {
2972                return Ok(());
2973            };
2974            depth.increment()?;
2975            let envelope_size = 8;
2976            let bytes_len = len * envelope_size;
2977            let offset = decoder.out_of_line_offset(bytes_len)?;
2978            // Decode the envelope for each type.
2979            let mut _next_ordinal_to_read = 0;
2980            let mut next_offset = offset;
2981            let end_offset = offset + bytes_len;
2982            _next_ordinal_to_read += 1;
2983            if next_offset >= end_offset {
2984                return Ok(());
2985            }
2986
2987            // Decode unknown envelopes for gaps in ordinals.
2988            while _next_ordinal_to_read < 1 {
2989                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2990                _next_ordinal_to_read += 1;
2991                next_offset += envelope_size;
2992            }
2993
2994            let next_out_of_line = decoder.next_out_of_line();
2995            let handles_before = decoder.remaining_handles();
2996            if let Some((inlined, num_bytes, num_handles)) =
2997                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2998            {
2999                let member_inline_size =
3000                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3001                if inlined != (member_inline_size <= 4) {
3002                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3003                }
3004                let inner_offset;
3005                let mut inner_depth = depth.clone();
3006                if inlined {
3007                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3008                    inner_offset = next_offset;
3009                } else {
3010                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3011                    inner_depth.increment()?;
3012                }
3013                let val_ref = self
3014                    .collection_timeout_per_annotation
3015                    .get_or_insert_with(|| fidl::new_empty!(i64, D));
3016                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3017                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3018                {
3019                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3020                }
3021                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3022                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3023                }
3024            }
3025
3026            next_offset += envelope_size;
3027
3028            // Decode the remaining unknown envelopes.
3029            while next_offset < end_offset {
3030                _next_ordinal_to_read += 1;
3031                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3032                next_offset += envelope_size;
3033            }
3034
3035            Ok(())
3036        }
3037    }
3038
3039    impl LastReboot {
3040        #[inline(always)]
3041        fn max_ordinal_present(&self) -> u64 {
3042            if let Some(_) = self.runtime {
3043                return 5;
3044            }
3045            if let Some(_) = self.planned {
3046                return 4;
3047            }
3048            if let Some(_) = self.uptime {
3049                return 3;
3050            }
3051            if let Some(_) = self.reason {
3052                return 2;
3053            }
3054            if let Some(_) = self.graceful {
3055                return 1;
3056            }
3057            0
3058        }
3059    }
3060
3061    impl fidl::encoding::ValueTypeMarker for LastReboot {
3062        type Borrowed<'a> = &'a Self;
3063        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3064            value
3065        }
3066    }
3067
3068    unsafe impl fidl::encoding::TypeMarker for LastReboot {
3069        type Owned = Self;
3070
3071        #[inline(always)]
3072        fn inline_align(_context: fidl::encoding::Context) -> usize {
3073            8
3074        }
3075
3076        #[inline(always)]
3077        fn inline_size(_context: fidl::encoding::Context) -> usize {
3078            16
3079        }
3080    }
3081
3082    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LastReboot, D>
3083        for &LastReboot
3084    {
3085        unsafe fn encode(
3086            self,
3087            encoder: &mut fidl::encoding::Encoder<'_, D>,
3088            offset: usize,
3089            mut depth: fidl::encoding::Depth,
3090        ) -> fidl::Result<()> {
3091            encoder.debug_check_bounds::<LastReboot>(offset);
3092            // Vector header
3093            let max_ordinal: u64 = self.max_ordinal_present();
3094            encoder.write_num(max_ordinal, offset);
3095            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3096            // Calling encoder.out_of_line_offset(0) is not allowed.
3097            if max_ordinal == 0 {
3098                return Ok(());
3099            }
3100            depth.increment()?;
3101            let envelope_size = 8;
3102            let bytes_len = max_ordinal as usize * envelope_size;
3103            #[allow(unused_variables)]
3104            let offset = encoder.out_of_line_offset(bytes_len);
3105            let mut _prev_end_offset: usize = 0;
3106            if 1 > max_ordinal {
3107                return Ok(());
3108            }
3109
3110            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3111            // are envelope_size bytes.
3112            let cur_offset: usize = (1 - 1) * envelope_size;
3113
3114            // Zero reserved fields.
3115            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3116
3117            // Safety:
3118            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3119            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3120            //   envelope_size bytes, there is always sufficient room.
3121            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3122                self.graceful.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3123                encoder,
3124                offset + cur_offset,
3125                depth,
3126            )?;
3127
3128            _prev_end_offset = cur_offset + envelope_size;
3129            if 2 > max_ordinal {
3130                return Ok(());
3131            }
3132
3133            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3134            // are envelope_size bytes.
3135            let cur_offset: usize = (2 - 1) * envelope_size;
3136
3137            // Zero reserved fields.
3138            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3139
3140            // Safety:
3141            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3142            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3143            //   envelope_size bytes, there is always sufficient room.
3144            fidl::encoding::encode_in_envelope_optional::<RebootReason, D>(
3145                self.reason.as_ref().map(<RebootReason as fidl::encoding::ValueTypeMarker>::borrow),
3146                encoder,
3147                offset + cur_offset,
3148                depth,
3149            )?;
3150
3151            _prev_end_offset = cur_offset + envelope_size;
3152            if 3 > max_ordinal {
3153                return Ok(());
3154            }
3155
3156            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3157            // are envelope_size bytes.
3158            let cur_offset: usize = (3 - 1) * envelope_size;
3159
3160            // Zero reserved fields.
3161            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3162
3163            // Safety:
3164            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3165            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3166            //   envelope_size bytes, there is always sufficient room.
3167            fidl::encoding::encode_in_envelope_optional::<i64, D>(
3168                self.uptime.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3169                encoder,
3170                offset + cur_offset,
3171                depth,
3172            )?;
3173
3174            _prev_end_offset = cur_offset + envelope_size;
3175            if 4 > max_ordinal {
3176                return Ok(());
3177            }
3178
3179            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3180            // are envelope_size bytes.
3181            let cur_offset: usize = (4 - 1) * envelope_size;
3182
3183            // Zero reserved fields.
3184            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3185
3186            // Safety:
3187            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3188            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3189            //   envelope_size bytes, there is always sufficient room.
3190            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3191                self.planned.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3192                encoder,
3193                offset + cur_offset,
3194                depth,
3195            )?;
3196
3197            _prev_end_offset = cur_offset + envelope_size;
3198            if 5 > max_ordinal {
3199                return Ok(());
3200            }
3201
3202            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3203            // are envelope_size bytes.
3204            let cur_offset: usize = (5 - 1) * envelope_size;
3205
3206            // Zero reserved fields.
3207            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3208
3209            // Safety:
3210            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3211            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3212            //   envelope_size bytes, there is always sufficient room.
3213            fidl::encoding::encode_in_envelope_optional::<i64, D>(
3214                self.runtime.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3215                encoder,
3216                offset + cur_offset,
3217                depth,
3218            )?;
3219
3220            _prev_end_offset = cur_offset + envelope_size;
3221
3222            Ok(())
3223        }
3224    }
3225
3226    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LastReboot {
3227        #[inline(always)]
3228        fn new_empty() -> Self {
3229            Self::default()
3230        }
3231
3232        unsafe fn decode(
3233            &mut self,
3234            decoder: &mut fidl::encoding::Decoder<'_, D>,
3235            offset: usize,
3236            mut depth: fidl::encoding::Depth,
3237        ) -> fidl::Result<()> {
3238            decoder.debug_check_bounds::<Self>(offset);
3239            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3240                None => return Err(fidl::Error::NotNullable),
3241                Some(len) => len,
3242            };
3243            // Calling decoder.out_of_line_offset(0) is not allowed.
3244            if len == 0 {
3245                return Ok(());
3246            };
3247            depth.increment()?;
3248            let envelope_size = 8;
3249            let bytes_len = len * envelope_size;
3250            let offset = decoder.out_of_line_offset(bytes_len)?;
3251            // Decode the envelope for each type.
3252            let mut _next_ordinal_to_read = 0;
3253            let mut next_offset = offset;
3254            let end_offset = offset + bytes_len;
3255            _next_ordinal_to_read += 1;
3256            if next_offset >= end_offset {
3257                return Ok(());
3258            }
3259
3260            // Decode unknown envelopes for gaps in ordinals.
3261            while _next_ordinal_to_read < 1 {
3262                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3263                _next_ordinal_to_read += 1;
3264                next_offset += envelope_size;
3265            }
3266
3267            let next_out_of_line = decoder.next_out_of_line();
3268            let handles_before = decoder.remaining_handles();
3269            if let Some((inlined, num_bytes, num_handles)) =
3270                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3271            {
3272                let member_inline_size =
3273                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3274                if inlined != (member_inline_size <= 4) {
3275                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3276                }
3277                let inner_offset;
3278                let mut inner_depth = depth.clone();
3279                if inlined {
3280                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3281                    inner_offset = next_offset;
3282                } else {
3283                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3284                    inner_depth.increment()?;
3285                }
3286                let val_ref = self.graceful.get_or_insert_with(|| fidl::new_empty!(bool, D));
3287                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3288                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3289                {
3290                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3291                }
3292                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3293                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3294                }
3295            }
3296
3297            next_offset += envelope_size;
3298            _next_ordinal_to_read += 1;
3299            if next_offset >= end_offset {
3300                return Ok(());
3301            }
3302
3303            // Decode unknown envelopes for gaps in ordinals.
3304            while _next_ordinal_to_read < 2 {
3305                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3306                _next_ordinal_to_read += 1;
3307                next_offset += envelope_size;
3308            }
3309
3310            let next_out_of_line = decoder.next_out_of_line();
3311            let handles_before = decoder.remaining_handles();
3312            if let Some((inlined, num_bytes, num_handles)) =
3313                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3314            {
3315                let member_inline_size =
3316                    <RebootReason as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3317                if inlined != (member_inline_size <= 4) {
3318                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3319                }
3320                let inner_offset;
3321                let mut inner_depth = depth.clone();
3322                if inlined {
3323                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3324                    inner_offset = next_offset;
3325                } else {
3326                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3327                    inner_depth.increment()?;
3328                }
3329                let val_ref = self.reason.get_or_insert_with(|| fidl::new_empty!(RebootReason, D));
3330                fidl::decode!(RebootReason, D, val_ref, decoder, inner_offset, inner_depth)?;
3331                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3332                {
3333                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3334                }
3335                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3336                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3337                }
3338            }
3339
3340            next_offset += envelope_size;
3341            _next_ordinal_to_read += 1;
3342            if next_offset >= end_offset {
3343                return Ok(());
3344            }
3345
3346            // Decode unknown envelopes for gaps in ordinals.
3347            while _next_ordinal_to_read < 3 {
3348                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3349                _next_ordinal_to_read += 1;
3350                next_offset += envelope_size;
3351            }
3352
3353            let next_out_of_line = decoder.next_out_of_line();
3354            let handles_before = decoder.remaining_handles();
3355            if let Some((inlined, num_bytes, num_handles)) =
3356                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3357            {
3358                let member_inline_size =
3359                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3360                if inlined != (member_inline_size <= 4) {
3361                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3362                }
3363                let inner_offset;
3364                let mut inner_depth = depth.clone();
3365                if inlined {
3366                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3367                    inner_offset = next_offset;
3368                } else {
3369                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3370                    inner_depth.increment()?;
3371                }
3372                let val_ref = self.uptime.get_or_insert_with(|| fidl::new_empty!(i64, D));
3373                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3374                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3375                {
3376                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3377                }
3378                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3379                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3380                }
3381            }
3382
3383            next_offset += envelope_size;
3384            _next_ordinal_to_read += 1;
3385            if next_offset >= end_offset {
3386                return Ok(());
3387            }
3388
3389            // Decode unknown envelopes for gaps in ordinals.
3390            while _next_ordinal_to_read < 4 {
3391                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3392                _next_ordinal_to_read += 1;
3393                next_offset += envelope_size;
3394            }
3395
3396            let next_out_of_line = decoder.next_out_of_line();
3397            let handles_before = decoder.remaining_handles();
3398            if let Some((inlined, num_bytes, num_handles)) =
3399                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3400            {
3401                let member_inline_size =
3402                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3403                if inlined != (member_inline_size <= 4) {
3404                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3405                }
3406                let inner_offset;
3407                let mut inner_depth = depth.clone();
3408                if inlined {
3409                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3410                    inner_offset = next_offset;
3411                } else {
3412                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3413                    inner_depth.increment()?;
3414                }
3415                let val_ref = self.planned.get_or_insert_with(|| fidl::new_empty!(bool, D));
3416                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3417                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3418                {
3419                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3420                }
3421                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3422                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3423                }
3424            }
3425
3426            next_offset += envelope_size;
3427            _next_ordinal_to_read += 1;
3428            if next_offset >= end_offset {
3429                return Ok(());
3430            }
3431
3432            // Decode unknown envelopes for gaps in ordinals.
3433            while _next_ordinal_to_read < 5 {
3434                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3435                _next_ordinal_to_read += 1;
3436                next_offset += envelope_size;
3437            }
3438
3439            let next_out_of_line = decoder.next_out_of_line();
3440            let handles_before = decoder.remaining_handles();
3441            if let Some((inlined, num_bytes, num_handles)) =
3442                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3443            {
3444                let member_inline_size =
3445                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3446                if inlined != (member_inline_size <= 4) {
3447                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3448                }
3449                let inner_offset;
3450                let mut inner_depth = depth.clone();
3451                if inlined {
3452                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3453                    inner_offset = next_offset;
3454                } else {
3455                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3456                    inner_depth.increment()?;
3457                }
3458                let val_ref = self.runtime.get_or_insert_with(|| fidl::new_empty!(i64, D));
3459                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3460                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3461                {
3462                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3463                }
3464                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3465                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3466                }
3467            }
3468
3469            next_offset += envelope_size;
3470
3471            // Decode the remaining unknown envelopes.
3472            while next_offset < end_offset {
3473                _next_ordinal_to_read += 1;
3474                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3475                next_offset += envelope_size;
3476            }
3477
3478            Ok(())
3479        }
3480    }
3481}