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 children components will
347    /// be launched within this realm. This is mutually exclusive with
348    /// |job_only|. If both are specified, a FilterError will be returned.
349    pub recursive: Option<bool>,
350    /// Whether or not to attach directly to the parent job of the process
351    /// matching the filter. When true, the parent job's standard exception
352    /// channel will be bound, rather than the exception channel of the process.
353    /// See https://fuchsia.dev/fuchsia-src/concepts/kernel/exceptions#exception_channel_types
354    /// for more details. Note that this is *not* the same as the "Debugger"
355    /// exception channel, which only delivers process starting "exceptions" but
356    /// not architectural exceptions. Note that this is mutually exclusive with
357    /// |recursive|. If both are specified, a FilterError will be returned.
358    pub job_only: Option<bool>,
359    #[doc(hidden)]
360    pub __source_breaking: fidl::marker::SourceBreaking,
361}
362
363impl fidl::Persistable for FilterOptions {}
364
365#[derive(Clone, Debug, Default, PartialEq)]
366pub struct GetProcessInfoOptions {
367    /// A filter that will reduce the number of processes that are iterated
368    /// over. This will not install any new filters and will not cause new
369    /// processes to be attached. Instead, this filter will be applied to
370    /// already attached processes, which can be useful if there are many
371    /// processes currently attached.
372    pub filter: Option<Filter>,
373    /// Clients should specify the data they are interested in being yielded
374    /// from the iterator here. Any unspecified fields will be assumed to be
375    /// false. See ThreadDetailsInterest for descriptions of possible data.
376    pub interest: Option<ThreadDetailsInterest>,
377    #[doc(hidden)]
378    pub __source_breaking: fidl::marker::SourceBreaking,
379}
380
381impl fidl::Persistable for GetProcessInfoOptions {}
382
383#[derive(Clone, Debug, Default, PartialEq)]
384pub struct MinidumpOptions {
385    /// This will not install any new filters and will not cause new processes
386    /// to be attached. Rather, this filter will be applied to already attached
387    /// processes.
388    pub filter: Option<Filter>,
389    #[doc(hidden)]
390    pub __source_breaking: fidl::marker::SourceBreaking,
391}
392
393impl fidl::Persistable for MinidumpOptions {}
394
395/// Details about a particular thread. The fields will be included as per the
396/// ThreadDetailsInterest supplied when creating the ProcessInfoIterator via
397/// |GetProcessInfo|.
398#[derive(Clone, Debug, Default, PartialEq)]
399pub struct ThreadDetails {
400    /// A stack trace from the current thread in symbolizer markup format.
401    pub backtrace: Option<String>,
402    #[doc(hidden)]
403    pub __source_breaking: fidl::marker::SourceBreaking,
404}
405
406impl fidl::Persistable for ThreadDetails {}
407
408#[derive(Clone, Debug, Default, PartialEq)]
409pub struct ThreadDetailsInterest {
410    /// Produce a backtrace in symbolizer markup format for each thread.
411    /// If this is unspecified, no backtrace will be included in the
412    /// ThreadDetails yielded by ProcessInfoIterator.
413    pub backtrace: Option<bool>,
414    #[doc(hidden)]
415    pub __source_breaking: fidl::marker::SourceBreaking,
416}
417
418impl fidl::Persistable for ThreadDetailsInterest {}
419
420pub mod agent_iterator_ordinals {
421    pub const GET_NEXT: u64 = 0x40f8adb0c975fa41;
422}
423
424pub mod attached_process_iterator_ordinals {
425    pub const GET_NEXT: u64 = 0x47ef49b75f6133ab;
426}
427
428pub mod debug_agent_ordinals {
429    pub const CONNECT: u64 = 0x6f81c1e426ddf3f9;
430    pub const GET_ATTACHED_PROCESSES: u64 = 0x4a07b086a7deda56;
431    pub const ATTACH_TO: u64 = 0x2800c757fe52795f;
432    pub const GET_PROCESS_INFO: u64 = 0x4daf0a7366bb6d77;
433    pub const GET_MINIDUMPS: u64 = 0x4a4693aeecdb7deb;
434    pub const ON_FATAL_EXCEPTION: u64 = 0x254b534a4790d114;
435}
436
437pub mod launcher_ordinals {
438    pub const LAUNCH: u64 = 0x54420f44e79e5c0e;
439    pub const GET_AGENTS: u64 = 0x4e6a35bfa35ee8f4;
440}
441
442pub mod minidump_iterator_ordinals {
443    pub const GET_NEXT: u64 = 0x3db055b61b8482dc;
444}
445
446pub mod process_info_iterator_ordinals {
447    pub const GET_NEXT: u64 = 0x527e289fe635bcc;
448}
449
450mod internal {
451    use super::*;
452    unsafe impl fidl::encoding::TypeMarker for FilterError {
453        type Owned = Self;
454
455        #[inline(always)]
456        fn inline_align(_context: fidl::encoding::Context) -> usize {
457            std::mem::align_of::<u32>()
458        }
459
460        #[inline(always)]
461        fn inline_size(_context: fidl::encoding::Context) -> usize {
462            std::mem::size_of::<u32>()
463        }
464
465        #[inline(always)]
466        fn encode_is_copy() -> bool {
467            false
468        }
469
470        #[inline(always)]
471        fn decode_is_copy() -> bool {
472            false
473        }
474    }
475
476    impl fidl::encoding::ValueTypeMarker for FilterError {
477        type Borrowed<'a> = Self;
478        #[inline(always)]
479        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
480            *value
481        }
482    }
483
484    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilterError {
485        #[inline]
486        unsafe fn encode(
487            self,
488            encoder: &mut fidl::encoding::Encoder<'_, D>,
489            offset: usize,
490            _depth: fidl::encoding::Depth,
491        ) -> fidl::Result<()> {
492            encoder.debug_check_bounds::<Self>(offset);
493            encoder.write_num(self.into_primitive(), offset);
494            Ok(())
495        }
496    }
497
498    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilterError {
499        #[inline(always)]
500        fn new_empty() -> Self {
501            Self::unknown()
502        }
503
504        #[inline]
505        unsafe fn decode(
506            &mut self,
507            decoder: &mut fidl::encoding::Decoder<'_, D>,
508            offset: usize,
509            _depth: fidl::encoding::Depth,
510        ) -> fidl::Result<()> {
511            decoder.debug_check_bounds::<Self>(offset);
512            let prim = decoder.read_num::<u32>(offset);
513
514            *self = Self::from_primitive_allow_unknown(prim);
515            Ok(())
516        }
517    }
518    unsafe impl fidl::encoding::TypeMarker for FilterType {
519        type Owned = Self;
520
521        #[inline(always)]
522        fn inline_align(_context: fidl::encoding::Context) -> usize {
523            std::mem::align_of::<u8>()
524        }
525
526        #[inline(always)]
527        fn inline_size(_context: fidl::encoding::Context) -> usize {
528            std::mem::size_of::<u8>()
529        }
530
531        #[inline(always)]
532        fn encode_is_copy() -> bool {
533            false
534        }
535
536        #[inline(always)]
537        fn decode_is_copy() -> bool {
538            false
539        }
540    }
541
542    impl fidl::encoding::ValueTypeMarker for FilterType {
543        type Borrowed<'a> = Self;
544        #[inline(always)]
545        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
546            *value
547        }
548    }
549
550    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilterType {
551        #[inline]
552        unsafe fn encode(
553            self,
554            encoder: &mut fidl::encoding::Encoder<'_, D>,
555            offset: usize,
556            _depth: fidl::encoding::Depth,
557        ) -> fidl::Result<()> {
558            encoder.debug_check_bounds::<Self>(offset);
559            encoder.write_num(self.into_primitive(), offset);
560            Ok(())
561        }
562    }
563
564    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilterType {
565        #[inline(always)]
566        fn new_empty() -> Self {
567            Self::unknown()
568        }
569
570        #[inline]
571        unsafe fn decode(
572            &mut self,
573            decoder: &mut fidl::encoding::Decoder<'_, D>,
574            offset: usize,
575            _depth: fidl::encoding::Depth,
576        ) -> fidl::Result<()> {
577            decoder.debug_check_bounds::<Self>(offset);
578            let prim = decoder.read_num::<u8>(offset);
579
580            *self = Self::from_primitive_allow_unknown(prim);
581            Ok(())
582        }
583    }
584    unsafe impl fidl::encoding::TypeMarker for MinidumpError {
585        type Owned = Self;
586
587        #[inline(always)]
588        fn inline_align(_context: fidl::encoding::Context) -> usize {
589            std::mem::align_of::<u32>()
590        }
591
592        #[inline(always)]
593        fn inline_size(_context: fidl::encoding::Context) -> usize {
594            std::mem::size_of::<u32>()
595        }
596
597        #[inline(always)]
598        fn encode_is_copy() -> bool {
599            false
600        }
601
602        #[inline(always)]
603        fn decode_is_copy() -> bool {
604            false
605        }
606    }
607
608    impl fidl::encoding::ValueTypeMarker for MinidumpError {
609        type Borrowed<'a> = Self;
610        #[inline(always)]
611        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
612            *value
613        }
614    }
615
616    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for MinidumpError {
617        #[inline]
618        unsafe fn encode(
619            self,
620            encoder: &mut fidl::encoding::Encoder<'_, D>,
621            offset: usize,
622            _depth: fidl::encoding::Depth,
623        ) -> fidl::Result<()> {
624            encoder.debug_check_bounds::<Self>(offset);
625            encoder.write_num(self.into_primitive(), offset);
626            Ok(())
627        }
628    }
629
630    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MinidumpError {
631        #[inline(always)]
632        fn new_empty() -> Self {
633            Self::unknown()
634        }
635
636        #[inline]
637        unsafe fn decode(
638            &mut self,
639            decoder: &mut fidl::encoding::Decoder<'_, D>,
640            offset: usize,
641            _depth: fidl::encoding::Depth,
642        ) -> fidl::Result<()> {
643            decoder.debug_check_bounds::<Self>(offset);
644            let prim = decoder.read_num::<u32>(offset);
645
646            *self = Self::from_primitive_allow_unknown(prim);
647            Ok(())
648        }
649    }
650    unsafe impl fidl::encoding::TypeMarker for ProcessInfoError {
651        type Owned = Self;
652
653        #[inline(always)]
654        fn inline_align(_context: fidl::encoding::Context) -> usize {
655            std::mem::align_of::<u32>()
656        }
657
658        #[inline(always)]
659        fn inline_size(_context: fidl::encoding::Context) -> usize {
660            std::mem::size_of::<u32>()
661        }
662
663        #[inline(always)]
664        fn encode_is_copy() -> bool {
665            false
666        }
667
668        #[inline(always)]
669        fn decode_is_copy() -> bool {
670            false
671        }
672    }
673
674    impl fidl::encoding::ValueTypeMarker for ProcessInfoError {
675        type Borrowed<'a> = Self;
676        #[inline(always)]
677        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
678            *value
679        }
680    }
681
682    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
683        for ProcessInfoError
684    {
685        #[inline]
686        unsafe fn encode(
687            self,
688            encoder: &mut fidl::encoding::Encoder<'_, D>,
689            offset: usize,
690            _depth: fidl::encoding::Depth,
691        ) -> fidl::Result<()> {
692            encoder.debug_check_bounds::<Self>(offset);
693            encoder.write_num(self.into_primitive(), offset);
694            Ok(())
695        }
696    }
697
698    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProcessInfoError {
699        #[inline(always)]
700        fn new_empty() -> Self {
701            Self::unknown()
702        }
703
704        #[inline]
705        unsafe fn decode(
706            &mut self,
707            decoder: &mut fidl::encoding::Decoder<'_, D>,
708            offset: usize,
709            _depth: fidl::encoding::Depth,
710        ) -> fidl::Result<()> {
711            decoder.debug_check_bounds::<Self>(offset);
712            let prim = decoder.read_num::<u32>(offset);
713
714            *self = Self::from_primitive_allow_unknown(prim);
715            Ok(())
716        }
717    }
718
719    impl fidl::encoding::ValueTypeMarker for AttachedProcessIteratorGetNextResponse {
720        type Borrowed<'a> = &'a Self;
721        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
722            value
723        }
724    }
725
726    unsafe impl fidl::encoding::TypeMarker for AttachedProcessIteratorGetNextResponse {
727        type Owned = Self;
728
729        #[inline(always)]
730        fn inline_align(_context: fidl::encoding::Context) -> usize {
731            8
732        }
733
734        #[inline(always)]
735        fn inline_size(_context: fidl::encoding::Context) -> usize {
736            16
737        }
738    }
739
740    unsafe impl<D: fidl::encoding::ResourceDialect>
741        fidl::encoding::Encode<AttachedProcessIteratorGetNextResponse, D>
742        for &AttachedProcessIteratorGetNextResponse
743    {
744        #[inline]
745        unsafe fn encode(
746            self,
747            encoder: &mut fidl::encoding::Encoder<'_, D>,
748            offset: usize,
749            _depth: fidl::encoding::Depth,
750        ) -> fidl::Result<()> {
751            encoder.debug_check_bounds::<AttachedProcessIteratorGetNextResponse>(offset);
752            // Delegate to tuple encoding.
753            fidl::encoding::Encode::<AttachedProcessIteratorGetNextResponse, D>::encode(
754                (
755                    <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>> as fidl::encoding::ValueTypeMarker>::borrow(&self.process_names),
756                ),
757                encoder, offset, _depth
758            )
759        }
760    }
761    unsafe impl<
762            D: fidl::encoding::ResourceDialect,
763            T0: fidl::encoding::Encode<
764                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>>,
765                D,
766            >,
767        > fidl::encoding::Encode<AttachedProcessIteratorGetNextResponse, D> for (T0,)
768    {
769        #[inline]
770        unsafe fn encode(
771            self,
772            encoder: &mut fidl::encoding::Encoder<'_, D>,
773            offset: usize,
774            depth: fidl::encoding::Depth,
775        ) -> fidl::Result<()> {
776            encoder.debug_check_bounds::<AttachedProcessIteratorGetNextResponse>(offset);
777            // Zero out padding regions. There's no need to apply masks
778            // because the unmasked parts will be overwritten by fields.
779            // Write the fields.
780            self.0.encode(encoder, offset + 0, depth)?;
781            Ok(())
782        }
783    }
784
785    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
786        for AttachedProcessIteratorGetNextResponse
787    {
788        #[inline(always)]
789        fn new_empty() -> Self {
790            Self {
791                process_names: fidl::new_empty!(
792                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>>,
793                    D
794                ),
795            }
796        }
797
798        #[inline]
799        unsafe fn decode(
800            &mut self,
801            decoder: &mut fidl::encoding::Decoder<'_, D>,
802            offset: usize,
803            _depth: fidl::encoding::Depth,
804        ) -> fidl::Result<()> {
805            decoder.debug_check_bounds::<Self>(offset);
806            // Verify that padding bytes are zero.
807            fidl::decode!(
808                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>>,
809                D,
810                &mut self.process_names,
811                decoder,
812                offset + 0,
813                _depth
814            )?;
815            Ok(())
816        }
817    }
818
819    impl fidl::encoding::ValueTypeMarker for DebugAgentAttachToResponse {
820        type Borrowed<'a> = &'a Self;
821        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
822            value
823        }
824    }
825
826    unsafe impl fidl::encoding::TypeMarker for DebugAgentAttachToResponse {
827        type Owned = Self;
828
829        #[inline(always)]
830        fn inline_align(_context: fidl::encoding::Context) -> usize {
831            4
832        }
833
834        #[inline(always)]
835        fn inline_size(_context: fidl::encoding::Context) -> usize {
836            4
837        }
838        #[inline(always)]
839        fn encode_is_copy() -> bool {
840            true
841        }
842
843        #[inline(always)]
844        fn decode_is_copy() -> bool {
845            true
846        }
847    }
848
849    unsafe impl<D: fidl::encoding::ResourceDialect>
850        fidl::encoding::Encode<DebugAgentAttachToResponse, D> for &DebugAgentAttachToResponse
851    {
852        #[inline]
853        unsafe fn encode(
854            self,
855            encoder: &mut fidl::encoding::Encoder<'_, D>,
856            offset: usize,
857            _depth: fidl::encoding::Depth,
858        ) -> fidl::Result<()> {
859            encoder.debug_check_bounds::<DebugAgentAttachToResponse>(offset);
860            unsafe {
861                // Copy the object into the buffer.
862                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
863                (buf_ptr as *mut DebugAgentAttachToResponse)
864                    .write_unaligned((self as *const DebugAgentAttachToResponse).read());
865                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
866                // done second because the memcpy will write garbage to these bytes.
867            }
868            Ok(())
869        }
870    }
871    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
872        fidl::encoding::Encode<DebugAgentAttachToResponse, D> for (T0,)
873    {
874        #[inline]
875        unsafe fn encode(
876            self,
877            encoder: &mut fidl::encoding::Encoder<'_, D>,
878            offset: usize,
879            depth: fidl::encoding::Depth,
880        ) -> fidl::Result<()> {
881            encoder.debug_check_bounds::<DebugAgentAttachToResponse>(offset);
882            // Zero out padding regions. There's no need to apply masks
883            // because the unmasked parts will be overwritten by fields.
884            // Write the fields.
885            self.0.encode(encoder, offset + 0, depth)?;
886            Ok(())
887        }
888    }
889
890    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
891        for DebugAgentAttachToResponse
892    {
893        #[inline(always)]
894        fn new_empty() -> Self {
895            Self { num_matches: fidl::new_empty!(u32, D) }
896        }
897
898        #[inline]
899        unsafe fn decode(
900            &mut self,
901            decoder: &mut fidl::encoding::Decoder<'_, D>,
902            offset: usize,
903            _depth: fidl::encoding::Depth,
904        ) -> fidl::Result<()> {
905            decoder.debug_check_bounds::<Self>(offset);
906            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
907            // Verify that padding bytes are zero.
908            // Copy from the buffer into the object.
909            unsafe {
910                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
911            }
912            Ok(())
913        }
914    }
915
916    impl fidl::encoding::ValueTypeMarker for Filter {
917        type Borrowed<'a> = &'a Self;
918        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
919            value
920        }
921    }
922
923    unsafe impl fidl::encoding::TypeMarker for Filter {
924        type Owned = Self;
925
926        #[inline(always)]
927        fn inline_align(_context: fidl::encoding::Context) -> usize {
928            8
929        }
930
931        #[inline(always)]
932        fn inline_size(_context: fidl::encoding::Context) -> usize {
933            40
934        }
935    }
936
937    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Filter, D> for &Filter {
938        #[inline]
939        unsafe fn encode(
940            self,
941            encoder: &mut fidl::encoding::Encoder<'_, D>,
942            offset: usize,
943            _depth: fidl::encoding::Depth,
944        ) -> fidl::Result<()> {
945            encoder.debug_check_bounds::<Filter>(offset);
946            // Delegate to tuple encoding.
947            fidl::encoding::Encode::<Filter, D>::encode(
948                (
949                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
950                        &self.pattern,
951                    ),
952                    <FilterType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
953                    <FilterOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
954                ),
955                encoder,
956                offset,
957                _depth,
958            )
959        }
960    }
961    unsafe impl<
962            D: fidl::encoding::ResourceDialect,
963            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
964            T1: fidl::encoding::Encode<FilterType, D>,
965            T2: fidl::encoding::Encode<FilterOptions, D>,
966        > fidl::encoding::Encode<Filter, D> for (T0, T1, T2)
967    {
968        #[inline]
969        unsafe fn encode(
970            self,
971            encoder: &mut fidl::encoding::Encoder<'_, D>,
972            offset: usize,
973            depth: fidl::encoding::Depth,
974        ) -> fidl::Result<()> {
975            encoder.debug_check_bounds::<Filter>(offset);
976            // Zero out padding regions. There's no need to apply masks
977            // because the unmasked parts will be overwritten by fields.
978            unsafe {
979                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
980                (ptr as *mut u64).write_unaligned(0);
981            }
982            // Write the fields.
983            self.0.encode(encoder, offset + 0, depth)?;
984            self.1.encode(encoder, offset + 16, depth)?;
985            self.2.encode(encoder, offset + 24, depth)?;
986            Ok(())
987        }
988    }
989
990    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Filter {
991        #[inline(always)]
992        fn new_empty() -> Self {
993            Self {
994                pattern: fidl::new_empty!(fidl::encoding::UnboundedString, D),
995                type_: fidl::new_empty!(FilterType, D),
996                options: fidl::new_empty!(FilterOptions, D),
997            }
998        }
999
1000        #[inline]
1001        unsafe fn decode(
1002            &mut self,
1003            decoder: &mut fidl::encoding::Decoder<'_, D>,
1004            offset: usize,
1005            _depth: fidl::encoding::Depth,
1006        ) -> fidl::Result<()> {
1007            decoder.debug_check_bounds::<Self>(offset);
1008            // Verify that padding bytes are zero.
1009            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1010            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1011            let mask = 0xffffffffffffff00u64;
1012            let maskedval = padval & mask;
1013            if maskedval != 0 {
1014                return Err(fidl::Error::NonZeroPadding {
1015                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1016                });
1017            }
1018            fidl::decode!(
1019                fidl::encoding::UnboundedString,
1020                D,
1021                &mut self.pattern,
1022                decoder,
1023                offset + 0,
1024                _depth
1025            )?;
1026            fidl::decode!(FilterType, D, &mut self.type_, decoder, offset + 16, _depth)?;
1027            fidl::decode!(FilterOptions, D, &mut self.options, decoder, offset + 24, _depth)?;
1028            Ok(())
1029        }
1030    }
1031
1032    impl fidl::encoding::ValueTypeMarker for ProcessInfo {
1033        type Borrowed<'a> = &'a Self;
1034        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1035            value
1036        }
1037    }
1038
1039    unsafe impl fidl::encoding::TypeMarker for ProcessInfo {
1040        type Owned = Self;
1041
1042        #[inline(always)]
1043        fn inline_align(_context: fidl::encoding::Context) -> usize {
1044            8
1045        }
1046
1047        #[inline(always)]
1048        fn inline_size(_context: fidl::encoding::Context) -> usize {
1049            48
1050        }
1051    }
1052
1053    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProcessInfo, D>
1054        for &ProcessInfo
1055    {
1056        #[inline]
1057        unsafe fn encode(
1058            self,
1059            encoder: &mut fidl::encoding::Encoder<'_, D>,
1060            offset: usize,
1061            _depth: fidl::encoding::Depth,
1062        ) -> fidl::Result<()> {
1063            encoder.debug_check_bounds::<ProcessInfo>(offset);
1064            // Delegate to tuple encoding.
1065            fidl::encoding::Encode::<ProcessInfo, D>::encode(
1066                (
1067                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.process),
1068                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
1069                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.thread),
1070                    <ThreadDetails as fidl::encoding::ValueTypeMarker>::borrow(&self.details),
1071                ),
1072                encoder, offset, _depth
1073            )
1074        }
1075    }
1076    unsafe impl<
1077            D: fidl::encoding::ResourceDialect,
1078            T0: fidl::encoding::Encode<u64, D>,
1079            T1: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
1080            T2: fidl::encoding::Encode<u64, D>,
1081            T3: fidl::encoding::Encode<ThreadDetails, D>,
1082        > fidl::encoding::Encode<ProcessInfo, D> for (T0, T1, T2, T3)
1083    {
1084        #[inline]
1085        unsafe fn encode(
1086            self,
1087            encoder: &mut fidl::encoding::Encoder<'_, D>,
1088            offset: usize,
1089            depth: fidl::encoding::Depth,
1090        ) -> fidl::Result<()> {
1091            encoder.debug_check_bounds::<ProcessInfo>(offset);
1092            // Zero out padding regions. There's no need to apply masks
1093            // because the unmasked parts will be overwritten by fields.
1094            // Write the fields.
1095            self.0.encode(encoder, offset + 0, depth)?;
1096            self.1.encode(encoder, offset + 8, depth)?;
1097            self.2.encode(encoder, offset + 24, depth)?;
1098            self.3.encode(encoder, offset + 32, depth)?;
1099            Ok(())
1100        }
1101    }
1102
1103    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProcessInfo {
1104        #[inline(always)]
1105        fn new_empty() -> Self {
1106            Self {
1107                process: fidl::new_empty!(u64, D),
1108                moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
1109                thread: fidl::new_empty!(u64, D),
1110                details: fidl::new_empty!(ThreadDetails, D),
1111            }
1112        }
1113
1114        #[inline]
1115        unsafe fn decode(
1116            &mut self,
1117            decoder: &mut fidl::encoding::Decoder<'_, D>,
1118            offset: usize,
1119            _depth: fidl::encoding::Depth,
1120        ) -> fidl::Result<()> {
1121            decoder.debug_check_bounds::<Self>(offset);
1122            // Verify that padding bytes are zero.
1123            fidl::decode!(u64, D, &mut self.process, decoder, offset + 0, _depth)?;
1124            fidl::decode!(
1125                fidl::encoding::BoundedString<4096>,
1126                D,
1127                &mut self.moniker,
1128                decoder,
1129                offset + 8,
1130                _depth
1131            )?;
1132            fidl::decode!(u64, D, &mut self.thread, decoder, offset + 24, _depth)?;
1133            fidl::decode!(ThreadDetails, D, &mut self.details, decoder, offset + 32, _depth)?;
1134            Ok(())
1135        }
1136    }
1137
1138    impl fidl::encoding::ValueTypeMarker for ProcessInfoIteratorGetNextResponse {
1139        type Borrowed<'a> = &'a Self;
1140        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1141            value
1142        }
1143    }
1144
1145    unsafe impl fidl::encoding::TypeMarker for ProcessInfoIteratorGetNextResponse {
1146        type Owned = Self;
1147
1148        #[inline(always)]
1149        fn inline_align(_context: fidl::encoding::Context) -> usize {
1150            8
1151        }
1152
1153        #[inline(always)]
1154        fn inline_size(_context: fidl::encoding::Context) -> usize {
1155            16
1156        }
1157    }
1158
1159    unsafe impl<D: fidl::encoding::ResourceDialect>
1160        fidl::encoding::Encode<ProcessInfoIteratorGetNextResponse, D>
1161        for &ProcessInfoIteratorGetNextResponse
1162    {
1163        #[inline]
1164        unsafe fn encode(
1165            self,
1166            encoder: &mut fidl::encoding::Encoder<'_, D>,
1167            offset: usize,
1168            _depth: fidl::encoding::Depth,
1169        ) -> fidl::Result<()> {
1170            encoder.debug_check_bounds::<ProcessInfoIteratorGetNextResponse>(offset);
1171            // Delegate to tuple encoding.
1172            fidl::encoding::Encode::<ProcessInfoIteratorGetNextResponse, D>::encode(
1173                (
1174                    <fidl::encoding::UnboundedVector<ProcessInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1175                ),
1176                encoder, offset, _depth
1177            )
1178        }
1179    }
1180    unsafe impl<
1181            D: fidl::encoding::ResourceDialect,
1182            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<ProcessInfo>, D>,
1183        > fidl::encoding::Encode<ProcessInfoIteratorGetNextResponse, D> for (T0,)
1184    {
1185        #[inline]
1186        unsafe fn encode(
1187            self,
1188            encoder: &mut fidl::encoding::Encoder<'_, D>,
1189            offset: usize,
1190            depth: fidl::encoding::Depth,
1191        ) -> fidl::Result<()> {
1192            encoder.debug_check_bounds::<ProcessInfoIteratorGetNextResponse>(offset);
1193            // Zero out padding regions. There's no need to apply masks
1194            // because the unmasked parts will be overwritten by fields.
1195            // Write the fields.
1196            self.0.encode(encoder, offset + 0, depth)?;
1197            Ok(())
1198        }
1199    }
1200
1201    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1202        for ProcessInfoIteratorGetNextResponse
1203    {
1204        #[inline(always)]
1205        fn new_empty() -> Self {
1206            Self { info: fidl::new_empty!(fidl::encoding::UnboundedVector<ProcessInfo>, D) }
1207        }
1208
1209        #[inline]
1210        unsafe fn decode(
1211            &mut self,
1212            decoder: &mut fidl::encoding::Decoder<'_, D>,
1213            offset: usize,
1214            _depth: fidl::encoding::Depth,
1215        ) -> fidl::Result<()> {
1216            decoder.debug_check_bounds::<Self>(offset);
1217            // Verify that padding bytes are zero.
1218            fidl::decode!(
1219                fidl::encoding::UnboundedVector<ProcessInfo>,
1220                D,
1221                &mut self.info,
1222                decoder,
1223                offset + 0,
1224                _depth
1225            )?;
1226            Ok(())
1227        }
1228    }
1229
1230    impl DebugAgentOnFatalExceptionRequest {
1231        #[inline(always)]
1232        fn max_ordinal_present(&self) -> u64 {
1233            if let Some(_) = self.backtrace {
1234                return 2;
1235            }
1236            if let Some(_) = self.thread {
1237                return 1;
1238            }
1239            0
1240        }
1241    }
1242
1243    impl fidl::encoding::ValueTypeMarker for DebugAgentOnFatalExceptionRequest {
1244        type Borrowed<'a> = &'a Self;
1245        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1246            value
1247        }
1248    }
1249
1250    unsafe impl fidl::encoding::TypeMarker for DebugAgentOnFatalExceptionRequest {
1251        type Owned = Self;
1252
1253        #[inline(always)]
1254        fn inline_align(_context: fidl::encoding::Context) -> usize {
1255            8
1256        }
1257
1258        #[inline(always)]
1259        fn inline_size(_context: fidl::encoding::Context) -> usize {
1260            16
1261        }
1262    }
1263
1264    unsafe impl<D: fidl::encoding::ResourceDialect>
1265        fidl::encoding::Encode<DebugAgentOnFatalExceptionRequest, D>
1266        for &DebugAgentOnFatalExceptionRequest
1267    {
1268        unsafe fn encode(
1269            self,
1270            encoder: &mut fidl::encoding::Encoder<'_, D>,
1271            offset: usize,
1272            mut depth: fidl::encoding::Depth,
1273        ) -> fidl::Result<()> {
1274            encoder.debug_check_bounds::<DebugAgentOnFatalExceptionRequest>(offset);
1275            // Vector header
1276            let max_ordinal: u64 = self.max_ordinal_present();
1277            encoder.write_num(max_ordinal, offset);
1278            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1279            // Calling encoder.out_of_line_offset(0) is not allowed.
1280            if max_ordinal == 0 {
1281                return Ok(());
1282            }
1283            depth.increment()?;
1284            let envelope_size = 8;
1285            let bytes_len = max_ordinal as usize * envelope_size;
1286            #[allow(unused_variables)]
1287            let offset = encoder.out_of_line_offset(bytes_len);
1288            let mut _prev_end_offset: usize = 0;
1289            if 1 > max_ordinal {
1290                return Ok(());
1291            }
1292
1293            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1294            // are envelope_size bytes.
1295            let cur_offset: usize = (1 - 1) * envelope_size;
1296
1297            // Zero reserved fields.
1298            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1299
1300            // Safety:
1301            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1302            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1303            //   envelope_size bytes, there is always sufficient room.
1304            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1305                self.thread.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1306                encoder,
1307                offset + cur_offset,
1308                depth,
1309            )?;
1310
1311            _prev_end_offset = cur_offset + envelope_size;
1312            if 2 > max_ordinal {
1313                return Ok(());
1314            }
1315
1316            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1317            // are envelope_size bytes.
1318            let cur_offset: usize = (2 - 1) * envelope_size;
1319
1320            // Zero reserved fields.
1321            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1322
1323            // Safety:
1324            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1325            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1326            //   envelope_size bytes, there is always sufficient room.
1327            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
1328                self.backtrace.as_ref().map(
1329                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
1330                ),
1331                encoder,
1332                offset + cur_offset,
1333                depth,
1334            )?;
1335
1336            _prev_end_offset = cur_offset + envelope_size;
1337
1338            Ok(())
1339        }
1340    }
1341
1342    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1343        for DebugAgentOnFatalExceptionRequest
1344    {
1345        #[inline(always)]
1346        fn new_empty() -> Self {
1347            Self::default()
1348        }
1349
1350        unsafe fn decode(
1351            &mut self,
1352            decoder: &mut fidl::encoding::Decoder<'_, D>,
1353            offset: usize,
1354            mut depth: fidl::encoding::Depth,
1355        ) -> fidl::Result<()> {
1356            decoder.debug_check_bounds::<Self>(offset);
1357            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1358                None => return Err(fidl::Error::NotNullable),
1359                Some(len) => len,
1360            };
1361            // Calling decoder.out_of_line_offset(0) is not allowed.
1362            if len == 0 {
1363                return Ok(());
1364            };
1365            depth.increment()?;
1366            let envelope_size = 8;
1367            let bytes_len = len * envelope_size;
1368            let offset = decoder.out_of_line_offset(bytes_len)?;
1369            // Decode the envelope for each type.
1370            let mut _next_ordinal_to_read = 0;
1371            let mut next_offset = offset;
1372            let end_offset = offset + bytes_len;
1373            _next_ordinal_to_read += 1;
1374            if next_offset >= end_offset {
1375                return Ok(());
1376            }
1377
1378            // Decode unknown envelopes for gaps in ordinals.
1379            while _next_ordinal_to_read < 1 {
1380                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1381                _next_ordinal_to_read += 1;
1382                next_offset += envelope_size;
1383            }
1384
1385            let next_out_of_line = decoder.next_out_of_line();
1386            let handles_before = decoder.remaining_handles();
1387            if let Some((inlined, num_bytes, num_handles)) =
1388                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1389            {
1390                let member_inline_size =
1391                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1392                if inlined != (member_inline_size <= 4) {
1393                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1394                }
1395                let inner_offset;
1396                let mut inner_depth = depth.clone();
1397                if inlined {
1398                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1399                    inner_offset = next_offset;
1400                } else {
1401                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1402                    inner_depth.increment()?;
1403                }
1404                let val_ref = self.thread.get_or_insert_with(|| fidl::new_empty!(u64, D));
1405                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
1406                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1407                {
1408                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1409                }
1410                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1411                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1412                }
1413            }
1414
1415            next_offset += envelope_size;
1416            _next_ordinal_to_read += 1;
1417            if next_offset >= end_offset {
1418                return Ok(());
1419            }
1420
1421            // Decode unknown envelopes for gaps in ordinals.
1422            while _next_ordinal_to_read < 2 {
1423                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1424                _next_ordinal_to_read += 1;
1425                next_offset += envelope_size;
1426            }
1427
1428            let next_out_of_line = decoder.next_out_of_line();
1429            let handles_before = decoder.remaining_handles();
1430            if let Some((inlined, num_bytes, num_handles)) =
1431                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1432            {
1433                let member_inline_size =
1434                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
1435                        decoder.context,
1436                    );
1437                if inlined != (member_inline_size <= 4) {
1438                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1439                }
1440                let inner_offset;
1441                let mut inner_depth = depth.clone();
1442                if inlined {
1443                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1444                    inner_offset = next_offset;
1445                } else {
1446                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1447                    inner_depth.increment()?;
1448                }
1449                let val_ref = self
1450                    .backtrace
1451                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
1452                fidl::decode!(
1453                    fidl::encoding::UnboundedString,
1454                    D,
1455                    val_ref,
1456                    decoder,
1457                    inner_offset,
1458                    inner_depth
1459                )?;
1460                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1461                {
1462                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1463                }
1464                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1465                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1466                }
1467            }
1468
1469            next_offset += envelope_size;
1470
1471            // Decode the remaining unknown envelopes.
1472            while next_offset < end_offset {
1473                _next_ordinal_to_read += 1;
1474                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1475                next_offset += envelope_size;
1476            }
1477
1478            Ok(())
1479        }
1480    }
1481
1482    impl FilterOptions {
1483        #[inline(always)]
1484        fn max_ordinal_present(&self) -> u64 {
1485            if let Some(_) = self.job_only {
1486                return 2;
1487            }
1488            if let Some(_) = self.recursive {
1489                return 1;
1490            }
1491            0
1492        }
1493    }
1494
1495    impl fidl::encoding::ValueTypeMarker for FilterOptions {
1496        type Borrowed<'a> = &'a Self;
1497        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1498            value
1499        }
1500    }
1501
1502    unsafe impl fidl::encoding::TypeMarker for FilterOptions {
1503        type Owned = Self;
1504
1505        #[inline(always)]
1506        fn inline_align(_context: fidl::encoding::Context) -> usize {
1507            8
1508        }
1509
1510        #[inline(always)]
1511        fn inline_size(_context: fidl::encoding::Context) -> usize {
1512            16
1513        }
1514    }
1515
1516    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FilterOptions, D>
1517        for &FilterOptions
1518    {
1519        unsafe fn encode(
1520            self,
1521            encoder: &mut fidl::encoding::Encoder<'_, D>,
1522            offset: usize,
1523            mut depth: fidl::encoding::Depth,
1524        ) -> fidl::Result<()> {
1525            encoder.debug_check_bounds::<FilterOptions>(offset);
1526            // Vector header
1527            let max_ordinal: u64 = self.max_ordinal_present();
1528            encoder.write_num(max_ordinal, offset);
1529            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1530            // Calling encoder.out_of_line_offset(0) is not allowed.
1531            if max_ordinal == 0 {
1532                return Ok(());
1533            }
1534            depth.increment()?;
1535            let envelope_size = 8;
1536            let bytes_len = max_ordinal as usize * envelope_size;
1537            #[allow(unused_variables)]
1538            let offset = encoder.out_of_line_offset(bytes_len);
1539            let mut _prev_end_offset: usize = 0;
1540            if 1 > max_ordinal {
1541                return Ok(());
1542            }
1543
1544            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1545            // are envelope_size bytes.
1546            let cur_offset: usize = (1 - 1) * envelope_size;
1547
1548            // Zero reserved fields.
1549            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1550
1551            // Safety:
1552            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1553            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1554            //   envelope_size bytes, there is always sufficient room.
1555            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1556                self.recursive.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1557                encoder,
1558                offset + cur_offset,
1559                depth,
1560            )?;
1561
1562            _prev_end_offset = cur_offset + envelope_size;
1563            if 2 > max_ordinal {
1564                return Ok(());
1565            }
1566
1567            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1568            // are envelope_size bytes.
1569            let cur_offset: usize = (2 - 1) * envelope_size;
1570
1571            // Zero reserved fields.
1572            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1573
1574            // Safety:
1575            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1576            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1577            //   envelope_size bytes, there is always sufficient room.
1578            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1579                self.job_only.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1580                encoder,
1581                offset + cur_offset,
1582                depth,
1583            )?;
1584
1585            _prev_end_offset = cur_offset + envelope_size;
1586
1587            Ok(())
1588        }
1589    }
1590
1591    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilterOptions {
1592        #[inline(always)]
1593        fn new_empty() -> Self {
1594            Self::default()
1595        }
1596
1597        unsafe fn decode(
1598            &mut self,
1599            decoder: &mut fidl::encoding::Decoder<'_, D>,
1600            offset: usize,
1601            mut depth: fidl::encoding::Depth,
1602        ) -> fidl::Result<()> {
1603            decoder.debug_check_bounds::<Self>(offset);
1604            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1605                None => return Err(fidl::Error::NotNullable),
1606                Some(len) => len,
1607            };
1608            // Calling decoder.out_of_line_offset(0) is not allowed.
1609            if len == 0 {
1610                return Ok(());
1611            };
1612            depth.increment()?;
1613            let envelope_size = 8;
1614            let bytes_len = len * envelope_size;
1615            let offset = decoder.out_of_line_offset(bytes_len)?;
1616            // Decode the envelope for each type.
1617            let mut _next_ordinal_to_read = 0;
1618            let mut next_offset = offset;
1619            let end_offset = offset + bytes_len;
1620            _next_ordinal_to_read += 1;
1621            if next_offset >= end_offset {
1622                return Ok(());
1623            }
1624
1625            // Decode unknown envelopes for gaps in ordinals.
1626            while _next_ordinal_to_read < 1 {
1627                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1628                _next_ordinal_to_read += 1;
1629                next_offset += envelope_size;
1630            }
1631
1632            let next_out_of_line = decoder.next_out_of_line();
1633            let handles_before = decoder.remaining_handles();
1634            if let Some((inlined, num_bytes, num_handles)) =
1635                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1636            {
1637                let member_inline_size =
1638                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1639                if inlined != (member_inline_size <= 4) {
1640                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1641                }
1642                let inner_offset;
1643                let mut inner_depth = depth.clone();
1644                if inlined {
1645                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1646                    inner_offset = next_offset;
1647                } else {
1648                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1649                    inner_depth.increment()?;
1650                }
1651                let val_ref = self.recursive.get_or_insert_with(|| fidl::new_empty!(bool, D));
1652                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1653                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1654                {
1655                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1656                }
1657                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1658                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1659                }
1660            }
1661
1662            next_offset += envelope_size;
1663            _next_ordinal_to_read += 1;
1664            if next_offset >= end_offset {
1665                return Ok(());
1666            }
1667
1668            // Decode unknown envelopes for gaps in ordinals.
1669            while _next_ordinal_to_read < 2 {
1670                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1671                _next_ordinal_to_read += 1;
1672                next_offset += envelope_size;
1673            }
1674
1675            let next_out_of_line = decoder.next_out_of_line();
1676            let handles_before = decoder.remaining_handles();
1677            if let Some((inlined, num_bytes, num_handles)) =
1678                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1679            {
1680                let member_inline_size =
1681                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1682                if inlined != (member_inline_size <= 4) {
1683                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1684                }
1685                let inner_offset;
1686                let mut inner_depth = depth.clone();
1687                if inlined {
1688                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1689                    inner_offset = next_offset;
1690                } else {
1691                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1692                    inner_depth.increment()?;
1693                }
1694                let val_ref = self.job_only.get_or_insert_with(|| fidl::new_empty!(bool, D));
1695                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1696                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1697                {
1698                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1699                }
1700                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1701                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1702                }
1703            }
1704
1705            next_offset += envelope_size;
1706
1707            // Decode the remaining unknown envelopes.
1708            while next_offset < end_offset {
1709                _next_ordinal_to_read += 1;
1710                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1711                next_offset += envelope_size;
1712            }
1713
1714            Ok(())
1715        }
1716    }
1717
1718    impl GetProcessInfoOptions {
1719        #[inline(always)]
1720        fn max_ordinal_present(&self) -> u64 {
1721            if let Some(_) = self.interest {
1722                return 2;
1723            }
1724            if let Some(_) = self.filter {
1725                return 1;
1726            }
1727            0
1728        }
1729    }
1730
1731    impl fidl::encoding::ValueTypeMarker for GetProcessInfoOptions {
1732        type Borrowed<'a> = &'a Self;
1733        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1734            value
1735        }
1736    }
1737
1738    unsafe impl fidl::encoding::TypeMarker for GetProcessInfoOptions {
1739        type Owned = Self;
1740
1741        #[inline(always)]
1742        fn inline_align(_context: fidl::encoding::Context) -> usize {
1743            8
1744        }
1745
1746        #[inline(always)]
1747        fn inline_size(_context: fidl::encoding::Context) -> usize {
1748            16
1749        }
1750    }
1751
1752    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GetProcessInfoOptions, D>
1753        for &GetProcessInfoOptions
1754    {
1755        unsafe fn encode(
1756            self,
1757            encoder: &mut fidl::encoding::Encoder<'_, D>,
1758            offset: usize,
1759            mut depth: fidl::encoding::Depth,
1760        ) -> fidl::Result<()> {
1761            encoder.debug_check_bounds::<GetProcessInfoOptions>(offset);
1762            // Vector header
1763            let max_ordinal: u64 = self.max_ordinal_present();
1764            encoder.write_num(max_ordinal, offset);
1765            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1766            // Calling encoder.out_of_line_offset(0) is not allowed.
1767            if max_ordinal == 0 {
1768                return Ok(());
1769            }
1770            depth.increment()?;
1771            let envelope_size = 8;
1772            let bytes_len = max_ordinal as usize * envelope_size;
1773            #[allow(unused_variables)]
1774            let offset = encoder.out_of_line_offset(bytes_len);
1775            let mut _prev_end_offset: usize = 0;
1776            if 1 > max_ordinal {
1777                return Ok(());
1778            }
1779
1780            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1781            // are envelope_size bytes.
1782            let cur_offset: usize = (1 - 1) * envelope_size;
1783
1784            // Zero reserved fields.
1785            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1786
1787            // Safety:
1788            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1789            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1790            //   envelope_size bytes, there is always sufficient room.
1791            fidl::encoding::encode_in_envelope_optional::<Filter, D>(
1792                self.filter.as_ref().map(<Filter as fidl::encoding::ValueTypeMarker>::borrow),
1793                encoder,
1794                offset + cur_offset,
1795                depth,
1796            )?;
1797
1798            _prev_end_offset = cur_offset + envelope_size;
1799            if 2 > max_ordinal {
1800                return Ok(());
1801            }
1802
1803            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1804            // are envelope_size bytes.
1805            let cur_offset: usize = (2 - 1) * envelope_size;
1806
1807            // Zero reserved fields.
1808            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1809
1810            // Safety:
1811            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1812            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1813            //   envelope_size bytes, there is always sufficient room.
1814            fidl::encoding::encode_in_envelope_optional::<ThreadDetailsInterest, D>(
1815                self.interest
1816                    .as_ref()
1817                    .map(<ThreadDetailsInterest as fidl::encoding::ValueTypeMarker>::borrow),
1818                encoder,
1819                offset + cur_offset,
1820                depth,
1821            )?;
1822
1823            _prev_end_offset = cur_offset + envelope_size;
1824
1825            Ok(())
1826        }
1827    }
1828
1829    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetProcessInfoOptions {
1830        #[inline(always)]
1831        fn new_empty() -> Self {
1832            Self::default()
1833        }
1834
1835        unsafe fn decode(
1836            &mut self,
1837            decoder: &mut fidl::encoding::Decoder<'_, D>,
1838            offset: usize,
1839            mut depth: fidl::encoding::Depth,
1840        ) -> fidl::Result<()> {
1841            decoder.debug_check_bounds::<Self>(offset);
1842            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1843                None => return Err(fidl::Error::NotNullable),
1844                Some(len) => len,
1845            };
1846            // Calling decoder.out_of_line_offset(0) is not allowed.
1847            if len == 0 {
1848                return Ok(());
1849            };
1850            depth.increment()?;
1851            let envelope_size = 8;
1852            let bytes_len = len * envelope_size;
1853            let offset = decoder.out_of_line_offset(bytes_len)?;
1854            // Decode the envelope for each type.
1855            let mut _next_ordinal_to_read = 0;
1856            let mut next_offset = offset;
1857            let end_offset = offset + bytes_len;
1858            _next_ordinal_to_read += 1;
1859            if next_offset >= end_offset {
1860                return Ok(());
1861            }
1862
1863            // Decode unknown envelopes for gaps in ordinals.
1864            while _next_ordinal_to_read < 1 {
1865                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1866                _next_ordinal_to_read += 1;
1867                next_offset += envelope_size;
1868            }
1869
1870            let next_out_of_line = decoder.next_out_of_line();
1871            let handles_before = decoder.remaining_handles();
1872            if let Some((inlined, num_bytes, num_handles)) =
1873                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1874            {
1875                let member_inline_size =
1876                    <Filter as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1877                if inlined != (member_inline_size <= 4) {
1878                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1879                }
1880                let inner_offset;
1881                let mut inner_depth = depth.clone();
1882                if inlined {
1883                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1884                    inner_offset = next_offset;
1885                } else {
1886                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1887                    inner_depth.increment()?;
1888                }
1889                let val_ref = self.filter.get_or_insert_with(|| fidl::new_empty!(Filter, D));
1890                fidl::decode!(Filter, D, val_ref, decoder, inner_offset, inner_depth)?;
1891                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1892                {
1893                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1894                }
1895                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1896                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1897                }
1898            }
1899
1900            next_offset += envelope_size;
1901            _next_ordinal_to_read += 1;
1902            if next_offset >= end_offset {
1903                return Ok(());
1904            }
1905
1906            // Decode unknown envelopes for gaps in ordinals.
1907            while _next_ordinal_to_read < 2 {
1908                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1909                _next_ordinal_to_read += 1;
1910                next_offset += envelope_size;
1911            }
1912
1913            let next_out_of_line = decoder.next_out_of_line();
1914            let handles_before = decoder.remaining_handles();
1915            if let Some((inlined, num_bytes, num_handles)) =
1916                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1917            {
1918                let member_inline_size =
1919                    <ThreadDetailsInterest as fidl::encoding::TypeMarker>::inline_size(
1920                        decoder.context,
1921                    );
1922                if inlined != (member_inline_size <= 4) {
1923                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1924                }
1925                let inner_offset;
1926                let mut inner_depth = depth.clone();
1927                if inlined {
1928                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1929                    inner_offset = next_offset;
1930                } else {
1931                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1932                    inner_depth.increment()?;
1933                }
1934                let val_ref =
1935                    self.interest.get_or_insert_with(|| fidl::new_empty!(ThreadDetailsInterest, D));
1936                fidl::decode!(
1937                    ThreadDetailsInterest,
1938                    D,
1939                    val_ref,
1940                    decoder,
1941                    inner_offset,
1942                    inner_depth
1943                )?;
1944                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1945                {
1946                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1947                }
1948                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1949                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1950                }
1951            }
1952
1953            next_offset += envelope_size;
1954
1955            // Decode the remaining unknown envelopes.
1956            while next_offset < end_offset {
1957                _next_ordinal_to_read += 1;
1958                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1959                next_offset += envelope_size;
1960            }
1961
1962            Ok(())
1963        }
1964    }
1965
1966    impl MinidumpOptions {
1967        #[inline(always)]
1968        fn max_ordinal_present(&self) -> u64 {
1969            if let Some(_) = self.filter {
1970                return 1;
1971            }
1972            0
1973        }
1974    }
1975
1976    impl fidl::encoding::ValueTypeMarker for MinidumpOptions {
1977        type Borrowed<'a> = &'a Self;
1978        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1979            value
1980        }
1981    }
1982
1983    unsafe impl fidl::encoding::TypeMarker for MinidumpOptions {
1984        type Owned = Self;
1985
1986        #[inline(always)]
1987        fn inline_align(_context: fidl::encoding::Context) -> usize {
1988            8
1989        }
1990
1991        #[inline(always)]
1992        fn inline_size(_context: fidl::encoding::Context) -> usize {
1993            16
1994        }
1995    }
1996
1997    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MinidumpOptions, D>
1998        for &MinidumpOptions
1999    {
2000        unsafe fn encode(
2001            self,
2002            encoder: &mut fidl::encoding::Encoder<'_, D>,
2003            offset: usize,
2004            mut depth: fidl::encoding::Depth,
2005        ) -> fidl::Result<()> {
2006            encoder.debug_check_bounds::<MinidumpOptions>(offset);
2007            // Vector header
2008            let max_ordinal: u64 = self.max_ordinal_present();
2009            encoder.write_num(max_ordinal, offset);
2010            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2011            // Calling encoder.out_of_line_offset(0) is not allowed.
2012            if max_ordinal == 0 {
2013                return Ok(());
2014            }
2015            depth.increment()?;
2016            let envelope_size = 8;
2017            let bytes_len = max_ordinal as usize * envelope_size;
2018            #[allow(unused_variables)]
2019            let offset = encoder.out_of_line_offset(bytes_len);
2020            let mut _prev_end_offset: usize = 0;
2021            if 1 > max_ordinal {
2022                return Ok(());
2023            }
2024
2025            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2026            // are envelope_size bytes.
2027            let cur_offset: usize = (1 - 1) * envelope_size;
2028
2029            // Zero reserved fields.
2030            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2031
2032            // Safety:
2033            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2034            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2035            //   envelope_size bytes, there is always sufficient room.
2036            fidl::encoding::encode_in_envelope_optional::<Filter, D>(
2037                self.filter.as_ref().map(<Filter as fidl::encoding::ValueTypeMarker>::borrow),
2038                encoder,
2039                offset + cur_offset,
2040                depth,
2041            )?;
2042
2043            _prev_end_offset = cur_offset + envelope_size;
2044
2045            Ok(())
2046        }
2047    }
2048
2049    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MinidumpOptions {
2050        #[inline(always)]
2051        fn new_empty() -> Self {
2052            Self::default()
2053        }
2054
2055        unsafe fn decode(
2056            &mut self,
2057            decoder: &mut fidl::encoding::Decoder<'_, D>,
2058            offset: usize,
2059            mut depth: fidl::encoding::Depth,
2060        ) -> fidl::Result<()> {
2061            decoder.debug_check_bounds::<Self>(offset);
2062            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2063                None => return Err(fidl::Error::NotNullable),
2064                Some(len) => len,
2065            };
2066            // Calling decoder.out_of_line_offset(0) is not allowed.
2067            if len == 0 {
2068                return Ok(());
2069            };
2070            depth.increment()?;
2071            let envelope_size = 8;
2072            let bytes_len = len * envelope_size;
2073            let offset = decoder.out_of_line_offset(bytes_len)?;
2074            // Decode the envelope for each type.
2075            let mut _next_ordinal_to_read = 0;
2076            let mut next_offset = offset;
2077            let end_offset = offset + bytes_len;
2078            _next_ordinal_to_read += 1;
2079            if next_offset >= end_offset {
2080                return Ok(());
2081            }
2082
2083            // Decode unknown envelopes for gaps in ordinals.
2084            while _next_ordinal_to_read < 1 {
2085                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2086                _next_ordinal_to_read += 1;
2087                next_offset += envelope_size;
2088            }
2089
2090            let next_out_of_line = decoder.next_out_of_line();
2091            let handles_before = decoder.remaining_handles();
2092            if let Some((inlined, num_bytes, num_handles)) =
2093                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2094            {
2095                let member_inline_size =
2096                    <Filter as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2097                if inlined != (member_inline_size <= 4) {
2098                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2099                }
2100                let inner_offset;
2101                let mut inner_depth = depth.clone();
2102                if inlined {
2103                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2104                    inner_offset = next_offset;
2105                } else {
2106                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2107                    inner_depth.increment()?;
2108                }
2109                let val_ref = self.filter.get_or_insert_with(|| fidl::new_empty!(Filter, D));
2110                fidl::decode!(Filter, D, val_ref, decoder, inner_offset, inner_depth)?;
2111                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2112                {
2113                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2114                }
2115                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2116                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2117                }
2118            }
2119
2120            next_offset += envelope_size;
2121
2122            // Decode the remaining unknown envelopes.
2123            while next_offset < end_offset {
2124                _next_ordinal_to_read += 1;
2125                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2126                next_offset += envelope_size;
2127            }
2128
2129            Ok(())
2130        }
2131    }
2132
2133    impl ThreadDetails {
2134        #[inline(always)]
2135        fn max_ordinal_present(&self) -> u64 {
2136            if let Some(_) = self.backtrace {
2137                return 1;
2138            }
2139            0
2140        }
2141    }
2142
2143    impl fidl::encoding::ValueTypeMarker for ThreadDetails {
2144        type Borrowed<'a> = &'a Self;
2145        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2146            value
2147        }
2148    }
2149
2150    unsafe impl fidl::encoding::TypeMarker for ThreadDetails {
2151        type Owned = Self;
2152
2153        #[inline(always)]
2154        fn inline_align(_context: fidl::encoding::Context) -> usize {
2155            8
2156        }
2157
2158        #[inline(always)]
2159        fn inline_size(_context: fidl::encoding::Context) -> usize {
2160            16
2161        }
2162    }
2163
2164    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ThreadDetails, D>
2165        for &ThreadDetails
2166    {
2167        unsafe fn encode(
2168            self,
2169            encoder: &mut fidl::encoding::Encoder<'_, D>,
2170            offset: usize,
2171            mut depth: fidl::encoding::Depth,
2172        ) -> fidl::Result<()> {
2173            encoder.debug_check_bounds::<ThreadDetails>(offset);
2174            // Vector header
2175            let max_ordinal: u64 = self.max_ordinal_present();
2176            encoder.write_num(max_ordinal, offset);
2177            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2178            // Calling encoder.out_of_line_offset(0) is not allowed.
2179            if max_ordinal == 0 {
2180                return Ok(());
2181            }
2182            depth.increment()?;
2183            let envelope_size = 8;
2184            let bytes_len = max_ordinal as usize * envelope_size;
2185            #[allow(unused_variables)]
2186            let offset = encoder.out_of_line_offset(bytes_len);
2187            let mut _prev_end_offset: usize = 0;
2188            if 1 > max_ordinal {
2189                return Ok(());
2190            }
2191
2192            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2193            // are envelope_size bytes.
2194            let cur_offset: usize = (1 - 1) * envelope_size;
2195
2196            // Zero reserved fields.
2197            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2198
2199            // Safety:
2200            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2201            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2202            //   envelope_size bytes, there is always sufficient room.
2203            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2204                self.backtrace.as_ref().map(
2205                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2206                ),
2207                encoder,
2208                offset + cur_offset,
2209                depth,
2210            )?;
2211
2212            _prev_end_offset = cur_offset + envelope_size;
2213
2214            Ok(())
2215        }
2216    }
2217
2218    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThreadDetails {
2219        #[inline(always)]
2220        fn new_empty() -> Self {
2221            Self::default()
2222        }
2223
2224        unsafe fn decode(
2225            &mut self,
2226            decoder: &mut fidl::encoding::Decoder<'_, D>,
2227            offset: usize,
2228            mut depth: fidl::encoding::Depth,
2229        ) -> fidl::Result<()> {
2230            decoder.debug_check_bounds::<Self>(offset);
2231            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2232                None => return Err(fidl::Error::NotNullable),
2233                Some(len) => len,
2234            };
2235            // Calling decoder.out_of_line_offset(0) is not allowed.
2236            if len == 0 {
2237                return Ok(());
2238            };
2239            depth.increment()?;
2240            let envelope_size = 8;
2241            let bytes_len = len * envelope_size;
2242            let offset = decoder.out_of_line_offset(bytes_len)?;
2243            // Decode the envelope for each type.
2244            let mut _next_ordinal_to_read = 0;
2245            let mut next_offset = offset;
2246            let end_offset = offset + bytes_len;
2247            _next_ordinal_to_read += 1;
2248            if next_offset >= end_offset {
2249                return Ok(());
2250            }
2251
2252            // Decode unknown envelopes for gaps in ordinals.
2253            while _next_ordinal_to_read < 1 {
2254                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2255                _next_ordinal_to_read += 1;
2256                next_offset += envelope_size;
2257            }
2258
2259            let next_out_of_line = decoder.next_out_of_line();
2260            let handles_before = decoder.remaining_handles();
2261            if let Some((inlined, num_bytes, num_handles)) =
2262                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2263            {
2264                let member_inline_size =
2265                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2266                        decoder.context,
2267                    );
2268                if inlined != (member_inline_size <= 4) {
2269                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2270                }
2271                let inner_offset;
2272                let mut inner_depth = depth.clone();
2273                if inlined {
2274                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2275                    inner_offset = next_offset;
2276                } else {
2277                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2278                    inner_depth.increment()?;
2279                }
2280                let val_ref = self
2281                    .backtrace
2282                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2283                fidl::decode!(
2284                    fidl::encoding::UnboundedString,
2285                    D,
2286                    val_ref,
2287                    decoder,
2288                    inner_offset,
2289                    inner_depth
2290                )?;
2291                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2292                {
2293                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2294                }
2295                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2296                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2297                }
2298            }
2299
2300            next_offset += envelope_size;
2301
2302            // Decode the remaining unknown envelopes.
2303            while next_offset < end_offset {
2304                _next_ordinal_to_read += 1;
2305                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2306                next_offset += envelope_size;
2307            }
2308
2309            Ok(())
2310        }
2311    }
2312
2313    impl ThreadDetailsInterest {
2314        #[inline(always)]
2315        fn max_ordinal_present(&self) -> u64 {
2316            if let Some(_) = self.backtrace {
2317                return 1;
2318            }
2319            0
2320        }
2321    }
2322
2323    impl fidl::encoding::ValueTypeMarker for ThreadDetailsInterest {
2324        type Borrowed<'a> = &'a Self;
2325        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2326            value
2327        }
2328    }
2329
2330    unsafe impl fidl::encoding::TypeMarker for ThreadDetailsInterest {
2331        type Owned = Self;
2332
2333        #[inline(always)]
2334        fn inline_align(_context: fidl::encoding::Context) -> usize {
2335            8
2336        }
2337
2338        #[inline(always)]
2339        fn inline_size(_context: fidl::encoding::Context) -> usize {
2340            16
2341        }
2342    }
2343
2344    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ThreadDetailsInterest, D>
2345        for &ThreadDetailsInterest
2346    {
2347        unsafe fn encode(
2348            self,
2349            encoder: &mut fidl::encoding::Encoder<'_, D>,
2350            offset: usize,
2351            mut depth: fidl::encoding::Depth,
2352        ) -> fidl::Result<()> {
2353            encoder.debug_check_bounds::<ThreadDetailsInterest>(offset);
2354            // Vector header
2355            let max_ordinal: u64 = self.max_ordinal_present();
2356            encoder.write_num(max_ordinal, offset);
2357            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2358            // Calling encoder.out_of_line_offset(0) is not allowed.
2359            if max_ordinal == 0 {
2360                return Ok(());
2361            }
2362            depth.increment()?;
2363            let envelope_size = 8;
2364            let bytes_len = max_ordinal as usize * envelope_size;
2365            #[allow(unused_variables)]
2366            let offset = encoder.out_of_line_offset(bytes_len);
2367            let mut _prev_end_offset: usize = 0;
2368            if 1 > max_ordinal {
2369                return Ok(());
2370            }
2371
2372            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2373            // are envelope_size bytes.
2374            let cur_offset: usize = (1 - 1) * envelope_size;
2375
2376            // Zero reserved fields.
2377            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2378
2379            // Safety:
2380            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2381            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2382            //   envelope_size bytes, there is always sufficient room.
2383            fidl::encoding::encode_in_envelope_optional::<bool, D>(
2384                self.backtrace.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2385                encoder,
2386                offset + cur_offset,
2387                depth,
2388            )?;
2389
2390            _prev_end_offset = cur_offset + envelope_size;
2391
2392            Ok(())
2393        }
2394    }
2395
2396    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThreadDetailsInterest {
2397        #[inline(always)]
2398        fn new_empty() -> Self {
2399            Self::default()
2400        }
2401
2402        unsafe fn decode(
2403            &mut self,
2404            decoder: &mut fidl::encoding::Decoder<'_, D>,
2405            offset: usize,
2406            mut depth: fidl::encoding::Depth,
2407        ) -> fidl::Result<()> {
2408            decoder.debug_check_bounds::<Self>(offset);
2409            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2410                None => return Err(fidl::Error::NotNullable),
2411                Some(len) => len,
2412            };
2413            // Calling decoder.out_of_line_offset(0) is not allowed.
2414            if len == 0 {
2415                return Ok(());
2416            };
2417            depth.increment()?;
2418            let envelope_size = 8;
2419            let bytes_len = len * envelope_size;
2420            let offset = decoder.out_of_line_offset(bytes_len)?;
2421            // Decode the envelope for each type.
2422            let mut _next_ordinal_to_read = 0;
2423            let mut next_offset = offset;
2424            let end_offset = offset + bytes_len;
2425            _next_ordinal_to_read += 1;
2426            if next_offset >= end_offset {
2427                return Ok(());
2428            }
2429
2430            // Decode unknown envelopes for gaps in ordinals.
2431            while _next_ordinal_to_read < 1 {
2432                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2433                _next_ordinal_to_read += 1;
2434                next_offset += envelope_size;
2435            }
2436
2437            let next_out_of_line = decoder.next_out_of_line();
2438            let handles_before = decoder.remaining_handles();
2439            if let Some((inlined, num_bytes, num_handles)) =
2440                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2441            {
2442                let member_inline_size =
2443                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2444                if inlined != (member_inline_size <= 4) {
2445                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2446                }
2447                let inner_offset;
2448                let mut inner_depth = depth.clone();
2449                if inlined {
2450                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2451                    inner_offset = next_offset;
2452                } else {
2453                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2454                    inner_depth.increment()?;
2455                }
2456                let val_ref = self.backtrace.get_or_insert_with(|| fidl::new_empty!(bool, D));
2457                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2458                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2459                {
2460                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2461                }
2462                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2463                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2464                }
2465            }
2466
2467            next_offset += envelope_size;
2468
2469            // Decode the remaining unknown envelopes.
2470            while next_offset < end_offset {
2471                _next_ordinal_to_read += 1;
2472                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2473                next_offset += envelope_size;
2474            }
2475
2476            Ok(())
2477        }
2478    }
2479}