Skip to main content

fidl_fuchsia_debugger_common/
fidl_fuchsia_debugger_common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
12pub enum FilterError {
13    /// Indicates that there was no pattern given in the filter.
14    NoPattern,
15    /// FilterType was either unspecified or an otherwise unknown type to this agent.
16    UnknownType,
17    /// The set of options given in FilterOptions was not valid.
18    InvalidOptions,
19    #[doc(hidden)]
20    __SourceBreaking { unknown_ordinal: u32 },
21}
22
23/// Pattern that matches an unknown `FilterError` member.
24#[macro_export]
25macro_rules! FilterErrorUnknown {
26    () => {
27        _
28    };
29}
30
31impl FilterError {
32    #[inline]
33    pub fn from_primitive(prim: u32) -> Option<Self> {
34        match prim {
35            1 => Some(Self::NoPattern),
36            2 => Some(Self::UnknownType),
37            3 => Some(Self::InvalidOptions),
38            _ => None,
39        }
40    }
41
42    #[inline]
43    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
44        match prim {
45            1 => Self::NoPattern,
46            2 => Self::UnknownType,
47            3 => Self::InvalidOptions,
48            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
49        }
50    }
51
52    #[inline]
53    pub fn unknown() -> Self {
54        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
55    }
56
57    #[inline]
58    pub const fn into_primitive(self) -> u32 {
59        match self {
60            Self::NoPattern => 1,
61            Self::UnknownType => 2,
62            Self::InvalidOptions => 3,
63            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
64        }
65    }
66
67    #[inline]
68    pub fn is_unknown(&self) -> bool {
69        match self {
70            Self::__SourceBreaking { unknown_ordinal: _ } => true,
71            _ => false,
72        }
73    }
74}
75
76#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
77pub enum FilterType {
78    /// Performs an exact match against a component's URL, sans hash values.
79    /// e.g. pattern fuchsia-pkg://fuchsia.com/package#meta/component.cm will
80    /// match fuchsia-pkg://fuchsia.com/package?hash=1234abcd#meta/component.cm.
81    Url,
82    /// Performs an exact match against a component's full moniker.
83    Moniker,
84    /// Matches any component moniker that includes the pattern as a prefix.
85    MonikerPrefix,
86    /// Matches any component moniker that includes the pattern as a suffix.
87    MonikerSuffix,
88    #[doc(hidden)]
89    __SourceBreaking { unknown_ordinal: u8 },
90}
91
92/// Pattern that matches an unknown `FilterType` member.
93#[macro_export]
94macro_rules! FilterTypeUnknown {
95    () => {
96        _
97    };
98}
99
100impl FilterType {
101    #[inline]
102    pub fn from_primitive(prim: u8) -> Option<Self> {
103        match prim {
104            0 => Some(Self::Url),
105            1 => Some(Self::Moniker),
106            2 => Some(Self::MonikerPrefix),
107            3 => Some(Self::MonikerSuffix),
108            _ => None,
109        }
110    }
111
112    #[inline]
113    pub fn from_primitive_allow_unknown(prim: u8) -> Self {
114        match prim {
115            0 => Self::Url,
116            1 => Self::Moniker,
117            2 => Self::MonikerPrefix,
118            3 => Self::MonikerSuffix,
119            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
120        }
121    }
122
123    #[inline]
124    pub fn unknown() -> Self {
125        Self::__SourceBreaking { unknown_ordinal: 0xff }
126    }
127
128    #[inline]
129    pub const fn into_primitive(self) -> u8 {
130        match self {
131            Self::Url => 0,
132            Self::Moniker => 1,
133            Self::MonikerPrefix => 2,
134            Self::MonikerSuffix => 3,
135            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
136        }
137    }
138
139    #[inline]
140    pub fn is_unknown(&self) -> bool {
141        match self {
142            Self::__SourceBreaking { unknown_ordinal: _ } => true,
143            _ => false,
144        }
145    }
146}
147
148#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
149pub enum MinidumpError {
150    /// No processes were yielded to the iterator. This could mean that the
151    /// supplied filter did not match any attached processes, or DebugAgent is
152    /// not attached to any processes.
153    NoProcesses,
154    /// An error occurred while generating the minidump. These errors are opaque
155    /// to DebugAgent.
156    InternalError,
157    #[doc(hidden)]
158    __SourceBreaking { unknown_ordinal: u32 },
159}
160
161/// Pattern that matches an unknown `MinidumpError` member.
162#[macro_export]
163macro_rules! MinidumpErrorUnknown {
164    () => {
165        _
166    };
167}
168
169impl MinidumpError {
170    #[inline]
171    pub fn from_primitive(prim: u32) -> Option<Self> {
172        match prim {
173            1 => Some(Self::NoProcesses),
174            2 => Some(Self::InternalError),
175            _ => None,
176        }
177    }
178
179    #[inline]
180    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
181        match prim {
182            1 => Self::NoProcesses,
183            2 => Self::InternalError,
184            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
185        }
186    }
187
188    #[inline]
189    pub fn unknown() -> Self {
190        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
191    }
192
193    #[inline]
194    pub const fn into_primitive(self) -> u32 {
195        match self {
196            Self::NoProcesses => 1,
197            Self::InternalError => 2,
198            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
199        }
200    }
201
202    #[inline]
203    pub fn is_unknown(&self) -> bool {
204        match self {
205            Self::__SourceBreaking { unknown_ordinal: _ } => true,
206            _ => false,
207        }
208    }
209}
210
211#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
212pub enum ProcessInfoError {
213    /// There were no attached processes to iterate over.
214    NoProcesses,
215    /// A process has died such that the iterator is invalid.
216    ProcessGone,
217    /// A process's threads have been mutated such that the iterator is invalid.
218    ThreadGone,
219    #[doc(hidden)]
220    __SourceBreaking { unknown_ordinal: u32 },
221}
222
223/// Pattern that matches an unknown `ProcessInfoError` member.
224#[macro_export]
225macro_rules! ProcessInfoErrorUnknown {
226    () => {
227        _
228    };
229}
230
231impl ProcessInfoError {
232    #[inline]
233    pub fn from_primitive(prim: u32) -> Option<Self> {
234        match prim {
235            1 => Some(Self::NoProcesses),
236            2 => Some(Self::ProcessGone),
237            3 => Some(Self::ThreadGone),
238            _ => None,
239        }
240    }
241
242    #[inline]
243    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
244        match prim {
245            1 => Self::NoProcesses,
246            2 => Self::ProcessGone,
247            3 => Self::ThreadGone,
248            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
249        }
250    }
251
252    #[inline]
253    pub fn unknown() -> Self {
254        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
255    }
256
257    #[inline]
258    pub const fn into_primitive(self) -> u32 {
259        match self {
260            Self::NoProcesses => 1,
261            Self::ProcessGone => 2,
262            Self::ThreadGone => 3,
263            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
264        }
265    }
266
267    #[inline]
268    pub fn is_unknown(&self) -> bool {
269        match self {
270            Self::__SourceBreaking { unknown_ordinal: _ } => true,
271            _ => false,
272        }
273    }
274}
275
276#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
277pub struct AttachedProcessIteratorGetNextResponse {
278    pub process_names: Vec<String>,
279}
280
281impl fidl::Persistable for AttachedProcessIteratorGetNextResponse {}
282
283#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
284#[repr(C)]
285pub struct DebugAgentAttachToResponse {
286    pub num_matches: u32,
287}
288
289impl fidl::Persistable for DebugAgentAttachToResponse {}
290
291/// A filter that will apply to processes and components running now and in the
292/// future. Any component or process that matches the given pattern and type
293/// will be attached, thereafter allowing clients to query information about the
294/// program(s). A valid filter will always contain a non-empty pattern string,
295/// and a FilterType to discern what to compare the pattern against. Additional
296/// options may be specified via FilterOptions.
297#[derive(Clone, Debug, PartialEq)]
298pub struct Filter {
299    /// A string pattern to be matched against the given |type|. An empty
300    /// pattern will result in a NO_PATTERN error.
301    pub pattern: String,
302    /// How to interpret |pattern|. See FilterType.
303    pub type_: FilterType,
304    /// Additional options for this filter. See FilterOptions.
305    pub options: FilterOptions,
306}
307
308impl fidl::Persistable for Filter {}
309
310#[derive(Clone, Debug, PartialEq)]
311pub struct ProcessInfo {
312    pub process: u64,
313    pub moniker: String,
314    /// The koid of the thread that produced the information in |details|.
315    pub thread: u64,
316    /// Details about the thread with |koid|, as specified in the
317    /// ThreadDetailsInterest given to |GetProcessInfo|.
318    pub details: ThreadDetails,
319}
320
321impl fidl::Persistable for ProcessInfo {}
322
323#[derive(Clone, Debug, PartialEq)]
324pub struct ProcessInfoIteratorGetNextResponse {
325    pub info: Vec<ProcessInfo>,
326}
327
328impl fidl::Persistable for ProcessInfoIteratorGetNextResponse {}
329
330#[derive(Clone, Debug, Default, PartialEq)]
331pub struct DebugAgentOnFatalExceptionRequest {
332    /// The faulting thread's koid.
333    pub thread: Option<u64>,
334    /// A stack trace from the faulting thread in symbolizer markup format.
335    pub backtrace: Option<String>,
336    #[doc(hidden)]
337    pub __source_breaking: fidl::marker::SourceBreaking,
338}
339
340impl fidl::Persistable for DebugAgentOnFatalExceptionRequest {}
341
342#[derive(Clone, Debug, Default, PartialEq)]
343pub struct FilterOptions {
344    /// Whether or not to also match all child components in the matching
345    /// component's realm. When true, the matching component's full moniker will
346    /// be assumed to be the root of the realm, and all processes in all
347    /// children components launched in this realm will be attached to.
348    pub recursive: Option<bool>,
349    /// Whether or not to attach directly to the parent job of the process
350    /// matching the filter. When true, the parent job's standard exception
351    /// channel will be bound, rather than the exception channel of the process.
352    /// See https://fuchsia.dev/fuchsia-src/concepts/kernel/exceptions#exception_channel_types
353    /// for more details. Note that this is *not* the same as the "Debugger"
354    /// exception channel, which only delivers process starting "exceptions" but
355    /// not architectural exceptions.
356    pub job_only: Option<bool>,
357    #[doc(hidden)]
358    pub __source_breaking: fidl::marker::SourceBreaking,
359}
360
361impl fidl::Persistable for FilterOptions {}
362
363#[derive(Clone, Debug, Default, PartialEq)]
364pub struct GetProcessInfoOptions {
365    /// A filter that will reduce the number of processes that are iterated
366    /// over. This will not install any new filters and will not cause new
367    /// processes to be attached. Instead, this filter will be applied to
368    /// already attached processes, which can be useful if there are many
369    /// processes currently attached.
370    pub filter: Option<Filter>,
371    /// Clients should specify the data they are interested in being yielded
372    /// from the iterator here. Any unspecified fields will be assumed to be
373    /// false. See ThreadDetailsInterest for descriptions of possible data.
374    pub interest: Option<ThreadDetailsInterest>,
375    #[doc(hidden)]
376    pub __source_breaking: fidl::marker::SourceBreaking,
377}
378
379impl fidl::Persistable for GetProcessInfoOptions {}
380
381#[derive(Clone, Debug, Default, PartialEq)]
382pub struct LaunchOptions {
383    pub monitor_root_job: Option<bool>,
384    #[doc(hidden)]
385    pub __source_breaking: fidl::marker::SourceBreaking,
386}
387
388impl fidl::Persistable for LaunchOptions {}
389
390#[derive(Clone, Debug, Default, PartialEq)]
391pub struct MinidumpOptions {
392    /// This will not install any new filters and will not cause new processes
393    /// to be attached. Rather, this filter will be applied to already attached
394    /// processes.
395    pub filter: Option<Filter>,
396    #[doc(hidden)]
397    pub __source_breaking: fidl::marker::SourceBreaking,
398}
399
400impl fidl::Persistable for MinidumpOptions {}
401
402/// Details about a particular thread. The fields will be included as per the
403/// ThreadDetailsInterest supplied when creating the ProcessInfoIterator via
404/// |GetProcessInfo|.
405#[derive(Clone, Debug, Default, PartialEq)]
406pub struct ThreadDetails {
407    /// A stack trace from the current thread in symbolizer markup format.
408    pub backtrace: Option<String>,
409    #[doc(hidden)]
410    pub __source_breaking: fidl::marker::SourceBreaking,
411}
412
413impl fidl::Persistable for ThreadDetails {}
414
415#[derive(Clone, Debug, Default, PartialEq)]
416pub struct ThreadDetailsInterest {
417    /// Produce a backtrace in symbolizer markup format for each thread.
418    /// If this is unspecified, no backtrace will be included in the
419    /// ThreadDetails yielded by ProcessInfoIterator.
420    pub backtrace: Option<bool>,
421    #[doc(hidden)]
422    pub __source_breaking: fidl::marker::SourceBreaking,
423}
424
425impl fidl::Persistable for ThreadDetailsInterest {}
426
427pub mod agent_iterator_ordinals {
428    pub const GET_NEXT: u64 = 0x40f8adb0c975fa41;
429}
430
431pub mod attached_process_iterator_ordinals {
432    pub const GET_NEXT: u64 = 0x47ef49b75f6133ab;
433}
434
435pub mod debug_agent_ordinals {
436    pub const CONNECT: u64 = 0x6f81c1e426ddf3f9;
437    pub const GET_ATTACHED_PROCESSES: u64 = 0x4a07b086a7deda56;
438    pub const ATTACH_TO: u64 = 0x2800c757fe52795f;
439    pub const GET_PROCESS_INFO: u64 = 0x4daf0a7366bb6d77;
440    pub const GET_MINIDUMPS: u64 = 0x4a4693aeecdb7deb;
441    pub const ON_FATAL_EXCEPTION: u64 = 0x254b534a4790d114;
442}
443
444pub mod launcher_ordinals {
445    pub const LAUNCH: u64 = 0x54420f44e79e5c0e;
446    pub const GET_AGENTS: u64 = 0x4e6a35bfa35ee8f4;
447}
448
449pub mod minidump_iterator_ordinals {
450    pub const GET_NEXT: u64 = 0x3db055b61b8482dc;
451}
452
453pub mod process_info_iterator_ordinals {
454    pub const GET_NEXT: u64 = 0x527e289fe635bcc;
455}
456
457mod internal {
458    use super::*;
459    unsafe impl fidl::encoding::TypeMarker for FilterError {
460        type Owned = Self;
461
462        #[inline(always)]
463        fn inline_align(_context: fidl::encoding::Context) -> usize {
464            std::mem::align_of::<u32>()
465        }
466
467        #[inline(always)]
468        fn inline_size(_context: fidl::encoding::Context) -> usize {
469            std::mem::size_of::<u32>()
470        }
471
472        #[inline(always)]
473        fn encode_is_copy() -> bool {
474            false
475        }
476
477        #[inline(always)]
478        fn decode_is_copy() -> bool {
479            false
480        }
481    }
482
483    impl fidl::encoding::ValueTypeMarker for FilterError {
484        type Borrowed<'a> = Self;
485        #[inline(always)]
486        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
487            *value
488        }
489    }
490
491    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilterError {
492        #[inline]
493        unsafe fn encode(
494            self,
495            encoder: &mut fidl::encoding::Encoder<'_, D>,
496            offset: usize,
497            _depth: fidl::encoding::Depth,
498        ) -> fidl::Result<()> {
499            encoder.debug_check_bounds::<Self>(offset);
500            encoder.write_num(self.into_primitive(), offset);
501            Ok(())
502        }
503    }
504
505    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilterError {
506        #[inline(always)]
507        fn new_empty() -> Self {
508            Self::unknown()
509        }
510
511        #[inline]
512        unsafe fn decode(
513            &mut self,
514            decoder: &mut fidl::encoding::Decoder<'_, D>,
515            offset: usize,
516            _depth: fidl::encoding::Depth,
517        ) -> fidl::Result<()> {
518            decoder.debug_check_bounds::<Self>(offset);
519            let prim = decoder.read_num::<u32>(offset);
520
521            *self = Self::from_primitive_allow_unknown(prim);
522            Ok(())
523        }
524    }
525    unsafe impl fidl::encoding::TypeMarker for FilterType {
526        type Owned = Self;
527
528        #[inline(always)]
529        fn inline_align(_context: fidl::encoding::Context) -> usize {
530            std::mem::align_of::<u8>()
531        }
532
533        #[inline(always)]
534        fn inline_size(_context: fidl::encoding::Context) -> usize {
535            std::mem::size_of::<u8>()
536        }
537
538        #[inline(always)]
539        fn encode_is_copy() -> bool {
540            false
541        }
542
543        #[inline(always)]
544        fn decode_is_copy() -> bool {
545            false
546        }
547    }
548
549    impl fidl::encoding::ValueTypeMarker for FilterType {
550        type Borrowed<'a> = Self;
551        #[inline(always)]
552        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
553            *value
554        }
555    }
556
557    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilterType {
558        #[inline]
559        unsafe fn encode(
560            self,
561            encoder: &mut fidl::encoding::Encoder<'_, D>,
562            offset: usize,
563            _depth: fidl::encoding::Depth,
564        ) -> fidl::Result<()> {
565            encoder.debug_check_bounds::<Self>(offset);
566            encoder.write_num(self.into_primitive(), offset);
567            Ok(())
568        }
569    }
570
571    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilterType {
572        #[inline(always)]
573        fn new_empty() -> Self {
574            Self::unknown()
575        }
576
577        #[inline]
578        unsafe fn decode(
579            &mut self,
580            decoder: &mut fidl::encoding::Decoder<'_, D>,
581            offset: usize,
582            _depth: fidl::encoding::Depth,
583        ) -> fidl::Result<()> {
584            decoder.debug_check_bounds::<Self>(offset);
585            let prim = decoder.read_num::<u8>(offset);
586
587            *self = Self::from_primitive_allow_unknown(prim);
588            Ok(())
589        }
590    }
591    unsafe impl fidl::encoding::TypeMarker for MinidumpError {
592        type Owned = Self;
593
594        #[inline(always)]
595        fn inline_align(_context: fidl::encoding::Context) -> usize {
596            std::mem::align_of::<u32>()
597        }
598
599        #[inline(always)]
600        fn inline_size(_context: fidl::encoding::Context) -> usize {
601            std::mem::size_of::<u32>()
602        }
603
604        #[inline(always)]
605        fn encode_is_copy() -> bool {
606            false
607        }
608
609        #[inline(always)]
610        fn decode_is_copy() -> bool {
611            false
612        }
613    }
614
615    impl fidl::encoding::ValueTypeMarker for MinidumpError {
616        type Borrowed<'a> = Self;
617        #[inline(always)]
618        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
619            *value
620        }
621    }
622
623    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for MinidumpError {
624        #[inline]
625        unsafe fn encode(
626            self,
627            encoder: &mut fidl::encoding::Encoder<'_, D>,
628            offset: usize,
629            _depth: fidl::encoding::Depth,
630        ) -> fidl::Result<()> {
631            encoder.debug_check_bounds::<Self>(offset);
632            encoder.write_num(self.into_primitive(), offset);
633            Ok(())
634        }
635    }
636
637    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MinidumpError {
638        #[inline(always)]
639        fn new_empty() -> Self {
640            Self::unknown()
641        }
642
643        #[inline]
644        unsafe fn decode(
645            &mut self,
646            decoder: &mut fidl::encoding::Decoder<'_, D>,
647            offset: usize,
648            _depth: fidl::encoding::Depth,
649        ) -> fidl::Result<()> {
650            decoder.debug_check_bounds::<Self>(offset);
651            let prim = decoder.read_num::<u32>(offset);
652
653            *self = Self::from_primitive_allow_unknown(prim);
654            Ok(())
655        }
656    }
657    unsafe impl fidl::encoding::TypeMarker for ProcessInfoError {
658        type Owned = Self;
659
660        #[inline(always)]
661        fn inline_align(_context: fidl::encoding::Context) -> usize {
662            std::mem::align_of::<u32>()
663        }
664
665        #[inline(always)]
666        fn inline_size(_context: fidl::encoding::Context) -> usize {
667            std::mem::size_of::<u32>()
668        }
669
670        #[inline(always)]
671        fn encode_is_copy() -> bool {
672            false
673        }
674
675        #[inline(always)]
676        fn decode_is_copy() -> bool {
677            false
678        }
679    }
680
681    impl fidl::encoding::ValueTypeMarker for ProcessInfoError {
682        type Borrowed<'a> = Self;
683        #[inline(always)]
684        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
685            *value
686        }
687    }
688
689    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
690        for ProcessInfoError
691    {
692        #[inline]
693        unsafe fn encode(
694            self,
695            encoder: &mut fidl::encoding::Encoder<'_, D>,
696            offset: usize,
697            _depth: fidl::encoding::Depth,
698        ) -> fidl::Result<()> {
699            encoder.debug_check_bounds::<Self>(offset);
700            encoder.write_num(self.into_primitive(), offset);
701            Ok(())
702        }
703    }
704
705    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProcessInfoError {
706        #[inline(always)]
707        fn new_empty() -> Self {
708            Self::unknown()
709        }
710
711        #[inline]
712        unsafe fn decode(
713            &mut self,
714            decoder: &mut fidl::encoding::Decoder<'_, D>,
715            offset: usize,
716            _depth: fidl::encoding::Depth,
717        ) -> fidl::Result<()> {
718            decoder.debug_check_bounds::<Self>(offset);
719            let prim = decoder.read_num::<u32>(offset);
720
721            *self = Self::from_primitive_allow_unknown(prim);
722            Ok(())
723        }
724    }
725
726    impl fidl::encoding::ValueTypeMarker for AttachedProcessIteratorGetNextResponse {
727        type Borrowed<'a> = &'a Self;
728        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
729            value
730        }
731    }
732
733    unsafe impl fidl::encoding::TypeMarker for AttachedProcessIteratorGetNextResponse {
734        type Owned = Self;
735
736        #[inline(always)]
737        fn inline_align(_context: fidl::encoding::Context) -> usize {
738            8
739        }
740
741        #[inline(always)]
742        fn inline_size(_context: fidl::encoding::Context) -> usize {
743            16
744        }
745    }
746
747    unsafe impl<D: fidl::encoding::ResourceDialect>
748        fidl::encoding::Encode<AttachedProcessIteratorGetNextResponse, D>
749        for &AttachedProcessIteratorGetNextResponse
750    {
751        #[inline]
752        unsafe fn encode(
753            self,
754            encoder: &mut fidl::encoding::Encoder<'_, D>,
755            offset: usize,
756            _depth: fidl::encoding::Depth,
757        ) -> fidl::Result<()> {
758            encoder.debug_check_bounds::<AttachedProcessIteratorGetNextResponse>(offset);
759            // Delegate to tuple encoding.
760            fidl::encoding::Encode::<AttachedProcessIteratorGetNextResponse, D>::encode(
761                (
762                    <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>> as fidl::encoding::ValueTypeMarker>::borrow(&self.process_names),
763                ),
764                encoder, offset, _depth
765            )
766        }
767    }
768    unsafe impl<
769        D: fidl::encoding::ResourceDialect,
770        T0: fidl::encoding::Encode<
771                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>>,
772                D,
773            >,
774    > fidl::encoding::Encode<AttachedProcessIteratorGetNextResponse, D> for (T0,)
775    {
776        #[inline]
777        unsafe fn encode(
778            self,
779            encoder: &mut fidl::encoding::Encoder<'_, D>,
780            offset: usize,
781            depth: fidl::encoding::Depth,
782        ) -> fidl::Result<()> {
783            encoder.debug_check_bounds::<AttachedProcessIteratorGetNextResponse>(offset);
784            // Zero out padding regions. There's no need to apply masks
785            // because the unmasked parts will be overwritten by fields.
786            // Write the fields.
787            self.0.encode(encoder, offset + 0, depth)?;
788            Ok(())
789        }
790    }
791
792    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
793        for AttachedProcessIteratorGetNextResponse
794    {
795        #[inline(always)]
796        fn new_empty() -> Self {
797            Self {
798                process_names: fidl::new_empty!(
799                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>>,
800                    D
801                ),
802            }
803        }
804
805        #[inline]
806        unsafe fn decode(
807            &mut self,
808            decoder: &mut fidl::encoding::Decoder<'_, D>,
809            offset: usize,
810            _depth: fidl::encoding::Depth,
811        ) -> fidl::Result<()> {
812            decoder.debug_check_bounds::<Self>(offset);
813            // Verify that padding bytes are zero.
814            fidl::decode!(
815                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>>,
816                D,
817                &mut self.process_names,
818                decoder,
819                offset + 0,
820                _depth
821            )?;
822            Ok(())
823        }
824    }
825
826    impl fidl::encoding::ValueTypeMarker for DebugAgentAttachToResponse {
827        type Borrowed<'a> = &'a Self;
828        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
829            value
830        }
831    }
832
833    unsafe impl fidl::encoding::TypeMarker for DebugAgentAttachToResponse {
834        type Owned = Self;
835
836        #[inline(always)]
837        fn inline_align(_context: fidl::encoding::Context) -> usize {
838            4
839        }
840
841        #[inline(always)]
842        fn inline_size(_context: fidl::encoding::Context) -> usize {
843            4
844        }
845        #[inline(always)]
846        fn encode_is_copy() -> bool {
847            true
848        }
849
850        #[inline(always)]
851        fn decode_is_copy() -> bool {
852            true
853        }
854    }
855
856    unsafe impl<D: fidl::encoding::ResourceDialect>
857        fidl::encoding::Encode<DebugAgentAttachToResponse, D> for &DebugAgentAttachToResponse
858    {
859        #[inline]
860        unsafe fn encode(
861            self,
862            encoder: &mut fidl::encoding::Encoder<'_, D>,
863            offset: usize,
864            _depth: fidl::encoding::Depth,
865        ) -> fidl::Result<()> {
866            encoder.debug_check_bounds::<DebugAgentAttachToResponse>(offset);
867            unsafe {
868                // Copy the object into the buffer.
869                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
870                (buf_ptr as *mut DebugAgentAttachToResponse)
871                    .write_unaligned((self as *const DebugAgentAttachToResponse).read());
872                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
873                // done second because the memcpy will write garbage to these bytes.
874            }
875            Ok(())
876        }
877    }
878    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
879        fidl::encoding::Encode<DebugAgentAttachToResponse, D> for (T0,)
880    {
881        #[inline]
882        unsafe fn encode(
883            self,
884            encoder: &mut fidl::encoding::Encoder<'_, D>,
885            offset: usize,
886            depth: fidl::encoding::Depth,
887        ) -> fidl::Result<()> {
888            encoder.debug_check_bounds::<DebugAgentAttachToResponse>(offset);
889            // Zero out padding regions. There's no need to apply masks
890            // because the unmasked parts will be overwritten by fields.
891            // Write the fields.
892            self.0.encode(encoder, offset + 0, depth)?;
893            Ok(())
894        }
895    }
896
897    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
898        for DebugAgentAttachToResponse
899    {
900        #[inline(always)]
901        fn new_empty() -> Self {
902            Self { num_matches: fidl::new_empty!(u32, D) }
903        }
904
905        #[inline]
906        unsafe fn decode(
907            &mut self,
908            decoder: &mut fidl::encoding::Decoder<'_, D>,
909            offset: usize,
910            _depth: fidl::encoding::Depth,
911        ) -> fidl::Result<()> {
912            decoder.debug_check_bounds::<Self>(offset);
913            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
914            // Verify that padding bytes are zero.
915            // Copy from the buffer into the object.
916            unsafe {
917                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
918            }
919            Ok(())
920        }
921    }
922
923    impl fidl::encoding::ValueTypeMarker for Filter {
924        type Borrowed<'a> = &'a Self;
925        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
926            value
927        }
928    }
929
930    unsafe impl fidl::encoding::TypeMarker for Filter {
931        type Owned = Self;
932
933        #[inline(always)]
934        fn inline_align(_context: fidl::encoding::Context) -> usize {
935            8
936        }
937
938        #[inline(always)]
939        fn inline_size(_context: fidl::encoding::Context) -> usize {
940            40
941        }
942    }
943
944    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Filter, D> for &Filter {
945        #[inline]
946        unsafe fn encode(
947            self,
948            encoder: &mut fidl::encoding::Encoder<'_, D>,
949            offset: usize,
950            _depth: fidl::encoding::Depth,
951        ) -> fidl::Result<()> {
952            encoder.debug_check_bounds::<Filter>(offset);
953            // Delegate to tuple encoding.
954            fidl::encoding::Encode::<Filter, D>::encode(
955                (
956                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
957                        &self.pattern,
958                    ),
959                    <FilterType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
960                    <FilterOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
961                ),
962                encoder,
963                offset,
964                _depth,
965            )
966        }
967    }
968    unsafe impl<
969        D: fidl::encoding::ResourceDialect,
970        T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
971        T1: fidl::encoding::Encode<FilterType, D>,
972        T2: fidl::encoding::Encode<FilterOptions, D>,
973    > fidl::encoding::Encode<Filter, D> for (T0, T1, T2)
974    {
975        #[inline]
976        unsafe fn encode(
977            self,
978            encoder: &mut fidl::encoding::Encoder<'_, D>,
979            offset: usize,
980            depth: fidl::encoding::Depth,
981        ) -> fidl::Result<()> {
982            encoder.debug_check_bounds::<Filter>(offset);
983            // Zero out padding regions. There's no need to apply masks
984            // because the unmasked parts will be overwritten by fields.
985            unsafe {
986                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
987                (ptr as *mut u64).write_unaligned(0);
988            }
989            // Write the fields.
990            self.0.encode(encoder, offset + 0, depth)?;
991            self.1.encode(encoder, offset + 16, depth)?;
992            self.2.encode(encoder, offset + 24, depth)?;
993            Ok(())
994        }
995    }
996
997    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Filter {
998        #[inline(always)]
999        fn new_empty() -> Self {
1000            Self {
1001                pattern: fidl::new_empty!(fidl::encoding::UnboundedString, D),
1002                type_: fidl::new_empty!(FilterType, D),
1003                options: fidl::new_empty!(FilterOptions, D),
1004            }
1005        }
1006
1007        #[inline]
1008        unsafe fn decode(
1009            &mut self,
1010            decoder: &mut fidl::encoding::Decoder<'_, D>,
1011            offset: usize,
1012            _depth: fidl::encoding::Depth,
1013        ) -> fidl::Result<()> {
1014            decoder.debug_check_bounds::<Self>(offset);
1015            // Verify that padding bytes are zero.
1016            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1017            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1018            let mask = 0xffffffffffffff00u64;
1019            let maskedval = padval & mask;
1020            if maskedval != 0 {
1021                return Err(fidl::Error::NonZeroPadding {
1022                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1023                });
1024            }
1025            fidl::decode!(
1026                fidl::encoding::UnboundedString,
1027                D,
1028                &mut self.pattern,
1029                decoder,
1030                offset + 0,
1031                _depth
1032            )?;
1033            fidl::decode!(FilterType, D, &mut self.type_, decoder, offset + 16, _depth)?;
1034            fidl::decode!(FilterOptions, D, &mut self.options, decoder, offset + 24, _depth)?;
1035            Ok(())
1036        }
1037    }
1038
1039    impl fidl::encoding::ValueTypeMarker for ProcessInfo {
1040        type Borrowed<'a> = &'a Self;
1041        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1042            value
1043        }
1044    }
1045
1046    unsafe impl fidl::encoding::TypeMarker for ProcessInfo {
1047        type Owned = Self;
1048
1049        #[inline(always)]
1050        fn inline_align(_context: fidl::encoding::Context) -> usize {
1051            8
1052        }
1053
1054        #[inline(always)]
1055        fn inline_size(_context: fidl::encoding::Context) -> usize {
1056            48
1057        }
1058    }
1059
1060    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProcessInfo, D>
1061        for &ProcessInfo
1062    {
1063        #[inline]
1064        unsafe fn encode(
1065            self,
1066            encoder: &mut fidl::encoding::Encoder<'_, D>,
1067            offset: usize,
1068            _depth: fidl::encoding::Depth,
1069        ) -> fidl::Result<()> {
1070            encoder.debug_check_bounds::<ProcessInfo>(offset);
1071            // Delegate to tuple encoding.
1072            fidl::encoding::Encode::<ProcessInfo, D>::encode(
1073                (
1074                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.process),
1075                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
1076                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.thread),
1077                    <ThreadDetails as fidl::encoding::ValueTypeMarker>::borrow(&self.details),
1078                ),
1079                encoder, offset, _depth
1080            )
1081        }
1082    }
1083    unsafe impl<
1084        D: fidl::encoding::ResourceDialect,
1085        T0: fidl::encoding::Encode<u64, D>,
1086        T1: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
1087        T2: fidl::encoding::Encode<u64, D>,
1088        T3: fidl::encoding::Encode<ThreadDetails, D>,
1089    > fidl::encoding::Encode<ProcessInfo, D> for (T0, T1, T2, T3)
1090    {
1091        #[inline]
1092        unsafe fn encode(
1093            self,
1094            encoder: &mut fidl::encoding::Encoder<'_, D>,
1095            offset: usize,
1096            depth: fidl::encoding::Depth,
1097        ) -> fidl::Result<()> {
1098            encoder.debug_check_bounds::<ProcessInfo>(offset);
1099            // Zero out padding regions. There's no need to apply masks
1100            // because the unmasked parts will be overwritten by fields.
1101            // Write the fields.
1102            self.0.encode(encoder, offset + 0, depth)?;
1103            self.1.encode(encoder, offset + 8, depth)?;
1104            self.2.encode(encoder, offset + 24, depth)?;
1105            self.3.encode(encoder, offset + 32, depth)?;
1106            Ok(())
1107        }
1108    }
1109
1110    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProcessInfo {
1111        #[inline(always)]
1112        fn new_empty() -> Self {
1113            Self {
1114                process: fidl::new_empty!(u64, D),
1115                moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
1116                thread: fidl::new_empty!(u64, D),
1117                details: fidl::new_empty!(ThreadDetails, D),
1118            }
1119        }
1120
1121        #[inline]
1122        unsafe fn decode(
1123            &mut self,
1124            decoder: &mut fidl::encoding::Decoder<'_, D>,
1125            offset: usize,
1126            _depth: fidl::encoding::Depth,
1127        ) -> fidl::Result<()> {
1128            decoder.debug_check_bounds::<Self>(offset);
1129            // Verify that padding bytes are zero.
1130            fidl::decode!(u64, D, &mut self.process, decoder, offset + 0, _depth)?;
1131            fidl::decode!(
1132                fidl::encoding::BoundedString<4096>,
1133                D,
1134                &mut self.moniker,
1135                decoder,
1136                offset + 8,
1137                _depth
1138            )?;
1139            fidl::decode!(u64, D, &mut self.thread, decoder, offset + 24, _depth)?;
1140            fidl::decode!(ThreadDetails, D, &mut self.details, decoder, offset + 32, _depth)?;
1141            Ok(())
1142        }
1143    }
1144
1145    impl fidl::encoding::ValueTypeMarker for ProcessInfoIteratorGetNextResponse {
1146        type Borrowed<'a> = &'a Self;
1147        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1148            value
1149        }
1150    }
1151
1152    unsafe impl fidl::encoding::TypeMarker for ProcessInfoIteratorGetNextResponse {
1153        type Owned = Self;
1154
1155        #[inline(always)]
1156        fn inline_align(_context: fidl::encoding::Context) -> usize {
1157            8
1158        }
1159
1160        #[inline(always)]
1161        fn inline_size(_context: fidl::encoding::Context) -> usize {
1162            16
1163        }
1164    }
1165
1166    unsafe impl<D: fidl::encoding::ResourceDialect>
1167        fidl::encoding::Encode<ProcessInfoIteratorGetNextResponse, D>
1168        for &ProcessInfoIteratorGetNextResponse
1169    {
1170        #[inline]
1171        unsafe fn encode(
1172            self,
1173            encoder: &mut fidl::encoding::Encoder<'_, D>,
1174            offset: usize,
1175            _depth: fidl::encoding::Depth,
1176        ) -> fidl::Result<()> {
1177            encoder.debug_check_bounds::<ProcessInfoIteratorGetNextResponse>(offset);
1178            // Delegate to tuple encoding.
1179            fidl::encoding::Encode::<ProcessInfoIteratorGetNextResponse, D>::encode(
1180                (
1181                    <fidl::encoding::UnboundedVector<ProcessInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1182                ),
1183                encoder, offset, _depth
1184            )
1185        }
1186    }
1187    unsafe impl<
1188        D: fidl::encoding::ResourceDialect,
1189        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<ProcessInfo>, D>,
1190    > fidl::encoding::Encode<ProcessInfoIteratorGetNextResponse, D> for (T0,)
1191    {
1192        #[inline]
1193        unsafe fn encode(
1194            self,
1195            encoder: &mut fidl::encoding::Encoder<'_, D>,
1196            offset: usize,
1197            depth: fidl::encoding::Depth,
1198        ) -> fidl::Result<()> {
1199            encoder.debug_check_bounds::<ProcessInfoIteratorGetNextResponse>(offset);
1200            // Zero out padding regions. There's no need to apply masks
1201            // because the unmasked parts will be overwritten by fields.
1202            // Write the fields.
1203            self.0.encode(encoder, offset + 0, depth)?;
1204            Ok(())
1205        }
1206    }
1207
1208    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1209        for ProcessInfoIteratorGetNextResponse
1210    {
1211        #[inline(always)]
1212        fn new_empty() -> Self {
1213            Self { info: fidl::new_empty!(fidl::encoding::UnboundedVector<ProcessInfo>, D) }
1214        }
1215
1216        #[inline]
1217        unsafe fn decode(
1218            &mut self,
1219            decoder: &mut fidl::encoding::Decoder<'_, D>,
1220            offset: usize,
1221            _depth: fidl::encoding::Depth,
1222        ) -> fidl::Result<()> {
1223            decoder.debug_check_bounds::<Self>(offset);
1224            // Verify that padding bytes are zero.
1225            fidl::decode!(
1226                fidl::encoding::UnboundedVector<ProcessInfo>,
1227                D,
1228                &mut self.info,
1229                decoder,
1230                offset + 0,
1231                _depth
1232            )?;
1233            Ok(())
1234        }
1235    }
1236
1237    impl DebugAgentOnFatalExceptionRequest {
1238        #[inline(always)]
1239        fn max_ordinal_present(&self) -> u64 {
1240            if let Some(_) = self.backtrace {
1241                return 2;
1242            }
1243            if let Some(_) = self.thread {
1244                return 1;
1245            }
1246            0
1247        }
1248    }
1249
1250    impl fidl::encoding::ValueTypeMarker for DebugAgentOnFatalExceptionRequest {
1251        type Borrowed<'a> = &'a Self;
1252        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1253            value
1254        }
1255    }
1256
1257    unsafe impl fidl::encoding::TypeMarker for DebugAgentOnFatalExceptionRequest {
1258        type Owned = Self;
1259
1260        #[inline(always)]
1261        fn inline_align(_context: fidl::encoding::Context) -> usize {
1262            8
1263        }
1264
1265        #[inline(always)]
1266        fn inline_size(_context: fidl::encoding::Context) -> usize {
1267            16
1268        }
1269    }
1270
1271    unsafe impl<D: fidl::encoding::ResourceDialect>
1272        fidl::encoding::Encode<DebugAgentOnFatalExceptionRequest, D>
1273        for &DebugAgentOnFatalExceptionRequest
1274    {
1275        unsafe fn encode(
1276            self,
1277            encoder: &mut fidl::encoding::Encoder<'_, D>,
1278            offset: usize,
1279            mut depth: fidl::encoding::Depth,
1280        ) -> fidl::Result<()> {
1281            encoder.debug_check_bounds::<DebugAgentOnFatalExceptionRequest>(offset);
1282            // Vector header
1283            let max_ordinal: u64 = self.max_ordinal_present();
1284            encoder.write_num(max_ordinal, offset);
1285            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1286            // Calling encoder.out_of_line_offset(0) is not allowed.
1287            if max_ordinal == 0 {
1288                return Ok(());
1289            }
1290            depth.increment()?;
1291            let envelope_size = 8;
1292            let bytes_len = max_ordinal as usize * envelope_size;
1293            #[allow(unused_variables)]
1294            let offset = encoder.out_of_line_offset(bytes_len);
1295            let mut _prev_end_offset: usize = 0;
1296            if 1 > max_ordinal {
1297                return Ok(());
1298            }
1299
1300            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1301            // are envelope_size bytes.
1302            let cur_offset: usize = (1 - 1) * envelope_size;
1303
1304            // Zero reserved fields.
1305            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1306
1307            // Safety:
1308            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1309            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1310            //   envelope_size bytes, there is always sufficient room.
1311            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1312                self.thread.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1313                encoder,
1314                offset + cur_offset,
1315                depth,
1316            )?;
1317
1318            _prev_end_offset = cur_offset + envelope_size;
1319            if 2 > max_ordinal {
1320                return Ok(());
1321            }
1322
1323            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1324            // are envelope_size bytes.
1325            let cur_offset: usize = (2 - 1) * envelope_size;
1326
1327            // Zero reserved fields.
1328            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1329
1330            // Safety:
1331            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1332            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1333            //   envelope_size bytes, there is always sufficient room.
1334            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
1335                self.backtrace.as_ref().map(
1336                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
1337                ),
1338                encoder,
1339                offset + cur_offset,
1340                depth,
1341            )?;
1342
1343            _prev_end_offset = cur_offset + envelope_size;
1344
1345            Ok(())
1346        }
1347    }
1348
1349    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1350        for DebugAgentOnFatalExceptionRequest
1351    {
1352        #[inline(always)]
1353        fn new_empty() -> Self {
1354            Self::default()
1355        }
1356
1357        unsafe fn decode(
1358            &mut self,
1359            decoder: &mut fidl::encoding::Decoder<'_, D>,
1360            offset: usize,
1361            mut depth: fidl::encoding::Depth,
1362        ) -> fidl::Result<()> {
1363            decoder.debug_check_bounds::<Self>(offset);
1364            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1365                None => return Err(fidl::Error::NotNullable),
1366                Some(len) => len,
1367            };
1368            // Calling decoder.out_of_line_offset(0) is not allowed.
1369            if len == 0 {
1370                return Ok(());
1371            };
1372            depth.increment()?;
1373            let envelope_size = 8;
1374            let bytes_len = len * envelope_size;
1375            let offset = decoder.out_of_line_offset(bytes_len)?;
1376            // Decode the envelope for each type.
1377            let mut _next_ordinal_to_read = 0;
1378            let mut next_offset = offset;
1379            let end_offset = offset + bytes_len;
1380            _next_ordinal_to_read += 1;
1381            if next_offset >= end_offset {
1382                return Ok(());
1383            }
1384
1385            // Decode unknown envelopes for gaps in ordinals.
1386            while _next_ordinal_to_read < 1 {
1387                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1388                _next_ordinal_to_read += 1;
1389                next_offset += envelope_size;
1390            }
1391
1392            let next_out_of_line = decoder.next_out_of_line();
1393            let handles_before = decoder.remaining_handles();
1394            if let Some((inlined, num_bytes, num_handles)) =
1395                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1396            {
1397                let member_inline_size =
1398                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1399                if inlined != (member_inline_size <= 4) {
1400                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1401                }
1402                let inner_offset;
1403                let mut inner_depth = depth.clone();
1404                if inlined {
1405                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1406                    inner_offset = next_offset;
1407                } else {
1408                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1409                    inner_depth.increment()?;
1410                }
1411                let val_ref = self.thread.get_or_insert_with(|| fidl::new_empty!(u64, D));
1412                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
1413                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1414                {
1415                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1416                }
1417                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1418                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1419                }
1420            }
1421
1422            next_offset += envelope_size;
1423            _next_ordinal_to_read += 1;
1424            if next_offset >= end_offset {
1425                return Ok(());
1426            }
1427
1428            // Decode unknown envelopes for gaps in ordinals.
1429            while _next_ordinal_to_read < 2 {
1430                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1431                _next_ordinal_to_read += 1;
1432                next_offset += envelope_size;
1433            }
1434
1435            let next_out_of_line = decoder.next_out_of_line();
1436            let handles_before = decoder.remaining_handles();
1437            if let Some((inlined, num_bytes, num_handles)) =
1438                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1439            {
1440                let member_inline_size =
1441                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
1442                        decoder.context,
1443                    );
1444                if inlined != (member_inline_size <= 4) {
1445                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1446                }
1447                let inner_offset;
1448                let mut inner_depth = depth.clone();
1449                if inlined {
1450                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1451                    inner_offset = next_offset;
1452                } else {
1453                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1454                    inner_depth.increment()?;
1455                }
1456                let val_ref = self
1457                    .backtrace
1458                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
1459                fidl::decode!(
1460                    fidl::encoding::UnboundedString,
1461                    D,
1462                    val_ref,
1463                    decoder,
1464                    inner_offset,
1465                    inner_depth
1466                )?;
1467                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1468                {
1469                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1470                }
1471                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1472                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1473                }
1474            }
1475
1476            next_offset += envelope_size;
1477
1478            // Decode the remaining unknown envelopes.
1479            while next_offset < end_offset {
1480                _next_ordinal_to_read += 1;
1481                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1482                next_offset += envelope_size;
1483            }
1484
1485            Ok(())
1486        }
1487    }
1488
1489    impl FilterOptions {
1490        #[inline(always)]
1491        fn max_ordinal_present(&self) -> u64 {
1492            if let Some(_) = self.job_only {
1493                return 2;
1494            }
1495            if let Some(_) = self.recursive {
1496                return 1;
1497            }
1498            0
1499        }
1500    }
1501
1502    impl fidl::encoding::ValueTypeMarker for FilterOptions {
1503        type Borrowed<'a> = &'a Self;
1504        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1505            value
1506        }
1507    }
1508
1509    unsafe impl fidl::encoding::TypeMarker for FilterOptions {
1510        type Owned = Self;
1511
1512        #[inline(always)]
1513        fn inline_align(_context: fidl::encoding::Context) -> usize {
1514            8
1515        }
1516
1517        #[inline(always)]
1518        fn inline_size(_context: fidl::encoding::Context) -> usize {
1519            16
1520        }
1521    }
1522
1523    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FilterOptions, D>
1524        for &FilterOptions
1525    {
1526        unsafe fn encode(
1527            self,
1528            encoder: &mut fidl::encoding::Encoder<'_, D>,
1529            offset: usize,
1530            mut depth: fidl::encoding::Depth,
1531        ) -> fidl::Result<()> {
1532            encoder.debug_check_bounds::<FilterOptions>(offset);
1533            // Vector header
1534            let max_ordinal: u64 = self.max_ordinal_present();
1535            encoder.write_num(max_ordinal, offset);
1536            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1537            // Calling encoder.out_of_line_offset(0) is not allowed.
1538            if max_ordinal == 0 {
1539                return Ok(());
1540            }
1541            depth.increment()?;
1542            let envelope_size = 8;
1543            let bytes_len = max_ordinal as usize * envelope_size;
1544            #[allow(unused_variables)]
1545            let offset = encoder.out_of_line_offset(bytes_len);
1546            let mut _prev_end_offset: usize = 0;
1547            if 1 > max_ordinal {
1548                return Ok(());
1549            }
1550
1551            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1552            // are envelope_size bytes.
1553            let cur_offset: usize = (1 - 1) * envelope_size;
1554
1555            // Zero reserved fields.
1556            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1557
1558            // Safety:
1559            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1560            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1561            //   envelope_size bytes, there is always sufficient room.
1562            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1563                self.recursive.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1564                encoder,
1565                offset + cur_offset,
1566                depth,
1567            )?;
1568
1569            _prev_end_offset = cur_offset + envelope_size;
1570            if 2 > max_ordinal {
1571                return Ok(());
1572            }
1573
1574            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1575            // are envelope_size bytes.
1576            let cur_offset: usize = (2 - 1) * envelope_size;
1577
1578            // Zero reserved fields.
1579            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1580
1581            // Safety:
1582            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1583            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1584            //   envelope_size bytes, there is always sufficient room.
1585            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1586                self.job_only.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1587                encoder,
1588                offset + cur_offset,
1589                depth,
1590            )?;
1591
1592            _prev_end_offset = cur_offset + envelope_size;
1593
1594            Ok(())
1595        }
1596    }
1597
1598    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilterOptions {
1599        #[inline(always)]
1600        fn new_empty() -> Self {
1601            Self::default()
1602        }
1603
1604        unsafe fn decode(
1605            &mut self,
1606            decoder: &mut fidl::encoding::Decoder<'_, D>,
1607            offset: usize,
1608            mut depth: fidl::encoding::Depth,
1609        ) -> fidl::Result<()> {
1610            decoder.debug_check_bounds::<Self>(offset);
1611            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1612                None => return Err(fidl::Error::NotNullable),
1613                Some(len) => len,
1614            };
1615            // Calling decoder.out_of_line_offset(0) is not allowed.
1616            if len == 0 {
1617                return Ok(());
1618            };
1619            depth.increment()?;
1620            let envelope_size = 8;
1621            let bytes_len = len * envelope_size;
1622            let offset = decoder.out_of_line_offset(bytes_len)?;
1623            // Decode the envelope for each type.
1624            let mut _next_ordinal_to_read = 0;
1625            let mut next_offset = offset;
1626            let end_offset = offset + bytes_len;
1627            _next_ordinal_to_read += 1;
1628            if next_offset >= end_offset {
1629                return Ok(());
1630            }
1631
1632            // Decode unknown envelopes for gaps in ordinals.
1633            while _next_ordinal_to_read < 1 {
1634                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1635                _next_ordinal_to_read += 1;
1636                next_offset += envelope_size;
1637            }
1638
1639            let next_out_of_line = decoder.next_out_of_line();
1640            let handles_before = decoder.remaining_handles();
1641            if let Some((inlined, num_bytes, num_handles)) =
1642                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1643            {
1644                let member_inline_size =
1645                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1646                if inlined != (member_inline_size <= 4) {
1647                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1648                }
1649                let inner_offset;
1650                let mut inner_depth = depth.clone();
1651                if inlined {
1652                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1653                    inner_offset = next_offset;
1654                } else {
1655                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1656                    inner_depth.increment()?;
1657                }
1658                let val_ref = self.recursive.get_or_insert_with(|| fidl::new_empty!(bool, D));
1659                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1660                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1661                {
1662                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1663                }
1664                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1665                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1666                }
1667            }
1668
1669            next_offset += envelope_size;
1670            _next_ordinal_to_read += 1;
1671            if next_offset >= end_offset {
1672                return Ok(());
1673            }
1674
1675            // Decode unknown envelopes for gaps in ordinals.
1676            while _next_ordinal_to_read < 2 {
1677                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1678                _next_ordinal_to_read += 1;
1679                next_offset += envelope_size;
1680            }
1681
1682            let next_out_of_line = decoder.next_out_of_line();
1683            let handles_before = decoder.remaining_handles();
1684            if let Some((inlined, num_bytes, num_handles)) =
1685                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1686            {
1687                let member_inline_size =
1688                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1689                if inlined != (member_inline_size <= 4) {
1690                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1691                }
1692                let inner_offset;
1693                let mut inner_depth = depth.clone();
1694                if inlined {
1695                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1696                    inner_offset = next_offset;
1697                } else {
1698                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1699                    inner_depth.increment()?;
1700                }
1701                let val_ref = self.job_only.get_or_insert_with(|| fidl::new_empty!(bool, D));
1702                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1703                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1704                {
1705                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1706                }
1707                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1708                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1709                }
1710            }
1711
1712            next_offset += envelope_size;
1713
1714            // Decode the remaining unknown envelopes.
1715            while next_offset < end_offset {
1716                _next_ordinal_to_read += 1;
1717                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1718                next_offset += envelope_size;
1719            }
1720
1721            Ok(())
1722        }
1723    }
1724
1725    impl GetProcessInfoOptions {
1726        #[inline(always)]
1727        fn max_ordinal_present(&self) -> u64 {
1728            if let Some(_) = self.interest {
1729                return 2;
1730            }
1731            if let Some(_) = self.filter {
1732                return 1;
1733            }
1734            0
1735        }
1736    }
1737
1738    impl fidl::encoding::ValueTypeMarker for GetProcessInfoOptions {
1739        type Borrowed<'a> = &'a Self;
1740        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1741            value
1742        }
1743    }
1744
1745    unsafe impl fidl::encoding::TypeMarker for GetProcessInfoOptions {
1746        type Owned = Self;
1747
1748        #[inline(always)]
1749        fn inline_align(_context: fidl::encoding::Context) -> usize {
1750            8
1751        }
1752
1753        #[inline(always)]
1754        fn inline_size(_context: fidl::encoding::Context) -> usize {
1755            16
1756        }
1757    }
1758
1759    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GetProcessInfoOptions, D>
1760        for &GetProcessInfoOptions
1761    {
1762        unsafe fn encode(
1763            self,
1764            encoder: &mut fidl::encoding::Encoder<'_, D>,
1765            offset: usize,
1766            mut depth: fidl::encoding::Depth,
1767        ) -> fidl::Result<()> {
1768            encoder.debug_check_bounds::<GetProcessInfoOptions>(offset);
1769            // Vector header
1770            let max_ordinal: u64 = self.max_ordinal_present();
1771            encoder.write_num(max_ordinal, offset);
1772            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1773            // Calling encoder.out_of_line_offset(0) is not allowed.
1774            if max_ordinal == 0 {
1775                return Ok(());
1776            }
1777            depth.increment()?;
1778            let envelope_size = 8;
1779            let bytes_len = max_ordinal as usize * envelope_size;
1780            #[allow(unused_variables)]
1781            let offset = encoder.out_of_line_offset(bytes_len);
1782            let mut _prev_end_offset: usize = 0;
1783            if 1 > max_ordinal {
1784                return Ok(());
1785            }
1786
1787            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1788            // are envelope_size bytes.
1789            let cur_offset: usize = (1 - 1) * envelope_size;
1790
1791            // Zero reserved fields.
1792            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1793
1794            // Safety:
1795            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1796            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1797            //   envelope_size bytes, there is always sufficient room.
1798            fidl::encoding::encode_in_envelope_optional::<Filter, D>(
1799                self.filter.as_ref().map(<Filter as fidl::encoding::ValueTypeMarker>::borrow),
1800                encoder,
1801                offset + cur_offset,
1802                depth,
1803            )?;
1804
1805            _prev_end_offset = cur_offset + envelope_size;
1806            if 2 > max_ordinal {
1807                return Ok(());
1808            }
1809
1810            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1811            // are envelope_size bytes.
1812            let cur_offset: usize = (2 - 1) * envelope_size;
1813
1814            // Zero reserved fields.
1815            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1816
1817            // Safety:
1818            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1819            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1820            //   envelope_size bytes, there is always sufficient room.
1821            fidl::encoding::encode_in_envelope_optional::<ThreadDetailsInterest, D>(
1822                self.interest
1823                    .as_ref()
1824                    .map(<ThreadDetailsInterest as fidl::encoding::ValueTypeMarker>::borrow),
1825                encoder,
1826                offset + cur_offset,
1827                depth,
1828            )?;
1829
1830            _prev_end_offset = cur_offset + envelope_size;
1831
1832            Ok(())
1833        }
1834    }
1835
1836    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetProcessInfoOptions {
1837        #[inline(always)]
1838        fn new_empty() -> Self {
1839            Self::default()
1840        }
1841
1842        unsafe fn decode(
1843            &mut self,
1844            decoder: &mut fidl::encoding::Decoder<'_, D>,
1845            offset: usize,
1846            mut depth: fidl::encoding::Depth,
1847        ) -> fidl::Result<()> {
1848            decoder.debug_check_bounds::<Self>(offset);
1849            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1850                None => return Err(fidl::Error::NotNullable),
1851                Some(len) => len,
1852            };
1853            // Calling decoder.out_of_line_offset(0) is not allowed.
1854            if len == 0 {
1855                return Ok(());
1856            };
1857            depth.increment()?;
1858            let envelope_size = 8;
1859            let bytes_len = len * envelope_size;
1860            let offset = decoder.out_of_line_offset(bytes_len)?;
1861            // Decode the envelope for each type.
1862            let mut _next_ordinal_to_read = 0;
1863            let mut next_offset = offset;
1864            let end_offset = offset + bytes_len;
1865            _next_ordinal_to_read += 1;
1866            if next_offset >= end_offset {
1867                return Ok(());
1868            }
1869
1870            // Decode unknown envelopes for gaps in ordinals.
1871            while _next_ordinal_to_read < 1 {
1872                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1873                _next_ordinal_to_read += 1;
1874                next_offset += envelope_size;
1875            }
1876
1877            let next_out_of_line = decoder.next_out_of_line();
1878            let handles_before = decoder.remaining_handles();
1879            if let Some((inlined, num_bytes, num_handles)) =
1880                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1881            {
1882                let member_inline_size =
1883                    <Filter as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1884                if inlined != (member_inline_size <= 4) {
1885                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1886                }
1887                let inner_offset;
1888                let mut inner_depth = depth.clone();
1889                if inlined {
1890                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1891                    inner_offset = next_offset;
1892                } else {
1893                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1894                    inner_depth.increment()?;
1895                }
1896                let val_ref = self.filter.get_or_insert_with(|| fidl::new_empty!(Filter, D));
1897                fidl::decode!(Filter, D, val_ref, decoder, inner_offset, inner_depth)?;
1898                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1899                {
1900                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1901                }
1902                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1903                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1904                }
1905            }
1906
1907            next_offset += envelope_size;
1908            _next_ordinal_to_read += 1;
1909            if next_offset >= end_offset {
1910                return Ok(());
1911            }
1912
1913            // Decode unknown envelopes for gaps in ordinals.
1914            while _next_ordinal_to_read < 2 {
1915                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1916                _next_ordinal_to_read += 1;
1917                next_offset += envelope_size;
1918            }
1919
1920            let next_out_of_line = decoder.next_out_of_line();
1921            let handles_before = decoder.remaining_handles();
1922            if let Some((inlined, num_bytes, num_handles)) =
1923                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1924            {
1925                let member_inline_size =
1926                    <ThreadDetailsInterest as fidl::encoding::TypeMarker>::inline_size(
1927                        decoder.context,
1928                    );
1929                if inlined != (member_inline_size <= 4) {
1930                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1931                }
1932                let inner_offset;
1933                let mut inner_depth = depth.clone();
1934                if inlined {
1935                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1936                    inner_offset = next_offset;
1937                } else {
1938                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1939                    inner_depth.increment()?;
1940                }
1941                let val_ref =
1942                    self.interest.get_or_insert_with(|| fidl::new_empty!(ThreadDetailsInterest, D));
1943                fidl::decode!(
1944                    ThreadDetailsInterest,
1945                    D,
1946                    val_ref,
1947                    decoder,
1948                    inner_offset,
1949                    inner_depth
1950                )?;
1951                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1952                {
1953                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1954                }
1955                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1956                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1957                }
1958            }
1959
1960            next_offset += envelope_size;
1961
1962            // Decode the remaining unknown envelopes.
1963            while next_offset < end_offset {
1964                _next_ordinal_to_read += 1;
1965                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1966                next_offset += envelope_size;
1967            }
1968
1969            Ok(())
1970        }
1971    }
1972
1973    impl LaunchOptions {
1974        #[inline(always)]
1975        fn max_ordinal_present(&self) -> u64 {
1976            if let Some(_) = self.monitor_root_job {
1977                return 1;
1978            }
1979            0
1980        }
1981    }
1982
1983    impl fidl::encoding::ValueTypeMarker for LaunchOptions {
1984        type Borrowed<'a> = &'a Self;
1985        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1986            value
1987        }
1988    }
1989
1990    unsafe impl fidl::encoding::TypeMarker for LaunchOptions {
1991        type Owned = Self;
1992
1993        #[inline(always)]
1994        fn inline_align(_context: fidl::encoding::Context) -> usize {
1995            8
1996        }
1997
1998        #[inline(always)]
1999        fn inline_size(_context: fidl::encoding::Context) -> usize {
2000            16
2001        }
2002    }
2003
2004    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LaunchOptions, D>
2005        for &LaunchOptions
2006    {
2007        unsafe fn encode(
2008            self,
2009            encoder: &mut fidl::encoding::Encoder<'_, D>,
2010            offset: usize,
2011            mut depth: fidl::encoding::Depth,
2012        ) -> fidl::Result<()> {
2013            encoder.debug_check_bounds::<LaunchOptions>(offset);
2014            // Vector header
2015            let max_ordinal: u64 = self.max_ordinal_present();
2016            encoder.write_num(max_ordinal, offset);
2017            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2018            // Calling encoder.out_of_line_offset(0) is not allowed.
2019            if max_ordinal == 0 {
2020                return Ok(());
2021            }
2022            depth.increment()?;
2023            let envelope_size = 8;
2024            let bytes_len = max_ordinal as usize * envelope_size;
2025            #[allow(unused_variables)]
2026            let offset = encoder.out_of_line_offset(bytes_len);
2027            let mut _prev_end_offset: usize = 0;
2028            if 1 > max_ordinal {
2029                return Ok(());
2030            }
2031
2032            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2033            // are envelope_size bytes.
2034            let cur_offset: usize = (1 - 1) * envelope_size;
2035
2036            // Zero reserved fields.
2037            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2038
2039            // Safety:
2040            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2041            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2042            //   envelope_size bytes, there is always sufficient room.
2043            fidl::encoding::encode_in_envelope_optional::<bool, D>(
2044                self.monitor_root_job
2045                    .as_ref()
2046                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2047                encoder,
2048                offset + cur_offset,
2049                depth,
2050            )?;
2051
2052            _prev_end_offset = cur_offset + envelope_size;
2053
2054            Ok(())
2055        }
2056    }
2057
2058    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LaunchOptions {
2059        #[inline(always)]
2060        fn new_empty() -> Self {
2061            Self::default()
2062        }
2063
2064        unsafe fn decode(
2065            &mut self,
2066            decoder: &mut fidl::encoding::Decoder<'_, D>,
2067            offset: usize,
2068            mut depth: fidl::encoding::Depth,
2069        ) -> fidl::Result<()> {
2070            decoder.debug_check_bounds::<Self>(offset);
2071            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2072                None => return Err(fidl::Error::NotNullable),
2073                Some(len) => len,
2074            };
2075            // Calling decoder.out_of_line_offset(0) is not allowed.
2076            if len == 0 {
2077                return Ok(());
2078            };
2079            depth.increment()?;
2080            let envelope_size = 8;
2081            let bytes_len = len * envelope_size;
2082            let offset = decoder.out_of_line_offset(bytes_len)?;
2083            // Decode the envelope for each type.
2084            let mut _next_ordinal_to_read = 0;
2085            let mut next_offset = offset;
2086            let end_offset = offset + bytes_len;
2087            _next_ordinal_to_read += 1;
2088            if next_offset >= end_offset {
2089                return Ok(());
2090            }
2091
2092            // Decode unknown envelopes for gaps in ordinals.
2093            while _next_ordinal_to_read < 1 {
2094                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2095                _next_ordinal_to_read += 1;
2096                next_offset += envelope_size;
2097            }
2098
2099            let next_out_of_line = decoder.next_out_of_line();
2100            let handles_before = decoder.remaining_handles();
2101            if let Some((inlined, num_bytes, num_handles)) =
2102                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2103            {
2104                let member_inline_size =
2105                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2106                if inlined != (member_inline_size <= 4) {
2107                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2108                }
2109                let inner_offset;
2110                let mut inner_depth = depth.clone();
2111                if inlined {
2112                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2113                    inner_offset = next_offset;
2114                } else {
2115                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2116                    inner_depth.increment()?;
2117                }
2118                let val_ref =
2119                    self.monitor_root_job.get_or_insert_with(|| fidl::new_empty!(bool, D));
2120                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2121                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2122                {
2123                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2124                }
2125                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2126                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2127                }
2128            }
2129
2130            next_offset += envelope_size;
2131
2132            // Decode the remaining unknown envelopes.
2133            while next_offset < end_offset {
2134                _next_ordinal_to_read += 1;
2135                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2136                next_offset += envelope_size;
2137            }
2138
2139            Ok(())
2140        }
2141    }
2142
2143    impl MinidumpOptions {
2144        #[inline(always)]
2145        fn max_ordinal_present(&self) -> u64 {
2146            if let Some(_) = self.filter {
2147                return 1;
2148            }
2149            0
2150        }
2151    }
2152
2153    impl fidl::encoding::ValueTypeMarker for MinidumpOptions {
2154        type Borrowed<'a> = &'a Self;
2155        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2156            value
2157        }
2158    }
2159
2160    unsafe impl fidl::encoding::TypeMarker for MinidumpOptions {
2161        type Owned = Self;
2162
2163        #[inline(always)]
2164        fn inline_align(_context: fidl::encoding::Context) -> usize {
2165            8
2166        }
2167
2168        #[inline(always)]
2169        fn inline_size(_context: fidl::encoding::Context) -> usize {
2170            16
2171        }
2172    }
2173
2174    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MinidumpOptions, D>
2175        for &MinidumpOptions
2176    {
2177        unsafe fn encode(
2178            self,
2179            encoder: &mut fidl::encoding::Encoder<'_, D>,
2180            offset: usize,
2181            mut depth: fidl::encoding::Depth,
2182        ) -> fidl::Result<()> {
2183            encoder.debug_check_bounds::<MinidumpOptions>(offset);
2184            // Vector header
2185            let max_ordinal: u64 = self.max_ordinal_present();
2186            encoder.write_num(max_ordinal, offset);
2187            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2188            // Calling encoder.out_of_line_offset(0) is not allowed.
2189            if max_ordinal == 0 {
2190                return Ok(());
2191            }
2192            depth.increment()?;
2193            let envelope_size = 8;
2194            let bytes_len = max_ordinal as usize * envelope_size;
2195            #[allow(unused_variables)]
2196            let offset = encoder.out_of_line_offset(bytes_len);
2197            let mut _prev_end_offset: usize = 0;
2198            if 1 > max_ordinal {
2199                return Ok(());
2200            }
2201
2202            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2203            // are envelope_size bytes.
2204            let cur_offset: usize = (1 - 1) * envelope_size;
2205
2206            // Zero reserved fields.
2207            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2208
2209            // Safety:
2210            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2211            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2212            //   envelope_size bytes, there is always sufficient room.
2213            fidl::encoding::encode_in_envelope_optional::<Filter, D>(
2214                self.filter.as_ref().map(<Filter as fidl::encoding::ValueTypeMarker>::borrow),
2215                encoder,
2216                offset + cur_offset,
2217                depth,
2218            )?;
2219
2220            _prev_end_offset = cur_offset + envelope_size;
2221
2222            Ok(())
2223        }
2224    }
2225
2226    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MinidumpOptions {
2227        #[inline(always)]
2228        fn new_empty() -> Self {
2229            Self::default()
2230        }
2231
2232        unsafe fn decode(
2233            &mut self,
2234            decoder: &mut fidl::encoding::Decoder<'_, D>,
2235            offset: usize,
2236            mut depth: fidl::encoding::Depth,
2237        ) -> fidl::Result<()> {
2238            decoder.debug_check_bounds::<Self>(offset);
2239            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2240                None => return Err(fidl::Error::NotNullable),
2241                Some(len) => len,
2242            };
2243            // Calling decoder.out_of_line_offset(0) is not allowed.
2244            if len == 0 {
2245                return Ok(());
2246            };
2247            depth.increment()?;
2248            let envelope_size = 8;
2249            let bytes_len = len * envelope_size;
2250            let offset = decoder.out_of_line_offset(bytes_len)?;
2251            // Decode the envelope for each type.
2252            let mut _next_ordinal_to_read = 0;
2253            let mut next_offset = offset;
2254            let end_offset = offset + bytes_len;
2255            _next_ordinal_to_read += 1;
2256            if next_offset >= end_offset {
2257                return Ok(());
2258            }
2259
2260            // Decode unknown envelopes for gaps in ordinals.
2261            while _next_ordinal_to_read < 1 {
2262                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2263                _next_ordinal_to_read += 1;
2264                next_offset += envelope_size;
2265            }
2266
2267            let next_out_of_line = decoder.next_out_of_line();
2268            let handles_before = decoder.remaining_handles();
2269            if let Some((inlined, num_bytes, num_handles)) =
2270                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2271            {
2272                let member_inline_size =
2273                    <Filter as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2274                if inlined != (member_inline_size <= 4) {
2275                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2276                }
2277                let inner_offset;
2278                let mut inner_depth = depth.clone();
2279                if inlined {
2280                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2281                    inner_offset = next_offset;
2282                } else {
2283                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2284                    inner_depth.increment()?;
2285                }
2286                let val_ref = self.filter.get_or_insert_with(|| fidl::new_empty!(Filter, D));
2287                fidl::decode!(Filter, D, val_ref, decoder, inner_offset, inner_depth)?;
2288                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2289                {
2290                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2291                }
2292                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2293                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2294                }
2295            }
2296
2297            next_offset += envelope_size;
2298
2299            // Decode the remaining unknown envelopes.
2300            while next_offset < end_offset {
2301                _next_ordinal_to_read += 1;
2302                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2303                next_offset += envelope_size;
2304            }
2305
2306            Ok(())
2307        }
2308    }
2309
2310    impl ThreadDetails {
2311        #[inline(always)]
2312        fn max_ordinal_present(&self) -> u64 {
2313            if let Some(_) = self.backtrace {
2314                return 1;
2315            }
2316            0
2317        }
2318    }
2319
2320    impl fidl::encoding::ValueTypeMarker for ThreadDetails {
2321        type Borrowed<'a> = &'a Self;
2322        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2323            value
2324        }
2325    }
2326
2327    unsafe impl fidl::encoding::TypeMarker for ThreadDetails {
2328        type Owned = Self;
2329
2330        #[inline(always)]
2331        fn inline_align(_context: fidl::encoding::Context) -> usize {
2332            8
2333        }
2334
2335        #[inline(always)]
2336        fn inline_size(_context: fidl::encoding::Context) -> usize {
2337            16
2338        }
2339    }
2340
2341    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ThreadDetails, D>
2342        for &ThreadDetails
2343    {
2344        unsafe fn encode(
2345            self,
2346            encoder: &mut fidl::encoding::Encoder<'_, D>,
2347            offset: usize,
2348            mut depth: fidl::encoding::Depth,
2349        ) -> fidl::Result<()> {
2350            encoder.debug_check_bounds::<ThreadDetails>(offset);
2351            // Vector header
2352            let max_ordinal: u64 = self.max_ordinal_present();
2353            encoder.write_num(max_ordinal, offset);
2354            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2355            // Calling encoder.out_of_line_offset(0) is not allowed.
2356            if max_ordinal == 0 {
2357                return Ok(());
2358            }
2359            depth.increment()?;
2360            let envelope_size = 8;
2361            let bytes_len = max_ordinal as usize * envelope_size;
2362            #[allow(unused_variables)]
2363            let offset = encoder.out_of_line_offset(bytes_len);
2364            let mut _prev_end_offset: usize = 0;
2365            if 1 > max_ordinal {
2366                return Ok(());
2367            }
2368
2369            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2370            // are envelope_size bytes.
2371            let cur_offset: usize = (1 - 1) * envelope_size;
2372
2373            // Zero reserved fields.
2374            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2375
2376            // Safety:
2377            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2378            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2379            //   envelope_size bytes, there is always sufficient room.
2380            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2381                self.backtrace.as_ref().map(
2382                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2383                ),
2384                encoder,
2385                offset + cur_offset,
2386                depth,
2387            )?;
2388
2389            _prev_end_offset = cur_offset + envelope_size;
2390
2391            Ok(())
2392        }
2393    }
2394
2395    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThreadDetails {
2396        #[inline(always)]
2397        fn new_empty() -> Self {
2398            Self::default()
2399        }
2400
2401        unsafe fn decode(
2402            &mut self,
2403            decoder: &mut fidl::encoding::Decoder<'_, D>,
2404            offset: usize,
2405            mut depth: fidl::encoding::Depth,
2406        ) -> fidl::Result<()> {
2407            decoder.debug_check_bounds::<Self>(offset);
2408            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2409                None => return Err(fidl::Error::NotNullable),
2410                Some(len) => len,
2411            };
2412            // Calling decoder.out_of_line_offset(0) is not allowed.
2413            if len == 0 {
2414                return Ok(());
2415            };
2416            depth.increment()?;
2417            let envelope_size = 8;
2418            let bytes_len = len * envelope_size;
2419            let offset = decoder.out_of_line_offset(bytes_len)?;
2420            // Decode the envelope for each type.
2421            let mut _next_ordinal_to_read = 0;
2422            let mut next_offset = offset;
2423            let end_offset = offset + bytes_len;
2424            _next_ordinal_to_read += 1;
2425            if next_offset >= end_offset {
2426                return Ok(());
2427            }
2428
2429            // Decode unknown envelopes for gaps in ordinals.
2430            while _next_ordinal_to_read < 1 {
2431                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2432                _next_ordinal_to_read += 1;
2433                next_offset += envelope_size;
2434            }
2435
2436            let next_out_of_line = decoder.next_out_of_line();
2437            let handles_before = decoder.remaining_handles();
2438            if let Some((inlined, num_bytes, num_handles)) =
2439                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2440            {
2441                let member_inline_size =
2442                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2443                        decoder.context,
2444                    );
2445                if inlined != (member_inline_size <= 4) {
2446                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2447                }
2448                let inner_offset;
2449                let mut inner_depth = depth.clone();
2450                if inlined {
2451                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2452                    inner_offset = next_offset;
2453                } else {
2454                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2455                    inner_depth.increment()?;
2456                }
2457                let val_ref = self
2458                    .backtrace
2459                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2460                fidl::decode!(
2461                    fidl::encoding::UnboundedString,
2462                    D,
2463                    val_ref,
2464                    decoder,
2465                    inner_offset,
2466                    inner_depth
2467                )?;
2468                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2469                {
2470                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2471                }
2472                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2473                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2474                }
2475            }
2476
2477            next_offset += envelope_size;
2478
2479            // Decode the remaining unknown envelopes.
2480            while next_offset < end_offset {
2481                _next_ordinal_to_read += 1;
2482                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2483                next_offset += envelope_size;
2484            }
2485
2486            Ok(())
2487        }
2488    }
2489
2490    impl ThreadDetailsInterest {
2491        #[inline(always)]
2492        fn max_ordinal_present(&self) -> u64 {
2493            if let Some(_) = self.backtrace {
2494                return 1;
2495            }
2496            0
2497        }
2498    }
2499
2500    impl fidl::encoding::ValueTypeMarker for ThreadDetailsInterest {
2501        type Borrowed<'a> = &'a Self;
2502        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2503            value
2504        }
2505    }
2506
2507    unsafe impl fidl::encoding::TypeMarker for ThreadDetailsInterest {
2508        type Owned = Self;
2509
2510        #[inline(always)]
2511        fn inline_align(_context: fidl::encoding::Context) -> usize {
2512            8
2513        }
2514
2515        #[inline(always)]
2516        fn inline_size(_context: fidl::encoding::Context) -> usize {
2517            16
2518        }
2519    }
2520
2521    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ThreadDetailsInterest, D>
2522        for &ThreadDetailsInterest
2523    {
2524        unsafe fn encode(
2525            self,
2526            encoder: &mut fidl::encoding::Encoder<'_, D>,
2527            offset: usize,
2528            mut depth: fidl::encoding::Depth,
2529        ) -> fidl::Result<()> {
2530            encoder.debug_check_bounds::<ThreadDetailsInterest>(offset);
2531            // Vector header
2532            let max_ordinal: u64 = self.max_ordinal_present();
2533            encoder.write_num(max_ordinal, offset);
2534            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2535            // Calling encoder.out_of_line_offset(0) is not allowed.
2536            if max_ordinal == 0 {
2537                return Ok(());
2538            }
2539            depth.increment()?;
2540            let envelope_size = 8;
2541            let bytes_len = max_ordinal as usize * envelope_size;
2542            #[allow(unused_variables)]
2543            let offset = encoder.out_of_line_offset(bytes_len);
2544            let mut _prev_end_offset: usize = 0;
2545            if 1 > max_ordinal {
2546                return Ok(());
2547            }
2548
2549            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2550            // are envelope_size bytes.
2551            let cur_offset: usize = (1 - 1) * envelope_size;
2552
2553            // Zero reserved fields.
2554            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2555
2556            // Safety:
2557            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2558            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2559            //   envelope_size bytes, there is always sufficient room.
2560            fidl::encoding::encode_in_envelope_optional::<bool, D>(
2561                self.backtrace.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2562                encoder,
2563                offset + cur_offset,
2564                depth,
2565            )?;
2566
2567            _prev_end_offset = cur_offset + envelope_size;
2568
2569            Ok(())
2570        }
2571    }
2572
2573    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThreadDetailsInterest {
2574        #[inline(always)]
2575        fn new_empty() -> Self {
2576            Self::default()
2577        }
2578
2579        unsafe fn decode(
2580            &mut self,
2581            decoder: &mut fidl::encoding::Decoder<'_, D>,
2582            offset: usize,
2583            mut depth: fidl::encoding::Depth,
2584        ) -> fidl::Result<()> {
2585            decoder.debug_check_bounds::<Self>(offset);
2586            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2587                None => return Err(fidl::Error::NotNullable),
2588                Some(len) => len,
2589            };
2590            // Calling decoder.out_of_line_offset(0) is not allowed.
2591            if len == 0 {
2592                return Ok(());
2593            };
2594            depth.increment()?;
2595            let envelope_size = 8;
2596            let bytes_len = len * envelope_size;
2597            let offset = decoder.out_of_line_offset(bytes_len)?;
2598            // Decode the envelope for each type.
2599            let mut _next_ordinal_to_read = 0;
2600            let mut next_offset = offset;
2601            let end_offset = offset + bytes_len;
2602            _next_ordinal_to_read += 1;
2603            if next_offset >= end_offset {
2604                return Ok(());
2605            }
2606
2607            // Decode unknown envelopes for gaps in ordinals.
2608            while _next_ordinal_to_read < 1 {
2609                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2610                _next_ordinal_to_read += 1;
2611                next_offset += envelope_size;
2612            }
2613
2614            let next_out_of_line = decoder.next_out_of_line();
2615            let handles_before = decoder.remaining_handles();
2616            if let Some((inlined, num_bytes, num_handles)) =
2617                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2618            {
2619                let member_inline_size =
2620                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2621                if inlined != (member_inline_size <= 4) {
2622                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2623                }
2624                let inner_offset;
2625                let mut inner_depth = depth.clone();
2626                if inlined {
2627                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2628                    inner_offset = next_offset;
2629                } else {
2630                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2631                    inner_depth.increment()?;
2632                }
2633                let val_ref = self.backtrace.get_or_insert_with(|| fidl::new_empty!(bool, D));
2634                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2635                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2636                {
2637                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2638                }
2639                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2640                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2641                }
2642            }
2643
2644            next_offset += envelope_size;
2645
2646            // Decode the remaining unknown envelopes.
2647            while next_offset < end_offset {
2648                _next_ordinal_to_read += 1;
2649                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2650                next_offset += envelope_size;
2651            }
2652
2653            Ok(())
2654        }
2655    }
2656}