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
597pub mod component_data_register_ordinals {
598    pub const UPSERT: u64 = 0xa25b7c4e125c0a1;
599}
600
601pub mod crash_reporter_ordinals {
602    pub const FILE_REPORT: u64 = 0x6f660f55b3160dd4;
603}
604
605pub mod crash_reporting_product_register_ordinals {
606    pub const UPSERT: u64 = 0x668cdc9615c91d7f;
607    pub const UPSERT_WITH_ACK: u64 = 0x4a4f1279b3439c9d;
608}
609
610pub mod data_provider_ordinals {
611    pub const GET_SNAPSHOT: u64 = 0x753649a04e5d0bc0;
612    pub const GET_SCREENSHOT: u64 = 0x438c858494d1781;
613    pub const GET_ANNOTATIONS: u64 = 0x367b4b6afe4345d8;
614}
615
616pub mod device_id_provider_ordinals {
617    pub const GET_ID: u64 = 0xea7f28a243488dc;
618}
619
620pub mod last_reboot_info_provider_ordinals {
621    pub const GET: u64 = 0xbc32d10e081ffac;
622}
623
624mod internal {
625    use super::*;
626    unsafe impl fidl::encoding::TypeMarker for FilingError {
627        type Owned = Self;
628
629        #[inline(always)]
630        fn inline_align(_context: fidl::encoding::Context) -> usize {
631            std::mem::align_of::<u32>()
632        }
633
634        #[inline(always)]
635        fn inline_size(_context: fidl::encoding::Context) -> usize {
636            std::mem::size_of::<u32>()
637        }
638
639        #[inline(always)]
640        fn encode_is_copy() -> bool {
641            false
642        }
643
644        #[inline(always)]
645        fn decode_is_copy() -> bool {
646            false
647        }
648    }
649
650    impl fidl::encoding::ValueTypeMarker for FilingError {
651        type Borrowed<'a> = Self;
652        #[inline(always)]
653        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
654            *value
655        }
656    }
657
658    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilingError {
659        #[inline]
660        unsafe fn encode(
661            self,
662            encoder: &mut fidl::encoding::Encoder<'_, D>,
663            offset: usize,
664            _depth: fidl::encoding::Depth,
665        ) -> fidl::Result<()> {
666            encoder.debug_check_bounds::<Self>(offset);
667            encoder.write_num(self.into_primitive(), offset);
668            Ok(())
669        }
670    }
671
672    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilingError {
673        #[inline(always)]
674        fn new_empty() -> Self {
675            Self::unknown()
676        }
677
678        #[inline]
679        unsafe fn decode(
680            &mut self,
681            decoder: &mut fidl::encoding::Decoder<'_, D>,
682            offset: usize,
683            _depth: fidl::encoding::Depth,
684        ) -> fidl::Result<()> {
685            decoder.debug_check_bounds::<Self>(offset);
686            let prim = decoder.read_num::<u32>(offset);
687
688            *self = Self::from_primitive_allow_unknown(prim);
689            Ok(())
690        }
691    }
692    unsafe impl fidl::encoding::TypeMarker for FilingSuccess {
693        type Owned = Self;
694
695        #[inline(always)]
696        fn inline_align(_context: fidl::encoding::Context) -> usize {
697            std::mem::align_of::<u32>()
698        }
699
700        #[inline(always)]
701        fn inline_size(_context: fidl::encoding::Context) -> usize {
702            std::mem::size_of::<u32>()
703        }
704
705        #[inline(always)]
706        fn encode_is_copy() -> bool {
707            false
708        }
709
710        #[inline(always)]
711        fn decode_is_copy() -> bool {
712            false
713        }
714    }
715
716    impl fidl::encoding::ValueTypeMarker for FilingSuccess {
717        type Borrowed<'a> = Self;
718        #[inline(always)]
719        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
720            *value
721        }
722    }
723
724    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilingSuccess {
725        #[inline]
726        unsafe fn encode(
727            self,
728            encoder: &mut fidl::encoding::Encoder<'_, D>,
729            offset: usize,
730            _depth: fidl::encoding::Depth,
731        ) -> fidl::Result<()> {
732            encoder.debug_check_bounds::<Self>(offset);
733            encoder.write_num(self.into_primitive(), offset);
734            Ok(())
735        }
736    }
737
738    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilingSuccess {
739        #[inline(always)]
740        fn new_empty() -> Self {
741            Self::unknown()
742        }
743
744        #[inline]
745        unsafe fn decode(
746            &mut self,
747            decoder: &mut fidl::encoding::Decoder<'_, D>,
748            offset: usize,
749            _depth: fidl::encoding::Depth,
750        ) -> fidl::Result<()> {
751            decoder.debug_check_bounds::<Self>(offset);
752            let prim = decoder.read_num::<u32>(offset);
753
754            *self = Self::from_primitive_allow_unknown(prim);
755            Ok(())
756        }
757    }
758    unsafe impl fidl::encoding::TypeMarker for ImageEncoding {
759        type Owned = Self;
760
761        #[inline(always)]
762        fn inline_align(_context: fidl::encoding::Context) -> usize {
763            std::mem::align_of::<u32>()
764        }
765
766        #[inline(always)]
767        fn inline_size(_context: fidl::encoding::Context) -> usize {
768            std::mem::size_of::<u32>()
769        }
770
771        #[inline(always)]
772        fn encode_is_copy() -> bool {
773            true
774        }
775
776        #[inline(always)]
777        fn decode_is_copy() -> bool {
778            false
779        }
780    }
781
782    impl fidl::encoding::ValueTypeMarker for ImageEncoding {
783        type Borrowed<'a> = Self;
784        #[inline(always)]
785        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
786            *value
787        }
788    }
789
790    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ImageEncoding {
791        #[inline]
792        unsafe fn encode(
793            self,
794            encoder: &mut fidl::encoding::Encoder<'_, D>,
795            offset: usize,
796            _depth: fidl::encoding::Depth,
797        ) -> fidl::Result<()> {
798            encoder.debug_check_bounds::<Self>(offset);
799            encoder.write_num(self.into_primitive(), offset);
800            Ok(())
801        }
802    }
803
804    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageEncoding {
805        #[inline(always)]
806        fn new_empty() -> Self {
807            Self::Png
808        }
809
810        #[inline]
811        unsafe fn decode(
812            &mut self,
813            decoder: &mut fidl::encoding::Decoder<'_, D>,
814            offset: usize,
815            _depth: fidl::encoding::Depth,
816        ) -> fidl::Result<()> {
817            decoder.debug_check_bounds::<Self>(offset);
818            let prim = decoder.read_num::<u32>(offset);
819
820            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
821            Ok(())
822        }
823    }
824    unsafe impl fidl::encoding::TypeMarker for RebootReason {
825        type Owned = Self;
826
827        #[inline(always)]
828        fn inline_align(_context: fidl::encoding::Context) -> usize {
829            std::mem::align_of::<u16>()
830        }
831
832        #[inline(always)]
833        fn inline_size(_context: fidl::encoding::Context) -> usize {
834            std::mem::size_of::<u16>()
835        }
836
837        #[inline(always)]
838        fn encode_is_copy() -> bool {
839            false
840        }
841
842        #[inline(always)]
843        fn decode_is_copy() -> bool {
844            false
845        }
846    }
847
848    impl fidl::encoding::ValueTypeMarker for RebootReason {
849        type Borrowed<'a> = Self;
850        #[inline(always)]
851        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
852            *value
853        }
854    }
855
856    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RebootReason {
857        #[inline]
858        unsafe fn encode(
859            self,
860            encoder: &mut fidl::encoding::Encoder<'_, D>,
861            offset: usize,
862            _depth: fidl::encoding::Depth,
863        ) -> fidl::Result<()> {
864            encoder.debug_check_bounds::<Self>(offset);
865            encoder.write_num(self.into_primitive(), offset);
866            Ok(())
867        }
868    }
869
870    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RebootReason {
871        #[inline(always)]
872        fn new_empty() -> Self {
873            Self::unknown()
874        }
875
876        #[inline]
877        unsafe fn decode(
878            &mut self,
879            decoder: &mut fidl::encoding::Decoder<'_, D>,
880            offset: usize,
881            _depth: fidl::encoding::Depth,
882        ) -> fidl::Result<()> {
883            decoder.debug_check_bounds::<Self>(offset);
884            let prim = decoder.read_num::<u16>(offset);
885
886            *self = Self::from_primitive_allow_unknown(prim);
887            Ok(())
888        }
889    }
890
891    impl fidl::encoding::ValueTypeMarker for Annotation {
892        type Borrowed<'a> = &'a Self;
893        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
894            value
895        }
896    }
897
898    unsafe impl fidl::encoding::TypeMarker for Annotation {
899        type Owned = Self;
900
901        #[inline(always)]
902        fn inline_align(_context: fidl::encoding::Context) -> usize {
903            8
904        }
905
906        #[inline(always)]
907        fn inline_size(_context: fidl::encoding::Context) -> usize {
908            32
909        }
910    }
911
912    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Annotation, D>
913        for &Annotation
914    {
915        #[inline]
916        unsafe fn encode(
917            self,
918            encoder: &mut fidl::encoding::Encoder<'_, D>,
919            offset: usize,
920            _depth: fidl::encoding::Depth,
921        ) -> fidl::Result<()> {
922            encoder.debug_check_bounds::<Annotation>(offset);
923            // Delegate to tuple encoding.
924            fidl::encoding::Encode::<Annotation, D>::encode(
925                (
926                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
927                    <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
928                ),
929                encoder, offset, _depth
930            )
931        }
932    }
933    unsafe impl<
934            D: fidl::encoding::ResourceDialect,
935            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
936            T1: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>, D>,
937        > fidl::encoding::Encode<Annotation, D> for (T0, T1)
938    {
939        #[inline]
940        unsafe fn encode(
941            self,
942            encoder: &mut fidl::encoding::Encoder<'_, D>,
943            offset: usize,
944            depth: fidl::encoding::Depth,
945        ) -> fidl::Result<()> {
946            encoder.debug_check_bounds::<Annotation>(offset);
947            // Zero out padding regions. There's no need to apply masks
948            // because the unmasked parts will be overwritten by fields.
949            // Write the fields.
950            self.0.encode(encoder, offset + 0, depth)?;
951            self.1.encode(encoder, offset + 16, depth)?;
952            Ok(())
953        }
954    }
955
956    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Annotation {
957        #[inline(always)]
958        fn new_empty() -> Self {
959            Self {
960                key: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
961                value: fidl::new_empty!(fidl::encoding::BoundedString<1024>, D),
962            }
963        }
964
965        #[inline]
966        unsafe fn decode(
967            &mut self,
968            decoder: &mut fidl::encoding::Decoder<'_, D>,
969            offset: usize,
970            _depth: fidl::encoding::Depth,
971        ) -> fidl::Result<()> {
972            decoder.debug_check_bounds::<Self>(offset);
973            // Verify that padding bytes are zero.
974            fidl::decode!(
975                fidl::encoding::BoundedString<128>,
976                D,
977                &mut self.key,
978                decoder,
979                offset + 0,
980                _depth
981            )?;
982            fidl::decode!(
983                fidl::encoding::BoundedString<1024>,
984                D,
985                &mut self.value,
986                decoder,
987                offset + 16,
988                _depth
989            )?;
990            Ok(())
991        }
992    }
993
994    impl fidl::encoding::ValueTypeMarker for ComponentDataRegisterUpsertRequest {
995        type Borrowed<'a> = &'a Self;
996        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
997            value
998        }
999    }
1000
1001    unsafe impl fidl::encoding::TypeMarker for ComponentDataRegisterUpsertRequest {
1002        type Owned = Self;
1003
1004        #[inline(always)]
1005        fn inline_align(_context: fidl::encoding::Context) -> usize {
1006            8
1007        }
1008
1009        #[inline(always)]
1010        fn inline_size(_context: fidl::encoding::Context) -> usize {
1011            16
1012        }
1013    }
1014
1015    unsafe impl<D: fidl::encoding::ResourceDialect>
1016        fidl::encoding::Encode<ComponentDataRegisterUpsertRequest, D>
1017        for &ComponentDataRegisterUpsertRequest
1018    {
1019        #[inline]
1020        unsafe fn encode(
1021            self,
1022            encoder: &mut fidl::encoding::Encoder<'_, D>,
1023            offset: usize,
1024            _depth: fidl::encoding::Depth,
1025        ) -> fidl::Result<()> {
1026            encoder.debug_check_bounds::<ComponentDataRegisterUpsertRequest>(offset);
1027            // Delegate to tuple encoding.
1028            fidl::encoding::Encode::<ComponentDataRegisterUpsertRequest, D>::encode(
1029                (<ComponentData as fidl::encoding::ValueTypeMarker>::borrow(&self.data),),
1030                encoder,
1031                offset,
1032                _depth,
1033            )
1034        }
1035    }
1036    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ComponentData, D>>
1037        fidl::encoding::Encode<ComponentDataRegisterUpsertRequest, D> for (T0,)
1038    {
1039        #[inline]
1040        unsafe fn encode(
1041            self,
1042            encoder: &mut fidl::encoding::Encoder<'_, D>,
1043            offset: usize,
1044            depth: fidl::encoding::Depth,
1045        ) -> fidl::Result<()> {
1046            encoder.debug_check_bounds::<ComponentDataRegisterUpsertRequest>(offset);
1047            // Zero out padding regions. There's no need to apply masks
1048            // because the unmasked parts will be overwritten by fields.
1049            // Write the fields.
1050            self.0.encode(encoder, offset + 0, depth)?;
1051            Ok(())
1052        }
1053    }
1054
1055    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1056        for ComponentDataRegisterUpsertRequest
1057    {
1058        #[inline(always)]
1059        fn new_empty() -> Self {
1060            Self { data: fidl::new_empty!(ComponentData, D) }
1061        }
1062
1063        #[inline]
1064        unsafe fn decode(
1065            &mut self,
1066            decoder: &mut fidl::encoding::Decoder<'_, D>,
1067            offset: usize,
1068            _depth: fidl::encoding::Depth,
1069        ) -> fidl::Result<()> {
1070            decoder.debug_check_bounds::<Self>(offset);
1071            // Verify that padding bytes are zero.
1072            fidl::decode!(ComponentData, D, &mut self.data, decoder, offset + 0, _depth)?;
1073            Ok(())
1074        }
1075    }
1076
1077    impl fidl::encoding::ValueTypeMarker for CrashReporterFileReportResponse {
1078        type Borrowed<'a> = &'a Self;
1079        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1080            value
1081        }
1082    }
1083
1084    unsafe impl fidl::encoding::TypeMarker for CrashReporterFileReportResponse {
1085        type Owned = Self;
1086
1087        #[inline(always)]
1088        fn inline_align(_context: fidl::encoding::Context) -> usize {
1089            8
1090        }
1091
1092        #[inline(always)]
1093        fn inline_size(_context: fidl::encoding::Context) -> usize {
1094            16
1095        }
1096    }
1097
1098    unsafe impl<D: fidl::encoding::ResourceDialect>
1099        fidl::encoding::Encode<CrashReporterFileReportResponse, D>
1100        for &CrashReporterFileReportResponse
1101    {
1102        #[inline]
1103        unsafe fn encode(
1104            self,
1105            encoder: &mut fidl::encoding::Encoder<'_, D>,
1106            offset: usize,
1107            _depth: fidl::encoding::Depth,
1108        ) -> fidl::Result<()> {
1109            encoder.debug_check_bounds::<CrashReporterFileReportResponse>(offset);
1110            // Delegate to tuple encoding.
1111            fidl::encoding::Encode::<CrashReporterFileReportResponse, D>::encode(
1112                (<FileReportResults as fidl::encoding::ValueTypeMarker>::borrow(&self.results),),
1113                encoder,
1114                offset,
1115                _depth,
1116            )
1117        }
1118    }
1119    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<FileReportResults, D>>
1120        fidl::encoding::Encode<CrashReporterFileReportResponse, D> for (T0,)
1121    {
1122        #[inline]
1123        unsafe fn encode(
1124            self,
1125            encoder: &mut fidl::encoding::Encoder<'_, D>,
1126            offset: usize,
1127            depth: fidl::encoding::Depth,
1128        ) -> fidl::Result<()> {
1129            encoder.debug_check_bounds::<CrashReporterFileReportResponse>(offset);
1130            // Zero out padding regions. There's no need to apply masks
1131            // because the unmasked parts will be overwritten by fields.
1132            // Write the fields.
1133            self.0.encode(encoder, offset + 0, depth)?;
1134            Ok(())
1135        }
1136    }
1137
1138    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1139        for CrashReporterFileReportResponse
1140    {
1141        #[inline(always)]
1142        fn new_empty() -> Self {
1143            Self { results: fidl::new_empty!(FileReportResults, D) }
1144        }
1145
1146        #[inline]
1147        unsafe fn decode(
1148            &mut self,
1149            decoder: &mut fidl::encoding::Decoder<'_, D>,
1150            offset: usize,
1151            _depth: fidl::encoding::Depth,
1152        ) -> fidl::Result<()> {
1153            decoder.debug_check_bounds::<Self>(offset);
1154            // Verify that padding bytes are zero.
1155            fidl::decode!(FileReportResults, D, &mut self.results, decoder, offset + 0, _depth)?;
1156            Ok(())
1157        }
1158    }
1159
1160    impl fidl::encoding::ValueTypeMarker for CrashReportingProductRegisterUpsertRequest {
1161        type Borrowed<'a> = &'a Self;
1162        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1163            value
1164        }
1165    }
1166
1167    unsafe impl fidl::encoding::TypeMarker for CrashReportingProductRegisterUpsertRequest {
1168        type Owned = Self;
1169
1170        #[inline(always)]
1171        fn inline_align(_context: fidl::encoding::Context) -> usize {
1172            8
1173        }
1174
1175        #[inline(always)]
1176        fn inline_size(_context: fidl::encoding::Context) -> usize {
1177            32
1178        }
1179    }
1180
1181    unsafe impl<D: fidl::encoding::ResourceDialect>
1182        fidl::encoding::Encode<CrashReportingProductRegisterUpsertRequest, D>
1183        for &CrashReportingProductRegisterUpsertRequest
1184    {
1185        #[inline]
1186        unsafe fn encode(
1187            self,
1188            encoder: &mut fidl::encoding::Encoder<'_, D>,
1189            offset: usize,
1190            _depth: fidl::encoding::Depth,
1191        ) -> fidl::Result<()> {
1192            encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertRequest>(offset);
1193            // Delegate to tuple encoding.
1194            fidl::encoding::Encode::<CrashReportingProductRegisterUpsertRequest, D>::encode(
1195                (
1196                    <fidl::encoding::BoundedString<2083> as fidl::encoding::ValueTypeMarker>::borrow(&self.component_url),
1197                    <CrashReportingProduct as fidl::encoding::ValueTypeMarker>::borrow(&self.product),
1198                ),
1199                encoder, offset, _depth
1200            )
1201        }
1202    }
1203    unsafe impl<
1204            D: fidl::encoding::ResourceDialect,
1205            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<2083>, D>,
1206            T1: fidl::encoding::Encode<CrashReportingProduct, D>,
1207        > fidl::encoding::Encode<CrashReportingProductRegisterUpsertRequest, D> for (T0, T1)
1208    {
1209        #[inline]
1210        unsafe fn encode(
1211            self,
1212            encoder: &mut fidl::encoding::Encoder<'_, D>,
1213            offset: usize,
1214            depth: fidl::encoding::Depth,
1215        ) -> fidl::Result<()> {
1216            encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertRequest>(offset);
1217            // Zero out padding regions. There's no need to apply masks
1218            // because the unmasked parts will be overwritten by fields.
1219            // Write the fields.
1220            self.0.encode(encoder, offset + 0, depth)?;
1221            self.1.encode(encoder, offset + 16, depth)?;
1222            Ok(())
1223        }
1224    }
1225
1226    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1227        for CrashReportingProductRegisterUpsertRequest
1228    {
1229        #[inline(always)]
1230        fn new_empty() -> Self {
1231            Self {
1232                component_url: fidl::new_empty!(fidl::encoding::BoundedString<2083>, D),
1233                product: fidl::new_empty!(CrashReportingProduct, D),
1234            }
1235        }
1236
1237        #[inline]
1238        unsafe fn decode(
1239            &mut self,
1240            decoder: &mut fidl::encoding::Decoder<'_, D>,
1241            offset: usize,
1242            _depth: fidl::encoding::Depth,
1243        ) -> fidl::Result<()> {
1244            decoder.debug_check_bounds::<Self>(offset);
1245            // Verify that padding bytes are zero.
1246            fidl::decode!(
1247                fidl::encoding::BoundedString<2083>,
1248                D,
1249                &mut self.component_url,
1250                decoder,
1251                offset + 0,
1252                _depth
1253            )?;
1254            fidl::decode!(
1255                CrashReportingProduct,
1256                D,
1257                &mut self.product,
1258                decoder,
1259                offset + 16,
1260                _depth
1261            )?;
1262            Ok(())
1263        }
1264    }
1265
1266    impl fidl::encoding::ValueTypeMarker for CrashReportingProductRegisterUpsertWithAckRequest {
1267        type Borrowed<'a> = &'a Self;
1268        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1269            value
1270        }
1271    }
1272
1273    unsafe impl fidl::encoding::TypeMarker for CrashReportingProductRegisterUpsertWithAckRequest {
1274        type Owned = Self;
1275
1276        #[inline(always)]
1277        fn inline_align(_context: fidl::encoding::Context) -> usize {
1278            8
1279        }
1280
1281        #[inline(always)]
1282        fn inline_size(_context: fidl::encoding::Context) -> usize {
1283            32
1284        }
1285    }
1286
1287    unsafe impl<D: fidl::encoding::ResourceDialect>
1288        fidl::encoding::Encode<CrashReportingProductRegisterUpsertWithAckRequest, D>
1289        for &CrashReportingProductRegisterUpsertWithAckRequest
1290    {
1291        #[inline]
1292        unsafe fn encode(
1293            self,
1294            encoder: &mut fidl::encoding::Encoder<'_, D>,
1295            offset: usize,
1296            _depth: fidl::encoding::Depth,
1297        ) -> fidl::Result<()> {
1298            encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertWithAckRequest>(offset);
1299            // Delegate to tuple encoding.
1300            fidl::encoding::Encode::<CrashReportingProductRegisterUpsertWithAckRequest, D>::encode(
1301                (
1302                    <fidl::encoding::BoundedString<2083> as fidl::encoding::ValueTypeMarker>::borrow(&self.component_url),
1303                    <CrashReportingProduct as fidl::encoding::ValueTypeMarker>::borrow(&self.product),
1304                ),
1305                encoder, offset, _depth
1306            )
1307        }
1308    }
1309    unsafe impl<
1310            D: fidl::encoding::ResourceDialect,
1311            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<2083>, D>,
1312            T1: fidl::encoding::Encode<CrashReportingProduct, D>,
1313        > fidl::encoding::Encode<CrashReportingProductRegisterUpsertWithAckRequest, D>
1314        for (T0, T1)
1315    {
1316        #[inline]
1317        unsafe fn encode(
1318            self,
1319            encoder: &mut fidl::encoding::Encoder<'_, D>,
1320            offset: usize,
1321            depth: fidl::encoding::Depth,
1322        ) -> fidl::Result<()> {
1323            encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertWithAckRequest>(offset);
1324            // Zero out padding regions. There's no need to apply masks
1325            // because the unmasked parts will be overwritten by fields.
1326            // Write the fields.
1327            self.0.encode(encoder, offset + 0, depth)?;
1328            self.1.encode(encoder, offset + 16, depth)?;
1329            Ok(())
1330        }
1331    }
1332
1333    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1334        for CrashReportingProductRegisterUpsertWithAckRequest
1335    {
1336        #[inline(always)]
1337        fn new_empty() -> Self {
1338            Self {
1339                component_url: fidl::new_empty!(fidl::encoding::BoundedString<2083>, D),
1340                product: fidl::new_empty!(CrashReportingProduct, D),
1341            }
1342        }
1343
1344        #[inline]
1345        unsafe fn decode(
1346            &mut self,
1347            decoder: &mut fidl::encoding::Decoder<'_, D>,
1348            offset: usize,
1349            _depth: fidl::encoding::Depth,
1350        ) -> fidl::Result<()> {
1351            decoder.debug_check_bounds::<Self>(offset);
1352            // Verify that padding bytes are zero.
1353            fidl::decode!(
1354                fidl::encoding::BoundedString<2083>,
1355                D,
1356                &mut self.component_url,
1357                decoder,
1358                offset + 0,
1359                _depth
1360            )?;
1361            fidl::decode!(
1362                CrashReportingProduct,
1363                D,
1364                &mut self.product,
1365                decoder,
1366                offset + 16,
1367                _depth
1368            )?;
1369            Ok(())
1370        }
1371    }
1372
1373    impl fidl::encoding::ValueTypeMarker for DataProviderGetAnnotationsRequest {
1374        type Borrowed<'a> = &'a Self;
1375        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1376            value
1377        }
1378    }
1379
1380    unsafe impl fidl::encoding::TypeMarker for DataProviderGetAnnotationsRequest {
1381        type Owned = Self;
1382
1383        #[inline(always)]
1384        fn inline_align(_context: fidl::encoding::Context) -> usize {
1385            8
1386        }
1387
1388        #[inline(always)]
1389        fn inline_size(_context: fidl::encoding::Context) -> usize {
1390            16
1391        }
1392    }
1393
1394    unsafe impl<D: fidl::encoding::ResourceDialect>
1395        fidl::encoding::Encode<DataProviderGetAnnotationsRequest, D>
1396        for &DataProviderGetAnnotationsRequest
1397    {
1398        #[inline]
1399        unsafe fn encode(
1400            self,
1401            encoder: &mut fidl::encoding::Encoder<'_, D>,
1402            offset: usize,
1403            _depth: fidl::encoding::Depth,
1404        ) -> fidl::Result<()> {
1405            encoder.debug_check_bounds::<DataProviderGetAnnotationsRequest>(offset);
1406            // Delegate to tuple encoding.
1407            fidl::encoding::Encode::<DataProviderGetAnnotationsRequest, D>::encode(
1408                (<GetAnnotationsParameters as fidl::encoding::ValueTypeMarker>::borrow(
1409                    &self.params,
1410                ),),
1411                encoder,
1412                offset,
1413                _depth,
1414            )
1415        }
1416    }
1417    unsafe impl<
1418            D: fidl::encoding::ResourceDialect,
1419            T0: fidl::encoding::Encode<GetAnnotationsParameters, D>,
1420        > fidl::encoding::Encode<DataProviderGetAnnotationsRequest, D> for (T0,)
1421    {
1422        #[inline]
1423        unsafe fn encode(
1424            self,
1425            encoder: &mut fidl::encoding::Encoder<'_, D>,
1426            offset: usize,
1427            depth: fidl::encoding::Depth,
1428        ) -> fidl::Result<()> {
1429            encoder.debug_check_bounds::<DataProviderGetAnnotationsRequest>(offset);
1430            // Zero out padding regions. There's no need to apply masks
1431            // because the unmasked parts will be overwritten by fields.
1432            // Write the fields.
1433            self.0.encode(encoder, offset + 0, depth)?;
1434            Ok(())
1435        }
1436    }
1437
1438    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1439        for DataProviderGetAnnotationsRequest
1440    {
1441        #[inline(always)]
1442        fn new_empty() -> Self {
1443            Self { params: fidl::new_empty!(GetAnnotationsParameters, D) }
1444        }
1445
1446        #[inline]
1447        unsafe fn decode(
1448            &mut self,
1449            decoder: &mut fidl::encoding::Decoder<'_, D>,
1450            offset: usize,
1451            _depth: fidl::encoding::Depth,
1452        ) -> fidl::Result<()> {
1453            decoder.debug_check_bounds::<Self>(offset);
1454            // Verify that padding bytes are zero.
1455            fidl::decode!(
1456                GetAnnotationsParameters,
1457                D,
1458                &mut self.params,
1459                decoder,
1460                offset + 0,
1461                _depth
1462            )?;
1463            Ok(())
1464        }
1465    }
1466
1467    impl fidl::encoding::ValueTypeMarker for DataProviderGetAnnotationsResponse {
1468        type Borrowed<'a> = &'a Self;
1469        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1470            value
1471        }
1472    }
1473
1474    unsafe impl fidl::encoding::TypeMarker for DataProviderGetAnnotationsResponse {
1475        type Owned = Self;
1476
1477        #[inline(always)]
1478        fn inline_align(_context: fidl::encoding::Context) -> usize {
1479            8
1480        }
1481
1482        #[inline(always)]
1483        fn inline_size(_context: fidl::encoding::Context) -> usize {
1484            16
1485        }
1486    }
1487
1488    unsafe impl<D: fidl::encoding::ResourceDialect>
1489        fidl::encoding::Encode<DataProviderGetAnnotationsResponse, D>
1490        for &DataProviderGetAnnotationsResponse
1491    {
1492        #[inline]
1493        unsafe fn encode(
1494            self,
1495            encoder: &mut fidl::encoding::Encoder<'_, D>,
1496            offset: usize,
1497            _depth: fidl::encoding::Depth,
1498        ) -> fidl::Result<()> {
1499            encoder.debug_check_bounds::<DataProviderGetAnnotationsResponse>(offset);
1500            // Delegate to tuple encoding.
1501            fidl::encoding::Encode::<DataProviderGetAnnotationsResponse, D>::encode(
1502                (<Annotations as fidl::encoding::ValueTypeMarker>::borrow(&self.annotations),),
1503                encoder,
1504                offset,
1505                _depth,
1506            )
1507        }
1508    }
1509    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Annotations, D>>
1510        fidl::encoding::Encode<DataProviderGetAnnotationsResponse, D> for (T0,)
1511    {
1512        #[inline]
1513        unsafe fn encode(
1514            self,
1515            encoder: &mut fidl::encoding::Encoder<'_, D>,
1516            offset: usize,
1517            depth: fidl::encoding::Depth,
1518        ) -> fidl::Result<()> {
1519            encoder.debug_check_bounds::<DataProviderGetAnnotationsResponse>(offset);
1520            // Zero out padding regions. There's no need to apply masks
1521            // because the unmasked parts will be overwritten by fields.
1522            // Write the fields.
1523            self.0.encode(encoder, offset + 0, depth)?;
1524            Ok(())
1525        }
1526    }
1527
1528    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1529        for DataProviderGetAnnotationsResponse
1530    {
1531        #[inline(always)]
1532        fn new_empty() -> Self {
1533            Self { annotations: fidl::new_empty!(Annotations, D) }
1534        }
1535
1536        #[inline]
1537        unsafe fn decode(
1538            &mut self,
1539            decoder: &mut fidl::encoding::Decoder<'_, D>,
1540            offset: usize,
1541            _depth: fidl::encoding::Depth,
1542        ) -> fidl::Result<()> {
1543            decoder.debug_check_bounds::<Self>(offset);
1544            // Verify that padding bytes are zero.
1545            fidl::decode!(Annotations, D, &mut self.annotations, decoder, offset + 0, _depth)?;
1546            Ok(())
1547        }
1548    }
1549
1550    impl fidl::encoding::ValueTypeMarker for DataProviderGetScreenshotRequest {
1551        type Borrowed<'a> = &'a Self;
1552        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1553            value
1554        }
1555    }
1556
1557    unsafe impl fidl::encoding::TypeMarker for DataProviderGetScreenshotRequest {
1558        type Owned = Self;
1559
1560        #[inline(always)]
1561        fn inline_align(_context: fidl::encoding::Context) -> usize {
1562            4
1563        }
1564
1565        #[inline(always)]
1566        fn inline_size(_context: fidl::encoding::Context) -> usize {
1567            4
1568        }
1569    }
1570
1571    unsafe impl<D: fidl::encoding::ResourceDialect>
1572        fidl::encoding::Encode<DataProviderGetScreenshotRequest, D>
1573        for &DataProviderGetScreenshotRequest
1574    {
1575        #[inline]
1576        unsafe fn encode(
1577            self,
1578            encoder: &mut fidl::encoding::Encoder<'_, D>,
1579            offset: usize,
1580            _depth: fidl::encoding::Depth,
1581        ) -> fidl::Result<()> {
1582            encoder.debug_check_bounds::<DataProviderGetScreenshotRequest>(offset);
1583            // Delegate to tuple encoding.
1584            fidl::encoding::Encode::<DataProviderGetScreenshotRequest, D>::encode(
1585                (<ImageEncoding as fidl::encoding::ValueTypeMarker>::borrow(&self.encoding),),
1586                encoder,
1587                offset,
1588                _depth,
1589            )
1590        }
1591    }
1592    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ImageEncoding, D>>
1593        fidl::encoding::Encode<DataProviderGetScreenshotRequest, D> for (T0,)
1594    {
1595        #[inline]
1596        unsafe fn encode(
1597            self,
1598            encoder: &mut fidl::encoding::Encoder<'_, D>,
1599            offset: usize,
1600            depth: fidl::encoding::Depth,
1601        ) -> fidl::Result<()> {
1602            encoder.debug_check_bounds::<DataProviderGetScreenshotRequest>(offset);
1603            // Zero out padding regions. There's no need to apply masks
1604            // because the unmasked parts will be overwritten by fields.
1605            // Write the fields.
1606            self.0.encode(encoder, offset + 0, depth)?;
1607            Ok(())
1608        }
1609    }
1610
1611    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1612        for DataProviderGetScreenshotRequest
1613    {
1614        #[inline(always)]
1615        fn new_empty() -> Self {
1616            Self { encoding: fidl::new_empty!(ImageEncoding, D) }
1617        }
1618
1619        #[inline]
1620        unsafe fn decode(
1621            &mut self,
1622            decoder: &mut fidl::encoding::Decoder<'_, D>,
1623            offset: usize,
1624            _depth: fidl::encoding::Depth,
1625        ) -> fidl::Result<()> {
1626            decoder.debug_check_bounds::<Self>(offset);
1627            // Verify that padding bytes are zero.
1628            fidl::decode!(ImageEncoding, D, &mut self.encoding, decoder, offset + 0, _depth)?;
1629            Ok(())
1630        }
1631    }
1632
1633    impl fidl::encoding::ValueTypeMarker for DeviceIdProviderGetIdResponse {
1634        type Borrowed<'a> = &'a Self;
1635        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1636            value
1637        }
1638    }
1639
1640    unsafe impl fidl::encoding::TypeMarker for DeviceIdProviderGetIdResponse {
1641        type Owned = Self;
1642
1643        #[inline(always)]
1644        fn inline_align(_context: fidl::encoding::Context) -> usize {
1645            8
1646        }
1647
1648        #[inline(always)]
1649        fn inline_size(_context: fidl::encoding::Context) -> usize {
1650            16
1651        }
1652    }
1653
1654    unsafe impl<D: fidl::encoding::ResourceDialect>
1655        fidl::encoding::Encode<DeviceIdProviderGetIdResponse, D>
1656        for &DeviceIdProviderGetIdResponse
1657    {
1658        #[inline]
1659        unsafe fn encode(
1660            self,
1661            encoder: &mut fidl::encoding::Encoder<'_, D>,
1662            offset: usize,
1663            _depth: fidl::encoding::Depth,
1664        ) -> fidl::Result<()> {
1665            encoder.debug_check_bounds::<DeviceIdProviderGetIdResponse>(offset);
1666            // Delegate to tuple encoding.
1667            fidl::encoding::Encode::<DeviceIdProviderGetIdResponse, D>::encode(
1668                (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
1669                    &self.feedback_id,
1670                ),),
1671                encoder,
1672                offset,
1673                _depth,
1674            )
1675        }
1676    }
1677    unsafe impl<
1678            D: fidl::encoding::ResourceDialect,
1679            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
1680        > fidl::encoding::Encode<DeviceIdProviderGetIdResponse, D> for (T0,)
1681    {
1682        #[inline]
1683        unsafe fn encode(
1684            self,
1685            encoder: &mut fidl::encoding::Encoder<'_, D>,
1686            offset: usize,
1687            depth: fidl::encoding::Depth,
1688        ) -> fidl::Result<()> {
1689            encoder.debug_check_bounds::<DeviceIdProviderGetIdResponse>(offset);
1690            // Zero out padding regions. There's no need to apply masks
1691            // because the unmasked parts will be overwritten by fields.
1692            // Write the fields.
1693            self.0.encode(encoder, offset + 0, depth)?;
1694            Ok(())
1695        }
1696    }
1697
1698    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1699        for DeviceIdProviderGetIdResponse
1700    {
1701        #[inline(always)]
1702        fn new_empty() -> Self {
1703            Self { feedback_id: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
1704        }
1705
1706        #[inline]
1707        unsafe fn decode(
1708            &mut self,
1709            decoder: &mut fidl::encoding::Decoder<'_, D>,
1710            offset: usize,
1711            _depth: fidl::encoding::Depth,
1712        ) -> fidl::Result<()> {
1713            decoder.debug_check_bounds::<Self>(offset);
1714            // Verify that padding bytes are zero.
1715            fidl::decode!(
1716                fidl::encoding::BoundedString<64>,
1717                D,
1718                &mut self.feedback_id,
1719                decoder,
1720                offset + 0,
1721                _depth
1722            )?;
1723            Ok(())
1724        }
1725    }
1726
1727    impl fidl::encoding::ValueTypeMarker for LastRebootInfoProviderGetResponse {
1728        type Borrowed<'a> = &'a Self;
1729        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1730            value
1731        }
1732    }
1733
1734    unsafe impl fidl::encoding::TypeMarker for LastRebootInfoProviderGetResponse {
1735        type Owned = Self;
1736
1737        #[inline(always)]
1738        fn inline_align(_context: fidl::encoding::Context) -> usize {
1739            8
1740        }
1741
1742        #[inline(always)]
1743        fn inline_size(_context: fidl::encoding::Context) -> usize {
1744            16
1745        }
1746    }
1747
1748    unsafe impl<D: fidl::encoding::ResourceDialect>
1749        fidl::encoding::Encode<LastRebootInfoProviderGetResponse, D>
1750        for &LastRebootInfoProviderGetResponse
1751    {
1752        #[inline]
1753        unsafe fn encode(
1754            self,
1755            encoder: &mut fidl::encoding::Encoder<'_, D>,
1756            offset: usize,
1757            _depth: fidl::encoding::Depth,
1758        ) -> fidl::Result<()> {
1759            encoder.debug_check_bounds::<LastRebootInfoProviderGetResponse>(offset);
1760            // Delegate to tuple encoding.
1761            fidl::encoding::Encode::<LastRebootInfoProviderGetResponse, D>::encode(
1762                (<LastReboot as fidl::encoding::ValueTypeMarker>::borrow(&self.last_reboot),),
1763                encoder,
1764                offset,
1765                _depth,
1766            )
1767        }
1768    }
1769    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LastReboot, D>>
1770        fidl::encoding::Encode<LastRebootInfoProviderGetResponse, D> for (T0,)
1771    {
1772        #[inline]
1773        unsafe fn encode(
1774            self,
1775            encoder: &mut fidl::encoding::Encoder<'_, D>,
1776            offset: usize,
1777            depth: fidl::encoding::Depth,
1778        ) -> fidl::Result<()> {
1779            encoder.debug_check_bounds::<LastRebootInfoProviderGetResponse>(offset);
1780            // Zero out padding regions. There's no need to apply masks
1781            // because the unmasked parts will be overwritten by fields.
1782            // Write the fields.
1783            self.0.encode(encoder, offset + 0, depth)?;
1784            Ok(())
1785        }
1786    }
1787
1788    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1789        for LastRebootInfoProviderGetResponse
1790    {
1791        #[inline(always)]
1792        fn new_empty() -> Self {
1793            Self { last_reboot: fidl::new_empty!(LastReboot, D) }
1794        }
1795
1796        #[inline]
1797        unsafe fn decode(
1798            &mut self,
1799            decoder: &mut fidl::encoding::Decoder<'_, D>,
1800            offset: usize,
1801            _depth: fidl::encoding::Depth,
1802        ) -> fidl::Result<()> {
1803            decoder.debug_check_bounds::<Self>(offset);
1804            // Verify that padding bytes are zero.
1805            fidl::decode!(LastReboot, D, &mut self.last_reboot, decoder, offset + 0, _depth)?;
1806            Ok(())
1807        }
1808    }
1809
1810    impl Annotations {
1811        #[inline(always)]
1812        fn max_ordinal_present(&self) -> u64 {
1813            if let Some(_) = self.annotations2 {
1814                return 2;
1815            }
1816            if let Some(_) = self.annotations {
1817                return 1;
1818            }
1819            0
1820        }
1821    }
1822
1823    impl fidl::encoding::ValueTypeMarker for Annotations {
1824        type Borrowed<'a> = &'a Self;
1825        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1826            value
1827        }
1828    }
1829
1830    unsafe impl fidl::encoding::TypeMarker for Annotations {
1831        type Owned = Self;
1832
1833        #[inline(always)]
1834        fn inline_align(_context: fidl::encoding::Context) -> usize {
1835            8
1836        }
1837
1838        #[inline(always)]
1839        fn inline_size(_context: fidl::encoding::Context) -> usize {
1840            16
1841        }
1842    }
1843
1844    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Annotations, D>
1845        for &Annotations
1846    {
1847        unsafe fn encode(
1848            self,
1849            encoder: &mut fidl::encoding::Encoder<'_, D>,
1850            offset: usize,
1851            mut depth: fidl::encoding::Depth,
1852        ) -> fidl::Result<()> {
1853            encoder.debug_check_bounds::<Annotations>(offset);
1854            // Vector header
1855            let max_ordinal: u64 = self.max_ordinal_present();
1856            encoder.write_num(max_ordinal, offset);
1857            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1858            // Calling encoder.out_of_line_offset(0) is not allowed.
1859            if max_ordinal == 0 {
1860                return Ok(());
1861            }
1862            depth.increment()?;
1863            let envelope_size = 8;
1864            let bytes_len = max_ordinal as usize * envelope_size;
1865            #[allow(unused_variables)]
1866            let offset = encoder.out_of_line_offset(bytes_len);
1867            let mut _prev_end_offset: usize = 0;
1868            if 1 > max_ordinal {
1869                return Ok(());
1870            }
1871
1872            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1873            // are envelope_size bytes.
1874            let cur_offset: usize = (1 - 1) * envelope_size;
1875
1876            // Zero reserved fields.
1877            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1878
1879            // Safety:
1880            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1881            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1882            //   envelope_size bytes, there is always sufficient room.
1883            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 64>, D>(
1884            self.annotations.as_ref().map(<fidl::encoding::Vector<Annotation, 64> as fidl::encoding::ValueTypeMarker>::borrow),
1885            encoder, offset + cur_offset, depth
1886        )?;
1887
1888            _prev_end_offset = cur_offset + envelope_size;
1889            if 2 > max_ordinal {
1890                return Ok(());
1891            }
1892
1893            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1894            // are envelope_size bytes.
1895            let cur_offset: usize = (2 - 1) * envelope_size;
1896
1897            // Zero reserved fields.
1898            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1899
1900            // Safety:
1901            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1902            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1903            //   envelope_size bytes, there is always sufficient room.
1904            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 512>, D>(
1905            self.annotations2.as_ref().map(<fidl::encoding::Vector<Annotation, 512> as fidl::encoding::ValueTypeMarker>::borrow),
1906            encoder, offset + cur_offset, depth
1907        )?;
1908
1909            _prev_end_offset = cur_offset + envelope_size;
1910
1911            Ok(())
1912        }
1913    }
1914
1915    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Annotations {
1916        #[inline(always)]
1917        fn new_empty() -> Self {
1918            Self::default()
1919        }
1920
1921        unsafe fn decode(
1922            &mut self,
1923            decoder: &mut fidl::encoding::Decoder<'_, D>,
1924            offset: usize,
1925            mut depth: fidl::encoding::Depth,
1926        ) -> fidl::Result<()> {
1927            decoder.debug_check_bounds::<Self>(offset);
1928            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1929                None => return Err(fidl::Error::NotNullable),
1930                Some(len) => len,
1931            };
1932            // Calling decoder.out_of_line_offset(0) is not allowed.
1933            if len == 0 {
1934                return Ok(());
1935            };
1936            depth.increment()?;
1937            let envelope_size = 8;
1938            let bytes_len = len * envelope_size;
1939            let offset = decoder.out_of_line_offset(bytes_len)?;
1940            // Decode the envelope for each type.
1941            let mut _next_ordinal_to_read = 0;
1942            let mut next_offset = offset;
1943            let end_offset = offset + bytes_len;
1944            _next_ordinal_to_read += 1;
1945            if next_offset >= end_offset {
1946                return Ok(());
1947            }
1948
1949            // Decode unknown envelopes for gaps in ordinals.
1950            while _next_ordinal_to_read < 1 {
1951                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1952                _next_ordinal_to_read += 1;
1953                next_offset += envelope_size;
1954            }
1955
1956            let next_out_of_line = decoder.next_out_of_line();
1957            let handles_before = decoder.remaining_handles();
1958            if let Some((inlined, num_bytes, num_handles)) =
1959                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1960            {
1961                let member_inline_size = <fidl::encoding::Vector<Annotation, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1962                if inlined != (member_inline_size <= 4) {
1963                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1964                }
1965                let inner_offset;
1966                let mut inner_depth = depth.clone();
1967                if inlined {
1968                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1969                    inner_offset = next_offset;
1970                } else {
1971                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1972                    inner_depth.increment()?;
1973                }
1974                let val_ref = self.annotations.get_or_insert_with(
1975                    || fidl::new_empty!(fidl::encoding::Vector<Annotation, 64>, D),
1976                );
1977                fidl::decode!(fidl::encoding::Vector<Annotation, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
1978                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1979                {
1980                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1981                }
1982                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1983                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1984                }
1985            }
1986
1987            next_offset += envelope_size;
1988            _next_ordinal_to_read += 1;
1989            if next_offset >= end_offset {
1990                return Ok(());
1991            }
1992
1993            // Decode unknown envelopes for gaps in ordinals.
1994            while _next_ordinal_to_read < 2 {
1995                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1996                _next_ordinal_to_read += 1;
1997                next_offset += envelope_size;
1998            }
1999
2000            let next_out_of_line = decoder.next_out_of_line();
2001            let handles_before = decoder.remaining_handles();
2002            if let Some((inlined, num_bytes, num_handles)) =
2003                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2004            {
2005                let member_inline_size = <fidl::encoding::Vector<Annotation, 512> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2006                if inlined != (member_inline_size <= 4) {
2007                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2008                }
2009                let inner_offset;
2010                let mut inner_depth = depth.clone();
2011                if inlined {
2012                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2013                    inner_offset = next_offset;
2014                } else {
2015                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2016                    inner_depth.increment()?;
2017                }
2018                let val_ref = self.annotations2.get_or_insert_with(
2019                    || fidl::new_empty!(fidl::encoding::Vector<Annotation, 512>, D),
2020                );
2021                fidl::decode!(fidl::encoding::Vector<Annotation, 512>, D, val_ref, decoder, inner_offset, inner_depth)?;
2022                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2023                {
2024                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2025                }
2026                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2027                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2028                }
2029            }
2030
2031            next_offset += envelope_size;
2032
2033            // Decode the remaining unknown envelopes.
2034            while next_offset < end_offset {
2035                _next_ordinal_to_read += 1;
2036                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2037                next_offset += envelope_size;
2038            }
2039
2040            Ok(())
2041        }
2042    }
2043
2044    impl ComponentData {
2045        #[inline(always)]
2046        fn max_ordinal_present(&self) -> u64 {
2047            if let Some(_) = self.annotations {
2048                return 2;
2049            }
2050            if let Some(_) = self.namespace {
2051                return 1;
2052            }
2053            0
2054        }
2055    }
2056
2057    impl fidl::encoding::ValueTypeMarker for ComponentData {
2058        type Borrowed<'a> = &'a Self;
2059        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2060            value
2061        }
2062    }
2063
2064    unsafe impl fidl::encoding::TypeMarker for ComponentData {
2065        type Owned = Self;
2066
2067        #[inline(always)]
2068        fn inline_align(_context: fidl::encoding::Context) -> usize {
2069            8
2070        }
2071
2072        #[inline(always)]
2073        fn inline_size(_context: fidl::encoding::Context) -> usize {
2074            16
2075        }
2076    }
2077
2078    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ComponentData, D>
2079        for &ComponentData
2080    {
2081        unsafe fn encode(
2082            self,
2083            encoder: &mut fidl::encoding::Encoder<'_, D>,
2084            offset: usize,
2085            mut depth: fidl::encoding::Depth,
2086        ) -> fidl::Result<()> {
2087            encoder.debug_check_bounds::<ComponentData>(offset);
2088            // Vector header
2089            let max_ordinal: u64 = self.max_ordinal_present();
2090            encoder.write_num(max_ordinal, offset);
2091            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2092            // Calling encoder.out_of_line_offset(0) is not allowed.
2093            if max_ordinal == 0 {
2094                return Ok(());
2095            }
2096            depth.increment()?;
2097            let envelope_size = 8;
2098            let bytes_len = max_ordinal as usize * envelope_size;
2099            #[allow(unused_variables)]
2100            let offset = encoder.out_of_line_offset(bytes_len);
2101            let mut _prev_end_offset: usize = 0;
2102            if 1 > max_ordinal {
2103                return Ok(());
2104            }
2105
2106            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2107            // are envelope_size bytes.
2108            let cur_offset: usize = (1 - 1) * envelope_size;
2109
2110            // Zero reserved fields.
2111            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2112
2113            // Safety:
2114            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2115            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2116            //   envelope_size bytes, there is always sufficient room.
2117            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<32>, D>(
2118                self.namespace.as_ref().map(
2119                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
2120                ),
2121                encoder,
2122                offset + cur_offset,
2123                depth,
2124            )?;
2125
2126            _prev_end_offset = cur_offset + envelope_size;
2127            if 2 > max_ordinal {
2128                return Ok(());
2129            }
2130
2131            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2132            // are envelope_size bytes.
2133            let cur_offset: usize = (2 - 1) * envelope_size;
2134
2135            // Zero reserved fields.
2136            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2137
2138            // Safety:
2139            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2140            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2141            //   envelope_size bytes, there is always sufficient room.
2142            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 16>, D>(
2143            self.annotations.as_ref().map(<fidl::encoding::Vector<Annotation, 16> as fidl::encoding::ValueTypeMarker>::borrow),
2144            encoder, offset + cur_offset, depth
2145        )?;
2146
2147            _prev_end_offset = cur_offset + envelope_size;
2148
2149            Ok(())
2150        }
2151    }
2152
2153    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ComponentData {
2154        #[inline(always)]
2155        fn new_empty() -> Self {
2156            Self::default()
2157        }
2158
2159        unsafe fn decode(
2160            &mut self,
2161            decoder: &mut fidl::encoding::Decoder<'_, D>,
2162            offset: usize,
2163            mut depth: fidl::encoding::Depth,
2164        ) -> fidl::Result<()> {
2165            decoder.debug_check_bounds::<Self>(offset);
2166            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2167                None => return Err(fidl::Error::NotNullable),
2168                Some(len) => len,
2169            };
2170            // Calling decoder.out_of_line_offset(0) is not allowed.
2171            if len == 0 {
2172                return Ok(());
2173            };
2174            depth.increment()?;
2175            let envelope_size = 8;
2176            let bytes_len = len * envelope_size;
2177            let offset = decoder.out_of_line_offset(bytes_len)?;
2178            // Decode the envelope for each type.
2179            let mut _next_ordinal_to_read = 0;
2180            let mut next_offset = offset;
2181            let end_offset = offset + bytes_len;
2182            _next_ordinal_to_read += 1;
2183            if next_offset >= end_offset {
2184                return Ok(());
2185            }
2186
2187            // Decode unknown envelopes for gaps in ordinals.
2188            while _next_ordinal_to_read < 1 {
2189                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2190                _next_ordinal_to_read += 1;
2191                next_offset += envelope_size;
2192            }
2193
2194            let next_out_of_line = decoder.next_out_of_line();
2195            let handles_before = decoder.remaining_handles();
2196            if let Some((inlined, num_bytes, num_handles)) =
2197                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2198            {
2199                let member_inline_size =
2200                    <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
2201                        decoder.context,
2202                    );
2203                if inlined != (member_inline_size <= 4) {
2204                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2205                }
2206                let inner_offset;
2207                let mut inner_depth = depth.clone();
2208                if inlined {
2209                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2210                    inner_offset = next_offset;
2211                } else {
2212                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2213                    inner_depth.increment()?;
2214                }
2215                let val_ref = self
2216                    .namespace
2217                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<32>, D));
2218                fidl::decode!(
2219                    fidl::encoding::BoundedString<32>,
2220                    D,
2221                    val_ref,
2222                    decoder,
2223                    inner_offset,
2224                    inner_depth
2225                )?;
2226                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2227                {
2228                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2229                }
2230                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2231                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2232                }
2233            }
2234
2235            next_offset += envelope_size;
2236            _next_ordinal_to_read += 1;
2237            if next_offset >= end_offset {
2238                return Ok(());
2239            }
2240
2241            // Decode unknown envelopes for gaps in ordinals.
2242            while _next_ordinal_to_read < 2 {
2243                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2244                _next_ordinal_to_read += 1;
2245                next_offset += envelope_size;
2246            }
2247
2248            let next_out_of_line = decoder.next_out_of_line();
2249            let handles_before = decoder.remaining_handles();
2250            if let Some((inlined, num_bytes, num_handles)) =
2251                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2252            {
2253                let member_inline_size = <fidl::encoding::Vector<Annotation, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2254                if inlined != (member_inline_size <= 4) {
2255                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2256                }
2257                let inner_offset;
2258                let mut inner_depth = depth.clone();
2259                if inlined {
2260                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2261                    inner_offset = next_offset;
2262                } else {
2263                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2264                    inner_depth.increment()?;
2265                }
2266                let val_ref = self.annotations.get_or_insert_with(
2267                    || fidl::new_empty!(fidl::encoding::Vector<Annotation, 16>, D),
2268                );
2269                fidl::decode!(fidl::encoding::Vector<Annotation, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
2270                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2271                {
2272                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2273                }
2274                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2275                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2276                }
2277            }
2278
2279            next_offset += envelope_size;
2280
2281            // Decode the remaining unknown envelopes.
2282            while next_offset < end_offset {
2283                _next_ordinal_to_read += 1;
2284                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2285                next_offset += envelope_size;
2286            }
2287
2288            Ok(())
2289        }
2290    }
2291
2292    impl CrashReportingProduct {
2293        #[inline(always)]
2294        fn max_ordinal_present(&self) -> u64 {
2295            if let Some(_) = self.channel {
2296                return 3;
2297            }
2298            if let Some(_) = self.version {
2299                return 2;
2300            }
2301            if let Some(_) = self.name {
2302                return 1;
2303            }
2304            0
2305        }
2306    }
2307
2308    impl fidl::encoding::ValueTypeMarker for CrashReportingProduct {
2309        type Borrowed<'a> = &'a Self;
2310        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2311            value
2312        }
2313    }
2314
2315    unsafe impl fidl::encoding::TypeMarker for CrashReportingProduct {
2316        type Owned = Self;
2317
2318        #[inline(always)]
2319        fn inline_align(_context: fidl::encoding::Context) -> usize {
2320            8
2321        }
2322
2323        #[inline(always)]
2324        fn inline_size(_context: fidl::encoding::Context) -> usize {
2325            16
2326        }
2327    }
2328
2329    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CrashReportingProduct, D>
2330        for &CrashReportingProduct
2331    {
2332        unsafe fn encode(
2333            self,
2334            encoder: &mut fidl::encoding::Encoder<'_, D>,
2335            offset: usize,
2336            mut depth: fidl::encoding::Depth,
2337        ) -> fidl::Result<()> {
2338            encoder.debug_check_bounds::<CrashReportingProduct>(offset);
2339            // Vector header
2340            let max_ordinal: u64 = self.max_ordinal_present();
2341            encoder.write_num(max_ordinal, offset);
2342            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2343            // Calling encoder.out_of_line_offset(0) is not allowed.
2344            if max_ordinal == 0 {
2345                return Ok(());
2346            }
2347            depth.increment()?;
2348            let envelope_size = 8;
2349            let bytes_len = max_ordinal as usize * envelope_size;
2350            #[allow(unused_variables)]
2351            let offset = encoder.out_of_line_offset(bytes_len);
2352            let mut _prev_end_offset: usize = 0;
2353            if 1 > max_ordinal {
2354                return Ok(());
2355            }
2356
2357            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2358            // are envelope_size bytes.
2359            let cur_offset: usize = (1 - 1) * envelope_size;
2360
2361            // Zero reserved fields.
2362            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2363
2364            // Safety:
2365            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2366            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2367            //   envelope_size bytes, there is always sufficient room.
2368            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2369                self.name.as_ref().map(
2370                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2371                ),
2372                encoder,
2373                offset + cur_offset,
2374                depth,
2375            )?;
2376
2377            _prev_end_offset = cur_offset + envelope_size;
2378            if 2 > max_ordinal {
2379                return Ok(());
2380            }
2381
2382            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2383            // are envelope_size bytes.
2384            let cur_offset: usize = (2 - 1) * envelope_size;
2385
2386            // Zero reserved fields.
2387            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2388
2389            // Safety:
2390            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2391            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2392            //   envelope_size bytes, there is always sufficient room.
2393            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2394                self.version.as_ref().map(
2395                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2396                ),
2397                encoder,
2398                offset + cur_offset,
2399                depth,
2400            )?;
2401
2402            _prev_end_offset = cur_offset + envelope_size;
2403            if 3 > max_ordinal {
2404                return Ok(());
2405            }
2406
2407            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2408            // are envelope_size bytes.
2409            let cur_offset: usize = (3 - 1) * envelope_size;
2410
2411            // Zero reserved fields.
2412            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2413
2414            // Safety:
2415            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2416            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2417            //   envelope_size bytes, there is always sufficient room.
2418            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2419                self.channel.as_ref().map(
2420                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2421                ),
2422                encoder,
2423                offset + cur_offset,
2424                depth,
2425            )?;
2426
2427            _prev_end_offset = cur_offset + envelope_size;
2428
2429            Ok(())
2430        }
2431    }
2432
2433    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CrashReportingProduct {
2434        #[inline(always)]
2435        fn new_empty() -> Self {
2436            Self::default()
2437        }
2438
2439        unsafe fn decode(
2440            &mut self,
2441            decoder: &mut fidl::encoding::Decoder<'_, D>,
2442            offset: usize,
2443            mut depth: fidl::encoding::Depth,
2444        ) -> fidl::Result<()> {
2445            decoder.debug_check_bounds::<Self>(offset);
2446            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2447                None => return Err(fidl::Error::NotNullable),
2448                Some(len) => len,
2449            };
2450            // Calling decoder.out_of_line_offset(0) is not allowed.
2451            if len == 0 {
2452                return Ok(());
2453            };
2454            depth.increment()?;
2455            let envelope_size = 8;
2456            let bytes_len = len * envelope_size;
2457            let offset = decoder.out_of_line_offset(bytes_len)?;
2458            // Decode the envelope for each type.
2459            let mut _next_ordinal_to_read = 0;
2460            let mut next_offset = offset;
2461            let end_offset = offset + bytes_len;
2462            _next_ordinal_to_read += 1;
2463            if next_offset >= end_offset {
2464                return Ok(());
2465            }
2466
2467            // Decode unknown envelopes for gaps in ordinals.
2468            while _next_ordinal_to_read < 1 {
2469                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2470                _next_ordinal_to_read += 1;
2471                next_offset += envelope_size;
2472            }
2473
2474            let next_out_of_line = decoder.next_out_of_line();
2475            let handles_before = decoder.remaining_handles();
2476            if let Some((inlined, num_bytes, num_handles)) =
2477                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2478            {
2479                let member_inline_size =
2480                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2481                        decoder.context,
2482                    );
2483                if inlined != (member_inline_size <= 4) {
2484                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2485                }
2486                let inner_offset;
2487                let mut inner_depth = depth.clone();
2488                if inlined {
2489                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2490                    inner_offset = next_offset;
2491                } else {
2492                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2493                    inner_depth.increment()?;
2494                }
2495                let val_ref = self
2496                    .name
2497                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2498                fidl::decode!(
2499                    fidl::encoding::UnboundedString,
2500                    D,
2501                    val_ref,
2502                    decoder,
2503                    inner_offset,
2504                    inner_depth
2505                )?;
2506                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2507                {
2508                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2509                }
2510                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2511                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2512                }
2513            }
2514
2515            next_offset += envelope_size;
2516            _next_ordinal_to_read += 1;
2517            if next_offset >= end_offset {
2518                return Ok(());
2519            }
2520
2521            // Decode unknown envelopes for gaps in ordinals.
2522            while _next_ordinal_to_read < 2 {
2523                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2524                _next_ordinal_to_read += 1;
2525                next_offset += envelope_size;
2526            }
2527
2528            let next_out_of_line = decoder.next_out_of_line();
2529            let handles_before = decoder.remaining_handles();
2530            if let Some((inlined, num_bytes, num_handles)) =
2531                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2532            {
2533                let member_inline_size =
2534                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2535                        decoder.context,
2536                    );
2537                if inlined != (member_inline_size <= 4) {
2538                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2539                }
2540                let inner_offset;
2541                let mut inner_depth = depth.clone();
2542                if inlined {
2543                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2544                    inner_offset = next_offset;
2545                } else {
2546                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2547                    inner_depth.increment()?;
2548                }
2549                let val_ref = self
2550                    .version
2551                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2552                fidl::decode!(
2553                    fidl::encoding::UnboundedString,
2554                    D,
2555                    val_ref,
2556                    decoder,
2557                    inner_offset,
2558                    inner_depth
2559                )?;
2560                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2561                {
2562                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2563                }
2564                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2565                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2566                }
2567            }
2568
2569            next_offset += envelope_size;
2570            _next_ordinal_to_read += 1;
2571            if next_offset >= end_offset {
2572                return Ok(());
2573            }
2574
2575            // Decode unknown envelopes for gaps in ordinals.
2576            while _next_ordinal_to_read < 3 {
2577                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2578                _next_ordinal_to_read += 1;
2579                next_offset += envelope_size;
2580            }
2581
2582            let next_out_of_line = decoder.next_out_of_line();
2583            let handles_before = decoder.remaining_handles();
2584            if let Some((inlined, num_bytes, num_handles)) =
2585                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2586            {
2587                let member_inline_size =
2588                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2589                        decoder.context,
2590                    );
2591                if inlined != (member_inline_size <= 4) {
2592                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2593                }
2594                let inner_offset;
2595                let mut inner_depth = depth.clone();
2596                if inlined {
2597                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2598                    inner_offset = next_offset;
2599                } else {
2600                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2601                    inner_depth.increment()?;
2602                }
2603                let val_ref = self
2604                    .channel
2605                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2606                fidl::decode!(
2607                    fidl::encoding::UnboundedString,
2608                    D,
2609                    val_ref,
2610                    decoder,
2611                    inner_offset,
2612                    inner_depth
2613                )?;
2614                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2615                {
2616                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2617                }
2618                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2619                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2620                }
2621            }
2622
2623            next_offset += envelope_size;
2624
2625            // Decode the remaining unknown envelopes.
2626            while next_offset < end_offset {
2627                _next_ordinal_to_read += 1;
2628                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2629                next_offset += envelope_size;
2630            }
2631
2632            Ok(())
2633        }
2634    }
2635
2636    impl FileReportResults {
2637        #[inline(always)]
2638        fn max_ordinal_present(&self) -> u64 {
2639            if let Some(_) = self.report_id {
2640                return 2;
2641            }
2642            if let Some(_) = self.result {
2643                return 1;
2644            }
2645            0
2646        }
2647    }
2648
2649    impl fidl::encoding::ValueTypeMarker for FileReportResults {
2650        type Borrowed<'a> = &'a Self;
2651        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2652            value
2653        }
2654    }
2655
2656    unsafe impl fidl::encoding::TypeMarker for FileReportResults {
2657        type Owned = Self;
2658
2659        #[inline(always)]
2660        fn inline_align(_context: fidl::encoding::Context) -> usize {
2661            8
2662        }
2663
2664        #[inline(always)]
2665        fn inline_size(_context: fidl::encoding::Context) -> usize {
2666            16
2667        }
2668    }
2669
2670    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileReportResults, D>
2671        for &FileReportResults
2672    {
2673        unsafe fn encode(
2674            self,
2675            encoder: &mut fidl::encoding::Encoder<'_, D>,
2676            offset: usize,
2677            mut depth: fidl::encoding::Depth,
2678        ) -> fidl::Result<()> {
2679            encoder.debug_check_bounds::<FileReportResults>(offset);
2680            // Vector header
2681            let max_ordinal: u64 = self.max_ordinal_present();
2682            encoder.write_num(max_ordinal, offset);
2683            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2684            // Calling encoder.out_of_line_offset(0) is not allowed.
2685            if max_ordinal == 0 {
2686                return Ok(());
2687            }
2688            depth.increment()?;
2689            let envelope_size = 8;
2690            let bytes_len = max_ordinal as usize * envelope_size;
2691            #[allow(unused_variables)]
2692            let offset = encoder.out_of_line_offset(bytes_len);
2693            let mut _prev_end_offset: usize = 0;
2694            if 1 > max_ordinal {
2695                return Ok(());
2696            }
2697
2698            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2699            // are envelope_size bytes.
2700            let cur_offset: usize = (1 - 1) * envelope_size;
2701
2702            // Zero reserved fields.
2703            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2704
2705            // Safety:
2706            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2707            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2708            //   envelope_size bytes, there is always sufficient room.
2709            fidl::encoding::encode_in_envelope_optional::<FilingSuccess, D>(
2710                self.result
2711                    .as_ref()
2712                    .map(<FilingSuccess as fidl::encoding::ValueTypeMarker>::borrow),
2713                encoder,
2714                offset + cur_offset,
2715                depth,
2716            )?;
2717
2718            _prev_end_offset = cur_offset + envelope_size;
2719            if 2 > max_ordinal {
2720                return Ok(());
2721            }
2722
2723            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2724            // are envelope_size bytes.
2725            let cur_offset: usize = (2 - 1) * envelope_size;
2726
2727            // Zero reserved fields.
2728            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2729
2730            // Safety:
2731            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2732            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2733            //   envelope_size bytes, there is always sufficient room.
2734            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<64>, D>(
2735                self.report_id.as_ref().map(
2736                    <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow,
2737                ),
2738                encoder,
2739                offset + cur_offset,
2740                depth,
2741            )?;
2742
2743            _prev_end_offset = cur_offset + envelope_size;
2744
2745            Ok(())
2746        }
2747    }
2748
2749    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileReportResults {
2750        #[inline(always)]
2751        fn new_empty() -> Self {
2752            Self::default()
2753        }
2754
2755        unsafe fn decode(
2756            &mut self,
2757            decoder: &mut fidl::encoding::Decoder<'_, D>,
2758            offset: usize,
2759            mut depth: fidl::encoding::Depth,
2760        ) -> fidl::Result<()> {
2761            decoder.debug_check_bounds::<Self>(offset);
2762            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2763                None => return Err(fidl::Error::NotNullable),
2764                Some(len) => len,
2765            };
2766            // Calling decoder.out_of_line_offset(0) is not allowed.
2767            if len == 0 {
2768                return Ok(());
2769            };
2770            depth.increment()?;
2771            let envelope_size = 8;
2772            let bytes_len = len * envelope_size;
2773            let offset = decoder.out_of_line_offset(bytes_len)?;
2774            // Decode the envelope for each type.
2775            let mut _next_ordinal_to_read = 0;
2776            let mut next_offset = offset;
2777            let end_offset = offset + bytes_len;
2778            _next_ordinal_to_read += 1;
2779            if next_offset >= end_offset {
2780                return Ok(());
2781            }
2782
2783            // Decode unknown envelopes for gaps in ordinals.
2784            while _next_ordinal_to_read < 1 {
2785                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2786                _next_ordinal_to_read += 1;
2787                next_offset += envelope_size;
2788            }
2789
2790            let next_out_of_line = decoder.next_out_of_line();
2791            let handles_before = decoder.remaining_handles();
2792            if let Some((inlined, num_bytes, num_handles)) =
2793                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2794            {
2795                let member_inline_size =
2796                    <FilingSuccess as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2797                if inlined != (member_inline_size <= 4) {
2798                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2799                }
2800                let inner_offset;
2801                let mut inner_depth = depth.clone();
2802                if inlined {
2803                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2804                    inner_offset = next_offset;
2805                } else {
2806                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2807                    inner_depth.increment()?;
2808                }
2809                let val_ref = self.result.get_or_insert_with(|| fidl::new_empty!(FilingSuccess, D));
2810                fidl::decode!(FilingSuccess, D, val_ref, decoder, inner_offset, inner_depth)?;
2811                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2812                {
2813                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2814                }
2815                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2816                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2817                }
2818            }
2819
2820            next_offset += envelope_size;
2821            _next_ordinal_to_read += 1;
2822            if next_offset >= end_offset {
2823                return Ok(());
2824            }
2825
2826            // Decode unknown envelopes for gaps in ordinals.
2827            while _next_ordinal_to_read < 2 {
2828                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2829                _next_ordinal_to_read += 1;
2830                next_offset += envelope_size;
2831            }
2832
2833            let next_out_of_line = decoder.next_out_of_line();
2834            let handles_before = decoder.remaining_handles();
2835            if let Some((inlined, num_bytes, num_handles)) =
2836                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2837            {
2838                let member_inline_size =
2839                    <fidl::encoding::BoundedString<64> as fidl::encoding::TypeMarker>::inline_size(
2840                        decoder.context,
2841                    );
2842                if inlined != (member_inline_size <= 4) {
2843                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2844                }
2845                let inner_offset;
2846                let mut inner_depth = depth.clone();
2847                if inlined {
2848                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2849                    inner_offset = next_offset;
2850                } else {
2851                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2852                    inner_depth.increment()?;
2853                }
2854                let val_ref = self
2855                    .report_id
2856                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<64>, D));
2857                fidl::decode!(
2858                    fidl::encoding::BoundedString<64>,
2859                    D,
2860                    val_ref,
2861                    decoder,
2862                    inner_offset,
2863                    inner_depth
2864                )?;
2865                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2866                {
2867                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2868                }
2869                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2870                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2871                }
2872            }
2873
2874            next_offset += envelope_size;
2875
2876            // Decode the remaining unknown envelopes.
2877            while next_offset < end_offset {
2878                _next_ordinal_to_read += 1;
2879                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2880                next_offset += envelope_size;
2881            }
2882
2883            Ok(())
2884        }
2885    }
2886
2887    impl GetAnnotationsParameters {
2888        #[inline(always)]
2889        fn max_ordinal_present(&self) -> u64 {
2890            if let Some(_) = self.collection_timeout_per_annotation {
2891                return 1;
2892            }
2893            0
2894        }
2895    }
2896
2897    impl fidl::encoding::ValueTypeMarker for GetAnnotationsParameters {
2898        type Borrowed<'a> = &'a Self;
2899        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2900            value
2901        }
2902    }
2903
2904    unsafe impl fidl::encoding::TypeMarker for GetAnnotationsParameters {
2905        type Owned = Self;
2906
2907        #[inline(always)]
2908        fn inline_align(_context: fidl::encoding::Context) -> usize {
2909            8
2910        }
2911
2912        #[inline(always)]
2913        fn inline_size(_context: fidl::encoding::Context) -> usize {
2914            16
2915        }
2916    }
2917
2918    unsafe impl<D: fidl::encoding::ResourceDialect>
2919        fidl::encoding::Encode<GetAnnotationsParameters, D> for &GetAnnotationsParameters
2920    {
2921        unsafe fn encode(
2922            self,
2923            encoder: &mut fidl::encoding::Encoder<'_, D>,
2924            offset: usize,
2925            mut depth: fidl::encoding::Depth,
2926        ) -> fidl::Result<()> {
2927            encoder.debug_check_bounds::<GetAnnotationsParameters>(offset);
2928            // Vector header
2929            let max_ordinal: u64 = self.max_ordinal_present();
2930            encoder.write_num(max_ordinal, offset);
2931            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2932            // Calling encoder.out_of_line_offset(0) is not allowed.
2933            if max_ordinal == 0 {
2934                return Ok(());
2935            }
2936            depth.increment()?;
2937            let envelope_size = 8;
2938            let bytes_len = max_ordinal as usize * envelope_size;
2939            #[allow(unused_variables)]
2940            let offset = encoder.out_of_line_offset(bytes_len);
2941            let mut _prev_end_offset: usize = 0;
2942            if 1 > max_ordinal {
2943                return Ok(());
2944            }
2945
2946            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2947            // are envelope_size bytes.
2948            let cur_offset: usize = (1 - 1) * envelope_size;
2949
2950            // Zero reserved fields.
2951            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2952
2953            // Safety:
2954            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2955            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2956            //   envelope_size bytes, there is always sufficient room.
2957            fidl::encoding::encode_in_envelope_optional::<i64, D>(
2958                self.collection_timeout_per_annotation
2959                    .as_ref()
2960                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2961                encoder,
2962                offset + cur_offset,
2963                depth,
2964            )?;
2965
2966            _prev_end_offset = cur_offset + envelope_size;
2967
2968            Ok(())
2969        }
2970    }
2971
2972    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2973        for GetAnnotationsParameters
2974    {
2975        #[inline(always)]
2976        fn new_empty() -> Self {
2977            Self::default()
2978        }
2979
2980        unsafe fn decode(
2981            &mut self,
2982            decoder: &mut fidl::encoding::Decoder<'_, D>,
2983            offset: usize,
2984            mut depth: fidl::encoding::Depth,
2985        ) -> fidl::Result<()> {
2986            decoder.debug_check_bounds::<Self>(offset);
2987            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2988                None => return Err(fidl::Error::NotNullable),
2989                Some(len) => len,
2990            };
2991            // Calling decoder.out_of_line_offset(0) is not allowed.
2992            if len == 0 {
2993                return Ok(());
2994            };
2995            depth.increment()?;
2996            let envelope_size = 8;
2997            let bytes_len = len * envelope_size;
2998            let offset = decoder.out_of_line_offset(bytes_len)?;
2999            // Decode the envelope for each type.
3000            let mut _next_ordinal_to_read = 0;
3001            let mut next_offset = offset;
3002            let end_offset = offset + bytes_len;
3003            _next_ordinal_to_read += 1;
3004            if next_offset >= end_offset {
3005                return Ok(());
3006            }
3007
3008            // Decode unknown envelopes for gaps in ordinals.
3009            while _next_ordinal_to_read < 1 {
3010                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3011                _next_ordinal_to_read += 1;
3012                next_offset += envelope_size;
3013            }
3014
3015            let next_out_of_line = decoder.next_out_of_line();
3016            let handles_before = decoder.remaining_handles();
3017            if let Some((inlined, num_bytes, num_handles)) =
3018                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3019            {
3020                let member_inline_size =
3021                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3022                if inlined != (member_inline_size <= 4) {
3023                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3024                }
3025                let inner_offset;
3026                let mut inner_depth = depth.clone();
3027                if inlined {
3028                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3029                    inner_offset = next_offset;
3030                } else {
3031                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3032                    inner_depth.increment()?;
3033                }
3034                let val_ref = self
3035                    .collection_timeout_per_annotation
3036                    .get_or_insert_with(|| fidl::new_empty!(i64, D));
3037                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3038                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3039                {
3040                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3041                }
3042                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3043                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3044                }
3045            }
3046
3047            next_offset += envelope_size;
3048
3049            // Decode the remaining unknown envelopes.
3050            while next_offset < end_offset {
3051                _next_ordinal_to_read += 1;
3052                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3053                next_offset += envelope_size;
3054            }
3055
3056            Ok(())
3057        }
3058    }
3059
3060    impl LastReboot {
3061        #[inline(always)]
3062        fn max_ordinal_present(&self) -> u64 {
3063            if let Some(_) = self.runtime {
3064                return 5;
3065            }
3066            if let Some(_) = self.planned {
3067                return 4;
3068            }
3069            if let Some(_) = self.uptime {
3070                return 3;
3071            }
3072            if let Some(_) = self.reason {
3073                return 2;
3074            }
3075            if let Some(_) = self.graceful {
3076                return 1;
3077            }
3078            0
3079        }
3080    }
3081
3082    impl fidl::encoding::ValueTypeMarker for LastReboot {
3083        type Borrowed<'a> = &'a Self;
3084        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3085            value
3086        }
3087    }
3088
3089    unsafe impl fidl::encoding::TypeMarker for LastReboot {
3090        type Owned = Self;
3091
3092        #[inline(always)]
3093        fn inline_align(_context: fidl::encoding::Context) -> usize {
3094            8
3095        }
3096
3097        #[inline(always)]
3098        fn inline_size(_context: fidl::encoding::Context) -> usize {
3099            16
3100        }
3101    }
3102
3103    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LastReboot, D>
3104        for &LastReboot
3105    {
3106        unsafe fn encode(
3107            self,
3108            encoder: &mut fidl::encoding::Encoder<'_, D>,
3109            offset: usize,
3110            mut depth: fidl::encoding::Depth,
3111        ) -> fidl::Result<()> {
3112            encoder.debug_check_bounds::<LastReboot>(offset);
3113            // Vector header
3114            let max_ordinal: u64 = self.max_ordinal_present();
3115            encoder.write_num(max_ordinal, offset);
3116            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3117            // Calling encoder.out_of_line_offset(0) is not allowed.
3118            if max_ordinal == 0 {
3119                return Ok(());
3120            }
3121            depth.increment()?;
3122            let envelope_size = 8;
3123            let bytes_len = max_ordinal as usize * envelope_size;
3124            #[allow(unused_variables)]
3125            let offset = encoder.out_of_line_offset(bytes_len);
3126            let mut _prev_end_offset: usize = 0;
3127            if 1 > max_ordinal {
3128                return Ok(());
3129            }
3130
3131            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3132            // are envelope_size bytes.
3133            let cur_offset: usize = (1 - 1) * envelope_size;
3134
3135            // Zero reserved fields.
3136            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3137
3138            // Safety:
3139            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3140            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3141            //   envelope_size bytes, there is always sufficient room.
3142            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3143                self.graceful.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3144                encoder,
3145                offset + cur_offset,
3146                depth,
3147            )?;
3148
3149            _prev_end_offset = cur_offset + envelope_size;
3150            if 2 > max_ordinal {
3151                return Ok(());
3152            }
3153
3154            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3155            // are envelope_size bytes.
3156            let cur_offset: usize = (2 - 1) * envelope_size;
3157
3158            // Zero reserved fields.
3159            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3160
3161            // Safety:
3162            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3163            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3164            //   envelope_size bytes, there is always sufficient room.
3165            fidl::encoding::encode_in_envelope_optional::<RebootReason, D>(
3166                self.reason.as_ref().map(<RebootReason as fidl::encoding::ValueTypeMarker>::borrow),
3167                encoder,
3168                offset + cur_offset,
3169                depth,
3170            )?;
3171
3172            _prev_end_offset = cur_offset + envelope_size;
3173            if 3 > max_ordinal {
3174                return Ok(());
3175            }
3176
3177            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3178            // are envelope_size bytes.
3179            let cur_offset: usize = (3 - 1) * envelope_size;
3180
3181            // Zero reserved fields.
3182            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3183
3184            // Safety:
3185            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3186            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3187            //   envelope_size bytes, there is always sufficient room.
3188            fidl::encoding::encode_in_envelope_optional::<i64, D>(
3189                self.uptime.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3190                encoder,
3191                offset + cur_offset,
3192                depth,
3193            )?;
3194
3195            _prev_end_offset = cur_offset + envelope_size;
3196            if 4 > max_ordinal {
3197                return Ok(());
3198            }
3199
3200            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3201            // are envelope_size bytes.
3202            let cur_offset: usize = (4 - 1) * envelope_size;
3203
3204            // Zero reserved fields.
3205            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3206
3207            // Safety:
3208            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3209            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3210            //   envelope_size bytes, there is always sufficient room.
3211            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3212                self.planned.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3213                encoder,
3214                offset + cur_offset,
3215                depth,
3216            )?;
3217
3218            _prev_end_offset = cur_offset + envelope_size;
3219            if 5 > max_ordinal {
3220                return Ok(());
3221            }
3222
3223            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3224            // are envelope_size bytes.
3225            let cur_offset: usize = (5 - 1) * envelope_size;
3226
3227            // Zero reserved fields.
3228            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3229
3230            // Safety:
3231            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3232            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3233            //   envelope_size bytes, there is always sufficient room.
3234            fidl::encoding::encode_in_envelope_optional::<i64, D>(
3235                self.runtime.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3236                encoder,
3237                offset + cur_offset,
3238                depth,
3239            )?;
3240
3241            _prev_end_offset = cur_offset + envelope_size;
3242
3243            Ok(())
3244        }
3245    }
3246
3247    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LastReboot {
3248        #[inline(always)]
3249        fn new_empty() -> Self {
3250            Self::default()
3251        }
3252
3253        unsafe fn decode(
3254            &mut self,
3255            decoder: &mut fidl::encoding::Decoder<'_, D>,
3256            offset: usize,
3257            mut depth: fidl::encoding::Depth,
3258        ) -> fidl::Result<()> {
3259            decoder.debug_check_bounds::<Self>(offset);
3260            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3261                None => return Err(fidl::Error::NotNullable),
3262                Some(len) => len,
3263            };
3264            // Calling decoder.out_of_line_offset(0) is not allowed.
3265            if len == 0 {
3266                return Ok(());
3267            };
3268            depth.increment()?;
3269            let envelope_size = 8;
3270            let bytes_len = len * envelope_size;
3271            let offset = decoder.out_of_line_offset(bytes_len)?;
3272            // Decode the envelope for each type.
3273            let mut _next_ordinal_to_read = 0;
3274            let mut next_offset = offset;
3275            let end_offset = offset + bytes_len;
3276            _next_ordinal_to_read += 1;
3277            if next_offset >= end_offset {
3278                return Ok(());
3279            }
3280
3281            // Decode unknown envelopes for gaps in ordinals.
3282            while _next_ordinal_to_read < 1 {
3283                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3284                _next_ordinal_to_read += 1;
3285                next_offset += envelope_size;
3286            }
3287
3288            let next_out_of_line = decoder.next_out_of_line();
3289            let handles_before = decoder.remaining_handles();
3290            if let Some((inlined, num_bytes, num_handles)) =
3291                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3292            {
3293                let member_inline_size =
3294                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3295                if inlined != (member_inline_size <= 4) {
3296                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3297                }
3298                let inner_offset;
3299                let mut inner_depth = depth.clone();
3300                if inlined {
3301                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3302                    inner_offset = next_offset;
3303                } else {
3304                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3305                    inner_depth.increment()?;
3306                }
3307                let val_ref = self.graceful.get_or_insert_with(|| fidl::new_empty!(bool, D));
3308                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3309                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3310                {
3311                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3312                }
3313                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3314                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3315                }
3316            }
3317
3318            next_offset += envelope_size;
3319            _next_ordinal_to_read += 1;
3320            if next_offset >= end_offset {
3321                return Ok(());
3322            }
3323
3324            // Decode unknown envelopes for gaps in ordinals.
3325            while _next_ordinal_to_read < 2 {
3326                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3327                _next_ordinal_to_read += 1;
3328                next_offset += envelope_size;
3329            }
3330
3331            let next_out_of_line = decoder.next_out_of_line();
3332            let handles_before = decoder.remaining_handles();
3333            if let Some((inlined, num_bytes, num_handles)) =
3334                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3335            {
3336                let member_inline_size =
3337                    <RebootReason as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3338                if inlined != (member_inline_size <= 4) {
3339                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3340                }
3341                let inner_offset;
3342                let mut inner_depth = depth.clone();
3343                if inlined {
3344                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3345                    inner_offset = next_offset;
3346                } else {
3347                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3348                    inner_depth.increment()?;
3349                }
3350                let val_ref = self.reason.get_or_insert_with(|| fidl::new_empty!(RebootReason, D));
3351                fidl::decode!(RebootReason, D, val_ref, decoder, inner_offset, inner_depth)?;
3352                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3353                {
3354                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3355                }
3356                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3357                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3358                }
3359            }
3360
3361            next_offset += envelope_size;
3362            _next_ordinal_to_read += 1;
3363            if next_offset >= end_offset {
3364                return Ok(());
3365            }
3366
3367            // Decode unknown envelopes for gaps in ordinals.
3368            while _next_ordinal_to_read < 3 {
3369                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3370                _next_ordinal_to_read += 1;
3371                next_offset += envelope_size;
3372            }
3373
3374            let next_out_of_line = decoder.next_out_of_line();
3375            let handles_before = decoder.remaining_handles();
3376            if let Some((inlined, num_bytes, num_handles)) =
3377                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3378            {
3379                let member_inline_size =
3380                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3381                if inlined != (member_inline_size <= 4) {
3382                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3383                }
3384                let inner_offset;
3385                let mut inner_depth = depth.clone();
3386                if inlined {
3387                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3388                    inner_offset = next_offset;
3389                } else {
3390                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3391                    inner_depth.increment()?;
3392                }
3393                let val_ref = self.uptime.get_or_insert_with(|| fidl::new_empty!(i64, D));
3394                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3395                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3396                {
3397                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3398                }
3399                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3400                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3401                }
3402            }
3403
3404            next_offset += envelope_size;
3405            _next_ordinal_to_read += 1;
3406            if next_offset >= end_offset {
3407                return Ok(());
3408            }
3409
3410            // Decode unknown envelopes for gaps in ordinals.
3411            while _next_ordinal_to_read < 4 {
3412                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3413                _next_ordinal_to_read += 1;
3414                next_offset += envelope_size;
3415            }
3416
3417            let next_out_of_line = decoder.next_out_of_line();
3418            let handles_before = decoder.remaining_handles();
3419            if let Some((inlined, num_bytes, num_handles)) =
3420                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3421            {
3422                let member_inline_size =
3423                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3424                if inlined != (member_inline_size <= 4) {
3425                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3426                }
3427                let inner_offset;
3428                let mut inner_depth = depth.clone();
3429                if inlined {
3430                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3431                    inner_offset = next_offset;
3432                } else {
3433                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3434                    inner_depth.increment()?;
3435                }
3436                let val_ref = self.planned.get_or_insert_with(|| fidl::new_empty!(bool, D));
3437                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3438                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3439                {
3440                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3441                }
3442                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3443                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3444                }
3445            }
3446
3447            next_offset += envelope_size;
3448            _next_ordinal_to_read += 1;
3449            if next_offset >= end_offset {
3450                return Ok(());
3451            }
3452
3453            // Decode unknown envelopes for gaps in ordinals.
3454            while _next_ordinal_to_read < 5 {
3455                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3456                _next_ordinal_to_read += 1;
3457                next_offset += envelope_size;
3458            }
3459
3460            let next_out_of_line = decoder.next_out_of_line();
3461            let handles_before = decoder.remaining_handles();
3462            if let Some((inlined, num_bytes, num_handles)) =
3463                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3464            {
3465                let member_inline_size =
3466                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3467                if inlined != (member_inline_size <= 4) {
3468                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3469                }
3470                let inner_offset;
3471                let mut inner_depth = depth.clone();
3472                if inlined {
3473                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3474                    inner_offset = next_offset;
3475                } else {
3476                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3477                    inner_depth.increment()?;
3478                }
3479                let val_ref = self.runtime.get_or_insert_with(|| fidl::new_empty!(i64, D));
3480                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3481                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3482                {
3483                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3484                }
3485                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3486                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3487                }
3488            }
3489
3490            next_offset += envelope_size;
3491
3492            // Decode the remaining unknown envelopes.
3493            while next_offset < end_offset {
3494                _next_ordinal_to_read += 1;
3495                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3496                next_offset += envelope_size;
3497            }
3498
3499            Ok(())
3500        }
3501    }
3502}