fidl_fuchsia_feedback/
fidl_fuchsia_feedback.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::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13/// Maximum length for an annotation's key.
14pub const MAX_ANNOTATION_KEY_LENGTH: u64 = 128;
15
16/// Maximum length for an annotation's value.
17pub const MAX_ANNOTATION_VALUE_LENGTH: u64 = 1024;
18
19pub const MAX_CRASH_SIGNATURE_LENGTH: u32 = 128;
20
21pub const MAX_EVENT_ID_LENGTH: u32 = 128;
22
23pub const MAX_EXCEPTION_MESSAGE_LENGTH: u32 = 4096;
24
25pub const MAX_EXCEPTION_TYPE_LENGTH: u32 = 128;
26
27pub const MAX_NAMESPACE_LENGTH: u32 = 32;
28
29pub const MAX_NUM_ANNOTATIONS2_PROVIDED: u32 = 512;
30
31pub const MAX_NUM_ANNOTATIONS_PER_CRASH_REPORT: u32 = 32;
32
33pub const MAX_NUM_ANNOTATIONS_PER_NAMESPACE: u32 = 16;
34
35/// # Deprecation
36///
37/// Feedback is getting close to the limit defined by MAX_NUM_ANNOTATIONS_PROVIDED. Clients
38/// should migrate to using MAX_NUM_ANNOTATIONS2_PROVIDED with |annotations2|, which will include
39/// all annotations included in |annotations| but has a higher limit for future growth.
40pub const MAX_NUM_ANNOTATIONS_PROVIDED: u32 = 64;
41
42pub const MAX_NUM_ATTACHMENTS_PER_CRASH_REPORT: u32 = 16;
43
44pub const MAX_PROCESS_NAME_LENGTH: u32 = 64;
45
46pub const MAX_PROGRAM_NAME_LENGTH: u32 = 1024;
47
48pub const MAX_REPORT_ID_LENGTH: u32 = 64;
49
50pub const MAX_THREAD_NAME_LENGTH: u32 = 64;
51
52#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
53pub enum FilingError {
54    Unknown,
55    InvalidArgsError,
56    ServerError,
57    PersistenceError,
58    QuotaReachedError,
59    #[doc(hidden)]
60    __SourceBreaking {
61        unknown_ordinal: u32,
62    },
63}
64
65/// Pattern that matches an unknown `FilingError` member.
66#[macro_export]
67macro_rules! FilingErrorUnknown {
68    () => {
69        _
70    };
71}
72
73impl FilingError {
74    #[inline]
75    pub fn from_primitive(prim: u32) -> Option<Self> {
76        match prim {
77            0 => Some(Self::Unknown),
78            1 => Some(Self::InvalidArgsError),
79            2 => Some(Self::ServerError),
80            3 => Some(Self::PersistenceError),
81            4 => Some(Self::QuotaReachedError),
82            _ => None,
83        }
84    }
85
86    #[inline]
87    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
88        match prim {
89            0 => Self::Unknown,
90            1 => Self::InvalidArgsError,
91            2 => Self::ServerError,
92            3 => Self::PersistenceError,
93            4 => Self::QuotaReachedError,
94            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
95        }
96    }
97
98    #[inline]
99    pub fn unknown() -> Self {
100        Self::__SourceBreaking { unknown_ordinal: 0x0 }
101    }
102
103    #[inline]
104    pub const fn into_primitive(self) -> u32 {
105        match self {
106            Self::Unknown => 0,
107            Self::InvalidArgsError => 1,
108            Self::ServerError => 2,
109            Self::PersistenceError => 3,
110            Self::QuotaReachedError => 4,
111            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
112        }
113    }
114
115    #[inline]
116    pub fn is_unknown(&self) -> bool {
117        match self {
118            Self::__SourceBreaking { unknown_ordinal: _ } => true,
119            _ => false,
120        }
121    }
122}
123
124/// "Memory" refers to a non-persistent location, e.g. a memory-backed
125/// filesystem.
126#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
127pub enum FilingSuccess {
128    Unknown,
129    ReportUploaded,
130    ReportOnDisk,
131    ReportInMemory,
132    ReportNotFiledUserOptedOut,
133    #[doc(hidden)]
134    __SourceBreaking {
135        unknown_ordinal: u32,
136    },
137}
138
139/// Pattern that matches an unknown `FilingSuccess` member.
140#[macro_export]
141macro_rules! FilingSuccessUnknown {
142    () => {
143        _
144    };
145}
146
147impl FilingSuccess {
148    #[inline]
149    pub fn from_primitive(prim: u32) -> Option<Self> {
150        match prim {
151            0 => Some(Self::Unknown),
152            1 => Some(Self::ReportUploaded),
153            2 => Some(Self::ReportOnDisk),
154            3 => Some(Self::ReportInMemory),
155            4 => Some(Self::ReportNotFiledUserOptedOut),
156            _ => None,
157        }
158    }
159
160    #[inline]
161    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
162        match prim {
163            0 => Self::Unknown,
164            1 => Self::ReportUploaded,
165            2 => Self::ReportOnDisk,
166            3 => Self::ReportInMemory,
167            4 => Self::ReportNotFiledUserOptedOut,
168            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
169        }
170    }
171
172    #[inline]
173    pub fn unknown() -> Self {
174        Self::__SourceBreaking { unknown_ordinal: 0x0 }
175    }
176
177    #[inline]
178    pub const fn into_primitive(self) -> u32 {
179        match self {
180            Self::Unknown => 0,
181            Self::ReportUploaded => 1,
182            Self::ReportOnDisk => 2,
183            Self::ReportInMemory => 3,
184            Self::ReportNotFiledUserOptedOut => 4,
185            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
186        }
187    }
188
189    #[inline]
190    pub fn is_unknown(&self) -> bool {
191        match self {
192            Self::__SourceBreaking { unknown_ordinal: _ } => true,
193            _ => false,
194        }
195    }
196}
197
198/// The encoding used for the image.
199///
200/// Today, only PNG is supported, but in the future the screenshot could be
201/// returned in other encodings if need arises.
202#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
203#[repr(u32)]
204pub enum ImageEncoding {
205    Png = 0,
206}
207
208impl ImageEncoding {
209    #[inline]
210    pub fn from_primitive(prim: u32) -> Option<Self> {
211        match prim {
212            0 => Some(Self::Png),
213            _ => None,
214        }
215    }
216
217    #[inline]
218    pub const fn into_primitive(self) -> u32 {
219        self as u32
220    }
221
222    #[deprecated = "Strict enums should not use `is_unknown`"]
223    #[inline]
224    pub fn is_unknown(&self) -> bool {
225        false
226    }
227}
228
229/// Reasons why a device last rebooted.
230#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
231pub enum RebootReason {
232    /// The client will get this value if the server is sending a new enum value that the client
233    /// was not compiled with.
234    Unknown,
235    /// The device booted from a cold state.
236    ///
237    /// This is most likely the result of an extended period of time without power or a device
238    /// booting with Fuchsia for the first time.
239    Cold,
240    /// The device rebooted due to a brief loss of power.
241    ///
242    /// On some hardware this could be the result of a user disconnecting, then reconnecting their
243    /// device's power supply in rapid succession.
244    BriefPowerLoss,
245    /// The device rebooted because its voltage dipped below an allowable level without going to 0.
246    Brownout,
247    KernelPanic,
248    SystemOutOfMemory,
249    HardwareWatchdogTimeout,
250    SoftwareWatchdogTimeout,
251    /// The device rebooted because the userspace root job was terminated, most likely because one
252    /// of its critical processes crashed.
253    RootJobTermination,
254    /// The device rebooted because a user of the device initiated the reboot. A user can be a
255    /// human or a program that interacts with the device on behalf of a human, such as SL4F or RCS.
256    UserRequest,
257    /// The device rebooted because applying the OTA failed and we want to retry.
258    RetrySystemUpdate,
259    /// The device rebooted because it was determined to be too hot.
260    HighTemperature,
261    /// The device rebooted because of an issue with a session or because the session manager was
262    /// unable to  recover from an error.
263    SessionFailure,
264    /// The device rebooted because the system manager (sysmgr) was unable to recover from an
265    /// error.
266    SysmgrFailure,
267    /// The device rebooted following a data reset to factory defaults.
268    /// See [`fuchsia.recovery.FactoryReset`].
269    FactoryDataReset,
270    /// The device rebooted because a critical component managed by sysmgr has failed.
271    CriticalComponentFailure,
272    /// The device rebooted to apply the swap of Zircon boot images.
273    ZbiSwap,
274    /// The device rebooted because of an OTA.
275    SystemUpdate,
276    /// The Netstack component is changing versions.
277    NetstackMigration,
278    #[doc(hidden)]
279    __SourceBreaking {
280        unknown_ordinal: u16,
281    },
282}
283
284/// Pattern that matches an unknown `RebootReason` member.
285#[macro_export]
286macro_rules! RebootReasonUnknown {
287    () => {
288        _
289    };
290}
291
292impl RebootReason {
293    #[inline]
294    pub fn from_primitive(prim: u16) -> Option<Self> {
295        match prim {
296            0 => Some(Self::Unknown),
297            2 => Some(Self::Cold),
298            3 => Some(Self::BriefPowerLoss),
299            4 => Some(Self::Brownout),
300            5 => Some(Self::KernelPanic),
301            6 => Some(Self::SystemOutOfMemory),
302            7 => Some(Self::HardwareWatchdogTimeout),
303            8 => Some(Self::SoftwareWatchdogTimeout),
304            19 => Some(Self::RootJobTermination),
305            9 => Some(Self::UserRequest),
306            17 => Some(Self::RetrySystemUpdate),
307            11 => Some(Self::HighTemperature),
308            12 => Some(Self::SessionFailure),
309            15 => Some(Self::SysmgrFailure),
310            14 => Some(Self::FactoryDataReset),
311            16 => Some(Self::CriticalComponentFailure),
312            18 => Some(Self::ZbiSwap),
313            10 => Some(Self::SystemUpdate),
314            20 => Some(Self::NetstackMigration),
315            _ => None,
316        }
317    }
318
319    #[inline]
320    pub fn from_primitive_allow_unknown(prim: u16) -> Self {
321        match prim {
322            0 => Self::Unknown,
323            2 => Self::Cold,
324            3 => Self::BriefPowerLoss,
325            4 => Self::Brownout,
326            5 => Self::KernelPanic,
327            6 => Self::SystemOutOfMemory,
328            7 => Self::HardwareWatchdogTimeout,
329            8 => Self::SoftwareWatchdogTimeout,
330            19 => Self::RootJobTermination,
331            9 => Self::UserRequest,
332            17 => Self::RetrySystemUpdate,
333            11 => Self::HighTemperature,
334            12 => Self::SessionFailure,
335            15 => Self::SysmgrFailure,
336            14 => Self::FactoryDataReset,
337            16 => Self::CriticalComponentFailure,
338            18 => Self::ZbiSwap,
339            10 => Self::SystemUpdate,
340            20 => Self::NetstackMigration,
341            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
342        }
343    }
344
345    #[inline]
346    pub fn unknown() -> Self {
347        Self::__SourceBreaking { unknown_ordinal: 0x0 }
348    }
349
350    #[inline]
351    pub const fn into_primitive(self) -> u16 {
352        match self {
353            Self::Unknown => 0,
354            Self::Cold => 2,
355            Self::BriefPowerLoss => 3,
356            Self::Brownout => 4,
357            Self::KernelPanic => 5,
358            Self::SystemOutOfMemory => 6,
359            Self::HardwareWatchdogTimeout => 7,
360            Self::SoftwareWatchdogTimeout => 8,
361            Self::RootJobTermination => 19,
362            Self::UserRequest => 9,
363            Self::RetrySystemUpdate => 17,
364            Self::HighTemperature => 11,
365            Self::SessionFailure => 12,
366            Self::SysmgrFailure => 15,
367            Self::FactoryDataReset => 14,
368            Self::CriticalComponentFailure => 16,
369            Self::ZbiSwap => 18,
370            Self::SystemUpdate => 10,
371            Self::NetstackMigration => 20,
372            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
373        }
374    }
375
376    #[inline]
377    pub fn is_unknown(&self) -> bool {
378        match self {
379            Self::__SourceBreaking { unknown_ordinal: _ } => true,
380            _ => false,
381        }
382    }
383}
384
385/// An annotation and its plain ASCII string key.
386/// Annotations are short strings, e.g., the board name or the build version.
387#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
388pub struct Annotation {
389    pub key: String,
390    pub value: String,
391}
392
393impl fidl::Persistable for Annotation {}
394
395/// An attachment and its plain ASCII string key.
396/// Attachments are larger objects, e.g., log files. They may be binary or text data.
397#[derive(Debug, PartialEq)]
398pub struct Attachment {
399    pub key: String,
400    pub value: fidl_fuchsia_mem::Buffer,
401}
402
403impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Attachment {}
404
405#[derive(Clone, Debug, PartialEq)]
406pub struct ComponentDataRegisterUpsertRequest {
407    pub data: ComponentData,
408}
409
410impl fidl::Persistable for ComponentDataRegisterUpsertRequest {}
411
412#[derive(Debug, PartialEq)]
413pub struct CrashReporterFileReportRequest {
414    pub report: CrashReport,
415}
416
417impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
418    for CrashReporterFileReportRequest
419{
420}
421
422#[derive(Clone, Debug, PartialEq)]
423pub struct CrashReporterFileReportResponse {
424    pub results: FileReportResults,
425}
426
427impl fidl::Persistable for CrashReporterFileReportResponse {}
428
429#[derive(Clone, Debug, PartialEq)]
430pub struct CrashReportingProductRegisterUpsertRequest {
431    pub component_url: String,
432    pub product: CrashReportingProduct,
433}
434
435impl fidl::Persistable for CrashReportingProductRegisterUpsertRequest {}
436
437#[derive(Clone, Debug, PartialEq)]
438pub struct CrashReportingProductRegisterUpsertWithAckRequest {
439    pub component_url: String,
440    pub product: CrashReportingProduct,
441}
442
443impl fidl::Persistable for CrashReportingProductRegisterUpsertWithAckRequest {}
444
445#[derive(Clone, Debug, PartialEq)]
446pub struct DataProviderGetAnnotationsRequest {
447    pub params: GetAnnotationsParameters,
448}
449
450impl fidl::Persistable for DataProviderGetAnnotationsRequest {}
451
452#[derive(Clone, Debug, PartialEq)]
453pub struct DataProviderGetAnnotationsResponse {
454    pub annotations: Annotations,
455}
456
457impl fidl::Persistable for DataProviderGetAnnotationsResponse {}
458
459#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
460pub struct DataProviderGetScreenshotRequest {
461    pub encoding: ImageEncoding,
462}
463
464impl fidl::Persistable for DataProviderGetScreenshotRequest {}
465
466#[derive(Debug, PartialEq)]
467pub struct DataProviderGetScreenshotResponse {
468    pub screenshot: Option<Box<Screenshot>>,
469}
470
471impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
472    for DataProviderGetScreenshotResponse
473{
474}
475
476#[derive(Debug, PartialEq)]
477pub struct DataProviderGetSnapshotRequest {
478    pub params: GetSnapshotParameters,
479}
480
481impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
482    for DataProviderGetSnapshotRequest
483{
484}
485
486#[derive(Debug, PartialEq)]
487pub struct DataProviderGetSnapshotResponse {
488    pub snapshot: Snapshot,
489}
490
491impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
492    for DataProviderGetSnapshotResponse
493{
494}
495
496#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
497pub struct DeviceIdProviderGetIdResponse {
498    pub feedback_id: String,
499}
500
501impl fidl::Persistable for DeviceIdProviderGetIdResponse {}
502
503#[derive(Clone, Debug, PartialEq)]
504pub struct LastRebootInfoProviderGetResponse {
505    pub last_reboot: LastReboot,
506}
507
508impl fidl::Persistable for LastRebootInfoProviderGetResponse {}
509
510/// An encoded image of the screen.
511#[derive(Debug, PartialEq)]
512pub struct Screenshot {
513    pub image: fidl_fuchsia_mem::Buffer,
514    pub dimensions_in_px: fidl_fuchsia_math::Size,
515}
516
517impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Screenshot {}
518
519/// Annotations about the device's state.
520///
521/// Clients typically upload the data straight to servers. So the data comes in the form of
522/// arbitrary key-value pairs that clients can directly forward to the servers.
523#[derive(Clone, Debug, Default, PartialEq)]
524pub struct Annotations {
525    /// A vector of key-value string pairs. Keys are guaranteed to be unique.
526    ///
527    /// # Deprecation
528    ///
529    /// Feedback is getting close to the limit defined by MAX_NUM_ANNOTATIONS_PROVIDED. Clients
530    /// should migrate to |annotations2|, which will include all annotations included in
531    /// |annotations| but has a higher limit for future growth.
532    pub annotations: Option<Vec<Annotation>>,
533    /// A vector of key-value string pairs. Keys are guaranteed to be unique.
534    pub annotations2: Option<Vec<Annotation>>,
535    #[doc(hidden)]
536    pub __source_breaking: fidl::marker::SourceBreaking,
537}
538
539impl fidl::Persistable for Annotations {}
540
541/// Data known to a component, but not exposed to the platform, to attach to feedback reports.
542#[derive(Clone, Debug, Default, PartialEq)]
543pub struct ComponentData {
544    /// The top-level namespace associated with the data:
545    /// * Is intended to group related data together and reduce data key collisions across
546    ///   namespaces.
547    /// * May be shared by multiple clients, e.g., there could be multiple clients within the same
548    ///   component or across components that want to expose related data and they would all use
549    ///   the same namespace.
550    /// * Will be prefixed to every data key passed within that namespace in all feedback reports,
551    ///   e.g., the annotation "version" would appear as "foo.version" in all feedback reports if
552    ///   the namespace is "foo".
553    /// * Must match [a-z\-]+, i.e. only lowercase letters and hyphens or this will result in a
554    ///   ZX_ERR_INVALID_ARGS epitaph.
555    /// * Must not match a reserved namespace used internally for platform data, e.g., "build", or
556    ///   this will result in a ZX_ERR_INVALID_ARGS epitaph. The list of reserved namespaces is
557    ///   internal and subject to change for now.
558    pub namespace: Option<String>,
559    /// A vector of key-value string pairs, e.g., `<"version", "1.2.3.45">`.
560    ///
561    /// Keys:
562    /// * Should be unique as only the latest value for a given key in the vector will be
563    ///   considered.
564    /// * Must match [a-z\-\.]+, i.e. only lowercase letters, hyphens and periods. Use periods for
565    ///   sub-namespacing, e.g., "build.label" and "build.type", so that related annotations are
566    ///   grouped together (here related to "build") when sorted lexicographically.
567    pub annotations: Option<Vec<Annotation>>,
568    #[doc(hidden)]
569    pub __source_breaking: fidl::marker::SourceBreaking,
570}
571
572impl fidl::Persistable for ComponentData {}
573
574/// Represents a crash report.
575#[derive(Debug, Default, PartialEq)]
576pub struct CrashReport {
577    /// The name of the program that crashed, e.g., the process or component's name.
578    pub program_name: Option<String>,
579    /// The specific report that depends on the type of crashes.
580    ///
581    /// This field should be set if additional information about the crashing program needs to be
582    /// sent, e.g., a minidump.
583    pub specific_report: Option<SpecificCrashReport>,
584    /// A vector of key-value string pairs representing arbitrary data that should be attached to a
585    /// crash report.
586    ///
587    /// Keys should be unique as only the latest value for a given key in the vector will be
588    /// considered.
589    pub annotations: Option<Vec<Annotation>>,
590    /// A vector of key-value string-to-VMO pairs representing arbitrary data that should be
591    /// attached to a crash report.
592    ///
593    /// Keys should be unique as only the latest value for a given key in the vector will be
594    /// considered.
595    pub attachments: Option<Vec<Attachment>>,
596    /// A text ID that the crash server can use to group multiple crash reports related to the
597    /// same event.
598    ///
599    /// Unlike the crash signature, crash reports sharing the same ID correspond to different
600    /// crashes, but can be considered as belonging to the same event, e.g., a crash in a low-level
601    /// server causing a crash in a high-level UI widget.
602    pub event_id: Option<String>,
603    /// How long the program was running before it crashed.
604    pub program_uptime: Option<i64>,
605    /// A text signature that the crash server can use to track the same crash over time, e.g.,
606    /// "kernel-panic" or "oom". This signature will take precedence over any automated signature
607    /// derived from the rest of the data.
608    ///
609    /// Unlike the event ID, crash reports sharing the same signature correspond to the same crash,
610    /// but happening over multiple events, e.g., a null pointer exception in a server whenever
611    /// asked the same request.
612    ///
613    /// Must match [a-z][a-z\-]* i.e. only lowercase letters and hyphens or this will result in a
614    /// ZX_ERR_INVALID_ARGS epitaph.
615    pub crash_signature: Option<String>,
616    /// Indicates whether the crash report is for the atypical stop of a running process, component,
617    /// or the system itself.
618    ///
619    /// Examples of events that result in fatal crash reports are:
620    ///  * an ELF process crashing
621    ///  * the system rebooting because it ran out of memory.
622    ///  * the system rebooting because a critical component crashed.
623    ///  * the system rebooting because the device was too hot.
624    ///
625    /// Examples of events that result in non-fatal crash reports are:
626    ///  * an uncaught exception in a Dart program with many execution contexts. The runtime may
627    ///    chose to terminate that specific execution context and file a crash report for it instead
628    ///    of the whole program.
629    ///  * a component detecting a fatal event (like an OOM) may occur soon, but isn't guaranteed to
630    ///    occur.
631    ///
632    /// This field is primarily used for grouping crashes by fatal, not fatal, and unknown,
633    /// each corresponding to the field being set to true, set to false, or not set respectively.
634    pub is_fatal: Option<bool>,
635    #[doc(hidden)]
636    pub __source_breaking: fidl::marker::SourceBreaking,
637}
638
639impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CrashReport {}
640
641/// Product information to report to the crash server.
642#[derive(Clone, Debug, Default, PartialEq)]
643pub struct CrashReportingProduct {
644    /// The product name on the crash server.
645    /// * The first character has to be alphanumeric. The remaining characters must be printable,
646    ///   but cannot be a space, which leaves values 33 to 127 in the ASCII table. Any other
647    ///   characters will result in a ZX_ERR_INVALID_ARGS epitaph.
648    /// * Missing this required field will result in a ZX_ERR_INVALID_ARGS epitaph.
649    pub name: Option<String>,
650    /// Optional product version of the component.
651    /// * The first character has to be alphanumeric. The remaining characters must be printable,
652    ///   but cannot be a space, which leaves values 33 to 127 in the ASCII table. Any other
653    ///   characters will result in a ZX_ERR_INVALID_ARGS epitaph.
654    ///
655    /// If no version is specified then none is reported to the crash server.
656    pub version: Option<String>,
657    /// Optional product release channel for the component, e.g., "canary", "beta", "stable".
658    ///
659    /// If no channel is specified then none is reported to the crash server.
660    pub channel: Option<String>,
661    #[doc(hidden)]
662    pub __source_breaking: fidl::marker::SourceBreaking,
663}
664
665impl fidl::Persistable for CrashReportingProduct {}
666
667#[derive(Clone, Debug, Default, PartialEq)]
668pub struct FileReportResults {
669    /// The success type.
670    pub result: Option<FilingSuccess>,
671    /// A non-empty value if |result| is FilingSuccess::REPORT_UPLOADED.
672    pub report_id: Option<String>,
673    #[doc(hidden)]
674    pub __source_breaking: fidl::marker::SourceBreaking,
675}
676
677impl fidl::Persistable for FileReportResults {}
678
679/// Parameters for the DataProvider::GetAnnotations() method.
680#[derive(Clone, Debug, Default, PartialEq)]
681pub struct GetAnnotationsParameters {
682    /// Annotations are collected in parallel from various places in the platform, each with a
683    /// timeout.
684    ///
685    /// `collection_timeout_per_annotation` allows clients to control how much time is given to
686    /// each annotation collection. It enables clients to get a partial set of annotations under a
687    /// certain time.
688    pub collection_timeout_per_annotation: Option<i64>,
689    #[doc(hidden)]
690    pub __source_breaking: fidl::marker::SourceBreaking,
691}
692
693impl fidl::Persistable for GetAnnotationsParameters {}
694
695/// Parameters for the DataProvider::GetSnapshot() method.
696#[derive(Debug, Default, PartialEq)]
697pub struct GetSnapshotParameters {
698    /// A snapshot aggregates various data from the platform (device uptime, logs, Inspect data,
699    /// etc.) that are collected in parallel. Internally, each data collection is done within a
700    /// timeout.
701    ///
702    /// `collection_timeout_per_data` allows clients to control how much time is given to each data
703    /// collection. It enables clients to get a partial yet valid snapshot under a certain time.
704    ///
705    /// Note that this does not control how much total time the snapshot generation may take,
706    /// which is by construction higher than `collection_timeout_per_data`, as clients can control
707    /// the total time by using a timeout on the call to GetSnapshot() on their side.
708    pub collection_timeout_per_data: Option<i64>,
709    /// If set, the snapshot archive will be sent as a |fuchsia.io.File| over this channel instead
710    /// of being set in the |archive| field in the |Snapshot| response. This is typically useful if
711    /// the client is on the host and does not support VMOs.
712    pub response_channel: Option<fidl::Channel>,
713    #[doc(hidden)]
714    pub __source_breaking: fidl::marker::SourceBreaking,
715}
716
717impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for GetSnapshotParameters {}
718
719/// Information about why a device last rebooted.
720#[derive(Clone, Debug, Default, PartialEq)]
721pub struct LastReboot {
722    /// Whether the last reboot was graceful, i.e. the device didn't reboot in response to an error
723    /// and rebooted in a controlled manner.
724    ///
725    /// This field allows clients to know whether the last reboot was graceful without having to
726    /// parse the optional |reason| field. This is useful when |reason| is not set, i.e. because
727    /// the system doesn't know more than the fact that the reboot was graceful, or when the API
728    /// evolves to support new RebootReason values and the clients hasn't been updated yet.
729    ///
730    /// This field is always has a value if |reason| is provided. However, |reason| might not
731    /// always have a value this field is provided.
732    pub graceful: Option<bool>,
733    /// Why a device last rebooted.
734    pub reason: Option<RebootReason>,
735    /// The uptime of the device before it rebooted. This is the amount of time since boot,
736    /// including any time spent in suspend-to-idle.
737    pub uptime: Option<i64>,
738    /// Whether the last reboot was planned, i.e. the device rebooted in accordance to a schedule
739    /// applied by the system.
740    ///
741    /// This field allows clients to know whether the last reboot was planned without having to
742    /// parse the |reason| field.
743    ///
744    /// Planned reboots are by nature, graceful.
745    pub planned: Option<bool>,
746    /// The runtime of the device before it rebooted. This is the amount of time since boot
747    /// excluding any time spent in suspend-to-idle.
748    pub runtime: Option<i64>,
749    #[doc(hidden)]
750    pub __source_breaking: fidl::marker::SourceBreaking,
751}
752
753impl fidl::Persistable for LastReboot {}
754
755/// Represents a crash report for a native exception out of which the client has built a minidump.
756#[derive(Debug, Default, PartialEq)]
757pub struct NativeCrashReport {
758    /// The core dump in the Minidump format.
759    pub minidump: Option<fidl_fuchsia_mem::Buffer>,
760    /// The name of the crashed process.
761    pub process_name: Option<String>,
762    /// The kernel object id of the crashed process.
763    pub process_koid: Option<u64>,
764    /// The name of the crashed thread.
765    pub thread_name: Option<String>,
766    /// The kernel object id of the crashed thread.
767    pub thread_koid: Option<u64>,
768    #[doc(hidden)]
769    pub __source_breaking: fidl::marker::SourceBreaking,
770}
771
772impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NativeCrashReport {}
773
774/// Represents a crash report for a runtime exception, applicable to most languages.
775#[derive(Debug, Default, PartialEq)]
776pub struct RuntimeCrashReport {
777    /// The exception type, e.g., "FileSystemException".
778    pub exception_type: Option<String>,
779    /// The exception message, e.g., "cannot open file".
780    pub exception_message: Option<String>,
781    /// The text representation of the exception stack trace.
782    pub exception_stack_trace: Option<fidl_fuchsia_mem::Buffer>,
783    #[doc(hidden)]
784    pub __source_breaking: fidl::marker::SourceBreaking,
785}
786
787impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RuntimeCrashReport {}
788
789/// Snapshot about the device's state.
790///
791/// Clients typically upload the data straight to servers. So the data comes in the form of
792/// arbitrary key-value pairs that clients can directly forward to the servers.
793#[derive(Debug, Default, PartialEq)]
794pub struct Snapshot {
795    /// A <filename, ZIP archive> pair.
796    ///
797    /// The ZIP archive contains several files corresponding to the various data it collected from
798    /// the platform. There is typically one file for all the annotations (device uptime, build
799    /// version, etc.) and one file per attachment (logs, Inspect data, etc.).
800    ///
801    /// Not set if |response_channel| was set in the request.
802    pub archive: Option<Attachment>,
803    /// A vector of key-value string pairs. Keys are guaranteed to be unique.
804    ///
805    /// While the annotations are included in the ZIP archive itself, some clients also want them
806    /// separately to index or augment them so we provide them separately as well.
807    ///
808    /// # Deprecation
809    ///
810    /// Feedback is getting close to the limit defined by MAX_NUM_ANNOTATIONS_PROVIDED. Clients
811    /// should migrate to |annotations2|, which will include all annotations included in
812    /// |annotations| but has a higher limit for future growth.
813    pub annotations: Option<Vec<Annotation>>,
814    /// A vector of key-value string pairs. Keys are guaranteed to be unique.
815    ///
816    /// While the annotations are included in the ZIP archive itself, some clients also want them
817    /// separately to index or augment them so we provide them separately as well.
818    pub annotations2: Option<Vec<Annotation>>,
819    #[doc(hidden)]
820    pub __source_breaking: fidl::marker::SourceBreaking,
821}
822
823impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Snapshot {}
824
825/// Represents a specific crash report.
826///
827/// Add a new member when the server needs to special case how it handles certain annotations and
828/// attachments for a given type of crashes, e.g., a `RuntimeCrashReport` for Javascript.
829#[derive(Debug)]
830pub enum SpecificCrashReport {
831    /// Intended for a native exception.
832    Native(NativeCrashReport),
833    /// Intended for a Dart exception.
834    Dart(RuntimeCrashReport),
835    #[doc(hidden)]
836    __SourceBreaking { unknown_ordinal: u64 },
837}
838
839/// Pattern that matches an unknown `SpecificCrashReport` member.
840#[macro_export]
841macro_rules! SpecificCrashReportUnknown {
842    () => {
843        _
844    };
845}
846
847// Custom PartialEq so that unknown variants are not equal to themselves.
848impl PartialEq for SpecificCrashReport {
849    fn eq(&self, other: &Self) -> bool {
850        match (self, other) {
851            (Self::Native(x), Self::Native(y)) => *x == *y,
852            (Self::Dart(x), Self::Dart(y)) => *x == *y,
853            _ => false,
854        }
855    }
856}
857
858impl SpecificCrashReport {
859    #[inline]
860    pub fn ordinal(&self) -> u64 {
861        match *self {
862            Self::Native(_) => 2,
863            Self::Dart(_) => 3,
864            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
865        }
866    }
867
868    #[inline]
869    pub fn unknown_variant_for_testing() -> Self {
870        Self::__SourceBreaking { unknown_ordinal: 0 }
871    }
872
873    #[inline]
874    pub fn is_unknown(&self) -> bool {
875        match self {
876            Self::__SourceBreaking { .. } => true,
877            _ => false,
878        }
879    }
880}
881
882impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SpecificCrashReport {}
883
884#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
885pub struct ComponentDataRegisterMarker;
886
887impl fidl::endpoints::ProtocolMarker for ComponentDataRegisterMarker {
888    type Proxy = ComponentDataRegisterProxy;
889    type RequestStream = ComponentDataRegisterRequestStream;
890    #[cfg(target_os = "fuchsia")]
891    type SynchronousProxy = ComponentDataRegisterSynchronousProxy;
892
893    const DEBUG_NAME: &'static str = "fuchsia.feedback.ComponentDataRegister";
894}
895impl fidl::endpoints::DiscoverableProtocolMarker for ComponentDataRegisterMarker {}
896
897pub trait ComponentDataRegisterProxyInterface: Send + Sync {
898    type UpsertResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
899    fn r#upsert(&self, data: &ComponentData) -> Self::UpsertResponseFut;
900}
901#[derive(Debug)]
902#[cfg(target_os = "fuchsia")]
903pub struct ComponentDataRegisterSynchronousProxy {
904    client: fidl::client::sync::Client,
905}
906
907#[cfg(target_os = "fuchsia")]
908impl fidl::endpoints::SynchronousProxy for ComponentDataRegisterSynchronousProxy {
909    type Proxy = ComponentDataRegisterProxy;
910    type Protocol = ComponentDataRegisterMarker;
911
912    fn from_channel(inner: fidl::Channel) -> Self {
913        Self::new(inner)
914    }
915
916    fn into_channel(self) -> fidl::Channel {
917        self.client.into_channel()
918    }
919
920    fn as_channel(&self) -> &fidl::Channel {
921        self.client.as_channel()
922    }
923}
924
925#[cfg(target_os = "fuchsia")]
926impl ComponentDataRegisterSynchronousProxy {
927    pub fn new(channel: fidl::Channel) -> Self {
928        let protocol_name =
929            <ComponentDataRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
930        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
931    }
932
933    pub fn into_channel(self) -> fidl::Channel {
934        self.client.into_channel()
935    }
936
937    /// Waits until an event arrives and returns it. It is safe for other
938    /// threads to make concurrent requests while waiting for an event.
939    pub fn wait_for_event(
940        &self,
941        deadline: zx::MonotonicInstant,
942    ) -> Result<ComponentDataRegisterEvent, fidl::Error> {
943        ComponentDataRegisterEvent::decode(self.client.wait_for_event(deadline)?)
944    }
945
946    /// Upserts, i.e. updates or inserts, extra component data to be included in feedback reports.
947    ///
948    /// The namespace and each annotation key are used to decide whether to update or insert an
949    /// annotation. If an annotation is already present for a given key within the same namespace,
950    /// update the value, otherwise insert the annotation with that key under that namespace.
951    ///
952    /// For instance, assuming these are the data already held by the server (from previous calls
953    /// to Upsert()):
954    /// ```
955    /// {
956    ///   "bar": { # namespace
957    ///     "channel": "stable",
958    ///   },
959    ///   "foo": { # namespace
960    ///     "version": "0.2",
961    ///   }
962    /// }
963    /// ```
964    /// then:
965    /// ```
966    /// Upsert({
967    ///   "namespace": "bar",
968    ///   "annotations": [
969    ///     "version": "1.2.3.45",
970    ///     "channel": "beta",
971    ///   ]
972    /// })
973    /// ```
974    /// would result in the server now holding:
975    /// ```
976    /// {
977    ///   "bar": { # namespace
978    ///     "channel": "beta", # updated
979    ///     "version": "1.2.3.45" # inserted
980    ///   },
981    ///   "foo": { # namespace
982    ///     "version": "0.2", # untouched
983    ///   }
984    /// }
985    /// ```
986    ///
987    /// Note that the server will only hold at most MAX_NUM_ANNOTATIONS_PER_NAMESPACE distinct
988    /// annotation keys per namespace, picking up the latest values.
989    pub fn r#upsert(
990        &self,
991        mut data: &ComponentData,
992        ___deadline: zx::MonotonicInstant,
993    ) -> Result<(), fidl::Error> {
994        let _response = self
995            .client
996            .send_query::<ComponentDataRegisterUpsertRequest, fidl::encoding::EmptyPayload>(
997                (data,),
998                0xa25b7c4e125c0a1,
999                fidl::encoding::DynamicFlags::empty(),
1000                ___deadline,
1001            )?;
1002        Ok(_response)
1003    }
1004}
1005
1006#[derive(Debug, Clone)]
1007pub struct ComponentDataRegisterProxy {
1008    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1009}
1010
1011impl fidl::endpoints::Proxy for ComponentDataRegisterProxy {
1012    type Protocol = ComponentDataRegisterMarker;
1013
1014    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1015        Self::new(inner)
1016    }
1017
1018    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1019        self.client.into_channel().map_err(|client| Self { client })
1020    }
1021
1022    fn as_channel(&self) -> &::fidl::AsyncChannel {
1023        self.client.as_channel()
1024    }
1025}
1026
1027impl ComponentDataRegisterProxy {
1028    /// Create a new Proxy for fuchsia.feedback/ComponentDataRegister.
1029    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1030        let protocol_name =
1031            <ComponentDataRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1032        Self { client: fidl::client::Client::new(channel, protocol_name) }
1033    }
1034
1035    /// Get a Stream of events from the remote end of the protocol.
1036    ///
1037    /// # Panics
1038    ///
1039    /// Panics if the event stream was already taken.
1040    pub fn take_event_stream(&self) -> ComponentDataRegisterEventStream {
1041        ComponentDataRegisterEventStream { event_receiver: self.client.take_event_receiver() }
1042    }
1043
1044    /// Upserts, i.e. updates or inserts, extra component data to be included in feedback reports.
1045    ///
1046    /// The namespace and each annotation key are used to decide whether to update or insert an
1047    /// annotation. If an annotation is already present for a given key within the same namespace,
1048    /// update the value, otherwise insert the annotation with that key under that namespace.
1049    ///
1050    /// For instance, assuming these are the data already held by the server (from previous calls
1051    /// to Upsert()):
1052    /// ```
1053    /// {
1054    ///   "bar": { # namespace
1055    ///     "channel": "stable",
1056    ///   },
1057    ///   "foo": { # namespace
1058    ///     "version": "0.2",
1059    ///   }
1060    /// }
1061    /// ```
1062    /// then:
1063    /// ```
1064    /// Upsert({
1065    ///   "namespace": "bar",
1066    ///   "annotations": [
1067    ///     "version": "1.2.3.45",
1068    ///     "channel": "beta",
1069    ///   ]
1070    /// })
1071    /// ```
1072    /// would result in the server now holding:
1073    /// ```
1074    /// {
1075    ///   "bar": { # namespace
1076    ///     "channel": "beta", # updated
1077    ///     "version": "1.2.3.45" # inserted
1078    ///   },
1079    ///   "foo": { # namespace
1080    ///     "version": "0.2", # untouched
1081    ///   }
1082    /// }
1083    /// ```
1084    ///
1085    /// Note that the server will only hold at most MAX_NUM_ANNOTATIONS_PER_NAMESPACE distinct
1086    /// annotation keys per namespace, picking up the latest values.
1087    pub fn r#upsert(
1088        &self,
1089        mut data: &ComponentData,
1090    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1091        ComponentDataRegisterProxyInterface::r#upsert(self, data)
1092    }
1093}
1094
1095impl ComponentDataRegisterProxyInterface for ComponentDataRegisterProxy {
1096    type UpsertResponseFut =
1097        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1098    fn r#upsert(&self, mut data: &ComponentData) -> Self::UpsertResponseFut {
1099        fn _decode(
1100            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1101        ) -> Result<(), fidl::Error> {
1102            let _response = fidl::client::decode_transaction_body::<
1103                fidl::encoding::EmptyPayload,
1104                fidl::encoding::DefaultFuchsiaResourceDialect,
1105                0xa25b7c4e125c0a1,
1106            >(_buf?)?;
1107            Ok(_response)
1108        }
1109        self.client.send_query_and_decode::<ComponentDataRegisterUpsertRequest, ()>(
1110            (data,),
1111            0xa25b7c4e125c0a1,
1112            fidl::encoding::DynamicFlags::empty(),
1113            _decode,
1114        )
1115    }
1116}
1117
1118pub struct ComponentDataRegisterEventStream {
1119    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1120}
1121
1122impl std::marker::Unpin for ComponentDataRegisterEventStream {}
1123
1124impl futures::stream::FusedStream for ComponentDataRegisterEventStream {
1125    fn is_terminated(&self) -> bool {
1126        self.event_receiver.is_terminated()
1127    }
1128}
1129
1130impl futures::Stream for ComponentDataRegisterEventStream {
1131    type Item = Result<ComponentDataRegisterEvent, fidl::Error>;
1132
1133    fn poll_next(
1134        mut self: std::pin::Pin<&mut Self>,
1135        cx: &mut std::task::Context<'_>,
1136    ) -> std::task::Poll<Option<Self::Item>> {
1137        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1138            &mut self.event_receiver,
1139            cx
1140        )?) {
1141            Some(buf) => std::task::Poll::Ready(Some(ComponentDataRegisterEvent::decode(buf))),
1142            None => std::task::Poll::Ready(None),
1143        }
1144    }
1145}
1146
1147#[derive(Debug)]
1148pub enum ComponentDataRegisterEvent {}
1149
1150impl ComponentDataRegisterEvent {
1151    /// Decodes a message buffer as a [`ComponentDataRegisterEvent`].
1152    fn decode(
1153        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1154    ) -> Result<ComponentDataRegisterEvent, fidl::Error> {
1155        let (bytes, _handles) = buf.split_mut();
1156        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1157        debug_assert_eq!(tx_header.tx_id, 0);
1158        match tx_header.ordinal {
1159            _ => Err(fidl::Error::UnknownOrdinal {
1160                ordinal: tx_header.ordinal,
1161                protocol_name:
1162                    <ComponentDataRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1163            }),
1164        }
1165    }
1166}
1167
1168/// A Stream of incoming requests for fuchsia.feedback/ComponentDataRegister.
1169pub struct ComponentDataRegisterRequestStream {
1170    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1171    is_terminated: bool,
1172}
1173
1174impl std::marker::Unpin for ComponentDataRegisterRequestStream {}
1175
1176impl futures::stream::FusedStream for ComponentDataRegisterRequestStream {
1177    fn is_terminated(&self) -> bool {
1178        self.is_terminated
1179    }
1180}
1181
1182impl fidl::endpoints::RequestStream for ComponentDataRegisterRequestStream {
1183    type Protocol = ComponentDataRegisterMarker;
1184    type ControlHandle = ComponentDataRegisterControlHandle;
1185
1186    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1187        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1188    }
1189
1190    fn control_handle(&self) -> Self::ControlHandle {
1191        ComponentDataRegisterControlHandle { inner: self.inner.clone() }
1192    }
1193
1194    fn into_inner(
1195        self,
1196    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1197    {
1198        (self.inner, self.is_terminated)
1199    }
1200
1201    fn from_inner(
1202        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1203        is_terminated: bool,
1204    ) -> Self {
1205        Self { inner, is_terminated }
1206    }
1207}
1208
1209impl futures::Stream for ComponentDataRegisterRequestStream {
1210    type Item = Result<ComponentDataRegisterRequest, fidl::Error>;
1211
1212    fn poll_next(
1213        mut self: std::pin::Pin<&mut Self>,
1214        cx: &mut std::task::Context<'_>,
1215    ) -> std::task::Poll<Option<Self::Item>> {
1216        let this = &mut *self;
1217        if this.inner.check_shutdown(cx) {
1218            this.is_terminated = true;
1219            return std::task::Poll::Ready(None);
1220        }
1221        if this.is_terminated {
1222            panic!("polled ComponentDataRegisterRequestStream after completion");
1223        }
1224        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1225            |bytes, handles| {
1226                match this.inner.channel().read_etc(cx, bytes, handles) {
1227                    std::task::Poll::Ready(Ok(())) => {}
1228                    std::task::Poll::Pending => return std::task::Poll::Pending,
1229                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1230                        this.is_terminated = true;
1231                        return std::task::Poll::Ready(None);
1232                    }
1233                    std::task::Poll::Ready(Err(e)) => {
1234                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1235                            e.into(),
1236                        ))))
1237                    }
1238                }
1239
1240                // A message has been received from the channel
1241                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1242
1243                std::task::Poll::Ready(Some(match header.ordinal {
1244                0xa25b7c4e125c0a1 => {
1245                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1246                    let mut req = fidl::new_empty!(ComponentDataRegisterUpsertRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
1247                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ComponentDataRegisterUpsertRequest>(&header, _body_bytes, handles, &mut req)?;
1248                    let control_handle = ComponentDataRegisterControlHandle {
1249                        inner: this.inner.clone(),
1250                    };
1251                    Ok(ComponentDataRegisterRequest::Upsert {data: req.data,
1252
1253                        responder: ComponentDataRegisterUpsertResponder {
1254                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1255                            tx_id: header.tx_id,
1256                        },
1257                    })
1258                }
1259                _ => Err(fidl::Error::UnknownOrdinal {
1260                    ordinal: header.ordinal,
1261                    protocol_name: <ComponentDataRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1262                }),
1263            }))
1264            },
1265        )
1266    }
1267}
1268
1269/// Registers data useful to attach in feedback reports (crash, user feedback or bug reports).
1270///
1271/// This can be used by components to augment the data attached to all feedback reports. By default
1272/// the Feedback service attaches data exposed to the platform. This protocol is  useful for data
1273/// known by certain components in certain products, but that is not exposed to the platform.
1274///
1275/// The epitaph ZX_ERR_INVALID_ARGS indicates that the client is sending invalid requests. See
1276/// below for each request why they might be invalid.
1277///
1278/// The epitaph ZX_ERR_NO_RESOURCES indicates that the server can no longer store additional
1279/// component data and will not service new connections.
1280#[derive(Debug)]
1281pub enum ComponentDataRegisterRequest {
1282    /// Upserts, i.e. updates or inserts, extra component data to be included in feedback reports.
1283    ///
1284    /// The namespace and each annotation key are used to decide whether to update or insert an
1285    /// annotation. If an annotation is already present for a given key within the same namespace,
1286    /// update the value, otherwise insert the annotation with that key under that namespace.
1287    ///
1288    /// For instance, assuming these are the data already held by the server (from previous calls
1289    /// to Upsert()):
1290    /// ```
1291    /// {
1292    ///   "bar": { # namespace
1293    ///     "channel": "stable",
1294    ///   },
1295    ///   "foo": { # namespace
1296    ///     "version": "0.2",
1297    ///   }
1298    /// }
1299    /// ```
1300    /// then:
1301    /// ```
1302    /// Upsert({
1303    ///   "namespace": "bar",
1304    ///   "annotations": [
1305    ///     "version": "1.2.3.45",
1306    ///     "channel": "beta",
1307    ///   ]
1308    /// })
1309    /// ```
1310    /// would result in the server now holding:
1311    /// ```
1312    /// {
1313    ///   "bar": { # namespace
1314    ///     "channel": "beta", # updated
1315    ///     "version": "1.2.3.45" # inserted
1316    ///   },
1317    ///   "foo": { # namespace
1318    ///     "version": "0.2", # untouched
1319    ///   }
1320    /// }
1321    /// ```
1322    ///
1323    /// Note that the server will only hold at most MAX_NUM_ANNOTATIONS_PER_NAMESPACE distinct
1324    /// annotation keys per namespace, picking up the latest values.
1325    Upsert { data: ComponentData, responder: ComponentDataRegisterUpsertResponder },
1326}
1327
1328impl ComponentDataRegisterRequest {
1329    #[allow(irrefutable_let_patterns)]
1330    pub fn into_upsert(self) -> Option<(ComponentData, ComponentDataRegisterUpsertResponder)> {
1331        if let ComponentDataRegisterRequest::Upsert { data, responder } = self {
1332            Some((data, responder))
1333        } else {
1334            None
1335        }
1336    }
1337
1338    /// Name of the method defined in FIDL
1339    pub fn method_name(&self) -> &'static str {
1340        match *self {
1341            ComponentDataRegisterRequest::Upsert { .. } => "upsert",
1342        }
1343    }
1344}
1345
1346#[derive(Debug, Clone)]
1347pub struct ComponentDataRegisterControlHandle {
1348    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1349}
1350
1351impl fidl::endpoints::ControlHandle for ComponentDataRegisterControlHandle {
1352    fn shutdown(&self) {
1353        self.inner.shutdown()
1354    }
1355    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1356        self.inner.shutdown_with_epitaph(status)
1357    }
1358
1359    fn is_closed(&self) -> bool {
1360        self.inner.channel().is_closed()
1361    }
1362    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1363        self.inner.channel().on_closed()
1364    }
1365
1366    #[cfg(target_os = "fuchsia")]
1367    fn signal_peer(
1368        &self,
1369        clear_mask: zx::Signals,
1370        set_mask: zx::Signals,
1371    ) -> Result<(), zx_status::Status> {
1372        use fidl::Peered;
1373        self.inner.channel().signal_peer(clear_mask, set_mask)
1374    }
1375}
1376
1377impl ComponentDataRegisterControlHandle {}
1378
1379#[must_use = "FIDL methods require a response to be sent"]
1380#[derive(Debug)]
1381pub struct ComponentDataRegisterUpsertResponder {
1382    control_handle: std::mem::ManuallyDrop<ComponentDataRegisterControlHandle>,
1383    tx_id: u32,
1384}
1385
1386/// Set the the channel to be shutdown (see [`ComponentDataRegisterControlHandle::shutdown`])
1387/// if the responder is dropped without sending a response, so that the client
1388/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1389impl std::ops::Drop for ComponentDataRegisterUpsertResponder {
1390    fn drop(&mut self) {
1391        self.control_handle.shutdown();
1392        // Safety: drops once, never accessed again
1393        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1394    }
1395}
1396
1397impl fidl::endpoints::Responder for ComponentDataRegisterUpsertResponder {
1398    type ControlHandle = ComponentDataRegisterControlHandle;
1399
1400    fn control_handle(&self) -> &ComponentDataRegisterControlHandle {
1401        &self.control_handle
1402    }
1403
1404    fn drop_without_shutdown(mut self) {
1405        // Safety: drops once, never accessed again due to mem::forget
1406        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1407        // Prevent Drop from running (which would shut down the channel)
1408        std::mem::forget(self);
1409    }
1410}
1411
1412impl ComponentDataRegisterUpsertResponder {
1413    /// Sends a response to the FIDL transaction.
1414    ///
1415    /// Sets the channel to shutdown if an error occurs.
1416    pub fn send(self) -> Result<(), fidl::Error> {
1417        let _result = self.send_raw();
1418        if _result.is_err() {
1419            self.control_handle.shutdown();
1420        }
1421        self.drop_without_shutdown();
1422        _result
1423    }
1424
1425    /// Similar to "send" but does not shutdown the channel if an error occurs.
1426    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1427        let _result = self.send_raw();
1428        self.drop_without_shutdown();
1429        _result
1430    }
1431
1432    fn send_raw(&self) -> Result<(), fidl::Error> {
1433        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1434            (),
1435            self.tx_id,
1436            0xa25b7c4e125c0a1,
1437            fidl::encoding::DynamicFlags::empty(),
1438        )
1439    }
1440}
1441
1442#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1443pub struct CrashReporterMarker;
1444
1445impl fidl::endpoints::ProtocolMarker for CrashReporterMarker {
1446    type Proxy = CrashReporterProxy;
1447    type RequestStream = CrashReporterRequestStream;
1448    #[cfg(target_os = "fuchsia")]
1449    type SynchronousProxy = CrashReporterSynchronousProxy;
1450
1451    const DEBUG_NAME: &'static str = "fuchsia.feedback.CrashReporter";
1452}
1453impl fidl::endpoints::DiscoverableProtocolMarker for CrashReporterMarker {}
1454pub type CrashReporterFileReportResult = Result<FileReportResults, FilingError>;
1455
1456pub trait CrashReporterProxyInterface: Send + Sync {
1457    type FileReportResponseFut: std::future::Future<Output = Result<CrashReporterFileReportResult, fidl::Error>>
1458        + Send;
1459    fn r#file_report(&self, report: CrashReport) -> Self::FileReportResponseFut;
1460}
1461#[derive(Debug)]
1462#[cfg(target_os = "fuchsia")]
1463pub struct CrashReporterSynchronousProxy {
1464    client: fidl::client::sync::Client,
1465}
1466
1467#[cfg(target_os = "fuchsia")]
1468impl fidl::endpoints::SynchronousProxy for CrashReporterSynchronousProxy {
1469    type Proxy = CrashReporterProxy;
1470    type Protocol = CrashReporterMarker;
1471
1472    fn from_channel(inner: fidl::Channel) -> Self {
1473        Self::new(inner)
1474    }
1475
1476    fn into_channel(self) -> fidl::Channel {
1477        self.client.into_channel()
1478    }
1479
1480    fn as_channel(&self) -> &fidl::Channel {
1481        self.client.as_channel()
1482    }
1483}
1484
1485#[cfg(target_os = "fuchsia")]
1486impl CrashReporterSynchronousProxy {
1487    pub fn new(channel: fidl::Channel) -> Self {
1488        let protocol_name = <CrashReporterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1489        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1490    }
1491
1492    pub fn into_channel(self) -> fidl::Channel {
1493        self.client.into_channel()
1494    }
1495
1496    /// Waits until an event arrives and returns it. It is safe for other
1497    /// threads to make concurrent requests while waiting for an event.
1498    pub fn wait_for_event(
1499        &self,
1500        deadline: zx::MonotonicInstant,
1501    ) -> Result<CrashReporterEvent, fidl::Error> {
1502        CrashReporterEvent::decode(self.client.wait_for_event(deadline)?)
1503    }
1504
1505    /// Files a crash `report` and gives the final result of the operation.
1506    ///
1507    /// This could mean generating a crash report in a local crash report
1508    /// database or uploading the crash report to a remote crash server
1509    /// depending on the FIDL server's configuration.
1510    ///
1511    /// Warning: this could potentially take up to several minutes. Calling
1512    /// this function in a synchronous manner is not recommended.
1513    pub fn r#file_report(
1514        &self,
1515        mut report: CrashReport,
1516        ___deadline: zx::MonotonicInstant,
1517    ) -> Result<CrashReporterFileReportResult, fidl::Error> {
1518        let _response = self.client.send_query::<
1519            CrashReporterFileReportRequest,
1520            fidl::encoding::ResultType<CrashReporterFileReportResponse, FilingError>,
1521        >(
1522            (&mut report,),
1523            0x6f660f55b3160dd4,
1524            fidl::encoding::DynamicFlags::empty(),
1525            ___deadline,
1526        )?;
1527        Ok(_response.map(|x| x.results))
1528    }
1529}
1530
1531#[derive(Debug, Clone)]
1532pub struct CrashReporterProxy {
1533    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1534}
1535
1536impl fidl::endpoints::Proxy for CrashReporterProxy {
1537    type Protocol = CrashReporterMarker;
1538
1539    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1540        Self::new(inner)
1541    }
1542
1543    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1544        self.client.into_channel().map_err(|client| Self { client })
1545    }
1546
1547    fn as_channel(&self) -> &::fidl::AsyncChannel {
1548        self.client.as_channel()
1549    }
1550}
1551
1552impl CrashReporterProxy {
1553    /// Create a new Proxy for fuchsia.feedback/CrashReporter.
1554    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1555        let protocol_name = <CrashReporterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1556        Self { client: fidl::client::Client::new(channel, protocol_name) }
1557    }
1558
1559    /// Get a Stream of events from the remote end of the protocol.
1560    ///
1561    /// # Panics
1562    ///
1563    /// Panics if the event stream was already taken.
1564    pub fn take_event_stream(&self) -> CrashReporterEventStream {
1565        CrashReporterEventStream { event_receiver: self.client.take_event_receiver() }
1566    }
1567
1568    /// Files a crash `report` and gives the final result of the operation.
1569    ///
1570    /// This could mean generating a crash report in a local crash report
1571    /// database or uploading the crash report to a remote crash server
1572    /// depending on the FIDL server's configuration.
1573    ///
1574    /// Warning: this could potentially take up to several minutes. Calling
1575    /// this function in a synchronous manner is not recommended.
1576    pub fn r#file_report(
1577        &self,
1578        mut report: CrashReport,
1579    ) -> fidl::client::QueryResponseFut<
1580        CrashReporterFileReportResult,
1581        fidl::encoding::DefaultFuchsiaResourceDialect,
1582    > {
1583        CrashReporterProxyInterface::r#file_report(self, report)
1584    }
1585}
1586
1587impl CrashReporterProxyInterface for CrashReporterProxy {
1588    type FileReportResponseFut = fidl::client::QueryResponseFut<
1589        CrashReporterFileReportResult,
1590        fidl::encoding::DefaultFuchsiaResourceDialect,
1591    >;
1592    fn r#file_report(&self, mut report: CrashReport) -> Self::FileReportResponseFut {
1593        fn _decode(
1594            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1595        ) -> Result<CrashReporterFileReportResult, fidl::Error> {
1596            let _response = fidl::client::decode_transaction_body::<
1597                fidl::encoding::ResultType<CrashReporterFileReportResponse, FilingError>,
1598                fidl::encoding::DefaultFuchsiaResourceDialect,
1599                0x6f660f55b3160dd4,
1600            >(_buf?)?;
1601            Ok(_response.map(|x| x.results))
1602        }
1603        self.client
1604            .send_query_and_decode::<CrashReporterFileReportRequest, CrashReporterFileReportResult>(
1605                (&mut report,),
1606                0x6f660f55b3160dd4,
1607                fidl::encoding::DynamicFlags::empty(),
1608                _decode,
1609            )
1610    }
1611}
1612
1613pub struct CrashReporterEventStream {
1614    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1615}
1616
1617impl std::marker::Unpin for CrashReporterEventStream {}
1618
1619impl futures::stream::FusedStream for CrashReporterEventStream {
1620    fn is_terminated(&self) -> bool {
1621        self.event_receiver.is_terminated()
1622    }
1623}
1624
1625impl futures::Stream for CrashReporterEventStream {
1626    type Item = Result<CrashReporterEvent, fidl::Error>;
1627
1628    fn poll_next(
1629        mut self: std::pin::Pin<&mut Self>,
1630        cx: &mut std::task::Context<'_>,
1631    ) -> std::task::Poll<Option<Self::Item>> {
1632        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1633            &mut self.event_receiver,
1634            cx
1635        )?) {
1636            Some(buf) => std::task::Poll::Ready(Some(CrashReporterEvent::decode(buf))),
1637            None => std::task::Poll::Ready(None),
1638        }
1639    }
1640}
1641
1642#[derive(Debug)]
1643pub enum CrashReporterEvent {}
1644
1645impl CrashReporterEvent {
1646    /// Decodes a message buffer as a [`CrashReporterEvent`].
1647    fn decode(
1648        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1649    ) -> Result<CrashReporterEvent, fidl::Error> {
1650        let (bytes, _handles) = buf.split_mut();
1651        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1652        debug_assert_eq!(tx_header.tx_id, 0);
1653        match tx_header.ordinal {
1654            _ => Err(fidl::Error::UnknownOrdinal {
1655                ordinal: tx_header.ordinal,
1656                protocol_name: <CrashReporterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1657            }),
1658        }
1659    }
1660}
1661
1662/// A Stream of incoming requests for fuchsia.feedback/CrashReporter.
1663pub struct CrashReporterRequestStream {
1664    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1665    is_terminated: bool,
1666}
1667
1668impl std::marker::Unpin for CrashReporterRequestStream {}
1669
1670impl futures::stream::FusedStream for CrashReporterRequestStream {
1671    fn is_terminated(&self) -> bool {
1672        self.is_terminated
1673    }
1674}
1675
1676impl fidl::endpoints::RequestStream for CrashReporterRequestStream {
1677    type Protocol = CrashReporterMarker;
1678    type ControlHandle = CrashReporterControlHandle;
1679
1680    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1681        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1682    }
1683
1684    fn control_handle(&self) -> Self::ControlHandle {
1685        CrashReporterControlHandle { inner: self.inner.clone() }
1686    }
1687
1688    fn into_inner(
1689        self,
1690    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1691    {
1692        (self.inner, self.is_terminated)
1693    }
1694
1695    fn from_inner(
1696        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1697        is_terminated: bool,
1698    ) -> Self {
1699        Self { inner, is_terminated }
1700    }
1701}
1702
1703impl futures::Stream for CrashReporterRequestStream {
1704    type Item = Result<CrashReporterRequest, fidl::Error>;
1705
1706    fn poll_next(
1707        mut self: std::pin::Pin<&mut Self>,
1708        cx: &mut std::task::Context<'_>,
1709    ) -> std::task::Poll<Option<Self::Item>> {
1710        let this = &mut *self;
1711        if this.inner.check_shutdown(cx) {
1712            this.is_terminated = true;
1713            return std::task::Poll::Ready(None);
1714        }
1715        if this.is_terminated {
1716            panic!("polled CrashReporterRequestStream after completion");
1717        }
1718        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1719            |bytes, handles| {
1720                match this.inner.channel().read_etc(cx, bytes, handles) {
1721                    std::task::Poll::Ready(Ok(())) => {}
1722                    std::task::Poll::Pending => return std::task::Poll::Pending,
1723                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1724                        this.is_terminated = true;
1725                        return std::task::Poll::Ready(None);
1726                    }
1727                    std::task::Poll::Ready(Err(e)) => {
1728                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1729                            e.into(),
1730                        ))))
1731                    }
1732                }
1733
1734                // A message has been received from the channel
1735                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1736
1737                std::task::Poll::Ready(Some(match header.ordinal {
1738                    0x6f660f55b3160dd4 => {
1739                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1740                        let mut req = fidl::new_empty!(
1741                            CrashReporterFileReportRequest,
1742                            fidl::encoding::DefaultFuchsiaResourceDialect
1743                        );
1744                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CrashReporterFileReportRequest>(&header, _body_bytes, handles, &mut req)?;
1745                        let control_handle =
1746                            CrashReporterControlHandle { inner: this.inner.clone() };
1747                        Ok(CrashReporterRequest::FileReport {
1748                            report: req.report,
1749
1750                            responder: CrashReporterFileReportResponder {
1751                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1752                                tx_id: header.tx_id,
1753                            },
1754                        })
1755                    }
1756                    _ => Err(fidl::Error::UnknownOrdinal {
1757                        ordinal: header.ordinal,
1758                        protocol_name:
1759                            <CrashReporterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1760                    }),
1761                }))
1762            },
1763        )
1764    }
1765}
1766
1767/// Provides the ability to file crash reports.
1768#[derive(Debug)]
1769pub enum CrashReporterRequest {
1770    /// Files a crash `report` and gives the final result of the operation.
1771    ///
1772    /// This could mean generating a crash report in a local crash report
1773    /// database or uploading the crash report to a remote crash server
1774    /// depending on the FIDL server's configuration.
1775    ///
1776    /// Warning: this could potentially take up to several minutes. Calling
1777    /// this function in a synchronous manner is not recommended.
1778    FileReport { report: CrashReport, responder: CrashReporterFileReportResponder },
1779}
1780
1781impl CrashReporterRequest {
1782    #[allow(irrefutable_let_patterns)]
1783    pub fn into_file_report(self) -> Option<(CrashReport, CrashReporterFileReportResponder)> {
1784        if let CrashReporterRequest::FileReport { report, responder } = self {
1785            Some((report, responder))
1786        } else {
1787            None
1788        }
1789    }
1790
1791    /// Name of the method defined in FIDL
1792    pub fn method_name(&self) -> &'static str {
1793        match *self {
1794            CrashReporterRequest::FileReport { .. } => "file_report",
1795        }
1796    }
1797}
1798
1799#[derive(Debug, Clone)]
1800pub struct CrashReporterControlHandle {
1801    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1802}
1803
1804impl fidl::endpoints::ControlHandle for CrashReporterControlHandle {
1805    fn shutdown(&self) {
1806        self.inner.shutdown()
1807    }
1808    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1809        self.inner.shutdown_with_epitaph(status)
1810    }
1811
1812    fn is_closed(&self) -> bool {
1813        self.inner.channel().is_closed()
1814    }
1815    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1816        self.inner.channel().on_closed()
1817    }
1818
1819    #[cfg(target_os = "fuchsia")]
1820    fn signal_peer(
1821        &self,
1822        clear_mask: zx::Signals,
1823        set_mask: zx::Signals,
1824    ) -> Result<(), zx_status::Status> {
1825        use fidl::Peered;
1826        self.inner.channel().signal_peer(clear_mask, set_mask)
1827    }
1828}
1829
1830impl CrashReporterControlHandle {}
1831
1832#[must_use = "FIDL methods require a response to be sent"]
1833#[derive(Debug)]
1834pub struct CrashReporterFileReportResponder {
1835    control_handle: std::mem::ManuallyDrop<CrashReporterControlHandle>,
1836    tx_id: u32,
1837}
1838
1839/// Set the the channel to be shutdown (see [`CrashReporterControlHandle::shutdown`])
1840/// if the responder is dropped without sending a response, so that the client
1841/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1842impl std::ops::Drop for CrashReporterFileReportResponder {
1843    fn drop(&mut self) {
1844        self.control_handle.shutdown();
1845        // Safety: drops once, never accessed again
1846        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1847    }
1848}
1849
1850impl fidl::endpoints::Responder for CrashReporterFileReportResponder {
1851    type ControlHandle = CrashReporterControlHandle;
1852
1853    fn control_handle(&self) -> &CrashReporterControlHandle {
1854        &self.control_handle
1855    }
1856
1857    fn drop_without_shutdown(mut self) {
1858        // Safety: drops once, never accessed again due to mem::forget
1859        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1860        // Prevent Drop from running (which would shut down the channel)
1861        std::mem::forget(self);
1862    }
1863}
1864
1865impl CrashReporterFileReportResponder {
1866    /// Sends a response to the FIDL transaction.
1867    ///
1868    /// Sets the channel to shutdown if an error occurs.
1869    pub fn send(
1870        self,
1871        mut result: Result<&FileReportResults, FilingError>,
1872    ) -> Result<(), fidl::Error> {
1873        let _result = self.send_raw(result);
1874        if _result.is_err() {
1875            self.control_handle.shutdown();
1876        }
1877        self.drop_without_shutdown();
1878        _result
1879    }
1880
1881    /// Similar to "send" but does not shutdown the channel if an error occurs.
1882    pub fn send_no_shutdown_on_err(
1883        self,
1884        mut result: Result<&FileReportResults, FilingError>,
1885    ) -> Result<(), fidl::Error> {
1886        let _result = self.send_raw(result);
1887        self.drop_without_shutdown();
1888        _result
1889    }
1890
1891    fn send_raw(
1892        &self,
1893        mut result: Result<&FileReportResults, FilingError>,
1894    ) -> Result<(), fidl::Error> {
1895        self.control_handle.inner.send::<fidl::encoding::ResultType<
1896            CrashReporterFileReportResponse,
1897            FilingError,
1898        >>(
1899            result.map(|results| (results,)),
1900            self.tx_id,
1901            0x6f660f55b3160dd4,
1902            fidl::encoding::DynamicFlags::empty(),
1903        )
1904    }
1905}
1906
1907#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1908pub struct CrashReportingProductRegisterMarker;
1909
1910impl fidl::endpoints::ProtocolMarker for CrashReportingProductRegisterMarker {
1911    type Proxy = CrashReportingProductRegisterProxy;
1912    type RequestStream = CrashReportingProductRegisterRequestStream;
1913    #[cfg(target_os = "fuchsia")]
1914    type SynchronousProxy = CrashReportingProductRegisterSynchronousProxy;
1915
1916    const DEBUG_NAME: &'static str = "fuchsia.feedback.CrashReportingProductRegister";
1917}
1918impl fidl::endpoints::DiscoverableProtocolMarker for CrashReportingProductRegisterMarker {}
1919
1920pub trait CrashReportingProductRegisterProxyInterface: Send + Sync {
1921    fn r#upsert(
1922        &self,
1923        component_url: &str,
1924        product: &CrashReportingProduct,
1925    ) -> Result<(), fidl::Error>;
1926    type UpsertWithAckResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1927    fn r#upsert_with_ack(
1928        &self,
1929        component_url: &str,
1930        product: &CrashReportingProduct,
1931    ) -> Self::UpsertWithAckResponseFut;
1932}
1933#[derive(Debug)]
1934#[cfg(target_os = "fuchsia")]
1935pub struct CrashReportingProductRegisterSynchronousProxy {
1936    client: fidl::client::sync::Client,
1937}
1938
1939#[cfg(target_os = "fuchsia")]
1940impl fidl::endpoints::SynchronousProxy for CrashReportingProductRegisterSynchronousProxy {
1941    type Proxy = CrashReportingProductRegisterProxy;
1942    type Protocol = CrashReportingProductRegisterMarker;
1943
1944    fn from_channel(inner: fidl::Channel) -> Self {
1945        Self::new(inner)
1946    }
1947
1948    fn into_channel(self) -> fidl::Channel {
1949        self.client.into_channel()
1950    }
1951
1952    fn as_channel(&self) -> &fidl::Channel {
1953        self.client.as_channel()
1954    }
1955}
1956
1957#[cfg(target_os = "fuchsia")]
1958impl CrashReportingProductRegisterSynchronousProxy {
1959    pub fn new(channel: fidl::Channel) -> Self {
1960        let protocol_name =
1961            <CrashReportingProductRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1962        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1963    }
1964
1965    pub fn into_channel(self) -> fidl::Channel {
1966        self.client.into_channel()
1967    }
1968
1969    /// Waits until an event arrives and returns it. It is safe for other
1970    /// threads to make concurrent requests while waiting for an event.
1971    pub fn wait_for_event(
1972        &self,
1973        deadline: zx::MonotonicInstant,
1974    ) -> Result<CrashReportingProductRegisterEvent, fidl::Error> {
1975        CrashReportingProductRegisterEvent::decode(self.client.wait_for_event(deadline)?)
1976    }
1977
1978    /// Upserts, i.e. updates or inserts, a crash reporting product for a given component URL.
1979    ///
1980    /// A subsequent call to Upsert() for the same component URL overwrites the
1981    /// `CrashReportingProduct` for that component.
1982    ///
1983    /// Prefer UpsertWithAck() if the component also files crash reports itself, to avoid race
1984    /// conditions and mis-attribution.
1985    pub fn r#upsert(
1986        &self,
1987        mut component_url: &str,
1988        mut product: &CrashReportingProduct,
1989    ) -> Result<(), fidl::Error> {
1990        self.client.send::<CrashReportingProductRegisterUpsertRequest>(
1991            (component_url, product),
1992            0x668cdc9615c91d7f,
1993            fidl::encoding::DynamicFlags::empty(),
1994        )
1995    }
1996
1997    /// Upserts (see above) and notifies the client when the operation is complete.
1998    ///
1999    /// This allows clients to prevent races between filing crash reports and calls to Upsert.
2000    /// Otherwise if a crash report is filed before the upsert completes, the crash report will be
2001    /// attributed to the wrong product, leading to potentially incorrect crash data.
2002    pub fn r#upsert_with_ack(
2003        &self,
2004        mut component_url: &str,
2005        mut product: &CrashReportingProduct,
2006        ___deadline: zx::MonotonicInstant,
2007    ) -> Result<(), fidl::Error> {
2008        let _response = self.client.send_query::<
2009            CrashReportingProductRegisterUpsertWithAckRequest,
2010            fidl::encoding::EmptyPayload,
2011        >(
2012            (component_url, product,),
2013            0x4a4f1279b3439c9d,
2014            fidl::encoding::DynamicFlags::empty(),
2015            ___deadline,
2016        )?;
2017        Ok(_response)
2018    }
2019}
2020
2021#[derive(Debug, Clone)]
2022pub struct CrashReportingProductRegisterProxy {
2023    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2024}
2025
2026impl fidl::endpoints::Proxy for CrashReportingProductRegisterProxy {
2027    type Protocol = CrashReportingProductRegisterMarker;
2028
2029    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2030        Self::new(inner)
2031    }
2032
2033    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2034        self.client.into_channel().map_err(|client| Self { client })
2035    }
2036
2037    fn as_channel(&self) -> &::fidl::AsyncChannel {
2038        self.client.as_channel()
2039    }
2040}
2041
2042impl CrashReportingProductRegisterProxy {
2043    /// Create a new Proxy for fuchsia.feedback/CrashReportingProductRegister.
2044    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2045        let protocol_name =
2046            <CrashReportingProductRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2047        Self { client: fidl::client::Client::new(channel, protocol_name) }
2048    }
2049
2050    /// Get a Stream of events from the remote end of the protocol.
2051    ///
2052    /// # Panics
2053    ///
2054    /// Panics if the event stream was already taken.
2055    pub fn take_event_stream(&self) -> CrashReportingProductRegisterEventStream {
2056        CrashReportingProductRegisterEventStream {
2057            event_receiver: self.client.take_event_receiver(),
2058        }
2059    }
2060
2061    /// Upserts, i.e. updates or inserts, a crash reporting product for a given component URL.
2062    ///
2063    /// A subsequent call to Upsert() for the same component URL overwrites the
2064    /// `CrashReportingProduct` for that component.
2065    ///
2066    /// Prefer UpsertWithAck() if the component also files crash reports itself, to avoid race
2067    /// conditions and mis-attribution.
2068    pub fn r#upsert(
2069        &self,
2070        mut component_url: &str,
2071        mut product: &CrashReportingProduct,
2072    ) -> Result<(), fidl::Error> {
2073        CrashReportingProductRegisterProxyInterface::r#upsert(self, component_url, product)
2074    }
2075
2076    /// Upserts (see above) and notifies the client when the operation is complete.
2077    ///
2078    /// This allows clients to prevent races between filing crash reports and calls to Upsert.
2079    /// Otherwise if a crash report is filed before the upsert completes, the crash report will be
2080    /// attributed to the wrong product, leading to potentially incorrect crash data.
2081    pub fn r#upsert_with_ack(
2082        &self,
2083        mut component_url: &str,
2084        mut product: &CrashReportingProduct,
2085    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2086        CrashReportingProductRegisterProxyInterface::r#upsert_with_ack(self, component_url, product)
2087    }
2088}
2089
2090impl CrashReportingProductRegisterProxyInterface for CrashReportingProductRegisterProxy {
2091    fn r#upsert(
2092        &self,
2093        mut component_url: &str,
2094        mut product: &CrashReportingProduct,
2095    ) -> Result<(), fidl::Error> {
2096        self.client.send::<CrashReportingProductRegisterUpsertRequest>(
2097            (component_url, product),
2098            0x668cdc9615c91d7f,
2099            fidl::encoding::DynamicFlags::empty(),
2100        )
2101    }
2102
2103    type UpsertWithAckResponseFut =
2104        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2105    fn r#upsert_with_ack(
2106        &self,
2107        mut component_url: &str,
2108        mut product: &CrashReportingProduct,
2109    ) -> Self::UpsertWithAckResponseFut {
2110        fn _decode(
2111            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2112        ) -> Result<(), fidl::Error> {
2113            let _response = fidl::client::decode_transaction_body::<
2114                fidl::encoding::EmptyPayload,
2115                fidl::encoding::DefaultFuchsiaResourceDialect,
2116                0x4a4f1279b3439c9d,
2117            >(_buf?)?;
2118            Ok(_response)
2119        }
2120        self.client.send_query_and_decode::<CrashReportingProductRegisterUpsertWithAckRequest, ()>(
2121            (component_url, product),
2122            0x4a4f1279b3439c9d,
2123            fidl::encoding::DynamicFlags::empty(),
2124            _decode,
2125        )
2126    }
2127}
2128
2129pub struct CrashReportingProductRegisterEventStream {
2130    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2131}
2132
2133impl std::marker::Unpin for CrashReportingProductRegisterEventStream {}
2134
2135impl futures::stream::FusedStream for CrashReportingProductRegisterEventStream {
2136    fn is_terminated(&self) -> bool {
2137        self.event_receiver.is_terminated()
2138    }
2139}
2140
2141impl futures::Stream for CrashReportingProductRegisterEventStream {
2142    type Item = Result<CrashReportingProductRegisterEvent, fidl::Error>;
2143
2144    fn poll_next(
2145        mut self: std::pin::Pin<&mut Self>,
2146        cx: &mut std::task::Context<'_>,
2147    ) -> std::task::Poll<Option<Self::Item>> {
2148        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2149            &mut self.event_receiver,
2150            cx
2151        )?) {
2152            Some(buf) => {
2153                std::task::Poll::Ready(Some(CrashReportingProductRegisterEvent::decode(buf)))
2154            }
2155            None => std::task::Poll::Ready(None),
2156        }
2157    }
2158}
2159
2160#[derive(Debug)]
2161pub enum CrashReportingProductRegisterEvent {}
2162
2163impl CrashReportingProductRegisterEvent {
2164    /// Decodes a message buffer as a [`CrashReportingProductRegisterEvent`].
2165    fn decode(
2166        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2167    ) -> Result<CrashReportingProductRegisterEvent, fidl::Error> {
2168        let (bytes, _handles) = buf.split_mut();
2169        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2170        debug_assert_eq!(tx_header.tx_id, 0);
2171        match tx_header.ordinal {
2172            _ => Err(fidl::Error::UnknownOrdinal {
2173                ordinal: tx_header.ordinal,
2174                protocol_name: <CrashReportingProductRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2175            })
2176        }
2177    }
2178}
2179
2180/// A Stream of incoming requests for fuchsia.feedback/CrashReportingProductRegister.
2181pub struct CrashReportingProductRegisterRequestStream {
2182    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2183    is_terminated: bool,
2184}
2185
2186impl std::marker::Unpin for CrashReportingProductRegisterRequestStream {}
2187
2188impl futures::stream::FusedStream for CrashReportingProductRegisterRequestStream {
2189    fn is_terminated(&self) -> bool {
2190        self.is_terminated
2191    }
2192}
2193
2194impl fidl::endpoints::RequestStream for CrashReportingProductRegisterRequestStream {
2195    type Protocol = CrashReportingProductRegisterMarker;
2196    type ControlHandle = CrashReportingProductRegisterControlHandle;
2197
2198    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2199        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2200    }
2201
2202    fn control_handle(&self) -> Self::ControlHandle {
2203        CrashReportingProductRegisterControlHandle { inner: self.inner.clone() }
2204    }
2205
2206    fn into_inner(
2207        self,
2208    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2209    {
2210        (self.inner, self.is_terminated)
2211    }
2212
2213    fn from_inner(
2214        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2215        is_terminated: bool,
2216    ) -> Self {
2217        Self { inner, is_terminated }
2218    }
2219}
2220
2221impl futures::Stream for CrashReportingProductRegisterRequestStream {
2222    type Item = Result<CrashReportingProductRegisterRequest, fidl::Error>;
2223
2224    fn poll_next(
2225        mut self: std::pin::Pin<&mut Self>,
2226        cx: &mut std::task::Context<'_>,
2227    ) -> std::task::Poll<Option<Self::Item>> {
2228        let this = &mut *self;
2229        if this.inner.check_shutdown(cx) {
2230            this.is_terminated = true;
2231            return std::task::Poll::Ready(None);
2232        }
2233        if this.is_terminated {
2234            panic!("polled CrashReportingProductRegisterRequestStream after completion");
2235        }
2236        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2237            |bytes, handles| {
2238                match this.inner.channel().read_etc(cx, bytes, handles) {
2239                    std::task::Poll::Ready(Ok(())) => {}
2240                    std::task::Poll::Pending => return std::task::Poll::Pending,
2241                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2242                        this.is_terminated = true;
2243                        return std::task::Poll::Ready(None);
2244                    }
2245                    std::task::Poll::Ready(Err(e)) => {
2246                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2247                            e.into(),
2248                        ))))
2249                    }
2250                }
2251
2252                // A message has been received from the channel
2253                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2254
2255                std::task::Poll::Ready(Some(match header.ordinal {
2256                0x668cdc9615c91d7f => {
2257                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2258                    let mut req = fidl::new_empty!(CrashReportingProductRegisterUpsertRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2259                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CrashReportingProductRegisterUpsertRequest>(&header, _body_bytes, handles, &mut req)?;
2260                    let control_handle = CrashReportingProductRegisterControlHandle {
2261                        inner: this.inner.clone(),
2262                    };
2263                    Ok(CrashReportingProductRegisterRequest::Upsert {component_url: req.component_url,
2264product: req.product,
2265
2266                        control_handle,
2267                    })
2268                }
2269                0x4a4f1279b3439c9d => {
2270                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2271                    let mut req = fidl::new_empty!(CrashReportingProductRegisterUpsertWithAckRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2272                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CrashReportingProductRegisterUpsertWithAckRequest>(&header, _body_bytes, handles, &mut req)?;
2273                    let control_handle = CrashReportingProductRegisterControlHandle {
2274                        inner: this.inner.clone(),
2275                    };
2276                    Ok(CrashReportingProductRegisterRequest::UpsertWithAck {component_url: req.component_url,
2277product: req.product,
2278
2279                        responder: CrashReportingProductRegisterUpsertWithAckResponder {
2280                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2281                            tx_id: header.tx_id,
2282                        },
2283                    })
2284                }
2285                _ => Err(fidl::Error::UnknownOrdinal {
2286                    ordinal: header.ordinal,
2287                    protocol_name: <CrashReportingProductRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2288                }),
2289            }))
2290            },
2291        )
2292    }
2293}
2294
2295/// Allows a component to choose a different crash reporting product to file crashes for that
2296/// component under.
2297///
2298/// By default, all crashes detected by the platform are filed under a single product on the crash
2299/// server. This API allows components to choose their own product while still benefiting from the
2300/// platform's exception handling and crash reporting.
2301#[derive(Debug)]
2302pub enum CrashReportingProductRegisterRequest {
2303    /// Upserts, i.e. updates or inserts, a crash reporting product for a given component URL.
2304    ///
2305    /// A subsequent call to Upsert() for the same component URL overwrites the
2306    /// `CrashReportingProduct` for that component.
2307    ///
2308    /// Prefer UpsertWithAck() if the component also files crash reports itself, to avoid race
2309    /// conditions and mis-attribution.
2310    Upsert {
2311        component_url: String,
2312        product: CrashReportingProduct,
2313        control_handle: CrashReportingProductRegisterControlHandle,
2314    },
2315    /// Upserts (see above) and notifies the client when the operation is complete.
2316    ///
2317    /// This allows clients to prevent races between filing crash reports and calls to Upsert.
2318    /// Otherwise if a crash report is filed before the upsert completes, the crash report will be
2319    /// attributed to the wrong product, leading to potentially incorrect crash data.
2320    UpsertWithAck {
2321        component_url: String,
2322        product: CrashReportingProduct,
2323        responder: CrashReportingProductRegisterUpsertWithAckResponder,
2324    },
2325}
2326
2327impl CrashReportingProductRegisterRequest {
2328    #[allow(irrefutable_let_patterns)]
2329    pub fn into_upsert(
2330        self,
2331    ) -> Option<(String, CrashReportingProduct, CrashReportingProductRegisterControlHandle)> {
2332        if let CrashReportingProductRegisterRequest::Upsert {
2333            component_url,
2334            product,
2335            control_handle,
2336        } = self
2337        {
2338            Some((component_url, product, control_handle))
2339        } else {
2340            None
2341        }
2342    }
2343
2344    #[allow(irrefutable_let_patterns)]
2345    pub fn into_upsert_with_ack(
2346        self,
2347    ) -> Option<(String, CrashReportingProduct, CrashReportingProductRegisterUpsertWithAckResponder)>
2348    {
2349        if let CrashReportingProductRegisterRequest::UpsertWithAck {
2350            component_url,
2351            product,
2352            responder,
2353        } = self
2354        {
2355            Some((component_url, product, responder))
2356        } else {
2357            None
2358        }
2359    }
2360
2361    /// Name of the method defined in FIDL
2362    pub fn method_name(&self) -> &'static str {
2363        match *self {
2364            CrashReportingProductRegisterRequest::Upsert { .. } => "upsert",
2365            CrashReportingProductRegisterRequest::UpsertWithAck { .. } => "upsert_with_ack",
2366        }
2367    }
2368}
2369
2370#[derive(Debug, Clone)]
2371pub struct CrashReportingProductRegisterControlHandle {
2372    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2373}
2374
2375impl fidl::endpoints::ControlHandle for CrashReportingProductRegisterControlHandle {
2376    fn shutdown(&self) {
2377        self.inner.shutdown()
2378    }
2379    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2380        self.inner.shutdown_with_epitaph(status)
2381    }
2382
2383    fn is_closed(&self) -> bool {
2384        self.inner.channel().is_closed()
2385    }
2386    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2387        self.inner.channel().on_closed()
2388    }
2389
2390    #[cfg(target_os = "fuchsia")]
2391    fn signal_peer(
2392        &self,
2393        clear_mask: zx::Signals,
2394        set_mask: zx::Signals,
2395    ) -> Result<(), zx_status::Status> {
2396        use fidl::Peered;
2397        self.inner.channel().signal_peer(clear_mask, set_mask)
2398    }
2399}
2400
2401impl CrashReportingProductRegisterControlHandle {}
2402
2403#[must_use = "FIDL methods require a response to be sent"]
2404#[derive(Debug)]
2405pub struct CrashReportingProductRegisterUpsertWithAckResponder {
2406    control_handle: std::mem::ManuallyDrop<CrashReportingProductRegisterControlHandle>,
2407    tx_id: u32,
2408}
2409
2410/// Set the the channel to be shutdown (see [`CrashReportingProductRegisterControlHandle::shutdown`])
2411/// if the responder is dropped without sending a response, so that the client
2412/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2413impl std::ops::Drop for CrashReportingProductRegisterUpsertWithAckResponder {
2414    fn drop(&mut self) {
2415        self.control_handle.shutdown();
2416        // Safety: drops once, never accessed again
2417        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2418    }
2419}
2420
2421impl fidl::endpoints::Responder for CrashReportingProductRegisterUpsertWithAckResponder {
2422    type ControlHandle = CrashReportingProductRegisterControlHandle;
2423
2424    fn control_handle(&self) -> &CrashReportingProductRegisterControlHandle {
2425        &self.control_handle
2426    }
2427
2428    fn drop_without_shutdown(mut self) {
2429        // Safety: drops once, never accessed again due to mem::forget
2430        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2431        // Prevent Drop from running (which would shut down the channel)
2432        std::mem::forget(self);
2433    }
2434}
2435
2436impl CrashReportingProductRegisterUpsertWithAckResponder {
2437    /// Sends a response to the FIDL transaction.
2438    ///
2439    /// Sets the channel to shutdown if an error occurs.
2440    pub fn send(self) -> Result<(), fidl::Error> {
2441        let _result = self.send_raw();
2442        if _result.is_err() {
2443            self.control_handle.shutdown();
2444        }
2445        self.drop_without_shutdown();
2446        _result
2447    }
2448
2449    /// Similar to "send" but does not shutdown the channel if an error occurs.
2450    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2451        let _result = self.send_raw();
2452        self.drop_without_shutdown();
2453        _result
2454    }
2455
2456    fn send_raw(&self) -> Result<(), fidl::Error> {
2457        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2458            (),
2459            self.tx_id,
2460            0x4a4f1279b3439c9d,
2461            fidl::encoding::DynamicFlags::empty(),
2462        )
2463    }
2464}
2465
2466#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2467pub struct DataProviderMarker;
2468
2469impl fidl::endpoints::ProtocolMarker for DataProviderMarker {
2470    type Proxy = DataProviderProxy;
2471    type RequestStream = DataProviderRequestStream;
2472    #[cfg(target_os = "fuchsia")]
2473    type SynchronousProxy = DataProviderSynchronousProxy;
2474
2475    const DEBUG_NAME: &'static str = "fuchsia.feedback.DataProvider";
2476}
2477impl fidl::endpoints::DiscoverableProtocolMarker for DataProviderMarker {}
2478
2479pub trait DataProviderProxyInterface: Send + Sync {
2480    type GetSnapshotResponseFut: std::future::Future<Output = Result<Snapshot, fidl::Error>> + Send;
2481    fn r#get_snapshot(&self, params: GetSnapshotParameters) -> Self::GetSnapshotResponseFut;
2482    type GetScreenshotResponseFut: std::future::Future<Output = Result<Option<Box<Screenshot>>, fidl::Error>>
2483        + Send;
2484    fn r#get_screenshot(&self, encoding: ImageEncoding) -> Self::GetScreenshotResponseFut;
2485    type GetAnnotationsResponseFut: std::future::Future<Output = Result<Annotations, fidl::Error>>
2486        + Send;
2487    fn r#get_annotations(
2488        &self,
2489        params: &GetAnnotationsParameters,
2490    ) -> Self::GetAnnotationsResponseFut;
2491}
2492#[derive(Debug)]
2493#[cfg(target_os = "fuchsia")]
2494pub struct DataProviderSynchronousProxy {
2495    client: fidl::client::sync::Client,
2496}
2497
2498#[cfg(target_os = "fuchsia")]
2499impl fidl::endpoints::SynchronousProxy for DataProviderSynchronousProxy {
2500    type Proxy = DataProviderProxy;
2501    type Protocol = DataProviderMarker;
2502
2503    fn from_channel(inner: fidl::Channel) -> Self {
2504        Self::new(inner)
2505    }
2506
2507    fn into_channel(self) -> fidl::Channel {
2508        self.client.into_channel()
2509    }
2510
2511    fn as_channel(&self) -> &fidl::Channel {
2512        self.client.as_channel()
2513    }
2514}
2515
2516#[cfg(target_os = "fuchsia")]
2517impl DataProviderSynchronousProxy {
2518    pub fn new(channel: fidl::Channel) -> Self {
2519        let protocol_name = <DataProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2520        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2521    }
2522
2523    pub fn into_channel(self) -> fidl::Channel {
2524        self.client.into_channel()
2525    }
2526
2527    /// Waits until an event arrives and returns it. It is safe for other
2528    /// threads to make concurrent requests while waiting for an event.
2529    pub fn wait_for_event(
2530        &self,
2531        deadline: zx::MonotonicInstant,
2532    ) -> Result<DataProviderEvent, fidl::Error> {
2533        DataProviderEvent::decode(self.client.wait_for_event(deadline)?)
2534    }
2535
2536    /// Returns a snapshot of the device's state.
2537    ///
2538    /// `snapshot` may be empty if there was an issue generating the snapshot.
2539    pub fn r#get_snapshot(
2540        &self,
2541        mut params: GetSnapshotParameters,
2542        ___deadline: zx::MonotonicInstant,
2543    ) -> Result<Snapshot, fidl::Error> {
2544        let _response = self
2545            .client
2546            .send_query::<DataProviderGetSnapshotRequest, DataProviderGetSnapshotResponse>(
2547                (&mut params,),
2548                0x753649a04e5d0bc0,
2549                fidl::encoding::DynamicFlags::empty(),
2550                ___deadline,
2551            )?;
2552        Ok(_response.snapshot)
2553    }
2554
2555    /// Returns an image of the current view encoded in the provided `encoding`.
2556    ///
2557    /// `screenshot` may be null if the encoding is not supported, the device does not have a
2558    /// display, or there is not enough memory to allocate the screenshot image.
2559    ///
2560    /// The screenshot is provided separately from the snapshot as callers might want to block on
2561    /// this call before changing the view while collecting a snapshot in the background is fine.
2562    /// There are also a lot of clients that are not interested in the screenshot.
2563    pub fn r#get_screenshot(
2564        &self,
2565        mut encoding: ImageEncoding,
2566        ___deadline: zx::MonotonicInstant,
2567    ) -> Result<Option<Box<Screenshot>>, fidl::Error> {
2568        let _response = self
2569            .client
2570            .send_query::<DataProviderGetScreenshotRequest, DataProviderGetScreenshotResponse>(
2571                (encoding,),
2572                0x438c858494d1781,
2573                fidl::encoding::DynamicFlags::empty(),
2574                ___deadline,
2575            )?;
2576        Ok(_response.screenshot)
2577    }
2578
2579    /// Returns a set of annotations about the device's state.
2580    ///
2581    /// `annotations` may be empty if there was an issue collecting them.
2582    ///
2583    /// These are the same annotations as provided through GetSnapshot() - some clients only want
2584    /// the annotations while others want both the annotations and the snapshot and generating the
2585    /// snapshot can take significantly more time than collecting the annotations, e.g., logs are
2586    /// only part of the snapshot and not part of the annotations and can take some time.
2587    pub fn r#get_annotations(
2588        &self,
2589        mut params: &GetAnnotationsParameters,
2590        ___deadline: zx::MonotonicInstant,
2591    ) -> Result<Annotations, fidl::Error> {
2592        let _response = self
2593            .client
2594            .send_query::<DataProviderGetAnnotationsRequest, DataProviderGetAnnotationsResponse>(
2595                (params,),
2596                0x367b4b6afe4345d8,
2597                fidl::encoding::DynamicFlags::empty(),
2598                ___deadline,
2599            )?;
2600        Ok(_response.annotations)
2601    }
2602}
2603
2604#[derive(Debug, Clone)]
2605pub struct DataProviderProxy {
2606    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2607}
2608
2609impl fidl::endpoints::Proxy for DataProviderProxy {
2610    type Protocol = DataProviderMarker;
2611
2612    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2613        Self::new(inner)
2614    }
2615
2616    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2617        self.client.into_channel().map_err(|client| Self { client })
2618    }
2619
2620    fn as_channel(&self) -> &::fidl::AsyncChannel {
2621        self.client.as_channel()
2622    }
2623}
2624
2625impl DataProviderProxy {
2626    /// Create a new Proxy for fuchsia.feedback/DataProvider.
2627    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2628        let protocol_name = <DataProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2629        Self { client: fidl::client::Client::new(channel, protocol_name) }
2630    }
2631
2632    /// Get a Stream of events from the remote end of the protocol.
2633    ///
2634    /// # Panics
2635    ///
2636    /// Panics if the event stream was already taken.
2637    pub fn take_event_stream(&self) -> DataProviderEventStream {
2638        DataProviderEventStream { event_receiver: self.client.take_event_receiver() }
2639    }
2640
2641    /// Returns a snapshot of the device's state.
2642    ///
2643    /// `snapshot` may be empty if there was an issue generating the snapshot.
2644    pub fn r#get_snapshot(
2645        &self,
2646        mut params: GetSnapshotParameters,
2647    ) -> fidl::client::QueryResponseFut<Snapshot, fidl::encoding::DefaultFuchsiaResourceDialect>
2648    {
2649        DataProviderProxyInterface::r#get_snapshot(self, params)
2650    }
2651
2652    /// Returns an image of the current view encoded in the provided `encoding`.
2653    ///
2654    /// `screenshot` may be null if the encoding is not supported, the device does not have a
2655    /// display, or there is not enough memory to allocate the screenshot image.
2656    ///
2657    /// The screenshot is provided separately from the snapshot as callers might want to block on
2658    /// this call before changing the view while collecting a snapshot in the background is fine.
2659    /// There are also a lot of clients that are not interested in the screenshot.
2660    pub fn r#get_screenshot(
2661        &self,
2662        mut encoding: ImageEncoding,
2663    ) -> fidl::client::QueryResponseFut<
2664        Option<Box<Screenshot>>,
2665        fidl::encoding::DefaultFuchsiaResourceDialect,
2666    > {
2667        DataProviderProxyInterface::r#get_screenshot(self, encoding)
2668    }
2669
2670    /// Returns a set of annotations about the device's state.
2671    ///
2672    /// `annotations` may be empty if there was an issue collecting them.
2673    ///
2674    /// These are the same annotations as provided through GetSnapshot() - some clients only want
2675    /// the annotations while others want both the annotations and the snapshot and generating the
2676    /// snapshot can take significantly more time than collecting the annotations, e.g., logs are
2677    /// only part of the snapshot and not part of the annotations and can take some time.
2678    pub fn r#get_annotations(
2679        &self,
2680        mut params: &GetAnnotationsParameters,
2681    ) -> fidl::client::QueryResponseFut<Annotations, fidl::encoding::DefaultFuchsiaResourceDialect>
2682    {
2683        DataProviderProxyInterface::r#get_annotations(self, params)
2684    }
2685}
2686
2687impl DataProviderProxyInterface for DataProviderProxy {
2688    type GetSnapshotResponseFut =
2689        fidl::client::QueryResponseFut<Snapshot, fidl::encoding::DefaultFuchsiaResourceDialect>;
2690    fn r#get_snapshot(&self, mut params: GetSnapshotParameters) -> Self::GetSnapshotResponseFut {
2691        fn _decode(
2692            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2693        ) -> Result<Snapshot, fidl::Error> {
2694            let _response = fidl::client::decode_transaction_body::<
2695                DataProviderGetSnapshotResponse,
2696                fidl::encoding::DefaultFuchsiaResourceDialect,
2697                0x753649a04e5d0bc0,
2698            >(_buf?)?;
2699            Ok(_response.snapshot)
2700        }
2701        self.client.send_query_and_decode::<DataProviderGetSnapshotRequest, Snapshot>(
2702            (&mut params,),
2703            0x753649a04e5d0bc0,
2704            fidl::encoding::DynamicFlags::empty(),
2705            _decode,
2706        )
2707    }
2708
2709    type GetScreenshotResponseFut = fidl::client::QueryResponseFut<
2710        Option<Box<Screenshot>>,
2711        fidl::encoding::DefaultFuchsiaResourceDialect,
2712    >;
2713    fn r#get_screenshot(&self, mut encoding: ImageEncoding) -> Self::GetScreenshotResponseFut {
2714        fn _decode(
2715            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2716        ) -> Result<Option<Box<Screenshot>>, fidl::Error> {
2717            let _response = fidl::client::decode_transaction_body::<
2718                DataProviderGetScreenshotResponse,
2719                fidl::encoding::DefaultFuchsiaResourceDialect,
2720                0x438c858494d1781,
2721            >(_buf?)?;
2722            Ok(_response.screenshot)
2723        }
2724        self.client
2725            .send_query_and_decode::<DataProviderGetScreenshotRequest, Option<Box<Screenshot>>>(
2726                (encoding,),
2727                0x438c858494d1781,
2728                fidl::encoding::DynamicFlags::empty(),
2729                _decode,
2730            )
2731    }
2732
2733    type GetAnnotationsResponseFut =
2734        fidl::client::QueryResponseFut<Annotations, fidl::encoding::DefaultFuchsiaResourceDialect>;
2735    fn r#get_annotations(
2736        &self,
2737        mut params: &GetAnnotationsParameters,
2738    ) -> Self::GetAnnotationsResponseFut {
2739        fn _decode(
2740            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2741        ) -> Result<Annotations, fidl::Error> {
2742            let _response = fidl::client::decode_transaction_body::<
2743                DataProviderGetAnnotationsResponse,
2744                fidl::encoding::DefaultFuchsiaResourceDialect,
2745                0x367b4b6afe4345d8,
2746            >(_buf?)?;
2747            Ok(_response.annotations)
2748        }
2749        self.client.send_query_and_decode::<DataProviderGetAnnotationsRequest, Annotations>(
2750            (params,),
2751            0x367b4b6afe4345d8,
2752            fidl::encoding::DynamicFlags::empty(),
2753            _decode,
2754        )
2755    }
2756}
2757
2758pub struct DataProviderEventStream {
2759    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2760}
2761
2762impl std::marker::Unpin for DataProviderEventStream {}
2763
2764impl futures::stream::FusedStream for DataProviderEventStream {
2765    fn is_terminated(&self) -> bool {
2766        self.event_receiver.is_terminated()
2767    }
2768}
2769
2770impl futures::Stream for DataProviderEventStream {
2771    type Item = Result<DataProviderEvent, fidl::Error>;
2772
2773    fn poll_next(
2774        mut self: std::pin::Pin<&mut Self>,
2775        cx: &mut std::task::Context<'_>,
2776    ) -> std::task::Poll<Option<Self::Item>> {
2777        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2778            &mut self.event_receiver,
2779            cx
2780        )?) {
2781            Some(buf) => std::task::Poll::Ready(Some(DataProviderEvent::decode(buf))),
2782            None => std::task::Poll::Ready(None),
2783        }
2784    }
2785}
2786
2787#[derive(Debug)]
2788pub enum DataProviderEvent {}
2789
2790impl DataProviderEvent {
2791    /// Decodes a message buffer as a [`DataProviderEvent`].
2792    fn decode(
2793        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2794    ) -> Result<DataProviderEvent, fidl::Error> {
2795        let (bytes, _handles) = buf.split_mut();
2796        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2797        debug_assert_eq!(tx_header.tx_id, 0);
2798        match tx_header.ordinal {
2799            _ => Err(fidl::Error::UnknownOrdinal {
2800                ordinal: tx_header.ordinal,
2801                protocol_name: <DataProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2802            }),
2803        }
2804    }
2805}
2806
2807/// A Stream of incoming requests for fuchsia.feedback/DataProvider.
2808pub struct DataProviderRequestStream {
2809    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2810    is_terminated: bool,
2811}
2812
2813impl std::marker::Unpin for DataProviderRequestStream {}
2814
2815impl futures::stream::FusedStream for DataProviderRequestStream {
2816    fn is_terminated(&self) -> bool {
2817        self.is_terminated
2818    }
2819}
2820
2821impl fidl::endpoints::RequestStream for DataProviderRequestStream {
2822    type Protocol = DataProviderMarker;
2823    type ControlHandle = DataProviderControlHandle;
2824
2825    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2826        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2827    }
2828
2829    fn control_handle(&self) -> Self::ControlHandle {
2830        DataProviderControlHandle { inner: self.inner.clone() }
2831    }
2832
2833    fn into_inner(
2834        self,
2835    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2836    {
2837        (self.inner, self.is_terminated)
2838    }
2839
2840    fn from_inner(
2841        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2842        is_terminated: bool,
2843    ) -> Self {
2844        Self { inner, is_terminated }
2845    }
2846}
2847
2848impl futures::Stream for DataProviderRequestStream {
2849    type Item = Result<DataProviderRequest, fidl::Error>;
2850
2851    fn poll_next(
2852        mut self: std::pin::Pin<&mut Self>,
2853        cx: &mut std::task::Context<'_>,
2854    ) -> std::task::Poll<Option<Self::Item>> {
2855        let this = &mut *self;
2856        if this.inner.check_shutdown(cx) {
2857            this.is_terminated = true;
2858            return std::task::Poll::Ready(None);
2859        }
2860        if this.is_terminated {
2861            panic!("polled DataProviderRequestStream after completion");
2862        }
2863        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2864            |bytes, handles| {
2865                match this.inner.channel().read_etc(cx, bytes, handles) {
2866                    std::task::Poll::Ready(Ok(())) => {}
2867                    std::task::Poll::Pending => return std::task::Poll::Pending,
2868                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2869                        this.is_terminated = true;
2870                        return std::task::Poll::Ready(None);
2871                    }
2872                    std::task::Poll::Ready(Err(e)) => {
2873                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2874                            e.into(),
2875                        ))))
2876                    }
2877                }
2878
2879                // A message has been received from the channel
2880                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2881
2882                std::task::Poll::Ready(Some(match header.ordinal {
2883                    0x753649a04e5d0bc0 => {
2884                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2885                        let mut req = fidl::new_empty!(
2886                            DataProviderGetSnapshotRequest,
2887                            fidl::encoding::DefaultFuchsiaResourceDialect
2888                        );
2889                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DataProviderGetSnapshotRequest>(&header, _body_bytes, handles, &mut req)?;
2890                        let control_handle =
2891                            DataProviderControlHandle { inner: this.inner.clone() };
2892                        Ok(DataProviderRequest::GetSnapshot {
2893                            params: req.params,
2894
2895                            responder: DataProviderGetSnapshotResponder {
2896                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2897                                tx_id: header.tx_id,
2898                            },
2899                        })
2900                    }
2901                    0x438c858494d1781 => {
2902                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2903                        let mut req = fidl::new_empty!(
2904                            DataProviderGetScreenshotRequest,
2905                            fidl::encoding::DefaultFuchsiaResourceDialect
2906                        );
2907                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DataProviderGetScreenshotRequest>(&header, _body_bytes, handles, &mut req)?;
2908                        let control_handle =
2909                            DataProviderControlHandle { inner: this.inner.clone() };
2910                        Ok(DataProviderRequest::GetScreenshot {
2911                            encoding: req.encoding,
2912
2913                            responder: DataProviderGetScreenshotResponder {
2914                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2915                                tx_id: header.tx_id,
2916                            },
2917                        })
2918                    }
2919                    0x367b4b6afe4345d8 => {
2920                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2921                        let mut req = fidl::new_empty!(
2922                            DataProviderGetAnnotationsRequest,
2923                            fidl::encoding::DefaultFuchsiaResourceDialect
2924                        );
2925                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DataProviderGetAnnotationsRequest>(&header, _body_bytes, handles, &mut req)?;
2926                        let control_handle =
2927                            DataProviderControlHandle { inner: this.inner.clone() };
2928                        Ok(DataProviderRequest::GetAnnotations {
2929                            params: req.params,
2930
2931                            responder: DataProviderGetAnnotationsResponder {
2932                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2933                                tx_id: header.tx_id,
2934                            },
2935                        })
2936                    }
2937                    _ => Err(fidl::Error::UnknownOrdinal {
2938                        ordinal: header.ordinal,
2939                        protocol_name:
2940                            <DataProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2941                    }),
2942                }))
2943            },
2944        )
2945    }
2946}
2947
2948/// Provides data useful to attach to feedback reports, e.g., a crash report filed by the system, a
2949/// user feedback report filed by a user or a bug report filed by a developer.
2950#[derive(Debug)]
2951pub enum DataProviderRequest {
2952    /// Returns a snapshot of the device's state.
2953    ///
2954    /// `snapshot` may be empty if there was an issue generating the snapshot.
2955    GetSnapshot { params: GetSnapshotParameters, responder: DataProviderGetSnapshotResponder },
2956    /// Returns an image of the current view encoded in the provided `encoding`.
2957    ///
2958    /// `screenshot` may be null if the encoding is not supported, the device does not have a
2959    /// display, or there is not enough memory to allocate the screenshot image.
2960    ///
2961    /// The screenshot is provided separately from the snapshot as callers might want to block on
2962    /// this call before changing the view while collecting a snapshot in the background is fine.
2963    /// There are also a lot of clients that are not interested in the screenshot.
2964    GetScreenshot { encoding: ImageEncoding, responder: DataProviderGetScreenshotResponder },
2965    /// Returns a set of annotations about the device's state.
2966    ///
2967    /// `annotations` may be empty if there was an issue collecting them.
2968    ///
2969    /// These are the same annotations as provided through GetSnapshot() - some clients only want
2970    /// the annotations while others want both the annotations and the snapshot and generating the
2971    /// snapshot can take significantly more time than collecting the annotations, e.g., logs are
2972    /// only part of the snapshot and not part of the annotations and can take some time.
2973    GetAnnotations {
2974        params: GetAnnotationsParameters,
2975        responder: DataProviderGetAnnotationsResponder,
2976    },
2977}
2978
2979impl DataProviderRequest {
2980    #[allow(irrefutable_let_patterns)]
2981    pub fn into_get_snapshot(
2982        self,
2983    ) -> Option<(GetSnapshotParameters, DataProviderGetSnapshotResponder)> {
2984        if let DataProviderRequest::GetSnapshot { params, responder } = self {
2985            Some((params, responder))
2986        } else {
2987            None
2988        }
2989    }
2990
2991    #[allow(irrefutable_let_patterns)]
2992    pub fn into_get_screenshot(
2993        self,
2994    ) -> Option<(ImageEncoding, DataProviderGetScreenshotResponder)> {
2995        if let DataProviderRequest::GetScreenshot { encoding, responder } = self {
2996            Some((encoding, responder))
2997        } else {
2998            None
2999        }
3000    }
3001
3002    #[allow(irrefutable_let_patterns)]
3003    pub fn into_get_annotations(
3004        self,
3005    ) -> Option<(GetAnnotationsParameters, DataProviderGetAnnotationsResponder)> {
3006        if let DataProviderRequest::GetAnnotations { params, responder } = self {
3007            Some((params, responder))
3008        } else {
3009            None
3010        }
3011    }
3012
3013    /// Name of the method defined in FIDL
3014    pub fn method_name(&self) -> &'static str {
3015        match *self {
3016            DataProviderRequest::GetSnapshot { .. } => "get_snapshot",
3017            DataProviderRequest::GetScreenshot { .. } => "get_screenshot",
3018            DataProviderRequest::GetAnnotations { .. } => "get_annotations",
3019        }
3020    }
3021}
3022
3023#[derive(Debug, Clone)]
3024pub struct DataProviderControlHandle {
3025    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3026}
3027
3028impl fidl::endpoints::ControlHandle for DataProviderControlHandle {
3029    fn shutdown(&self) {
3030        self.inner.shutdown()
3031    }
3032    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3033        self.inner.shutdown_with_epitaph(status)
3034    }
3035
3036    fn is_closed(&self) -> bool {
3037        self.inner.channel().is_closed()
3038    }
3039    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3040        self.inner.channel().on_closed()
3041    }
3042
3043    #[cfg(target_os = "fuchsia")]
3044    fn signal_peer(
3045        &self,
3046        clear_mask: zx::Signals,
3047        set_mask: zx::Signals,
3048    ) -> Result<(), zx_status::Status> {
3049        use fidl::Peered;
3050        self.inner.channel().signal_peer(clear_mask, set_mask)
3051    }
3052}
3053
3054impl DataProviderControlHandle {}
3055
3056#[must_use = "FIDL methods require a response to be sent"]
3057#[derive(Debug)]
3058pub struct DataProviderGetSnapshotResponder {
3059    control_handle: std::mem::ManuallyDrop<DataProviderControlHandle>,
3060    tx_id: u32,
3061}
3062
3063/// Set the the channel to be shutdown (see [`DataProviderControlHandle::shutdown`])
3064/// if the responder is dropped without sending a response, so that the client
3065/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3066impl std::ops::Drop for DataProviderGetSnapshotResponder {
3067    fn drop(&mut self) {
3068        self.control_handle.shutdown();
3069        // Safety: drops once, never accessed again
3070        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3071    }
3072}
3073
3074impl fidl::endpoints::Responder for DataProviderGetSnapshotResponder {
3075    type ControlHandle = DataProviderControlHandle;
3076
3077    fn control_handle(&self) -> &DataProviderControlHandle {
3078        &self.control_handle
3079    }
3080
3081    fn drop_without_shutdown(mut self) {
3082        // Safety: drops once, never accessed again due to mem::forget
3083        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3084        // Prevent Drop from running (which would shut down the channel)
3085        std::mem::forget(self);
3086    }
3087}
3088
3089impl DataProviderGetSnapshotResponder {
3090    /// Sends a response to the FIDL transaction.
3091    ///
3092    /// Sets the channel to shutdown if an error occurs.
3093    pub fn send(self, mut snapshot: Snapshot) -> Result<(), fidl::Error> {
3094        let _result = self.send_raw(snapshot);
3095        if _result.is_err() {
3096            self.control_handle.shutdown();
3097        }
3098        self.drop_without_shutdown();
3099        _result
3100    }
3101
3102    /// Similar to "send" but does not shutdown the channel if an error occurs.
3103    pub fn send_no_shutdown_on_err(self, mut snapshot: Snapshot) -> Result<(), fidl::Error> {
3104        let _result = self.send_raw(snapshot);
3105        self.drop_without_shutdown();
3106        _result
3107    }
3108
3109    fn send_raw(&self, mut snapshot: Snapshot) -> Result<(), fidl::Error> {
3110        self.control_handle.inner.send::<DataProviderGetSnapshotResponse>(
3111            (&mut snapshot,),
3112            self.tx_id,
3113            0x753649a04e5d0bc0,
3114            fidl::encoding::DynamicFlags::empty(),
3115        )
3116    }
3117}
3118
3119#[must_use = "FIDL methods require a response to be sent"]
3120#[derive(Debug)]
3121pub struct DataProviderGetScreenshotResponder {
3122    control_handle: std::mem::ManuallyDrop<DataProviderControlHandle>,
3123    tx_id: u32,
3124}
3125
3126/// Set the the channel to be shutdown (see [`DataProviderControlHandle::shutdown`])
3127/// if the responder is dropped without sending a response, so that the client
3128/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3129impl std::ops::Drop for DataProviderGetScreenshotResponder {
3130    fn drop(&mut self) {
3131        self.control_handle.shutdown();
3132        // Safety: drops once, never accessed again
3133        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3134    }
3135}
3136
3137impl fidl::endpoints::Responder for DataProviderGetScreenshotResponder {
3138    type ControlHandle = DataProviderControlHandle;
3139
3140    fn control_handle(&self) -> &DataProviderControlHandle {
3141        &self.control_handle
3142    }
3143
3144    fn drop_without_shutdown(mut self) {
3145        // Safety: drops once, never accessed again due to mem::forget
3146        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3147        // Prevent Drop from running (which would shut down the channel)
3148        std::mem::forget(self);
3149    }
3150}
3151
3152impl DataProviderGetScreenshotResponder {
3153    /// Sends a response to the FIDL transaction.
3154    ///
3155    /// Sets the channel to shutdown if an error occurs.
3156    pub fn send(self, mut screenshot: Option<Screenshot>) -> Result<(), fidl::Error> {
3157        let _result = self.send_raw(screenshot);
3158        if _result.is_err() {
3159            self.control_handle.shutdown();
3160        }
3161        self.drop_without_shutdown();
3162        _result
3163    }
3164
3165    /// Similar to "send" but does not shutdown the channel if an error occurs.
3166    pub fn send_no_shutdown_on_err(
3167        self,
3168        mut screenshot: Option<Screenshot>,
3169    ) -> Result<(), fidl::Error> {
3170        let _result = self.send_raw(screenshot);
3171        self.drop_without_shutdown();
3172        _result
3173    }
3174
3175    fn send_raw(&self, mut screenshot: Option<Screenshot>) -> Result<(), fidl::Error> {
3176        self.control_handle.inner.send::<DataProviderGetScreenshotResponse>(
3177            (screenshot.as_mut(),),
3178            self.tx_id,
3179            0x438c858494d1781,
3180            fidl::encoding::DynamicFlags::empty(),
3181        )
3182    }
3183}
3184
3185#[must_use = "FIDL methods require a response to be sent"]
3186#[derive(Debug)]
3187pub struct DataProviderGetAnnotationsResponder {
3188    control_handle: std::mem::ManuallyDrop<DataProviderControlHandle>,
3189    tx_id: u32,
3190}
3191
3192/// Set the the channel to be shutdown (see [`DataProviderControlHandle::shutdown`])
3193/// if the responder is dropped without sending a response, so that the client
3194/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3195impl std::ops::Drop for DataProviderGetAnnotationsResponder {
3196    fn drop(&mut self) {
3197        self.control_handle.shutdown();
3198        // Safety: drops once, never accessed again
3199        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3200    }
3201}
3202
3203impl fidl::endpoints::Responder for DataProviderGetAnnotationsResponder {
3204    type ControlHandle = DataProviderControlHandle;
3205
3206    fn control_handle(&self) -> &DataProviderControlHandle {
3207        &self.control_handle
3208    }
3209
3210    fn drop_without_shutdown(mut self) {
3211        // Safety: drops once, never accessed again due to mem::forget
3212        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3213        // Prevent Drop from running (which would shut down the channel)
3214        std::mem::forget(self);
3215    }
3216}
3217
3218impl DataProviderGetAnnotationsResponder {
3219    /// Sends a response to the FIDL transaction.
3220    ///
3221    /// Sets the channel to shutdown if an error occurs.
3222    pub fn send(self, mut annotations: &Annotations) -> Result<(), fidl::Error> {
3223        let _result = self.send_raw(annotations);
3224        if _result.is_err() {
3225            self.control_handle.shutdown();
3226        }
3227        self.drop_without_shutdown();
3228        _result
3229    }
3230
3231    /// Similar to "send" but does not shutdown the channel if an error occurs.
3232    pub fn send_no_shutdown_on_err(self, mut annotations: &Annotations) -> Result<(), fidl::Error> {
3233        let _result = self.send_raw(annotations);
3234        self.drop_without_shutdown();
3235        _result
3236    }
3237
3238    fn send_raw(&self, mut annotations: &Annotations) -> Result<(), fidl::Error> {
3239        self.control_handle.inner.send::<DataProviderGetAnnotationsResponse>(
3240            (annotations,),
3241            self.tx_id,
3242            0x367b4b6afe4345d8,
3243            fidl::encoding::DynamicFlags::empty(),
3244        )
3245    }
3246}
3247
3248#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3249pub struct DeviceIdProviderMarker;
3250
3251impl fidl::endpoints::ProtocolMarker for DeviceIdProviderMarker {
3252    type Proxy = DeviceIdProviderProxy;
3253    type RequestStream = DeviceIdProviderRequestStream;
3254    #[cfg(target_os = "fuchsia")]
3255    type SynchronousProxy = DeviceIdProviderSynchronousProxy;
3256
3257    const DEBUG_NAME: &'static str = "fuchsia.feedback.DeviceIdProvider";
3258}
3259impl fidl::endpoints::DiscoverableProtocolMarker for DeviceIdProviderMarker {}
3260
3261pub trait DeviceIdProviderProxyInterface: Send + Sync {
3262    type GetIdResponseFut: std::future::Future<Output = Result<String, fidl::Error>> + Send;
3263    fn r#get_id(&self) -> Self::GetIdResponseFut;
3264}
3265#[derive(Debug)]
3266#[cfg(target_os = "fuchsia")]
3267pub struct DeviceIdProviderSynchronousProxy {
3268    client: fidl::client::sync::Client,
3269}
3270
3271#[cfg(target_os = "fuchsia")]
3272impl fidl::endpoints::SynchronousProxy for DeviceIdProviderSynchronousProxy {
3273    type Proxy = DeviceIdProviderProxy;
3274    type Protocol = DeviceIdProviderMarker;
3275
3276    fn from_channel(inner: fidl::Channel) -> Self {
3277        Self::new(inner)
3278    }
3279
3280    fn into_channel(self) -> fidl::Channel {
3281        self.client.into_channel()
3282    }
3283
3284    fn as_channel(&self) -> &fidl::Channel {
3285        self.client.as_channel()
3286    }
3287}
3288
3289#[cfg(target_os = "fuchsia")]
3290impl DeviceIdProviderSynchronousProxy {
3291    pub fn new(channel: fidl::Channel) -> Self {
3292        let protocol_name = <DeviceIdProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3293        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3294    }
3295
3296    pub fn into_channel(self) -> fidl::Channel {
3297        self.client.into_channel()
3298    }
3299
3300    /// Waits until an event arrives and returns it. It is safe for other
3301    /// threads to make concurrent requests while waiting for an event.
3302    pub fn wait_for_event(
3303        &self,
3304        deadline: zx::MonotonicInstant,
3305    ) -> Result<DeviceIdProviderEvent, fidl::Error> {
3306        DeviceIdProviderEvent::decode(self.client.wait_for_event(deadline)?)
3307    }
3308
3309    /// Returns the device's feedback ID.
3310    ///
3311    /// This method follows the hanging-get pattern and won't return a value until the ID since the
3312    /// last call has changed.
3313    pub fn r#get_id(&self, ___deadline: zx::MonotonicInstant) -> Result<String, fidl::Error> {
3314        let _response =
3315            self.client.send_query::<fidl::encoding::EmptyPayload, DeviceIdProviderGetIdResponse>(
3316                (),
3317                0xea7f28a243488dc,
3318                fidl::encoding::DynamicFlags::empty(),
3319                ___deadline,
3320            )?;
3321        Ok(_response.feedback_id)
3322    }
3323}
3324
3325#[derive(Debug, Clone)]
3326pub struct DeviceIdProviderProxy {
3327    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3328}
3329
3330impl fidl::endpoints::Proxy for DeviceIdProviderProxy {
3331    type Protocol = DeviceIdProviderMarker;
3332
3333    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3334        Self::new(inner)
3335    }
3336
3337    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3338        self.client.into_channel().map_err(|client| Self { client })
3339    }
3340
3341    fn as_channel(&self) -> &::fidl::AsyncChannel {
3342        self.client.as_channel()
3343    }
3344}
3345
3346impl DeviceIdProviderProxy {
3347    /// Create a new Proxy for fuchsia.feedback/DeviceIdProvider.
3348    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3349        let protocol_name = <DeviceIdProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3350        Self { client: fidl::client::Client::new(channel, protocol_name) }
3351    }
3352
3353    /// Get a Stream of events from the remote end of the protocol.
3354    ///
3355    /// # Panics
3356    ///
3357    /// Panics if the event stream was already taken.
3358    pub fn take_event_stream(&self) -> DeviceIdProviderEventStream {
3359        DeviceIdProviderEventStream { event_receiver: self.client.take_event_receiver() }
3360    }
3361
3362    /// Returns the device's feedback ID.
3363    ///
3364    /// This method follows the hanging-get pattern and won't return a value until the ID since the
3365    /// last call has changed.
3366    pub fn r#get_id(
3367        &self,
3368    ) -> fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect> {
3369        DeviceIdProviderProxyInterface::r#get_id(self)
3370    }
3371}
3372
3373impl DeviceIdProviderProxyInterface for DeviceIdProviderProxy {
3374    type GetIdResponseFut =
3375        fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect>;
3376    fn r#get_id(&self) -> Self::GetIdResponseFut {
3377        fn _decode(
3378            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3379        ) -> Result<String, fidl::Error> {
3380            let _response = fidl::client::decode_transaction_body::<
3381                DeviceIdProviderGetIdResponse,
3382                fidl::encoding::DefaultFuchsiaResourceDialect,
3383                0xea7f28a243488dc,
3384            >(_buf?)?;
3385            Ok(_response.feedback_id)
3386        }
3387        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, String>(
3388            (),
3389            0xea7f28a243488dc,
3390            fidl::encoding::DynamicFlags::empty(),
3391            _decode,
3392        )
3393    }
3394}
3395
3396pub struct DeviceIdProviderEventStream {
3397    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3398}
3399
3400impl std::marker::Unpin for DeviceIdProviderEventStream {}
3401
3402impl futures::stream::FusedStream for DeviceIdProviderEventStream {
3403    fn is_terminated(&self) -> bool {
3404        self.event_receiver.is_terminated()
3405    }
3406}
3407
3408impl futures::Stream for DeviceIdProviderEventStream {
3409    type Item = Result<DeviceIdProviderEvent, fidl::Error>;
3410
3411    fn poll_next(
3412        mut self: std::pin::Pin<&mut Self>,
3413        cx: &mut std::task::Context<'_>,
3414    ) -> std::task::Poll<Option<Self::Item>> {
3415        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3416            &mut self.event_receiver,
3417            cx
3418        )?) {
3419            Some(buf) => std::task::Poll::Ready(Some(DeviceIdProviderEvent::decode(buf))),
3420            None => std::task::Poll::Ready(None),
3421        }
3422    }
3423}
3424
3425#[derive(Debug)]
3426pub enum DeviceIdProviderEvent {}
3427
3428impl DeviceIdProviderEvent {
3429    /// Decodes a message buffer as a [`DeviceIdProviderEvent`].
3430    fn decode(
3431        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3432    ) -> Result<DeviceIdProviderEvent, fidl::Error> {
3433        let (bytes, _handles) = buf.split_mut();
3434        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3435        debug_assert_eq!(tx_header.tx_id, 0);
3436        match tx_header.ordinal {
3437            _ => Err(fidl::Error::UnknownOrdinal {
3438                ordinal: tx_header.ordinal,
3439                protocol_name:
3440                    <DeviceIdProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3441            }),
3442        }
3443    }
3444}
3445
3446/// A Stream of incoming requests for fuchsia.feedback/DeviceIdProvider.
3447pub struct DeviceIdProviderRequestStream {
3448    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3449    is_terminated: bool,
3450}
3451
3452impl std::marker::Unpin for DeviceIdProviderRequestStream {}
3453
3454impl futures::stream::FusedStream for DeviceIdProviderRequestStream {
3455    fn is_terminated(&self) -> bool {
3456        self.is_terminated
3457    }
3458}
3459
3460impl fidl::endpoints::RequestStream for DeviceIdProviderRequestStream {
3461    type Protocol = DeviceIdProviderMarker;
3462    type ControlHandle = DeviceIdProviderControlHandle;
3463
3464    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3465        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3466    }
3467
3468    fn control_handle(&self) -> Self::ControlHandle {
3469        DeviceIdProviderControlHandle { inner: self.inner.clone() }
3470    }
3471
3472    fn into_inner(
3473        self,
3474    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3475    {
3476        (self.inner, self.is_terminated)
3477    }
3478
3479    fn from_inner(
3480        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3481        is_terminated: bool,
3482    ) -> Self {
3483        Self { inner, is_terminated }
3484    }
3485}
3486
3487impl futures::Stream for DeviceIdProviderRequestStream {
3488    type Item = Result<DeviceIdProviderRequest, fidl::Error>;
3489
3490    fn poll_next(
3491        mut self: std::pin::Pin<&mut Self>,
3492        cx: &mut std::task::Context<'_>,
3493    ) -> std::task::Poll<Option<Self::Item>> {
3494        let this = &mut *self;
3495        if this.inner.check_shutdown(cx) {
3496            this.is_terminated = true;
3497            return std::task::Poll::Ready(None);
3498        }
3499        if this.is_terminated {
3500            panic!("polled DeviceIdProviderRequestStream after completion");
3501        }
3502        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3503            |bytes, handles| {
3504                match this.inner.channel().read_etc(cx, bytes, handles) {
3505                    std::task::Poll::Ready(Ok(())) => {}
3506                    std::task::Poll::Pending => return std::task::Poll::Pending,
3507                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3508                        this.is_terminated = true;
3509                        return std::task::Poll::Ready(None);
3510                    }
3511                    std::task::Poll::Ready(Err(e)) => {
3512                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3513                            e.into(),
3514                        ))))
3515                    }
3516                }
3517
3518                // A message has been received from the channel
3519                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3520
3521                std::task::Poll::Ready(Some(match header.ordinal {
3522                    0xea7f28a243488dc => {
3523                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3524                        let mut req = fidl::new_empty!(
3525                            fidl::encoding::EmptyPayload,
3526                            fidl::encoding::DefaultFuchsiaResourceDialect
3527                        );
3528                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3529                        let control_handle =
3530                            DeviceIdProviderControlHandle { inner: this.inner.clone() };
3531                        Ok(DeviceIdProviderRequest::GetId {
3532                            responder: DeviceIdProviderGetIdResponder {
3533                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3534                                tx_id: header.tx_id,
3535                            },
3536                        })
3537                    }
3538                    _ => Err(fidl::Error::UnknownOrdinal {
3539                        ordinal: header.ordinal,
3540                        protocol_name:
3541                            <DeviceIdProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3542                    }),
3543                }))
3544            },
3545        )
3546    }
3547}
3548
3549/// Provides the device's feedback ID.
3550///
3551/// The feedback ID is a persisted UUID used to group feedback reports. The ID
3552/// is not intended to be used for any reporting purposes other than feedback,
3553/// e.g., not intended to be used for telemetry.
3554#[derive(Debug)]
3555pub enum DeviceIdProviderRequest {
3556    /// Returns the device's feedback ID.
3557    ///
3558    /// This method follows the hanging-get pattern and won't return a value until the ID since the
3559    /// last call has changed.
3560    GetId { responder: DeviceIdProviderGetIdResponder },
3561}
3562
3563impl DeviceIdProviderRequest {
3564    #[allow(irrefutable_let_patterns)]
3565    pub fn into_get_id(self) -> Option<(DeviceIdProviderGetIdResponder)> {
3566        if let DeviceIdProviderRequest::GetId { responder } = self {
3567            Some((responder))
3568        } else {
3569            None
3570        }
3571    }
3572
3573    /// Name of the method defined in FIDL
3574    pub fn method_name(&self) -> &'static str {
3575        match *self {
3576            DeviceIdProviderRequest::GetId { .. } => "get_id",
3577        }
3578    }
3579}
3580
3581#[derive(Debug, Clone)]
3582pub struct DeviceIdProviderControlHandle {
3583    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3584}
3585
3586impl fidl::endpoints::ControlHandle for DeviceIdProviderControlHandle {
3587    fn shutdown(&self) {
3588        self.inner.shutdown()
3589    }
3590    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3591        self.inner.shutdown_with_epitaph(status)
3592    }
3593
3594    fn is_closed(&self) -> bool {
3595        self.inner.channel().is_closed()
3596    }
3597    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3598        self.inner.channel().on_closed()
3599    }
3600
3601    #[cfg(target_os = "fuchsia")]
3602    fn signal_peer(
3603        &self,
3604        clear_mask: zx::Signals,
3605        set_mask: zx::Signals,
3606    ) -> Result<(), zx_status::Status> {
3607        use fidl::Peered;
3608        self.inner.channel().signal_peer(clear_mask, set_mask)
3609    }
3610}
3611
3612impl DeviceIdProviderControlHandle {}
3613
3614#[must_use = "FIDL methods require a response to be sent"]
3615#[derive(Debug)]
3616pub struct DeviceIdProviderGetIdResponder {
3617    control_handle: std::mem::ManuallyDrop<DeviceIdProviderControlHandle>,
3618    tx_id: u32,
3619}
3620
3621/// Set the the channel to be shutdown (see [`DeviceIdProviderControlHandle::shutdown`])
3622/// if the responder is dropped without sending a response, so that the client
3623/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3624impl std::ops::Drop for DeviceIdProviderGetIdResponder {
3625    fn drop(&mut self) {
3626        self.control_handle.shutdown();
3627        // Safety: drops once, never accessed again
3628        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3629    }
3630}
3631
3632impl fidl::endpoints::Responder for DeviceIdProviderGetIdResponder {
3633    type ControlHandle = DeviceIdProviderControlHandle;
3634
3635    fn control_handle(&self) -> &DeviceIdProviderControlHandle {
3636        &self.control_handle
3637    }
3638
3639    fn drop_without_shutdown(mut self) {
3640        // Safety: drops once, never accessed again due to mem::forget
3641        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3642        // Prevent Drop from running (which would shut down the channel)
3643        std::mem::forget(self);
3644    }
3645}
3646
3647impl DeviceIdProviderGetIdResponder {
3648    /// Sends a response to the FIDL transaction.
3649    ///
3650    /// Sets the channel to shutdown if an error occurs.
3651    pub fn send(self, mut feedback_id: &str) -> Result<(), fidl::Error> {
3652        let _result = self.send_raw(feedback_id);
3653        if _result.is_err() {
3654            self.control_handle.shutdown();
3655        }
3656        self.drop_without_shutdown();
3657        _result
3658    }
3659
3660    /// Similar to "send" but does not shutdown the channel if an error occurs.
3661    pub fn send_no_shutdown_on_err(self, mut feedback_id: &str) -> Result<(), fidl::Error> {
3662        let _result = self.send_raw(feedback_id);
3663        self.drop_without_shutdown();
3664        _result
3665    }
3666
3667    fn send_raw(&self, mut feedback_id: &str) -> Result<(), fidl::Error> {
3668        self.control_handle.inner.send::<DeviceIdProviderGetIdResponse>(
3669            (feedback_id,),
3670            self.tx_id,
3671            0xea7f28a243488dc,
3672            fidl::encoding::DynamicFlags::empty(),
3673        )
3674    }
3675}
3676
3677#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3678pub struct LastRebootInfoProviderMarker;
3679
3680impl fidl::endpoints::ProtocolMarker for LastRebootInfoProviderMarker {
3681    type Proxy = LastRebootInfoProviderProxy;
3682    type RequestStream = LastRebootInfoProviderRequestStream;
3683    #[cfg(target_os = "fuchsia")]
3684    type SynchronousProxy = LastRebootInfoProviderSynchronousProxy;
3685
3686    const DEBUG_NAME: &'static str = "fuchsia.feedback.LastRebootInfoProvider";
3687}
3688impl fidl::endpoints::DiscoverableProtocolMarker for LastRebootInfoProviderMarker {}
3689
3690pub trait LastRebootInfoProviderProxyInterface: Send + Sync {
3691    type GetResponseFut: std::future::Future<Output = Result<LastReboot, fidl::Error>> + Send;
3692    fn r#get(&self) -> Self::GetResponseFut;
3693}
3694#[derive(Debug)]
3695#[cfg(target_os = "fuchsia")]
3696pub struct LastRebootInfoProviderSynchronousProxy {
3697    client: fidl::client::sync::Client,
3698}
3699
3700#[cfg(target_os = "fuchsia")]
3701impl fidl::endpoints::SynchronousProxy for LastRebootInfoProviderSynchronousProxy {
3702    type Proxy = LastRebootInfoProviderProxy;
3703    type Protocol = LastRebootInfoProviderMarker;
3704
3705    fn from_channel(inner: fidl::Channel) -> Self {
3706        Self::new(inner)
3707    }
3708
3709    fn into_channel(self) -> fidl::Channel {
3710        self.client.into_channel()
3711    }
3712
3713    fn as_channel(&self) -> &fidl::Channel {
3714        self.client.as_channel()
3715    }
3716}
3717
3718#[cfg(target_os = "fuchsia")]
3719impl LastRebootInfoProviderSynchronousProxy {
3720    pub fn new(channel: fidl::Channel) -> Self {
3721        let protocol_name =
3722            <LastRebootInfoProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3723        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3724    }
3725
3726    pub fn into_channel(self) -> fidl::Channel {
3727        self.client.into_channel()
3728    }
3729
3730    /// Waits until an event arrives and returns it. It is safe for other
3731    /// threads to make concurrent requests while waiting for an event.
3732    pub fn wait_for_event(
3733        &self,
3734        deadline: zx::MonotonicInstant,
3735    ) -> Result<LastRebootInfoProviderEvent, fidl::Error> {
3736        LastRebootInfoProviderEvent::decode(self.client.wait_for_event(deadline)?)
3737    }
3738
3739    pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<LastReboot, fidl::Error> {
3740        let _response = self
3741            .client
3742            .send_query::<fidl::encoding::EmptyPayload, LastRebootInfoProviderGetResponse>(
3743                (),
3744                0xbc32d10e081ffac,
3745                fidl::encoding::DynamicFlags::empty(),
3746                ___deadline,
3747            )?;
3748        Ok(_response.last_reboot)
3749    }
3750}
3751
3752#[derive(Debug, Clone)]
3753pub struct LastRebootInfoProviderProxy {
3754    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3755}
3756
3757impl fidl::endpoints::Proxy for LastRebootInfoProviderProxy {
3758    type Protocol = LastRebootInfoProviderMarker;
3759
3760    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3761        Self::new(inner)
3762    }
3763
3764    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3765        self.client.into_channel().map_err(|client| Self { client })
3766    }
3767
3768    fn as_channel(&self) -> &::fidl::AsyncChannel {
3769        self.client.as_channel()
3770    }
3771}
3772
3773impl LastRebootInfoProviderProxy {
3774    /// Create a new Proxy for fuchsia.feedback/LastRebootInfoProvider.
3775    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3776        let protocol_name =
3777            <LastRebootInfoProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3778        Self { client: fidl::client::Client::new(channel, protocol_name) }
3779    }
3780
3781    /// Get a Stream of events from the remote end of the protocol.
3782    ///
3783    /// # Panics
3784    ///
3785    /// Panics if the event stream was already taken.
3786    pub fn take_event_stream(&self) -> LastRebootInfoProviderEventStream {
3787        LastRebootInfoProviderEventStream { event_receiver: self.client.take_event_receiver() }
3788    }
3789
3790    pub fn r#get(
3791        &self,
3792    ) -> fidl::client::QueryResponseFut<LastReboot, fidl::encoding::DefaultFuchsiaResourceDialect>
3793    {
3794        LastRebootInfoProviderProxyInterface::r#get(self)
3795    }
3796}
3797
3798impl LastRebootInfoProviderProxyInterface for LastRebootInfoProviderProxy {
3799    type GetResponseFut =
3800        fidl::client::QueryResponseFut<LastReboot, fidl::encoding::DefaultFuchsiaResourceDialect>;
3801    fn r#get(&self) -> Self::GetResponseFut {
3802        fn _decode(
3803            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3804        ) -> Result<LastReboot, fidl::Error> {
3805            let _response = fidl::client::decode_transaction_body::<
3806                LastRebootInfoProviderGetResponse,
3807                fidl::encoding::DefaultFuchsiaResourceDialect,
3808                0xbc32d10e081ffac,
3809            >(_buf?)?;
3810            Ok(_response.last_reboot)
3811        }
3812        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, LastReboot>(
3813            (),
3814            0xbc32d10e081ffac,
3815            fidl::encoding::DynamicFlags::empty(),
3816            _decode,
3817        )
3818    }
3819}
3820
3821pub struct LastRebootInfoProviderEventStream {
3822    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3823}
3824
3825impl std::marker::Unpin for LastRebootInfoProviderEventStream {}
3826
3827impl futures::stream::FusedStream for LastRebootInfoProviderEventStream {
3828    fn is_terminated(&self) -> bool {
3829        self.event_receiver.is_terminated()
3830    }
3831}
3832
3833impl futures::Stream for LastRebootInfoProviderEventStream {
3834    type Item = Result<LastRebootInfoProviderEvent, fidl::Error>;
3835
3836    fn poll_next(
3837        mut self: std::pin::Pin<&mut Self>,
3838        cx: &mut std::task::Context<'_>,
3839    ) -> std::task::Poll<Option<Self::Item>> {
3840        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3841            &mut self.event_receiver,
3842            cx
3843        )?) {
3844            Some(buf) => std::task::Poll::Ready(Some(LastRebootInfoProviderEvent::decode(buf))),
3845            None => std::task::Poll::Ready(None),
3846        }
3847    }
3848}
3849
3850#[derive(Debug)]
3851pub enum LastRebootInfoProviderEvent {}
3852
3853impl LastRebootInfoProviderEvent {
3854    /// Decodes a message buffer as a [`LastRebootInfoProviderEvent`].
3855    fn decode(
3856        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3857    ) -> Result<LastRebootInfoProviderEvent, fidl::Error> {
3858        let (bytes, _handles) = buf.split_mut();
3859        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3860        debug_assert_eq!(tx_header.tx_id, 0);
3861        match tx_header.ordinal {
3862            _ => Err(fidl::Error::UnknownOrdinal {
3863                ordinal: tx_header.ordinal,
3864                protocol_name:
3865                    <LastRebootInfoProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3866            }),
3867        }
3868    }
3869}
3870
3871/// A Stream of incoming requests for fuchsia.feedback/LastRebootInfoProvider.
3872pub struct LastRebootInfoProviderRequestStream {
3873    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3874    is_terminated: bool,
3875}
3876
3877impl std::marker::Unpin for LastRebootInfoProviderRequestStream {}
3878
3879impl futures::stream::FusedStream for LastRebootInfoProviderRequestStream {
3880    fn is_terminated(&self) -> bool {
3881        self.is_terminated
3882    }
3883}
3884
3885impl fidl::endpoints::RequestStream for LastRebootInfoProviderRequestStream {
3886    type Protocol = LastRebootInfoProviderMarker;
3887    type ControlHandle = LastRebootInfoProviderControlHandle;
3888
3889    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3890        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3891    }
3892
3893    fn control_handle(&self) -> Self::ControlHandle {
3894        LastRebootInfoProviderControlHandle { inner: self.inner.clone() }
3895    }
3896
3897    fn into_inner(
3898        self,
3899    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3900    {
3901        (self.inner, self.is_terminated)
3902    }
3903
3904    fn from_inner(
3905        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3906        is_terminated: bool,
3907    ) -> Self {
3908        Self { inner, is_terminated }
3909    }
3910}
3911
3912impl futures::Stream for LastRebootInfoProviderRequestStream {
3913    type Item = Result<LastRebootInfoProviderRequest, fidl::Error>;
3914
3915    fn poll_next(
3916        mut self: std::pin::Pin<&mut Self>,
3917        cx: &mut std::task::Context<'_>,
3918    ) -> std::task::Poll<Option<Self::Item>> {
3919        let this = &mut *self;
3920        if this.inner.check_shutdown(cx) {
3921            this.is_terminated = true;
3922            return std::task::Poll::Ready(None);
3923        }
3924        if this.is_terminated {
3925            panic!("polled LastRebootInfoProviderRequestStream after completion");
3926        }
3927        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3928            |bytes, handles| {
3929                match this.inner.channel().read_etc(cx, bytes, handles) {
3930                    std::task::Poll::Ready(Ok(())) => {}
3931                    std::task::Poll::Pending => return std::task::Poll::Pending,
3932                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3933                        this.is_terminated = true;
3934                        return std::task::Poll::Ready(None);
3935                    }
3936                    std::task::Poll::Ready(Err(e)) => {
3937                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3938                            e.into(),
3939                        ))))
3940                    }
3941                }
3942
3943                // A message has been received from the channel
3944                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3945
3946                std::task::Poll::Ready(Some(match header.ordinal {
3947                0xbc32d10e081ffac => {
3948                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3949                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
3950                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3951                    let control_handle = LastRebootInfoProviderControlHandle {
3952                        inner: this.inner.clone(),
3953                    };
3954                    Ok(LastRebootInfoProviderRequest::Get {
3955                        responder: LastRebootInfoProviderGetResponder {
3956                            control_handle: std::mem::ManuallyDrop::new(control_handle),
3957                            tx_id: header.tx_id,
3958                        },
3959                    })
3960                }
3961                _ => Err(fidl::Error::UnknownOrdinal {
3962                    ordinal: header.ordinal,
3963                    protocol_name: <LastRebootInfoProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3964                }),
3965            }))
3966            },
3967        )
3968    }
3969}
3970
3971/// Get information about why a device last shutdown. The term reboot is used instead of shutdown
3972/// since many developers phrase their questions about shutdowns in terms of reboots and most
3973/// components are interested in knowing why the system just rebooted.
3974#[derive(Debug)]
3975pub enum LastRebootInfoProviderRequest {
3976    Get { responder: LastRebootInfoProviderGetResponder },
3977}
3978
3979impl LastRebootInfoProviderRequest {
3980    #[allow(irrefutable_let_patterns)]
3981    pub fn into_get(self) -> Option<(LastRebootInfoProviderGetResponder)> {
3982        if let LastRebootInfoProviderRequest::Get { responder } = self {
3983            Some((responder))
3984        } else {
3985            None
3986        }
3987    }
3988
3989    /// Name of the method defined in FIDL
3990    pub fn method_name(&self) -> &'static str {
3991        match *self {
3992            LastRebootInfoProviderRequest::Get { .. } => "get",
3993        }
3994    }
3995}
3996
3997#[derive(Debug, Clone)]
3998pub struct LastRebootInfoProviderControlHandle {
3999    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4000}
4001
4002impl fidl::endpoints::ControlHandle for LastRebootInfoProviderControlHandle {
4003    fn shutdown(&self) {
4004        self.inner.shutdown()
4005    }
4006    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4007        self.inner.shutdown_with_epitaph(status)
4008    }
4009
4010    fn is_closed(&self) -> bool {
4011        self.inner.channel().is_closed()
4012    }
4013    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4014        self.inner.channel().on_closed()
4015    }
4016
4017    #[cfg(target_os = "fuchsia")]
4018    fn signal_peer(
4019        &self,
4020        clear_mask: zx::Signals,
4021        set_mask: zx::Signals,
4022    ) -> Result<(), zx_status::Status> {
4023        use fidl::Peered;
4024        self.inner.channel().signal_peer(clear_mask, set_mask)
4025    }
4026}
4027
4028impl LastRebootInfoProviderControlHandle {}
4029
4030#[must_use = "FIDL methods require a response to be sent"]
4031#[derive(Debug)]
4032pub struct LastRebootInfoProviderGetResponder {
4033    control_handle: std::mem::ManuallyDrop<LastRebootInfoProviderControlHandle>,
4034    tx_id: u32,
4035}
4036
4037/// Set the the channel to be shutdown (see [`LastRebootInfoProviderControlHandle::shutdown`])
4038/// if the responder is dropped without sending a response, so that the client
4039/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4040impl std::ops::Drop for LastRebootInfoProviderGetResponder {
4041    fn drop(&mut self) {
4042        self.control_handle.shutdown();
4043        // Safety: drops once, never accessed again
4044        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4045    }
4046}
4047
4048impl fidl::endpoints::Responder for LastRebootInfoProviderGetResponder {
4049    type ControlHandle = LastRebootInfoProviderControlHandle;
4050
4051    fn control_handle(&self) -> &LastRebootInfoProviderControlHandle {
4052        &self.control_handle
4053    }
4054
4055    fn drop_without_shutdown(mut self) {
4056        // Safety: drops once, never accessed again due to mem::forget
4057        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4058        // Prevent Drop from running (which would shut down the channel)
4059        std::mem::forget(self);
4060    }
4061}
4062
4063impl LastRebootInfoProviderGetResponder {
4064    /// Sends a response to the FIDL transaction.
4065    ///
4066    /// Sets the channel to shutdown if an error occurs.
4067    pub fn send(self, mut last_reboot: &LastReboot) -> Result<(), fidl::Error> {
4068        let _result = self.send_raw(last_reboot);
4069        if _result.is_err() {
4070            self.control_handle.shutdown();
4071        }
4072        self.drop_without_shutdown();
4073        _result
4074    }
4075
4076    /// Similar to "send" but does not shutdown the channel if an error occurs.
4077    pub fn send_no_shutdown_on_err(self, mut last_reboot: &LastReboot) -> Result<(), fidl::Error> {
4078        let _result = self.send_raw(last_reboot);
4079        self.drop_without_shutdown();
4080        _result
4081    }
4082
4083    fn send_raw(&self, mut last_reboot: &LastReboot) -> Result<(), fidl::Error> {
4084        self.control_handle.inner.send::<LastRebootInfoProviderGetResponse>(
4085            (last_reboot,),
4086            self.tx_id,
4087            0xbc32d10e081ffac,
4088            fidl::encoding::DynamicFlags::empty(),
4089        )
4090    }
4091}
4092
4093mod internal {
4094    use super::*;
4095    unsafe impl fidl::encoding::TypeMarker for FilingError {
4096        type Owned = Self;
4097
4098        #[inline(always)]
4099        fn inline_align(_context: fidl::encoding::Context) -> usize {
4100            std::mem::align_of::<u32>()
4101        }
4102
4103        #[inline(always)]
4104        fn inline_size(_context: fidl::encoding::Context) -> usize {
4105            std::mem::size_of::<u32>()
4106        }
4107
4108        #[inline(always)]
4109        fn encode_is_copy() -> bool {
4110            false
4111        }
4112
4113        #[inline(always)]
4114        fn decode_is_copy() -> bool {
4115            false
4116        }
4117    }
4118
4119    impl fidl::encoding::ValueTypeMarker for FilingError {
4120        type Borrowed<'a> = Self;
4121        #[inline(always)]
4122        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4123            *value
4124        }
4125    }
4126
4127    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilingError {
4128        #[inline]
4129        unsafe fn encode(
4130            self,
4131            encoder: &mut fidl::encoding::Encoder<'_, D>,
4132            offset: usize,
4133            _depth: fidl::encoding::Depth,
4134        ) -> fidl::Result<()> {
4135            encoder.debug_check_bounds::<Self>(offset);
4136            encoder.write_num(self.into_primitive(), offset);
4137            Ok(())
4138        }
4139    }
4140
4141    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilingError {
4142        #[inline(always)]
4143        fn new_empty() -> Self {
4144            Self::unknown()
4145        }
4146
4147        #[inline]
4148        unsafe fn decode(
4149            &mut self,
4150            decoder: &mut fidl::encoding::Decoder<'_, D>,
4151            offset: usize,
4152            _depth: fidl::encoding::Depth,
4153        ) -> fidl::Result<()> {
4154            decoder.debug_check_bounds::<Self>(offset);
4155            let prim = decoder.read_num::<u32>(offset);
4156
4157            *self = Self::from_primitive_allow_unknown(prim);
4158            Ok(())
4159        }
4160    }
4161    unsafe impl fidl::encoding::TypeMarker for FilingSuccess {
4162        type Owned = Self;
4163
4164        #[inline(always)]
4165        fn inline_align(_context: fidl::encoding::Context) -> usize {
4166            std::mem::align_of::<u32>()
4167        }
4168
4169        #[inline(always)]
4170        fn inline_size(_context: fidl::encoding::Context) -> usize {
4171            std::mem::size_of::<u32>()
4172        }
4173
4174        #[inline(always)]
4175        fn encode_is_copy() -> bool {
4176            false
4177        }
4178
4179        #[inline(always)]
4180        fn decode_is_copy() -> bool {
4181            false
4182        }
4183    }
4184
4185    impl fidl::encoding::ValueTypeMarker for FilingSuccess {
4186        type Borrowed<'a> = Self;
4187        #[inline(always)]
4188        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4189            *value
4190        }
4191    }
4192
4193    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilingSuccess {
4194        #[inline]
4195        unsafe fn encode(
4196            self,
4197            encoder: &mut fidl::encoding::Encoder<'_, D>,
4198            offset: usize,
4199            _depth: fidl::encoding::Depth,
4200        ) -> fidl::Result<()> {
4201            encoder.debug_check_bounds::<Self>(offset);
4202            encoder.write_num(self.into_primitive(), offset);
4203            Ok(())
4204        }
4205    }
4206
4207    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilingSuccess {
4208        #[inline(always)]
4209        fn new_empty() -> Self {
4210            Self::unknown()
4211        }
4212
4213        #[inline]
4214        unsafe fn decode(
4215            &mut self,
4216            decoder: &mut fidl::encoding::Decoder<'_, D>,
4217            offset: usize,
4218            _depth: fidl::encoding::Depth,
4219        ) -> fidl::Result<()> {
4220            decoder.debug_check_bounds::<Self>(offset);
4221            let prim = decoder.read_num::<u32>(offset);
4222
4223            *self = Self::from_primitive_allow_unknown(prim);
4224            Ok(())
4225        }
4226    }
4227    unsafe impl fidl::encoding::TypeMarker for ImageEncoding {
4228        type Owned = Self;
4229
4230        #[inline(always)]
4231        fn inline_align(_context: fidl::encoding::Context) -> usize {
4232            std::mem::align_of::<u32>()
4233        }
4234
4235        #[inline(always)]
4236        fn inline_size(_context: fidl::encoding::Context) -> usize {
4237            std::mem::size_of::<u32>()
4238        }
4239
4240        #[inline(always)]
4241        fn encode_is_copy() -> bool {
4242            true
4243        }
4244
4245        #[inline(always)]
4246        fn decode_is_copy() -> bool {
4247            false
4248        }
4249    }
4250
4251    impl fidl::encoding::ValueTypeMarker for ImageEncoding {
4252        type Borrowed<'a> = Self;
4253        #[inline(always)]
4254        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4255            *value
4256        }
4257    }
4258
4259    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ImageEncoding {
4260        #[inline]
4261        unsafe fn encode(
4262            self,
4263            encoder: &mut fidl::encoding::Encoder<'_, D>,
4264            offset: usize,
4265            _depth: fidl::encoding::Depth,
4266        ) -> fidl::Result<()> {
4267            encoder.debug_check_bounds::<Self>(offset);
4268            encoder.write_num(self.into_primitive(), offset);
4269            Ok(())
4270        }
4271    }
4272
4273    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageEncoding {
4274        #[inline(always)]
4275        fn new_empty() -> Self {
4276            Self::Png
4277        }
4278
4279        #[inline]
4280        unsafe fn decode(
4281            &mut self,
4282            decoder: &mut fidl::encoding::Decoder<'_, D>,
4283            offset: usize,
4284            _depth: fidl::encoding::Depth,
4285        ) -> fidl::Result<()> {
4286            decoder.debug_check_bounds::<Self>(offset);
4287            let prim = decoder.read_num::<u32>(offset);
4288
4289            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4290            Ok(())
4291        }
4292    }
4293    unsafe impl fidl::encoding::TypeMarker for RebootReason {
4294        type Owned = Self;
4295
4296        #[inline(always)]
4297        fn inline_align(_context: fidl::encoding::Context) -> usize {
4298            std::mem::align_of::<u16>()
4299        }
4300
4301        #[inline(always)]
4302        fn inline_size(_context: fidl::encoding::Context) -> usize {
4303            std::mem::size_of::<u16>()
4304        }
4305
4306        #[inline(always)]
4307        fn encode_is_copy() -> bool {
4308            false
4309        }
4310
4311        #[inline(always)]
4312        fn decode_is_copy() -> bool {
4313            false
4314        }
4315    }
4316
4317    impl fidl::encoding::ValueTypeMarker for RebootReason {
4318        type Borrowed<'a> = Self;
4319        #[inline(always)]
4320        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4321            *value
4322        }
4323    }
4324
4325    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RebootReason {
4326        #[inline]
4327        unsafe fn encode(
4328            self,
4329            encoder: &mut fidl::encoding::Encoder<'_, D>,
4330            offset: usize,
4331            _depth: fidl::encoding::Depth,
4332        ) -> fidl::Result<()> {
4333            encoder.debug_check_bounds::<Self>(offset);
4334            encoder.write_num(self.into_primitive(), offset);
4335            Ok(())
4336        }
4337    }
4338
4339    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RebootReason {
4340        #[inline(always)]
4341        fn new_empty() -> Self {
4342            Self::unknown()
4343        }
4344
4345        #[inline]
4346        unsafe fn decode(
4347            &mut self,
4348            decoder: &mut fidl::encoding::Decoder<'_, D>,
4349            offset: usize,
4350            _depth: fidl::encoding::Depth,
4351        ) -> fidl::Result<()> {
4352            decoder.debug_check_bounds::<Self>(offset);
4353            let prim = decoder.read_num::<u16>(offset);
4354
4355            *self = Self::from_primitive_allow_unknown(prim);
4356            Ok(())
4357        }
4358    }
4359
4360    impl fidl::encoding::ValueTypeMarker for Annotation {
4361        type Borrowed<'a> = &'a Self;
4362        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4363            value
4364        }
4365    }
4366
4367    unsafe impl fidl::encoding::TypeMarker for Annotation {
4368        type Owned = Self;
4369
4370        #[inline(always)]
4371        fn inline_align(_context: fidl::encoding::Context) -> usize {
4372            8
4373        }
4374
4375        #[inline(always)]
4376        fn inline_size(_context: fidl::encoding::Context) -> usize {
4377            32
4378        }
4379    }
4380
4381    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Annotation, D>
4382        for &Annotation
4383    {
4384        #[inline]
4385        unsafe fn encode(
4386            self,
4387            encoder: &mut fidl::encoding::Encoder<'_, D>,
4388            offset: usize,
4389            _depth: fidl::encoding::Depth,
4390        ) -> fidl::Result<()> {
4391            encoder.debug_check_bounds::<Annotation>(offset);
4392            // Delegate to tuple encoding.
4393            fidl::encoding::Encode::<Annotation, D>::encode(
4394                (
4395                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
4396                    <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
4397                ),
4398                encoder, offset, _depth
4399            )
4400        }
4401    }
4402    unsafe impl<
4403            D: fidl::encoding::ResourceDialect,
4404            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
4405            T1: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>, D>,
4406        > fidl::encoding::Encode<Annotation, D> for (T0, T1)
4407    {
4408        #[inline]
4409        unsafe fn encode(
4410            self,
4411            encoder: &mut fidl::encoding::Encoder<'_, D>,
4412            offset: usize,
4413            depth: fidl::encoding::Depth,
4414        ) -> fidl::Result<()> {
4415            encoder.debug_check_bounds::<Annotation>(offset);
4416            // Zero out padding regions. There's no need to apply masks
4417            // because the unmasked parts will be overwritten by fields.
4418            // Write the fields.
4419            self.0.encode(encoder, offset + 0, depth)?;
4420            self.1.encode(encoder, offset + 16, depth)?;
4421            Ok(())
4422        }
4423    }
4424
4425    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Annotation {
4426        #[inline(always)]
4427        fn new_empty() -> Self {
4428            Self {
4429                key: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
4430                value: fidl::new_empty!(fidl::encoding::BoundedString<1024>, D),
4431            }
4432        }
4433
4434        #[inline]
4435        unsafe fn decode(
4436            &mut self,
4437            decoder: &mut fidl::encoding::Decoder<'_, D>,
4438            offset: usize,
4439            _depth: fidl::encoding::Depth,
4440        ) -> fidl::Result<()> {
4441            decoder.debug_check_bounds::<Self>(offset);
4442            // Verify that padding bytes are zero.
4443            fidl::decode!(
4444                fidl::encoding::BoundedString<128>,
4445                D,
4446                &mut self.key,
4447                decoder,
4448                offset + 0,
4449                _depth
4450            )?;
4451            fidl::decode!(
4452                fidl::encoding::BoundedString<1024>,
4453                D,
4454                &mut self.value,
4455                decoder,
4456                offset + 16,
4457                _depth
4458            )?;
4459            Ok(())
4460        }
4461    }
4462
4463    impl fidl::encoding::ResourceTypeMarker for Attachment {
4464        type Borrowed<'a> = &'a mut Self;
4465        fn take_or_borrow<'a>(
4466            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4467        ) -> Self::Borrowed<'a> {
4468            value
4469        }
4470    }
4471
4472    unsafe impl fidl::encoding::TypeMarker for Attachment {
4473        type Owned = Self;
4474
4475        #[inline(always)]
4476        fn inline_align(_context: fidl::encoding::Context) -> usize {
4477            8
4478        }
4479
4480        #[inline(always)]
4481        fn inline_size(_context: fidl::encoding::Context) -> usize {
4482            32
4483        }
4484    }
4485
4486    unsafe impl fidl::encoding::Encode<Attachment, fidl::encoding::DefaultFuchsiaResourceDialect>
4487        for &mut Attachment
4488    {
4489        #[inline]
4490        unsafe fn encode(
4491            self,
4492            encoder: &mut fidl::encoding::Encoder<
4493                '_,
4494                fidl::encoding::DefaultFuchsiaResourceDialect,
4495            >,
4496            offset: usize,
4497            _depth: fidl::encoding::Depth,
4498        ) -> fidl::Result<()> {
4499            encoder.debug_check_bounds::<Attachment>(offset);
4500            // Delegate to tuple encoding.
4501            fidl::encoding::Encode::<Attachment, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4502                (
4503                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
4504                    <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.value),
4505                ),
4506                encoder, offset, _depth
4507            )
4508        }
4509    }
4510    unsafe impl<
4511            T0: fidl::encoding::Encode<
4512                fidl::encoding::BoundedString<128>,
4513                fidl::encoding::DefaultFuchsiaResourceDialect,
4514            >,
4515            T1: fidl::encoding::Encode<
4516                fidl_fuchsia_mem::Buffer,
4517                fidl::encoding::DefaultFuchsiaResourceDialect,
4518            >,
4519        > fidl::encoding::Encode<Attachment, fidl::encoding::DefaultFuchsiaResourceDialect>
4520        for (T0, T1)
4521    {
4522        #[inline]
4523        unsafe fn encode(
4524            self,
4525            encoder: &mut fidl::encoding::Encoder<
4526                '_,
4527                fidl::encoding::DefaultFuchsiaResourceDialect,
4528            >,
4529            offset: usize,
4530            depth: fidl::encoding::Depth,
4531        ) -> fidl::Result<()> {
4532            encoder.debug_check_bounds::<Attachment>(offset);
4533            // Zero out padding regions. There's no need to apply masks
4534            // because the unmasked parts will be overwritten by fields.
4535            // Write the fields.
4536            self.0.encode(encoder, offset + 0, depth)?;
4537            self.1.encode(encoder, offset + 16, depth)?;
4538            Ok(())
4539        }
4540    }
4541
4542    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Attachment {
4543        #[inline(always)]
4544        fn new_empty() -> Self {
4545            Self {
4546                key: fidl::new_empty!(
4547                    fidl::encoding::BoundedString<128>,
4548                    fidl::encoding::DefaultFuchsiaResourceDialect
4549                ),
4550                value: fidl::new_empty!(
4551                    fidl_fuchsia_mem::Buffer,
4552                    fidl::encoding::DefaultFuchsiaResourceDialect
4553                ),
4554            }
4555        }
4556
4557        #[inline]
4558        unsafe fn decode(
4559            &mut self,
4560            decoder: &mut fidl::encoding::Decoder<
4561                '_,
4562                fidl::encoding::DefaultFuchsiaResourceDialect,
4563            >,
4564            offset: usize,
4565            _depth: fidl::encoding::Depth,
4566        ) -> fidl::Result<()> {
4567            decoder.debug_check_bounds::<Self>(offset);
4568            // Verify that padding bytes are zero.
4569            fidl::decode!(
4570                fidl::encoding::BoundedString<128>,
4571                fidl::encoding::DefaultFuchsiaResourceDialect,
4572                &mut self.key,
4573                decoder,
4574                offset + 0,
4575                _depth
4576            )?;
4577            fidl::decode!(
4578                fidl_fuchsia_mem::Buffer,
4579                fidl::encoding::DefaultFuchsiaResourceDialect,
4580                &mut self.value,
4581                decoder,
4582                offset + 16,
4583                _depth
4584            )?;
4585            Ok(())
4586        }
4587    }
4588
4589    impl fidl::encoding::ValueTypeMarker for ComponentDataRegisterUpsertRequest {
4590        type Borrowed<'a> = &'a Self;
4591        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4592            value
4593        }
4594    }
4595
4596    unsafe impl fidl::encoding::TypeMarker for ComponentDataRegisterUpsertRequest {
4597        type Owned = Self;
4598
4599        #[inline(always)]
4600        fn inline_align(_context: fidl::encoding::Context) -> usize {
4601            8
4602        }
4603
4604        #[inline(always)]
4605        fn inline_size(_context: fidl::encoding::Context) -> usize {
4606            16
4607        }
4608    }
4609
4610    unsafe impl<D: fidl::encoding::ResourceDialect>
4611        fidl::encoding::Encode<ComponentDataRegisterUpsertRequest, D>
4612        for &ComponentDataRegisterUpsertRequest
4613    {
4614        #[inline]
4615        unsafe fn encode(
4616            self,
4617            encoder: &mut fidl::encoding::Encoder<'_, D>,
4618            offset: usize,
4619            _depth: fidl::encoding::Depth,
4620        ) -> fidl::Result<()> {
4621            encoder.debug_check_bounds::<ComponentDataRegisterUpsertRequest>(offset);
4622            // Delegate to tuple encoding.
4623            fidl::encoding::Encode::<ComponentDataRegisterUpsertRequest, D>::encode(
4624                (<ComponentData as fidl::encoding::ValueTypeMarker>::borrow(&self.data),),
4625                encoder,
4626                offset,
4627                _depth,
4628            )
4629        }
4630    }
4631    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ComponentData, D>>
4632        fidl::encoding::Encode<ComponentDataRegisterUpsertRequest, D> for (T0,)
4633    {
4634        #[inline]
4635        unsafe fn encode(
4636            self,
4637            encoder: &mut fidl::encoding::Encoder<'_, D>,
4638            offset: usize,
4639            depth: fidl::encoding::Depth,
4640        ) -> fidl::Result<()> {
4641            encoder.debug_check_bounds::<ComponentDataRegisterUpsertRequest>(offset);
4642            // Zero out padding regions. There's no need to apply masks
4643            // because the unmasked parts will be overwritten by fields.
4644            // Write the fields.
4645            self.0.encode(encoder, offset + 0, depth)?;
4646            Ok(())
4647        }
4648    }
4649
4650    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4651        for ComponentDataRegisterUpsertRequest
4652    {
4653        #[inline(always)]
4654        fn new_empty() -> Self {
4655            Self { data: fidl::new_empty!(ComponentData, D) }
4656        }
4657
4658        #[inline]
4659        unsafe fn decode(
4660            &mut self,
4661            decoder: &mut fidl::encoding::Decoder<'_, D>,
4662            offset: usize,
4663            _depth: fidl::encoding::Depth,
4664        ) -> fidl::Result<()> {
4665            decoder.debug_check_bounds::<Self>(offset);
4666            // Verify that padding bytes are zero.
4667            fidl::decode!(ComponentData, D, &mut self.data, decoder, offset + 0, _depth)?;
4668            Ok(())
4669        }
4670    }
4671
4672    impl fidl::encoding::ResourceTypeMarker for CrashReporterFileReportRequest {
4673        type Borrowed<'a> = &'a mut Self;
4674        fn take_or_borrow<'a>(
4675            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4676        ) -> Self::Borrowed<'a> {
4677            value
4678        }
4679    }
4680
4681    unsafe impl fidl::encoding::TypeMarker for CrashReporterFileReportRequest {
4682        type Owned = Self;
4683
4684        #[inline(always)]
4685        fn inline_align(_context: fidl::encoding::Context) -> usize {
4686            8
4687        }
4688
4689        #[inline(always)]
4690        fn inline_size(_context: fidl::encoding::Context) -> usize {
4691            16
4692        }
4693    }
4694
4695    unsafe impl
4696        fidl::encoding::Encode<
4697            CrashReporterFileReportRequest,
4698            fidl::encoding::DefaultFuchsiaResourceDialect,
4699        > for &mut CrashReporterFileReportRequest
4700    {
4701        #[inline]
4702        unsafe fn encode(
4703            self,
4704            encoder: &mut fidl::encoding::Encoder<
4705                '_,
4706                fidl::encoding::DefaultFuchsiaResourceDialect,
4707            >,
4708            offset: usize,
4709            _depth: fidl::encoding::Depth,
4710        ) -> fidl::Result<()> {
4711            encoder.debug_check_bounds::<CrashReporterFileReportRequest>(offset);
4712            // Delegate to tuple encoding.
4713            fidl::encoding::Encode::<
4714                CrashReporterFileReportRequest,
4715                fidl::encoding::DefaultFuchsiaResourceDialect,
4716            >::encode(
4717                (<CrashReport as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4718                    &mut self.report,
4719                ),),
4720                encoder,
4721                offset,
4722                _depth,
4723            )
4724        }
4725    }
4726    unsafe impl<
4727            T0: fidl::encoding::Encode<CrashReport, fidl::encoding::DefaultFuchsiaResourceDialect>,
4728        >
4729        fidl::encoding::Encode<
4730            CrashReporterFileReportRequest,
4731            fidl::encoding::DefaultFuchsiaResourceDialect,
4732        > for (T0,)
4733    {
4734        #[inline]
4735        unsafe fn encode(
4736            self,
4737            encoder: &mut fidl::encoding::Encoder<
4738                '_,
4739                fidl::encoding::DefaultFuchsiaResourceDialect,
4740            >,
4741            offset: usize,
4742            depth: fidl::encoding::Depth,
4743        ) -> fidl::Result<()> {
4744            encoder.debug_check_bounds::<CrashReporterFileReportRequest>(offset);
4745            // Zero out padding regions. There's no need to apply masks
4746            // because the unmasked parts will be overwritten by fields.
4747            // Write the fields.
4748            self.0.encode(encoder, offset + 0, depth)?;
4749            Ok(())
4750        }
4751    }
4752
4753    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4754        for CrashReporterFileReportRequest
4755    {
4756        #[inline(always)]
4757        fn new_empty() -> Self {
4758            Self {
4759                report: fidl::new_empty!(
4760                    CrashReport,
4761                    fidl::encoding::DefaultFuchsiaResourceDialect
4762                ),
4763            }
4764        }
4765
4766        #[inline]
4767        unsafe fn decode(
4768            &mut self,
4769            decoder: &mut fidl::encoding::Decoder<
4770                '_,
4771                fidl::encoding::DefaultFuchsiaResourceDialect,
4772            >,
4773            offset: usize,
4774            _depth: fidl::encoding::Depth,
4775        ) -> fidl::Result<()> {
4776            decoder.debug_check_bounds::<Self>(offset);
4777            // Verify that padding bytes are zero.
4778            fidl::decode!(
4779                CrashReport,
4780                fidl::encoding::DefaultFuchsiaResourceDialect,
4781                &mut self.report,
4782                decoder,
4783                offset + 0,
4784                _depth
4785            )?;
4786            Ok(())
4787        }
4788    }
4789
4790    impl fidl::encoding::ValueTypeMarker for CrashReporterFileReportResponse {
4791        type Borrowed<'a> = &'a Self;
4792        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4793            value
4794        }
4795    }
4796
4797    unsafe impl fidl::encoding::TypeMarker for CrashReporterFileReportResponse {
4798        type Owned = Self;
4799
4800        #[inline(always)]
4801        fn inline_align(_context: fidl::encoding::Context) -> usize {
4802            8
4803        }
4804
4805        #[inline(always)]
4806        fn inline_size(_context: fidl::encoding::Context) -> usize {
4807            16
4808        }
4809    }
4810
4811    unsafe impl<D: fidl::encoding::ResourceDialect>
4812        fidl::encoding::Encode<CrashReporterFileReportResponse, D>
4813        for &CrashReporterFileReportResponse
4814    {
4815        #[inline]
4816        unsafe fn encode(
4817            self,
4818            encoder: &mut fidl::encoding::Encoder<'_, D>,
4819            offset: usize,
4820            _depth: fidl::encoding::Depth,
4821        ) -> fidl::Result<()> {
4822            encoder.debug_check_bounds::<CrashReporterFileReportResponse>(offset);
4823            // Delegate to tuple encoding.
4824            fidl::encoding::Encode::<CrashReporterFileReportResponse, D>::encode(
4825                (<FileReportResults as fidl::encoding::ValueTypeMarker>::borrow(&self.results),),
4826                encoder,
4827                offset,
4828                _depth,
4829            )
4830        }
4831    }
4832    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<FileReportResults, D>>
4833        fidl::encoding::Encode<CrashReporterFileReportResponse, D> for (T0,)
4834    {
4835        #[inline]
4836        unsafe fn encode(
4837            self,
4838            encoder: &mut fidl::encoding::Encoder<'_, D>,
4839            offset: usize,
4840            depth: fidl::encoding::Depth,
4841        ) -> fidl::Result<()> {
4842            encoder.debug_check_bounds::<CrashReporterFileReportResponse>(offset);
4843            // Zero out padding regions. There's no need to apply masks
4844            // because the unmasked parts will be overwritten by fields.
4845            // Write the fields.
4846            self.0.encode(encoder, offset + 0, depth)?;
4847            Ok(())
4848        }
4849    }
4850
4851    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4852        for CrashReporterFileReportResponse
4853    {
4854        #[inline(always)]
4855        fn new_empty() -> Self {
4856            Self { results: fidl::new_empty!(FileReportResults, D) }
4857        }
4858
4859        #[inline]
4860        unsafe fn decode(
4861            &mut self,
4862            decoder: &mut fidl::encoding::Decoder<'_, D>,
4863            offset: usize,
4864            _depth: fidl::encoding::Depth,
4865        ) -> fidl::Result<()> {
4866            decoder.debug_check_bounds::<Self>(offset);
4867            // Verify that padding bytes are zero.
4868            fidl::decode!(FileReportResults, D, &mut self.results, decoder, offset + 0, _depth)?;
4869            Ok(())
4870        }
4871    }
4872
4873    impl fidl::encoding::ValueTypeMarker for CrashReportingProductRegisterUpsertRequest {
4874        type Borrowed<'a> = &'a Self;
4875        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4876            value
4877        }
4878    }
4879
4880    unsafe impl fidl::encoding::TypeMarker for CrashReportingProductRegisterUpsertRequest {
4881        type Owned = Self;
4882
4883        #[inline(always)]
4884        fn inline_align(_context: fidl::encoding::Context) -> usize {
4885            8
4886        }
4887
4888        #[inline(always)]
4889        fn inline_size(_context: fidl::encoding::Context) -> usize {
4890            32
4891        }
4892    }
4893
4894    unsafe impl<D: fidl::encoding::ResourceDialect>
4895        fidl::encoding::Encode<CrashReportingProductRegisterUpsertRequest, D>
4896        for &CrashReportingProductRegisterUpsertRequest
4897    {
4898        #[inline]
4899        unsafe fn encode(
4900            self,
4901            encoder: &mut fidl::encoding::Encoder<'_, D>,
4902            offset: usize,
4903            _depth: fidl::encoding::Depth,
4904        ) -> fidl::Result<()> {
4905            encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertRequest>(offset);
4906            // Delegate to tuple encoding.
4907            fidl::encoding::Encode::<CrashReportingProductRegisterUpsertRequest, D>::encode(
4908                (
4909                    <fidl::encoding::BoundedString<2083> as fidl::encoding::ValueTypeMarker>::borrow(&self.component_url),
4910                    <CrashReportingProduct as fidl::encoding::ValueTypeMarker>::borrow(&self.product),
4911                ),
4912                encoder, offset, _depth
4913            )
4914        }
4915    }
4916    unsafe impl<
4917            D: fidl::encoding::ResourceDialect,
4918            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<2083>, D>,
4919            T1: fidl::encoding::Encode<CrashReportingProduct, D>,
4920        > fidl::encoding::Encode<CrashReportingProductRegisterUpsertRequest, D> for (T0, T1)
4921    {
4922        #[inline]
4923        unsafe fn encode(
4924            self,
4925            encoder: &mut fidl::encoding::Encoder<'_, D>,
4926            offset: usize,
4927            depth: fidl::encoding::Depth,
4928        ) -> fidl::Result<()> {
4929            encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertRequest>(offset);
4930            // Zero out padding regions. There's no need to apply masks
4931            // because the unmasked parts will be overwritten by fields.
4932            // Write the fields.
4933            self.0.encode(encoder, offset + 0, depth)?;
4934            self.1.encode(encoder, offset + 16, depth)?;
4935            Ok(())
4936        }
4937    }
4938
4939    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4940        for CrashReportingProductRegisterUpsertRequest
4941    {
4942        #[inline(always)]
4943        fn new_empty() -> Self {
4944            Self {
4945                component_url: fidl::new_empty!(fidl::encoding::BoundedString<2083>, D),
4946                product: fidl::new_empty!(CrashReportingProduct, D),
4947            }
4948        }
4949
4950        #[inline]
4951        unsafe fn decode(
4952            &mut self,
4953            decoder: &mut fidl::encoding::Decoder<'_, D>,
4954            offset: usize,
4955            _depth: fidl::encoding::Depth,
4956        ) -> fidl::Result<()> {
4957            decoder.debug_check_bounds::<Self>(offset);
4958            // Verify that padding bytes are zero.
4959            fidl::decode!(
4960                fidl::encoding::BoundedString<2083>,
4961                D,
4962                &mut self.component_url,
4963                decoder,
4964                offset + 0,
4965                _depth
4966            )?;
4967            fidl::decode!(
4968                CrashReportingProduct,
4969                D,
4970                &mut self.product,
4971                decoder,
4972                offset + 16,
4973                _depth
4974            )?;
4975            Ok(())
4976        }
4977    }
4978
4979    impl fidl::encoding::ValueTypeMarker for CrashReportingProductRegisterUpsertWithAckRequest {
4980        type Borrowed<'a> = &'a Self;
4981        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4982            value
4983        }
4984    }
4985
4986    unsafe impl fidl::encoding::TypeMarker for CrashReportingProductRegisterUpsertWithAckRequest {
4987        type Owned = Self;
4988
4989        #[inline(always)]
4990        fn inline_align(_context: fidl::encoding::Context) -> usize {
4991            8
4992        }
4993
4994        #[inline(always)]
4995        fn inline_size(_context: fidl::encoding::Context) -> usize {
4996            32
4997        }
4998    }
4999
5000    unsafe impl<D: fidl::encoding::ResourceDialect>
5001        fidl::encoding::Encode<CrashReportingProductRegisterUpsertWithAckRequest, D>
5002        for &CrashReportingProductRegisterUpsertWithAckRequest
5003    {
5004        #[inline]
5005        unsafe fn encode(
5006            self,
5007            encoder: &mut fidl::encoding::Encoder<'_, D>,
5008            offset: usize,
5009            _depth: fidl::encoding::Depth,
5010        ) -> fidl::Result<()> {
5011            encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertWithAckRequest>(offset);
5012            // Delegate to tuple encoding.
5013            fidl::encoding::Encode::<CrashReportingProductRegisterUpsertWithAckRequest, D>::encode(
5014                (
5015                    <fidl::encoding::BoundedString<2083> as fidl::encoding::ValueTypeMarker>::borrow(&self.component_url),
5016                    <CrashReportingProduct as fidl::encoding::ValueTypeMarker>::borrow(&self.product),
5017                ),
5018                encoder, offset, _depth
5019            )
5020        }
5021    }
5022    unsafe impl<
5023            D: fidl::encoding::ResourceDialect,
5024            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<2083>, D>,
5025            T1: fidl::encoding::Encode<CrashReportingProduct, D>,
5026        > fidl::encoding::Encode<CrashReportingProductRegisterUpsertWithAckRequest, D>
5027        for (T0, T1)
5028    {
5029        #[inline]
5030        unsafe fn encode(
5031            self,
5032            encoder: &mut fidl::encoding::Encoder<'_, D>,
5033            offset: usize,
5034            depth: fidl::encoding::Depth,
5035        ) -> fidl::Result<()> {
5036            encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertWithAckRequest>(offset);
5037            // Zero out padding regions. There's no need to apply masks
5038            // because the unmasked parts will be overwritten by fields.
5039            // Write the fields.
5040            self.0.encode(encoder, offset + 0, depth)?;
5041            self.1.encode(encoder, offset + 16, depth)?;
5042            Ok(())
5043        }
5044    }
5045
5046    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5047        for CrashReportingProductRegisterUpsertWithAckRequest
5048    {
5049        #[inline(always)]
5050        fn new_empty() -> Self {
5051            Self {
5052                component_url: fidl::new_empty!(fidl::encoding::BoundedString<2083>, D),
5053                product: fidl::new_empty!(CrashReportingProduct, D),
5054            }
5055        }
5056
5057        #[inline]
5058        unsafe fn decode(
5059            &mut self,
5060            decoder: &mut fidl::encoding::Decoder<'_, D>,
5061            offset: usize,
5062            _depth: fidl::encoding::Depth,
5063        ) -> fidl::Result<()> {
5064            decoder.debug_check_bounds::<Self>(offset);
5065            // Verify that padding bytes are zero.
5066            fidl::decode!(
5067                fidl::encoding::BoundedString<2083>,
5068                D,
5069                &mut self.component_url,
5070                decoder,
5071                offset + 0,
5072                _depth
5073            )?;
5074            fidl::decode!(
5075                CrashReportingProduct,
5076                D,
5077                &mut self.product,
5078                decoder,
5079                offset + 16,
5080                _depth
5081            )?;
5082            Ok(())
5083        }
5084    }
5085
5086    impl fidl::encoding::ValueTypeMarker for DataProviderGetAnnotationsRequest {
5087        type Borrowed<'a> = &'a Self;
5088        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5089            value
5090        }
5091    }
5092
5093    unsafe impl fidl::encoding::TypeMarker for DataProviderGetAnnotationsRequest {
5094        type Owned = Self;
5095
5096        #[inline(always)]
5097        fn inline_align(_context: fidl::encoding::Context) -> usize {
5098            8
5099        }
5100
5101        #[inline(always)]
5102        fn inline_size(_context: fidl::encoding::Context) -> usize {
5103            16
5104        }
5105    }
5106
5107    unsafe impl<D: fidl::encoding::ResourceDialect>
5108        fidl::encoding::Encode<DataProviderGetAnnotationsRequest, D>
5109        for &DataProviderGetAnnotationsRequest
5110    {
5111        #[inline]
5112        unsafe fn encode(
5113            self,
5114            encoder: &mut fidl::encoding::Encoder<'_, D>,
5115            offset: usize,
5116            _depth: fidl::encoding::Depth,
5117        ) -> fidl::Result<()> {
5118            encoder.debug_check_bounds::<DataProviderGetAnnotationsRequest>(offset);
5119            // Delegate to tuple encoding.
5120            fidl::encoding::Encode::<DataProviderGetAnnotationsRequest, D>::encode(
5121                (<GetAnnotationsParameters as fidl::encoding::ValueTypeMarker>::borrow(
5122                    &self.params,
5123                ),),
5124                encoder,
5125                offset,
5126                _depth,
5127            )
5128        }
5129    }
5130    unsafe impl<
5131            D: fidl::encoding::ResourceDialect,
5132            T0: fidl::encoding::Encode<GetAnnotationsParameters, D>,
5133        > fidl::encoding::Encode<DataProviderGetAnnotationsRequest, D> for (T0,)
5134    {
5135        #[inline]
5136        unsafe fn encode(
5137            self,
5138            encoder: &mut fidl::encoding::Encoder<'_, D>,
5139            offset: usize,
5140            depth: fidl::encoding::Depth,
5141        ) -> fidl::Result<()> {
5142            encoder.debug_check_bounds::<DataProviderGetAnnotationsRequest>(offset);
5143            // Zero out padding regions. There's no need to apply masks
5144            // because the unmasked parts will be overwritten by fields.
5145            // Write the fields.
5146            self.0.encode(encoder, offset + 0, depth)?;
5147            Ok(())
5148        }
5149    }
5150
5151    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5152        for DataProviderGetAnnotationsRequest
5153    {
5154        #[inline(always)]
5155        fn new_empty() -> Self {
5156            Self { params: fidl::new_empty!(GetAnnotationsParameters, D) }
5157        }
5158
5159        #[inline]
5160        unsafe fn decode(
5161            &mut self,
5162            decoder: &mut fidl::encoding::Decoder<'_, D>,
5163            offset: usize,
5164            _depth: fidl::encoding::Depth,
5165        ) -> fidl::Result<()> {
5166            decoder.debug_check_bounds::<Self>(offset);
5167            // Verify that padding bytes are zero.
5168            fidl::decode!(
5169                GetAnnotationsParameters,
5170                D,
5171                &mut self.params,
5172                decoder,
5173                offset + 0,
5174                _depth
5175            )?;
5176            Ok(())
5177        }
5178    }
5179
5180    impl fidl::encoding::ValueTypeMarker for DataProviderGetAnnotationsResponse {
5181        type Borrowed<'a> = &'a Self;
5182        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5183            value
5184        }
5185    }
5186
5187    unsafe impl fidl::encoding::TypeMarker for DataProviderGetAnnotationsResponse {
5188        type Owned = Self;
5189
5190        #[inline(always)]
5191        fn inline_align(_context: fidl::encoding::Context) -> usize {
5192            8
5193        }
5194
5195        #[inline(always)]
5196        fn inline_size(_context: fidl::encoding::Context) -> usize {
5197            16
5198        }
5199    }
5200
5201    unsafe impl<D: fidl::encoding::ResourceDialect>
5202        fidl::encoding::Encode<DataProviderGetAnnotationsResponse, D>
5203        for &DataProviderGetAnnotationsResponse
5204    {
5205        #[inline]
5206        unsafe fn encode(
5207            self,
5208            encoder: &mut fidl::encoding::Encoder<'_, D>,
5209            offset: usize,
5210            _depth: fidl::encoding::Depth,
5211        ) -> fidl::Result<()> {
5212            encoder.debug_check_bounds::<DataProviderGetAnnotationsResponse>(offset);
5213            // Delegate to tuple encoding.
5214            fidl::encoding::Encode::<DataProviderGetAnnotationsResponse, D>::encode(
5215                (<Annotations as fidl::encoding::ValueTypeMarker>::borrow(&self.annotations),),
5216                encoder,
5217                offset,
5218                _depth,
5219            )
5220        }
5221    }
5222    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Annotations, D>>
5223        fidl::encoding::Encode<DataProviderGetAnnotationsResponse, D> for (T0,)
5224    {
5225        #[inline]
5226        unsafe fn encode(
5227            self,
5228            encoder: &mut fidl::encoding::Encoder<'_, D>,
5229            offset: usize,
5230            depth: fidl::encoding::Depth,
5231        ) -> fidl::Result<()> {
5232            encoder.debug_check_bounds::<DataProviderGetAnnotationsResponse>(offset);
5233            // Zero out padding regions. There's no need to apply masks
5234            // because the unmasked parts will be overwritten by fields.
5235            // Write the fields.
5236            self.0.encode(encoder, offset + 0, depth)?;
5237            Ok(())
5238        }
5239    }
5240
5241    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5242        for DataProviderGetAnnotationsResponse
5243    {
5244        #[inline(always)]
5245        fn new_empty() -> Self {
5246            Self { annotations: fidl::new_empty!(Annotations, D) }
5247        }
5248
5249        #[inline]
5250        unsafe fn decode(
5251            &mut self,
5252            decoder: &mut fidl::encoding::Decoder<'_, D>,
5253            offset: usize,
5254            _depth: fidl::encoding::Depth,
5255        ) -> fidl::Result<()> {
5256            decoder.debug_check_bounds::<Self>(offset);
5257            // Verify that padding bytes are zero.
5258            fidl::decode!(Annotations, D, &mut self.annotations, decoder, offset + 0, _depth)?;
5259            Ok(())
5260        }
5261    }
5262
5263    impl fidl::encoding::ValueTypeMarker for DataProviderGetScreenshotRequest {
5264        type Borrowed<'a> = &'a Self;
5265        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5266            value
5267        }
5268    }
5269
5270    unsafe impl fidl::encoding::TypeMarker for DataProviderGetScreenshotRequest {
5271        type Owned = Self;
5272
5273        #[inline(always)]
5274        fn inline_align(_context: fidl::encoding::Context) -> usize {
5275            4
5276        }
5277
5278        #[inline(always)]
5279        fn inline_size(_context: fidl::encoding::Context) -> usize {
5280            4
5281        }
5282    }
5283
5284    unsafe impl<D: fidl::encoding::ResourceDialect>
5285        fidl::encoding::Encode<DataProviderGetScreenshotRequest, D>
5286        for &DataProviderGetScreenshotRequest
5287    {
5288        #[inline]
5289        unsafe fn encode(
5290            self,
5291            encoder: &mut fidl::encoding::Encoder<'_, D>,
5292            offset: usize,
5293            _depth: fidl::encoding::Depth,
5294        ) -> fidl::Result<()> {
5295            encoder.debug_check_bounds::<DataProviderGetScreenshotRequest>(offset);
5296            // Delegate to tuple encoding.
5297            fidl::encoding::Encode::<DataProviderGetScreenshotRequest, D>::encode(
5298                (<ImageEncoding as fidl::encoding::ValueTypeMarker>::borrow(&self.encoding),),
5299                encoder,
5300                offset,
5301                _depth,
5302            )
5303        }
5304    }
5305    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ImageEncoding, D>>
5306        fidl::encoding::Encode<DataProviderGetScreenshotRequest, D> for (T0,)
5307    {
5308        #[inline]
5309        unsafe fn encode(
5310            self,
5311            encoder: &mut fidl::encoding::Encoder<'_, D>,
5312            offset: usize,
5313            depth: fidl::encoding::Depth,
5314        ) -> fidl::Result<()> {
5315            encoder.debug_check_bounds::<DataProviderGetScreenshotRequest>(offset);
5316            // Zero out padding regions. There's no need to apply masks
5317            // because the unmasked parts will be overwritten by fields.
5318            // Write the fields.
5319            self.0.encode(encoder, offset + 0, depth)?;
5320            Ok(())
5321        }
5322    }
5323
5324    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5325        for DataProviderGetScreenshotRequest
5326    {
5327        #[inline(always)]
5328        fn new_empty() -> Self {
5329            Self { encoding: fidl::new_empty!(ImageEncoding, D) }
5330        }
5331
5332        #[inline]
5333        unsafe fn decode(
5334            &mut self,
5335            decoder: &mut fidl::encoding::Decoder<'_, D>,
5336            offset: usize,
5337            _depth: fidl::encoding::Depth,
5338        ) -> fidl::Result<()> {
5339            decoder.debug_check_bounds::<Self>(offset);
5340            // Verify that padding bytes are zero.
5341            fidl::decode!(ImageEncoding, D, &mut self.encoding, decoder, offset + 0, _depth)?;
5342            Ok(())
5343        }
5344    }
5345
5346    impl fidl::encoding::ResourceTypeMarker for DataProviderGetScreenshotResponse {
5347        type Borrowed<'a> = &'a mut Self;
5348        fn take_or_borrow<'a>(
5349            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5350        ) -> Self::Borrowed<'a> {
5351            value
5352        }
5353    }
5354
5355    unsafe impl fidl::encoding::TypeMarker for DataProviderGetScreenshotResponse {
5356        type Owned = Self;
5357
5358        #[inline(always)]
5359        fn inline_align(_context: fidl::encoding::Context) -> usize {
5360            8
5361        }
5362
5363        #[inline(always)]
5364        fn inline_size(_context: fidl::encoding::Context) -> usize {
5365            8
5366        }
5367    }
5368
5369    unsafe impl
5370        fidl::encoding::Encode<
5371            DataProviderGetScreenshotResponse,
5372            fidl::encoding::DefaultFuchsiaResourceDialect,
5373        > for &mut DataProviderGetScreenshotResponse
5374    {
5375        #[inline]
5376        unsafe fn encode(
5377            self,
5378            encoder: &mut fidl::encoding::Encoder<
5379                '_,
5380                fidl::encoding::DefaultFuchsiaResourceDialect,
5381            >,
5382            offset: usize,
5383            _depth: fidl::encoding::Depth,
5384        ) -> fidl::Result<()> {
5385            encoder.debug_check_bounds::<DataProviderGetScreenshotResponse>(offset);
5386            // Delegate to tuple encoding.
5387            fidl::encoding::Encode::<DataProviderGetScreenshotResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5388                (
5389                    <fidl::encoding::Boxed<Screenshot> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.screenshot),
5390                ),
5391                encoder, offset, _depth
5392            )
5393        }
5394    }
5395    unsafe impl<
5396            T0: fidl::encoding::Encode<
5397                fidl::encoding::Boxed<Screenshot>,
5398                fidl::encoding::DefaultFuchsiaResourceDialect,
5399            >,
5400        >
5401        fidl::encoding::Encode<
5402            DataProviderGetScreenshotResponse,
5403            fidl::encoding::DefaultFuchsiaResourceDialect,
5404        > for (T0,)
5405    {
5406        #[inline]
5407        unsafe fn encode(
5408            self,
5409            encoder: &mut fidl::encoding::Encoder<
5410                '_,
5411                fidl::encoding::DefaultFuchsiaResourceDialect,
5412            >,
5413            offset: usize,
5414            depth: fidl::encoding::Depth,
5415        ) -> fidl::Result<()> {
5416            encoder.debug_check_bounds::<DataProviderGetScreenshotResponse>(offset);
5417            // Zero out padding regions. There's no need to apply masks
5418            // because the unmasked parts will be overwritten by fields.
5419            // Write the fields.
5420            self.0.encode(encoder, offset + 0, depth)?;
5421            Ok(())
5422        }
5423    }
5424
5425    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5426        for DataProviderGetScreenshotResponse
5427    {
5428        #[inline(always)]
5429        fn new_empty() -> Self {
5430            Self {
5431                screenshot: fidl::new_empty!(
5432                    fidl::encoding::Boxed<Screenshot>,
5433                    fidl::encoding::DefaultFuchsiaResourceDialect
5434                ),
5435            }
5436        }
5437
5438        #[inline]
5439        unsafe fn decode(
5440            &mut self,
5441            decoder: &mut fidl::encoding::Decoder<
5442                '_,
5443                fidl::encoding::DefaultFuchsiaResourceDialect,
5444            >,
5445            offset: usize,
5446            _depth: fidl::encoding::Depth,
5447        ) -> fidl::Result<()> {
5448            decoder.debug_check_bounds::<Self>(offset);
5449            // Verify that padding bytes are zero.
5450            fidl::decode!(
5451                fidl::encoding::Boxed<Screenshot>,
5452                fidl::encoding::DefaultFuchsiaResourceDialect,
5453                &mut self.screenshot,
5454                decoder,
5455                offset + 0,
5456                _depth
5457            )?;
5458            Ok(())
5459        }
5460    }
5461
5462    impl fidl::encoding::ResourceTypeMarker for DataProviderGetSnapshotRequest {
5463        type Borrowed<'a> = &'a mut Self;
5464        fn take_or_borrow<'a>(
5465            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5466        ) -> Self::Borrowed<'a> {
5467            value
5468        }
5469    }
5470
5471    unsafe impl fidl::encoding::TypeMarker for DataProviderGetSnapshotRequest {
5472        type Owned = Self;
5473
5474        #[inline(always)]
5475        fn inline_align(_context: fidl::encoding::Context) -> usize {
5476            8
5477        }
5478
5479        #[inline(always)]
5480        fn inline_size(_context: fidl::encoding::Context) -> usize {
5481            16
5482        }
5483    }
5484
5485    unsafe impl
5486        fidl::encoding::Encode<
5487            DataProviderGetSnapshotRequest,
5488            fidl::encoding::DefaultFuchsiaResourceDialect,
5489        > for &mut DataProviderGetSnapshotRequest
5490    {
5491        #[inline]
5492        unsafe fn encode(
5493            self,
5494            encoder: &mut fidl::encoding::Encoder<
5495                '_,
5496                fidl::encoding::DefaultFuchsiaResourceDialect,
5497            >,
5498            offset: usize,
5499            _depth: fidl::encoding::Depth,
5500        ) -> fidl::Result<()> {
5501            encoder.debug_check_bounds::<DataProviderGetSnapshotRequest>(offset);
5502            // Delegate to tuple encoding.
5503            fidl::encoding::Encode::<
5504                DataProviderGetSnapshotRequest,
5505                fidl::encoding::DefaultFuchsiaResourceDialect,
5506            >::encode(
5507                (<GetSnapshotParameters as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5508                    &mut self.params,
5509                ),),
5510                encoder,
5511                offset,
5512                _depth,
5513            )
5514        }
5515    }
5516    unsafe impl<
5517            T0: fidl::encoding::Encode<
5518                GetSnapshotParameters,
5519                fidl::encoding::DefaultFuchsiaResourceDialect,
5520            >,
5521        >
5522        fidl::encoding::Encode<
5523            DataProviderGetSnapshotRequest,
5524            fidl::encoding::DefaultFuchsiaResourceDialect,
5525        > for (T0,)
5526    {
5527        #[inline]
5528        unsafe fn encode(
5529            self,
5530            encoder: &mut fidl::encoding::Encoder<
5531                '_,
5532                fidl::encoding::DefaultFuchsiaResourceDialect,
5533            >,
5534            offset: usize,
5535            depth: fidl::encoding::Depth,
5536        ) -> fidl::Result<()> {
5537            encoder.debug_check_bounds::<DataProviderGetSnapshotRequest>(offset);
5538            // Zero out padding regions. There's no need to apply masks
5539            // because the unmasked parts will be overwritten by fields.
5540            // Write the fields.
5541            self.0.encode(encoder, offset + 0, depth)?;
5542            Ok(())
5543        }
5544    }
5545
5546    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5547        for DataProviderGetSnapshotRequest
5548    {
5549        #[inline(always)]
5550        fn new_empty() -> Self {
5551            Self {
5552                params: fidl::new_empty!(
5553                    GetSnapshotParameters,
5554                    fidl::encoding::DefaultFuchsiaResourceDialect
5555                ),
5556            }
5557        }
5558
5559        #[inline]
5560        unsafe fn decode(
5561            &mut self,
5562            decoder: &mut fidl::encoding::Decoder<
5563                '_,
5564                fidl::encoding::DefaultFuchsiaResourceDialect,
5565            >,
5566            offset: usize,
5567            _depth: fidl::encoding::Depth,
5568        ) -> fidl::Result<()> {
5569            decoder.debug_check_bounds::<Self>(offset);
5570            // Verify that padding bytes are zero.
5571            fidl::decode!(
5572                GetSnapshotParameters,
5573                fidl::encoding::DefaultFuchsiaResourceDialect,
5574                &mut self.params,
5575                decoder,
5576                offset + 0,
5577                _depth
5578            )?;
5579            Ok(())
5580        }
5581    }
5582
5583    impl fidl::encoding::ResourceTypeMarker for DataProviderGetSnapshotResponse {
5584        type Borrowed<'a> = &'a mut Self;
5585        fn take_or_borrow<'a>(
5586            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5587        ) -> Self::Borrowed<'a> {
5588            value
5589        }
5590    }
5591
5592    unsafe impl fidl::encoding::TypeMarker for DataProviderGetSnapshotResponse {
5593        type Owned = Self;
5594
5595        #[inline(always)]
5596        fn inline_align(_context: fidl::encoding::Context) -> usize {
5597            8
5598        }
5599
5600        #[inline(always)]
5601        fn inline_size(_context: fidl::encoding::Context) -> usize {
5602            16
5603        }
5604    }
5605
5606    unsafe impl
5607        fidl::encoding::Encode<
5608            DataProviderGetSnapshotResponse,
5609            fidl::encoding::DefaultFuchsiaResourceDialect,
5610        > for &mut DataProviderGetSnapshotResponse
5611    {
5612        #[inline]
5613        unsafe fn encode(
5614            self,
5615            encoder: &mut fidl::encoding::Encoder<
5616                '_,
5617                fidl::encoding::DefaultFuchsiaResourceDialect,
5618            >,
5619            offset: usize,
5620            _depth: fidl::encoding::Depth,
5621        ) -> fidl::Result<()> {
5622            encoder.debug_check_bounds::<DataProviderGetSnapshotResponse>(offset);
5623            // Delegate to tuple encoding.
5624            fidl::encoding::Encode::<
5625                DataProviderGetSnapshotResponse,
5626                fidl::encoding::DefaultFuchsiaResourceDialect,
5627            >::encode(
5628                (<Snapshot as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5629                    &mut self.snapshot,
5630                ),),
5631                encoder,
5632                offset,
5633                _depth,
5634            )
5635        }
5636    }
5637    unsafe impl<T0: fidl::encoding::Encode<Snapshot, fidl::encoding::DefaultFuchsiaResourceDialect>>
5638        fidl::encoding::Encode<
5639            DataProviderGetSnapshotResponse,
5640            fidl::encoding::DefaultFuchsiaResourceDialect,
5641        > for (T0,)
5642    {
5643        #[inline]
5644        unsafe fn encode(
5645            self,
5646            encoder: &mut fidl::encoding::Encoder<
5647                '_,
5648                fidl::encoding::DefaultFuchsiaResourceDialect,
5649            >,
5650            offset: usize,
5651            depth: fidl::encoding::Depth,
5652        ) -> fidl::Result<()> {
5653            encoder.debug_check_bounds::<DataProviderGetSnapshotResponse>(offset);
5654            // Zero out padding regions. There's no need to apply masks
5655            // because the unmasked parts will be overwritten by fields.
5656            // Write the fields.
5657            self.0.encode(encoder, offset + 0, depth)?;
5658            Ok(())
5659        }
5660    }
5661
5662    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5663        for DataProviderGetSnapshotResponse
5664    {
5665        #[inline(always)]
5666        fn new_empty() -> Self {
5667            Self {
5668                snapshot: fidl::new_empty!(Snapshot, fidl::encoding::DefaultFuchsiaResourceDialect),
5669            }
5670        }
5671
5672        #[inline]
5673        unsafe fn decode(
5674            &mut self,
5675            decoder: &mut fidl::encoding::Decoder<
5676                '_,
5677                fidl::encoding::DefaultFuchsiaResourceDialect,
5678            >,
5679            offset: usize,
5680            _depth: fidl::encoding::Depth,
5681        ) -> fidl::Result<()> {
5682            decoder.debug_check_bounds::<Self>(offset);
5683            // Verify that padding bytes are zero.
5684            fidl::decode!(
5685                Snapshot,
5686                fidl::encoding::DefaultFuchsiaResourceDialect,
5687                &mut self.snapshot,
5688                decoder,
5689                offset + 0,
5690                _depth
5691            )?;
5692            Ok(())
5693        }
5694    }
5695
5696    impl fidl::encoding::ValueTypeMarker for DeviceIdProviderGetIdResponse {
5697        type Borrowed<'a> = &'a Self;
5698        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5699            value
5700        }
5701    }
5702
5703    unsafe impl fidl::encoding::TypeMarker for DeviceIdProviderGetIdResponse {
5704        type Owned = Self;
5705
5706        #[inline(always)]
5707        fn inline_align(_context: fidl::encoding::Context) -> usize {
5708            8
5709        }
5710
5711        #[inline(always)]
5712        fn inline_size(_context: fidl::encoding::Context) -> usize {
5713            16
5714        }
5715    }
5716
5717    unsafe impl<D: fidl::encoding::ResourceDialect>
5718        fidl::encoding::Encode<DeviceIdProviderGetIdResponse, D>
5719        for &DeviceIdProviderGetIdResponse
5720    {
5721        #[inline]
5722        unsafe fn encode(
5723            self,
5724            encoder: &mut fidl::encoding::Encoder<'_, D>,
5725            offset: usize,
5726            _depth: fidl::encoding::Depth,
5727        ) -> fidl::Result<()> {
5728            encoder.debug_check_bounds::<DeviceIdProviderGetIdResponse>(offset);
5729            // Delegate to tuple encoding.
5730            fidl::encoding::Encode::<DeviceIdProviderGetIdResponse, D>::encode(
5731                (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
5732                    &self.feedback_id,
5733                ),),
5734                encoder,
5735                offset,
5736                _depth,
5737            )
5738        }
5739    }
5740    unsafe impl<
5741            D: fidl::encoding::ResourceDialect,
5742            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
5743        > fidl::encoding::Encode<DeviceIdProviderGetIdResponse, D> for (T0,)
5744    {
5745        #[inline]
5746        unsafe fn encode(
5747            self,
5748            encoder: &mut fidl::encoding::Encoder<'_, D>,
5749            offset: usize,
5750            depth: fidl::encoding::Depth,
5751        ) -> fidl::Result<()> {
5752            encoder.debug_check_bounds::<DeviceIdProviderGetIdResponse>(offset);
5753            // Zero out padding regions. There's no need to apply masks
5754            // because the unmasked parts will be overwritten by fields.
5755            // Write the fields.
5756            self.0.encode(encoder, offset + 0, depth)?;
5757            Ok(())
5758        }
5759    }
5760
5761    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5762        for DeviceIdProviderGetIdResponse
5763    {
5764        #[inline(always)]
5765        fn new_empty() -> Self {
5766            Self { feedback_id: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
5767        }
5768
5769        #[inline]
5770        unsafe fn decode(
5771            &mut self,
5772            decoder: &mut fidl::encoding::Decoder<'_, D>,
5773            offset: usize,
5774            _depth: fidl::encoding::Depth,
5775        ) -> fidl::Result<()> {
5776            decoder.debug_check_bounds::<Self>(offset);
5777            // Verify that padding bytes are zero.
5778            fidl::decode!(
5779                fidl::encoding::BoundedString<64>,
5780                D,
5781                &mut self.feedback_id,
5782                decoder,
5783                offset + 0,
5784                _depth
5785            )?;
5786            Ok(())
5787        }
5788    }
5789
5790    impl fidl::encoding::ValueTypeMarker for LastRebootInfoProviderGetResponse {
5791        type Borrowed<'a> = &'a Self;
5792        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5793            value
5794        }
5795    }
5796
5797    unsafe impl fidl::encoding::TypeMarker for LastRebootInfoProviderGetResponse {
5798        type Owned = Self;
5799
5800        #[inline(always)]
5801        fn inline_align(_context: fidl::encoding::Context) -> usize {
5802            8
5803        }
5804
5805        #[inline(always)]
5806        fn inline_size(_context: fidl::encoding::Context) -> usize {
5807            16
5808        }
5809    }
5810
5811    unsafe impl<D: fidl::encoding::ResourceDialect>
5812        fidl::encoding::Encode<LastRebootInfoProviderGetResponse, D>
5813        for &LastRebootInfoProviderGetResponse
5814    {
5815        #[inline]
5816        unsafe fn encode(
5817            self,
5818            encoder: &mut fidl::encoding::Encoder<'_, D>,
5819            offset: usize,
5820            _depth: fidl::encoding::Depth,
5821        ) -> fidl::Result<()> {
5822            encoder.debug_check_bounds::<LastRebootInfoProviderGetResponse>(offset);
5823            // Delegate to tuple encoding.
5824            fidl::encoding::Encode::<LastRebootInfoProviderGetResponse, D>::encode(
5825                (<LastReboot as fidl::encoding::ValueTypeMarker>::borrow(&self.last_reboot),),
5826                encoder,
5827                offset,
5828                _depth,
5829            )
5830        }
5831    }
5832    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LastReboot, D>>
5833        fidl::encoding::Encode<LastRebootInfoProviderGetResponse, D> for (T0,)
5834    {
5835        #[inline]
5836        unsafe fn encode(
5837            self,
5838            encoder: &mut fidl::encoding::Encoder<'_, D>,
5839            offset: usize,
5840            depth: fidl::encoding::Depth,
5841        ) -> fidl::Result<()> {
5842            encoder.debug_check_bounds::<LastRebootInfoProviderGetResponse>(offset);
5843            // Zero out padding regions. There's no need to apply masks
5844            // because the unmasked parts will be overwritten by fields.
5845            // Write the fields.
5846            self.0.encode(encoder, offset + 0, depth)?;
5847            Ok(())
5848        }
5849    }
5850
5851    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5852        for LastRebootInfoProviderGetResponse
5853    {
5854        #[inline(always)]
5855        fn new_empty() -> Self {
5856            Self { last_reboot: fidl::new_empty!(LastReboot, D) }
5857        }
5858
5859        #[inline]
5860        unsafe fn decode(
5861            &mut self,
5862            decoder: &mut fidl::encoding::Decoder<'_, D>,
5863            offset: usize,
5864            _depth: fidl::encoding::Depth,
5865        ) -> fidl::Result<()> {
5866            decoder.debug_check_bounds::<Self>(offset);
5867            // Verify that padding bytes are zero.
5868            fidl::decode!(LastReboot, D, &mut self.last_reboot, decoder, offset + 0, _depth)?;
5869            Ok(())
5870        }
5871    }
5872
5873    impl fidl::encoding::ResourceTypeMarker for Screenshot {
5874        type Borrowed<'a> = &'a mut Self;
5875        fn take_or_borrow<'a>(
5876            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5877        ) -> Self::Borrowed<'a> {
5878            value
5879        }
5880    }
5881
5882    unsafe impl fidl::encoding::TypeMarker for Screenshot {
5883        type Owned = Self;
5884
5885        #[inline(always)]
5886        fn inline_align(_context: fidl::encoding::Context) -> usize {
5887            8
5888        }
5889
5890        #[inline(always)]
5891        fn inline_size(_context: fidl::encoding::Context) -> usize {
5892            24
5893        }
5894    }
5895
5896    unsafe impl fidl::encoding::Encode<Screenshot, fidl::encoding::DefaultFuchsiaResourceDialect>
5897        for &mut Screenshot
5898    {
5899        #[inline]
5900        unsafe fn encode(
5901            self,
5902            encoder: &mut fidl::encoding::Encoder<
5903                '_,
5904                fidl::encoding::DefaultFuchsiaResourceDialect,
5905            >,
5906            offset: usize,
5907            _depth: fidl::encoding::Depth,
5908        ) -> fidl::Result<()> {
5909            encoder.debug_check_bounds::<Screenshot>(offset);
5910            // Delegate to tuple encoding.
5911            fidl::encoding::Encode::<Screenshot, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5912                (
5913                    <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.image),
5914                    <fidl_fuchsia_math::Size as fidl::encoding::ValueTypeMarker>::borrow(&self.dimensions_in_px),
5915                ),
5916                encoder, offset, _depth
5917            )
5918        }
5919    }
5920    unsafe impl<
5921            T0: fidl::encoding::Encode<
5922                fidl_fuchsia_mem::Buffer,
5923                fidl::encoding::DefaultFuchsiaResourceDialect,
5924            >,
5925            T1: fidl::encoding::Encode<
5926                fidl_fuchsia_math::Size,
5927                fidl::encoding::DefaultFuchsiaResourceDialect,
5928            >,
5929        > fidl::encoding::Encode<Screenshot, fidl::encoding::DefaultFuchsiaResourceDialect>
5930        for (T0, T1)
5931    {
5932        #[inline]
5933        unsafe fn encode(
5934            self,
5935            encoder: &mut fidl::encoding::Encoder<
5936                '_,
5937                fidl::encoding::DefaultFuchsiaResourceDialect,
5938            >,
5939            offset: usize,
5940            depth: fidl::encoding::Depth,
5941        ) -> fidl::Result<()> {
5942            encoder.debug_check_bounds::<Screenshot>(offset);
5943            // Zero out padding regions. There's no need to apply masks
5944            // because the unmasked parts will be overwritten by fields.
5945            // Write the fields.
5946            self.0.encode(encoder, offset + 0, depth)?;
5947            self.1.encode(encoder, offset + 16, depth)?;
5948            Ok(())
5949        }
5950    }
5951
5952    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Screenshot {
5953        #[inline(always)]
5954        fn new_empty() -> Self {
5955            Self {
5956                image: fidl::new_empty!(
5957                    fidl_fuchsia_mem::Buffer,
5958                    fidl::encoding::DefaultFuchsiaResourceDialect
5959                ),
5960                dimensions_in_px: fidl::new_empty!(
5961                    fidl_fuchsia_math::Size,
5962                    fidl::encoding::DefaultFuchsiaResourceDialect
5963                ),
5964            }
5965        }
5966
5967        #[inline]
5968        unsafe fn decode(
5969            &mut self,
5970            decoder: &mut fidl::encoding::Decoder<
5971                '_,
5972                fidl::encoding::DefaultFuchsiaResourceDialect,
5973            >,
5974            offset: usize,
5975            _depth: fidl::encoding::Depth,
5976        ) -> fidl::Result<()> {
5977            decoder.debug_check_bounds::<Self>(offset);
5978            // Verify that padding bytes are zero.
5979            fidl::decode!(
5980                fidl_fuchsia_mem::Buffer,
5981                fidl::encoding::DefaultFuchsiaResourceDialect,
5982                &mut self.image,
5983                decoder,
5984                offset + 0,
5985                _depth
5986            )?;
5987            fidl::decode!(
5988                fidl_fuchsia_math::Size,
5989                fidl::encoding::DefaultFuchsiaResourceDialect,
5990                &mut self.dimensions_in_px,
5991                decoder,
5992                offset + 16,
5993                _depth
5994            )?;
5995            Ok(())
5996        }
5997    }
5998
5999    impl Annotations {
6000        #[inline(always)]
6001        fn max_ordinal_present(&self) -> u64 {
6002            if let Some(_) = self.annotations2 {
6003                return 2;
6004            }
6005            if let Some(_) = self.annotations {
6006                return 1;
6007            }
6008            0
6009        }
6010    }
6011
6012    impl fidl::encoding::ValueTypeMarker for Annotations {
6013        type Borrowed<'a> = &'a Self;
6014        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6015            value
6016        }
6017    }
6018
6019    unsafe impl fidl::encoding::TypeMarker for Annotations {
6020        type Owned = Self;
6021
6022        #[inline(always)]
6023        fn inline_align(_context: fidl::encoding::Context) -> usize {
6024            8
6025        }
6026
6027        #[inline(always)]
6028        fn inline_size(_context: fidl::encoding::Context) -> usize {
6029            16
6030        }
6031    }
6032
6033    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Annotations, D>
6034        for &Annotations
6035    {
6036        unsafe fn encode(
6037            self,
6038            encoder: &mut fidl::encoding::Encoder<'_, D>,
6039            offset: usize,
6040            mut depth: fidl::encoding::Depth,
6041        ) -> fidl::Result<()> {
6042            encoder.debug_check_bounds::<Annotations>(offset);
6043            // Vector header
6044            let max_ordinal: u64 = self.max_ordinal_present();
6045            encoder.write_num(max_ordinal, offset);
6046            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6047            // Calling encoder.out_of_line_offset(0) is not allowed.
6048            if max_ordinal == 0 {
6049                return Ok(());
6050            }
6051            depth.increment()?;
6052            let envelope_size = 8;
6053            let bytes_len = max_ordinal as usize * envelope_size;
6054            #[allow(unused_variables)]
6055            let offset = encoder.out_of_line_offset(bytes_len);
6056            let mut _prev_end_offset: usize = 0;
6057            if 1 > max_ordinal {
6058                return Ok(());
6059            }
6060
6061            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6062            // are envelope_size bytes.
6063            let cur_offset: usize = (1 - 1) * envelope_size;
6064
6065            // Zero reserved fields.
6066            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6067
6068            // Safety:
6069            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6070            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6071            //   envelope_size bytes, there is always sufficient room.
6072            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 64>, D>(
6073            self.annotations.as_ref().map(<fidl::encoding::Vector<Annotation, 64> as fidl::encoding::ValueTypeMarker>::borrow),
6074            encoder, offset + cur_offset, depth
6075        )?;
6076
6077            _prev_end_offset = cur_offset + envelope_size;
6078            if 2 > max_ordinal {
6079                return Ok(());
6080            }
6081
6082            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6083            // are envelope_size bytes.
6084            let cur_offset: usize = (2 - 1) * envelope_size;
6085
6086            // Zero reserved fields.
6087            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6088
6089            // Safety:
6090            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6091            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6092            //   envelope_size bytes, there is always sufficient room.
6093            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 512>, D>(
6094            self.annotations2.as_ref().map(<fidl::encoding::Vector<Annotation, 512> as fidl::encoding::ValueTypeMarker>::borrow),
6095            encoder, offset + cur_offset, depth
6096        )?;
6097
6098            _prev_end_offset = cur_offset + envelope_size;
6099
6100            Ok(())
6101        }
6102    }
6103
6104    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Annotations {
6105        #[inline(always)]
6106        fn new_empty() -> Self {
6107            Self::default()
6108        }
6109
6110        unsafe fn decode(
6111            &mut self,
6112            decoder: &mut fidl::encoding::Decoder<'_, D>,
6113            offset: usize,
6114            mut depth: fidl::encoding::Depth,
6115        ) -> fidl::Result<()> {
6116            decoder.debug_check_bounds::<Self>(offset);
6117            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6118                None => return Err(fidl::Error::NotNullable),
6119                Some(len) => len,
6120            };
6121            // Calling decoder.out_of_line_offset(0) is not allowed.
6122            if len == 0 {
6123                return Ok(());
6124            };
6125            depth.increment()?;
6126            let envelope_size = 8;
6127            let bytes_len = len * envelope_size;
6128            let offset = decoder.out_of_line_offset(bytes_len)?;
6129            // Decode the envelope for each type.
6130            let mut _next_ordinal_to_read = 0;
6131            let mut next_offset = offset;
6132            let end_offset = offset + bytes_len;
6133            _next_ordinal_to_read += 1;
6134            if next_offset >= end_offset {
6135                return Ok(());
6136            }
6137
6138            // Decode unknown envelopes for gaps in ordinals.
6139            while _next_ordinal_to_read < 1 {
6140                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6141                _next_ordinal_to_read += 1;
6142                next_offset += envelope_size;
6143            }
6144
6145            let next_out_of_line = decoder.next_out_of_line();
6146            let handles_before = decoder.remaining_handles();
6147            if let Some((inlined, num_bytes, num_handles)) =
6148                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6149            {
6150                let member_inline_size = <fidl::encoding::Vector<Annotation, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6151                if inlined != (member_inline_size <= 4) {
6152                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6153                }
6154                let inner_offset;
6155                let mut inner_depth = depth.clone();
6156                if inlined {
6157                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6158                    inner_offset = next_offset;
6159                } else {
6160                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6161                    inner_depth.increment()?;
6162                }
6163                let val_ref = self.annotations.get_or_insert_with(
6164                    || fidl::new_empty!(fidl::encoding::Vector<Annotation, 64>, D),
6165                );
6166                fidl::decode!(fidl::encoding::Vector<Annotation, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
6167                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6168                {
6169                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6170                }
6171                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6172                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6173                }
6174            }
6175
6176            next_offset += envelope_size;
6177            _next_ordinal_to_read += 1;
6178            if next_offset >= end_offset {
6179                return Ok(());
6180            }
6181
6182            // Decode unknown envelopes for gaps in ordinals.
6183            while _next_ordinal_to_read < 2 {
6184                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6185                _next_ordinal_to_read += 1;
6186                next_offset += envelope_size;
6187            }
6188
6189            let next_out_of_line = decoder.next_out_of_line();
6190            let handles_before = decoder.remaining_handles();
6191            if let Some((inlined, num_bytes, num_handles)) =
6192                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6193            {
6194                let member_inline_size = <fidl::encoding::Vector<Annotation, 512> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6195                if inlined != (member_inline_size <= 4) {
6196                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6197                }
6198                let inner_offset;
6199                let mut inner_depth = depth.clone();
6200                if inlined {
6201                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6202                    inner_offset = next_offset;
6203                } else {
6204                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6205                    inner_depth.increment()?;
6206                }
6207                let val_ref = self.annotations2.get_or_insert_with(
6208                    || fidl::new_empty!(fidl::encoding::Vector<Annotation, 512>, D),
6209                );
6210                fidl::decode!(fidl::encoding::Vector<Annotation, 512>, D, val_ref, decoder, inner_offset, inner_depth)?;
6211                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6212                {
6213                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6214                }
6215                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6216                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6217                }
6218            }
6219
6220            next_offset += envelope_size;
6221
6222            // Decode the remaining unknown envelopes.
6223            while next_offset < end_offset {
6224                _next_ordinal_to_read += 1;
6225                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6226                next_offset += envelope_size;
6227            }
6228
6229            Ok(())
6230        }
6231    }
6232
6233    impl ComponentData {
6234        #[inline(always)]
6235        fn max_ordinal_present(&self) -> u64 {
6236            if let Some(_) = self.annotations {
6237                return 2;
6238            }
6239            if let Some(_) = self.namespace {
6240                return 1;
6241            }
6242            0
6243        }
6244    }
6245
6246    impl fidl::encoding::ValueTypeMarker for ComponentData {
6247        type Borrowed<'a> = &'a Self;
6248        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6249            value
6250        }
6251    }
6252
6253    unsafe impl fidl::encoding::TypeMarker for ComponentData {
6254        type Owned = Self;
6255
6256        #[inline(always)]
6257        fn inline_align(_context: fidl::encoding::Context) -> usize {
6258            8
6259        }
6260
6261        #[inline(always)]
6262        fn inline_size(_context: fidl::encoding::Context) -> usize {
6263            16
6264        }
6265    }
6266
6267    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ComponentData, D>
6268        for &ComponentData
6269    {
6270        unsafe fn encode(
6271            self,
6272            encoder: &mut fidl::encoding::Encoder<'_, D>,
6273            offset: usize,
6274            mut depth: fidl::encoding::Depth,
6275        ) -> fidl::Result<()> {
6276            encoder.debug_check_bounds::<ComponentData>(offset);
6277            // Vector header
6278            let max_ordinal: u64 = self.max_ordinal_present();
6279            encoder.write_num(max_ordinal, offset);
6280            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6281            // Calling encoder.out_of_line_offset(0) is not allowed.
6282            if max_ordinal == 0 {
6283                return Ok(());
6284            }
6285            depth.increment()?;
6286            let envelope_size = 8;
6287            let bytes_len = max_ordinal as usize * envelope_size;
6288            #[allow(unused_variables)]
6289            let offset = encoder.out_of_line_offset(bytes_len);
6290            let mut _prev_end_offset: usize = 0;
6291            if 1 > max_ordinal {
6292                return Ok(());
6293            }
6294
6295            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6296            // are envelope_size bytes.
6297            let cur_offset: usize = (1 - 1) * envelope_size;
6298
6299            // Zero reserved fields.
6300            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6301
6302            // Safety:
6303            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6304            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6305            //   envelope_size bytes, there is always sufficient room.
6306            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<32>, D>(
6307                self.namespace.as_ref().map(
6308                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
6309                ),
6310                encoder,
6311                offset + cur_offset,
6312                depth,
6313            )?;
6314
6315            _prev_end_offset = cur_offset + envelope_size;
6316            if 2 > max_ordinal {
6317                return Ok(());
6318            }
6319
6320            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6321            // are envelope_size bytes.
6322            let cur_offset: usize = (2 - 1) * envelope_size;
6323
6324            // Zero reserved fields.
6325            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6326
6327            // Safety:
6328            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6329            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6330            //   envelope_size bytes, there is always sufficient room.
6331            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 16>, D>(
6332            self.annotations.as_ref().map(<fidl::encoding::Vector<Annotation, 16> as fidl::encoding::ValueTypeMarker>::borrow),
6333            encoder, offset + cur_offset, depth
6334        )?;
6335
6336            _prev_end_offset = cur_offset + envelope_size;
6337
6338            Ok(())
6339        }
6340    }
6341
6342    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ComponentData {
6343        #[inline(always)]
6344        fn new_empty() -> Self {
6345            Self::default()
6346        }
6347
6348        unsafe fn decode(
6349            &mut self,
6350            decoder: &mut fidl::encoding::Decoder<'_, D>,
6351            offset: usize,
6352            mut depth: fidl::encoding::Depth,
6353        ) -> fidl::Result<()> {
6354            decoder.debug_check_bounds::<Self>(offset);
6355            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6356                None => return Err(fidl::Error::NotNullable),
6357                Some(len) => len,
6358            };
6359            // Calling decoder.out_of_line_offset(0) is not allowed.
6360            if len == 0 {
6361                return Ok(());
6362            };
6363            depth.increment()?;
6364            let envelope_size = 8;
6365            let bytes_len = len * envelope_size;
6366            let offset = decoder.out_of_line_offset(bytes_len)?;
6367            // Decode the envelope for each type.
6368            let mut _next_ordinal_to_read = 0;
6369            let mut next_offset = offset;
6370            let end_offset = offset + bytes_len;
6371            _next_ordinal_to_read += 1;
6372            if next_offset >= end_offset {
6373                return Ok(());
6374            }
6375
6376            // Decode unknown envelopes for gaps in ordinals.
6377            while _next_ordinal_to_read < 1 {
6378                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6379                _next_ordinal_to_read += 1;
6380                next_offset += envelope_size;
6381            }
6382
6383            let next_out_of_line = decoder.next_out_of_line();
6384            let handles_before = decoder.remaining_handles();
6385            if let Some((inlined, num_bytes, num_handles)) =
6386                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6387            {
6388                let member_inline_size =
6389                    <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
6390                        decoder.context,
6391                    );
6392                if inlined != (member_inline_size <= 4) {
6393                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6394                }
6395                let inner_offset;
6396                let mut inner_depth = depth.clone();
6397                if inlined {
6398                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6399                    inner_offset = next_offset;
6400                } else {
6401                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6402                    inner_depth.increment()?;
6403                }
6404                let val_ref = self
6405                    .namespace
6406                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<32>, D));
6407                fidl::decode!(
6408                    fidl::encoding::BoundedString<32>,
6409                    D,
6410                    val_ref,
6411                    decoder,
6412                    inner_offset,
6413                    inner_depth
6414                )?;
6415                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6416                {
6417                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6418                }
6419                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6420                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6421                }
6422            }
6423
6424            next_offset += envelope_size;
6425            _next_ordinal_to_read += 1;
6426            if next_offset >= end_offset {
6427                return Ok(());
6428            }
6429
6430            // Decode unknown envelopes for gaps in ordinals.
6431            while _next_ordinal_to_read < 2 {
6432                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6433                _next_ordinal_to_read += 1;
6434                next_offset += envelope_size;
6435            }
6436
6437            let next_out_of_line = decoder.next_out_of_line();
6438            let handles_before = decoder.remaining_handles();
6439            if let Some((inlined, num_bytes, num_handles)) =
6440                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6441            {
6442                let member_inline_size = <fidl::encoding::Vector<Annotation, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6443                if inlined != (member_inline_size <= 4) {
6444                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6445                }
6446                let inner_offset;
6447                let mut inner_depth = depth.clone();
6448                if inlined {
6449                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6450                    inner_offset = next_offset;
6451                } else {
6452                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6453                    inner_depth.increment()?;
6454                }
6455                let val_ref = self.annotations.get_or_insert_with(
6456                    || fidl::new_empty!(fidl::encoding::Vector<Annotation, 16>, D),
6457                );
6458                fidl::decode!(fidl::encoding::Vector<Annotation, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
6459                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6460                {
6461                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6462                }
6463                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6464                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6465                }
6466            }
6467
6468            next_offset += envelope_size;
6469
6470            // Decode the remaining unknown envelopes.
6471            while next_offset < end_offset {
6472                _next_ordinal_to_read += 1;
6473                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6474                next_offset += envelope_size;
6475            }
6476
6477            Ok(())
6478        }
6479    }
6480
6481    impl CrashReport {
6482        #[inline(always)]
6483        fn max_ordinal_present(&self) -> u64 {
6484            if let Some(_) = self.is_fatal {
6485                return 8;
6486            }
6487            if let Some(_) = self.crash_signature {
6488                return 7;
6489            }
6490            if let Some(_) = self.program_uptime {
6491                return 6;
6492            }
6493            if let Some(_) = self.event_id {
6494                return 5;
6495            }
6496            if let Some(_) = self.attachments {
6497                return 4;
6498            }
6499            if let Some(_) = self.annotations {
6500                return 3;
6501            }
6502            if let Some(_) = self.specific_report {
6503                return 2;
6504            }
6505            if let Some(_) = self.program_name {
6506                return 1;
6507            }
6508            0
6509        }
6510    }
6511
6512    impl fidl::encoding::ResourceTypeMarker for CrashReport {
6513        type Borrowed<'a> = &'a mut Self;
6514        fn take_or_borrow<'a>(
6515            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6516        ) -> Self::Borrowed<'a> {
6517            value
6518        }
6519    }
6520
6521    unsafe impl fidl::encoding::TypeMarker for CrashReport {
6522        type Owned = Self;
6523
6524        #[inline(always)]
6525        fn inline_align(_context: fidl::encoding::Context) -> usize {
6526            8
6527        }
6528
6529        #[inline(always)]
6530        fn inline_size(_context: fidl::encoding::Context) -> usize {
6531            16
6532        }
6533    }
6534
6535    unsafe impl fidl::encoding::Encode<CrashReport, fidl::encoding::DefaultFuchsiaResourceDialect>
6536        for &mut CrashReport
6537    {
6538        unsafe fn encode(
6539            self,
6540            encoder: &mut fidl::encoding::Encoder<
6541                '_,
6542                fidl::encoding::DefaultFuchsiaResourceDialect,
6543            >,
6544            offset: usize,
6545            mut depth: fidl::encoding::Depth,
6546        ) -> fidl::Result<()> {
6547            encoder.debug_check_bounds::<CrashReport>(offset);
6548            // Vector header
6549            let max_ordinal: u64 = self.max_ordinal_present();
6550            encoder.write_num(max_ordinal, offset);
6551            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6552            // Calling encoder.out_of_line_offset(0) is not allowed.
6553            if max_ordinal == 0 {
6554                return Ok(());
6555            }
6556            depth.increment()?;
6557            let envelope_size = 8;
6558            let bytes_len = max_ordinal as usize * envelope_size;
6559            #[allow(unused_variables)]
6560            let offset = encoder.out_of_line_offset(bytes_len);
6561            let mut _prev_end_offset: usize = 0;
6562            if 1 > max_ordinal {
6563                return Ok(());
6564            }
6565
6566            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6567            // are envelope_size bytes.
6568            let cur_offset: usize = (1 - 1) * envelope_size;
6569
6570            // Zero reserved fields.
6571            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6572
6573            // Safety:
6574            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6575            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6576            //   envelope_size bytes, there is always sufficient room.
6577            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6578            self.program_name.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
6579            encoder, offset + cur_offset, depth
6580        )?;
6581
6582            _prev_end_offset = cur_offset + envelope_size;
6583            if 2 > max_ordinal {
6584                return Ok(());
6585            }
6586
6587            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6588            // are envelope_size bytes.
6589            let cur_offset: usize = (2 - 1) * envelope_size;
6590
6591            // Zero reserved fields.
6592            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6593
6594            // Safety:
6595            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6596            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6597            //   envelope_size bytes, there is always sufficient room.
6598            fidl::encoding::encode_in_envelope_optional::<
6599                SpecificCrashReport,
6600                fidl::encoding::DefaultFuchsiaResourceDialect,
6601            >(
6602                self.specific_report.as_mut().map(
6603                    <SpecificCrashReport as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
6604                ),
6605                encoder,
6606                offset + cur_offset,
6607                depth,
6608            )?;
6609
6610            _prev_end_offset = cur_offset + envelope_size;
6611            if 3 > max_ordinal {
6612                return Ok(());
6613            }
6614
6615            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6616            // are envelope_size bytes.
6617            let cur_offset: usize = (3 - 1) * envelope_size;
6618
6619            // Zero reserved fields.
6620            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6621
6622            // Safety:
6623            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6624            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6625            //   envelope_size bytes, there is always sufficient room.
6626            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 32>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6627            self.annotations.as_ref().map(<fidl::encoding::Vector<Annotation, 32> as fidl::encoding::ValueTypeMarker>::borrow),
6628            encoder, offset + cur_offset, depth
6629        )?;
6630
6631            _prev_end_offset = cur_offset + envelope_size;
6632            if 4 > max_ordinal {
6633                return Ok(());
6634            }
6635
6636            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6637            // are envelope_size bytes.
6638            let cur_offset: usize = (4 - 1) * envelope_size;
6639
6640            // Zero reserved fields.
6641            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6642
6643            // Safety:
6644            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6645            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6646            //   envelope_size bytes, there is always sufficient room.
6647            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Attachment, 16>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6648            self.attachments.as_mut().map(<fidl::encoding::Vector<Attachment, 16> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
6649            encoder, offset + cur_offset, depth
6650        )?;
6651
6652            _prev_end_offset = cur_offset + envelope_size;
6653            if 5 > max_ordinal {
6654                return Ok(());
6655            }
6656
6657            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6658            // are envelope_size bytes.
6659            let cur_offset: usize = (5 - 1) * envelope_size;
6660
6661            // Zero reserved fields.
6662            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6663
6664            // Safety:
6665            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6666            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6667            //   envelope_size bytes, there is always sufficient room.
6668            fidl::encoding::encode_in_envelope_optional::<
6669                fidl::encoding::BoundedString<128>,
6670                fidl::encoding::DefaultFuchsiaResourceDialect,
6671            >(
6672                self.event_id.as_ref().map(
6673                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
6674                ),
6675                encoder,
6676                offset + cur_offset,
6677                depth,
6678            )?;
6679
6680            _prev_end_offset = cur_offset + envelope_size;
6681            if 6 > max_ordinal {
6682                return Ok(());
6683            }
6684
6685            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6686            // are envelope_size bytes.
6687            let cur_offset: usize = (6 - 1) * envelope_size;
6688
6689            // Zero reserved fields.
6690            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6691
6692            // Safety:
6693            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6694            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6695            //   envelope_size bytes, there is always sufficient room.
6696            fidl::encoding::encode_in_envelope_optional::<
6697                i64,
6698                fidl::encoding::DefaultFuchsiaResourceDialect,
6699            >(
6700                self.program_uptime.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
6701                encoder,
6702                offset + cur_offset,
6703                depth,
6704            )?;
6705
6706            _prev_end_offset = cur_offset + envelope_size;
6707            if 7 > max_ordinal {
6708                return Ok(());
6709            }
6710
6711            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6712            // are envelope_size bytes.
6713            let cur_offset: usize = (7 - 1) * envelope_size;
6714
6715            // Zero reserved fields.
6716            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6717
6718            // Safety:
6719            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6720            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6721            //   envelope_size bytes, there is always sufficient room.
6722            fidl::encoding::encode_in_envelope_optional::<
6723                fidl::encoding::BoundedString<128>,
6724                fidl::encoding::DefaultFuchsiaResourceDialect,
6725            >(
6726                self.crash_signature.as_ref().map(
6727                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
6728                ),
6729                encoder,
6730                offset + cur_offset,
6731                depth,
6732            )?;
6733
6734            _prev_end_offset = cur_offset + envelope_size;
6735            if 8 > max_ordinal {
6736                return Ok(());
6737            }
6738
6739            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6740            // are envelope_size bytes.
6741            let cur_offset: usize = (8 - 1) * envelope_size;
6742
6743            // Zero reserved fields.
6744            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6745
6746            // Safety:
6747            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6748            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6749            //   envelope_size bytes, there is always sufficient room.
6750            fidl::encoding::encode_in_envelope_optional::<
6751                bool,
6752                fidl::encoding::DefaultFuchsiaResourceDialect,
6753            >(
6754                self.is_fatal.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6755                encoder,
6756                offset + cur_offset,
6757                depth,
6758            )?;
6759
6760            _prev_end_offset = cur_offset + envelope_size;
6761
6762            Ok(())
6763        }
6764    }
6765
6766    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for CrashReport {
6767        #[inline(always)]
6768        fn new_empty() -> Self {
6769            Self::default()
6770        }
6771
6772        unsafe fn decode(
6773            &mut self,
6774            decoder: &mut fidl::encoding::Decoder<
6775                '_,
6776                fidl::encoding::DefaultFuchsiaResourceDialect,
6777            >,
6778            offset: usize,
6779            mut depth: fidl::encoding::Depth,
6780        ) -> fidl::Result<()> {
6781            decoder.debug_check_bounds::<Self>(offset);
6782            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6783                None => return Err(fidl::Error::NotNullable),
6784                Some(len) => len,
6785            };
6786            // Calling decoder.out_of_line_offset(0) is not allowed.
6787            if len == 0 {
6788                return Ok(());
6789            };
6790            depth.increment()?;
6791            let envelope_size = 8;
6792            let bytes_len = len * envelope_size;
6793            let offset = decoder.out_of_line_offset(bytes_len)?;
6794            // Decode the envelope for each type.
6795            let mut _next_ordinal_to_read = 0;
6796            let mut next_offset = offset;
6797            let end_offset = offset + bytes_len;
6798            _next_ordinal_to_read += 1;
6799            if next_offset >= end_offset {
6800                return Ok(());
6801            }
6802
6803            // Decode unknown envelopes for gaps in ordinals.
6804            while _next_ordinal_to_read < 1 {
6805                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6806                _next_ordinal_to_read += 1;
6807                next_offset += envelope_size;
6808            }
6809
6810            let next_out_of_line = decoder.next_out_of_line();
6811            let handles_before = decoder.remaining_handles();
6812            if let Some((inlined, num_bytes, num_handles)) =
6813                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6814            {
6815                let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6816                if inlined != (member_inline_size <= 4) {
6817                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6818                }
6819                let inner_offset;
6820                let mut inner_depth = depth.clone();
6821                if inlined {
6822                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6823                    inner_offset = next_offset;
6824                } else {
6825                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6826                    inner_depth.increment()?;
6827                }
6828                let val_ref = self.program_name.get_or_insert_with(|| {
6829                    fidl::new_empty!(
6830                        fidl::encoding::BoundedString<1024>,
6831                        fidl::encoding::DefaultFuchsiaResourceDialect
6832                    )
6833                });
6834                fidl::decode!(
6835                    fidl::encoding::BoundedString<1024>,
6836                    fidl::encoding::DefaultFuchsiaResourceDialect,
6837                    val_ref,
6838                    decoder,
6839                    inner_offset,
6840                    inner_depth
6841                )?;
6842                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6843                {
6844                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6845                }
6846                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6847                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6848                }
6849            }
6850
6851            next_offset += envelope_size;
6852            _next_ordinal_to_read += 1;
6853            if next_offset >= end_offset {
6854                return Ok(());
6855            }
6856
6857            // Decode unknown envelopes for gaps in ordinals.
6858            while _next_ordinal_to_read < 2 {
6859                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6860                _next_ordinal_to_read += 1;
6861                next_offset += envelope_size;
6862            }
6863
6864            let next_out_of_line = decoder.next_out_of_line();
6865            let handles_before = decoder.remaining_handles();
6866            if let Some((inlined, num_bytes, num_handles)) =
6867                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6868            {
6869                let member_inline_size =
6870                    <SpecificCrashReport as fidl::encoding::TypeMarker>::inline_size(
6871                        decoder.context,
6872                    );
6873                if inlined != (member_inline_size <= 4) {
6874                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6875                }
6876                let inner_offset;
6877                let mut inner_depth = depth.clone();
6878                if inlined {
6879                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6880                    inner_offset = next_offset;
6881                } else {
6882                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6883                    inner_depth.increment()?;
6884                }
6885                let val_ref = self.specific_report.get_or_insert_with(|| {
6886                    fidl::new_empty!(
6887                        SpecificCrashReport,
6888                        fidl::encoding::DefaultFuchsiaResourceDialect
6889                    )
6890                });
6891                fidl::decode!(
6892                    SpecificCrashReport,
6893                    fidl::encoding::DefaultFuchsiaResourceDialect,
6894                    val_ref,
6895                    decoder,
6896                    inner_offset,
6897                    inner_depth
6898                )?;
6899                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6900                {
6901                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6902                }
6903                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6904                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6905                }
6906            }
6907
6908            next_offset += envelope_size;
6909            _next_ordinal_to_read += 1;
6910            if next_offset >= end_offset {
6911                return Ok(());
6912            }
6913
6914            // Decode unknown envelopes for gaps in ordinals.
6915            while _next_ordinal_to_read < 3 {
6916                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6917                _next_ordinal_to_read += 1;
6918                next_offset += envelope_size;
6919            }
6920
6921            let next_out_of_line = decoder.next_out_of_line();
6922            let handles_before = decoder.remaining_handles();
6923            if let Some((inlined, num_bytes, num_handles)) =
6924                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6925            {
6926                let member_inline_size = <fidl::encoding::Vector<Annotation, 32> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6927                if inlined != (member_inline_size <= 4) {
6928                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6929                }
6930                let inner_offset;
6931                let mut inner_depth = depth.clone();
6932                if inlined {
6933                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6934                    inner_offset = next_offset;
6935                } else {
6936                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6937                    inner_depth.increment()?;
6938                }
6939                let val_ref =
6940                self.annotations.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<Annotation, 32>, fidl::encoding::DefaultFuchsiaResourceDialect));
6941                fidl::decode!(fidl::encoding::Vector<Annotation, 32>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
6942                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6943                {
6944                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6945                }
6946                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6947                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6948                }
6949            }
6950
6951            next_offset += envelope_size;
6952            _next_ordinal_to_read += 1;
6953            if next_offset >= end_offset {
6954                return Ok(());
6955            }
6956
6957            // Decode unknown envelopes for gaps in ordinals.
6958            while _next_ordinal_to_read < 4 {
6959                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6960                _next_ordinal_to_read += 1;
6961                next_offset += envelope_size;
6962            }
6963
6964            let next_out_of_line = decoder.next_out_of_line();
6965            let handles_before = decoder.remaining_handles();
6966            if let Some((inlined, num_bytes, num_handles)) =
6967                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6968            {
6969                let member_inline_size = <fidl::encoding::Vector<Attachment, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6970                if inlined != (member_inline_size <= 4) {
6971                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6972                }
6973                let inner_offset;
6974                let mut inner_depth = depth.clone();
6975                if inlined {
6976                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6977                    inner_offset = next_offset;
6978                } else {
6979                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6980                    inner_depth.increment()?;
6981                }
6982                let val_ref =
6983                self.attachments.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<Attachment, 16>, fidl::encoding::DefaultFuchsiaResourceDialect));
6984                fidl::decode!(fidl::encoding::Vector<Attachment, 16>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
6985                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6986                {
6987                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6988                }
6989                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6990                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6991                }
6992            }
6993
6994            next_offset += envelope_size;
6995            _next_ordinal_to_read += 1;
6996            if next_offset >= end_offset {
6997                return Ok(());
6998            }
6999
7000            // Decode unknown envelopes for gaps in ordinals.
7001            while _next_ordinal_to_read < 5 {
7002                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7003                _next_ordinal_to_read += 1;
7004                next_offset += envelope_size;
7005            }
7006
7007            let next_out_of_line = decoder.next_out_of_line();
7008            let handles_before = decoder.remaining_handles();
7009            if let Some((inlined, num_bytes, num_handles)) =
7010                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7011            {
7012                let member_inline_size =
7013                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
7014                        decoder.context,
7015                    );
7016                if inlined != (member_inline_size <= 4) {
7017                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7018                }
7019                let inner_offset;
7020                let mut inner_depth = depth.clone();
7021                if inlined {
7022                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7023                    inner_offset = next_offset;
7024                } else {
7025                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7026                    inner_depth.increment()?;
7027                }
7028                let val_ref = self.event_id.get_or_insert_with(|| {
7029                    fidl::new_empty!(
7030                        fidl::encoding::BoundedString<128>,
7031                        fidl::encoding::DefaultFuchsiaResourceDialect
7032                    )
7033                });
7034                fidl::decode!(
7035                    fidl::encoding::BoundedString<128>,
7036                    fidl::encoding::DefaultFuchsiaResourceDialect,
7037                    val_ref,
7038                    decoder,
7039                    inner_offset,
7040                    inner_depth
7041                )?;
7042                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7043                {
7044                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7045                }
7046                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7047                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7048                }
7049            }
7050
7051            next_offset += envelope_size;
7052            _next_ordinal_to_read += 1;
7053            if next_offset >= end_offset {
7054                return Ok(());
7055            }
7056
7057            // Decode unknown envelopes for gaps in ordinals.
7058            while _next_ordinal_to_read < 6 {
7059                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7060                _next_ordinal_to_read += 1;
7061                next_offset += envelope_size;
7062            }
7063
7064            let next_out_of_line = decoder.next_out_of_line();
7065            let handles_before = decoder.remaining_handles();
7066            if let Some((inlined, num_bytes, num_handles)) =
7067                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7068            {
7069                let member_inline_size =
7070                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7071                if inlined != (member_inline_size <= 4) {
7072                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7073                }
7074                let inner_offset;
7075                let mut inner_depth = depth.clone();
7076                if inlined {
7077                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7078                    inner_offset = next_offset;
7079                } else {
7080                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7081                    inner_depth.increment()?;
7082                }
7083                let val_ref = self.program_uptime.get_or_insert_with(|| {
7084                    fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
7085                });
7086                fidl::decode!(
7087                    i64,
7088                    fidl::encoding::DefaultFuchsiaResourceDialect,
7089                    val_ref,
7090                    decoder,
7091                    inner_offset,
7092                    inner_depth
7093                )?;
7094                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7095                {
7096                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7097                }
7098                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7099                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7100                }
7101            }
7102
7103            next_offset += envelope_size;
7104            _next_ordinal_to_read += 1;
7105            if next_offset >= end_offset {
7106                return Ok(());
7107            }
7108
7109            // Decode unknown envelopes for gaps in ordinals.
7110            while _next_ordinal_to_read < 7 {
7111                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7112                _next_ordinal_to_read += 1;
7113                next_offset += envelope_size;
7114            }
7115
7116            let next_out_of_line = decoder.next_out_of_line();
7117            let handles_before = decoder.remaining_handles();
7118            if let Some((inlined, num_bytes, num_handles)) =
7119                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7120            {
7121                let member_inline_size =
7122                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
7123                        decoder.context,
7124                    );
7125                if inlined != (member_inline_size <= 4) {
7126                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7127                }
7128                let inner_offset;
7129                let mut inner_depth = depth.clone();
7130                if inlined {
7131                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7132                    inner_offset = next_offset;
7133                } else {
7134                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7135                    inner_depth.increment()?;
7136                }
7137                let val_ref = self.crash_signature.get_or_insert_with(|| {
7138                    fidl::new_empty!(
7139                        fidl::encoding::BoundedString<128>,
7140                        fidl::encoding::DefaultFuchsiaResourceDialect
7141                    )
7142                });
7143                fidl::decode!(
7144                    fidl::encoding::BoundedString<128>,
7145                    fidl::encoding::DefaultFuchsiaResourceDialect,
7146                    val_ref,
7147                    decoder,
7148                    inner_offset,
7149                    inner_depth
7150                )?;
7151                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7152                {
7153                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7154                }
7155                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7156                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7157                }
7158            }
7159
7160            next_offset += envelope_size;
7161            _next_ordinal_to_read += 1;
7162            if next_offset >= end_offset {
7163                return Ok(());
7164            }
7165
7166            // Decode unknown envelopes for gaps in ordinals.
7167            while _next_ordinal_to_read < 8 {
7168                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7169                _next_ordinal_to_read += 1;
7170                next_offset += envelope_size;
7171            }
7172
7173            let next_out_of_line = decoder.next_out_of_line();
7174            let handles_before = decoder.remaining_handles();
7175            if let Some((inlined, num_bytes, num_handles)) =
7176                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7177            {
7178                let member_inline_size =
7179                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7180                if inlined != (member_inline_size <= 4) {
7181                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7182                }
7183                let inner_offset;
7184                let mut inner_depth = depth.clone();
7185                if inlined {
7186                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7187                    inner_offset = next_offset;
7188                } else {
7189                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7190                    inner_depth.increment()?;
7191                }
7192                let val_ref = self.is_fatal.get_or_insert_with(|| {
7193                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
7194                });
7195                fidl::decode!(
7196                    bool,
7197                    fidl::encoding::DefaultFuchsiaResourceDialect,
7198                    val_ref,
7199                    decoder,
7200                    inner_offset,
7201                    inner_depth
7202                )?;
7203                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7204                {
7205                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7206                }
7207                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7208                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7209                }
7210            }
7211
7212            next_offset += envelope_size;
7213
7214            // Decode the remaining unknown envelopes.
7215            while next_offset < end_offset {
7216                _next_ordinal_to_read += 1;
7217                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7218                next_offset += envelope_size;
7219            }
7220
7221            Ok(())
7222        }
7223    }
7224
7225    impl CrashReportingProduct {
7226        #[inline(always)]
7227        fn max_ordinal_present(&self) -> u64 {
7228            if let Some(_) = self.channel {
7229                return 3;
7230            }
7231            if let Some(_) = self.version {
7232                return 2;
7233            }
7234            if let Some(_) = self.name {
7235                return 1;
7236            }
7237            0
7238        }
7239    }
7240
7241    impl fidl::encoding::ValueTypeMarker for CrashReportingProduct {
7242        type Borrowed<'a> = &'a Self;
7243        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7244            value
7245        }
7246    }
7247
7248    unsafe impl fidl::encoding::TypeMarker for CrashReportingProduct {
7249        type Owned = Self;
7250
7251        #[inline(always)]
7252        fn inline_align(_context: fidl::encoding::Context) -> usize {
7253            8
7254        }
7255
7256        #[inline(always)]
7257        fn inline_size(_context: fidl::encoding::Context) -> usize {
7258            16
7259        }
7260    }
7261
7262    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CrashReportingProduct, D>
7263        for &CrashReportingProduct
7264    {
7265        unsafe fn encode(
7266            self,
7267            encoder: &mut fidl::encoding::Encoder<'_, D>,
7268            offset: usize,
7269            mut depth: fidl::encoding::Depth,
7270        ) -> fidl::Result<()> {
7271            encoder.debug_check_bounds::<CrashReportingProduct>(offset);
7272            // Vector header
7273            let max_ordinal: u64 = self.max_ordinal_present();
7274            encoder.write_num(max_ordinal, offset);
7275            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7276            // Calling encoder.out_of_line_offset(0) is not allowed.
7277            if max_ordinal == 0 {
7278                return Ok(());
7279            }
7280            depth.increment()?;
7281            let envelope_size = 8;
7282            let bytes_len = max_ordinal as usize * envelope_size;
7283            #[allow(unused_variables)]
7284            let offset = encoder.out_of_line_offset(bytes_len);
7285            let mut _prev_end_offset: usize = 0;
7286            if 1 > max_ordinal {
7287                return Ok(());
7288            }
7289
7290            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7291            // are envelope_size bytes.
7292            let cur_offset: usize = (1 - 1) * envelope_size;
7293
7294            // Zero reserved fields.
7295            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7296
7297            // Safety:
7298            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7299            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7300            //   envelope_size bytes, there is always sufficient room.
7301            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
7302                self.name.as_ref().map(
7303                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
7304                ),
7305                encoder,
7306                offset + cur_offset,
7307                depth,
7308            )?;
7309
7310            _prev_end_offset = cur_offset + envelope_size;
7311            if 2 > max_ordinal {
7312                return Ok(());
7313            }
7314
7315            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7316            // are envelope_size bytes.
7317            let cur_offset: usize = (2 - 1) * envelope_size;
7318
7319            // Zero reserved fields.
7320            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7321
7322            // Safety:
7323            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7324            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7325            //   envelope_size bytes, there is always sufficient room.
7326            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
7327                self.version.as_ref().map(
7328                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
7329                ),
7330                encoder,
7331                offset + cur_offset,
7332                depth,
7333            )?;
7334
7335            _prev_end_offset = cur_offset + envelope_size;
7336            if 3 > max_ordinal {
7337                return Ok(());
7338            }
7339
7340            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7341            // are envelope_size bytes.
7342            let cur_offset: usize = (3 - 1) * envelope_size;
7343
7344            // Zero reserved fields.
7345            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7346
7347            // Safety:
7348            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7349            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7350            //   envelope_size bytes, there is always sufficient room.
7351            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
7352                self.channel.as_ref().map(
7353                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
7354                ),
7355                encoder,
7356                offset + cur_offset,
7357                depth,
7358            )?;
7359
7360            _prev_end_offset = cur_offset + envelope_size;
7361
7362            Ok(())
7363        }
7364    }
7365
7366    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CrashReportingProduct {
7367        #[inline(always)]
7368        fn new_empty() -> Self {
7369            Self::default()
7370        }
7371
7372        unsafe fn decode(
7373            &mut self,
7374            decoder: &mut fidl::encoding::Decoder<'_, D>,
7375            offset: usize,
7376            mut depth: fidl::encoding::Depth,
7377        ) -> fidl::Result<()> {
7378            decoder.debug_check_bounds::<Self>(offset);
7379            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7380                None => return Err(fidl::Error::NotNullable),
7381                Some(len) => len,
7382            };
7383            // Calling decoder.out_of_line_offset(0) is not allowed.
7384            if len == 0 {
7385                return Ok(());
7386            };
7387            depth.increment()?;
7388            let envelope_size = 8;
7389            let bytes_len = len * envelope_size;
7390            let offset = decoder.out_of_line_offset(bytes_len)?;
7391            // Decode the envelope for each type.
7392            let mut _next_ordinal_to_read = 0;
7393            let mut next_offset = offset;
7394            let end_offset = offset + bytes_len;
7395            _next_ordinal_to_read += 1;
7396            if next_offset >= end_offset {
7397                return Ok(());
7398            }
7399
7400            // Decode unknown envelopes for gaps in ordinals.
7401            while _next_ordinal_to_read < 1 {
7402                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7403                _next_ordinal_to_read += 1;
7404                next_offset += envelope_size;
7405            }
7406
7407            let next_out_of_line = decoder.next_out_of_line();
7408            let handles_before = decoder.remaining_handles();
7409            if let Some((inlined, num_bytes, num_handles)) =
7410                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7411            {
7412                let member_inline_size =
7413                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
7414                        decoder.context,
7415                    );
7416                if inlined != (member_inline_size <= 4) {
7417                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7418                }
7419                let inner_offset;
7420                let mut inner_depth = depth.clone();
7421                if inlined {
7422                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7423                    inner_offset = next_offset;
7424                } else {
7425                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7426                    inner_depth.increment()?;
7427                }
7428                let val_ref = self
7429                    .name
7430                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
7431                fidl::decode!(
7432                    fidl::encoding::UnboundedString,
7433                    D,
7434                    val_ref,
7435                    decoder,
7436                    inner_offset,
7437                    inner_depth
7438                )?;
7439                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7440                {
7441                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7442                }
7443                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7444                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7445                }
7446            }
7447
7448            next_offset += envelope_size;
7449            _next_ordinal_to_read += 1;
7450            if next_offset >= end_offset {
7451                return Ok(());
7452            }
7453
7454            // Decode unknown envelopes for gaps in ordinals.
7455            while _next_ordinal_to_read < 2 {
7456                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7457                _next_ordinal_to_read += 1;
7458                next_offset += envelope_size;
7459            }
7460
7461            let next_out_of_line = decoder.next_out_of_line();
7462            let handles_before = decoder.remaining_handles();
7463            if let Some((inlined, num_bytes, num_handles)) =
7464                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7465            {
7466                let member_inline_size =
7467                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
7468                        decoder.context,
7469                    );
7470                if inlined != (member_inline_size <= 4) {
7471                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7472                }
7473                let inner_offset;
7474                let mut inner_depth = depth.clone();
7475                if inlined {
7476                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7477                    inner_offset = next_offset;
7478                } else {
7479                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7480                    inner_depth.increment()?;
7481                }
7482                let val_ref = self
7483                    .version
7484                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
7485                fidl::decode!(
7486                    fidl::encoding::UnboundedString,
7487                    D,
7488                    val_ref,
7489                    decoder,
7490                    inner_offset,
7491                    inner_depth
7492                )?;
7493                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7494                {
7495                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7496                }
7497                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7498                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7499                }
7500            }
7501
7502            next_offset += envelope_size;
7503            _next_ordinal_to_read += 1;
7504            if next_offset >= end_offset {
7505                return Ok(());
7506            }
7507
7508            // Decode unknown envelopes for gaps in ordinals.
7509            while _next_ordinal_to_read < 3 {
7510                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7511                _next_ordinal_to_read += 1;
7512                next_offset += envelope_size;
7513            }
7514
7515            let next_out_of_line = decoder.next_out_of_line();
7516            let handles_before = decoder.remaining_handles();
7517            if let Some((inlined, num_bytes, num_handles)) =
7518                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7519            {
7520                let member_inline_size =
7521                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
7522                        decoder.context,
7523                    );
7524                if inlined != (member_inline_size <= 4) {
7525                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7526                }
7527                let inner_offset;
7528                let mut inner_depth = depth.clone();
7529                if inlined {
7530                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7531                    inner_offset = next_offset;
7532                } else {
7533                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7534                    inner_depth.increment()?;
7535                }
7536                let val_ref = self
7537                    .channel
7538                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
7539                fidl::decode!(
7540                    fidl::encoding::UnboundedString,
7541                    D,
7542                    val_ref,
7543                    decoder,
7544                    inner_offset,
7545                    inner_depth
7546                )?;
7547                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7548                {
7549                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7550                }
7551                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7552                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7553                }
7554            }
7555
7556            next_offset += envelope_size;
7557
7558            // Decode the remaining unknown envelopes.
7559            while next_offset < end_offset {
7560                _next_ordinal_to_read += 1;
7561                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7562                next_offset += envelope_size;
7563            }
7564
7565            Ok(())
7566        }
7567    }
7568
7569    impl FileReportResults {
7570        #[inline(always)]
7571        fn max_ordinal_present(&self) -> u64 {
7572            if let Some(_) = self.report_id {
7573                return 2;
7574            }
7575            if let Some(_) = self.result {
7576                return 1;
7577            }
7578            0
7579        }
7580    }
7581
7582    impl fidl::encoding::ValueTypeMarker for FileReportResults {
7583        type Borrowed<'a> = &'a Self;
7584        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7585            value
7586        }
7587    }
7588
7589    unsafe impl fidl::encoding::TypeMarker for FileReportResults {
7590        type Owned = Self;
7591
7592        #[inline(always)]
7593        fn inline_align(_context: fidl::encoding::Context) -> usize {
7594            8
7595        }
7596
7597        #[inline(always)]
7598        fn inline_size(_context: fidl::encoding::Context) -> usize {
7599            16
7600        }
7601    }
7602
7603    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileReportResults, D>
7604        for &FileReportResults
7605    {
7606        unsafe fn encode(
7607            self,
7608            encoder: &mut fidl::encoding::Encoder<'_, D>,
7609            offset: usize,
7610            mut depth: fidl::encoding::Depth,
7611        ) -> fidl::Result<()> {
7612            encoder.debug_check_bounds::<FileReportResults>(offset);
7613            // Vector header
7614            let max_ordinal: u64 = self.max_ordinal_present();
7615            encoder.write_num(max_ordinal, offset);
7616            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7617            // Calling encoder.out_of_line_offset(0) is not allowed.
7618            if max_ordinal == 0 {
7619                return Ok(());
7620            }
7621            depth.increment()?;
7622            let envelope_size = 8;
7623            let bytes_len = max_ordinal as usize * envelope_size;
7624            #[allow(unused_variables)]
7625            let offset = encoder.out_of_line_offset(bytes_len);
7626            let mut _prev_end_offset: usize = 0;
7627            if 1 > max_ordinal {
7628                return Ok(());
7629            }
7630
7631            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7632            // are envelope_size bytes.
7633            let cur_offset: usize = (1 - 1) * envelope_size;
7634
7635            // Zero reserved fields.
7636            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7637
7638            // Safety:
7639            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7640            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7641            //   envelope_size bytes, there is always sufficient room.
7642            fidl::encoding::encode_in_envelope_optional::<FilingSuccess, D>(
7643                self.result
7644                    .as_ref()
7645                    .map(<FilingSuccess as fidl::encoding::ValueTypeMarker>::borrow),
7646                encoder,
7647                offset + cur_offset,
7648                depth,
7649            )?;
7650
7651            _prev_end_offset = cur_offset + envelope_size;
7652            if 2 > max_ordinal {
7653                return Ok(());
7654            }
7655
7656            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7657            // are envelope_size bytes.
7658            let cur_offset: usize = (2 - 1) * envelope_size;
7659
7660            // Zero reserved fields.
7661            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7662
7663            // Safety:
7664            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7665            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7666            //   envelope_size bytes, there is always sufficient room.
7667            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<64>, D>(
7668                self.report_id.as_ref().map(
7669                    <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow,
7670                ),
7671                encoder,
7672                offset + cur_offset,
7673                depth,
7674            )?;
7675
7676            _prev_end_offset = cur_offset + envelope_size;
7677
7678            Ok(())
7679        }
7680    }
7681
7682    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileReportResults {
7683        #[inline(always)]
7684        fn new_empty() -> Self {
7685            Self::default()
7686        }
7687
7688        unsafe fn decode(
7689            &mut self,
7690            decoder: &mut fidl::encoding::Decoder<'_, D>,
7691            offset: usize,
7692            mut depth: fidl::encoding::Depth,
7693        ) -> fidl::Result<()> {
7694            decoder.debug_check_bounds::<Self>(offset);
7695            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7696                None => return Err(fidl::Error::NotNullable),
7697                Some(len) => len,
7698            };
7699            // Calling decoder.out_of_line_offset(0) is not allowed.
7700            if len == 0 {
7701                return Ok(());
7702            };
7703            depth.increment()?;
7704            let envelope_size = 8;
7705            let bytes_len = len * envelope_size;
7706            let offset = decoder.out_of_line_offset(bytes_len)?;
7707            // Decode the envelope for each type.
7708            let mut _next_ordinal_to_read = 0;
7709            let mut next_offset = offset;
7710            let end_offset = offset + bytes_len;
7711            _next_ordinal_to_read += 1;
7712            if next_offset >= end_offset {
7713                return Ok(());
7714            }
7715
7716            // Decode unknown envelopes for gaps in ordinals.
7717            while _next_ordinal_to_read < 1 {
7718                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7719                _next_ordinal_to_read += 1;
7720                next_offset += envelope_size;
7721            }
7722
7723            let next_out_of_line = decoder.next_out_of_line();
7724            let handles_before = decoder.remaining_handles();
7725            if let Some((inlined, num_bytes, num_handles)) =
7726                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7727            {
7728                let member_inline_size =
7729                    <FilingSuccess as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7730                if inlined != (member_inline_size <= 4) {
7731                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7732                }
7733                let inner_offset;
7734                let mut inner_depth = depth.clone();
7735                if inlined {
7736                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7737                    inner_offset = next_offset;
7738                } else {
7739                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7740                    inner_depth.increment()?;
7741                }
7742                let val_ref = self.result.get_or_insert_with(|| fidl::new_empty!(FilingSuccess, D));
7743                fidl::decode!(FilingSuccess, D, val_ref, decoder, inner_offset, inner_depth)?;
7744                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7745                {
7746                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7747                }
7748                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7749                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7750                }
7751            }
7752
7753            next_offset += envelope_size;
7754            _next_ordinal_to_read += 1;
7755            if next_offset >= end_offset {
7756                return Ok(());
7757            }
7758
7759            // Decode unknown envelopes for gaps in ordinals.
7760            while _next_ordinal_to_read < 2 {
7761                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7762                _next_ordinal_to_read += 1;
7763                next_offset += envelope_size;
7764            }
7765
7766            let next_out_of_line = decoder.next_out_of_line();
7767            let handles_before = decoder.remaining_handles();
7768            if let Some((inlined, num_bytes, num_handles)) =
7769                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7770            {
7771                let member_inline_size =
7772                    <fidl::encoding::BoundedString<64> as fidl::encoding::TypeMarker>::inline_size(
7773                        decoder.context,
7774                    );
7775                if inlined != (member_inline_size <= 4) {
7776                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7777                }
7778                let inner_offset;
7779                let mut inner_depth = depth.clone();
7780                if inlined {
7781                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7782                    inner_offset = next_offset;
7783                } else {
7784                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7785                    inner_depth.increment()?;
7786                }
7787                let val_ref = self
7788                    .report_id
7789                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<64>, D));
7790                fidl::decode!(
7791                    fidl::encoding::BoundedString<64>,
7792                    D,
7793                    val_ref,
7794                    decoder,
7795                    inner_offset,
7796                    inner_depth
7797                )?;
7798                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7799                {
7800                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7801                }
7802                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7803                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7804                }
7805            }
7806
7807            next_offset += envelope_size;
7808
7809            // Decode the remaining unknown envelopes.
7810            while next_offset < end_offset {
7811                _next_ordinal_to_read += 1;
7812                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7813                next_offset += envelope_size;
7814            }
7815
7816            Ok(())
7817        }
7818    }
7819
7820    impl GetAnnotationsParameters {
7821        #[inline(always)]
7822        fn max_ordinal_present(&self) -> u64 {
7823            if let Some(_) = self.collection_timeout_per_annotation {
7824                return 1;
7825            }
7826            0
7827        }
7828    }
7829
7830    impl fidl::encoding::ValueTypeMarker for GetAnnotationsParameters {
7831        type Borrowed<'a> = &'a Self;
7832        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7833            value
7834        }
7835    }
7836
7837    unsafe impl fidl::encoding::TypeMarker for GetAnnotationsParameters {
7838        type Owned = Self;
7839
7840        #[inline(always)]
7841        fn inline_align(_context: fidl::encoding::Context) -> usize {
7842            8
7843        }
7844
7845        #[inline(always)]
7846        fn inline_size(_context: fidl::encoding::Context) -> usize {
7847            16
7848        }
7849    }
7850
7851    unsafe impl<D: fidl::encoding::ResourceDialect>
7852        fidl::encoding::Encode<GetAnnotationsParameters, D> for &GetAnnotationsParameters
7853    {
7854        unsafe fn encode(
7855            self,
7856            encoder: &mut fidl::encoding::Encoder<'_, D>,
7857            offset: usize,
7858            mut depth: fidl::encoding::Depth,
7859        ) -> fidl::Result<()> {
7860            encoder.debug_check_bounds::<GetAnnotationsParameters>(offset);
7861            // Vector header
7862            let max_ordinal: u64 = self.max_ordinal_present();
7863            encoder.write_num(max_ordinal, offset);
7864            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7865            // Calling encoder.out_of_line_offset(0) is not allowed.
7866            if max_ordinal == 0 {
7867                return Ok(());
7868            }
7869            depth.increment()?;
7870            let envelope_size = 8;
7871            let bytes_len = max_ordinal as usize * envelope_size;
7872            #[allow(unused_variables)]
7873            let offset = encoder.out_of_line_offset(bytes_len);
7874            let mut _prev_end_offset: usize = 0;
7875            if 1 > max_ordinal {
7876                return Ok(());
7877            }
7878
7879            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7880            // are envelope_size bytes.
7881            let cur_offset: usize = (1 - 1) * envelope_size;
7882
7883            // Zero reserved fields.
7884            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7885
7886            // Safety:
7887            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7888            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7889            //   envelope_size bytes, there is always sufficient room.
7890            fidl::encoding::encode_in_envelope_optional::<i64, D>(
7891                self.collection_timeout_per_annotation
7892                    .as_ref()
7893                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
7894                encoder,
7895                offset + cur_offset,
7896                depth,
7897            )?;
7898
7899            _prev_end_offset = cur_offset + envelope_size;
7900
7901            Ok(())
7902        }
7903    }
7904
7905    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7906        for GetAnnotationsParameters
7907    {
7908        #[inline(always)]
7909        fn new_empty() -> Self {
7910            Self::default()
7911        }
7912
7913        unsafe fn decode(
7914            &mut self,
7915            decoder: &mut fidl::encoding::Decoder<'_, D>,
7916            offset: usize,
7917            mut depth: fidl::encoding::Depth,
7918        ) -> fidl::Result<()> {
7919            decoder.debug_check_bounds::<Self>(offset);
7920            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7921                None => return Err(fidl::Error::NotNullable),
7922                Some(len) => len,
7923            };
7924            // Calling decoder.out_of_line_offset(0) is not allowed.
7925            if len == 0 {
7926                return Ok(());
7927            };
7928            depth.increment()?;
7929            let envelope_size = 8;
7930            let bytes_len = len * envelope_size;
7931            let offset = decoder.out_of_line_offset(bytes_len)?;
7932            // Decode the envelope for each type.
7933            let mut _next_ordinal_to_read = 0;
7934            let mut next_offset = offset;
7935            let end_offset = offset + bytes_len;
7936            _next_ordinal_to_read += 1;
7937            if next_offset >= end_offset {
7938                return Ok(());
7939            }
7940
7941            // Decode unknown envelopes for gaps in ordinals.
7942            while _next_ordinal_to_read < 1 {
7943                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7944                _next_ordinal_to_read += 1;
7945                next_offset += envelope_size;
7946            }
7947
7948            let next_out_of_line = decoder.next_out_of_line();
7949            let handles_before = decoder.remaining_handles();
7950            if let Some((inlined, num_bytes, num_handles)) =
7951                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7952            {
7953                let member_inline_size =
7954                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7955                if inlined != (member_inline_size <= 4) {
7956                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7957                }
7958                let inner_offset;
7959                let mut inner_depth = depth.clone();
7960                if inlined {
7961                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7962                    inner_offset = next_offset;
7963                } else {
7964                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7965                    inner_depth.increment()?;
7966                }
7967                let val_ref = self
7968                    .collection_timeout_per_annotation
7969                    .get_or_insert_with(|| fidl::new_empty!(i64, D));
7970                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
7971                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7972                {
7973                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7974                }
7975                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7976                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7977                }
7978            }
7979
7980            next_offset += envelope_size;
7981
7982            // Decode the remaining unknown envelopes.
7983            while next_offset < end_offset {
7984                _next_ordinal_to_read += 1;
7985                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7986                next_offset += envelope_size;
7987            }
7988
7989            Ok(())
7990        }
7991    }
7992
7993    impl GetSnapshotParameters {
7994        #[inline(always)]
7995        fn max_ordinal_present(&self) -> u64 {
7996            if let Some(_) = self.response_channel {
7997                return 2;
7998            }
7999            if let Some(_) = self.collection_timeout_per_data {
8000                return 1;
8001            }
8002            0
8003        }
8004    }
8005
8006    impl fidl::encoding::ResourceTypeMarker for GetSnapshotParameters {
8007        type Borrowed<'a> = &'a mut Self;
8008        fn take_or_borrow<'a>(
8009            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8010        ) -> Self::Borrowed<'a> {
8011            value
8012        }
8013    }
8014
8015    unsafe impl fidl::encoding::TypeMarker for GetSnapshotParameters {
8016        type Owned = Self;
8017
8018        #[inline(always)]
8019        fn inline_align(_context: fidl::encoding::Context) -> usize {
8020            8
8021        }
8022
8023        #[inline(always)]
8024        fn inline_size(_context: fidl::encoding::Context) -> usize {
8025            16
8026        }
8027    }
8028
8029    unsafe impl
8030        fidl::encoding::Encode<GetSnapshotParameters, fidl::encoding::DefaultFuchsiaResourceDialect>
8031        for &mut GetSnapshotParameters
8032    {
8033        unsafe fn encode(
8034            self,
8035            encoder: &mut fidl::encoding::Encoder<
8036                '_,
8037                fidl::encoding::DefaultFuchsiaResourceDialect,
8038            >,
8039            offset: usize,
8040            mut depth: fidl::encoding::Depth,
8041        ) -> fidl::Result<()> {
8042            encoder.debug_check_bounds::<GetSnapshotParameters>(offset);
8043            // Vector header
8044            let max_ordinal: u64 = self.max_ordinal_present();
8045            encoder.write_num(max_ordinal, offset);
8046            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8047            // Calling encoder.out_of_line_offset(0) is not allowed.
8048            if max_ordinal == 0 {
8049                return Ok(());
8050            }
8051            depth.increment()?;
8052            let envelope_size = 8;
8053            let bytes_len = max_ordinal as usize * envelope_size;
8054            #[allow(unused_variables)]
8055            let offset = encoder.out_of_line_offset(bytes_len);
8056            let mut _prev_end_offset: usize = 0;
8057            if 1 > max_ordinal {
8058                return Ok(());
8059            }
8060
8061            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8062            // are envelope_size bytes.
8063            let cur_offset: usize = (1 - 1) * envelope_size;
8064
8065            // Zero reserved fields.
8066            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8067
8068            // Safety:
8069            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8070            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8071            //   envelope_size bytes, there is always sufficient room.
8072            fidl::encoding::encode_in_envelope_optional::<
8073                i64,
8074                fidl::encoding::DefaultFuchsiaResourceDialect,
8075            >(
8076                self.collection_timeout_per_data
8077                    .as_ref()
8078                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
8079                encoder,
8080                offset + cur_offset,
8081                depth,
8082            )?;
8083
8084            _prev_end_offset = cur_offset + envelope_size;
8085            if 2 > max_ordinal {
8086                return Ok(());
8087            }
8088
8089            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8090            // are envelope_size bytes.
8091            let cur_offset: usize = (2 - 1) * envelope_size;
8092
8093            // Zero reserved fields.
8094            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8095
8096            // Safety:
8097            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8098            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8099            //   envelope_size bytes, there is always sufficient room.
8100            fidl::encoding::encode_in_envelope_optional::<
8101                fidl::encoding::HandleType<
8102                    fidl::Channel,
8103                    { fidl::ObjectType::CHANNEL.into_raw() },
8104                    2147483648,
8105                >,
8106                fidl::encoding::DefaultFuchsiaResourceDialect,
8107            >(
8108                self.response_channel.as_mut().map(
8109                    <fidl::encoding::HandleType<
8110                        fidl::Channel,
8111                        { fidl::ObjectType::CHANNEL.into_raw() },
8112                        2147483648,
8113                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
8114                ),
8115                encoder,
8116                offset + cur_offset,
8117                depth,
8118            )?;
8119
8120            _prev_end_offset = cur_offset + envelope_size;
8121
8122            Ok(())
8123        }
8124    }
8125
8126    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8127        for GetSnapshotParameters
8128    {
8129        #[inline(always)]
8130        fn new_empty() -> Self {
8131            Self::default()
8132        }
8133
8134        unsafe fn decode(
8135            &mut self,
8136            decoder: &mut fidl::encoding::Decoder<
8137                '_,
8138                fidl::encoding::DefaultFuchsiaResourceDialect,
8139            >,
8140            offset: usize,
8141            mut depth: fidl::encoding::Depth,
8142        ) -> fidl::Result<()> {
8143            decoder.debug_check_bounds::<Self>(offset);
8144            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8145                None => return Err(fidl::Error::NotNullable),
8146                Some(len) => len,
8147            };
8148            // Calling decoder.out_of_line_offset(0) is not allowed.
8149            if len == 0 {
8150                return Ok(());
8151            };
8152            depth.increment()?;
8153            let envelope_size = 8;
8154            let bytes_len = len * envelope_size;
8155            let offset = decoder.out_of_line_offset(bytes_len)?;
8156            // Decode the envelope for each type.
8157            let mut _next_ordinal_to_read = 0;
8158            let mut next_offset = offset;
8159            let end_offset = offset + bytes_len;
8160            _next_ordinal_to_read += 1;
8161            if next_offset >= end_offset {
8162                return Ok(());
8163            }
8164
8165            // Decode unknown envelopes for gaps in ordinals.
8166            while _next_ordinal_to_read < 1 {
8167                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8168                _next_ordinal_to_read += 1;
8169                next_offset += envelope_size;
8170            }
8171
8172            let next_out_of_line = decoder.next_out_of_line();
8173            let handles_before = decoder.remaining_handles();
8174            if let Some((inlined, num_bytes, num_handles)) =
8175                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8176            {
8177                let member_inline_size =
8178                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8179                if inlined != (member_inline_size <= 4) {
8180                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8181                }
8182                let inner_offset;
8183                let mut inner_depth = depth.clone();
8184                if inlined {
8185                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8186                    inner_offset = next_offset;
8187                } else {
8188                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8189                    inner_depth.increment()?;
8190                }
8191                let val_ref = self.collection_timeout_per_data.get_or_insert_with(|| {
8192                    fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
8193                });
8194                fidl::decode!(
8195                    i64,
8196                    fidl::encoding::DefaultFuchsiaResourceDialect,
8197                    val_ref,
8198                    decoder,
8199                    inner_offset,
8200                    inner_depth
8201                )?;
8202                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8203                {
8204                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8205                }
8206                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8207                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8208                }
8209            }
8210
8211            next_offset += envelope_size;
8212            _next_ordinal_to_read += 1;
8213            if next_offset >= end_offset {
8214                return Ok(());
8215            }
8216
8217            // Decode unknown envelopes for gaps in ordinals.
8218            while _next_ordinal_to_read < 2 {
8219                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8220                _next_ordinal_to_read += 1;
8221                next_offset += envelope_size;
8222            }
8223
8224            let next_out_of_line = decoder.next_out_of_line();
8225            let handles_before = decoder.remaining_handles();
8226            if let Some((inlined, num_bytes, num_handles)) =
8227                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8228            {
8229                let member_inline_size = <fidl::encoding::HandleType<
8230                    fidl::Channel,
8231                    { fidl::ObjectType::CHANNEL.into_raw() },
8232                    2147483648,
8233                > as fidl::encoding::TypeMarker>::inline_size(
8234                    decoder.context
8235                );
8236                if inlined != (member_inline_size <= 4) {
8237                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8238                }
8239                let inner_offset;
8240                let mut inner_depth = depth.clone();
8241                if inlined {
8242                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8243                    inner_offset = next_offset;
8244                } else {
8245                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8246                    inner_depth.increment()?;
8247                }
8248                let val_ref =
8249                self.response_channel.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
8250                fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
8251                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8252                {
8253                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8254                }
8255                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8256                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8257                }
8258            }
8259
8260            next_offset += envelope_size;
8261
8262            // Decode the remaining unknown envelopes.
8263            while next_offset < end_offset {
8264                _next_ordinal_to_read += 1;
8265                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8266                next_offset += envelope_size;
8267            }
8268
8269            Ok(())
8270        }
8271    }
8272
8273    impl LastReboot {
8274        #[inline(always)]
8275        fn max_ordinal_present(&self) -> u64 {
8276            if let Some(_) = self.runtime {
8277                return 5;
8278            }
8279            if let Some(_) = self.planned {
8280                return 4;
8281            }
8282            if let Some(_) = self.uptime {
8283                return 3;
8284            }
8285            if let Some(_) = self.reason {
8286                return 2;
8287            }
8288            if let Some(_) = self.graceful {
8289                return 1;
8290            }
8291            0
8292        }
8293    }
8294
8295    impl fidl::encoding::ValueTypeMarker for LastReboot {
8296        type Borrowed<'a> = &'a Self;
8297        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8298            value
8299        }
8300    }
8301
8302    unsafe impl fidl::encoding::TypeMarker for LastReboot {
8303        type Owned = Self;
8304
8305        #[inline(always)]
8306        fn inline_align(_context: fidl::encoding::Context) -> usize {
8307            8
8308        }
8309
8310        #[inline(always)]
8311        fn inline_size(_context: fidl::encoding::Context) -> usize {
8312            16
8313        }
8314    }
8315
8316    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LastReboot, D>
8317        for &LastReboot
8318    {
8319        unsafe fn encode(
8320            self,
8321            encoder: &mut fidl::encoding::Encoder<'_, D>,
8322            offset: usize,
8323            mut depth: fidl::encoding::Depth,
8324        ) -> fidl::Result<()> {
8325            encoder.debug_check_bounds::<LastReboot>(offset);
8326            // Vector header
8327            let max_ordinal: u64 = self.max_ordinal_present();
8328            encoder.write_num(max_ordinal, offset);
8329            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8330            // Calling encoder.out_of_line_offset(0) is not allowed.
8331            if max_ordinal == 0 {
8332                return Ok(());
8333            }
8334            depth.increment()?;
8335            let envelope_size = 8;
8336            let bytes_len = max_ordinal as usize * envelope_size;
8337            #[allow(unused_variables)]
8338            let offset = encoder.out_of_line_offset(bytes_len);
8339            let mut _prev_end_offset: usize = 0;
8340            if 1 > max_ordinal {
8341                return Ok(());
8342            }
8343
8344            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8345            // are envelope_size bytes.
8346            let cur_offset: usize = (1 - 1) * envelope_size;
8347
8348            // Zero reserved fields.
8349            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8350
8351            // Safety:
8352            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8353            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8354            //   envelope_size bytes, there is always sufficient room.
8355            fidl::encoding::encode_in_envelope_optional::<bool, D>(
8356                self.graceful.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
8357                encoder,
8358                offset + cur_offset,
8359                depth,
8360            )?;
8361
8362            _prev_end_offset = cur_offset + envelope_size;
8363            if 2 > max_ordinal {
8364                return Ok(());
8365            }
8366
8367            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8368            // are envelope_size bytes.
8369            let cur_offset: usize = (2 - 1) * envelope_size;
8370
8371            // Zero reserved fields.
8372            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8373
8374            // Safety:
8375            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8376            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8377            //   envelope_size bytes, there is always sufficient room.
8378            fidl::encoding::encode_in_envelope_optional::<RebootReason, D>(
8379                self.reason.as_ref().map(<RebootReason as fidl::encoding::ValueTypeMarker>::borrow),
8380                encoder,
8381                offset + cur_offset,
8382                depth,
8383            )?;
8384
8385            _prev_end_offset = cur_offset + envelope_size;
8386            if 3 > max_ordinal {
8387                return Ok(());
8388            }
8389
8390            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8391            // are envelope_size bytes.
8392            let cur_offset: usize = (3 - 1) * envelope_size;
8393
8394            // Zero reserved fields.
8395            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8396
8397            // Safety:
8398            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8399            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8400            //   envelope_size bytes, there is always sufficient room.
8401            fidl::encoding::encode_in_envelope_optional::<i64, D>(
8402                self.uptime.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
8403                encoder,
8404                offset + cur_offset,
8405                depth,
8406            )?;
8407
8408            _prev_end_offset = cur_offset + envelope_size;
8409            if 4 > max_ordinal {
8410                return Ok(());
8411            }
8412
8413            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8414            // are envelope_size bytes.
8415            let cur_offset: usize = (4 - 1) * envelope_size;
8416
8417            // Zero reserved fields.
8418            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8419
8420            // Safety:
8421            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8422            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8423            //   envelope_size bytes, there is always sufficient room.
8424            fidl::encoding::encode_in_envelope_optional::<bool, D>(
8425                self.planned.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
8426                encoder,
8427                offset + cur_offset,
8428                depth,
8429            )?;
8430
8431            _prev_end_offset = cur_offset + envelope_size;
8432            if 5 > max_ordinal {
8433                return Ok(());
8434            }
8435
8436            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8437            // are envelope_size bytes.
8438            let cur_offset: usize = (5 - 1) * envelope_size;
8439
8440            // Zero reserved fields.
8441            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8442
8443            // Safety:
8444            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8445            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8446            //   envelope_size bytes, there is always sufficient room.
8447            fidl::encoding::encode_in_envelope_optional::<i64, D>(
8448                self.runtime.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
8449                encoder,
8450                offset + cur_offset,
8451                depth,
8452            )?;
8453
8454            _prev_end_offset = cur_offset + envelope_size;
8455
8456            Ok(())
8457        }
8458    }
8459
8460    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LastReboot {
8461        #[inline(always)]
8462        fn new_empty() -> Self {
8463            Self::default()
8464        }
8465
8466        unsafe fn decode(
8467            &mut self,
8468            decoder: &mut fidl::encoding::Decoder<'_, D>,
8469            offset: usize,
8470            mut depth: fidl::encoding::Depth,
8471        ) -> fidl::Result<()> {
8472            decoder.debug_check_bounds::<Self>(offset);
8473            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8474                None => return Err(fidl::Error::NotNullable),
8475                Some(len) => len,
8476            };
8477            // Calling decoder.out_of_line_offset(0) is not allowed.
8478            if len == 0 {
8479                return Ok(());
8480            };
8481            depth.increment()?;
8482            let envelope_size = 8;
8483            let bytes_len = len * envelope_size;
8484            let offset = decoder.out_of_line_offset(bytes_len)?;
8485            // Decode the envelope for each type.
8486            let mut _next_ordinal_to_read = 0;
8487            let mut next_offset = offset;
8488            let end_offset = offset + bytes_len;
8489            _next_ordinal_to_read += 1;
8490            if next_offset >= end_offset {
8491                return Ok(());
8492            }
8493
8494            // Decode unknown envelopes for gaps in ordinals.
8495            while _next_ordinal_to_read < 1 {
8496                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8497                _next_ordinal_to_read += 1;
8498                next_offset += envelope_size;
8499            }
8500
8501            let next_out_of_line = decoder.next_out_of_line();
8502            let handles_before = decoder.remaining_handles();
8503            if let Some((inlined, num_bytes, num_handles)) =
8504                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8505            {
8506                let member_inline_size =
8507                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8508                if inlined != (member_inline_size <= 4) {
8509                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8510                }
8511                let inner_offset;
8512                let mut inner_depth = depth.clone();
8513                if inlined {
8514                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8515                    inner_offset = next_offset;
8516                } else {
8517                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8518                    inner_depth.increment()?;
8519                }
8520                let val_ref = self.graceful.get_or_insert_with(|| fidl::new_empty!(bool, D));
8521                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8522                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8523                {
8524                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8525                }
8526                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8527                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8528                }
8529            }
8530
8531            next_offset += envelope_size;
8532            _next_ordinal_to_read += 1;
8533            if next_offset >= end_offset {
8534                return Ok(());
8535            }
8536
8537            // Decode unknown envelopes for gaps in ordinals.
8538            while _next_ordinal_to_read < 2 {
8539                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8540                _next_ordinal_to_read += 1;
8541                next_offset += envelope_size;
8542            }
8543
8544            let next_out_of_line = decoder.next_out_of_line();
8545            let handles_before = decoder.remaining_handles();
8546            if let Some((inlined, num_bytes, num_handles)) =
8547                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8548            {
8549                let member_inline_size =
8550                    <RebootReason as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8551                if inlined != (member_inline_size <= 4) {
8552                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8553                }
8554                let inner_offset;
8555                let mut inner_depth = depth.clone();
8556                if inlined {
8557                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8558                    inner_offset = next_offset;
8559                } else {
8560                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8561                    inner_depth.increment()?;
8562                }
8563                let val_ref = self.reason.get_or_insert_with(|| fidl::new_empty!(RebootReason, D));
8564                fidl::decode!(RebootReason, D, val_ref, decoder, inner_offset, inner_depth)?;
8565                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8566                {
8567                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8568                }
8569                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8570                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8571                }
8572            }
8573
8574            next_offset += envelope_size;
8575            _next_ordinal_to_read += 1;
8576            if next_offset >= end_offset {
8577                return Ok(());
8578            }
8579
8580            // Decode unknown envelopes for gaps in ordinals.
8581            while _next_ordinal_to_read < 3 {
8582                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8583                _next_ordinal_to_read += 1;
8584                next_offset += envelope_size;
8585            }
8586
8587            let next_out_of_line = decoder.next_out_of_line();
8588            let handles_before = decoder.remaining_handles();
8589            if let Some((inlined, num_bytes, num_handles)) =
8590                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8591            {
8592                let member_inline_size =
8593                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8594                if inlined != (member_inline_size <= 4) {
8595                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8596                }
8597                let inner_offset;
8598                let mut inner_depth = depth.clone();
8599                if inlined {
8600                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8601                    inner_offset = next_offset;
8602                } else {
8603                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8604                    inner_depth.increment()?;
8605                }
8606                let val_ref = self.uptime.get_or_insert_with(|| fidl::new_empty!(i64, D));
8607                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
8608                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8609                {
8610                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8611                }
8612                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8613                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8614                }
8615            }
8616
8617            next_offset += envelope_size;
8618            _next_ordinal_to_read += 1;
8619            if next_offset >= end_offset {
8620                return Ok(());
8621            }
8622
8623            // Decode unknown envelopes for gaps in ordinals.
8624            while _next_ordinal_to_read < 4 {
8625                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8626                _next_ordinal_to_read += 1;
8627                next_offset += envelope_size;
8628            }
8629
8630            let next_out_of_line = decoder.next_out_of_line();
8631            let handles_before = decoder.remaining_handles();
8632            if let Some((inlined, num_bytes, num_handles)) =
8633                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8634            {
8635                let member_inline_size =
8636                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8637                if inlined != (member_inline_size <= 4) {
8638                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8639                }
8640                let inner_offset;
8641                let mut inner_depth = depth.clone();
8642                if inlined {
8643                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8644                    inner_offset = next_offset;
8645                } else {
8646                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8647                    inner_depth.increment()?;
8648                }
8649                let val_ref = self.planned.get_or_insert_with(|| fidl::new_empty!(bool, D));
8650                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8651                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8652                {
8653                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8654                }
8655                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8656                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8657                }
8658            }
8659
8660            next_offset += envelope_size;
8661            _next_ordinal_to_read += 1;
8662            if next_offset >= end_offset {
8663                return Ok(());
8664            }
8665
8666            // Decode unknown envelopes for gaps in ordinals.
8667            while _next_ordinal_to_read < 5 {
8668                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8669                _next_ordinal_to_read += 1;
8670                next_offset += envelope_size;
8671            }
8672
8673            let next_out_of_line = decoder.next_out_of_line();
8674            let handles_before = decoder.remaining_handles();
8675            if let Some((inlined, num_bytes, num_handles)) =
8676                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8677            {
8678                let member_inline_size =
8679                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8680                if inlined != (member_inline_size <= 4) {
8681                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8682                }
8683                let inner_offset;
8684                let mut inner_depth = depth.clone();
8685                if inlined {
8686                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8687                    inner_offset = next_offset;
8688                } else {
8689                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8690                    inner_depth.increment()?;
8691                }
8692                let val_ref = self.runtime.get_or_insert_with(|| fidl::new_empty!(i64, D));
8693                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
8694                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8695                {
8696                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8697                }
8698                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8699                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8700                }
8701            }
8702
8703            next_offset += envelope_size;
8704
8705            // Decode the remaining unknown envelopes.
8706            while next_offset < end_offset {
8707                _next_ordinal_to_read += 1;
8708                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8709                next_offset += envelope_size;
8710            }
8711
8712            Ok(())
8713        }
8714    }
8715
8716    impl NativeCrashReport {
8717        #[inline(always)]
8718        fn max_ordinal_present(&self) -> u64 {
8719            if let Some(_) = self.thread_koid {
8720                return 5;
8721            }
8722            if let Some(_) = self.thread_name {
8723                return 4;
8724            }
8725            if let Some(_) = self.process_koid {
8726                return 3;
8727            }
8728            if let Some(_) = self.process_name {
8729                return 2;
8730            }
8731            if let Some(_) = self.minidump {
8732                return 1;
8733            }
8734            0
8735        }
8736    }
8737
8738    impl fidl::encoding::ResourceTypeMarker for NativeCrashReport {
8739        type Borrowed<'a> = &'a mut Self;
8740        fn take_or_borrow<'a>(
8741            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8742        ) -> Self::Borrowed<'a> {
8743            value
8744        }
8745    }
8746
8747    unsafe impl fidl::encoding::TypeMarker for NativeCrashReport {
8748        type Owned = Self;
8749
8750        #[inline(always)]
8751        fn inline_align(_context: fidl::encoding::Context) -> usize {
8752            8
8753        }
8754
8755        #[inline(always)]
8756        fn inline_size(_context: fidl::encoding::Context) -> usize {
8757            16
8758        }
8759    }
8760
8761    unsafe impl
8762        fidl::encoding::Encode<NativeCrashReport, fidl::encoding::DefaultFuchsiaResourceDialect>
8763        for &mut NativeCrashReport
8764    {
8765        unsafe fn encode(
8766            self,
8767            encoder: &mut fidl::encoding::Encoder<
8768                '_,
8769                fidl::encoding::DefaultFuchsiaResourceDialect,
8770            >,
8771            offset: usize,
8772            mut depth: fidl::encoding::Depth,
8773        ) -> fidl::Result<()> {
8774            encoder.debug_check_bounds::<NativeCrashReport>(offset);
8775            // Vector header
8776            let max_ordinal: u64 = self.max_ordinal_present();
8777            encoder.write_num(max_ordinal, offset);
8778            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8779            // Calling encoder.out_of_line_offset(0) is not allowed.
8780            if max_ordinal == 0 {
8781                return Ok(());
8782            }
8783            depth.increment()?;
8784            let envelope_size = 8;
8785            let bytes_len = max_ordinal as usize * envelope_size;
8786            #[allow(unused_variables)]
8787            let offset = encoder.out_of_line_offset(bytes_len);
8788            let mut _prev_end_offset: usize = 0;
8789            if 1 > max_ordinal {
8790                return Ok(());
8791            }
8792
8793            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8794            // are envelope_size bytes.
8795            let cur_offset: usize = (1 - 1) * envelope_size;
8796
8797            // Zero reserved fields.
8798            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8799
8800            // Safety:
8801            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8802            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8803            //   envelope_size bytes, there is always sufficient room.
8804            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_mem::Buffer, fidl::encoding::DefaultFuchsiaResourceDialect>(
8805            self.minidump.as_mut().map(<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
8806            encoder, offset + cur_offset, depth
8807        )?;
8808
8809            _prev_end_offset = cur_offset + envelope_size;
8810            if 2 > max_ordinal {
8811                return Ok(());
8812            }
8813
8814            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8815            // are envelope_size bytes.
8816            let cur_offset: usize = (2 - 1) * envelope_size;
8817
8818            // Zero reserved fields.
8819            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8820
8821            // Safety:
8822            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8823            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8824            //   envelope_size bytes, there is always sufficient room.
8825            fidl::encoding::encode_in_envelope_optional::<
8826                fidl::encoding::BoundedString<64>,
8827                fidl::encoding::DefaultFuchsiaResourceDialect,
8828            >(
8829                self.process_name.as_ref().map(
8830                    <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow,
8831                ),
8832                encoder,
8833                offset + cur_offset,
8834                depth,
8835            )?;
8836
8837            _prev_end_offset = cur_offset + envelope_size;
8838            if 3 > max_ordinal {
8839                return Ok(());
8840            }
8841
8842            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8843            // are envelope_size bytes.
8844            let cur_offset: usize = (3 - 1) * envelope_size;
8845
8846            // Zero reserved fields.
8847            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8848
8849            // Safety:
8850            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8851            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8852            //   envelope_size bytes, there is always sufficient room.
8853            fidl::encoding::encode_in_envelope_optional::<
8854                u64,
8855                fidl::encoding::DefaultFuchsiaResourceDialect,
8856            >(
8857                self.process_koid.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8858                encoder,
8859                offset + cur_offset,
8860                depth,
8861            )?;
8862
8863            _prev_end_offset = cur_offset + envelope_size;
8864            if 4 > max_ordinal {
8865                return Ok(());
8866            }
8867
8868            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8869            // are envelope_size bytes.
8870            let cur_offset: usize = (4 - 1) * envelope_size;
8871
8872            // Zero reserved fields.
8873            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8874
8875            // Safety:
8876            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8877            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8878            //   envelope_size bytes, there is always sufficient room.
8879            fidl::encoding::encode_in_envelope_optional::<
8880                fidl::encoding::BoundedString<64>,
8881                fidl::encoding::DefaultFuchsiaResourceDialect,
8882            >(
8883                self.thread_name.as_ref().map(
8884                    <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow,
8885                ),
8886                encoder,
8887                offset + cur_offset,
8888                depth,
8889            )?;
8890
8891            _prev_end_offset = cur_offset + envelope_size;
8892            if 5 > max_ordinal {
8893                return Ok(());
8894            }
8895
8896            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8897            // are envelope_size bytes.
8898            let cur_offset: usize = (5 - 1) * envelope_size;
8899
8900            // Zero reserved fields.
8901            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8902
8903            // Safety:
8904            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8905            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8906            //   envelope_size bytes, there is always sufficient room.
8907            fidl::encoding::encode_in_envelope_optional::<
8908                u64,
8909                fidl::encoding::DefaultFuchsiaResourceDialect,
8910            >(
8911                self.thread_koid.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8912                encoder,
8913                offset + cur_offset,
8914                depth,
8915            )?;
8916
8917            _prev_end_offset = cur_offset + envelope_size;
8918
8919            Ok(())
8920        }
8921    }
8922
8923    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8924        for NativeCrashReport
8925    {
8926        #[inline(always)]
8927        fn new_empty() -> Self {
8928            Self::default()
8929        }
8930
8931        unsafe fn decode(
8932            &mut self,
8933            decoder: &mut fidl::encoding::Decoder<
8934                '_,
8935                fidl::encoding::DefaultFuchsiaResourceDialect,
8936            >,
8937            offset: usize,
8938            mut depth: fidl::encoding::Depth,
8939        ) -> fidl::Result<()> {
8940            decoder.debug_check_bounds::<Self>(offset);
8941            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8942                None => return Err(fidl::Error::NotNullable),
8943                Some(len) => len,
8944            };
8945            // Calling decoder.out_of_line_offset(0) is not allowed.
8946            if len == 0 {
8947                return Ok(());
8948            };
8949            depth.increment()?;
8950            let envelope_size = 8;
8951            let bytes_len = len * envelope_size;
8952            let offset = decoder.out_of_line_offset(bytes_len)?;
8953            // Decode the envelope for each type.
8954            let mut _next_ordinal_to_read = 0;
8955            let mut next_offset = offset;
8956            let end_offset = offset + bytes_len;
8957            _next_ordinal_to_read += 1;
8958            if next_offset >= end_offset {
8959                return Ok(());
8960            }
8961
8962            // Decode unknown envelopes for gaps in ordinals.
8963            while _next_ordinal_to_read < 1 {
8964                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8965                _next_ordinal_to_read += 1;
8966                next_offset += envelope_size;
8967            }
8968
8969            let next_out_of_line = decoder.next_out_of_line();
8970            let handles_before = decoder.remaining_handles();
8971            if let Some((inlined, num_bytes, num_handles)) =
8972                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8973            {
8974                let member_inline_size =
8975                    <fidl_fuchsia_mem::Buffer as fidl::encoding::TypeMarker>::inline_size(
8976                        decoder.context,
8977                    );
8978                if inlined != (member_inline_size <= 4) {
8979                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8980                }
8981                let inner_offset;
8982                let mut inner_depth = depth.clone();
8983                if inlined {
8984                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8985                    inner_offset = next_offset;
8986                } else {
8987                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8988                    inner_depth.increment()?;
8989                }
8990                let val_ref = self.minidump.get_or_insert_with(|| {
8991                    fidl::new_empty!(
8992                        fidl_fuchsia_mem::Buffer,
8993                        fidl::encoding::DefaultFuchsiaResourceDialect
8994                    )
8995                });
8996                fidl::decode!(
8997                    fidl_fuchsia_mem::Buffer,
8998                    fidl::encoding::DefaultFuchsiaResourceDialect,
8999                    val_ref,
9000                    decoder,
9001                    inner_offset,
9002                    inner_depth
9003                )?;
9004                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9005                {
9006                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9007                }
9008                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9009                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9010                }
9011            }
9012
9013            next_offset += envelope_size;
9014            _next_ordinal_to_read += 1;
9015            if next_offset >= end_offset {
9016                return Ok(());
9017            }
9018
9019            // Decode unknown envelopes for gaps in ordinals.
9020            while _next_ordinal_to_read < 2 {
9021                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9022                _next_ordinal_to_read += 1;
9023                next_offset += envelope_size;
9024            }
9025
9026            let next_out_of_line = decoder.next_out_of_line();
9027            let handles_before = decoder.remaining_handles();
9028            if let Some((inlined, num_bytes, num_handles)) =
9029                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9030            {
9031                let member_inline_size =
9032                    <fidl::encoding::BoundedString<64> as fidl::encoding::TypeMarker>::inline_size(
9033                        decoder.context,
9034                    );
9035                if inlined != (member_inline_size <= 4) {
9036                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9037                }
9038                let inner_offset;
9039                let mut inner_depth = depth.clone();
9040                if inlined {
9041                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9042                    inner_offset = next_offset;
9043                } else {
9044                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9045                    inner_depth.increment()?;
9046                }
9047                let val_ref = self.process_name.get_or_insert_with(|| {
9048                    fidl::new_empty!(
9049                        fidl::encoding::BoundedString<64>,
9050                        fidl::encoding::DefaultFuchsiaResourceDialect
9051                    )
9052                });
9053                fidl::decode!(
9054                    fidl::encoding::BoundedString<64>,
9055                    fidl::encoding::DefaultFuchsiaResourceDialect,
9056                    val_ref,
9057                    decoder,
9058                    inner_offset,
9059                    inner_depth
9060                )?;
9061                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9062                {
9063                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9064                }
9065                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9066                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9067                }
9068            }
9069
9070            next_offset += envelope_size;
9071            _next_ordinal_to_read += 1;
9072            if next_offset >= end_offset {
9073                return Ok(());
9074            }
9075
9076            // Decode unknown envelopes for gaps in ordinals.
9077            while _next_ordinal_to_read < 3 {
9078                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9079                _next_ordinal_to_read += 1;
9080                next_offset += envelope_size;
9081            }
9082
9083            let next_out_of_line = decoder.next_out_of_line();
9084            let handles_before = decoder.remaining_handles();
9085            if let Some((inlined, num_bytes, num_handles)) =
9086                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9087            {
9088                let member_inline_size =
9089                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9090                if inlined != (member_inline_size <= 4) {
9091                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9092                }
9093                let inner_offset;
9094                let mut inner_depth = depth.clone();
9095                if inlined {
9096                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9097                    inner_offset = next_offset;
9098                } else {
9099                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9100                    inner_depth.increment()?;
9101                }
9102                let val_ref = self.process_koid.get_or_insert_with(|| {
9103                    fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
9104                });
9105                fidl::decode!(
9106                    u64,
9107                    fidl::encoding::DefaultFuchsiaResourceDialect,
9108                    val_ref,
9109                    decoder,
9110                    inner_offset,
9111                    inner_depth
9112                )?;
9113                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9114                {
9115                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9116                }
9117                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9118                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9119                }
9120            }
9121
9122            next_offset += envelope_size;
9123            _next_ordinal_to_read += 1;
9124            if next_offset >= end_offset {
9125                return Ok(());
9126            }
9127
9128            // Decode unknown envelopes for gaps in ordinals.
9129            while _next_ordinal_to_read < 4 {
9130                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9131                _next_ordinal_to_read += 1;
9132                next_offset += envelope_size;
9133            }
9134
9135            let next_out_of_line = decoder.next_out_of_line();
9136            let handles_before = decoder.remaining_handles();
9137            if let Some((inlined, num_bytes, num_handles)) =
9138                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9139            {
9140                let member_inline_size =
9141                    <fidl::encoding::BoundedString<64> as fidl::encoding::TypeMarker>::inline_size(
9142                        decoder.context,
9143                    );
9144                if inlined != (member_inline_size <= 4) {
9145                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9146                }
9147                let inner_offset;
9148                let mut inner_depth = depth.clone();
9149                if inlined {
9150                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9151                    inner_offset = next_offset;
9152                } else {
9153                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9154                    inner_depth.increment()?;
9155                }
9156                let val_ref = self.thread_name.get_or_insert_with(|| {
9157                    fidl::new_empty!(
9158                        fidl::encoding::BoundedString<64>,
9159                        fidl::encoding::DefaultFuchsiaResourceDialect
9160                    )
9161                });
9162                fidl::decode!(
9163                    fidl::encoding::BoundedString<64>,
9164                    fidl::encoding::DefaultFuchsiaResourceDialect,
9165                    val_ref,
9166                    decoder,
9167                    inner_offset,
9168                    inner_depth
9169                )?;
9170                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9171                {
9172                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9173                }
9174                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9175                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9176                }
9177            }
9178
9179            next_offset += envelope_size;
9180            _next_ordinal_to_read += 1;
9181            if next_offset >= end_offset {
9182                return Ok(());
9183            }
9184
9185            // Decode unknown envelopes for gaps in ordinals.
9186            while _next_ordinal_to_read < 5 {
9187                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9188                _next_ordinal_to_read += 1;
9189                next_offset += envelope_size;
9190            }
9191
9192            let next_out_of_line = decoder.next_out_of_line();
9193            let handles_before = decoder.remaining_handles();
9194            if let Some((inlined, num_bytes, num_handles)) =
9195                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9196            {
9197                let member_inline_size =
9198                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9199                if inlined != (member_inline_size <= 4) {
9200                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9201                }
9202                let inner_offset;
9203                let mut inner_depth = depth.clone();
9204                if inlined {
9205                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9206                    inner_offset = next_offset;
9207                } else {
9208                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9209                    inner_depth.increment()?;
9210                }
9211                let val_ref = self.thread_koid.get_or_insert_with(|| {
9212                    fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
9213                });
9214                fidl::decode!(
9215                    u64,
9216                    fidl::encoding::DefaultFuchsiaResourceDialect,
9217                    val_ref,
9218                    decoder,
9219                    inner_offset,
9220                    inner_depth
9221                )?;
9222                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9223                {
9224                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9225                }
9226                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9227                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9228                }
9229            }
9230
9231            next_offset += envelope_size;
9232
9233            // Decode the remaining unknown envelopes.
9234            while next_offset < end_offset {
9235                _next_ordinal_to_read += 1;
9236                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9237                next_offset += envelope_size;
9238            }
9239
9240            Ok(())
9241        }
9242    }
9243
9244    impl RuntimeCrashReport {
9245        #[inline(always)]
9246        fn max_ordinal_present(&self) -> u64 {
9247            if let Some(_) = self.exception_stack_trace {
9248                return 3;
9249            }
9250            if let Some(_) = self.exception_message {
9251                return 2;
9252            }
9253            if let Some(_) = self.exception_type {
9254                return 1;
9255            }
9256            0
9257        }
9258    }
9259
9260    impl fidl::encoding::ResourceTypeMarker for RuntimeCrashReport {
9261        type Borrowed<'a> = &'a mut Self;
9262        fn take_or_borrow<'a>(
9263            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9264        ) -> Self::Borrowed<'a> {
9265            value
9266        }
9267    }
9268
9269    unsafe impl fidl::encoding::TypeMarker for RuntimeCrashReport {
9270        type Owned = Self;
9271
9272        #[inline(always)]
9273        fn inline_align(_context: fidl::encoding::Context) -> usize {
9274            8
9275        }
9276
9277        #[inline(always)]
9278        fn inline_size(_context: fidl::encoding::Context) -> usize {
9279            16
9280        }
9281    }
9282
9283    unsafe impl
9284        fidl::encoding::Encode<RuntimeCrashReport, fidl::encoding::DefaultFuchsiaResourceDialect>
9285        for &mut RuntimeCrashReport
9286    {
9287        unsafe fn encode(
9288            self,
9289            encoder: &mut fidl::encoding::Encoder<
9290                '_,
9291                fidl::encoding::DefaultFuchsiaResourceDialect,
9292            >,
9293            offset: usize,
9294            mut depth: fidl::encoding::Depth,
9295        ) -> fidl::Result<()> {
9296            encoder.debug_check_bounds::<RuntimeCrashReport>(offset);
9297            // Vector header
9298            let max_ordinal: u64 = self.max_ordinal_present();
9299            encoder.write_num(max_ordinal, offset);
9300            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9301            // Calling encoder.out_of_line_offset(0) is not allowed.
9302            if max_ordinal == 0 {
9303                return Ok(());
9304            }
9305            depth.increment()?;
9306            let envelope_size = 8;
9307            let bytes_len = max_ordinal as usize * envelope_size;
9308            #[allow(unused_variables)]
9309            let offset = encoder.out_of_line_offset(bytes_len);
9310            let mut _prev_end_offset: usize = 0;
9311            if 1 > max_ordinal {
9312                return Ok(());
9313            }
9314
9315            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9316            // are envelope_size bytes.
9317            let cur_offset: usize = (1 - 1) * envelope_size;
9318
9319            // Zero reserved fields.
9320            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9321
9322            // Safety:
9323            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9324            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9325            //   envelope_size bytes, there is always sufficient room.
9326            fidl::encoding::encode_in_envelope_optional::<
9327                fidl::encoding::BoundedString<128>,
9328                fidl::encoding::DefaultFuchsiaResourceDialect,
9329            >(
9330                self.exception_type.as_ref().map(
9331                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
9332                ),
9333                encoder,
9334                offset + cur_offset,
9335                depth,
9336            )?;
9337
9338            _prev_end_offset = cur_offset + envelope_size;
9339            if 2 > max_ordinal {
9340                return Ok(());
9341            }
9342
9343            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9344            // are envelope_size bytes.
9345            let cur_offset: usize = (2 - 1) * envelope_size;
9346
9347            // Zero reserved fields.
9348            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9349
9350            // Safety:
9351            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9352            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9353            //   envelope_size bytes, there is always sufficient room.
9354            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, fidl::encoding::DefaultFuchsiaResourceDialect>(
9355            self.exception_message.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
9356            encoder, offset + cur_offset, depth
9357        )?;
9358
9359            _prev_end_offset = cur_offset + envelope_size;
9360            if 3 > max_ordinal {
9361                return Ok(());
9362            }
9363
9364            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9365            // are envelope_size bytes.
9366            let cur_offset: usize = (3 - 1) * envelope_size;
9367
9368            // Zero reserved fields.
9369            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9370
9371            // Safety:
9372            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9373            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9374            //   envelope_size bytes, there is always sufficient room.
9375            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_mem::Buffer, fidl::encoding::DefaultFuchsiaResourceDialect>(
9376            self.exception_stack_trace.as_mut().map(<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9377            encoder, offset + cur_offset, depth
9378        )?;
9379
9380            _prev_end_offset = cur_offset + envelope_size;
9381
9382            Ok(())
9383        }
9384    }
9385
9386    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9387        for RuntimeCrashReport
9388    {
9389        #[inline(always)]
9390        fn new_empty() -> Self {
9391            Self::default()
9392        }
9393
9394        unsafe fn decode(
9395            &mut self,
9396            decoder: &mut fidl::encoding::Decoder<
9397                '_,
9398                fidl::encoding::DefaultFuchsiaResourceDialect,
9399            >,
9400            offset: usize,
9401            mut depth: fidl::encoding::Depth,
9402        ) -> fidl::Result<()> {
9403            decoder.debug_check_bounds::<Self>(offset);
9404            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9405                None => return Err(fidl::Error::NotNullable),
9406                Some(len) => len,
9407            };
9408            // Calling decoder.out_of_line_offset(0) is not allowed.
9409            if len == 0 {
9410                return Ok(());
9411            };
9412            depth.increment()?;
9413            let envelope_size = 8;
9414            let bytes_len = len * envelope_size;
9415            let offset = decoder.out_of_line_offset(bytes_len)?;
9416            // Decode the envelope for each type.
9417            let mut _next_ordinal_to_read = 0;
9418            let mut next_offset = offset;
9419            let end_offset = offset + bytes_len;
9420            _next_ordinal_to_read += 1;
9421            if next_offset >= end_offset {
9422                return Ok(());
9423            }
9424
9425            // Decode unknown envelopes for gaps in ordinals.
9426            while _next_ordinal_to_read < 1 {
9427                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9428                _next_ordinal_to_read += 1;
9429                next_offset += envelope_size;
9430            }
9431
9432            let next_out_of_line = decoder.next_out_of_line();
9433            let handles_before = decoder.remaining_handles();
9434            if let Some((inlined, num_bytes, num_handles)) =
9435                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9436            {
9437                let member_inline_size =
9438                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
9439                        decoder.context,
9440                    );
9441                if inlined != (member_inline_size <= 4) {
9442                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9443                }
9444                let inner_offset;
9445                let mut inner_depth = depth.clone();
9446                if inlined {
9447                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9448                    inner_offset = next_offset;
9449                } else {
9450                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9451                    inner_depth.increment()?;
9452                }
9453                let val_ref = self.exception_type.get_or_insert_with(|| {
9454                    fidl::new_empty!(
9455                        fidl::encoding::BoundedString<128>,
9456                        fidl::encoding::DefaultFuchsiaResourceDialect
9457                    )
9458                });
9459                fidl::decode!(
9460                    fidl::encoding::BoundedString<128>,
9461                    fidl::encoding::DefaultFuchsiaResourceDialect,
9462                    val_ref,
9463                    decoder,
9464                    inner_offset,
9465                    inner_depth
9466                )?;
9467                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9468                {
9469                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9470                }
9471                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9472                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9473                }
9474            }
9475
9476            next_offset += envelope_size;
9477            _next_ordinal_to_read += 1;
9478            if next_offset >= end_offset {
9479                return Ok(());
9480            }
9481
9482            // Decode unknown envelopes for gaps in ordinals.
9483            while _next_ordinal_to_read < 2 {
9484                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9485                _next_ordinal_to_read += 1;
9486                next_offset += envelope_size;
9487            }
9488
9489            let next_out_of_line = decoder.next_out_of_line();
9490            let handles_before = decoder.remaining_handles();
9491            if let Some((inlined, num_bytes, num_handles)) =
9492                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9493            {
9494                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9495                if inlined != (member_inline_size <= 4) {
9496                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9497                }
9498                let inner_offset;
9499                let mut inner_depth = depth.clone();
9500                if inlined {
9501                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9502                    inner_offset = next_offset;
9503                } else {
9504                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9505                    inner_depth.increment()?;
9506                }
9507                let val_ref = self.exception_message.get_or_insert_with(|| {
9508                    fidl::new_empty!(
9509                        fidl::encoding::BoundedString<4096>,
9510                        fidl::encoding::DefaultFuchsiaResourceDialect
9511                    )
9512                });
9513                fidl::decode!(
9514                    fidl::encoding::BoundedString<4096>,
9515                    fidl::encoding::DefaultFuchsiaResourceDialect,
9516                    val_ref,
9517                    decoder,
9518                    inner_offset,
9519                    inner_depth
9520                )?;
9521                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9522                {
9523                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9524                }
9525                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9526                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9527                }
9528            }
9529
9530            next_offset += envelope_size;
9531            _next_ordinal_to_read += 1;
9532            if next_offset >= end_offset {
9533                return Ok(());
9534            }
9535
9536            // Decode unknown envelopes for gaps in ordinals.
9537            while _next_ordinal_to_read < 3 {
9538                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9539                _next_ordinal_to_read += 1;
9540                next_offset += envelope_size;
9541            }
9542
9543            let next_out_of_line = decoder.next_out_of_line();
9544            let handles_before = decoder.remaining_handles();
9545            if let Some((inlined, num_bytes, num_handles)) =
9546                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9547            {
9548                let member_inline_size =
9549                    <fidl_fuchsia_mem::Buffer as fidl::encoding::TypeMarker>::inline_size(
9550                        decoder.context,
9551                    );
9552                if inlined != (member_inline_size <= 4) {
9553                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9554                }
9555                let inner_offset;
9556                let mut inner_depth = depth.clone();
9557                if inlined {
9558                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9559                    inner_offset = next_offset;
9560                } else {
9561                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9562                    inner_depth.increment()?;
9563                }
9564                let val_ref = self.exception_stack_trace.get_or_insert_with(|| {
9565                    fidl::new_empty!(
9566                        fidl_fuchsia_mem::Buffer,
9567                        fidl::encoding::DefaultFuchsiaResourceDialect
9568                    )
9569                });
9570                fidl::decode!(
9571                    fidl_fuchsia_mem::Buffer,
9572                    fidl::encoding::DefaultFuchsiaResourceDialect,
9573                    val_ref,
9574                    decoder,
9575                    inner_offset,
9576                    inner_depth
9577                )?;
9578                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9579                {
9580                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9581                }
9582                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9583                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9584                }
9585            }
9586
9587            next_offset += envelope_size;
9588
9589            // Decode the remaining unknown envelopes.
9590            while next_offset < end_offset {
9591                _next_ordinal_to_read += 1;
9592                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9593                next_offset += envelope_size;
9594            }
9595
9596            Ok(())
9597        }
9598    }
9599
9600    impl Snapshot {
9601        #[inline(always)]
9602        fn max_ordinal_present(&self) -> u64 {
9603            if let Some(_) = self.annotations2 {
9604                return 3;
9605            }
9606            if let Some(_) = self.annotations {
9607                return 2;
9608            }
9609            if let Some(_) = self.archive {
9610                return 1;
9611            }
9612            0
9613        }
9614    }
9615
9616    impl fidl::encoding::ResourceTypeMarker for Snapshot {
9617        type Borrowed<'a> = &'a mut Self;
9618        fn take_or_borrow<'a>(
9619            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9620        ) -> Self::Borrowed<'a> {
9621            value
9622        }
9623    }
9624
9625    unsafe impl fidl::encoding::TypeMarker for Snapshot {
9626        type Owned = Self;
9627
9628        #[inline(always)]
9629        fn inline_align(_context: fidl::encoding::Context) -> usize {
9630            8
9631        }
9632
9633        #[inline(always)]
9634        fn inline_size(_context: fidl::encoding::Context) -> usize {
9635            16
9636        }
9637    }
9638
9639    unsafe impl fidl::encoding::Encode<Snapshot, fidl::encoding::DefaultFuchsiaResourceDialect>
9640        for &mut Snapshot
9641    {
9642        unsafe fn encode(
9643            self,
9644            encoder: &mut fidl::encoding::Encoder<
9645                '_,
9646                fidl::encoding::DefaultFuchsiaResourceDialect,
9647            >,
9648            offset: usize,
9649            mut depth: fidl::encoding::Depth,
9650        ) -> fidl::Result<()> {
9651            encoder.debug_check_bounds::<Snapshot>(offset);
9652            // Vector header
9653            let max_ordinal: u64 = self.max_ordinal_present();
9654            encoder.write_num(max_ordinal, offset);
9655            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9656            // Calling encoder.out_of_line_offset(0) is not allowed.
9657            if max_ordinal == 0 {
9658                return Ok(());
9659            }
9660            depth.increment()?;
9661            let envelope_size = 8;
9662            let bytes_len = max_ordinal as usize * envelope_size;
9663            #[allow(unused_variables)]
9664            let offset = encoder.out_of_line_offset(bytes_len);
9665            let mut _prev_end_offset: usize = 0;
9666            if 1 > max_ordinal {
9667                return Ok(());
9668            }
9669
9670            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9671            // are envelope_size bytes.
9672            let cur_offset: usize = (1 - 1) * envelope_size;
9673
9674            // Zero reserved fields.
9675            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9676
9677            // Safety:
9678            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9679            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9680            //   envelope_size bytes, there is always sufficient room.
9681            fidl::encoding::encode_in_envelope_optional::<
9682                Attachment,
9683                fidl::encoding::DefaultFuchsiaResourceDialect,
9684            >(
9685                self.archive
9686                    .as_mut()
9687                    .map(<Attachment as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9688                encoder,
9689                offset + cur_offset,
9690                depth,
9691            )?;
9692
9693            _prev_end_offset = cur_offset + envelope_size;
9694            if 2 > max_ordinal {
9695                return Ok(());
9696            }
9697
9698            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9699            // are envelope_size bytes.
9700            let cur_offset: usize = (2 - 1) * envelope_size;
9701
9702            // Zero reserved fields.
9703            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9704
9705            // Safety:
9706            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9707            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9708            //   envelope_size bytes, there is always sufficient room.
9709            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
9710            self.annotations.as_ref().map(<fidl::encoding::Vector<Annotation, 64> as fidl::encoding::ValueTypeMarker>::borrow),
9711            encoder, offset + cur_offset, depth
9712        )?;
9713
9714            _prev_end_offset = cur_offset + envelope_size;
9715            if 3 > max_ordinal {
9716                return Ok(());
9717            }
9718
9719            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9720            // are envelope_size bytes.
9721            let cur_offset: usize = (3 - 1) * envelope_size;
9722
9723            // Zero reserved fields.
9724            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9725
9726            // Safety:
9727            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9728            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9729            //   envelope_size bytes, there is always sufficient room.
9730            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 512>, fidl::encoding::DefaultFuchsiaResourceDialect>(
9731            self.annotations2.as_ref().map(<fidl::encoding::Vector<Annotation, 512> as fidl::encoding::ValueTypeMarker>::borrow),
9732            encoder, offset + cur_offset, depth
9733        )?;
9734
9735            _prev_end_offset = cur_offset + envelope_size;
9736
9737            Ok(())
9738        }
9739    }
9740
9741    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Snapshot {
9742        #[inline(always)]
9743        fn new_empty() -> Self {
9744            Self::default()
9745        }
9746
9747        unsafe fn decode(
9748            &mut self,
9749            decoder: &mut fidl::encoding::Decoder<
9750                '_,
9751                fidl::encoding::DefaultFuchsiaResourceDialect,
9752            >,
9753            offset: usize,
9754            mut depth: fidl::encoding::Depth,
9755        ) -> fidl::Result<()> {
9756            decoder.debug_check_bounds::<Self>(offset);
9757            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9758                None => return Err(fidl::Error::NotNullable),
9759                Some(len) => len,
9760            };
9761            // Calling decoder.out_of_line_offset(0) is not allowed.
9762            if len == 0 {
9763                return Ok(());
9764            };
9765            depth.increment()?;
9766            let envelope_size = 8;
9767            let bytes_len = len * envelope_size;
9768            let offset = decoder.out_of_line_offset(bytes_len)?;
9769            // Decode the envelope for each type.
9770            let mut _next_ordinal_to_read = 0;
9771            let mut next_offset = offset;
9772            let end_offset = offset + bytes_len;
9773            _next_ordinal_to_read += 1;
9774            if next_offset >= end_offset {
9775                return Ok(());
9776            }
9777
9778            // Decode unknown envelopes for gaps in ordinals.
9779            while _next_ordinal_to_read < 1 {
9780                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9781                _next_ordinal_to_read += 1;
9782                next_offset += envelope_size;
9783            }
9784
9785            let next_out_of_line = decoder.next_out_of_line();
9786            let handles_before = decoder.remaining_handles();
9787            if let Some((inlined, num_bytes, num_handles)) =
9788                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9789            {
9790                let member_inline_size =
9791                    <Attachment as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9792                if inlined != (member_inline_size <= 4) {
9793                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9794                }
9795                let inner_offset;
9796                let mut inner_depth = depth.clone();
9797                if inlined {
9798                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9799                    inner_offset = next_offset;
9800                } else {
9801                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9802                    inner_depth.increment()?;
9803                }
9804                let val_ref = self.archive.get_or_insert_with(|| {
9805                    fidl::new_empty!(Attachment, fidl::encoding::DefaultFuchsiaResourceDialect)
9806                });
9807                fidl::decode!(
9808                    Attachment,
9809                    fidl::encoding::DefaultFuchsiaResourceDialect,
9810                    val_ref,
9811                    decoder,
9812                    inner_offset,
9813                    inner_depth
9814                )?;
9815                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9816                {
9817                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9818                }
9819                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9820                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9821                }
9822            }
9823
9824            next_offset += envelope_size;
9825            _next_ordinal_to_read += 1;
9826            if next_offset >= end_offset {
9827                return Ok(());
9828            }
9829
9830            // Decode unknown envelopes for gaps in ordinals.
9831            while _next_ordinal_to_read < 2 {
9832                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9833                _next_ordinal_to_read += 1;
9834                next_offset += envelope_size;
9835            }
9836
9837            let next_out_of_line = decoder.next_out_of_line();
9838            let handles_before = decoder.remaining_handles();
9839            if let Some((inlined, num_bytes, num_handles)) =
9840                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9841            {
9842                let member_inline_size = <fidl::encoding::Vector<Annotation, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9843                if inlined != (member_inline_size <= 4) {
9844                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9845                }
9846                let inner_offset;
9847                let mut inner_depth = depth.clone();
9848                if inlined {
9849                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9850                    inner_offset = next_offset;
9851                } else {
9852                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9853                    inner_depth.increment()?;
9854                }
9855                let val_ref =
9856                self.annotations.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<Annotation, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
9857                fidl::decode!(fidl::encoding::Vector<Annotation, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
9858                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9859                {
9860                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9861                }
9862                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9863                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9864                }
9865            }
9866
9867            next_offset += envelope_size;
9868            _next_ordinal_to_read += 1;
9869            if next_offset >= end_offset {
9870                return Ok(());
9871            }
9872
9873            // Decode unknown envelopes for gaps in ordinals.
9874            while _next_ordinal_to_read < 3 {
9875                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9876                _next_ordinal_to_read += 1;
9877                next_offset += envelope_size;
9878            }
9879
9880            let next_out_of_line = decoder.next_out_of_line();
9881            let handles_before = decoder.remaining_handles();
9882            if let Some((inlined, num_bytes, num_handles)) =
9883                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9884            {
9885                let member_inline_size = <fidl::encoding::Vector<Annotation, 512> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9886                if inlined != (member_inline_size <= 4) {
9887                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9888                }
9889                let inner_offset;
9890                let mut inner_depth = depth.clone();
9891                if inlined {
9892                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9893                    inner_offset = next_offset;
9894                } else {
9895                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9896                    inner_depth.increment()?;
9897                }
9898                let val_ref =
9899                self.annotations2.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<Annotation, 512>, fidl::encoding::DefaultFuchsiaResourceDialect));
9900                fidl::decode!(fidl::encoding::Vector<Annotation, 512>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
9901                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9902                {
9903                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9904                }
9905                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9906                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9907                }
9908            }
9909
9910            next_offset += envelope_size;
9911
9912            // Decode the remaining unknown envelopes.
9913            while next_offset < end_offset {
9914                _next_ordinal_to_read += 1;
9915                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9916                next_offset += envelope_size;
9917            }
9918
9919            Ok(())
9920        }
9921    }
9922
9923    impl fidl::encoding::ResourceTypeMarker for SpecificCrashReport {
9924        type Borrowed<'a> = &'a mut Self;
9925        fn take_or_borrow<'a>(
9926            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9927        ) -> Self::Borrowed<'a> {
9928            value
9929        }
9930    }
9931
9932    unsafe impl fidl::encoding::TypeMarker for SpecificCrashReport {
9933        type Owned = Self;
9934
9935        #[inline(always)]
9936        fn inline_align(_context: fidl::encoding::Context) -> usize {
9937            8
9938        }
9939
9940        #[inline(always)]
9941        fn inline_size(_context: fidl::encoding::Context) -> usize {
9942            16
9943        }
9944    }
9945
9946    unsafe impl
9947        fidl::encoding::Encode<SpecificCrashReport, fidl::encoding::DefaultFuchsiaResourceDialect>
9948        for &mut SpecificCrashReport
9949    {
9950        #[inline]
9951        unsafe fn encode(
9952            self,
9953            encoder: &mut fidl::encoding::Encoder<
9954                '_,
9955                fidl::encoding::DefaultFuchsiaResourceDialect,
9956            >,
9957            offset: usize,
9958            _depth: fidl::encoding::Depth,
9959        ) -> fidl::Result<()> {
9960            encoder.debug_check_bounds::<SpecificCrashReport>(offset);
9961            encoder.write_num::<u64>(self.ordinal(), offset);
9962            match self {
9963                SpecificCrashReport::Native(ref mut val) => fidl::encoding::encode_in_envelope::<
9964                    NativeCrashReport,
9965                    fidl::encoding::DefaultFuchsiaResourceDialect,
9966                >(
9967                    <NativeCrashReport as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
9968                    encoder,
9969                    offset + 8,
9970                    _depth,
9971                ),
9972                SpecificCrashReport::Dart(ref mut val) => fidl::encoding::encode_in_envelope::<
9973                    RuntimeCrashReport,
9974                    fidl::encoding::DefaultFuchsiaResourceDialect,
9975                >(
9976                    <RuntimeCrashReport as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
9977                    encoder,
9978                    offset + 8,
9979                    _depth,
9980                ),
9981                SpecificCrashReport::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
9982            }
9983        }
9984    }
9985
9986    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9987        for SpecificCrashReport
9988    {
9989        #[inline(always)]
9990        fn new_empty() -> Self {
9991            Self::__SourceBreaking { unknown_ordinal: 0 }
9992        }
9993
9994        #[inline]
9995        unsafe fn decode(
9996            &mut self,
9997            decoder: &mut fidl::encoding::Decoder<
9998                '_,
9999                fidl::encoding::DefaultFuchsiaResourceDialect,
10000            >,
10001            offset: usize,
10002            mut depth: fidl::encoding::Depth,
10003        ) -> fidl::Result<()> {
10004            decoder.debug_check_bounds::<Self>(offset);
10005            #[allow(unused_variables)]
10006            let next_out_of_line = decoder.next_out_of_line();
10007            let handles_before = decoder.remaining_handles();
10008            let (ordinal, inlined, num_bytes, num_handles) =
10009                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
10010
10011            let member_inline_size = match ordinal {
10012                2 => {
10013                    <NativeCrashReport as fidl::encoding::TypeMarker>::inline_size(decoder.context)
10014                }
10015                3 => {
10016                    <RuntimeCrashReport as fidl::encoding::TypeMarker>::inline_size(decoder.context)
10017                }
10018                0 => return Err(fidl::Error::UnknownUnionTag),
10019                _ => num_bytes as usize,
10020            };
10021
10022            if inlined != (member_inline_size <= 4) {
10023                return Err(fidl::Error::InvalidInlineBitInEnvelope);
10024            }
10025            let _inner_offset;
10026            if inlined {
10027                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
10028                _inner_offset = offset + 8;
10029            } else {
10030                depth.increment()?;
10031                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10032            }
10033            match ordinal {
10034                2 => {
10035                    #[allow(irrefutable_let_patterns)]
10036                    if let SpecificCrashReport::Native(_) = self {
10037                        // Do nothing, read the value into the object
10038                    } else {
10039                        // Initialize `self` to the right variant
10040                        *self = SpecificCrashReport::Native(fidl::new_empty!(
10041                            NativeCrashReport,
10042                            fidl::encoding::DefaultFuchsiaResourceDialect
10043                        ));
10044                    }
10045                    #[allow(irrefutable_let_patterns)]
10046                    if let SpecificCrashReport::Native(ref mut val) = self {
10047                        fidl::decode!(
10048                            NativeCrashReport,
10049                            fidl::encoding::DefaultFuchsiaResourceDialect,
10050                            val,
10051                            decoder,
10052                            _inner_offset,
10053                            depth
10054                        )?;
10055                    } else {
10056                        unreachable!()
10057                    }
10058                }
10059                3 => {
10060                    #[allow(irrefutable_let_patterns)]
10061                    if let SpecificCrashReport::Dart(_) = self {
10062                        // Do nothing, read the value into the object
10063                    } else {
10064                        // Initialize `self` to the right variant
10065                        *self = SpecificCrashReport::Dart(fidl::new_empty!(
10066                            RuntimeCrashReport,
10067                            fidl::encoding::DefaultFuchsiaResourceDialect
10068                        ));
10069                    }
10070                    #[allow(irrefutable_let_patterns)]
10071                    if let SpecificCrashReport::Dart(ref mut val) = self {
10072                        fidl::decode!(
10073                            RuntimeCrashReport,
10074                            fidl::encoding::DefaultFuchsiaResourceDialect,
10075                            val,
10076                            decoder,
10077                            _inner_offset,
10078                            depth
10079                        )?;
10080                    } else {
10081                        unreachable!()
10082                    }
10083                }
10084                #[allow(deprecated)]
10085                ordinal => {
10086                    for _ in 0..num_handles {
10087                        decoder.drop_next_handle()?;
10088                    }
10089                    *self = SpecificCrashReport::__SourceBreaking { unknown_ordinal: ordinal };
10090                }
10091            }
10092            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
10093                return Err(fidl::Error::InvalidNumBytesInEnvelope);
10094            }
10095            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10096                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10097            }
10098            Ok(())
10099        }
10100    }
10101}