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