Skip to main content

fidl_fuchsia_test_manager_common/
fidl_fuchsia_test_manager_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/// Test case identifier. Unique in a suite run.
12pub type TestCaseId = u32;
13
14/// Human-readable name for a test case.
15pub type TestCaseName = String;
16
17pub const MAX_ARGUMENTS: u64 = fidl_fuchsia_io_common::MAX_PATH_LENGTH as u64;
18
19pub const MAX_ARGUMENT_LENGTH: u64 = 16384;
20
21pub const MAX_DEBUG_DATAS_PER_GET: u64 = 1024;
22
23pub const MAX_EVENTS_PER_WATCH: u64 = 1024;
24
25pub const MAX_FILTERS: u64 = 1024;
26
27pub const MAX_FILTER_LENGTH: u64 = fidl_fuchsia_component_common::MAX_MONIKER_LENGTH as u64;
28
29pub const MAX_OFFERS: u64 = 1024;
30
31pub const MAX_TEST_CASES_PER_GET: u64 = 1024;
32
33pub const MAX_TEST_COLLECTION_NAME_LENGTH: u64 = fidl_fuchsia_io_common::MAX_NAME_LENGTH as u64;
34
35/// Error for `LaunchSuite` call.
36#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
37pub enum LaunchError {
38    /// There were insufficient resources to perform the operation.
39    ResourceUnavailable,
40    /// Cannot resolve `test_suite_url`.
41    InstanceCannotResolve,
42    /// Invalid argument(s) passed.
43    InvalidArgs,
44    /// Failed to connect to the `fuchsia.test.TestSuite` that the test should
45    /// expose.
46    FailedToConnectToTestSuite,
47    /// Failed to enumerate tests.
48    CaseEnumeration,
49    /// Some internal error occurred. Something wrong with test manager setup.
50    /// Check logs and report bug.
51    InternalError,
52    /// No test cases matched the specified test filters. This error is only
53    /// returned when a test filter is specified. In the case of a test suite
54    /// with no test cases, the suite will pass.
55    NoMatchingCases,
56    /// Test manifest is invalid.
57    InvalidManifest,
58    #[doc(hidden)]
59    __SourceBreaking { unknown_ordinal: u32 },
60}
61
62/// Pattern that matches an unknown `LaunchError` member.
63#[macro_export]
64macro_rules! LaunchErrorUnknown {
65    () => {
66        _
67    };
68}
69
70impl LaunchError {
71    #[inline]
72    pub fn from_primitive(prim: u32) -> Option<Self> {
73        match prim {
74            1 => Some(Self::ResourceUnavailable),
75            2 => Some(Self::InstanceCannotResolve),
76            3 => Some(Self::InvalidArgs),
77            4 => Some(Self::FailedToConnectToTestSuite),
78            5 => Some(Self::CaseEnumeration),
79            6 => Some(Self::InternalError),
80            7 => Some(Self::NoMatchingCases),
81            8 => Some(Self::InvalidManifest),
82            _ => None,
83        }
84    }
85
86    #[inline]
87    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
88        match prim {
89            1 => Self::ResourceUnavailable,
90            2 => Self::InstanceCannotResolve,
91            3 => Self::InvalidArgs,
92            4 => Self::FailedToConnectToTestSuite,
93            5 => Self::CaseEnumeration,
94            6 => Self::InternalError,
95            7 => Self::NoMatchingCases,
96            8 => Self::InvalidManifest,
97            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
98        }
99    }
100
101    #[inline]
102    pub fn unknown() -> Self {
103        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
104    }
105
106    #[inline]
107    pub const fn into_primitive(self) -> u32 {
108        match self {
109            Self::ResourceUnavailable => 1,
110            Self::InstanceCannotResolve => 2,
111            Self::InvalidArgs => 3,
112            Self::FailedToConnectToTestSuite => 4,
113            Self::CaseEnumeration => 5,
114            Self::InternalError => 6,
115            Self::NoMatchingCases => 7,
116            Self::InvalidManifest => 8,
117            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
118        }
119    }
120
121    #[inline]
122    pub fn is_unknown(&self) -> bool {
123        match self {
124            Self::__SourceBreaking { unknown_ordinal: _ } => true,
125            _ => false,
126        }
127    }
128}
129
130/// Enumeration of alternative log iteration mechanisms.
131#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
132pub enum LogsIteratorType {
133    /// Indicates use of `fuchsia.diagnostics.BatchIterator`. This iterator type employs
134    /// VMOs, which yields the best performance locally but cannot be used remotely (e.g.
135    /// from the host). When this type is selected, artifacts of type `log` will have values
136    /// that use the `batch` variant of the `Syslog` union.
137    Batch,
138    /// Indicates the use of a socket as described in `fuchsia.diagnostics.host.ArchiveAccessor`.
139    /// can be used remote (e.g. from the host). When this type is selected. artifacts of type
140    /// `log` will have values that use the `stream` variant of the `Syslog` union.
141    Socket,
142    #[doc(hidden)]
143    __SourceBreaking { unknown_ordinal: u32 },
144}
145
146/// Pattern that matches an unknown `LogsIteratorType` member.
147#[macro_export]
148macro_rules! LogsIteratorTypeUnknown {
149    () => {
150        _
151    };
152}
153
154impl LogsIteratorType {
155    #[inline]
156    pub fn from_primitive(prim: u32) -> Option<Self> {
157        match prim {
158            1 => Some(Self::Batch),
159            2 => Some(Self::Socket),
160            _ => None,
161        }
162    }
163
164    #[inline]
165    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
166        match prim {
167            1 => Self::Batch,
168            2 => Self::Socket,
169            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
170        }
171    }
172
173    #[inline]
174    pub fn unknown() -> Self {
175        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
176    }
177
178    #[inline]
179    pub const fn into_primitive(self) -> u32 {
180        match self {
181            Self::Batch => 1,
182            Self::Socket => 2,
183            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
184        }
185    }
186
187    #[inline]
188    pub fn is_unknown(&self) -> bool {
189        match self {
190            Self::__SourceBreaking { unknown_ordinal: _ } => true,
191            _ => false,
192        }
193    }
194}
195
196/// Represents the result of a suite run.
197#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
198pub enum SuiteResult {
199    /// The suite finished normally, with all test case results being either `SKIPPED` or `PASSED`.
200    Finished,
201    /// The suite finished normally, with some test case results being neither `SKIPPED` nor
202    /// `PASSED`.
203    Failed,
204    /// Suite implementation crashed, did not send `Finish` event, or did not report
205    /// test case result for one or more test cases.
206    DidNotFinish,
207    /// The overall suite run timed out .
208    TimedOut,
209    /// The suite run was stopped.
210    Stopped,
211    InternalError,
212    #[doc(hidden)]
213    __SourceBreaking {
214        unknown_ordinal: u32,
215    },
216}
217
218/// Pattern that matches an unknown `SuiteResult` member.
219#[macro_export]
220macro_rules! SuiteResultUnknown {
221    () => {
222        _
223    };
224}
225
226impl SuiteResult {
227    #[inline]
228    pub fn from_primitive(prim: u32) -> Option<Self> {
229        match prim {
230            1 => Some(Self::Finished),
231            2 => Some(Self::Failed),
232            3 => Some(Self::DidNotFinish),
233            4 => Some(Self::TimedOut),
234            5 => Some(Self::Stopped),
235            6 => Some(Self::InternalError),
236            _ => None,
237        }
238    }
239
240    #[inline]
241    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
242        match prim {
243            1 => Self::Finished,
244            2 => Self::Failed,
245            3 => Self::DidNotFinish,
246            4 => Self::TimedOut,
247            5 => Self::Stopped,
248            6 => Self::InternalError,
249            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
250        }
251    }
252
253    #[inline]
254    pub fn unknown() -> Self {
255        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
256    }
257
258    #[inline]
259    pub const fn into_primitive(self) -> u32 {
260        match self {
261            Self::Finished => 1,
262            Self::Failed => 2,
263            Self::DidNotFinish => 3,
264            Self::TimedOut => 4,
265            Self::Stopped => 5,
266            Self::InternalError => 6,
267            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
268        }
269    }
270
271    #[inline]
272    pub fn is_unknown(&self) -> bool {
273        match self {
274            Self::__SourceBreaking { unknown_ordinal: _ } => true,
275            _ => false,
276        }
277    }
278}
279
280/// Represent the result of a test case run.
281#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
282pub enum TestCaseResult {
283    /// Test case was skipped.
284    Skipped,
285    /// The test case passed.
286    Passed,
287    /// Test case failed.
288    Failed,
289    /// Test case timed out.
290    TimedOut,
291    /// Suite implementation did not return a result for the test case.
292    Error,
293    #[doc(hidden)]
294    __SourceBreaking { unknown_ordinal: u32 },
295}
296
297/// Pattern that matches an unknown `TestCaseResult` member.
298#[macro_export]
299macro_rules! TestCaseResultUnknown {
300    () => {
301        _
302    };
303}
304
305impl TestCaseResult {
306    #[inline]
307    pub fn from_primitive(prim: u32) -> Option<Self> {
308        match prim {
309            1 => Some(Self::Skipped),
310            2 => Some(Self::Passed),
311            3 => Some(Self::Failed),
312            4 => Some(Self::TimedOut),
313            5 => Some(Self::Error),
314            _ => None,
315        }
316    }
317
318    #[inline]
319    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
320        match prim {
321            1 => Self::Skipped,
322            2 => Self::Passed,
323            3 => Self::Failed,
324            4 => Self::TimedOut,
325            5 => Self::Error,
326            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
327        }
328    }
329
330    #[inline]
331    pub fn unknown() -> Self {
332        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
333    }
334
335    #[inline]
336    pub const fn into_primitive(self) -> u32 {
337        match self {
338            Self::Skipped => 1,
339            Self::Passed => 2,
340            Self::Failed => 3,
341            Self::TimedOut => 4,
342            Self::Error => 5,
343            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
344        }
345    }
346
347    #[inline]
348    pub fn is_unknown(&self) -> bool {
349        match self {
350            Self::__SourceBreaking { unknown_ordinal: _ } => true,
351            _ => false,
352        }
353    }
354}
355
356#[derive(Clone, Debug, PartialEq)]
357pub struct TestCaseIteratorGetNextResponse {
358    pub test_cases: Vec<TestCase>,
359}
360
361impl fidl::Persistable for TestCaseIteratorGetNextResponse {}
362
363/// Details for `suite_started` events.
364#[derive(Clone, Debug, Default, PartialEq)]
365pub struct SuiteStartedEventDetails {
366    #[doc(hidden)]
367    pub __source_breaking: fidl::marker::SourceBreaking,
368}
369
370impl fidl::Persistable for SuiteStartedEventDetails {}
371
372/// Details for `suite_stopped` events.
373#[derive(Clone, Debug, Default, PartialEq)]
374pub struct SuiteStoppedEventDetails {
375    /// The suite result. This field will always be provided.
376    pub result: Option<SuiteResult>,
377    #[doc(hidden)]
378    pub __source_breaking: fidl::marker::SourceBreaking,
379}
380
381impl fidl::Persistable for SuiteStoppedEventDetails {}
382
383/// Description of an enumerated test case.
384#[derive(Clone, Debug, Default, PartialEq)]
385pub struct TestCase {
386    /// Name of the test case.
387    pub name: Option<String>,
388    #[doc(hidden)]
389    pub __source_breaking: fidl::marker::SourceBreaking,
390}
391
392impl fidl::Persistable for TestCase {}
393
394/// Details for `test_case_finished` events.
395#[derive(Clone, Debug, Default, PartialEq)]
396pub struct TestCaseFinishedEventDetails {
397    /// The test case to which this event pertains. This event will be preceeded by a
398    /// 'test_case found' event with a matching id. This field will always be provided.
399    pub test_case_id: Option<u32>,
400    #[doc(hidden)]
401    pub __source_breaking: fidl::marker::SourceBreaking,
402}
403
404impl fidl::Persistable for TestCaseFinishedEventDetails {}
405
406/// Details for `test_case_found` events.
407#[derive(Clone, Debug, Default, PartialEq)]
408pub struct TestCaseFoundEventDetails {
409    /// Name of the test case that was found. This field will always be provided.
410    pub test_case_name: Option<String>,
411    /// Identifies this test case in subsequent events. This field will always be provided
412    /// and is unique for a given `SuiteController`.
413    pub test_case_id: Option<u32>,
414    #[doc(hidden)]
415    pub __source_breaking: fidl::marker::SourceBreaking,
416}
417
418impl fidl::Persistable for TestCaseFoundEventDetails {}
419
420/// Details for `test_case_started` events.
421#[derive(Clone, Debug, Default, PartialEq)]
422pub struct TestCaseStartedEventDetails {
423    /// The test case to which this event pertains. This event will be preceeded by a
424    /// 'test_case found' event with a matching id. This field will always be provided.
425    pub test_case_id: Option<u32>,
426    #[doc(hidden)]
427    pub __source_breaking: fidl::marker::SourceBreaking,
428}
429
430impl fidl::Persistable for TestCaseStartedEventDetails {}
431
432/// Details for `test_case_stopped` events.
433#[derive(Clone, Debug, Default, PartialEq)]
434pub struct TestCaseStoppedEventDetails {
435    /// The test case to which this event pertains. This event will be preceeded by a
436    /// 'test_case found' event with a matching id. This field will always be provided.
437    pub test_case_id: Option<u32>,
438    /// The test case result. This field will always be provided.
439    pub result: Option<TestCaseResult>,
440    #[doc(hidden)]
441    pub __source_breaking: fidl::marker::SourceBreaking,
442}
443
444impl fidl::Persistable for TestCaseStoppedEventDetails {}
445
446pub mod debug_data_iterator_ordinals {
447    pub const GET_NEXT: u64 = 0x9ef24c823f5ad60;
448    pub const GET_NEXT_COMPRESSED: u64 = 0x6765e9cb918301f4;
449}
450
451pub mod early_boot_profile_ordinals {
452    pub const REGISTER_WATCHER: u64 = 0x6bd6b03803b93715;
453}
454
455pub mod suite_controller_ordinals {
456    pub const STOP: u64 = 0x4675fc6c8f404fef;
457    pub const KILL: u64 = 0x5f813fb72887fc17;
458    pub const WATCH_EVENTS: u64 = 0x5d1a75b1d06839b4;
459}
460
461pub mod suite_runner_ordinals {
462    pub const RUN: u64 = 0x16f5ec6a46c223f0;
463}
464
465pub mod test_case_enumerator_ordinals {
466    pub const ENUMERATE: u64 = 0x24f8a91d96134492;
467}
468
469pub mod test_case_iterator_ordinals {
470    pub const GET_NEXT: u64 = 0x37abec519b2ac1be;
471}
472
473mod internal {
474    use super::*;
475    unsafe impl fidl::encoding::TypeMarker for LaunchError {
476        type Owned = Self;
477
478        #[inline(always)]
479        fn inline_align(_context: fidl::encoding::Context) -> usize {
480            std::mem::align_of::<u32>()
481        }
482
483        #[inline(always)]
484        fn inline_size(_context: fidl::encoding::Context) -> usize {
485            std::mem::size_of::<u32>()
486        }
487
488        #[inline(always)]
489        fn encode_is_copy() -> bool {
490            false
491        }
492
493        #[inline(always)]
494        fn decode_is_copy() -> bool {
495            false
496        }
497    }
498
499    impl fidl::encoding::ValueTypeMarker for LaunchError {
500        type Borrowed<'a> = Self;
501        #[inline(always)]
502        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
503            *value
504        }
505    }
506
507    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for LaunchError {
508        #[inline]
509        unsafe fn encode(
510            self,
511            encoder: &mut fidl::encoding::Encoder<'_, D>,
512            offset: usize,
513            _depth: fidl::encoding::Depth,
514        ) -> fidl::Result<()> {
515            encoder.debug_check_bounds::<Self>(offset);
516            encoder.write_num(self.into_primitive(), offset);
517            Ok(())
518        }
519    }
520
521    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LaunchError {
522        #[inline(always)]
523        fn new_empty() -> Self {
524            Self::unknown()
525        }
526
527        #[inline]
528        unsafe fn decode(
529            &mut self,
530            decoder: &mut fidl::encoding::Decoder<'_, D>,
531            offset: usize,
532            _depth: fidl::encoding::Depth,
533        ) -> fidl::Result<()> {
534            decoder.debug_check_bounds::<Self>(offset);
535            let prim = decoder.read_num::<u32>(offset);
536
537            *self = Self::from_primitive_allow_unknown(prim);
538            Ok(())
539        }
540    }
541    unsafe impl fidl::encoding::TypeMarker for LogsIteratorType {
542        type Owned = Self;
543
544        #[inline(always)]
545        fn inline_align(_context: fidl::encoding::Context) -> usize {
546            std::mem::align_of::<u32>()
547        }
548
549        #[inline(always)]
550        fn inline_size(_context: fidl::encoding::Context) -> usize {
551            std::mem::size_of::<u32>()
552        }
553
554        #[inline(always)]
555        fn encode_is_copy() -> bool {
556            false
557        }
558
559        #[inline(always)]
560        fn decode_is_copy() -> bool {
561            false
562        }
563    }
564
565    impl fidl::encoding::ValueTypeMarker for LogsIteratorType {
566        type Borrowed<'a> = Self;
567        #[inline(always)]
568        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
569            *value
570        }
571    }
572
573    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
574        for LogsIteratorType
575    {
576        #[inline]
577        unsafe fn encode(
578            self,
579            encoder: &mut fidl::encoding::Encoder<'_, D>,
580            offset: usize,
581            _depth: fidl::encoding::Depth,
582        ) -> fidl::Result<()> {
583            encoder.debug_check_bounds::<Self>(offset);
584            encoder.write_num(self.into_primitive(), offset);
585            Ok(())
586        }
587    }
588
589    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogsIteratorType {
590        #[inline(always)]
591        fn new_empty() -> Self {
592            Self::unknown()
593        }
594
595        #[inline]
596        unsafe fn decode(
597            &mut self,
598            decoder: &mut fidl::encoding::Decoder<'_, D>,
599            offset: usize,
600            _depth: fidl::encoding::Depth,
601        ) -> fidl::Result<()> {
602            decoder.debug_check_bounds::<Self>(offset);
603            let prim = decoder.read_num::<u32>(offset);
604
605            *self = Self::from_primitive_allow_unknown(prim);
606            Ok(())
607        }
608    }
609    unsafe impl fidl::encoding::TypeMarker for SuiteResult {
610        type Owned = Self;
611
612        #[inline(always)]
613        fn inline_align(_context: fidl::encoding::Context) -> usize {
614            std::mem::align_of::<u32>()
615        }
616
617        #[inline(always)]
618        fn inline_size(_context: fidl::encoding::Context) -> usize {
619            std::mem::size_of::<u32>()
620        }
621
622        #[inline(always)]
623        fn encode_is_copy() -> bool {
624            false
625        }
626
627        #[inline(always)]
628        fn decode_is_copy() -> bool {
629            false
630        }
631    }
632
633    impl fidl::encoding::ValueTypeMarker for SuiteResult {
634        type Borrowed<'a> = Self;
635        #[inline(always)]
636        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
637            *value
638        }
639    }
640
641    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SuiteResult {
642        #[inline]
643        unsafe fn encode(
644            self,
645            encoder: &mut fidl::encoding::Encoder<'_, D>,
646            offset: usize,
647            _depth: fidl::encoding::Depth,
648        ) -> fidl::Result<()> {
649            encoder.debug_check_bounds::<Self>(offset);
650            encoder.write_num(self.into_primitive(), offset);
651            Ok(())
652        }
653    }
654
655    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SuiteResult {
656        #[inline(always)]
657        fn new_empty() -> Self {
658            Self::unknown()
659        }
660
661        #[inline]
662        unsafe fn decode(
663            &mut self,
664            decoder: &mut fidl::encoding::Decoder<'_, D>,
665            offset: usize,
666            _depth: fidl::encoding::Depth,
667        ) -> fidl::Result<()> {
668            decoder.debug_check_bounds::<Self>(offset);
669            let prim = decoder.read_num::<u32>(offset);
670
671            *self = Self::from_primitive_allow_unknown(prim);
672            Ok(())
673        }
674    }
675    unsafe impl fidl::encoding::TypeMarker for TestCaseResult {
676        type Owned = Self;
677
678        #[inline(always)]
679        fn inline_align(_context: fidl::encoding::Context) -> usize {
680            std::mem::align_of::<u32>()
681        }
682
683        #[inline(always)]
684        fn inline_size(_context: fidl::encoding::Context) -> usize {
685            std::mem::size_of::<u32>()
686        }
687
688        #[inline(always)]
689        fn encode_is_copy() -> bool {
690            false
691        }
692
693        #[inline(always)]
694        fn decode_is_copy() -> bool {
695            false
696        }
697    }
698
699    impl fidl::encoding::ValueTypeMarker for TestCaseResult {
700        type Borrowed<'a> = Self;
701        #[inline(always)]
702        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
703            *value
704        }
705    }
706
707    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TestCaseResult {
708        #[inline]
709        unsafe fn encode(
710            self,
711            encoder: &mut fidl::encoding::Encoder<'_, D>,
712            offset: usize,
713            _depth: fidl::encoding::Depth,
714        ) -> fidl::Result<()> {
715            encoder.debug_check_bounds::<Self>(offset);
716            encoder.write_num(self.into_primitive(), offset);
717            Ok(())
718        }
719    }
720
721    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TestCaseResult {
722        #[inline(always)]
723        fn new_empty() -> Self {
724            Self::unknown()
725        }
726
727        #[inline]
728        unsafe fn decode(
729            &mut self,
730            decoder: &mut fidl::encoding::Decoder<'_, D>,
731            offset: usize,
732            _depth: fidl::encoding::Depth,
733        ) -> fidl::Result<()> {
734            decoder.debug_check_bounds::<Self>(offset);
735            let prim = decoder.read_num::<u32>(offset);
736
737            *self = Self::from_primitive_allow_unknown(prim);
738            Ok(())
739        }
740    }
741
742    impl fidl::encoding::ValueTypeMarker for TestCaseIteratorGetNextResponse {
743        type Borrowed<'a> = &'a Self;
744        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
745            value
746        }
747    }
748
749    unsafe impl fidl::encoding::TypeMarker for TestCaseIteratorGetNextResponse {
750        type Owned = Self;
751
752        #[inline(always)]
753        fn inline_align(_context: fidl::encoding::Context) -> usize {
754            8
755        }
756
757        #[inline(always)]
758        fn inline_size(_context: fidl::encoding::Context) -> usize {
759            16
760        }
761    }
762
763    unsafe impl<D: fidl::encoding::ResourceDialect>
764        fidl::encoding::Encode<TestCaseIteratorGetNextResponse, D>
765        for &TestCaseIteratorGetNextResponse
766    {
767        #[inline]
768        unsafe fn encode(
769            self,
770            encoder: &mut fidl::encoding::Encoder<'_, D>,
771            offset: usize,
772            _depth: fidl::encoding::Depth,
773        ) -> fidl::Result<()> {
774            encoder.debug_check_bounds::<TestCaseIteratorGetNextResponse>(offset);
775            // Delegate to tuple encoding.
776            fidl::encoding::Encode::<TestCaseIteratorGetNextResponse, D>::encode(
777                (
778                    <fidl::encoding::Vector<TestCase, 1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_cases),
779                ),
780                encoder, offset, _depth
781            )
782        }
783    }
784    unsafe impl<
785        D: fidl::encoding::ResourceDialect,
786        T0: fidl::encoding::Encode<fidl::encoding::Vector<TestCase, 1024>, D>,
787    > fidl::encoding::Encode<TestCaseIteratorGetNextResponse, D> for (T0,)
788    {
789        #[inline]
790        unsafe fn encode(
791            self,
792            encoder: &mut fidl::encoding::Encoder<'_, D>,
793            offset: usize,
794            depth: fidl::encoding::Depth,
795        ) -> fidl::Result<()> {
796            encoder.debug_check_bounds::<TestCaseIteratorGetNextResponse>(offset);
797            // Zero out padding regions. There's no need to apply masks
798            // because the unmasked parts will be overwritten by fields.
799            // Write the fields.
800            self.0.encode(encoder, offset + 0, depth)?;
801            Ok(())
802        }
803    }
804
805    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
806        for TestCaseIteratorGetNextResponse
807    {
808        #[inline(always)]
809        fn new_empty() -> Self {
810            Self { test_cases: fidl::new_empty!(fidl::encoding::Vector<TestCase, 1024>, D) }
811        }
812
813        #[inline]
814        unsafe fn decode(
815            &mut self,
816            decoder: &mut fidl::encoding::Decoder<'_, D>,
817            offset: usize,
818            _depth: fidl::encoding::Depth,
819        ) -> fidl::Result<()> {
820            decoder.debug_check_bounds::<Self>(offset);
821            // Verify that padding bytes are zero.
822            fidl::decode!(fidl::encoding::Vector<TestCase, 1024>, D, &mut self.test_cases, decoder, offset + 0, _depth)?;
823            Ok(())
824        }
825    }
826
827    impl SuiteStartedEventDetails {
828        #[inline(always)]
829        fn max_ordinal_present(&self) -> u64 {
830            0
831        }
832    }
833
834    impl fidl::encoding::ValueTypeMarker for SuiteStartedEventDetails {
835        type Borrowed<'a> = &'a Self;
836        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
837            value
838        }
839    }
840
841    unsafe impl fidl::encoding::TypeMarker for SuiteStartedEventDetails {
842        type Owned = Self;
843
844        #[inline(always)]
845        fn inline_align(_context: fidl::encoding::Context) -> usize {
846            8
847        }
848
849        #[inline(always)]
850        fn inline_size(_context: fidl::encoding::Context) -> usize {
851            16
852        }
853    }
854
855    unsafe impl<D: fidl::encoding::ResourceDialect>
856        fidl::encoding::Encode<SuiteStartedEventDetails, D> for &SuiteStartedEventDetails
857    {
858        unsafe fn encode(
859            self,
860            encoder: &mut fidl::encoding::Encoder<'_, D>,
861            offset: usize,
862            mut depth: fidl::encoding::Depth,
863        ) -> fidl::Result<()> {
864            encoder.debug_check_bounds::<SuiteStartedEventDetails>(offset);
865            // Vector header
866            let max_ordinal: u64 = self.max_ordinal_present();
867            encoder.write_num(max_ordinal, offset);
868            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
869            // Calling encoder.out_of_line_offset(0) is not allowed.
870            if max_ordinal == 0 {
871                return Ok(());
872            }
873            depth.increment()?;
874            let envelope_size = 8;
875            let bytes_len = max_ordinal as usize * envelope_size;
876            #[allow(unused_variables)]
877            let offset = encoder.out_of_line_offset(bytes_len);
878            let mut _prev_end_offset: usize = 0;
879
880            Ok(())
881        }
882    }
883
884    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
885        for SuiteStartedEventDetails
886    {
887        #[inline(always)]
888        fn new_empty() -> Self {
889            Self::default()
890        }
891
892        unsafe fn decode(
893            &mut self,
894            decoder: &mut fidl::encoding::Decoder<'_, D>,
895            offset: usize,
896            mut depth: fidl::encoding::Depth,
897        ) -> fidl::Result<()> {
898            decoder.debug_check_bounds::<Self>(offset);
899            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
900                None => return Err(fidl::Error::NotNullable),
901                Some(len) => len,
902            };
903            // Calling decoder.out_of_line_offset(0) is not allowed.
904            if len == 0 {
905                return Ok(());
906            };
907            depth.increment()?;
908            let envelope_size = 8;
909            let bytes_len = len * envelope_size;
910            let offset = decoder.out_of_line_offset(bytes_len)?;
911            // Decode the envelope for each type.
912            let mut _next_ordinal_to_read = 0;
913            let mut next_offset = offset;
914            let end_offset = offset + bytes_len;
915
916            // Decode the remaining unknown envelopes.
917            while next_offset < end_offset {
918                _next_ordinal_to_read += 1;
919                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
920                next_offset += envelope_size;
921            }
922
923            Ok(())
924        }
925    }
926
927    impl SuiteStoppedEventDetails {
928        #[inline(always)]
929        fn max_ordinal_present(&self) -> u64 {
930            if let Some(_) = self.result {
931                return 1;
932            }
933            0
934        }
935    }
936
937    impl fidl::encoding::ValueTypeMarker for SuiteStoppedEventDetails {
938        type Borrowed<'a> = &'a Self;
939        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
940            value
941        }
942    }
943
944    unsafe impl fidl::encoding::TypeMarker for SuiteStoppedEventDetails {
945        type Owned = Self;
946
947        #[inline(always)]
948        fn inline_align(_context: fidl::encoding::Context) -> usize {
949            8
950        }
951
952        #[inline(always)]
953        fn inline_size(_context: fidl::encoding::Context) -> usize {
954            16
955        }
956    }
957
958    unsafe impl<D: fidl::encoding::ResourceDialect>
959        fidl::encoding::Encode<SuiteStoppedEventDetails, D> for &SuiteStoppedEventDetails
960    {
961        unsafe fn encode(
962            self,
963            encoder: &mut fidl::encoding::Encoder<'_, D>,
964            offset: usize,
965            mut depth: fidl::encoding::Depth,
966        ) -> fidl::Result<()> {
967            encoder.debug_check_bounds::<SuiteStoppedEventDetails>(offset);
968            // Vector header
969            let max_ordinal: u64 = self.max_ordinal_present();
970            encoder.write_num(max_ordinal, offset);
971            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
972            // Calling encoder.out_of_line_offset(0) is not allowed.
973            if max_ordinal == 0 {
974                return Ok(());
975            }
976            depth.increment()?;
977            let envelope_size = 8;
978            let bytes_len = max_ordinal as usize * envelope_size;
979            #[allow(unused_variables)]
980            let offset = encoder.out_of_line_offset(bytes_len);
981            let mut _prev_end_offset: usize = 0;
982            if 1 > max_ordinal {
983                return Ok(());
984            }
985
986            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
987            // are envelope_size bytes.
988            let cur_offset: usize = (1 - 1) * envelope_size;
989
990            // Zero reserved fields.
991            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
992
993            // Safety:
994            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
995            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
996            //   envelope_size bytes, there is always sufficient room.
997            fidl::encoding::encode_in_envelope_optional::<SuiteResult, D>(
998                self.result.as_ref().map(<SuiteResult as fidl::encoding::ValueTypeMarker>::borrow),
999                encoder,
1000                offset + cur_offset,
1001                depth,
1002            )?;
1003
1004            _prev_end_offset = cur_offset + envelope_size;
1005
1006            Ok(())
1007        }
1008    }
1009
1010    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1011        for SuiteStoppedEventDetails
1012    {
1013        #[inline(always)]
1014        fn new_empty() -> Self {
1015            Self::default()
1016        }
1017
1018        unsafe fn decode(
1019            &mut self,
1020            decoder: &mut fidl::encoding::Decoder<'_, D>,
1021            offset: usize,
1022            mut depth: fidl::encoding::Depth,
1023        ) -> fidl::Result<()> {
1024            decoder.debug_check_bounds::<Self>(offset);
1025            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1026                None => return Err(fidl::Error::NotNullable),
1027                Some(len) => len,
1028            };
1029            // Calling decoder.out_of_line_offset(0) is not allowed.
1030            if len == 0 {
1031                return Ok(());
1032            };
1033            depth.increment()?;
1034            let envelope_size = 8;
1035            let bytes_len = len * envelope_size;
1036            let offset = decoder.out_of_line_offset(bytes_len)?;
1037            // Decode the envelope for each type.
1038            let mut _next_ordinal_to_read = 0;
1039            let mut next_offset = offset;
1040            let end_offset = offset + bytes_len;
1041            _next_ordinal_to_read += 1;
1042            if next_offset >= end_offset {
1043                return Ok(());
1044            }
1045
1046            // Decode unknown envelopes for gaps in ordinals.
1047            while _next_ordinal_to_read < 1 {
1048                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1049                _next_ordinal_to_read += 1;
1050                next_offset += envelope_size;
1051            }
1052
1053            let next_out_of_line = decoder.next_out_of_line();
1054            let handles_before = decoder.remaining_handles();
1055            if let Some((inlined, num_bytes, num_handles)) =
1056                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1057            {
1058                let member_inline_size =
1059                    <SuiteResult as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1060                if inlined != (member_inline_size <= 4) {
1061                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1062                }
1063                let inner_offset;
1064                let mut inner_depth = depth.clone();
1065                if inlined {
1066                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1067                    inner_offset = next_offset;
1068                } else {
1069                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1070                    inner_depth.increment()?;
1071                }
1072                let val_ref = self.result.get_or_insert_with(|| fidl::new_empty!(SuiteResult, D));
1073                fidl::decode!(SuiteResult, D, val_ref, decoder, inner_offset, inner_depth)?;
1074                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1075                {
1076                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1077                }
1078                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1079                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1080                }
1081            }
1082
1083            next_offset += envelope_size;
1084
1085            // Decode the remaining unknown envelopes.
1086            while next_offset < end_offset {
1087                _next_ordinal_to_read += 1;
1088                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1089                next_offset += envelope_size;
1090            }
1091
1092            Ok(())
1093        }
1094    }
1095
1096    impl TestCase {
1097        #[inline(always)]
1098        fn max_ordinal_present(&self) -> u64 {
1099            if let Some(_) = self.name {
1100                return 1;
1101            }
1102            0
1103        }
1104    }
1105
1106    impl fidl::encoding::ValueTypeMarker for TestCase {
1107        type Borrowed<'a> = &'a Self;
1108        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1109            value
1110        }
1111    }
1112
1113    unsafe impl fidl::encoding::TypeMarker for TestCase {
1114        type Owned = Self;
1115
1116        #[inline(always)]
1117        fn inline_align(_context: fidl::encoding::Context) -> usize {
1118            8
1119        }
1120
1121        #[inline(always)]
1122        fn inline_size(_context: fidl::encoding::Context) -> usize {
1123            16
1124        }
1125    }
1126
1127    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TestCase, D> for &TestCase {
1128        unsafe fn encode(
1129            self,
1130            encoder: &mut fidl::encoding::Encoder<'_, D>,
1131            offset: usize,
1132            mut depth: fidl::encoding::Depth,
1133        ) -> fidl::Result<()> {
1134            encoder.debug_check_bounds::<TestCase>(offset);
1135            // Vector header
1136            let max_ordinal: u64 = self.max_ordinal_present();
1137            encoder.write_num(max_ordinal, offset);
1138            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1139            // Calling encoder.out_of_line_offset(0) is not allowed.
1140            if max_ordinal == 0 {
1141                return Ok(());
1142            }
1143            depth.increment()?;
1144            let envelope_size = 8;
1145            let bytes_len = max_ordinal as usize * envelope_size;
1146            #[allow(unused_variables)]
1147            let offset = encoder.out_of_line_offset(bytes_len);
1148            let mut _prev_end_offset: usize = 0;
1149            if 1 > max_ordinal {
1150                return Ok(());
1151            }
1152
1153            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1154            // are envelope_size bytes.
1155            let cur_offset: usize = (1 - 1) * envelope_size;
1156
1157            // Zero reserved fields.
1158            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1159
1160            // Safety:
1161            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1162            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1163            //   envelope_size bytes, there is always sufficient room.
1164            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<2048>, D>(
1165            self.name.as_ref().map(<fidl::encoding::BoundedString<2048> as fidl::encoding::ValueTypeMarker>::borrow),
1166            encoder, offset + cur_offset, depth
1167        )?;
1168
1169            _prev_end_offset = cur_offset + envelope_size;
1170
1171            Ok(())
1172        }
1173    }
1174
1175    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TestCase {
1176        #[inline(always)]
1177        fn new_empty() -> Self {
1178            Self::default()
1179        }
1180
1181        unsafe fn decode(
1182            &mut self,
1183            decoder: &mut fidl::encoding::Decoder<'_, D>,
1184            offset: usize,
1185            mut depth: fidl::encoding::Depth,
1186        ) -> fidl::Result<()> {
1187            decoder.debug_check_bounds::<Self>(offset);
1188            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1189                None => return Err(fidl::Error::NotNullable),
1190                Some(len) => len,
1191            };
1192            // Calling decoder.out_of_line_offset(0) is not allowed.
1193            if len == 0 {
1194                return Ok(());
1195            };
1196            depth.increment()?;
1197            let envelope_size = 8;
1198            let bytes_len = len * envelope_size;
1199            let offset = decoder.out_of_line_offset(bytes_len)?;
1200            // Decode the envelope for each type.
1201            let mut _next_ordinal_to_read = 0;
1202            let mut next_offset = offset;
1203            let end_offset = offset + bytes_len;
1204            _next_ordinal_to_read += 1;
1205            if next_offset >= end_offset {
1206                return Ok(());
1207            }
1208
1209            // Decode unknown envelopes for gaps in ordinals.
1210            while _next_ordinal_to_read < 1 {
1211                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1212                _next_ordinal_to_read += 1;
1213                next_offset += envelope_size;
1214            }
1215
1216            let next_out_of_line = decoder.next_out_of_line();
1217            let handles_before = decoder.remaining_handles();
1218            if let Some((inlined, num_bytes, num_handles)) =
1219                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1220            {
1221                let member_inline_size = <fidl::encoding::BoundedString<2048> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1222                if inlined != (member_inline_size <= 4) {
1223                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1224                }
1225                let inner_offset;
1226                let mut inner_depth = depth.clone();
1227                if inlined {
1228                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1229                    inner_offset = next_offset;
1230                } else {
1231                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1232                    inner_depth.increment()?;
1233                }
1234                let val_ref = self.name.get_or_insert_with(|| {
1235                    fidl::new_empty!(fidl::encoding::BoundedString<2048>, D)
1236                });
1237                fidl::decode!(
1238                    fidl::encoding::BoundedString<2048>,
1239                    D,
1240                    val_ref,
1241                    decoder,
1242                    inner_offset,
1243                    inner_depth
1244                )?;
1245                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1246                {
1247                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1248                }
1249                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1250                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1251                }
1252            }
1253
1254            next_offset += envelope_size;
1255
1256            // Decode the remaining unknown envelopes.
1257            while next_offset < end_offset {
1258                _next_ordinal_to_read += 1;
1259                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1260                next_offset += envelope_size;
1261            }
1262
1263            Ok(())
1264        }
1265    }
1266
1267    impl TestCaseFinishedEventDetails {
1268        #[inline(always)]
1269        fn max_ordinal_present(&self) -> u64 {
1270            if let Some(_) = self.test_case_id {
1271                return 1;
1272            }
1273            0
1274        }
1275    }
1276
1277    impl fidl::encoding::ValueTypeMarker for TestCaseFinishedEventDetails {
1278        type Borrowed<'a> = &'a Self;
1279        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1280            value
1281        }
1282    }
1283
1284    unsafe impl fidl::encoding::TypeMarker for TestCaseFinishedEventDetails {
1285        type Owned = Self;
1286
1287        #[inline(always)]
1288        fn inline_align(_context: fidl::encoding::Context) -> usize {
1289            8
1290        }
1291
1292        #[inline(always)]
1293        fn inline_size(_context: fidl::encoding::Context) -> usize {
1294            16
1295        }
1296    }
1297
1298    unsafe impl<D: fidl::encoding::ResourceDialect>
1299        fidl::encoding::Encode<TestCaseFinishedEventDetails, D> for &TestCaseFinishedEventDetails
1300    {
1301        unsafe fn encode(
1302            self,
1303            encoder: &mut fidl::encoding::Encoder<'_, D>,
1304            offset: usize,
1305            mut depth: fidl::encoding::Depth,
1306        ) -> fidl::Result<()> {
1307            encoder.debug_check_bounds::<TestCaseFinishedEventDetails>(offset);
1308            // Vector header
1309            let max_ordinal: u64 = self.max_ordinal_present();
1310            encoder.write_num(max_ordinal, offset);
1311            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1312            // Calling encoder.out_of_line_offset(0) is not allowed.
1313            if max_ordinal == 0 {
1314                return Ok(());
1315            }
1316            depth.increment()?;
1317            let envelope_size = 8;
1318            let bytes_len = max_ordinal as usize * envelope_size;
1319            #[allow(unused_variables)]
1320            let offset = encoder.out_of_line_offset(bytes_len);
1321            let mut _prev_end_offset: usize = 0;
1322            if 1 > max_ordinal {
1323                return Ok(());
1324            }
1325
1326            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1327            // are envelope_size bytes.
1328            let cur_offset: usize = (1 - 1) * envelope_size;
1329
1330            // Zero reserved fields.
1331            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1332
1333            // Safety:
1334            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1335            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1336            //   envelope_size bytes, there is always sufficient room.
1337            fidl::encoding::encode_in_envelope_optional::<u32, D>(
1338                self.test_case_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
1339                encoder,
1340                offset + cur_offset,
1341                depth,
1342            )?;
1343
1344            _prev_end_offset = cur_offset + envelope_size;
1345
1346            Ok(())
1347        }
1348    }
1349
1350    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1351        for TestCaseFinishedEventDetails
1352    {
1353        #[inline(always)]
1354        fn new_empty() -> Self {
1355            Self::default()
1356        }
1357
1358        unsafe fn decode(
1359            &mut self,
1360            decoder: &mut fidl::encoding::Decoder<'_, D>,
1361            offset: usize,
1362            mut depth: fidl::encoding::Depth,
1363        ) -> fidl::Result<()> {
1364            decoder.debug_check_bounds::<Self>(offset);
1365            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1366                None => return Err(fidl::Error::NotNullable),
1367                Some(len) => len,
1368            };
1369            // Calling decoder.out_of_line_offset(0) is not allowed.
1370            if len == 0 {
1371                return Ok(());
1372            };
1373            depth.increment()?;
1374            let envelope_size = 8;
1375            let bytes_len = len * envelope_size;
1376            let offset = decoder.out_of_line_offset(bytes_len)?;
1377            // Decode the envelope for each type.
1378            let mut _next_ordinal_to_read = 0;
1379            let mut next_offset = offset;
1380            let end_offset = offset + bytes_len;
1381            _next_ordinal_to_read += 1;
1382            if next_offset >= end_offset {
1383                return Ok(());
1384            }
1385
1386            // Decode unknown envelopes for gaps in ordinals.
1387            while _next_ordinal_to_read < 1 {
1388                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1389                _next_ordinal_to_read += 1;
1390                next_offset += envelope_size;
1391            }
1392
1393            let next_out_of_line = decoder.next_out_of_line();
1394            let handles_before = decoder.remaining_handles();
1395            if let Some((inlined, num_bytes, num_handles)) =
1396                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1397            {
1398                let member_inline_size =
1399                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1400                if inlined != (member_inline_size <= 4) {
1401                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1402                }
1403                let inner_offset;
1404                let mut inner_depth = depth.clone();
1405                if inlined {
1406                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1407                    inner_offset = next_offset;
1408                } else {
1409                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1410                    inner_depth.increment()?;
1411                }
1412                let val_ref = self.test_case_id.get_or_insert_with(|| fidl::new_empty!(u32, D));
1413                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
1414                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1415                {
1416                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1417                }
1418                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1419                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1420                }
1421            }
1422
1423            next_offset += envelope_size;
1424
1425            // Decode the remaining unknown envelopes.
1426            while next_offset < end_offset {
1427                _next_ordinal_to_read += 1;
1428                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1429                next_offset += envelope_size;
1430            }
1431
1432            Ok(())
1433        }
1434    }
1435
1436    impl TestCaseFoundEventDetails {
1437        #[inline(always)]
1438        fn max_ordinal_present(&self) -> u64 {
1439            if let Some(_) = self.test_case_id {
1440                return 2;
1441            }
1442            if let Some(_) = self.test_case_name {
1443                return 1;
1444            }
1445            0
1446        }
1447    }
1448
1449    impl fidl::encoding::ValueTypeMarker for TestCaseFoundEventDetails {
1450        type Borrowed<'a> = &'a Self;
1451        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1452            value
1453        }
1454    }
1455
1456    unsafe impl fidl::encoding::TypeMarker for TestCaseFoundEventDetails {
1457        type Owned = Self;
1458
1459        #[inline(always)]
1460        fn inline_align(_context: fidl::encoding::Context) -> usize {
1461            8
1462        }
1463
1464        #[inline(always)]
1465        fn inline_size(_context: fidl::encoding::Context) -> usize {
1466            16
1467        }
1468    }
1469
1470    unsafe impl<D: fidl::encoding::ResourceDialect>
1471        fidl::encoding::Encode<TestCaseFoundEventDetails, D> for &TestCaseFoundEventDetails
1472    {
1473        unsafe fn encode(
1474            self,
1475            encoder: &mut fidl::encoding::Encoder<'_, D>,
1476            offset: usize,
1477            mut depth: fidl::encoding::Depth,
1478        ) -> fidl::Result<()> {
1479            encoder.debug_check_bounds::<TestCaseFoundEventDetails>(offset);
1480            // Vector header
1481            let max_ordinal: u64 = self.max_ordinal_present();
1482            encoder.write_num(max_ordinal, offset);
1483            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1484            // Calling encoder.out_of_line_offset(0) is not allowed.
1485            if max_ordinal == 0 {
1486                return Ok(());
1487            }
1488            depth.increment()?;
1489            let envelope_size = 8;
1490            let bytes_len = max_ordinal as usize * envelope_size;
1491            #[allow(unused_variables)]
1492            let offset = encoder.out_of_line_offset(bytes_len);
1493            let mut _prev_end_offset: usize = 0;
1494            if 1 > max_ordinal {
1495                return Ok(());
1496            }
1497
1498            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1499            // are envelope_size bytes.
1500            let cur_offset: usize = (1 - 1) * envelope_size;
1501
1502            // Zero reserved fields.
1503            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1504
1505            // Safety:
1506            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1507            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1508            //   envelope_size bytes, there is always sufficient room.
1509            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<2048>, D>(
1510            self.test_case_name.as_ref().map(<fidl::encoding::BoundedString<2048> as fidl::encoding::ValueTypeMarker>::borrow),
1511            encoder, offset + cur_offset, depth
1512        )?;
1513
1514            _prev_end_offset = cur_offset + envelope_size;
1515            if 2 > max_ordinal {
1516                return Ok(());
1517            }
1518
1519            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1520            // are envelope_size bytes.
1521            let cur_offset: usize = (2 - 1) * envelope_size;
1522
1523            // Zero reserved fields.
1524            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1525
1526            // Safety:
1527            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1528            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1529            //   envelope_size bytes, there is always sufficient room.
1530            fidl::encoding::encode_in_envelope_optional::<u32, D>(
1531                self.test_case_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
1532                encoder,
1533                offset + cur_offset,
1534                depth,
1535            )?;
1536
1537            _prev_end_offset = cur_offset + envelope_size;
1538
1539            Ok(())
1540        }
1541    }
1542
1543    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1544        for TestCaseFoundEventDetails
1545    {
1546        #[inline(always)]
1547        fn new_empty() -> Self {
1548            Self::default()
1549        }
1550
1551        unsafe fn decode(
1552            &mut self,
1553            decoder: &mut fidl::encoding::Decoder<'_, D>,
1554            offset: usize,
1555            mut depth: fidl::encoding::Depth,
1556        ) -> fidl::Result<()> {
1557            decoder.debug_check_bounds::<Self>(offset);
1558            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1559                None => return Err(fidl::Error::NotNullable),
1560                Some(len) => len,
1561            };
1562            // Calling decoder.out_of_line_offset(0) is not allowed.
1563            if len == 0 {
1564                return Ok(());
1565            };
1566            depth.increment()?;
1567            let envelope_size = 8;
1568            let bytes_len = len * envelope_size;
1569            let offset = decoder.out_of_line_offset(bytes_len)?;
1570            // Decode the envelope for each type.
1571            let mut _next_ordinal_to_read = 0;
1572            let mut next_offset = offset;
1573            let end_offset = offset + bytes_len;
1574            _next_ordinal_to_read += 1;
1575            if next_offset >= end_offset {
1576                return Ok(());
1577            }
1578
1579            // Decode unknown envelopes for gaps in ordinals.
1580            while _next_ordinal_to_read < 1 {
1581                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1582                _next_ordinal_to_read += 1;
1583                next_offset += envelope_size;
1584            }
1585
1586            let next_out_of_line = decoder.next_out_of_line();
1587            let handles_before = decoder.remaining_handles();
1588            if let Some((inlined, num_bytes, num_handles)) =
1589                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1590            {
1591                let member_inline_size = <fidl::encoding::BoundedString<2048> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1592                if inlined != (member_inline_size <= 4) {
1593                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1594                }
1595                let inner_offset;
1596                let mut inner_depth = depth.clone();
1597                if inlined {
1598                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1599                    inner_offset = next_offset;
1600                } else {
1601                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1602                    inner_depth.increment()?;
1603                }
1604                let val_ref = self.test_case_name.get_or_insert_with(|| {
1605                    fidl::new_empty!(fidl::encoding::BoundedString<2048>, D)
1606                });
1607                fidl::decode!(
1608                    fidl::encoding::BoundedString<2048>,
1609                    D,
1610                    val_ref,
1611                    decoder,
1612                    inner_offset,
1613                    inner_depth
1614                )?;
1615                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1616                {
1617                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1618                }
1619                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1620                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1621                }
1622            }
1623
1624            next_offset += envelope_size;
1625            _next_ordinal_to_read += 1;
1626            if next_offset >= end_offset {
1627                return Ok(());
1628            }
1629
1630            // Decode unknown envelopes for gaps in ordinals.
1631            while _next_ordinal_to_read < 2 {
1632                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1633                _next_ordinal_to_read += 1;
1634                next_offset += envelope_size;
1635            }
1636
1637            let next_out_of_line = decoder.next_out_of_line();
1638            let handles_before = decoder.remaining_handles();
1639            if let Some((inlined, num_bytes, num_handles)) =
1640                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1641            {
1642                let member_inline_size =
1643                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1644                if inlined != (member_inline_size <= 4) {
1645                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1646                }
1647                let inner_offset;
1648                let mut inner_depth = depth.clone();
1649                if inlined {
1650                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1651                    inner_offset = next_offset;
1652                } else {
1653                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1654                    inner_depth.increment()?;
1655                }
1656                let val_ref = self.test_case_id.get_or_insert_with(|| fidl::new_empty!(u32, D));
1657                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
1658                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1659                {
1660                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1661                }
1662                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1663                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1664                }
1665            }
1666
1667            next_offset += envelope_size;
1668
1669            // Decode the remaining unknown envelopes.
1670            while next_offset < end_offset {
1671                _next_ordinal_to_read += 1;
1672                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1673                next_offset += envelope_size;
1674            }
1675
1676            Ok(())
1677        }
1678    }
1679
1680    impl TestCaseStartedEventDetails {
1681        #[inline(always)]
1682        fn max_ordinal_present(&self) -> u64 {
1683            if let Some(_) = self.test_case_id {
1684                return 1;
1685            }
1686            0
1687        }
1688    }
1689
1690    impl fidl::encoding::ValueTypeMarker for TestCaseStartedEventDetails {
1691        type Borrowed<'a> = &'a Self;
1692        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1693            value
1694        }
1695    }
1696
1697    unsafe impl fidl::encoding::TypeMarker for TestCaseStartedEventDetails {
1698        type Owned = Self;
1699
1700        #[inline(always)]
1701        fn inline_align(_context: fidl::encoding::Context) -> usize {
1702            8
1703        }
1704
1705        #[inline(always)]
1706        fn inline_size(_context: fidl::encoding::Context) -> usize {
1707            16
1708        }
1709    }
1710
1711    unsafe impl<D: fidl::encoding::ResourceDialect>
1712        fidl::encoding::Encode<TestCaseStartedEventDetails, D> for &TestCaseStartedEventDetails
1713    {
1714        unsafe fn encode(
1715            self,
1716            encoder: &mut fidl::encoding::Encoder<'_, D>,
1717            offset: usize,
1718            mut depth: fidl::encoding::Depth,
1719        ) -> fidl::Result<()> {
1720            encoder.debug_check_bounds::<TestCaseStartedEventDetails>(offset);
1721            // Vector header
1722            let max_ordinal: u64 = self.max_ordinal_present();
1723            encoder.write_num(max_ordinal, offset);
1724            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1725            // Calling encoder.out_of_line_offset(0) is not allowed.
1726            if max_ordinal == 0 {
1727                return Ok(());
1728            }
1729            depth.increment()?;
1730            let envelope_size = 8;
1731            let bytes_len = max_ordinal as usize * envelope_size;
1732            #[allow(unused_variables)]
1733            let offset = encoder.out_of_line_offset(bytes_len);
1734            let mut _prev_end_offset: usize = 0;
1735            if 1 > max_ordinal {
1736                return Ok(());
1737            }
1738
1739            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1740            // are envelope_size bytes.
1741            let cur_offset: usize = (1 - 1) * envelope_size;
1742
1743            // Zero reserved fields.
1744            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1745
1746            // Safety:
1747            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1748            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1749            //   envelope_size bytes, there is always sufficient room.
1750            fidl::encoding::encode_in_envelope_optional::<u32, D>(
1751                self.test_case_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
1752                encoder,
1753                offset + cur_offset,
1754                depth,
1755            )?;
1756
1757            _prev_end_offset = cur_offset + envelope_size;
1758
1759            Ok(())
1760        }
1761    }
1762
1763    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1764        for TestCaseStartedEventDetails
1765    {
1766        #[inline(always)]
1767        fn new_empty() -> Self {
1768            Self::default()
1769        }
1770
1771        unsafe fn decode(
1772            &mut self,
1773            decoder: &mut fidl::encoding::Decoder<'_, D>,
1774            offset: usize,
1775            mut depth: fidl::encoding::Depth,
1776        ) -> fidl::Result<()> {
1777            decoder.debug_check_bounds::<Self>(offset);
1778            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1779                None => return Err(fidl::Error::NotNullable),
1780                Some(len) => len,
1781            };
1782            // Calling decoder.out_of_line_offset(0) is not allowed.
1783            if len == 0 {
1784                return Ok(());
1785            };
1786            depth.increment()?;
1787            let envelope_size = 8;
1788            let bytes_len = len * envelope_size;
1789            let offset = decoder.out_of_line_offset(bytes_len)?;
1790            // Decode the envelope for each type.
1791            let mut _next_ordinal_to_read = 0;
1792            let mut next_offset = offset;
1793            let end_offset = offset + bytes_len;
1794            _next_ordinal_to_read += 1;
1795            if next_offset >= end_offset {
1796                return Ok(());
1797            }
1798
1799            // Decode unknown envelopes for gaps in ordinals.
1800            while _next_ordinal_to_read < 1 {
1801                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1802                _next_ordinal_to_read += 1;
1803                next_offset += envelope_size;
1804            }
1805
1806            let next_out_of_line = decoder.next_out_of_line();
1807            let handles_before = decoder.remaining_handles();
1808            if let Some((inlined, num_bytes, num_handles)) =
1809                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1810            {
1811                let member_inline_size =
1812                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1813                if inlined != (member_inline_size <= 4) {
1814                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1815                }
1816                let inner_offset;
1817                let mut inner_depth = depth.clone();
1818                if inlined {
1819                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1820                    inner_offset = next_offset;
1821                } else {
1822                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1823                    inner_depth.increment()?;
1824                }
1825                let val_ref = self.test_case_id.get_or_insert_with(|| fidl::new_empty!(u32, D));
1826                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
1827                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1828                {
1829                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1830                }
1831                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1832                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1833                }
1834            }
1835
1836            next_offset += envelope_size;
1837
1838            // Decode the remaining unknown envelopes.
1839            while next_offset < end_offset {
1840                _next_ordinal_to_read += 1;
1841                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1842                next_offset += envelope_size;
1843            }
1844
1845            Ok(())
1846        }
1847    }
1848
1849    impl TestCaseStoppedEventDetails {
1850        #[inline(always)]
1851        fn max_ordinal_present(&self) -> u64 {
1852            if let Some(_) = self.result {
1853                return 2;
1854            }
1855            if let Some(_) = self.test_case_id {
1856                return 1;
1857            }
1858            0
1859        }
1860    }
1861
1862    impl fidl::encoding::ValueTypeMarker for TestCaseStoppedEventDetails {
1863        type Borrowed<'a> = &'a Self;
1864        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1865            value
1866        }
1867    }
1868
1869    unsafe impl fidl::encoding::TypeMarker for TestCaseStoppedEventDetails {
1870        type Owned = Self;
1871
1872        #[inline(always)]
1873        fn inline_align(_context: fidl::encoding::Context) -> usize {
1874            8
1875        }
1876
1877        #[inline(always)]
1878        fn inline_size(_context: fidl::encoding::Context) -> usize {
1879            16
1880        }
1881    }
1882
1883    unsafe impl<D: fidl::encoding::ResourceDialect>
1884        fidl::encoding::Encode<TestCaseStoppedEventDetails, D> for &TestCaseStoppedEventDetails
1885    {
1886        unsafe fn encode(
1887            self,
1888            encoder: &mut fidl::encoding::Encoder<'_, D>,
1889            offset: usize,
1890            mut depth: fidl::encoding::Depth,
1891        ) -> fidl::Result<()> {
1892            encoder.debug_check_bounds::<TestCaseStoppedEventDetails>(offset);
1893            // Vector header
1894            let max_ordinal: u64 = self.max_ordinal_present();
1895            encoder.write_num(max_ordinal, offset);
1896            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1897            // Calling encoder.out_of_line_offset(0) is not allowed.
1898            if max_ordinal == 0 {
1899                return Ok(());
1900            }
1901            depth.increment()?;
1902            let envelope_size = 8;
1903            let bytes_len = max_ordinal as usize * envelope_size;
1904            #[allow(unused_variables)]
1905            let offset = encoder.out_of_line_offset(bytes_len);
1906            let mut _prev_end_offset: usize = 0;
1907            if 1 > max_ordinal {
1908                return Ok(());
1909            }
1910
1911            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1912            // are envelope_size bytes.
1913            let cur_offset: usize = (1 - 1) * envelope_size;
1914
1915            // Zero reserved fields.
1916            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1917
1918            // Safety:
1919            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1920            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1921            //   envelope_size bytes, there is always sufficient room.
1922            fidl::encoding::encode_in_envelope_optional::<u32, D>(
1923                self.test_case_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
1924                encoder,
1925                offset + cur_offset,
1926                depth,
1927            )?;
1928
1929            _prev_end_offset = cur_offset + envelope_size;
1930            if 2 > max_ordinal {
1931                return Ok(());
1932            }
1933
1934            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1935            // are envelope_size bytes.
1936            let cur_offset: usize = (2 - 1) * envelope_size;
1937
1938            // Zero reserved fields.
1939            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1940
1941            // Safety:
1942            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1943            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1944            //   envelope_size bytes, there is always sufficient room.
1945            fidl::encoding::encode_in_envelope_optional::<TestCaseResult, D>(
1946                self.result
1947                    .as_ref()
1948                    .map(<TestCaseResult as fidl::encoding::ValueTypeMarker>::borrow),
1949                encoder,
1950                offset + cur_offset,
1951                depth,
1952            )?;
1953
1954            _prev_end_offset = cur_offset + envelope_size;
1955
1956            Ok(())
1957        }
1958    }
1959
1960    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1961        for TestCaseStoppedEventDetails
1962    {
1963        #[inline(always)]
1964        fn new_empty() -> Self {
1965            Self::default()
1966        }
1967
1968        unsafe fn decode(
1969            &mut self,
1970            decoder: &mut fidl::encoding::Decoder<'_, D>,
1971            offset: usize,
1972            mut depth: fidl::encoding::Depth,
1973        ) -> fidl::Result<()> {
1974            decoder.debug_check_bounds::<Self>(offset);
1975            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1976                None => return Err(fidl::Error::NotNullable),
1977                Some(len) => len,
1978            };
1979            // Calling decoder.out_of_line_offset(0) is not allowed.
1980            if len == 0 {
1981                return Ok(());
1982            };
1983            depth.increment()?;
1984            let envelope_size = 8;
1985            let bytes_len = len * envelope_size;
1986            let offset = decoder.out_of_line_offset(bytes_len)?;
1987            // Decode the envelope for each type.
1988            let mut _next_ordinal_to_read = 0;
1989            let mut next_offset = offset;
1990            let end_offset = offset + bytes_len;
1991            _next_ordinal_to_read += 1;
1992            if next_offset >= end_offset {
1993                return Ok(());
1994            }
1995
1996            // Decode unknown envelopes for gaps in ordinals.
1997            while _next_ordinal_to_read < 1 {
1998                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1999                _next_ordinal_to_read += 1;
2000                next_offset += envelope_size;
2001            }
2002
2003            let next_out_of_line = decoder.next_out_of_line();
2004            let handles_before = decoder.remaining_handles();
2005            if let Some((inlined, num_bytes, num_handles)) =
2006                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2007            {
2008                let member_inline_size =
2009                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2010                if inlined != (member_inline_size <= 4) {
2011                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2012                }
2013                let inner_offset;
2014                let mut inner_depth = depth.clone();
2015                if inlined {
2016                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2017                    inner_offset = next_offset;
2018                } else {
2019                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2020                    inner_depth.increment()?;
2021                }
2022                let val_ref = self.test_case_id.get_or_insert_with(|| fidl::new_empty!(u32, D));
2023                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
2024                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2025                {
2026                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2027                }
2028                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2029                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2030                }
2031            }
2032
2033            next_offset += envelope_size;
2034            _next_ordinal_to_read += 1;
2035            if next_offset >= end_offset {
2036                return Ok(());
2037            }
2038
2039            // Decode unknown envelopes for gaps in ordinals.
2040            while _next_ordinal_to_read < 2 {
2041                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2042                _next_ordinal_to_read += 1;
2043                next_offset += envelope_size;
2044            }
2045
2046            let next_out_of_line = decoder.next_out_of_line();
2047            let handles_before = decoder.remaining_handles();
2048            if let Some((inlined, num_bytes, num_handles)) =
2049                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2050            {
2051                let member_inline_size =
2052                    <TestCaseResult as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2053                if inlined != (member_inline_size <= 4) {
2054                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2055                }
2056                let inner_offset;
2057                let mut inner_depth = depth.clone();
2058                if inlined {
2059                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2060                    inner_offset = next_offset;
2061                } else {
2062                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2063                    inner_depth.increment()?;
2064                }
2065                let val_ref =
2066                    self.result.get_or_insert_with(|| fidl::new_empty!(TestCaseResult, D));
2067                fidl::decode!(TestCaseResult, D, val_ref, decoder, inner_offset, inner_depth)?;
2068                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2069                {
2070                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2071                }
2072                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2073                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2074                }
2075            }
2076
2077            next_offset += envelope_size;
2078
2079            // Decode the remaining unknown envelopes.
2080            while next_offset < end_offset {
2081                _next_ordinal_to_read += 1;
2082                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2083                next_offset += envelope_size;
2084            }
2085
2086            Ok(())
2087        }
2088    }
2089}