fidl_fuchsia_test_manager/
fidl_fuchsia_test_manager.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_test_manager__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct CaseArtifact {
16    pub identifier: u32,
17    pub artifact: Artifact,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CaseArtifact {}
21
22#[derive(Debug, PartialEq)]
23pub struct DebugDataIteratorGetNextCompressedResponse {
24    pub data: Vec<DebugData>,
25}
26
27impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
28    for DebugDataIteratorGetNextCompressedResponse
29{
30}
31
32#[derive(Debug, PartialEq)]
33pub struct DebugDataIteratorGetNextResponse {
34    pub data: Vec<DebugData>,
35}
36
37impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
38    for DebugDataIteratorGetNextResponse
39{
40}
41
42/// A handle to a directory and a token used to indicate when the client has
43/// completed inspecting the directory. The server end will retain all resources,
44/// such as subdirectories and files, within |directory| while |release_fence| remains open.
45/// |release_fence| is used instead of observing the |directory| channel directly as it
46/// is possible to clone and open new channels to the same directory.
47#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
48pub struct DirectoryAndToken {
49    /// `Directory` channel providing access to the directory. This channel should not be used
50    /// after `release_fence` is closed.
51    pub directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
52    /// An eventpair handle used to control the retention of the directory. When this handle is
53    /// closed, the directory is no longer retained.
54    pub token: fidl::EventPair,
55}
56
57impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryAndToken {}
58
59#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
60pub struct EarlyBootProfileRegisterWatcherRequest {
61    pub iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
62}
63
64impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
65    for EarlyBootProfileRegisterWatcherRequest
66{
67}
68
69#[derive(Debug, PartialEq)]
70pub struct QueryEnumerateInRealmRequest {
71    pub test_url: String,
72    /// The realm which contains the collection to launch the test in
73    pub realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
74    /// All offers from the realm to the test collection
75    pub offers: Vec<fidl_fuchsia_component_decl::Offer>,
76    /// the test collection to launch the test in.
77    pub test_collection: String,
78    pub iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
79}
80
81impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
82    for QueryEnumerateInRealmRequest
83{
84}
85
86#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
87pub struct QueryEnumerateRequest {
88    pub test_url: String,
89    pub iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
90}
91
92impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for QueryEnumerateRequest {}
93
94#[derive(Debug, PartialEq)]
95pub struct RunBuilderAddSuiteInRealmRequest {
96    /// The realm which contains the collection to launch the test in
97    pub realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
98    /// All offers from the realm to the test collection
99    pub offers: Vec<fidl_fuchsia_component_decl::Offer>,
100    /// the test collection to launch the test in.
101    pub test_collection: String,
102    pub test_url: String,
103    pub options: RunOptions,
104    pub controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
105}
106
107impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
108    for RunBuilderAddSuiteInRealmRequest
109{
110}
111
112#[derive(Debug, PartialEq)]
113pub struct RunBuilderAddSuiteRequest {
114    pub test_url: String,
115    pub options: RunOptions,
116    pub controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
117}
118
119impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RunBuilderAddSuiteRequest {}
120
121#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
122pub struct RunBuilderBuildRequest {
123    pub controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
124}
125
126impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RunBuilderBuildRequest {}
127
128#[derive(Debug, PartialEq)]
129pub struct RunControllerGetEventsResponse {
130    pub events: Vec<RunEvent>,
131}
132
133impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
134    for RunControllerGetEventsResponse
135{
136}
137
138#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
139pub struct Stderr {
140    pub socket: fidl::Socket,
141}
142
143impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Stderr {}
144
145#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
146pub struct Stdout {
147    pub socket: fidl::Socket,
148}
149
150impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Stdout {}
151
152#[derive(Debug, PartialEq)]
153pub struct SuiteArtifact {
154    pub artifact: Artifact,
155}
156
157impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SuiteArtifact {}
158
159#[derive(Debug, PartialEq)]
160pub struct SuiteControllerGetEventsResponse {
161    pub events: Vec<SuiteEvent>,
162}
163
164impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
165    for SuiteControllerGetEventsResponse
166{
167}
168
169#[derive(Debug, PartialEq)]
170pub struct SuiteControllerWatchEventsResponse {
171    pub events: Vec<Event>,
172}
173
174impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
175    for SuiteControllerWatchEventsResponse
176{
177}
178
179#[derive(Debug, PartialEq)]
180pub struct SuiteRunnerRunRequest {
181    /// The URL of the test component implementing the test suite to run.
182    pub test_suite_url: String,
183    /// Options specifying how the suite should be run.
184    pub options: RunSuiteOptions,
185    /// Server end of the suite controller. The client uses the controller to control the
186    /// execution of the test suite and to collect events regarding the suite run.
187    pub controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
188}
189
190impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SuiteRunnerRunRequest {}
191
192#[derive(Debug, PartialEq)]
193pub struct TestCaseEnumeratorEnumerateRequest {
194    /// The URL of the test component implementing the test suite.
195    pub test_suite_url: String,
196    /// Options specifying how the suite should be run.
197    pub options: EnumerateTestCasesOptions,
198    /// Server end of the test case iterator.
199    pub iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
200}
201
202impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
203    for TestCaseEnumeratorEnumerateRequest
204{
205}
206
207/// Describes a directory containing 'custom' (unclassified) artifacts produced by a test.
208#[derive(Debug, Default, PartialEq)]
209pub struct CustomArtifact {
210    /// The moniker of the component that produced the directory, relative to
211    /// the root of the test realm.
212    pub component_moniker: Option<String>,
213    /// A directory containing the artifacts.
214    pub directory_and_token: Option<DirectoryAndToken>,
215    #[doc(hidden)]
216    pub __source_breaking: fidl::marker::SourceBreaking,
217}
218
219impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CustomArtifact {}
220
221/// Describes available debug data.
222#[derive(Debug, Default, PartialEq)]
223pub struct DebugData {
224    /// Name of the file. Must be unique per `DebugDataIterator`.
225    pub name: Option<String>,
226    /// Socket over which the file may be accessed.
227    pub socket: Option<fidl::Socket>,
228    #[doc(hidden)]
229    pub __source_breaking: fidl::marker::SourceBreaking,
230}
231
232impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DebugData {}
233
234/// Options specifying how test cases should be enumerated.
235#[derive(Debug, Default, PartialEq)]
236pub struct EnumerateTestCasesOptions {
237    /// Specifies the realm in which to enumerate test cases. If this field is not supplied, the
238    /// test cases will be enumerated in a hermetic realm inside the test manager. This option is
239    /// used by clients that require non-hermetic realms or test realms with custom runners.
240    pub realm_options: Option<RealmOptions>,
241    #[doc(hidden)]
242    pub __source_breaking: fidl::marker::SourceBreaking,
243}
244
245impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for EnumerateTestCasesOptions {}
246
247/// An event delivered via `SuiteController.WatchEvents`.
248#[derive(Debug, Default, PartialEq)]
249pub struct Event {
250    /// The time at which the event occurred.
251    pub timestamp: Option<i64>,
252    /// The details of the event.
253    pub details: Option<EventDetails>,
254    #[doc(hidden)]
255    pub __source_breaking: fidl::marker::SourceBreaking,
256}
257
258impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Event {}
259
260/// Options specifying the realm in which a test suite should be run. These options are
261/// used by clients that require non-hermetic realms or test realms with custom runners.
262/// See [https://fuchsia.dev/fuchsia-src/development/testing/components/create_test_realm]
263/// and [https://fuchsia.dev/fuchsia-src/development/testing/components/test_runner_framework#non-hermetic_tests]
264/// for details.
265#[derive(Debug, Default, PartialEq)]
266pub struct RealmOptions {
267    /// The realm which contains the collection in which to launch the test. This field is required.
268    pub realm: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>>,
269    /// All offers from the realm to the test collection. This field is required.
270    pub offers: Option<Vec<fidl_fuchsia_component_decl::Offer>>,
271    /// The test collection in which to launch the test. This field is required.
272    pub test_collection: Option<String>,
273    #[doc(hidden)]
274    pub __source_breaking: fidl::marker::SourceBreaking,
275}
276
277impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RealmOptions {}
278
279#[derive(Debug, Default, PartialEq)]
280pub struct RunEvent {
281    pub timestamp: Option<i64>,
282    pub payload: Option<RunEventPayload>,
283    #[doc(hidden)]
284    pub __source_breaking: fidl::marker::SourceBreaking,
285}
286
287impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RunEvent {}
288
289/// Options specifying how a test suite should be run.
290#[derive(Debug, Default, PartialEq)]
291pub struct RunSuiteOptions {
292    /// Specifies the realm in which to run the test suite. If this field is not supplied, the
293    /// test will run in a hermetic realm inside the test manager.  This option is
294    /// used by clients that require non-hermetic realms or test realms with custom runners.
295    pub realm_options: Option<RealmOptions>,
296    /// If set to true, test cases that have been disabled by the test author will
297    /// nonetheless be executed. This value is false by default.
298    pub run_disabled_tests: Option<bool>,
299    /// Defines the maximum number of test cases to run concurrently. If unspecified, the
300    /// test suite component decides this value.
301    pub max_concurrent_test_case_runs: Option<u16>,
302    /// Command-line arguments to pass to the test. Test runners decide how to pass these
303    /// arguments to tests. This value is an empty vector (no arguments) by default.
304    pub arguments: Option<Vec<String>>,
305    /// Timeout for the entire suite run. If unspecified, there is no timeout, and the suite run
306    /// may hang indefinitely.
307    pub timeout: Option<i64>,
308    /// Test case filters as glob patterns [https://en.wikipedia.org/wiki/Glob_(programming)].
309    /// Negative filters may be specified by prepending '-'. This value is an empty vector
310    /// (no filters) by default.
311    ///
312    /// A given test case is run if both of the following are true:
313    ///  * No positive filters are specfied, or the test case matches one of the positive filters.
314    ///  * The test case does not match any specified negative filter.
315    ///
316    /// For example, given that a suite has the test cases `Foo.Test1`, `Foo.Test2`, `Bar.Test1`,
317    /// and `Bar.Test2`:
318    ///  * The filters `["Foo.*"]` will execute `Foo.Test1` and `Foo.Test2`.
319    ///  * The filters `["-Foo.*"]` will execute `Bar.Test1` and `Bar.Test2`.
320    ///  * The filters `["Foo.*", "-*.Test1"]` will execute `Foo.Test2`.
321    pub test_case_filters: Option<Vec<String>>,
322    /// Specifies what kind of iterator the client will use for retrieving logs. This value is
323    /// `BATCH` by default.
324    pub logs_iterator_type: Option<LogsIteratorType>,
325    /// Configures the minimum severity to apply when filtering logs from the test suite
326    /// component.
327    pub log_interest: Option<Vec<fidl_fuchsia_diagnostics::LogInterestSelector>>,
328    /// If set to true, debug data collected for this run will be accumulated in test manager's
329    /// tmp folder with debug data collected in previous runs with this flag set true. Defaults
330    /// to false.
331    ///
332    /// This option is used when many tests are run in a batch, and delivering the accumulated
333    /// data is more performant than delivering the debug data one test at a time.
334    pub accumulate_debug_data: Option<bool>,
335    /// If true, indicates the test creates an exception channel. In this case, the test manager
336    /// will refrain from creating its own exception channels to avoid conflicts. Default value
337    /// is false.
338    pub no_exception_channel: Option<bool>,
339    /// If true, the test runner should halt (if supported) the test suite when
340    /// a failure is encountered such that a debugger may attach to the process
341    /// in the future. Test runners may safely ignore this if they do not
342    /// support stopping running test suites.
343    pub break_on_failure: Option<bool>,
344    #[doc(hidden)]
345    pub __source_breaking: fidl::marker::SourceBreaking,
346}
347
348impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RunSuiteOptions {}
349
350/// Details for `suite_artifact_generated` events.
351#[derive(Debug, Default, PartialEq)]
352pub struct SuiteArtifactGeneratedEventDetails {
353    /// Describes the artifact. This field will always be provided.
354    pub artifact: Option<Artifact>,
355    #[doc(hidden)]
356    pub __source_breaking: fidl::marker::SourceBreaking,
357}
358
359impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
360    for SuiteArtifactGeneratedEventDetails
361{
362}
363
364#[derive(Debug, Default, PartialEq)]
365pub struct SuiteEvent {
366    pub timestamp: Option<i64>,
367    pub payload: Option<SuiteEventPayload>,
368    #[doc(hidden)]
369    pub __source_breaking: fidl::marker::SourceBreaking,
370}
371
372impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SuiteEvent {}
373
374/// Details for `test_case_artifact_generated` events.
375#[derive(Debug, Default, PartialEq)]
376pub struct TestCaseArtifactGeneratedEventDetails {
377    /// The test case to which this event pertains. This event will be preceeded by a
378    /// 'test_case found' event with a matching id. This field will always be provided.
379    pub test_case_id: Option<u32>,
380    /// Describes the artifact. This field will always be provided.
381    pub artifact: Option<Artifact>,
382    #[doc(hidden)]
383    pub __source_breaking: fidl::marker::SourceBreaking,
384}
385
386impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
387    for TestCaseArtifactGeneratedEventDetails
388{
389}
390
391/// Describes one or more artifacts.
392#[derive(Debug)]
393pub enum Artifact {
394    /// The artifact is the 'stdout' stream of the suite or test case. The artifact is delivered via
395    /// a socket, the consumer end of which is provided here.
396    Stdout(fidl::Socket),
397    /// The artifact is the 'stderr' stream of the suite or test case. The artifact is delivered via
398    /// a socket, the consumer end of which is provided here.
399    Stderr(fidl::Socket),
400    /// The artifact is the syslog of the suite or test case. The artifact is delivered using a batch
401    /// iterator or socket.
402    Log(Syslog),
403    /// The artifacts are one or more files in a directory and may be read using `fuchsia.io`.
404    Custom(CustomArtifact),
405    /// The artifacts are debug data delivered using a `DebugDataIterator` channel.
406    DebugData(fidl::endpoints::ClientEnd<DebugDataIteratorMarker>),
407    #[doc(hidden)]
408    __SourceBreaking { unknown_ordinal: u64 },
409}
410
411/// Pattern that matches an unknown `Artifact` member.
412#[macro_export]
413macro_rules! ArtifactUnknown {
414    () => {
415        _
416    };
417}
418
419// Custom PartialEq so that unknown variants are not equal to themselves.
420impl PartialEq for Artifact {
421    fn eq(&self, other: &Self) -> bool {
422        match (self, other) {
423            (Self::Stdout(x), Self::Stdout(y)) => *x == *y,
424            (Self::Stderr(x), Self::Stderr(y)) => *x == *y,
425            (Self::Log(x), Self::Log(y)) => *x == *y,
426            (Self::Custom(x), Self::Custom(y)) => *x == *y,
427            (Self::DebugData(x), Self::DebugData(y)) => *x == *y,
428            _ => false,
429        }
430    }
431}
432
433impl Artifact {
434    #[inline]
435    pub fn ordinal(&self) -> u64 {
436        match *self {
437            Self::Stdout(_) => 1,
438            Self::Stderr(_) => 2,
439            Self::Log(_) => 3,
440            Self::Custom(_) => 4,
441            Self::DebugData(_) => 5,
442            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
443        }
444    }
445
446    #[inline]
447    pub fn unknown_variant_for_testing() -> Self {
448        Self::__SourceBreaking { unknown_ordinal: 0 }
449    }
450
451    #[inline]
452    pub fn is_unknown(&self) -> bool {
453        match self {
454            Self::__SourceBreaking { .. } => true,
455            _ => false,
456        }
457    }
458}
459
460impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Artifact {}
461
462/// Details of an event delivered via `SuiteController.GetEvents`.
463///
464/// A `suite_started` event always precedes any events relating to test cases, and a
465/// `suite_stopped` event always follows any test case events. `suite_artifact_generated` may
466/// occur at any point, including before `suite_started` and after `suite_stopped`.
467///
468/// A `test_case_found` event is produced for all test cases found in the suite.
469/// If a particular test case run is enabled (based on `RunSuiteOptions.test_case_filters` and
470/// `RunSuiteOptions.run_disabled_tests`), the following sequence is produced, regardless of whether
471/// the test case is actually run, the run completes or whether or not it succeeds:
472///
473/// - `test_case_found`
474/// - `test_case_started`
475/// - `test_case_stopped`
476/// - `test_case_finished`
477///
478/// `test_case_artifact_generated` events for the test case may occur at any point after the
479/// `test_case_found` event and before `test_case_finished` event for that test case. Note that
480/// test case events for multiple events may be interleaved.
481///
482/// If a test case run is not enabled, only the `test_case_found` event will be produced for
483/// that test case.
484#[derive(Debug)]
485pub enum EventDetails {
486    /// Suite started execution.  `suite_artifact_generated` events may occur before this event.
487    SuiteStarted(SuiteStartedEventDetails),
488    /// A test_case was found. This is always the first event for a given test case.
489    TestCaseFound(TestCaseFoundEventDetails),
490    /// A test case started execution. Only one `test_case_started` event is produced for a given test case,
491    /// and it always precedes the `test_case_stopped` event for that test case.
492    /// `test_case_artifact_generated` events for the test case may occur before this event.
493    TestCaseStarted(TestCaseStartedEventDetails),
494    /// Artifact from a test case. Note that `test_case_artifact_generated` events for a given test
495    /// case may occur before `test_case_started` and after `test_case_stopped`.
496    TestCaseArtifactGenerated(TestCaseArtifactGeneratedEventDetails),
497    /// A test case stopped executing. This event includes the resulting `TestCaseResult` of the test case.
498    /// `test_case_artifact_generated` events for the case may occur after this event.
499    TestCaseStopped(TestCaseStoppedEventDetails),
500    /// A test case has finished and all artifact events have been dispatched to the client. This
501    /// is always the last event for a given test case.
502    TestCaseFinished(TestCaseFinishedEventDetails),
503    /// Artifact pertaining to the entire suite.
504    SuiteArtifactGenerated(SuiteArtifactGeneratedEventDetails),
505    /// Suite run stopped executing. This event includes the resulting `SuiteResult` of the suite.
506    /// `suite_artifact_generated` events may occur after this event.
507    SuiteStopped(SuiteStoppedEventDetails),
508    #[doc(hidden)]
509    __SourceBreaking { unknown_ordinal: u64 },
510}
511
512/// Pattern that matches an unknown `EventDetails` member.
513#[macro_export]
514macro_rules! EventDetailsUnknown {
515    () => {
516        _
517    };
518}
519
520// Custom PartialEq so that unknown variants are not equal to themselves.
521impl PartialEq for EventDetails {
522    fn eq(&self, other: &Self) -> bool {
523        match (self, other) {
524            (Self::SuiteStarted(x), Self::SuiteStarted(y)) => *x == *y,
525            (Self::TestCaseFound(x), Self::TestCaseFound(y)) => *x == *y,
526            (Self::TestCaseStarted(x), Self::TestCaseStarted(y)) => *x == *y,
527            (Self::TestCaseArtifactGenerated(x), Self::TestCaseArtifactGenerated(y)) => *x == *y,
528            (Self::TestCaseStopped(x), Self::TestCaseStopped(y)) => *x == *y,
529            (Self::TestCaseFinished(x), Self::TestCaseFinished(y)) => *x == *y,
530            (Self::SuiteArtifactGenerated(x), Self::SuiteArtifactGenerated(y)) => *x == *y,
531            (Self::SuiteStopped(x), Self::SuiteStopped(y)) => *x == *y,
532            _ => false,
533        }
534    }
535}
536
537impl EventDetails {
538    #[inline]
539    pub fn ordinal(&self) -> u64 {
540        match *self {
541            Self::SuiteStarted(_) => 1,
542            Self::TestCaseFound(_) => 2,
543            Self::TestCaseStarted(_) => 3,
544            Self::TestCaseArtifactGenerated(_) => 4,
545            Self::TestCaseStopped(_) => 5,
546            Self::TestCaseFinished(_) => 6,
547            Self::SuiteArtifactGenerated(_) => 7,
548            Self::SuiteStopped(_) => 8,
549            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
550        }
551    }
552
553    #[inline]
554    pub fn unknown_variant_for_testing() -> Self {
555        Self::__SourceBreaking { unknown_ordinal: 0 }
556    }
557
558    #[inline]
559    pub fn is_unknown(&self) -> bool {
560        match self {
561            Self::__SourceBreaking { .. } => true,
562            _ => false,
563        }
564    }
565}
566
567impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for EventDetails {}
568
569/// Holds the server end of an iterator over the isolated logs of a test.
570#[derive(Debug)]
571pub enum LogsIterator {
572    /// Server end of the iterator, when this protocol is used by Fuchsia clients.
573    Batch(fidl::endpoints::ServerEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>),
574    /// Server end of the iterator, when this protocol is used by host-side clients.
575    /// This uses the protocol specified in fuchsia.diagnostics.host.ArchiveReader.
576    Stream(fidl::Socket),
577    #[doc(hidden)]
578    __SourceBreaking { unknown_ordinal: u64 },
579}
580
581/// Pattern that matches an unknown `LogsIterator` member.
582#[macro_export]
583macro_rules! LogsIteratorUnknown {
584    () => {
585        _
586    };
587}
588
589// Custom PartialEq so that unknown variants are not equal to themselves.
590impl PartialEq for LogsIterator {
591    fn eq(&self, other: &Self) -> bool {
592        match (self, other) {
593            (Self::Batch(x), Self::Batch(y)) => *x == *y,
594            (Self::Stream(x), Self::Stream(y)) => *x == *y,
595            _ => false,
596        }
597    }
598}
599
600impl LogsIterator {
601    #[inline]
602    pub fn ordinal(&self) -> u64 {
603        match *self {
604            Self::Batch(_) => 2,
605            Self::Stream(_) => 3,
606            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
607        }
608    }
609
610    #[inline]
611    pub fn unknown_variant_for_testing() -> Self {
612        Self::__SourceBreaking { unknown_ordinal: 0 }
613    }
614
615    #[inline]
616    pub fn is_unknown(&self) -> bool {
617        match self {
618            Self::__SourceBreaking { .. } => true,
619            _ => false,
620        }
621    }
622}
623
624impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LogsIterator {}
625
626/// Various events for run execution. The first event for a test run will
627/// always be `run_started`. `run_stopped` fires when the test run stops
628/// and will always fire after `run_started`.
629#[derive(Debug)]
630pub enum RunEventPayload {
631    /// The test run started execution.
632    RunStarted(RunStarted),
633    /// The test run stopped executing.
634    RunStopped(RunStopped),
635    /// The test run produced an artifact.
636    Artifact(Artifact),
637    #[doc(hidden)]
638    __SourceBreaking { unknown_ordinal: u64 },
639}
640
641/// Pattern that matches an unknown `RunEventPayload` member.
642#[macro_export]
643macro_rules! RunEventPayloadUnknown {
644    () => {
645        _
646    };
647}
648
649// Custom PartialEq so that unknown variants are not equal to themselves.
650impl PartialEq for RunEventPayload {
651    fn eq(&self, other: &Self) -> bool {
652        match (self, other) {
653            (Self::RunStarted(x), Self::RunStarted(y)) => *x == *y,
654            (Self::RunStopped(x), Self::RunStopped(y)) => *x == *y,
655            (Self::Artifact(x), Self::Artifact(y)) => *x == *y,
656            _ => false,
657        }
658    }
659}
660
661impl RunEventPayload {
662    #[inline]
663    pub fn ordinal(&self) -> u64 {
664        match *self {
665            Self::RunStarted(_) => 1,
666            Self::RunStopped(_) => 2,
667            Self::Artifact(_) => 3,
668            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
669        }
670    }
671
672    #[inline]
673    pub fn unknown_variant_for_testing() -> Self {
674        Self::__SourceBreaking { unknown_ordinal: 0 }
675    }
676
677    #[inline]
678    pub fn is_unknown(&self) -> bool {
679        match self {
680            Self::__SourceBreaking { .. } => true,
681            _ => false,
682        }
683    }
684}
685
686impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RunEventPayload {}
687
688/// Various events for test execution.
689///
690/// First event for a test case will always be `case_found` and last will be
691/// `case_finished`. Events `case_started` and `case_artifact` can come in any
692/// order. There can be some `case_artifact` between `case_stopped` and
693/// `case_finished`. `suite_stopped` event will always fire when the whole
694/// suite has finished executing. Note `suite_artifact` may fire at any time.
695/// In the case where the client completely drains all events for a suite,
696/// `case_stopped` and `case_finished` will be reported for all found test
697/// cases, even if the test component fails to report a result.
698/// In the case a test is hung, GetEvents will hang and not complete, unless
699/// a timeout has been specified in RunOptions.
700#[derive(Debug)]
701pub enum SuiteEventPayload {
702    /// A case was found.
703    CaseFound(CaseFound),
704    /// A case started execution
705    CaseStarted(CaseStarted),
706    /// A case stopped executing, includes the pass/fail/skipped result of
707    /// the case. The client might still get artifacts pertaining to this test
708    /// after this event.
709    CaseStopped(CaseStopped),
710    /// A case has finished and all artifact events have been dispatched to the
711    /// client.
712    CaseFinished(CaseFinished),
713    /// Artifact from a case
714    CaseArtifact(CaseArtifact),
715    /// Artifact from a suite.
716    SuiteArtifact(SuiteArtifact),
717    /// Suite started execution
718    SuiteStarted(SuiteStarted),
719    /// Suite run stopped executing, includes the result of the suite. The
720    /// client might still get artifacts pertaining to this suite after this
721    /// event.
722    SuiteStopped(SuiteStopped),
723    #[doc(hidden)]
724    __SourceBreaking { unknown_ordinal: u64 },
725}
726
727/// Pattern that matches an unknown `SuiteEventPayload` member.
728#[macro_export]
729macro_rules! SuiteEventPayloadUnknown {
730    () => {
731        _
732    };
733}
734
735// Custom PartialEq so that unknown variants are not equal to themselves.
736impl PartialEq for SuiteEventPayload {
737    fn eq(&self, other: &Self) -> bool {
738        match (self, other) {
739            (Self::CaseFound(x), Self::CaseFound(y)) => *x == *y,
740            (Self::CaseStarted(x), Self::CaseStarted(y)) => *x == *y,
741            (Self::CaseStopped(x), Self::CaseStopped(y)) => *x == *y,
742            (Self::CaseFinished(x), Self::CaseFinished(y)) => *x == *y,
743            (Self::CaseArtifact(x), Self::CaseArtifact(y)) => *x == *y,
744            (Self::SuiteArtifact(x), Self::SuiteArtifact(y)) => *x == *y,
745            (Self::SuiteStarted(x), Self::SuiteStarted(y)) => *x == *y,
746            (Self::SuiteStopped(x), Self::SuiteStopped(y)) => *x == *y,
747            _ => false,
748        }
749    }
750}
751
752impl SuiteEventPayload {
753    #[inline]
754    pub fn ordinal(&self) -> u64 {
755        match *self {
756            Self::CaseFound(_) => 1,
757            Self::CaseStarted(_) => 2,
758            Self::CaseStopped(_) => 3,
759            Self::CaseFinished(_) => 4,
760            Self::CaseArtifact(_) => 5,
761            Self::SuiteArtifact(_) => 6,
762            Self::SuiteStarted(_) => 7,
763            Self::SuiteStopped(_) => 8,
764            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
765        }
766    }
767
768    #[inline]
769    pub fn unknown_variant_for_testing() -> Self {
770        Self::__SourceBreaking { unknown_ordinal: 0 }
771    }
772
773    #[inline]
774    pub fn is_unknown(&self) -> bool {
775        match self {
776            Self::__SourceBreaking { .. } => true,
777            _ => false,
778        }
779    }
780}
781
782impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SuiteEventPayload {}
783
784/// Delivery method for syslog.
785#[derive(Debug)]
786pub enum Syslog {
787    /// Client end of the iterator used by Fuchsia clients.
788    Batch(fidl::endpoints::ClientEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>),
789    /// Consumer end of the socket used by host-side clients.
790    Stream(fidl::Socket),
791    #[doc(hidden)]
792    __SourceBreaking { unknown_ordinal: u64 },
793}
794
795/// Pattern that matches an unknown `Syslog` member.
796#[macro_export]
797macro_rules! SyslogUnknown {
798    () => {
799        _
800    };
801}
802
803// Custom PartialEq so that unknown variants are not equal to themselves.
804impl PartialEq for Syslog {
805    fn eq(&self, other: &Self) -> bool {
806        match (self, other) {
807            (Self::Batch(x), Self::Batch(y)) => *x == *y,
808            (Self::Stream(x), Self::Stream(y)) => *x == *y,
809            _ => false,
810        }
811    }
812}
813
814impl Syslog {
815    #[inline]
816    pub fn ordinal(&self) -> u64 {
817        match *self {
818            Self::Batch(_) => 2,
819            Self::Stream(_) => 3,
820            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
821        }
822    }
823
824    #[inline]
825    pub fn unknown_variant_for_testing() -> Self {
826        Self::__SourceBreaking { unknown_ordinal: 0 }
827    }
828
829    #[inline]
830    pub fn is_unknown(&self) -> bool {
831        match self {
832            Self::__SourceBreaking { .. } => true,
833            _ => false,
834        }
835    }
836}
837
838impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Syslog {}
839
840#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
841pub struct CaseIteratorMarker;
842
843impl fidl::endpoints::ProtocolMarker for CaseIteratorMarker {
844    type Proxy = CaseIteratorProxy;
845    type RequestStream = CaseIteratorRequestStream;
846    #[cfg(target_os = "fuchsia")]
847    type SynchronousProxy = CaseIteratorSynchronousProxy;
848
849    const DEBUG_NAME: &'static str = "(anonymous) CaseIterator";
850}
851
852pub trait CaseIteratorProxyInterface: Send + Sync {
853    type GetNextResponseFut: std::future::Future<Output = Result<Vec<Case>, fidl::Error>> + Send;
854    fn r#get_next(&self) -> Self::GetNextResponseFut;
855}
856#[derive(Debug)]
857#[cfg(target_os = "fuchsia")]
858pub struct CaseIteratorSynchronousProxy {
859    client: fidl::client::sync::Client,
860}
861
862#[cfg(target_os = "fuchsia")]
863impl fidl::endpoints::SynchronousProxy for CaseIteratorSynchronousProxy {
864    type Proxy = CaseIteratorProxy;
865    type Protocol = CaseIteratorMarker;
866
867    fn from_channel(inner: fidl::Channel) -> Self {
868        Self::new(inner)
869    }
870
871    fn into_channel(self) -> fidl::Channel {
872        self.client.into_channel()
873    }
874
875    fn as_channel(&self) -> &fidl::Channel {
876        self.client.as_channel()
877    }
878}
879
880#[cfg(target_os = "fuchsia")]
881impl CaseIteratorSynchronousProxy {
882    pub fn new(channel: fidl::Channel) -> Self {
883        let protocol_name = <CaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
884        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
885    }
886
887    pub fn into_channel(self) -> fidl::Channel {
888        self.client.into_channel()
889    }
890
891    /// Waits until an event arrives and returns it. It is safe for other
892    /// threads to make concurrent requests while waiting for an event.
893    pub fn wait_for_event(
894        &self,
895        deadline: zx::MonotonicInstant,
896    ) -> Result<CaseIteratorEvent, fidl::Error> {
897        CaseIteratorEvent::decode(self.client.wait_for_event(deadline)?)
898    }
899
900    /// Returns the next batch of test cases when they are available. Returns the empty vector
901    /// to indicate that the iteration is complete.
902    pub fn r#get_next(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<Case>, fidl::Error> {
903        let _response =
904            self.client.send_query::<fidl::encoding::EmptyPayload, CaseIteratorGetNextResponse>(
905                (),
906                0x7583f97b7486467c,
907                fidl::encoding::DynamicFlags::empty(),
908                ___deadline,
909            )?;
910        Ok(_response.cases)
911    }
912}
913
914#[cfg(target_os = "fuchsia")]
915impl From<CaseIteratorSynchronousProxy> for zx::Handle {
916    fn from(value: CaseIteratorSynchronousProxy) -> Self {
917        value.into_channel().into()
918    }
919}
920
921#[cfg(target_os = "fuchsia")]
922impl From<fidl::Channel> for CaseIteratorSynchronousProxy {
923    fn from(value: fidl::Channel) -> Self {
924        Self::new(value)
925    }
926}
927
928#[derive(Debug, Clone)]
929pub struct CaseIteratorProxy {
930    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
931}
932
933impl fidl::endpoints::Proxy for CaseIteratorProxy {
934    type Protocol = CaseIteratorMarker;
935
936    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
937        Self::new(inner)
938    }
939
940    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
941        self.client.into_channel().map_err(|client| Self { client })
942    }
943
944    fn as_channel(&self) -> &::fidl::AsyncChannel {
945        self.client.as_channel()
946    }
947}
948
949impl CaseIteratorProxy {
950    /// Create a new Proxy for fuchsia.test.manager/CaseIterator.
951    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
952        let protocol_name = <CaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
953        Self { client: fidl::client::Client::new(channel, protocol_name) }
954    }
955
956    /// Get a Stream of events from the remote end of the protocol.
957    ///
958    /// # Panics
959    ///
960    /// Panics if the event stream was already taken.
961    pub fn take_event_stream(&self) -> CaseIteratorEventStream {
962        CaseIteratorEventStream { event_receiver: self.client.take_event_receiver() }
963    }
964
965    /// Returns the next batch of test cases when they are available. Returns the empty vector
966    /// to indicate that the iteration is complete.
967    pub fn r#get_next(
968        &self,
969    ) -> fidl::client::QueryResponseFut<Vec<Case>, fidl::encoding::DefaultFuchsiaResourceDialect>
970    {
971        CaseIteratorProxyInterface::r#get_next(self)
972    }
973}
974
975impl CaseIteratorProxyInterface for CaseIteratorProxy {
976    type GetNextResponseFut =
977        fidl::client::QueryResponseFut<Vec<Case>, fidl::encoding::DefaultFuchsiaResourceDialect>;
978    fn r#get_next(&self) -> Self::GetNextResponseFut {
979        fn _decode(
980            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
981        ) -> Result<Vec<Case>, fidl::Error> {
982            let _response = fidl::client::decode_transaction_body::<
983                CaseIteratorGetNextResponse,
984                fidl::encoding::DefaultFuchsiaResourceDialect,
985                0x7583f97b7486467c,
986            >(_buf?)?;
987            Ok(_response.cases)
988        }
989        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Case>>(
990            (),
991            0x7583f97b7486467c,
992            fidl::encoding::DynamicFlags::empty(),
993            _decode,
994        )
995    }
996}
997
998pub struct CaseIteratorEventStream {
999    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1000}
1001
1002impl std::marker::Unpin for CaseIteratorEventStream {}
1003
1004impl futures::stream::FusedStream for CaseIteratorEventStream {
1005    fn is_terminated(&self) -> bool {
1006        self.event_receiver.is_terminated()
1007    }
1008}
1009
1010impl futures::Stream for CaseIteratorEventStream {
1011    type Item = Result<CaseIteratorEvent, fidl::Error>;
1012
1013    fn poll_next(
1014        mut self: std::pin::Pin<&mut Self>,
1015        cx: &mut std::task::Context<'_>,
1016    ) -> std::task::Poll<Option<Self::Item>> {
1017        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1018            &mut self.event_receiver,
1019            cx
1020        )?) {
1021            Some(buf) => std::task::Poll::Ready(Some(CaseIteratorEvent::decode(buf))),
1022            None => std::task::Poll::Ready(None),
1023        }
1024    }
1025}
1026
1027#[derive(Debug)]
1028pub enum CaseIteratorEvent {}
1029
1030impl CaseIteratorEvent {
1031    /// Decodes a message buffer as a [`CaseIteratorEvent`].
1032    fn decode(
1033        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1034    ) -> Result<CaseIteratorEvent, fidl::Error> {
1035        let (bytes, _handles) = buf.split_mut();
1036        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1037        debug_assert_eq!(tx_header.tx_id, 0);
1038        match tx_header.ordinal {
1039            _ => Err(fidl::Error::UnknownOrdinal {
1040                ordinal: tx_header.ordinal,
1041                protocol_name: <CaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1042            }),
1043        }
1044    }
1045}
1046
1047/// A Stream of incoming requests for fuchsia.test.manager/CaseIterator.
1048pub struct CaseIteratorRequestStream {
1049    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1050    is_terminated: bool,
1051}
1052
1053impl std::marker::Unpin for CaseIteratorRequestStream {}
1054
1055impl futures::stream::FusedStream for CaseIteratorRequestStream {
1056    fn is_terminated(&self) -> bool {
1057        self.is_terminated
1058    }
1059}
1060
1061impl fidl::endpoints::RequestStream for CaseIteratorRequestStream {
1062    type Protocol = CaseIteratorMarker;
1063    type ControlHandle = CaseIteratorControlHandle;
1064
1065    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1066        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1067    }
1068
1069    fn control_handle(&self) -> Self::ControlHandle {
1070        CaseIteratorControlHandle { inner: self.inner.clone() }
1071    }
1072
1073    fn into_inner(
1074        self,
1075    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1076    {
1077        (self.inner, self.is_terminated)
1078    }
1079
1080    fn from_inner(
1081        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1082        is_terminated: bool,
1083    ) -> Self {
1084        Self { inner, is_terminated }
1085    }
1086}
1087
1088impl futures::Stream for CaseIteratorRequestStream {
1089    type Item = Result<CaseIteratorRequest, fidl::Error>;
1090
1091    fn poll_next(
1092        mut self: std::pin::Pin<&mut Self>,
1093        cx: &mut std::task::Context<'_>,
1094    ) -> std::task::Poll<Option<Self::Item>> {
1095        let this = &mut *self;
1096        if this.inner.check_shutdown(cx) {
1097            this.is_terminated = true;
1098            return std::task::Poll::Ready(None);
1099        }
1100        if this.is_terminated {
1101            panic!("polled CaseIteratorRequestStream after completion");
1102        }
1103        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1104            |bytes, handles| {
1105                match this.inner.channel().read_etc(cx, bytes, handles) {
1106                    std::task::Poll::Ready(Ok(())) => {}
1107                    std::task::Poll::Pending => return std::task::Poll::Pending,
1108                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1109                        this.is_terminated = true;
1110                        return std::task::Poll::Ready(None);
1111                    }
1112                    std::task::Poll::Ready(Err(e)) => {
1113                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1114                            e.into(),
1115                        ))))
1116                    }
1117                }
1118
1119                // A message has been received from the channel
1120                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1121
1122                std::task::Poll::Ready(Some(match header.ordinal {
1123                    0x7583f97b7486467c => {
1124                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1125                        let mut req = fidl::new_empty!(
1126                            fidl::encoding::EmptyPayload,
1127                            fidl::encoding::DefaultFuchsiaResourceDialect
1128                        );
1129                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1130                        let control_handle =
1131                            CaseIteratorControlHandle { inner: this.inner.clone() };
1132                        Ok(CaseIteratorRequest::GetNext {
1133                            responder: CaseIteratorGetNextResponder {
1134                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1135                                tx_id: header.tx_id,
1136                            },
1137                        })
1138                    }
1139                    _ => Err(fidl::Error::UnknownOrdinal {
1140                        ordinal: header.ordinal,
1141                        protocol_name:
1142                            <CaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1143                    }),
1144                }))
1145            },
1146        )
1147    }
1148}
1149
1150/// Iterator for listing available test cases.
1151#[derive(Debug)]
1152pub enum CaseIteratorRequest {
1153    /// Returns the next batch of test cases when they are available. Returns the empty vector
1154    /// to indicate that the iteration is complete.
1155    GetNext { responder: CaseIteratorGetNextResponder },
1156}
1157
1158impl CaseIteratorRequest {
1159    #[allow(irrefutable_let_patterns)]
1160    pub fn into_get_next(self) -> Option<(CaseIteratorGetNextResponder)> {
1161        if let CaseIteratorRequest::GetNext { responder } = self {
1162            Some((responder))
1163        } else {
1164            None
1165        }
1166    }
1167
1168    /// Name of the method defined in FIDL
1169    pub fn method_name(&self) -> &'static str {
1170        match *self {
1171            CaseIteratorRequest::GetNext { .. } => "get_next",
1172        }
1173    }
1174}
1175
1176#[derive(Debug, Clone)]
1177pub struct CaseIteratorControlHandle {
1178    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1179}
1180
1181impl fidl::endpoints::ControlHandle for CaseIteratorControlHandle {
1182    fn shutdown(&self) {
1183        self.inner.shutdown()
1184    }
1185    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1186        self.inner.shutdown_with_epitaph(status)
1187    }
1188
1189    fn is_closed(&self) -> bool {
1190        self.inner.channel().is_closed()
1191    }
1192    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1193        self.inner.channel().on_closed()
1194    }
1195
1196    #[cfg(target_os = "fuchsia")]
1197    fn signal_peer(
1198        &self,
1199        clear_mask: zx::Signals,
1200        set_mask: zx::Signals,
1201    ) -> Result<(), zx_status::Status> {
1202        use fidl::Peered;
1203        self.inner.channel().signal_peer(clear_mask, set_mask)
1204    }
1205}
1206
1207impl CaseIteratorControlHandle {}
1208
1209#[must_use = "FIDL methods require a response to be sent"]
1210#[derive(Debug)]
1211pub struct CaseIteratorGetNextResponder {
1212    control_handle: std::mem::ManuallyDrop<CaseIteratorControlHandle>,
1213    tx_id: u32,
1214}
1215
1216/// Set the the channel to be shutdown (see [`CaseIteratorControlHandle::shutdown`])
1217/// if the responder is dropped without sending a response, so that the client
1218/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1219impl std::ops::Drop for CaseIteratorGetNextResponder {
1220    fn drop(&mut self) {
1221        self.control_handle.shutdown();
1222        // Safety: drops once, never accessed again
1223        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1224    }
1225}
1226
1227impl fidl::endpoints::Responder for CaseIteratorGetNextResponder {
1228    type ControlHandle = CaseIteratorControlHandle;
1229
1230    fn control_handle(&self) -> &CaseIteratorControlHandle {
1231        &self.control_handle
1232    }
1233
1234    fn drop_without_shutdown(mut self) {
1235        // Safety: drops once, never accessed again due to mem::forget
1236        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1237        // Prevent Drop from running (which would shut down the channel)
1238        std::mem::forget(self);
1239    }
1240}
1241
1242impl CaseIteratorGetNextResponder {
1243    /// Sends a response to the FIDL transaction.
1244    ///
1245    /// Sets the channel to shutdown if an error occurs.
1246    pub fn send(self, mut cases: &[Case]) -> Result<(), fidl::Error> {
1247        let _result = self.send_raw(cases);
1248        if _result.is_err() {
1249            self.control_handle.shutdown();
1250        }
1251        self.drop_without_shutdown();
1252        _result
1253    }
1254
1255    /// Similar to "send" but does not shutdown the channel if an error occurs.
1256    pub fn send_no_shutdown_on_err(self, mut cases: &[Case]) -> Result<(), fidl::Error> {
1257        let _result = self.send_raw(cases);
1258        self.drop_without_shutdown();
1259        _result
1260    }
1261
1262    fn send_raw(&self, mut cases: &[Case]) -> Result<(), fidl::Error> {
1263        self.control_handle.inner.send::<CaseIteratorGetNextResponse>(
1264            (cases,),
1265            self.tx_id,
1266            0x7583f97b7486467c,
1267            fidl::encoding::DynamicFlags::empty(),
1268        )
1269    }
1270}
1271
1272#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1273pub struct DebugDataIteratorMarker;
1274
1275impl fidl::endpoints::ProtocolMarker for DebugDataIteratorMarker {
1276    type Proxy = DebugDataIteratorProxy;
1277    type RequestStream = DebugDataIteratorRequestStream;
1278    #[cfg(target_os = "fuchsia")]
1279    type SynchronousProxy = DebugDataIteratorSynchronousProxy;
1280
1281    const DEBUG_NAME: &'static str = "(anonymous) DebugDataIterator";
1282}
1283
1284pub trait DebugDataIteratorProxyInterface: Send + Sync {
1285    type GetNextResponseFut: std::future::Future<Output = Result<Vec<DebugData>, fidl::Error>>
1286        + Send;
1287    fn r#get_next(&self) -> Self::GetNextResponseFut;
1288    type GetNextCompressedResponseFut: std::future::Future<Output = Result<Vec<DebugData>, fidl::Error>>
1289        + Send;
1290    fn r#get_next_compressed(&self) -> Self::GetNextCompressedResponseFut;
1291}
1292#[derive(Debug)]
1293#[cfg(target_os = "fuchsia")]
1294pub struct DebugDataIteratorSynchronousProxy {
1295    client: fidl::client::sync::Client,
1296}
1297
1298#[cfg(target_os = "fuchsia")]
1299impl fidl::endpoints::SynchronousProxy for DebugDataIteratorSynchronousProxy {
1300    type Proxy = DebugDataIteratorProxy;
1301    type Protocol = DebugDataIteratorMarker;
1302
1303    fn from_channel(inner: fidl::Channel) -> Self {
1304        Self::new(inner)
1305    }
1306
1307    fn into_channel(self) -> fidl::Channel {
1308        self.client.into_channel()
1309    }
1310
1311    fn as_channel(&self) -> &fidl::Channel {
1312        self.client.as_channel()
1313    }
1314}
1315
1316#[cfg(target_os = "fuchsia")]
1317impl DebugDataIteratorSynchronousProxy {
1318    pub fn new(channel: fidl::Channel) -> Self {
1319        let protocol_name =
1320            <DebugDataIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1321        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1322    }
1323
1324    pub fn into_channel(self) -> fidl::Channel {
1325        self.client.into_channel()
1326    }
1327
1328    /// Waits until an event arrives and returns it. It is safe for other
1329    /// threads to make concurrent requests while waiting for an event.
1330    pub fn wait_for_event(
1331        &self,
1332        deadline: zx::MonotonicInstant,
1333    ) -> Result<DebugDataIteratorEvent, fidl::Error> {
1334        DebugDataIteratorEvent::decode(self.client.wait_for_event(deadline)?)
1335    }
1336
1337    /// Retrieve the next batch of debug data. This is a hanging get; if no data is
1338    /// immediately available, the call hangs until data is available. After all data has
1339    /// been returned, the call returns an empty vector.
1340    pub fn r#get_next(
1341        &self,
1342        ___deadline: zx::MonotonicInstant,
1343    ) -> Result<Vec<DebugData>, fidl::Error> {
1344        let _response = self
1345            .client
1346            .send_query::<fidl::encoding::EmptyPayload, DebugDataIteratorGetNextResponse>(
1347                (),
1348                0x9ef24c823f5ad60,
1349                fidl::encoding::DynamicFlags::empty(),
1350                ___deadline,
1351            )?;
1352        Ok(_response.data)
1353    }
1354
1355    /// Retrieve the next batch of debug data (compressed using zstd). This is
1356    /// a hanging get; if no data is immediately available, the call hangs until
1357    /// data is available. After all data has been returned, the call returns an empty vector.
1358    pub fn r#get_next_compressed(
1359        &self,
1360        ___deadline: zx::MonotonicInstant,
1361    ) -> Result<Vec<DebugData>, fidl::Error> {
1362        let _response = self
1363            .client
1364            .send_query::<fidl::encoding::EmptyPayload, DebugDataIteratorGetNextCompressedResponse>(
1365                (),
1366                0x6765e9cb918301f4,
1367                fidl::encoding::DynamicFlags::empty(),
1368                ___deadline,
1369            )?;
1370        Ok(_response.data)
1371    }
1372}
1373
1374#[cfg(target_os = "fuchsia")]
1375impl From<DebugDataIteratorSynchronousProxy> for zx::Handle {
1376    fn from(value: DebugDataIteratorSynchronousProxy) -> Self {
1377        value.into_channel().into()
1378    }
1379}
1380
1381#[cfg(target_os = "fuchsia")]
1382impl From<fidl::Channel> for DebugDataIteratorSynchronousProxy {
1383    fn from(value: fidl::Channel) -> Self {
1384        Self::new(value)
1385    }
1386}
1387
1388#[derive(Debug, Clone)]
1389pub struct DebugDataIteratorProxy {
1390    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1391}
1392
1393impl fidl::endpoints::Proxy for DebugDataIteratorProxy {
1394    type Protocol = DebugDataIteratorMarker;
1395
1396    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1397        Self::new(inner)
1398    }
1399
1400    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1401        self.client.into_channel().map_err(|client| Self { client })
1402    }
1403
1404    fn as_channel(&self) -> &::fidl::AsyncChannel {
1405        self.client.as_channel()
1406    }
1407}
1408
1409impl DebugDataIteratorProxy {
1410    /// Create a new Proxy for fuchsia.test.manager/DebugDataIterator.
1411    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1412        let protocol_name =
1413            <DebugDataIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1414        Self { client: fidl::client::Client::new(channel, protocol_name) }
1415    }
1416
1417    /// Get a Stream of events from the remote end of the protocol.
1418    ///
1419    /// # Panics
1420    ///
1421    /// Panics if the event stream was already taken.
1422    pub fn take_event_stream(&self) -> DebugDataIteratorEventStream {
1423        DebugDataIteratorEventStream { event_receiver: self.client.take_event_receiver() }
1424    }
1425
1426    /// Retrieve the next batch of debug data. This is a hanging get; if no data is
1427    /// immediately available, the call hangs until data is available. After all data has
1428    /// been returned, the call returns an empty vector.
1429    pub fn r#get_next(
1430        &self,
1431    ) -> fidl::client::QueryResponseFut<Vec<DebugData>, fidl::encoding::DefaultFuchsiaResourceDialect>
1432    {
1433        DebugDataIteratorProxyInterface::r#get_next(self)
1434    }
1435
1436    /// Retrieve the next batch of debug data (compressed using zstd). This is
1437    /// a hanging get; if no data is immediately available, the call hangs until
1438    /// data is available. After all data has been returned, the call returns an empty vector.
1439    pub fn r#get_next_compressed(
1440        &self,
1441    ) -> fidl::client::QueryResponseFut<Vec<DebugData>, fidl::encoding::DefaultFuchsiaResourceDialect>
1442    {
1443        DebugDataIteratorProxyInterface::r#get_next_compressed(self)
1444    }
1445}
1446
1447impl DebugDataIteratorProxyInterface for DebugDataIteratorProxy {
1448    type GetNextResponseFut = fidl::client::QueryResponseFut<
1449        Vec<DebugData>,
1450        fidl::encoding::DefaultFuchsiaResourceDialect,
1451    >;
1452    fn r#get_next(&self) -> Self::GetNextResponseFut {
1453        fn _decode(
1454            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1455        ) -> Result<Vec<DebugData>, fidl::Error> {
1456            let _response = fidl::client::decode_transaction_body::<
1457                DebugDataIteratorGetNextResponse,
1458                fidl::encoding::DefaultFuchsiaResourceDialect,
1459                0x9ef24c823f5ad60,
1460            >(_buf?)?;
1461            Ok(_response.data)
1462        }
1463        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<DebugData>>(
1464            (),
1465            0x9ef24c823f5ad60,
1466            fidl::encoding::DynamicFlags::empty(),
1467            _decode,
1468        )
1469    }
1470
1471    type GetNextCompressedResponseFut = fidl::client::QueryResponseFut<
1472        Vec<DebugData>,
1473        fidl::encoding::DefaultFuchsiaResourceDialect,
1474    >;
1475    fn r#get_next_compressed(&self) -> Self::GetNextCompressedResponseFut {
1476        fn _decode(
1477            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1478        ) -> Result<Vec<DebugData>, fidl::Error> {
1479            let _response = fidl::client::decode_transaction_body::<
1480                DebugDataIteratorGetNextCompressedResponse,
1481                fidl::encoding::DefaultFuchsiaResourceDialect,
1482                0x6765e9cb918301f4,
1483            >(_buf?)?;
1484            Ok(_response.data)
1485        }
1486        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<DebugData>>(
1487            (),
1488            0x6765e9cb918301f4,
1489            fidl::encoding::DynamicFlags::empty(),
1490            _decode,
1491        )
1492    }
1493}
1494
1495pub struct DebugDataIteratorEventStream {
1496    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1497}
1498
1499impl std::marker::Unpin for DebugDataIteratorEventStream {}
1500
1501impl futures::stream::FusedStream for DebugDataIteratorEventStream {
1502    fn is_terminated(&self) -> bool {
1503        self.event_receiver.is_terminated()
1504    }
1505}
1506
1507impl futures::Stream for DebugDataIteratorEventStream {
1508    type Item = Result<DebugDataIteratorEvent, fidl::Error>;
1509
1510    fn poll_next(
1511        mut self: std::pin::Pin<&mut Self>,
1512        cx: &mut std::task::Context<'_>,
1513    ) -> std::task::Poll<Option<Self::Item>> {
1514        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1515            &mut self.event_receiver,
1516            cx
1517        )?) {
1518            Some(buf) => std::task::Poll::Ready(Some(DebugDataIteratorEvent::decode(buf))),
1519            None => std::task::Poll::Ready(None),
1520        }
1521    }
1522}
1523
1524#[derive(Debug)]
1525pub enum DebugDataIteratorEvent {}
1526
1527impl DebugDataIteratorEvent {
1528    /// Decodes a message buffer as a [`DebugDataIteratorEvent`].
1529    fn decode(
1530        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1531    ) -> Result<DebugDataIteratorEvent, fidl::Error> {
1532        let (bytes, _handles) = buf.split_mut();
1533        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1534        debug_assert_eq!(tx_header.tx_id, 0);
1535        match tx_header.ordinal {
1536            _ => Err(fidl::Error::UnknownOrdinal {
1537                ordinal: tx_header.ordinal,
1538                protocol_name:
1539                    <DebugDataIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1540            }),
1541        }
1542    }
1543}
1544
1545/// A Stream of incoming requests for fuchsia.test.manager/DebugDataIterator.
1546pub struct DebugDataIteratorRequestStream {
1547    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1548    is_terminated: bool,
1549}
1550
1551impl std::marker::Unpin for DebugDataIteratorRequestStream {}
1552
1553impl futures::stream::FusedStream for DebugDataIteratorRequestStream {
1554    fn is_terminated(&self) -> bool {
1555        self.is_terminated
1556    }
1557}
1558
1559impl fidl::endpoints::RequestStream for DebugDataIteratorRequestStream {
1560    type Protocol = DebugDataIteratorMarker;
1561    type ControlHandle = DebugDataIteratorControlHandle;
1562
1563    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1564        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1565    }
1566
1567    fn control_handle(&self) -> Self::ControlHandle {
1568        DebugDataIteratorControlHandle { inner: self.inner.clone() }
1569    }
1570
1571    fn into_inner(
1572        self,
1573    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1574    {
1575        (self.inner, self.is_terminated)
1576    }
1577
1578    fn from_inner(
1579        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1580        is_terminated: bool,
1581    ) -> Self {
1582        Self { inner, is_terminated }
1583    }
1584}
1585
1586impl futures::Stream for DebugDataIteratorRequestStream {
1587    type Item = Result<DebugDataIteratorRequest, fidl::Error>;
1588
1589    fn poll_next(
1590        mut self: std::pin::Pin<&mut Self>,
1591        cx: &mut std::task::Context<'_>,
1592    ) -> std::task::Poll<Option<Self::Item>> {
1593        let this = &mut *self;
1594        if this.inner.check_shutdown(cx) {
1595            this.is_terminated = true;
1596            return std::task::Poll::Ready(None);
1597        }
1598        if this.is_terminated {
1599            panic!("polled DebugDataIteratorRequestStream after completion");
1600        }
1601        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1602            |bytes, handles| {
1603                match this.inner.channel().read_etc(cx, bytes, handles) {
1604                    std::task::Poll::Ready(Ok(())) => {}
1605                    std::task::Poll::Pending => return std::task::Poll::Pending,
1606                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1607                        this.is_terminated = true;
1608                        return std::task::Poll::Ready(None);
1609                    }
1610                    std::task::Poll::Ready(Err(e)) => {
1611                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1612                            e.into(),
1613                        ))))
1614                    }
1615                }
1616
1617                // A message has been received from the channel
1618                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1619
1620                std::task::Poll::Ready(Some(match header.ordinal {
1621                    0x9ef24c823f5ad60 => {
1622                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1623                        let mut req = fidl::new_empty!(
1624                            fidl::encoding::EmptyPayload,
1625                            fidl::encoding::DefaultFuchsiaResourceDialect
1626                        );
1627                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1628                        let control_handle =
1629                            DebugDataIteratorControlHandle { inner: this.inner.clone() };
1630                        Ok(DebugDataIteratorRequest::GetNext {
1631                            responder: DebugDataIteratorGetNextResponder {
1632                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1633                                tx_id: header.tx_id,
1634                            },
1635                        })
1636                    }
1637                    0x6765e9cb918301f4 => {
1638                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1639                        let mut req = fidl::new_empty!(
1640                            fidl::encoding::EmptyPayload,
1641                            fidl::encoding::DefaultFuchsiaResourceDialect
1642                        );
1643                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1644                        let control_handle =
1645                            DebugDataIteratorControlHandle { inner: this.inner.clone() };
1646                        Ok(DebugDataIteratorRequest::GetNextCompressed {
1647                            responder: DebugDataIteratorGetNextCompressedResponder {
1648                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1649                                tx_id: header.tx_id,
1650                            },
1651                        })
1652                    }
1653                    _ => Err(fidl::Error::UnknownOrdinal {
1654                        ordinal: header.ordinal,
1655                        protocol_name:
1656                            <DebugDataIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1657                    }),
1658                }))
1659            },
1660        )
1661    }
1662}
1663
1664/// An iterator protocol over which a client may retrieve debug data information.
1665#[derive(Debug)]
1666pub enum DebugDataIteratorRequest {
1667    /// Retrieve the next batch of debug data. This is a hanging get; if no data is
1668    /// immediately available, the call hangs until data is available. After all data has
1669    /// been returned, the call returns an empty vector.
1670    GetNext { responder: DebugDataIteratorGetNextResponder },
1671    /// Retrieve the next batch of debug data (compressed using zstd). This is
1672    /// a hanging get; if no data is immediately available, the call hangs until
1673    /// data is available. After all data has been returned, the call returns an empty vector.
1674    GetNextCompressed { responder: DebugDataIteratorGetNextCompressedResponder },
1675}
1676
1677impl DebugDataIteratorRequest {
1678    #[allow(irrefutable_let_patterns)]
1679    pub fn into_get_next(self) -> Option<(DebugDataIteratorGetNextResponder)> {
1680        if let DebugDataIteratorRequest::GetNext { responder } = self {
1681            Some((responder))
1682        } else {
1683            None
1684        }
1685    }
1686
1687    #[allow(irrefutable_let_patterns)]
1688    pub fn into_get_next_compressed(self) -> Option<(DebugDataIteratorGetNextCompressedResponder)> {
1689        if let DebugDataIteratorRequest::GetNextCompressed { responder } = self {
1690            Some((responder))
1691        } else {
1692            None
1693        }
1694    }
1695
1696    /// Name of the method defined in FIDL
1697    pub fn method_name(&self) -> &'static str {
1698        match *self {
1699            DebugDataIteratorRequest::GetNext { .. } => "get_next",
1700            DebugDataIteratorRequest::GetNextCompressed { .. } => "get_next_compressed",
1701        }
1702    }
1703}
1704
1705#[derive(Debug, Clone)]
1706pub struct DebugDataIteratorControlHandle {
1707    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1708}
1709
1710impl fidl::endpoints::ControlHandle for DebugDataIteratorControlHandle {
1711    fn shutdown(&self) {
1712        self.inner.shutdown()
1713    }
1714    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1715        self.inner.shutdown_with_epitaph(status)
1716    }
1717
1718    fn is_closed(&self) -> bool {
1719        self.inner.channel().is_closed()
1720    }
1721    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1722        self.inner.channel().on_closed()
1723    }
1724
1725    #[cfg(target_os = "fuchsia")]
1726    fn signal_peer(
1727        &self,
1728        clear_mask: zx::Signals,
1729        set_mask: zx::Signals,
1730    ) -> Result<(), zx_status::Status> {
1731        use fidl::Peered;
1732        self.inner.channel().signal_peer(clear_mask, set_mask)
1733    }
1734}
1735
1736impl DebugDataIteratorControlHandle {}
1737
1738#[must_use = "FIDL methods require a response to be sent"]
1739#[derive(Debug)]
1740pub struct DebugDataIteratorGetNextResponder {
1741    control_handle: std::mem::ManuallyDrop<DebugDataIteratorControlHandle>,
1742    tx_id: u32,
1743}
1744
1745/// Set the the channel to be shutdown (see [`DebugDataIteratorControlHandle::shutdown`])
1746/// if the responder is dropped without sending a response, so that the client
1747/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1748impl std::ops::Drop for DebugDataIteratorGetNextResponder {
1749    fn drop(&mut self) {
1750        self.control_handle.shutdown();
1751        // Safety: drops once, never accessed again
1752        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1753    }
1754}
1755
1756impl fidl::endpoints::Responder for DebugDataIteratorGetNextResponder {
1757    type ControlHandle = DebugDataIteratorControlHandle;
1758
1759    fn control_handle(&self) -> &DebugDataIteratorControlHandle {
1760        &self.control_handle
1761    }
1762
1763    fn drop_without_shutdown(mut self) {
1764        // Safety: drops once, never accessed again due to mem::forget
1765        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1766        // Prevent Drop from running (which would shut down the channel)
1767        std::mem::forget(self);
1768    }
1769}
1770
1771impl DebugDataIteratorGetNextResponder {
1772    /// Sends a response to the FIDL transaction.
1773    ///
1774    /// Sets the channel to shutdown if an error occurs.
1775    pub fn send(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1776        let _result = self.send_raw(data);
1777        if _result.is_err() {
1778            self.control_handle.shutdown();
1779        }
1780        self.drop_without_shutdown();
1781        _result
1782    }
1783
1784    /// Similar to "send" but does not shutdown the channel if an error occurs.
1785    pub fn send_no_shutdown_on_err(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1786        let _result = self.send_raw(data);
1787        self.drop_without_shutdown();
1788        _result
1789    }
1790
1791    fn send_raw(&self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1792        self.control_handle.inner.send::<DebugDataIteratorGetNextResponse>(
1793            (data.as_mut(),),
1794            self.tx_id,
1795            0x9ef24c823f5ad60,
1796            fidl::encoding::DynamicFlags::empty(),
1797        )
1798    }
1799}
1800
1801#[must_use = "FIDL methods require a response to be sent"]
1802#[derive(Debug)]
1803pub struct DebugDataIteratorGetNextCompressedResponder {
1804    control_handle: std::mem::ManuallyDrop<DebugDataIteratorControlHandle>,
1805    tx_id: u32,
1806}
1807
1808/// Set the the channel to be shutdown (see [`DebugDataIteratorControlHandle::shutdown`])
1809/// if the responder is dropped without sending a response, so that the client
1810/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1811impl std::ops::Drop for DebugDataIteratorGetNextCompressedResponder {
1812    fn drop(&mut self) {
1813        self.control_handle.shutdown();
1814        // Safety: drops once, never accessed again
1815        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1816    }
1817}
1818
1819impl fidl::endpoints::Responder for DebugDataIteratorGetNextCompressedResponder {
1820    type ControlHandle = DebugDataIteratorControlHandle;
1821
1822    fn control_handle(&self) -> &DebugDataIteratorControlHandle {
1823        &self.control_handle
1824    }
1825
1826    fn drop_without_shutdown(mut self) {
1827        // Safety: drops once, never accessed again due to mem::forget
1828        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1829        // Prevent Drop from running (which would shut down the channel)
1830        std::mem::forget(self);
1831    }
1832}
1833
1834impl DebugDataIteratorGetNextCompressedResponder {
1835    /// Sends a response to the FIDL transaction.
1836    ///
1837    /// Sets the channel to shutdown if an error occurs.
1838    pub fn send(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1839        let _result = self.send_raw(data);
1840        if _result.is_err() {
1841            self.control_handle.shutdown();
1842        }
1843        self.drop_without_shutdown();
1844        _result
1845    }
1846
1847    /// Similar to "send" but does not shutdown the channel if an error occurs.
1848    pub fn send_no_shutdown_on_err(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1849        let _result = self.send_raw(data);
1850        self.drop_without_shutdown();
1851        _result
1852    }
1853
1854    fn send_raw(&self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1855        self.control_handle.inner.send::<DebugDataIteratorGetNextCompressedResponse>(
1856            (data.as_mut(),),
1857            self.tx_id,
1858            0x6765e9cb918301f4,
1859            fidl::encoding::DynamicFlags::empty(),
1860        )
1861    }
1862}
1863
1864#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1865pub struct EarlyBootProfileMarker;
1866
1867impl fidl::endpoints::ProtocolMarker for EarlyBootProfileMarker {
1868    type Proxy = EarlyBootProfileProxy;
1869    type RequestStream = EarlyBootProfileRequestStream;
1870    #[cfg(target_os = "fuchsia")]
1871    type SynchronousProxy = EarlyBootProfileSynchronousProxy;
1872
1873    const DEBUG_NAME: &'static str = "fuchsia.test.manager.EarlyBootProfile";
1874}
1875impl fidl::endpoints::DiscoverableProtocolMarker for EarlyBootProfileMarker {}
1876
1877pub trait EarlyBootProfileProxyInterface: Send + Sync {
1878    fn r#register_watcher(
1879        &self,
1880        iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
1881    ) -> Result<(), fidl::Error>;
1882}
1883#[derive(Debug)]
1884#[cfg(target_os = "fuchsia")]
1885pub struct EarlyBootProfileSynchronousProxy {
1886    client: fidl::client::sync::Client,
1887}
1888
1889#[cfg(target_os = "fuchsia")]
1890impl fidl::endpoints::SynchronousProxy for EarlyBootProfileSynchronousProxy {
1891    type Proxy = EarlyBootProfileProxy;
1892    type Protocol = EarlyBootProfileMarker;
1893
1894    fn from_channel(inner: fidl::Channel) -> Self {
1895        Self::new(inner)
1896    }
1897
1898    fn into_channel(self) -> fidl::Channel {
1899        self.client.into_channel()
1900    }
1901
1902    fn as_channel(&self) -> &fidl::Channel {
1903        self.client.as_channel()
1904    }
1905}
1906
1907#[cfg(target_os = "fuchsia")]
1908impl EarlyBootProfileSynchronousProxy {
1909    pub fn new(channel: fidl::Channel) -> Self {
1910        let protocol_name = <EarlyBootProfileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1911        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1912    }
1913
1914    pub fn into_channel(self) -> fidl::Channel {
1915        self.client.into_channel()
1916    }
1917
1918    /// Waits until an event arrives and returns it. It is safe for other
1919    /// threads to make concurrent requests while waiting for an event.
1920    pub fn wait_for_event(
1921        &self,
1922        deadline: zx::MonotonicInstant,
1923    ) -> Result<EarlyBootProfileEvent, fidl::Error> {
1924        EarlyBootProfileEvent::decode(self.client.wait_for_event(deadline)?)
1925    }
1926
1927    /// Register iterator for watching early boot profiles.
1928    pub fn r#register_watcher(
1929        &self,
1930        mut iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
1931    ) -> Result<(), fidl::Error> {
1932        self.client.send::<EarlyBootProfileRegisterWatcherRequest>(
1933            (iterator,),
1934            0x6bd6b03803b93715,
1935            fidl::encoding::DynamicFlags::empty(),
1936        )
1937    }
1938}
1939
1940#[cfg(target_os = "fuchsia")]
1941impl From<EarlyBootProfileSynchronousProxy> for zx::Handle {
1942    fn from(value: EarlyBootProfileSynchronousProxy) -> Self {
1943        value.into_channel().into()
1944    }
1945}
1946
1947#[cfg(target_os = "fuchsia")]
1948impl From<fidl::Channel> for EarlyBootProfileSynchronousProxy {
1949    fn from(value: fidl::Channel) -> Self {
1950        Self::new(value)
1951    }
1952}
1953
1954#[derive(Debug, Clone)]
1955pub struct EarlyBootProfileProxy {
1956    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1957}
1958
1959impl fidl::endpoints::Proxy for EarlyBootProfileProxy {
1960    type Protocol = EarlyBootProfileMarker;
1961
1962    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1963        Self::new(inner)
1964    }
1965
1966    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1967        self.client.into_channel().map_err(|client| Self { client })
1968    }
1969
1970    fn as_channel(&self) -> &::fidl::AsyncChannel {
1971        self.client.as_channel()
1972    }
1973}
1974
1975impl EarlyBootProfileProxy {
1976    /// Create a new Proxy for fuchsia.test.manager/EarlyBootProfile.
1977    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1978        let protocol_name = <EarlyBootProfileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1979        Self { client: fidl::client::Client::new(channel, protocol_name) }
1980    }
1981
1982    /// Get a Stream of events from the remote end of the protocol.
1983    ///
1984    /// # Panics
1985    ///
1986    /// Panics if the event stream was already taken.
1987    pub fn take_event_stream(&self) -> EarlyBootProfileEventStream {
1988        EarlyBootProfileEventStream { event_receiver: self.client.take_event_receiver() }
1989    }
1990
1991    /// Register iterator for watching early boot profiles.
1992    pub fn r#register_watcher(
1993        &self,
1994        mut iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
1995    ) -> Result<(), fidl::Error> {
1996        EarlyBootProfileProxyInterface::r#register_watcher(self, iterator)
1997    }
1998}
1999
2000impl EarlyBootProfileProxyInterface for EarlyBootProfileProxy {
2001    fn r#register_watcher(
2002        &self,
2003        mut iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
2004    ) -> Result<(), fidl::Error> {
2005        self.client.send::<EarlyBootProfileRegisterWatcherRequest>(
2006            (iterator,),
2007            0x6bd6b03803b93715,
2008            fidl::encoding::DynamicFlags::empty(),
2009        )
2010    }
2011}
2012
2013pub struct EarlyBootProfileEventStream {
2014    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2015}
2016
2017impl std::marker::Unpin for EarlyBootProfileEventStream {}
2018
2019impl futures::stream::FusedStream for EarlyBootProfileEventStream {
2020    fn is_terminated(&self) -> bool {
2021        self.event_receiver.is_terminated()
2022    }
2023}
2024
2025impl futures::Stream for EarlyBootProfileEventStream {
2026    type Item = Result<EarlyBootProfileEvent, fidl::Error>;
2027
2028    fn poll_next(
2029        mut self: std::pin::Pin<&mut Self>,
2030        cx: &mut std::task::Context<'_>,
2031    ) -> std::task::Poll<Option<Self::Item>> {
2032        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2033            &mut self.event_receiver,
2034            cx
2035        )?) {
2036            Some(buf) => std::task::Poll::Ready(Some(EarlyBootProfileEvent::decode(buf))),
2037            None => std::task::Poll::Ready(None),
2038        }
2039    }
2040}
2041
2042#[derive(Debug)]
2043pub enum EarlyBootProfileEvent {
2044    #[non_exhaustive]
2045    _UnknownEvent {
2046        /// Ordinal of the event that was sent.
2047        ordinal: u64,
2048    },
2049}
2050
2051impl EarlyBootProfileEvent {
2052    /// Decodes a message buffer as a [`EarlyBootProfileEvent`].
2053    fn decode(
2054        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2055    ) -> Result<EarlyBootProfileEvent, fidl::Error> {
2056        let (bytes, _handles) = buf.split_mut();
2057        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2058        debug_assert_eq!(tx_header.tx_id, 0);
2059        match tx_header.ordinal {
2060            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2061                Ok(EarlyBootProfileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2062            }
2063            _ => Err(fidl::Error::UnknownOrdinal {
2064                ordinal: tx_header.ordinal,
2065                protocol_name:
2066                    <EarlyBootProfileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2067            }),
2068        }
2069    }
2070}
2071
2072/// A Stream of incoming requests for fuchsia.test.manager/EarlyBootProfile.
2073pub struct EarlyBootProfileRequestStream {
2074    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2075    is_terminated: bool,
2076}
2077
2078impl std::marker::Unpin for EarlyBootProfileRequestStream {}
2079
2080impl futures::stream::FusedStream for EarlyBootProfileRequestStream {
2081    fn is_terminated(&self) -> bool {
2082        self.is_terminated
2083    }
2084}
2085
2086impl fidl::endpoints::RequestStream for EarlyBootProfileRequestStream {
2087    type Protocol = EarlyBootProfileMarker;
2088    type ControlHandle = EarlyBootProfileControlHandle;
2089
2090    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2091        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2092    }
2093
2094    fn control_handle(&self) -> Self::ControlHandle {
2095        EarlyBootProfileControlHandle { inner: self.inner.clone() }
2096    }
2097
2098    fn into_inner(
2099        self,
2100    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2101    {
2102        (self.inner, self.is_terminated)
2103    }
2104
2105    fn from_inner(
2106        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2107        is_terminated: bool,
2108    ) -> Self {
2109        Self { inner, is_terminated }
2110    }
2111}
2112
2113impl futures::Stream for EarlyBootProfileRequestStream {
2114    type Item = Result<EarlyBootProfileRequest, fidl::Error>;
2115
2116    fn poll_next(
2117        mut self: std::pin::Pin<&mut Self>,
2118        cx: &mut std::task::Context<'_>,
2119    ) -> std::task::Poll<Option<Self::Item>> {
2120        let this = &mut *self;
2121        if this.inner.check_shutdown(cx) {
2122            this.is_terminated = true;
2123            return std::task::Poll::Ready(None);
2124        }
2125        if this.is_terminated {
2126            panic!("polled EarlyBootProfileRequestStream after completion");
2127        }
2128        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2129            |bytes, handles| {
2130                match this.inner.channel().read_etc(cx, bytes, handles) {
2131                    std::task::Poll::Ready(Ok(())) => {}
2132                    std::task::Poll::Pending => return std::task::Poll::Pending,
2133                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2134                        this.is_terminated = true;
2135                        return std::task::Poll::Ready(None);
2136                    }
2137                    std::task::Poll::Ready(Err(e)) => {
2138                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2139                            e.into(),
2140                        ))))
2141                    }
2142                }
2143
2144                // A message has been received from the channel
2145                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2146
2147                std::task::Poll::Ready(Some(match header.ordinal {
2148                    0x6bd6b03803b93715 => {
2149                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2150                        let mut req = fidl::new_empty!(
2151                            EarlyBootProfileRegisterWatcherRequest,
2152                            fidl::encoding::DefaultFuchsiaResourceDialect
2153                        );
2154                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EarlyBootProfileRegisterWatcherRequest>(&header, _body_bytes, handles, &mut req)?;
2155                        let control_handle =
2156                            EarlyBootProfileControlHandle { inner: this.inner.clone() };
2157                        Ok(EarlyBootProfileRequest::RegisterWatcher {
2158                            iterator: req.iterator,
2159
2160                            control_handle,
2161                        })
2162                    }
2163                    _ if header.tx_id == 0
2164                        && header
2165                            .dynamic_flags()
2166                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2167                    {
2168                        Ok(EarlyBootProfileRequest::_UnknownMethod {
2169                            ordinal: header.ordinal,
2170                            control_handle: EarlyBootProfileControlHandle {
2171                                inner: this.inner.clone(),
2172                            },
2173                            method_type: fidl::MethodType::OneWay,
2174                        })
2175                    }
2176                    _ if header
2177                        .dynamic_flags()
2178                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2179                    {
2180                        this.inner.send_framework_err(
2181                            fidl::encoding::FrameworkErr::UnknownMethod,
2182                            header.tx_id,
2183                            header.ordinal,
2184                            header.dynamic_flags(),
2185                            (bytes, handles),
2186                        )?;
2187                        Ok(EarlyBootProfileRequest::_UnknownMethod {
2188                            ordinal: header.ordinal,
2189                            control_handle: EarlyBootProfileControlHandle {
2190                                inner: this.inner.clone(),
2191                            },
2192                            method_type: fidl::MethodType::TwoWay,
2193                        })
2194                    }
2195                    _ => Err(fidl::Error::UnknownOrdinal {
2196                        ordinal: header.ordinal,
2197                        protocol_name:
2198                            <EarlyBootProfileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2199                    }),
2200                }))
2201            },
2202        )
2203    }
2204}
2205
2206/// Protocol to manage Early boot profiles. This should be called by our clients
2207/// after running all the tests.
2208#[derive(Debug)]
2209pub enum EarlyBootProfileRequest {
2210    /// Register iterator for watching early boot profiles.
2211    RegisterWatcher {
2212        iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
2213        control_handle: EarlyBootProfileControlHandle,
2214    },
2215    /// An interaction was received which does not match any known method.
2216    #[non_exhaustive]
2217    _UnknownMethod {
2218        /// Ordinal of the method that was called.
2219        ordinal: u64,
2220        control_handle: EarlyBootProfileControlHandle,
2221        method_type: fidl::MethodType,
2222    },
2223}
2224
2225impl EarlyBootProfileRequest {
2226    #[allow(irrefutable_let_patterns)]
2227    pub fn into_register_watcher(
2228        self,
2229    ) -> Option<(fidl::endpoints::ServerEnd<DebugDataIteratorMarker>, EarlyBootProfileControlHandle)>
2230    {
2231        if let EarlyBootProfileRequest::RegisterWatcher { iterator, control_handle } = self {
2232            Some((iterator, control_handle))
2233        } else {
2234            None
2235        }
2236    }
2237
2238    /// Name of the method defined in FIDL
2239    pub fn method_name(&self) -> &'static str {
2240        match *self {
2241            EarlyBootProfileRequest::RegisterWatcher { .. } => "register_watcher",
2242            EarlyBootProfileRequest::_UnknownMethod {
2243                method_type: fidl::MethodType::OneWay,
2244                ..
2245            } => "unknown one-way method",
2246            EarlyBootProfileRequest::_UnknownMethod {
2247                method_type: fidl::MethodType::TwoWay,
2248                ..
2249            } => "unknown two-way method",
2250        }
2251    }
2252}
2253
2254#[derive(Debug, Clone)]
2255pub struct EarlyBootProfileControlHandle {
2256    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2257}
2258
2259impl fidl::endpoints::ControlHandle for EarlyBootProfileControlHandle {
2260    fn shutdown(&self) {
2261        self.inner.shutdown()
2262    }
2263    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2264        self.inner.shutdown_with_epitaph(status)
2265    }
2266
2267    fn is_closed(&self) -> bool {
2268        self.inner.channel().is_closed()
2269    }
2270    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2271        self.inner.channel().on_closed()
2272    }
2273
2274    #[cfg(target_os = "fuchsia")]
2275    fn signal_peer(
2276        &self,
2277        clear_mask: zx::Signals,
2278        set_mask: zx::Signals,
2279    ) -> Result<(), zx_status::Status> {
2280        use fidl::Peered;
2281        self.inner.channel().signal_peer(clear_mask, set_mask)
2282    }
2283}
2284
2285impl EarlyBootProfileControlHandle {}
2286
2287#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2288pub struct QueryMarker;
2289
2290impl fidl::endpoints::ProtocolMarker for QueryMarker {
2291    type Proxy = QueryProxy;
2292    type RequestStream = QueryRequestStream;
2293    #[cfg(target_os = "fuchsia")]
2294    type SynchronousProxy = QuerySynchronousProxy;
2295
2296    const DEBUG_NAME: &'static str = "fuchsia.test.manager.Query";
2297}
2298impl fidl::endpoints::DiscoverableProtocolMarker for QueryMarker {}
2299pub type QueryEnumerateResult = Result<(), LaunchError>;
2300pub type QueryEnumerateInRealmResult = Result<(), LaunchError>;
2301
2302pub trait QueryProxyInterface: Send + Sync {
2303    type EnumerateResponseFut: std::future::Future<Output = Result<QueryEnumerateResult, fidl::Error>>
2304        + Send;
2305    fn r#enumerate(
2306        &self,
2307        test_url: &str,
2308        iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2309    ) -> Self::EnumerateResponseFut;
2310    type EnumerateInRealmResponseFut: std::future::Future<Output = Result<QueryEnumerateInRealmResult, fidl::Error>>
2311        + Send;
2312    fn r#enumerate_in_realm(
2313        &self,
2314        test_url: &str,
2315        realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2316        offers: &[fidl_fuchsia_component_decl::Offer],
2317        test_collection: &str,
2318        iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2319    ) -> Self::EnumerateInRealmResponseFut;
2320}
2321#[derive(Debug)]
2322#[cfg(target_os = "fuchsia")]
2323pub struct QuerySynchronousProxy {
2324    client: fidl::client::sync::Client,
2325}
2326
2327#[cfg(target_os = "fuchsia")]
2328impl fidl::endpoints::SynchronousProxy for QuerySynchronousProxy {
2329    type Proxy = QueryProxy;
2330    type Protocol = QueryMarker;
2331
2332    fn from_channel(inner: fidl::Channel) -> Self {
2333        Self::new(inner)
2334    }
2335
2336    fn into_channel(self) -> fidl::Channel {
2337        self.client.into_channel()
2338    }
2339
2340    fn as_channel(&self) -> &fidl::Channel {
2341        self.client.as_channel()
2342    }
2343}
2344
2345#[cfg(target_os = "fuchsia")]
2346impl QuerySynchronousProxy {
2347    pub fn new(channel: fidl::Channel) -> Self {
2348        let protocol_name = <QueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2349        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2350    }
2351
2352    pub fn into_channel(self) -> fidl::Channel {
2353        self.client.into_channel()
2354    }
2355
2356    /// Waits until an event arrives and returns it. It is safe for other
2357    /// threads to make concurrent requests while waiting for an event.
2358    pub fn wait_for_event(
2359        &self,
2360        deadline: zx::MonotonicInstant,
2361    ) -> Result<QueryEvent, fidl::Error> {
2362        QueryEvent::decode(self.client.wait_for_event(deadline)?)
2363    }
2364
2365    /// Enumerates test cases.
2366    pub fn r#enumerate(
2367        &self,
2368        mut test_url: &str,
2369        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2370        ___deadline: zx::MonotonicInstant,
2371    ) -> Result<QueryEnumerateResult, fidl::Error> {
2372        let _response = self.client.send_query::<
2373            QueryEnumerateRequest,
2374            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LaunchError>,
2375        >(
2376            (test_url, iterator,),
2377            0x6cd89c1f2728d418,
2378            fidl::encoding::DynamicFlags::empty(),
2379            ___deadline,
2380        )?;
2381        Ok(_response.map(|x| x))
2382    }
2383
2384    /// Enumerates test cases in non-hermetic tests.
2385    pub fn r#enumerate_in_realm(
2386        &self,
2387        mut test_url: &str,
2388        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2389        mut offers: &[fidl_fuchsia_component_decl::Offer],
2390        mut test_collection: &str,
2391        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2392        ___deadline: zx::MonotonicInstant,
2393    ) -> Result<QueryEnumerateInRealmResult, fidl::Error> {
2394        let _response = self.client.send_query::<
2395            QueryEnumerateInRealmRequest,
2396            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LaunchError>,
2397        >(
2398            (test_url, realm, offers, test_collection, iterator,),
2399            0x7f7f533194a51ec5,
2400            fidl::encoding::DynamicFlags::empty(),
2401            ___deadline,
2402        )?;
2403        Ok(_response.map(|x| x))
2404    }
2405}
2406
2407#[cfg(target_os = "fuchsia")]
2408impl From<QuerySynchronousProxy> for zx::Handle {
2409    fn from(value: QuerySynchronousProxy) -> Self {
2410        value.into_channel().into()
2411    }
2412}
2413
2414#[cfg(target_os = "fuchsia")]
2415impl From<fidl::Channel> for QuerySynchronousProxy {
2416    fn from(value: fidl::Channel) -> Self {
2417        Self::new(value)
2418    }
2419}
2420
2421#[derive(Debug, Clone)]
2422pub struct QueryProxy {
2423    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2424}
2425
2426impl fidl::endpoints::Proxy for QueryProxy {
2427    type Protocol = QueryMarker;
2428
2429    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2430        Self::new(inner)
2431    }
2432
2433    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2434        self.client.into_channel().map_err(|client| Self { client })
2435    }
2436
2437    fn as_channel(&self) -> &::fidl::AsyncChannel {
2438        self.client.as_channel()
2439    }
2440}
2441
2442impl QueryProxy {
2443    /// Create a new Proxy for fuchsia.test.manager/Query.
2444    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2445        let protocol_name = <QueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2446        Self { client: fidl::client::Client::new(channel, protocol_name) }
2447    }
2448
2449    /// Get a Stream of events from the remote end of the protocol.
2450    ///
2451    /// # Panics
2452    ///
2453    /// Panics if the event stream was already taken.
2454    pub fn take_event_stream(&self) -> QueryEventStream {
2455        QueryEventStream { event_receiver: self.client.take_event_receiver() }
2456    }
2457
2458    /// Enumerates test cases.
2459    pub fn r#enumerate(
2460        &self,
2461        mut test_url: &str,
2462        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2463    ) -> fidl::client::QueryResponseFut<
2464        QueryEnumerateResult,
2465        fidl::encoding::DefaultFuchsiaResourceDialect,
2466    > {
2467        QueryProxyInterface::r#enumerate(self, test_url, iterator)
2468    }
2469
2470    /// Enumerates test cases in non-hermetic tests.
2471    pub fn r#enumerate_in_realm(
2472        &self,
2473        mut test_url: &str,
2474        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2475        mut offers: &[fidl_fuchsia_component_decl::Offer],
2476        mut test_collection: &str,
2477        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2478    ) -> fidl::client::QueryResponseFut<
2479        QueryEnumerateInRealmResult,
2480        fidl::encoding::DefaultFuchsiaResourceDialect,
2481    > {
2482        QueryProxyInterface::r#enumerate_in_realm(
2483            self,
2484            test_url,
2485            realm,
2486            offers,
2487            test_collection,
2488            iterator,
2489        )
2490    }
2491}
2492
2493impl QueryProxyInterface for QueryProxy {
2494    type EnumerateResponseFut = fidl::client::QueryResponseFut<
2495        QueryEnumerateResult,
2496        fidl::encoding::DefaultFuchsiaResourceDialect,
2497    >;
2498    fn r#enumerate(
2499        &self,
2500        mut test_url: &str,
2501        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2502    ) -> Self::EnumerateResponseFut {
2503        fn _decode(
2504            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2505        ) -> Result<QueryEnumerateResult, fidl::Error> {
2506            let _response = fidl::client::decode_transaction_body::<
2507                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LaunchError>,
2508                fidl::encoding::DefaultFuchsiaResourceDialect,
2509                0x6cd89c1f2728d418,
2510            >(_buf?)?;
2511            Ok(_response.map(|x| x))
2512        }
2513        self.client.send_query_and_decode::<QueryEnumerateRequest, QueryEnumerateResult>(
2514            (test_url, iterator),
2515            0x6cd89c1f2728d418,
2516            fidl::encoding::DynamicFlags::empty(),
2517            _decode,
2518        )
2519    }
2520
2521    type EnumerateInRealmResponseFut = fidl::client::QueryResponseFut<
2522        QueryEnumerateInRealmResult,
2523        fidl::encoding::DefaultFuchsiaResourceDialect,
2524    >;
2525    fn r#enumerate_in_realm(
2526        &self,
2527        mut test_url: &str,
2528        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2529        mut offers: &[fidl_fuchsia_component_decl::Offer],
2530        mut test_collection: &str,
2531        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2532    ) -> Self::EnumerateInRealmResponseFut {
2533        fn _decode(
2534            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2535        ) -> Result<QueryEnumerateInRealmResult, fidl::Error> {
2536            let _response = fidl::client::decode_transaction_body::<
2537                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LaunchError>,
2538                fidl::encoding::DefaultFuchsiaResourceDialect,
2539                0x7f7f533194a51ec5,
2540            >(_buf?)?;
2541            Ok(_response.map(|x| x))
2542        }
2543        self.client
2544            .send_query_and_decode::<QueryEnumerateInRealmRequest, QueryEnumerateInRealmResult>(
2545                (test_url, realm, offers, test_collection, iterator),
2546                0x7f7f533194a51ec5,
2547                fidl::encoding::DynamicFlags::empty(),
2548                _decode,
2549            )
2550    }
2551}
2552
2553pub struct QueryEventStream {
2554    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2555}
2556
2557impl std::marker::Unpin for QueryEventStream {}
2558
2559impl futures::stream::FusedStream for QueryEventStream {
2560    fn is_terminated(&self) -> bool {
2561        self.event_receiver.is_terminated()
2562    }
2563}
2564
2565impl futures::Stream for QueryEventStream {
2566    type Item = Result<QueryEvent, fidl::Error>;
2567
2568    fn poll_next(
2569        mut self: std::pin::Pin<&mut Self>,
2570        cx: &mut std::task::Context<'_>,
2571    ) -> std::task::Poll<Option<Self::Item>> {
2572        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2573            &mut self.event_receiver,
2574            cx
2575        )?) {
2576            Some(buf) => std::task::Poll::Ready(Some(QueryEvent::decode(buf))),
2577            None => std::task::Poll::Ready(None),
2578        }
2579    }
2580}
2581
2582#[derive(Debug)]
2583pub enum QueryEvent {
2584    #[non_exhaustive]
2585    _UnknownEvent {
2586        /// Ordinal of the event that was sent.
2587        ordinal: u64,
2588    },
2589}
2590
2591impl QueryEvent {
2592    /// Decodes a message buffer as a [`QueryEvent`].
2593    fn decode(
2594        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2595    ) -> Result<QueryEvent, fidl::Error> {
2596        let (bytes, _handles) = buf.split_mut();
2597        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2598        debug_assert_eq!(tx_header.tx_id, 0);
2599        match tx_header.ordinal {
2600            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2601                Ok(QueryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2602            }
2603            _ => Err(fidl::Error::UnknownOrdinal {
2604                ordinal: tx_header.ordinal,
2605                protocol_name: <QueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2606            }),
2607        }
2608    }
2609}
2610
2611/// A Stream of incoming requests for fuchsia.test.manager/Query.
2612pub struct QueryRequestStream {
2613    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2614    is_terminated: bool,
2615}
2616
2617impl std::marker::Unpin for QueryRequestStream {}
2618
2619impl futures::stream::FusedStream for QueryRequestStream {
2620    fn is_terminated(&self) -> bool {
2621        self.is_terminated
2622    }
2623}
2624
2625impl fidl::endpoints::RequestStream for QueryRequestStream {
2626    type Protocol = QueryMarker;
2627    type ControlHandle = QueryControlHandle;
2628
2629    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2630        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2631    }
2632
2633    fn control_handle(&self) -> Self::ControlHandle {
2634        QueryControlHandle { inner: self.inner.clone() }
2635    }
2636
2637    fn into_inner(
2638        self,
2639    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2640    {
2641        (self.inner, self.is_terminated)
2642    }
2643
2644    fn from_inner(
2645        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2646        is_terminated: bool,
2647    ) -> Self {
2648        Self { inner, is_terminated }
2649    }
2650}
2651
2652impl futures::Stream for QueryRequestStream {
2653    type Item = Result<QueryRequest, fidl::Error>;
2654
2655    fn poll_next(
2656        mut self: std::pin::Pin<&mut Self>,
2657        cx: &mut std::task::Context<'_>,
2658    ) -> std::task::Poll<Option<Self::Item>> {
2659        let this = &mut *self;
2660        if this.inner.check_shutdown(cx) {
2661            this.is_terminated = true;
2662            return std::task::Poll::Ready(None);
2663        }
2664        if this.is_terminated {
2665            panic!("polled QueryRequestStream after completion");
2666        }
2667        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2668            |bytes, handles| {
2669                match this.inner.channel().read_etc(cx, bytes, handles) {
2670                    std::task::Poll::Ready(Ok(())) => {}
2671                    std::task::Poll::Pending => return std::task::Poll::Pending,
2672                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2673                        this.is_terminated = true;
2674                        return std::task::Poll::Ready(None);
2675                    }
2676                    std::task::Poll::Ready(Err(e)) => {
2677                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2678                            e.into(),
2679                        ))))
2680                    }
2681                }
2682
2683                // A message has been received from the channel
2684                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2685
2686                std::task::Poll::Ready(Some(match header.ordinal {
2687                    0x6cd89c1f2728d418 => {
2688                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2689                        let mut req = fidl::new_empty!(
2690                            QueryEnumerateRequest,
2691                            fidl::encoding::DefaultFuchsiaResourceDialect
2692                        );
2693                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<QueryEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
2694                        let control_handle = QueryControlHandle { inner: this.inner.clone() };
2695                        Ok(QueryRequest::Enumerate {
2696                            test_url: req.test_url,
2697                            iterator: req.iterator,
2698
2699                            responder: QueryEnumerateResponder {
2700                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2701                                tx_id: header.tx_id,
2702                            },
2703                        })
2704                    }
2705                    0x7f7f533194a51ec5 => {
2706                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2707                        let mut req = fidl::new_empty!(
2708                            QueryEnumerateInRealmRequest,
2709                            fidl::encoding::DefaultFuchsiaResourceDialect
2710                        );
2711                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<QueryEnumerateInRealmRequest>(&header, _body_bytes, handles, &mut req)?;
2712                        let control_handle = QueryControlHandle { inner: this.inner.clone() };
2713                        Ok(QueryRequest::EnumerateInRealm {
2714                            test_url: req.test_url,
2715                            realm: req.realm,
2716                            offers: req.offers,
2717                            test_collection: req.test_collection,
2718                            iterator: req.iterator,
2719
2720                            responder: QueryEnumerateInRealmResponder {
2721                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2722                                tx_id: header.tx_id,
2723                            },
2724                        })
2725                    }
2726                    _ if header.tx_id == 0
2727                        && header
2728                            .dynamic_flags()
2729                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2730                    {
2731                        Ok(QueryRequest::_UnknownMethod {
2732                            ordinal: header.ordinal,
2733                            control_handle: QueryControlHandle { inner: this.inner.clone() },
2734                            method_type: fidl::MethodType::OneWay,
2735                        })
2736                    }
2737                    _ if header
2738                        .dynamic_flags()
2739                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2740                    {
2741                        this.inner.send_framework_err(
2742                            fidl::encoding::FrameworkErr::UnknownMethod,
2743                            header.tx_id,
2744                            header.ordinal,
2745                            header.dynamic_flags(),
2746                            (bytes, handles),
2747                        )?;
2748                        Ok(QueryRequest::_UnknownMethod {
2749                            ordinal: header.ordinal,
2750                            control_handle: QueryControlHandle { inner: this.inner.clone() },
2751                            method_type: fidl::MethodType::TwoWay,
2752                        })
2753                    }
2754                    _ => Err(fidl::Error::UnknownOrdinal {
2755                        ordinal: header.ordinal,
2756                        protocol_name: <QueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2757                    }),
2758                }))
2759            },
2760        )
2761    }
2762}
2763
2764#[derive(Debug)]
2765pub enum QueryRequest {
2766    /// Enumerates test cases.
2767    Enumerate {
2768        test_url: String,
2769        iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2770        responder: QueryEnumerateResponder,
2771    },
2772    /// Enumerates test cases in non-hermetic tests.
2773    EnumerateInRealm {
2774        test_url: String,
2775        realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2776        offers: Vec<fidl_fuchsia_component_decl::Offer>,
2777        test_collection: String,
2778        iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2779        responder: QueryEnumerateInRealmResponder,
2780    },
2781    /// An interaction was received which does not match any known method.
2782    #[non_exhaustive]
2783    _UnknownMethod {
2784        /// Ordinal of the method that was called.
2785        ordinal: u64,
2786        control_handle: QueryControlHandle,
2787        method_type: fidl::MethodType,
2788    },
2789}
2790
2791impl QueryRequest {
2792    #[allow(irrefutable_let_patterns)]
2793    pub fn into_enumerate(
2794        self,
2795    ) -> Option<(String, fidl::endpoints::ServerEnd<CaseIteratorMarker>, QueryEnumerateResponder)>
2796    {
2797        if let QueryRequest::Enumerate { test_url, iterator, responder } = self {
2798            Some((test_url, iterator, responder))
2799        } else {
2800            None
2801        }
2802    }
2803
2804    #[allow(irrefutable_let_patterns)]
2805    pub fn into_enumerate_in_realm(
2806        self,
2807    ) -> Option<(
2808        String,
2809        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2810        Vec<fidl_fuchsia_component_decl::Offer>,
2811        String,
2812        fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2813        QueryEnumerateInRealmResponder,
2814    )> {
2815        if let QueryRequest::EnumerateInRealm {
2816            test_url,
2817            realm,
2818            offers,
2819            test_collection,
2820            iterator,
2821            responder,
2822        } = self
2823        {
2824            Some((test_url, realm, offers, test_collection, iterator, responder))
2825        } else {
2826            None
2827        }
2828    }
2829
2830    /// Name of the method defined in FIDL
2831    pub fn method_name(&self) -> &'static str {
2832        match *self {
2833            QueryRequest::Enumerate { .. } => "enumerate",
2834            QueryRequest::EnumerateInRealm { .. } => "enumerate_in_realm",
2835            QueryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
2836                "unknown one-way method"
2837            }
2838            QueryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
2839                "unknown two-way method"
2840            }
2841        }
2842    }
2843}
2844
2845#[derive(Debug, Clone)]
2846pub struct QueryControlHandle {
2847    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2848}
2849
2850impl fidl::endpoints::ControlHandle for QueryControlHandle {
2851    fn shutdown(&self) {
2852        self.inner.shutdown()
2853    }
2854    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2855        self.inner.shutdown_with_epitaph(status)
2856    }
2857
2858    fn is_closed(&self) -> bool {
2859        self.inner.channel().is_closed()
2860    }
2861    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2862        self.inner.channel().on_closed()
2863    }
2864
2865    #[cfg(target_os = "fuchsia")]
2866    fn signal_peer(
2867        &self,
2868        clear_mask: zx::Signals,
2869        set_mask: zx::Signals,
2870    ) -> Result<(), zx_status::Status> {
2871        use fidl::Peered;
2872        self.inner.channel().signal_peer(clear_mask, set_mask)
2873    }
2874}
2875
2876impl QueryControlHandle {}
2877
2878#[must_use = "FIDL methods require a response to be sent"]
2879#[derive(Debug)]
2880pub struct QueryEnumerateResponder {
2881    control_handle: std::mem::ManuallyDrop<QueryControlHandle>,
2882    tx_id: u32,
2883}
2884
2885/// Set the the channel to be shutdown (see [`QueryControlHandle::shutdown`])
2886/// if the responder is dropped without sending a response, so that the client
2887/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2888impl std::ops::Drop for QueryEnumerateResponder {
2889    fn drop(&mut self) {
2890        self.control_handle.shutdown();
2891        // Safety: drops once, never accessed again
2892        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2893    }
2894}
2895
2896impl fidl::endpoints::Responder for QueryEnumerateResponder {
2897    type ControlHandle = QueryControlHandle;
2898
2899    fn control_handle(&self) -> &QueryControlHandle {
2900        &self.control_handle
2901    }
2902
2903    fn drop_without_shutdown(mut self) {
2904        // Safety: drops once, never accessed again due to mem::forget
2905        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2906        // Prevent Drop from running (which would shut down the channel)
2907        std::mem::forget(self);
2908    }
2909}
2910
2911impl QueryEnumerateResponder {
2912    /// Sends a response to the FIDL transaction.
2913    ///
2914    /// Sets the channel to shutdown if an error occurs.
2915    pub fn send(self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
2916        let _result = self.send_raw(result);
2917        if _result.is_err() {
2918            self.control_handle.shutdown();
2919        }
2920        self.drop_without_shutdown();
2921        _result
2922    }
2923
2924    /// Similar to "send" but does not shutdown the channel if an error occurs.
2925    pub fn send_no_shutdown_on_err(
2926        self,
2927        mut result: Result<(), LaunchError>,
2928    ) -> Result<(), fidl::Error> {
2929        let _result = self.send_raw(result);
2930        self.drop_without_shutdown();
2931        _result
2932    }
2933
2934    fn send_raw(&self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
2935        self.control_handle.inner.send::<fidl::encoding::ResultType<
2936            fidl::encoding::EmptyStruct,
2937            LaunchError,
2938        >>(
2939            result,
2940            self.tx_id,
2941            0x6cd89c1f2728d418,
2942            fidl::encoding::DynamicFlags::empty(),
2943        )
2944    }
2945}
2946
2947#[must_use = "FIDL methods require a response to be sent"]
2948#[derive(Debug)]
2949pub struct QueryEnumerateInRealmResponder {
2950    control_handle: std::mem::ManuallyDrop<QueryControlHandle>,
2951    tx_id: u32,
2952}
2953
2954/// Set the the channel to be shutdown (see [`QueryControlHandle::shutdown`])
2955/// if the responder is dropped without sending a response, so that the client
2956/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2957impl std::ops::Drop for QueryEnumerateInRealmResponder {
2958    fn drop(&mut self) {
2959        self.control_handle.shutdown();
2960        // Safety: drops once, never accessed again
2961        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2962    }
2963}
2964
2965impl fidl::endpoints::Responder for QueryEnumerateInRealmResponder {
2966    type ControlHandle = QueryControlHandle;
2967
2968    fn control_handle(&self) -> &QueryControlHandle {
2969        &self.control_handle
2970    }
2971
2972    fn drop_without_shutdown(mut self) {
2973        // Safety: drops once, never accessed again due to mem::forget
2974        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2975        // Prevent Drop from running (which would shut down the channel)
2976        std::mem::forget(self);
2977    }
2978}
2979
2980impl QueryEnumerateInRealmResponder {
2981    /// Sends a response to the FIDL transaction.
2982    ///
2983    /// Sets the channel to shutdown if an error occurs.
2984    pub fn send(self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
2985        let _result = self.send_raw(result);
2986        if _result.is_err() {
2987            self.control_handle.shutdown();
2988        }
2989        self.drop_without_shutdown();
2990        _result
2991    }
2992
2993    /// Similar to "send" but does not shutdown the channel if an error occurs.
2994    pub fn send_no_shutdown_on_err(
2995        self,
2996        mut result: Result<(), LaunchError>,
2997    ) -> Result<(), fidl::Error> {
2998        let _result = self.send_raw(result);
2999        self.drop_without_shutdown();
3000        _result
3001    }
3002
3003    fn send_raw(&self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
3004        self.control_handle.inner.send::<fidl::encoding::ResultType<
3005            fidl::encoding::EmptyStruct,
3006            LaunchError,
3007        >>(
3008            result,
3009            self.tx_id,
3010            0x7f7f533194a51ec5,
3011            fidl::encoding::DynamicFlags::empty(),
3012        )
3013    }
3014}
3015
3016#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3017pub struct RunBuilderMarker;
3018
3019impl fidl::endpoints::ProtocolMarker for RunBuilderMarker {
3020    type Proxy = RunBuilderProxy;
3021    type RequestStream = RunBuilderRequestStream;
3022    #[cfg(target_os = "fuchsia")]
3023    type SynchronousProxy = RunBuilderSynchronousProxy;
3024
3025    const DEBUG_NAME: &'static str = "fuchsia.test.manager.RunBuilder";
3026}
3027impl fidl::endpoints::DiscoverableProtocolMarker for RunBuilderMarker {}
3028
3029pub trait RunBuilderProxyInterface: Send + Sync {
3030    fn r#add_suite(
3031        &self,
3032        test_url: &str,
3033        options: &RunOptions,
3034        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3035    ) -> Result<(), fidl::Error>;
3036    fn r#add_suite_in_realm(
3037        &self,
3038        realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3039        offers: &[fidl_fuchsia_component_decl::Offer],
3040        test_collection: &str,
3041        test_url: &str,
3042        options: &RunOptions,
3043        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3044    ) -> Result<(), fidl::Error>;
3045    fn r#with_scheduling_options(&self, options: &SchedulingOptions) -> Result<(), fidl::Error>;
3046    fn r#build(
3047        &self,
3048        controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
3049    ) -> Result<(), fidl::Error>;
3050}
3051#[derive(Debug)]
3052#[cfg(target_os = "fuchsia")]
3053pub struct RunBuilderSynchronousProxy {
3054    client: fidl::client::sync::Client,
3055}
3056
3057#[cfg(target_os = "fuchsia")]
3058impl fidl::endpoints::SynchronousProxy for RunBuilderSynchronousProxy {
3059    type Proxy = RunBuilderProxy;
3060    type Protocol = RunBuilderMarker;
3061
3062    fn from_channel(inner: fidl::Channel) -> Self {
3063        Self::new(inner)
3064    }
3065
3066    fn into_channel(self) -> fidl::Channel {
3067        self.client.into_channel()
3068    }
3069
3070    fn as_channel(&self) -> &fidl::Channel {
3071        self.client.as_channel()
3072    }
3073}
3074
3075#[cfg(target_os = "fuchsia")]
3076impl RunBuilderSynchronousProxy {
3077    pub fn new(channel: fidl::Channel) -> Self {
3078        let protocol_name = <RunBuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3079        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3080    }
3081
3082    pub fn into_channel(self) -> fidl::Channel {
3083        self.client.into_channel()
3084    }
3085
3086    /// Waits until an event arrives and returns it. It is safe for other
3087    /// threads to make concurrent requests while waiting for an event.
3088    pub fn wait_for_event(
3089        &self,
3090        deadline: zx::MonotonicInstant,
3091    ) -> Result<RunBuilderEvent, fidl::Error> {
3092        RunBuilderEvent::decode(self.client.wait_for_event(deadline)?)
3093    }
3094
3095    /// Add a suite to this run. A suite is a component that implements
3096    /// `fuchsia.test.Suite`. Implementors of this API will talk to test suites
3097    /// using "Suite" protocol and return results using `controller`. The
3098    /// controller is also used to control the execution of the test suite.
3099    pub fn r#add_suite(
3100        &self,
3101        mut test_url: &str,
3102        mut options: &RunOptions,
3103        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3104    ) -> Result<(), fidl::Error> {
3105        self.client.send::<RunBuilderAddSuiteRequest>(
3106            (test_url, options, controller),
3107            0x71e7f9a06daac486,
3108            fidl::encoding::DynamicFlags::FLEXIBLE,
3109        )
3110    }
3111
3112    /// Add a suite to this run which would run in provided 'realm'. A suite is
3113    /// a component that implements `fuchsia.test.Suite`. Implementors of this
3114    /// API will talk to test suites using "Suite" protocol and return results
3115    /// using `controller`. The controller is also used to control the execution
3116    /// of the test suite.
3117    pub fn r#add_suite_in_realm(
3118        &self,
3119        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3120        mut offers: &[fidl_fuchsia_component_decl::Offer],
3121        mut test_collection: &str,
3122        mut test_url: &str,
3123        mut options: &RunOptions,
3124        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3125    ) -> Result<(), fidl::Error> {
3126        self.client.send::<RunBuilderAddSuiteInRealmRequest>(
3127            (realm, offers, test_collection, test_url, options, controller),
3128            0x4d10c582715a8683,
3129            fidl::encoding::DynamicFlags::FLEXIBLE,
3130        )
3131    }
3132
3133    /// Specify scheduling options used for this run.
3134    pub fn r#with_scheduling_options(
3135        &self,
3136        mut options: &SchedulingOptions,
3137    ) -> Result<(), fidl::Error> {
3138        self.client.send::<RunBuilderWithSchedulingOptionsRequest>(
3139            (options,),
3140            0x55e73fdbeade0b0b,
3141            fidl::encoding::DynamicFlags::FLEXIBLE,
3142        )
3143    }
3144
3145    /// Build and schedule the run.
3146    ///
3147    /// This runs all suites added with their respective filters and closes the
3148    /// channel once it is done.
3149    pub fn r#build(
3150        &self,
3151        mut controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
3152    ) -> Result<(), fidl::Error> {
3153        self.client.send::<RunBuilderBuildRequest>(
3154            (controller,),
3155            0x7879f2360ff1f160,
3156            fidl::encoding::DynamicFlags::FLEXIBLE,
3157        )
3158    }
3159}
3160
3161#[cfg(target_os = "fuchsia")]
3162impl From<RunBuilderSynchronousProxy> for zx::Handle {
3163    fn from(value: RunBuilderSynchronousProxy) -> Self {
3164        value.into_channel().into()
3165    }
3166}
3167
3168#[cfg(target_os = "fuchsia")]
3169impl From<fidl::Channel> for RunBuilderSynchronousProxy {
3170    fn from(value: fidl::Channel) -> Self {
3171        Self::new(value)
3172    }
3173}
3174
3175#[derive(Debug, Clone)]
3176pub struct RunBuilderProxy {
3177    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3178}
3179
3180impl fidl::endpoints::Proxy for RunBuilderProxy {
3181    type Protocol = RunBuilderMarker;
3182
3183    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3184        Self::new(inner)
3185    }
3186
3187    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3188        self.client.into_channel().map_err(|client| Self { client })
3189    }
3190
3191    fn as_channel(&self) -> &::fidl::AsyncChannel {
3192        self.client.as_channel()
3193    }
3194}
3195
3196impl RunBuilderProxy {
3197    /// Create a new Proxy for fuchsia.test.manager/RunBuilder.
3198    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3199        let protocol_name = <RunBuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3200        Self { client: fidl::client::Client::new(channel, protocol_name) }
3201    }
3202
3203    /// Get a Stream of events from the remote end of the protocol.
3204    ///
3205    /// # Panics
3206    ///
3207    /// Panics if the event stream was already taken.
3208    pub fn take_event_stream(&self) -> RunBuilderEventStream {
3209        RunBuilderEventStream { event_receiver: self.client.take_event_receiver() }
3210    }
3211
3212    /// Add a suite to this run. A suite is a component that implements
3213    /// `fuchsia.test.Suite`. Implementors of this API will talk to test suites
3214    /// using "Suite" protocol and return results using `controller`. The
3215    /// controller is also used to control the execution of the test suite.
3216    pub fn r#add_suite(
3217        &self,
3218        mut test_url: &str,
3219        mut options: &RunOptions,
3220        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3221    ) -> Result<(), fidl::Error> {
3222        RunBuilderProxyInterface::r#add_suite(self, test_url, options, controller)
3223    }
3224
3225    /// Add a suite to this run which would run in provided 'realm'. A suite is
3226    /// a component that implements `fuchsia.test.Suite`. Implementors of this
3227    /// API will talk to test suites using "Suite" protocol and return results
3228    /// using `controller`. The controller is also used to control the execution
3229    /// of the test suite.
3230    pub fn r#add_suite_in_realm(
3231        &self,
3232        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3233        mut offers: &[fidl_fuchsia_component_decl::Offer],
3234        mut test_collection: &str,
3235        mut test_url: &str,
3236        mut options: &RunOptions,
3237        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3238    ) -> Result<(), fidl::Error> {
3239        RunBuilderProxyInterface::r#add_suite_in_realm(
3240            self,
3241            realm,
3242            offers,
3243            test_collection,
3244            test_url,
3245            options,
3246            controller,
3247        )
3248    }
3249
3250    /// Specify scheduling options used for this run.
3251    pub fn r#with_scheduling_options(
3252        &self,
3253        mut options: &SchedulingOptions,
3254    ) -> Result<(), fidl::Error> {
3255        RunBuilderProxyInterface::r#with_scheduling_options(self, options)
3256    }
3257
3258    /// Build and schedule the run.
3259    ///
3260    /// This runs all suites added with their respective filters and closes the
3261    /// channel once it is done.
3262    pub fn r#build(
3263        &self,
3264        mut controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
3265    ) -> Result<(), fidl::Error> {
3266        RunBuilderProxyInterface::r#build(self, controller)
3267    }
3268}
3269
3270impl RunBuilderProxyInterface for RunBuilderProxy {
3271    fn r#add_suite(
3272        &self,
3273        mut test_url: &str,
3274        mut options: &RunOptions,
3275        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3276    ) -> Result<(), fidl::Error> {
3277        self.client.send::<RunBuilderAddSuiteRequest>(
3278            (test_url, options, controller),
3279            0x71e7f9a06daac486,
3280            fidl::encoding::DynamicFlags::FLEXIBLE,
3281        )
3282    }
3283
3284    fn r#add_suite_in_realm(
3285        &self,
3286        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3287        mut offers: &[fidl_fuchsia_component_decl::Offer],
3288        mut test_collection: &str,
3289        mut test_url: &str,
3290        mut options: &RunOptions,
3291        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3292    ) -> Result<(), fidl::Error> {
3293        self.client.send::<RunBuilderAddSuiteInRealmRequest>(
3294            (realm, offers, test_collection, test_url, options, controller),
3295            0x4d10c582715a8683,
3296            fidl::encoding::DynamicFlags::FLEXIBLE,
3297        )
3298    }
3299
3300    fn r#with_scheduling_options(
3301        &self,
3302        mut options: &SchedulingOptions,
3303    ) -> Result<(), fidl::Error> {
3304        self.client.send::<RunBuilderWithSchedulingOptionsRequest>(
3305            (options,),
3306            0x55e73fdbeade0b0b,
3307            fidl::encoding::DynamicFlags::FLEXIBLE,
3308        )
3309    }
3310
3311    fn r#build(
3312        &self,
3313        mut controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
3314    ) -> Result<(), fidl::Error> {
3315        self.client.send::<RunBuilderBuildRequest>(
3316            (controller,),
3317            0x7879f2360ff1f160,
3318            fidl::encoding::DynamicFlags::FLEXIBLE,
3319        )
3320    }
3321}
3322
3323pub struct RunBuilderEventStream {
3324    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3325}
3326
3327impl std::marker::Unpin for RunBuilderEventStream {}
3328
3329impl futures::stream::FusedStream for RunBuilderEventStream {
3330    fn is_terminated(&self) -> bool {
3331        self.event_receiver.is_terminated()
3332    }
3333}
3334
3335impl futures::Stream for RunBuilderEventStream {
3336    type Item = Result<RunBuilderEvent, fidl::Error>;
3337
3338    fn poll_next(
3339        mut self: std::pin::Pin<&mut Self>,
3340        cx: &mut std::task::Context<'_>,
3341    ) -> std::task::Poll<Option<Self::Item>> {
3342        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3343            &mut self.event_receiver,
3344            cx
3345        )?) {
3346            Some(buf) => std::task::Poll::Ready(Some(RunBuilderEvent::decode(buf))),
3347            None => std::task::Poll::Ready(None),
3348        }
3349    }
3350}
3351
3352#[derive(Debug)]
3353pub enum RunBuilderEvent {
3354    #[non_exhaustive]
3355    _UnknownEvent {
3356        /// Ordinal of the event that was sent.
3357        ordinal: u64,
3358    },
3359}
3360
3361impl RunBuilderEvent {
3362    /// Decodes a message buffer as a [`RunBuilderEvent`].
3363    fn decode(
3364        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3365    ) -> Result<RunBuilderEvent, fidl::Error> {
3366        let (bytes, _handles) = buf.split_mut();
3367        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3368        debug_assert_eq!(tx_header.tx_id, 0);
3369        match tx_header.ordinal {
3370            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3371                Ok(RunBuilderEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3372            }
3373            _ => Err(fidl::Error::UnknownOrdinal {
3374                ordinal: tx_header.ordinal,
3375                protocol_name: <RunBuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3376            }),
3377        }
3378    }
3379}
3380
3381/// A Stream of incoming requests for fuchsia.test.manager/RunBuilder.
3382pub struct RunBuilderRequestStream {
3383    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3384    is_terminated: bool,
3385}
3386
3387impl std::marker::Unpin for RunBuilderRequestStream {}
3388
3389impl futures::stream::FusedStream for RunBuilderRequestStream {
3390    fn is_terminated(&self) -> bool {
3391        self.is_terminated
3392    }
3393}
3394
3395impl fidl::endpoints::RequestStream for RunBuilderRequestStream {
3396    type Protocol = RunBuilderMarker;
3397    type ControlHandle = RunBuilderControlHandle;
3398
3399    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3400        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3401    }
3402
3403    fn control_handle(&self) -> Self::ControlHandle {
3404        RunBuilderControlHandle { inner: self.inner.clone() }
3405    }
3406
3407    fn into_inner(
3408        self,
3409    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3410    {
3411        (self.inner, self.is_terminated)
3412    }
3413
3414    fn from_inner(
3415        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3416        is_terminated: bool,
3417    ) -> Self {
3418        Self { inner, is_terminated }
3419    }
3420}
3421
3422impl futures::Stream for RunBuilderRequestStream {
3423    type Item = Result<RunBuilderRequest, fidl::Error>;
3424
3425    fn poll_next(
3426        mut self: std::pin::Pin<&mut Self>,
3427        cx: &mut std::task::Context<'_>,
3428    ) -> std::task::Poll<Option<Self::Item>> {
3429        let this = &mut *self;
3430        if this.inner.check_shutdown(cx) {
3431            this.is_terminated = true;
3432            return std::task::Poll::Ready(None);
3433        }
3434        if this.is_terminated {
3435            panic!("polled RunBuilderRequestStream after completion");
3436        }
3437        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3438            |bytes, handles| {
3439                match this.inner.channel().read_etc(cx, bytes, handles) {
3440                    std::task::Poll::Ready(Ok(())) => {}
3441                    std::task::Poll::Pending => return std::task::Poll::Pending,
3442                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3443                        this.is_terminated = true;
3444                        return std::task::Poll::Ready(None);
3445                    }
3446                    std::task::Poll::Ready(Err(e)) => {
3447                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3448                            e.into(),
3449                        ))))
3450                    }
3451                }
3452
3453                // A message has been received from the channel
3454                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3455
3456                std::task::Poll::Ready(Some(match header.ordinal {
3457                    0x71e7f9a06daac486 => {
3458                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3459                        let mut req = fidl::new_empty!(
3460                            RunBuilderAddSuiteRequest,
3461                            fidl::encoding::DefaultFuchsiaResourceDialect
3462                        );
3463                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunBuilderAddSuiteRequest>(&header, _body_bytes, handles, &mut req)?;
3464                        let control_handle = RunBuilderControlHandle { inner: this.inner.clone() };
3465                        Ok(RunBuilderRequest::AddSuite {
3466                            test_url: req.test_url,
3467                            options: req.options,
3468                            controller: req.controller,
3469
3470                            control_handle,
3471                        })
3472                    }
3473                    0x4d10c582715a8683 => {
3474                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3475                        let mut req = fidl::new_empty!(
3476                            RunBuilderAddSuiteInRealmRequest,
3477                            fidl::encoding::DefaultFuchsiaResourceDialect
3478                        );
3479                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunBuilderAddSuiteInRealmRequest>(&header, _body_bytes, handles, &mut req)?;
3480                        let control_handle = RunBuilderControlHandle { inner: this.inner.clone() };
3481                        Ok(RunBuilderRequest::AddSuiteInRealm {
3482                            realm: req.realm,
3483                            offers: req.offers,
3484                            test_collection: req.test_collection,
3485                            test_url: req.test_url,
3486                            options: req.options,
3487                            controller: req.controller,
3488
3489                            control_handle,
3490                        })
3491                    }
3492                    0x55e73fdbeade0b0b => {
3493                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3494                        let mut req = fidl::new_empty!(
3495                            RunBuilderWithSchedulingOptionsRequest,
3496                            fidl::encoding::DefaultFuchsiaResourceDialect
3497                        );
3498                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunBuilderWithSchedulingOptionsRequest>(&header, _body_bytes, handles, &mut req)?;
3499                        let control_handle = RunBuilderControlHandle { inner: this.inner.clone() };
3500                        Ok(RunBuilderRequest::WithSchedulingOptions {
3501                            options: req.options,
3502
3503                            control_handle,
3504                        })
3505                    }
3506                    0x7879f2360ff1f160 => {
3507                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3508                        let mut req = fidl::new_empty!(
3509                            RunBuilderBuildRequest,
3510                            fidl::encoding::DefaultFuchsiaResourceDialect
3511                        );
3512                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunBuilderBuildRequest>(&header, _body_bytes, handles, &mut req)?;
3513                        let control_handle = RunBuilderControlHandle { inner: this.inner.clone() };
3514                        Ok(RunBuilderRequest::Build { controller: req.controller, control_handle })
3515                    }
3516                    _ if header.tx_id == 0
3517                        && header
3518                            .dynamic_flags()
3519                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3520                    {
3521                        Ok(RunBuilderRequest::_UnknownMethod {
3522                            ordinal: header.ordinal,
3523                            control_handle: RunBuilderControlHandle { inner: this.inner.clone() },
3524                            method_type: fidl::MethodType::OneWay,
3525                        })
3526                    }
3527                    _ if header
3528                        .dynamic_flags()
3529                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3530                    {
3531                        this.inner.send_framework_err(
3532                            fidl::encoding::FrameworkErr::UnknownMethod,
3533                            header.tx_id,
3534                            header.ordinal,
3535                            header.dynamic_flags(),
3536                            (bytes, handles),
3537                        )?;
3538                        Ok(RunBuilderRequest::_UnknownMethod {
3539                            ordinal: header.ordinal,
3540                            control_handle: RunBuilderControlHandle { inner: this.inner.clone() },
3541                            method_type: fidl::MethodType::TwoWay,
3542                        })
3543                    }
3544                    _ => Err(fidl::Error::UnknownOrdinal {
3545                        ordinal: header.ordinal,
3546                        protocol_name:
3547                            <RunBuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3548                    }),
3549                }))
3550            },
3551        )
3552    }
3553}
3554
3555/// This is the entry point of running test suites. A test "run" consists of
3556/// multiple test "suites" which consists of running multiple "test cases".
3557#[derive(Debug)]
3558pub enum RunBuilderRequest {
3559    /// Add a suite to this run. A suite is a component that implements
3560    /// `fuchsia.test.Suite`. Implementors of this API will talk to test suites
3561    /// using "Suite" protocol and return results using `controller`. The
3562    /// controller is also used to control the execution of the test suite.
3563    AddSuite {
3564        test_url: String,
3565        options: RunOptions,
3566        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3567        control_handle: RunBuilderControlHandle,
3568    },
3569    /// Add a suite to this run which would run in provided 'realm'. A suite is
3570    /// a component that implements `fuchsia.test.Suite`. Implementors of this
3571    /// API will talk to test suites using "Suite" protocol and return results
3572    /// using `controller`. The controller is also used to control the execution
3573    /// of the test suite.
3574    AddSuiteInRealm {
3575        realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3576        offers: Vec<fidl_fuchsia_component_decl::Offer>,
3577        test_collection: String,
3578        test_url: String,
3579        options: RunOptions,
3580        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3581        control_handle: RunBuilderControlHandle,
3582    },
3583    /// Specify scheduling options used for this run.
3584    WithSchedulingOptions { options: SchedulingOptions, control_handle: RunBuilderControlHandle },
3585    /// Build and schedule the run.
3586    ///
3587    /// This runs all suites added with their respective filters and closes the
3588    /// channel once it is done.
3589    Build {
3590        controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
3591        control_handle: RunBuilderControlHandle,
3592    },
3593    /// An interaction was received which does not match any known method.
3594    #[non_exhaustive]
3595    _UnknownMethod {
3596        /// Ordinal of the method that was called.
3597        ordinal: u64,
3598        control_handle: RunBuilderControlHandle,
3599        method_type: fidl::MethodType,
3600    },
3601}
3602
3603impl RunBuilderRequest {
3604    #[allow(irrefutable_let_patterns)]
3605    pub fn into_add_suite(
3606        self,
3607    ) -> Option<(
3608        String,
3609        RunOptions,
3610        fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3611        RunBuilderControlHandle,
3612    )> {
3613        if let RunBuilderRequest::AddSuite { test_url, options, controller, control_handle } = self
3614        {
3615            Some((test_url, options, controller, control_handle))
3616        } else {
3617            None
3618        }
3619    }
3620
3621    #[allow(irrefutable_let_patterns)]
3622    pub fn into_add_suite_in_realm(
3623        self,
3624    ) -> Option<(
3625        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3626        Vec<fidl_fuchsia_component_decl::Offer>,
3627        String,
3628        String,
3629        RunOptions,
3630        fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3631        RunBuilderControlHandle,
3632    )> {
3633        if let RunBuilderRequest::AddSuiteInRealm {
3634            realm,
3635            offers,
3636            test_collection,
3637            test_url,
3638            options,
3639            controller,
3640            control_handle,
3641        } = self
3642        {
3643            Some((realm, offers, test_collection, test_url, options, controller, control_handle))
3644        } else {
3645            None
3646        }
3647    }
3648
3649    #[allow(irrefutable_let_patterns)]
3650    pub fn into_with_scheduling_options(
3651        self,
3652    ) -> Option<(SchedulingOptions, RunBuilderControlHandle)> {
3653        if let RunBuilderRequest::WithSchedulingOptions { options, control_handle } = self {
3654            Some((options, control_handle))
3655        } else {
3656            None
3657        }
3658    }
3659
3660    #[allow(irrefutable_let_patterns)]
3661    pub fn into_build(
3662        self,
3663    ) -> Option<(fidl::endpoints::ServerEnd<RunControllerMarker>, RunBuilderControlHandle)> {
3664        if let RunBuilderRequest::Build { controller, control_handle } = self {
3665            Some((controller, control_handle))
3666        } else {
3667            None
3668        }
3669    }
3670
3671    /// Name of the method defined in FIDL
3672    pub fn method_name(&self) -> &'static str {
3673        match *self {
3674            RunBuilderRequest::AddSuite { .. } => "add_suite",
3675            RunBuilderRequest::AddSuiteInRealm { .. } => "add_suite_in_realm",
3676            RunBuilderRequest::WithSchedulingOptions { .. } => "with_scheduling_options",
3677            RunBuilderRequest::Build { .. } => "build",
3678            RunBuilderRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
3679                "unknown one-way method"
3680            }
3681            RunBuilderRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
3682                "unknown two-way method"
3683            }
3684        }
3685    }
3686}
3687
3688#[derive(Debug, Clone)]
3689pub struct RunBuilderControlHandle {
3690    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3691}
3692
3693impl fidl::endpoints::ControlHandle for RunBuilderControlHandle {
3694    fn shutdown(&self) {
3695        self.inner.shutdown()
3696    }
3697    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3698        self.inner.shutdown_with_epitaph(status)
3699    }
3700
3701    fn is_closed(&self) -> bool {
3702        self.inner.channel().is_closed()
3703    }
3704    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3705        self.inner.channel().on_closed()
3706    }
3707
3708    #[cfg(target_os = "fuchsia")]
3709    fn signal_peer(
3710        &self,
3711        clear_mask: zx::Signals,
3712        set_mask: zx::Signals,
3713    ) -> Result<(), zx_status::Status> {
3714        use fidl::Peered;
3715        self.inner.channel().signal_peer(clear_mask, set_mask)
3716    }
3717}
3718
3719impl RunBuilderControlHandle {}
3720
3721#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3722pub struct RunControllerMarker;
3723
3724impl fidl::endpoints::ProtocolMarker for RunControllerMarker {
3725    type Proxy = RunControllerProxy;
3726    type RequestStream = RunControllerRequestStream;
3727    #[cfg(target_os = "fuchsia")]
3728    type SynchronousProxy = RunControllerSynchronousProxy;
3729
3730    const DEBUG_NAME: &'static str = "fuchsia.test.manager.RunController";
3731}
3732impl fidl::endpoints::DiscoverableProtocolMarker for RunControllerMarker {}
3733
3734pub trait RunControllerProxyInterface: Send + Sync {
3735    fn r#stop(&self) -> Result<(), fidl::Error>;
3736    fn r#kill(&self) -> Result<(), fidl::Error>;
3737    type GetEventsResponseFut: std::future::Future<Output = Result<Vec<RunEvent>, fidl::Error>>
3738        + Send;
3739    fn r#get_events(&self) -> Self::GetEventsResponseFut;
3740}
3741#[derive(Debug)]
3742#[cfg(target_os = "fuchsia")]
3743pub struct RunControllerSynchronousProxy {
3744    client: fidl::client::sync::Client,
3745}
3746
3747#[cfg(target_os = "fuchsia")]
3748impl fidl::endpoints::SynchronousProxy for RunControllerSynchronousProxy {
3749    type Proxy = RunControllerProxy;
3750    type Protocol = RunControllerMarker;
3751
3752    fn from_channel(inner: fidl::Channel) -> Self {
3753        Self::new(inner)
3754    }
3755
3756    fn into_channel(self) -> fidl::Channel {
3757        self.client.into_channel()
3758    }
3759
3760    fn as_channel(&self) -> &fidl::Channel {
3761        self.client.as_channel()
3762    }
3763}
3764
3765#[cfg(target_os = "fuchsia")]
3766impl RunControllerSynchronousProxy {
3767    pub fn new(channel: fidl::Channel) -> Self {
3768        let protocol_name = <RunControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3769        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3770    }
3771
3772    pub fn into_channel(self) -> fidl::Channel {
3773        self.client.into_channel()
3774    }
3775
3776    /// Waits until an event arrives and returns it. It is safe for other
3777    /// threads to make concurrent requests while waiting for an event.
3778    pub fn wait_for_event(
3779        &self,
3780        deadline: zx::MonotonicInstant,
3781    ) -> Result<RunControllerEvent, fidl::Error> {
3782        RunControllerEvent::decode(self.client.wait_for_event(deadline)?)
3783    }
3784
3785    /// Stop the run gracefully. RunController will disconnect after all
3786    /// resources are released and all the events in this controller are drained.
3787    /// This method is used to allow the run to complete tests that are in progress,
3788    /// but will prevent starting new tests.
3789    pub fn r#stop(&self) -> Result<(), fidl::Error> {
3790        self.client.send::<fidl::encoding::EmptyPayload>(
3791            (),
3792            0x24972633e2cf712d,
3793            fidl::encoding::DynamicFlags::FLEXIBLE,
3794        )
3795    }
3796
3797    /// Immediately terminate the run. RunController will disconnect after all
3798    /// resources are released. This method will terminate tests even if they
3799    /// are in progress.
3800    pub fn r#kill(&self) -> Result<(), fidl::Error> {
3801        self.client.send::<fidl::encoding::EmptyPayload>(
3802            (),
3803            0x6e62104929fc55c5,
3804            fidl::encoding::DynamicFlags::FLEXIBLE,
3805        )
3806    }
3807
3808    /// Iterator over events for the run. This method is a hanging get; it
3809    /// returns an empty vector only when there will be no further events
3810    /// (the run completed).
3811    pub fn r#get_events(
3812        &self,
3813        ___deadline: zx::MonotonicInstant,
3814    ) -> Result<Vec<RunEvent>, fidl::Error> {
3815        let _response = self
3816            .client
3817            .send_query::<fidl::encoding::EmptyPayload, RunControllerGetEventsResponse>(
3818                (),
3819                0x273bbd98cfcea4ba,
3820                fidl::encoding::DynamicFlags::empty(),
3821                ___deadline,
3822            )?;
3823        Ok(_response.events)
3824    }
3825}
3826
3827#[cfg(target_os = "fuchsia")]
3828impl From<RunControllerSynchronousProxy> for zx::Handle {
3829    fn from(value: RunControllerSynchronousProxy) -> Self {
3830        value.into_channel().into()
3831    }
3832}
3833
3834#[cfg(target_os = "fuchsia")]
3835impl From<fidl::Channel> for RunControllerSynchronousProxy {
3836    fn from(value: fidl::Channel) -> Self {
3837        Self::new(value)
3838    }
3839}
3840
3841#[derive(Debug, Clone)]
3842pub struct RunControllerProxy {
3843    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3844}
3845
3846impl fidl::endpoints::Proxy for RunControllerProxy {
3847    type Protocol = RunControllerMarker;
3848
3849    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3850        Self::new(inner)
3851    }
3852
3853    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3854        self.client.into_channel().map_err(|client| Self { client })
3855    }
3856
3857    fn as_channel(&self) -> &::fidl::AsyncChannel {
3858        self.client.as_channel()
3859    }
3860}
3861
3862impl RunControllerProxy {
3863    /// Create a new Proxy for fuchsia.test.manager/RunController.
3864    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3865        let protocol_name = <RunControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3866        Self { client: fidl::client::Client::new(channel, protocol_name) }
3867    }
3868
3869    /// Get a Stream of events from the remote end of the protocol.
3870    ///
3871    /// # Panics
3872    ///
3873    /// Panics if the event stream was already taken.
3874    pub fn take_event_stream(&self) -> RunControllerEventStream {
3875        RunControllerEventStream { event_receiver: self.client.take_event_receiver() }
3876    }
3877
3878    /// Stop the run gracefully. RunController will disconnect after all
3879    /// resources are released and all the events in this controller are drained.
3880    /// This method is used to allow the run to complete tests that are in progress,
3881    /// but will prevent starting new tests.
3882    pub fn r#stop(&self) -> Result<(), fidl::Error> {
3883        RunControllerProxyInterface::r#stop(self)
3884    }
3885
3886    /// Immediately terminate the run. RunController will disconnect after all
3887    /// resources are released. This method will terminate tests even if they
3888    /// are in progress.
3889    pub fn r#kill(&self) -> Result<(), fidl::Error> {
3890        RunControllerProxyInterface::r#kill(self)
3891    }
3892
3893    /// Iterator over events for the run. This method is a hanging get; it
3894    /// returns an empty vector only when there will be no further events
3895    /// (the run completed).
3896    pub fn r#get_events(
3897        &self,
3898    ) -> fidl::client::QueryResponseFut<Vec<RunEvent>, fidl::encoding::DefaultFuchsiaResourceDialect>
3899    {
3900        RunControllerProxyInterface::r#get_events(self)
3901    }
3902}
3903
3904impl RunControllerProxyInterface for RunControllerProxy {
3905    fn r#stop(&self) -> Result<(), fidl::Error> {
3906        self.client.send::<fidl::encoding::EmptyPayload>(
3907            (),
3908            0x24972633e2cf712d,
3909            fidl::encoding::DynamicFlags::FLEXIBLE,
3910        )
3911    }
3912
3913    fn r#kill(&self) -> Result<(), fidl::Error> {
3914        self.client.send::<fidl::encoding::EmptyPayload>(
3915            (),
3916            0x6e62104929fc55c5,
3917            fidl::encoding::DynamicFlags::FLEXIBLE,
3918        )
3919    }
3920
3921    type GetEventsResponseFut = fidl::client::QueryResponseFut<
3922        Vec<RunEvent>,
3923        fidl::encoding::DefaultFuchsiaResourceDialect,
3924    >;
3925    fn r#get_events(&self) -> Self::GetEventsResponseFut {
3926        fn _decode(
3927            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3928        ) -> Result<Vec<RunEvent>, fidl::Error> {
3929            let _response = fidl::client::decode_transaction_body::<
3930                RunControllerGetEventsResponse,
3931                fidl::encoding::DefaultFuchsiaResourceDialect,
3932                0x273bbd98cfcea4ba,
3933            >(_buf?)?;
3934            Ok(_response.events)
3935        }
3936        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<RunEvent>>(
3937            (),
3938            0x273bbd98cfcea4ba,
3939            fidl::encoding::DynamicFlags::empty(),
3940            _decode,
3941        )
3942    }
3943}
3944
3945pub struct RunControllerEventStream {
3946    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3947}
3948
3949impl std::marker::Unpin for RunControllerEventStream {}
3950
3951impl futures::stream::FusedStream for RunControllerEventStream {
3952    fn is_terminated(&self) -> bool {
3953        self.event_receiver.is_terminated()
3954    }
3955}
3956
3957impl futures::Stream for RunControllerEventStream {
3958    type Item = Result<RunControllerEvent, fidl::Error>;
3959
3960    fn poll_next(
3961        mut self: std::pin::Pin<&mut Self>,
3962        cx: &mut std::task::Context<'_>,
3963    ) -> std::task::Poll<Option<Self::Item>> {
3964        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3965            &mut self.event_receiver,
3966            cx
3967        )?) {
3968            Some(buf) => std::task::Poll::Ready(Some(RunControllerEvent::decode(buf))),
3969            None => std::task::Poll::Ready(None),
3970        }
3971    }
3972}
3973
3974#[derive(Debug)]
3975pub enum RunControllerEvent {
3976    #[non_exhaustive]
3977    _UnknownEvent {
3978        /// Ordinal of the event that was sent.
3979        ordinal: u64,
3980    },
3981}
3982
3983impl RunControllerEvent {
3984    /// Decodes a message buffer as a [`RunControllerEvent`].
3985    fn decode(
3986        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3987    ) -> Result<RunControllerEvent, fidl::Error> {
3988        let (bytes, _handles) = buf.split_mut();
3989        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3990        debug_assert_eq!(tx_header.tx_id, 0);
3991        match tx_header.ordinal {
3992            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3993                Ok(RunControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3994            }
3995            _ => Err(fidl::Error::UnknownOrdinal {
3996                ordinal: tx_header.ordinal,
3997                protocol_name: <RunControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3998            }),
3999        }
4000    }
4001}
4002
4003/// A Stream of incoming requests for fuchsia.test.manager/RunController.
4004pub struct RunControllerRequestStream {
4005    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4006    is_terminated: bool,
4007}
4008
4009impl std::marker::Unpin for RunControllerRequestStream {}
4010
4011impl futures::stream::FusedStream for RunControllerRequestStream {
4012    fn is_terminated(&self) -> bool {
4013        self.is_terminated
4014    }
4015}
4016
4017impl fidl::endpoints::RequestStream for RunControllerRequestStream {
4018    type Protocol = RunControllerMarker;
4019    type ControlHandle = RunControllerControlHandle;
4020
4021    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4022        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4023    }
4024
4025    fn control_handle(&self) -> Self::ControlHandle {
4026        RunControllerControlHandle { inner: self.inner.clone() }
4027    }
4028
4029    fn into_inner(
4030        self,
4031    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4032    {
4033        (self.inner, self.is_terminated)
4034    }
4035
4036    fn from_inner(
4037        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4038        is_terminated: bool,
4039    ) -> Self {
4040        Self { inner, is_terminated }
4041    }
4042}
4043
4044impl futures::Stream for RunControllerRequestStream {
4045    type Item = Result<RunControllerRequest, fidl::Error>;
4046
4047    fn poll_next(
4048        mut self: std::pin::Pin<&mut Self>,
4049        cx: &mut std::task::Context<'_>,
4050    ) -> std::task::Poll<Option<Self::Item>> {
4051        let this = &mut *self;
4052        if this.inner.check_shutdown(cx) {
4053            this.is_terminated = true;
4054            return std::task::Poll::Ready(None);
4055        }
4056        if this.is_terminated {
4057            panic!("polled RunControllerRequestStream after completion");
4058        }
4059        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4060            |bytes, handles| {
4061                match this.inner.channel().read_etc(cx, bytes, handles) {
4062                    std::task::Poll::Ready(Ok(())) => {}
4063                    std::task::Poll::Pending => return std::task::Poll::Pending,
4064                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4065                        this.is_terminated = true;
4066                        return std::task::Poll::Ready(None);
4067                    }
4068                    std::task::Poll::Ready(Err(e)) => {
4069                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4070                            e.into(),
4071                        ))))
4072                    }
4073                }
4074
4075                // A message has been received from the channel
4076                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4077
4078                std::task::Poll::Ready(Some(match header.ordinal {
4079                    0x24972633e2cf712d => {
4080                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4081                        let mut req = fidl::new_empty!(
4082                            fidl::encoding::EmptyPayload,
4083                            fidl::encoding::DefaultFuchsiaResourceDialect
4084                        );
4085                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4086                        let control_handle =
4087                            RunControllerControlHandle { inner: this.inner.clone() };
4088                        Ok(RunControllerRequest::Stop { control_handle })
4089                    }
4090                    0x6e62104929fc55c5 => {
4091                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4092                        let mut req = fidl::new_empty!(
4093                            fidl::encoding::EmptyPayload,
4094                            fidl::encoding::DefaultFuchsiaResourceDialect
4095                        );
4096                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4097                        let control_handle =
4098                            RunControllerControlHandle { inner: this.inner.clone() };
4099                        Ok(RunControllerRequest::Kill { control_handle })
4100                    }
4101                    0x273bbd98cfcea4ba => {
4102                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4103                        let mut req = fidl::new_empty!(
4104                            fidl::encoding::EmptyPayload,
4105                            fidl::encoding::DefaultFuchsiaResourceDialect
4106                        );
4107                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4108                        let control_handle =
4109                            RunControllerControlHandle { inner: this.inner.clone() };
4110                        Ok(RunControllerRequest::GetEvents {
4111                            responder: RunControllerGetEventsResponder {
4112                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4113                                tx_id: header.tx_id,
4114                            },
4115                        })
4116                    }
4117                    _ if header.tx_id == 0
4118                        && header
4119                            .dynamic_flags()
4120                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4121                    {
4122                        Ok(RunControllerRequest::_UnknownMethod {
4123                            ordinal: header.ordinal,
4124                            control_handle: RunControllerControlHandle {
4125                                inner: this.inner.clone(),
4126                            },
4127                            method_type: fidl::MethodType::OneWay,
4128                        })
4129                    }
4130                    _ if header
4131                        .dynamic_flags()
4132                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4133                    {
4134                        this.inner.send_framework_err(
4135                            fidl::encoding::FrameworkErr::UnknownMethod,
4136                            header.tx_id,
4137                            header.ordinal,
4138                            header.dynamic_flags(),
4139                            (bytes, handles),
4140                        )?;
4141                        Ok(RunControllerRequest::_UnknownMethod {
4142                            ordinal: header.ordinal,
4143                            control_handle: RunControllerControlHandle {
4144                                inner: this.inner.clone(),
4145                            },
4146                            method_type: fidl::MethodType::TwoWay,
4147                        })
4148                    }
4149                    _ => Err(fidl::Error::UnknownOrdinal {
4150                        ordinal: header.ordinal,
4151                        protocol_name:
4152                            <RunControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4153                    }),
4154                }))
4155            },
4156        )
4157    }
4158}
4159
4160/// The server end will disconnect after all the suite runs have finished and
4161/// the events are drained.
4162/// If the client disconnects, the tests will be terminated immediately and all
4163/// results discarded.
4164#[derive(Debug)]
4165pub enum RunControllerRequest {
4166    /// Stop the run gracefully. RunController will disconnect after all
4167    /// resources are released and all the events in this controller are drained.
4168    /// This method is used to allow the run to complete tests that are in progress,
4169    /// but will prevent starting new tests.
4170    Stop { control_handle: RunControllerControlHandle },
4171    /// Immediately terminate the run. RunController will disconnect after all
4172    /// resources are released. This method will terminate tests even if they
4173    /// are in progress.
4174    Kill { control_handle: RunControllerControlHandle },
4175    /// Iterator over events for the run. This method is a hanging get; it
4176    /// returns an empty vector only when there will be no further events
4177    /// (the run completed).
4178    GetEvents { responder: RunControllerGetEventsResponder },
4179    /// An interaction was received which does not match any known method.
4180    #[non_exhaustive]
4181    _UnknownMethod {
4182        /// Ordinal of the method that was called.
4183        ordinal: u64,
4184        control_handle: RunControllerControlHandle,
4185        method_type: fidl::MethodType,
4186    },
4187}
4188
4189impl RunControllerRequest {
4190    #[allow(irrefutable_let_patterns)]
4191    pub fn into_stop(self) -> Option<(RunControllerControlHandle)> {
4192        if let RunControllerRequest::Stop { control_handle } = self {
4193            Some((control_handle))
4194        } else {
4195            None
4196        }
4197    }
4198
4199    #[allow(irrefutable_let_patterns)]
4200    pub fn into_kill(self) -> Option<(RunControllerControlHandle)> {
4201        if let RunControllerRequest::Kill { control_handle } = self {
4202            Some((control_handle))
4203        } else {
4204            None
4205        }
4206    }
4207
4208    #[allow(irrefutable_let_patterns)]
4209    pub fn into_get_events(self) -> Option<(RunControllerGetEventsResponder)> {
4210        if let RunControllerRequest::GetEvents { responder } = self {
4211            Some((responder))
4212        } else {
4213            None
4214        }
4215    }
4216
4217    /// Name of the method defined in FIDL
4218    pub fn method_name(&self) -> &'static str {
4219        match *self {
4220            RunControllerRequest::Stop { .. } => "stop",
4221            RunControllerRequest::Kill { .. } => "kill",
4222            RunControllerRequest::GetEvents { .. } => "get_events",
4223            RunControllerRequest::_UnknownMethod {
4224                method_type: fidl::MethodType::OneWay, ..
4225            } => "unknown one-way method",
4226            RunControllerRequest::_UnknownMethod {
4227                method_type: fidl::MethodType::TwoWay, ..
4228            } => "unknown two-way method",
4229        }
4230    }
4231}
4232
4233#[derive(Debug, Clone)]
4234pub struct RunControllerControlHandle {
4235    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4236}
4237
4238impl fidl::endpoints::ControlHandle for RunControllerControlHandle {
4239    fn shutdown(&self) {
4240        self.inner.shutdown()
4241    }
4242    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4243        self.inner.shutdown_with_epitaph(status)
4244    }
4245
4246    fn is_closed(&self) -> bool {
4247        self.inner.channel().is_closed()
4248    }
4249    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4250        self.inner.channel().on_closed()
4251    }
4252
4253    #[cfg(target_os = "fuchsia")]
4254    fn signal_peer(
4255        &self,
4256        clear_mask: zx::Signals,
4257        set_mask: zx::Signals,
4258    ) -> Result<(), zx_status::Status> {
4259        use fidl::Peered;
4260        self.inner.channel().signal_peer(clear_mask, set_mask)
4261    }
4262}
4263
4264impl RunControllerControlHandle {}
4265
4266#[must_use = "FIDL methods require a response to be sent"]
4267#[derive(Debug)]
4268pub struct RunControllerGetEventsResponder {
4269    control_handle: std::mem::ManuallyDrop<RunControllerControlHandle>,
4270    tx_id: u32,
4271}
4272
4273/// Set the the channel to be shutdown (see [`RunControllerControlHandle::shutdown`])
4274/// if the responder is dropped without sending a response, so that the client
4275/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4276impl std::ops::Drop for RunControllerGetEventsResponder {
4277    fn drop(&mut self) {
4278        self.control_handle.shutdown();
4279        // Safety: drops once, never accessed again
4280        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4281    }
4282}
4283
4284impl fidl::endpoints::Responder for RunControllerGetEventsResponder {
4285    type ControlHandle = RunControllerControlHandle;
4286
4287    fn control_handle(&self) -> &RunControllerControlHandle {
4288        &self.control_handle
4289    }
4290
4291    fn drop_without_shutdown(mut self) {
4292        // Safety: drops once, never accessed again due to mem::forget
4293        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4294        // Prevent Drop from running (which would shut down the channel)
4295        std::mem::forget(self);
4296    }
4297}
4298
4299impl RunControllerGetEventsResponder {
4300    /// Sends a response to the FIDL transaction.
4301    ///
4302    /// Sets the channel to shutdown if an error occurs.
4303    pub fn send(self, mut events: Vec<RunEvent>) -> Result<(), fidl::Error> {
4304        let _result = self.send_raw(events);
4305        if _result.is_err() {
4306            self.control_handle.shutdown();
4307        }
4308        self.drop_without_shutdown();
4309        _result
4310    }
4311
4312    /// Similar to "send" but does not shutdown the channel if an error occurs.
4313    pub fn send_no_shutdown_on_err(self, mut events: Vec<RunEvent>) -> Result<(), fidl::Error> {
4314        let _result = self.send_raw(events);
4315        self.drop_without_shutdown();
4316        _result
4317    }
4318
4319    fn send_raw(&self, mut events: Vec<RunEvent>) -> Result<(), fidl::Error> {
4320        self.control_handle.inner.send::<RunControllerGetEventsResponse>(
4321            (events.as_mut(),),
4322            self.tx_id,
4323            0x273bbd98cfcea4ba,
4324            fidl::encoding::DynamicFlags::empty(),
4325        )
4326    }
4327}
4328
4329#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4330pub struct SuiteControllerMarker;
4331
4332impl fidl::endpoints::ProtocolMarker for SuiteControllerMarker {
4333    type Proxy = SuiteControllerProxy;
4334    type RequestStream = SuiteControllerRequestStream;
4335    #[cfg(target_os = "fuchsia")]
4336    type SynchronousProxy = SuiteControllerSynchronousProxy;
4337
4338    const DEBUG_NAME: &'static str = "(anonymous) SuiteController";
4339}
4340pub type SuiteControllerWatchEventsResult = Result<Vec<Event>, LaunchError>;
4341pub type SuiteControllerGetEventsResult = Result<Vec<SuiteEvent>, LaunchError>;
4342
4343pub trait SuiteControllerProxyInterface: Send + Sync {
4344    fn r#stop(&self) -> Result<(), fidl::Error>;
4345    fn r#kill(&self) -> Result<(), fidl::Error>;
4346    type WatchEventsResponseFut: std::future::Future<Output = Result<SuiteControllerWatchEventsResult, fidl::Error>>
4347        + Send;
4348    fn r#watch_events(&self) -> Self::WatchEventsResponseFut;
4349    type GetEventsResponseFut: std::future::Future<Output = Result<SuiteControllerGetEventsResult, fidl::Error>>
4350        + Send;
4351    fn r#get_events(&self) -> Self::GetEventsResponseFut;
4352}
4353#[derive(Debug)]
4354#[cfg(target_os = "fuchsia")]
4355pub struct SuiteControllerSynchronousProxy {
4356    client: fidl::client::sync::Client,
4357}
4358
4359#[cfg(target_os = "fuchsia")]
4360impl fidl::endpoints::SynchronousProxy for SuiteControllerSynchronousProxy {
4361    type Proxy = SuiteControllerProxy;
4362    type Protocol = SuiteControllerMarker;
4363
4364    fn from_channel(inner: fidl::Channel) -> Self {
4365        Self::new(inner)
4366    }
4367
4368    fn into_channel(self) -> fidl::Channel {
4369        self.client.into_channel()
4370    }
4371
4372    fn as_channel(&self) -> &fidl::Channel {
4373        self.client.as_channel()
4374    }
4375}
4376
4377#[cfg(target_os = "fuchsia")]
4378impl SuiteControllerSynchronousProxy {
4379    pub fn new(channel: fidl::Channel) -> Self {
4380        let protocol_name = <SuiteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4381        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4382    }
4383
4384    pub fn into_channel(self) -> fidl::Channel {
4385        self.client.into_channel()
4386    }
4387
4388    /// Waits until an event arrives and returns it. It is safe for other
4389    /// threads to make concurrent requests while waiting for an event.
4390    pub fn wait_for_event(
4391        &self,
4392        deadline: zx::MonotonicInstant,
4393    ) -> Result<SuiteControllerEvent, fidl::Error> {
4394        SuiteControllerEvent::decode(self.client.wait_for_event(deadline)?)
4395    }
4396
4397    /// Stop the suite run gracefully. SuiteController will disconnect after
4398    /// all resources are released and all the events in this controller are drained.
4399    pub fn r#stop(&self) -> Result<(), fidl::Error> {
4400        self.client.send::<fidl::encoding::EmptyPayload>(
4401            (),
4402            0x4675fc6c8f404fef,
4403            fidl::encoding::DynamicFlags::FLEXIBLE,
4404        )
4405    }
4406
4407    /// Immediately terminate the run. SuiteController will disconnect after
4408    /// all resources are released. This method will terminate tests even if
4409    /// they are in progress.
4410    pub fn r#kill(&self) -> Result<(), fidl::Error> {
4411        self.client.send::<fidl::encoding::EmptyPayload>(
4412            (),
4413            0x5f813fb72887fc17,
4414            fidl::encoding::DynamicFlags::FLEXIBLE,
4415        )
4416    }
4417
4418    /// Returns events when they're available using a hanging get pattern. Returns an empty
4419    /// vector to indicate there will be no further events.
4420    pub fn r#watch_events(
4421        &self,
4422        ___deadline: zx::MonotonicInstant,
4423    ) -> Result<SuiteControllerWatchEventsResult, fidl::Error> {
4424        let _response =
4425            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
4426                SuiteControllerWatchEventsResponse,
4427                LaunchError,
4428            >>(
4429                (),
4430                0x5d1a75b1d06839b4,
4431                fidl::encoding::DynamicFlags::empty(),
4432                ___deadline,
4433            )?;
4434        Ok(_response.map(|x| x.events))
4435    }
4436
4437    /// Iterator over events for the run. This method is a hanging get; it
4438    /// returns an empty vector only when there will be no further events
4439    /// (the run completed).
4440    pub fn r#get_events(
4441        &self,
4442        ___deadline: zx::MonotonicInstant,
4443    ) -> Result<SuiteControllerGetEventsResult, fidl::Error> {
4444        let _response = self.client.send_query::<
4445            fidl::encoding::EmptyPayload,
4446            fidl::encoding::FlexibleResultType<SuiteControllerGetEventsResponse, LaunchError>,
4447        >(
4448            (),
4449            0x1f2ec93d2236d1db,
4450            fidl::encoding::DynamicFlags::FLEXIBLE,
4451            ___deadline,
4452        )?
4453        .into_result::<SuiteControllerMarker>("get_events")?;
4454        Ok(_response.map(|x| x.events))
4455    }
4456}
4457
4458#[cfg(target_os = "fuchsia")]
4459impl From<SuiteControllerSynchronousProxy> for zx::Handle {
4460    fn from(value: SuiteControllerSynchronousProxy) -> Self {
4461        value.into_channel().into()
4462    }
4463}
4464
4465#[cfg(target_os = "fuchsia")]
4466impl From<fidl::Channel> for SuiteControllerSynchronousProxy {
4467    fn from(value: fidl::Channel) -> Self {
4468        Self::new(value)
4469    }
4470}
4471
4472#[derive(Debug, Clone)]
4473pub struct SuiteControllerProxy {
4474    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4475}
4476
4477impl fidl::endpoints::Proxy for SuiteControllerProxy {
4478    type Protocol = SuiteControllerMarker;
4479
4480    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4481        Self::new(inner)
4482    }
4483
4484    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4485        self.client.into_channel().map_err(|client| Self { client })
4486    }
4487
4488    fn as_channel(&self) -> &::fidl::AsyncChannel {
4489        self.client.as_channel()
4490    }
4491}
4492
4493impl SuiteControllerProxy {
4494    /// Create a new Proxy for fuchsia.test.manager/SuiteController.
4495    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4496        let protocol_name = <SuiteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4497        Self { client: fidl::client::Client::new(channel, protocol_name) }
4498    }
4499
4500    /// Get a Stream of events from the remote end of the protocol.
4501    ///
4502    /// # Panics
4503    ///
4504    /// Panics if the event stream was already taken.
4505    pub fn take_event_stream(&self) -> SuiteControllerEventStream {
4506        SuiteControllerEventStream { event_receiver: self.client.take_event_receiver() }
4507    }
4508
4509    /// Stop the suite run gracefully. SuiteController will disconnect after
4510    /// all resources are released and all the events in this controller are drained.
4511    pub fn r#stop(&self) -> Result<(), fidl::Error> {
4512        SuiteControllerProxyInterface::r#stop(self)
4513    }
4514
4515    /// Immediately terminate the run. SuiteController will disconnect after
4516    /// all resources are released. This method will terminate tests even if
4517    /// they are in progress.
4518    pub fn r#kill(&self) -> Result<(), fidl::Error> {
4519        SuiteControllerProxyInterface::r#kill(self)
4520    }
4521
4522    /// Returns events when they're available using a hanging get pattern. Returns an empty
4523    /// vector to indicate there will be no further events.
4524    pub fn r#watch_events(
4525        &self,
4526    ) -> fidl::client::QueryResponseFut<
4527        SuiteControllerWatchEventsResult,
4528        fidl::encoding::DefaultFuchsiaResourceDialect,
4529    > {
4530        SuiteControllerProxyInterface::r#watch_events(self)
4531    }
4532
4533    /// Iterator over events for the run. This method is a hanging get; it
4534    /// returns an empty vector only when there will be no further events
4535    /// (the run completed).
4536    pub fn r#get_events(
4537        &self,
4538    ) -> fidl::client::QueryResponseFut<
4539        SuiteControllerGetEventsResult,
4540        fidl::encoding::DefaultFuchsiaResourceDialect,
4541    > {
4542        SuiteControllerProxyInterface::r#get_events(self)
4543    }
4544}
4545
4546impl SuiteControllerProxyInterface for SuiteControllerProxy {
4547    fn r#stop(&self) -> Result<(), fidl::Error> {
4548        self.client.send::<fidl::encoding::EmptyPayload>(
4549            (),
4550            0x4675fc6c8f404fef,
4551            fidl::encoding::DynamicFlags::FLEXIBLE,
4552        )
4553    }
4554
4555    fn r#kill(&self) -> Result<(), fidl::Error> {
4556        self.client.send::<fidl::encoding::EmptyPayload>(
4557            (),
4558            0x5f813fb72887fc17,
4559            fidl::encoding::DynamicFlags::FLEXIBLE,
4560        )
4561    }
4562
4563    type WatchEventsResponseFut = fidl::client::QueryResponseFut<
4564        SuiteControllerWatchEventsResult,
4565        fidl::encoding::DefaultFuchsiaResourceDialect,
4566    >;
4567    fn r#watch_events(&self) -> Self::WatchEventsResponseFut {
4568        fn _decode(
4569            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4570        ) -> Result<SuiteControllerWatchEventsResult, fidl::Error> {
4571            let _response = fidl::client::decode_transaction_body::<
4572                fidl::encoding::ResultType<SuiteControllerWatchEventsResponse, LaunchError>,
4573                fidl::encoding::DefaultFuchsiaResourceDialect,
4574                0x5d1a75b1d06839b4,
4575            >(_buf?)?;
4576            Ok(_response.map(|x| x.events))
4577        }
4578        self.client.send_query_and_decode::<
4579            fidl::encoding::EmptyPayload,
4580            SuiteControllerWatchEventsResult,
4581        >(
4582            (),
4583            0x5d1a75b1d06839b4,
4584            fidl::encoding::DynamicFlags::empty(),
4585            _decode,
4586        )
4587    }
4588
4589    type GetEventsResponseFut = fidl::client::QueryResponseFut<
4590        SuiteControllerGetEventsResult,
4591        fidl::encoding::DefaultFuchsiaResourceDialect,
4592    >;
4593    fn r#get_events(&self) -> Self::GetEventsResponseFut {
4594        fn _decode(
4595            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4596        ) -> Result<SuiteControllerGetEventsResult, fidl::Error> {
4597            let _response = fidl::client::decode_transaction_body::<
4598                fidl::encoding::FlexibleResultType<SuiteControllerGetEventsResponse, LaunchError>,
4599                fidl::encoding::DefaultFuchsiaResourceDialect,
4600                0x1f2ec93d2236d1db,
4601            >(_buf?)?
4602            .into_result::<SuiteControllerMarker>("get_events")?;
4603            Ok(_response.map(|x| x.events))
4604        }
4605        self.client
4606            .send_query_and_decode::<fidl::encoding::EmptyPayload, SuiteControllerGetEventsResult>(
4607                (),
4608                0x1f2ec93d2236d1db,
4609                fidl::encoding::DynamicFlags::FLEXIBLE,
4610                _decode,
4611            )
4612    }
4613}
4614
4615pub struct SuiteControllerEventStream {
4616    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4617}
4618
4619impl std::marker::Unpin for SuiteControllerEventStream {}
4620
4621impl futures::stream::FusedStream for SuiteControllerEventStream {
4622    fn is_terminated(&self) -> bool {
4623        self.event_receiver.is_terminated()
4624    }
4625}
4626
4627impl futures::Stream for SuiteControllerEventStream {
4628    type Item = Result<SuiteControllerEvent, fidl::Error>;
4629
4630    fn poll_next(
4631        mut self: std::pin::Pin<&mut Self>,
4632        cx: &mut std::task::Context<'_>,
4633    ) -> std::task::Poll<Option<Self::Item>> {
4634        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4635            &mut self.event_receiver,
4636            cx
4637        )?) {
4638            Some(buf) => std::task::Poll::Ready(Some(SuiteControllerEvent::decode(buf))),
4639            None => std::task::Poll::Ready(None),
4640        }
4641    }
4642}
4643
4644#[derive(Debug)]
4645pub enum SuiteControllerEvent {
4646    #[non_exhaustive]
4647    _UnknownEvent {
4648        /// Ordinal of the event that was sent.
4649        ordinal: u64,
4650    },
4651}
4652
4653impl SuiteControllerEvent {
4654    /// Decodes a message buffer as a [`SuiteControllerEvent`].
4655    fn decode(
4656        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4657    ) -> Result<SuiteControllerEvent, fidl::Error> {
4658        let (bytes, _handles) = buf.split_mut();
4659        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4660        debug_assert_eq!(tx_header.tx_id, 0);
4661        match tx_header.ordinal {
4662            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4663                Ok(SuiteControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4664            }
4665            _ => Err(fidl::Error::UnknownOrdinal {
4666                ordinal: tx_header.ordinal,
4667                protocol_name:
4668                    <SuiteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4669            }),
4670        }
4671    }
4672}
4673
4674/// A Stream of incoming requests for fuchsia.test.manager/SuiteController.
4675pub struct SuiteControllerRequestStream {
4676    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4677    is_terminated: bool,
4678}
4679
4680impl std::marker::Unpin for SuiteControllerRequestStream {}
4681
4682impl futures::stream::FusedStream for SuiteControllerRequestStream {
4683    fn is_terminated(&self) -> bool {
4684        self.is_terminated
4685    }
4686}
4687
4688impl fidl::endpoints::RequestStream for SuiteControllerRequestStream {
4689    type Protocol = SuiteControllerMarker;
4690    type ControlHandle = SuiteControllerControlHandle;
4691
4692    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4693        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4694    }
4695
4696    fn control_handle(&self) -> Self::ControlHandle {
4697        SuiteControllerControlHandle { inner: self.inner.clone() }
4698    }
4699
4700    fn into_inner(
4701        self,
4702    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4703    {
4704        (self.inner, self.is_terminated)
4705    }
4706
4707    fn from_inner(
4708        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4709        is_terminated: bool,
4710    ) -> Self {
4711        Self { inner, is_terminated }
4712    }
4713}
4714
4715impl futures::Stream for SuiteControllerRequestStream {
4716    type Item = Result<SuiteControllerRequest, fidl::Error>;
4717
4718    fn poll_next(
4719        mut self: std::pin::Pin<&mut Self>,
4720        cx: &mut std::task::Context<'_>,
4721    ) -> std::task::Poll<Option<Self::Item>> {
4722        let this = &mut *self;
4723        if this.inner.check_shutdown(cx) {
4724            this.is_terminated = true;
4725            return std::task::Poll::Ready(None);
4726        }
4727        if this.is_terminated {
4728            panic!("polled SuiteControllerRequestStream after completion");
4729        }
4730        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4731            |bytes, handles| {
4732                match this.inner.channel().read_etc(cx, bytes, handles) {
4733                    std::task::Poll::Ready(Ok(())) => {}
4734                    std::task::Poll::Pending => return std::task::Poll::Pending,
4735                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4736                        this.is_terminated = true;
4737                        return std::task::Poll::Ready(None);
4738                    }
4739                    std::task::Poll::Ready(Err(e)) => {
4740                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4741                            e.into(),
4742                        ))))
4743                    }
4744                }
4745
4746                // A message has been received from the channel
4747                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4748
4749                std::task::Poll::Ready(Some(match header.ordinal {
4750                    0x4675fc6c8f404fef => {
4751                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4752                        let mut req = fidl::new_empty!(
4753                            fidl::encoding::EmptyPayload,
4754                            fidl::encoding::DefaultFuchsiaResourceDialect
4755                        );
4756                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4757                        let control_handle =
4758                            SuiteControllerControlHandle { inner: this.inner.clone() };
4759                        Ok(SuiteControllerRequest::Stop { control_handle })
4760                    }
4761                    0x5f813fb72887fc17 => {
4762                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4763                        let mut req = fidl::new_empty!(
4764                            fidl::encoding::EmptyPayload,
4765                            fidl::encoding::DefaultFuchsiaResourceDialect
4766                        );
4767                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4768                        let control_handle =
4769                            SuiteControllerControlHandle { inner: this.inner.clone() };
4770                        Ok(SuiteControllerRequest::Kill { control_handle })
4771                    }
4772                    0x5d1a75b1d06839b4 => {
4773                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4774                        let mut req = fidl::new_empty!(
4775                            fidl::encoding::EmptyPayload,
4776                            fidl::encoding::DefaultFuchsiaResourceDialect
4777                        );
4778                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4779                        let control_handle =
4780                            SuiteControllerControlHandle { inner: this.inner.clone() };
4781                        Ok(SuiteControllerRequest::WatchEvents {
4782                            responder: SuiteControllerWatchEventsResponder {
4783                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4784                                tx_id: header.tx_id,
4785                            },
4786                        })
4787                    }
4788                    0x1f2ec93d2236d1db => {
4789                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4790                        let mut req = fidl::new_empty!(
4791                            fidl::encoding::EmptyPayload,
4792                            fidl::encoding::DefaultFuchsiaResourceDialect
4793                        );
4794                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4795                        let control_handle =
4796                            SuiteControllerControlHandle { inner: this.inner.clone() };
4797                        Ok(SuiteControllerRequest::GetEvents {
4798                            responder: SuiteControllerGetEventsResponder {
4799                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4800                                tx_id: header.tx_id,
4801                            },
4802                        })
4803                    }
4804                    _ if header.tx_id == 0
4805                        && header
4806                            .dynamic_flags()
4807                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4808                    {
4809                        Ok(SuiteControllerRequest::_UnknownMethod {
4810                            ordinal: header.ordinal,
4811                            control_handle: SuiteControllerControlHandle {
4812                                inner: this.inner.clone(),
4813                            },
4814                            method_type: fidl::MethodType::OneWay,
4815                        })
4816                    }
4817                    _ if header
4818                        .dynamic_flags()
4819                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4820                    {
4821                        this.inner.send_framework_err(
4822                            fidl::encoding::FrameworkErr::UnknownMethod,
4823                            header.tx_id,
4824                            header.ordinal,
4825                            header.dynamic_flags(),
4826                            (bytes, handles),
4827                        )?;
4828                        Ok(SuiteControllerRequest::_UnknownMethod {
4829                            ordinal: header.ordinal,
4830                            control_handle: SuiteControllerControlHandle {
4831                                inner: this.inner.clone(),
4832                            },
4833                            method_type: fidl::MethodType::TwoWay,
4834                        })
4835                    }
4836                    _ => Err(fidl::Error::UnknownOrdinal {
4837                        ordinal: header.ordinal,
4838                        protocol_name:
4839                            <SuiteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4840                    }),
4841                }))
4842            },
4843        )
4844    }
4845}
4846
4847/// Provides for control and monitoring of a running test suite started with `SuiteRunner.RunSuite`.
4848///
4849/// The server closes its end of the channel after the suite run has finished and all events have
4850/// been delivered via `WatchEvents`. If the client disconnects, the suite is terminated immediately
4851/// and all results discarded.
4852#[derive(Debug)]
4853pub enum SuiteControllerRequest {
4854    /// Stop the suite run gracefully. SuiteController will disconnect after
4855    /// all resources are released and all the events in this controller are drained.
4856    Stop { control_handle: SuiteControllerControlHandle },
4857    /// Immediately terminate the run. SuiteController will disconnect after
4858    /// all resources are released. This method will terminate tests even if
4859    /// they are in progress.
4860    Kill { control_handle: SuiteControllerControlHandle },
4861    /// Returns events when they're available using a hanging get pattern. Returns an empty
4862    /// vector to indicate there will be no further events.
4863    WatchEvents { responder: SuiteControllerWatchEventsResponder },
4864    /// Iterator over events for the run. This method is a hanging get; it
4865    /// returns an empty vector only when there will be no further events
4866    /// (the run completed).
4867    GetEvents { responder: SuiteControllerGetEventsResponder },
4868    /// An interaction was received which does not match any known method.
4869    #[non_exhaustive]
4870    _UnknownMethod {
4871        /// Ordinal of the method that was called.
4872        ordinal: u64,
4873        control_handle: SuiteControllerControlHandle,
4874        method_type: fidl::MethodType,
4875    },
4876}
4877
4878impl SuiteControllerRequest {
4879    #[allow(irrefutable_let_patterns)]
4880    pub fn into_stop(self) -> Option<(SuiteControllerControlHandle)> {
4881        if let SuiteControllerRequest::Stop { control_handle } = self {
4882            Some((control_handle))
4883        } else {
4884            None
4885        }
4886    }
4887
4888    #[allow(irrefutable_let_patterns)]
4889    pub fn into_kill(self) -> Option<(SuiteControllerControlHandle)> {
4890        if let SuiteControllerRequest::Kill { control_handle } = self {
4891            Some((control_handle))
4892        } else {
4893            None
4894        }
4895    }
4896
4897    #[allow(irrefutable_let_patterns)]
4898    pub fn into_watch_events(self) -> Option<(SuiteControllerWatchEventsResponder)> {
4899        if let SuiteControllerRequest::WatchEvents { responder } = self {
4900            Some((responder))
4901        } else {
4902            None
4903        }
4904    }
4905
4906    #[allow(irrefutable_let_patterns)]
4907    pub fn into_get_events(self) -> Option<(SuiteControllerGetEventsResponder)> {
4908        if let SuiteControllerRequest::GetEvents { responder } = self {
4909            Some((responder))
4910        } else {
4911            None
4912        }
4913    }
4914
4915    /// Name of the method defined in FIDL
4916    pub fn method_name(&self) -> &'static str {
4917        match *self {
4918            SuiteControllerRequest::Stop { .. } => "stop",
4919            SuiteControllerRequest::Kill { .. } => "kill",
4920            SuiteControllerRequest::WatchEvents { .. } => "watch_events",
4921            SuiteControllerRequest::GetEvents { .. } => "get_events",
4922            SuiteControllerRequest::_UnknownMethod {
4923                method_type: fidl::MethodType::OneWay,
4924                ..
4925            } => "unknown one-way method",
4926            SuiteControllerRequest::_UnknownMethod {
4927                method_type: fidl::MethodType::TwoWay,
4928                ..
4929            } => "unknown two-way method",
4930        }
4931    }
4932}
4933
4934#[derive(Debug, Clone)]
4935pub struct SuiteControllerControlHandle {
4936    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4937}
4938
4939impl fidl::endpoints::ControlHandle for SuiteControllerControlHandle {
4940    fn shutdown(&self) {
4941        self.inner.shutdown()
4942    }
4943    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4944        self.inner.shutdown_with_epitaph(status)
4945    }
4946
4947    fn is_closed(&self) -> bool {
4948        self.inner.channel().is_closed()
4949    }
4950    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4951        self.inner.channel().on_closed()
4952    }
4953
4954    #[cfg(target_os = "fuchsia")]
4955    fn signal_peer(
4956        &self,
4957        clear_mask: zx::Signals,
4958        set_mask: zx::Signals,
4959    ) -> Result<(), zx_status::Status> {
4960        use fidl::Peered;
4961        self.inner.channel().signal_peer(clear_mask, set_mask)
4962    }
4963}
4964
4965impl SuiteControllerControlHandle {}
4966
4967#[must_use = "FIDL methods require a response to be sent"]
4968#[derive(Debug)]
4969pub struct SuiteControllerWatchEventsResponder {
4970    control_handle: std::mem::ManuallyDrop<SuiteControllerControlHandle>,
4971    tx_id: u32,
4972}
4973
4974/// Set the the channel to be shutdown (see [`SuiteControllerControlHandle::shutdown`])
4975/// if the responder is dropped without sending a response, so that the client
4976/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4977impl std::ops::Drop for SuiteControllerWatchEventsResponder {
4978    fn drop(&mut self) {
4979        self.control_handle.shutdown();
4980        // Safety: drops once, never accessed again
4981        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4982    }
4983}
4984
4985impl fidl::endpoints::Responder for SuiteControllerWatchEventsResponder {
4986    type ControlHandle = SuiteControllerControlHandle;
4987
4988    fn control_handle(&self) -> &SuiteControllerControlHandle {
4989        &self.control_handle
4990    }
4991
4992    fn drop_without_shutdown(mut self) {
4993        // Safety: drops once, never accessed again due to mem::forget
4994        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4995        // Prevent Drop from running (which would shut down the channel)
4996        std::mem::forget(self);
4997    }
4998}
4999
5000impl SuiteControllerWatchEventsResponder {
5001    /// Sends a response to the FIDL transaction.
5002    ///
5003    /// Sets the channel to shutdown if an error occurs.
5004    pub fn send(self, mut result: Result<Vec<Event>, LaunchError>) -> Result<(), fidl::Error> {
5005        let _result = self.send_raw(result);
5006        if _result.is_err() {
5007            self.control_handle.shutdown();
5008        }
5009        self.drop_without_shutdown();
5010        _result
5011    }
5012
5013    /// Similar to "send" but does not shutdown the channel if an error occurs.
5014    pub fn send_no_shutdown_on_err(
5015        self,
5016        mut result: Result<Vec<Event>, LaunchError>,
5017    ) -> Result<(), fidl::Error> {
5018        let _result = self.send_raw(result);
5019        self.drop_without_shutdown();
5020        _result
5021    }
5022
5023    fn send_raw(&self, mut result: Result<Vec<Event>, LaunchError>) -> Result<(), fidl::Error> {
5024        self.control_handle.inner.send::<fidl::encoding::ResultType<
5025            SuiteControllerWatchEventsResponse,
5026            LaunchError,
5027        >>(
5028            result.as_mut().map_err(|e| *e).map(|events| (events.as_mut_slice(),)),
5029            self.tx_id,
5030            0x5d1a75b1d06839b4,
5031            fidl::encoding::DynamicFlags::empty(),
5032        )
5033    }
5034}
5035
5036#[must_use = "FIDL methods require a response to be sent"]
5037#[derive(Debug)]
5038pub struct SuiteControllerGetEventsResponder {
5039    control_handle: std::mem::ManuallyDrop<SuiteControllerControlHandle>,
5040    tx_id: u32,
5041}
5042
5043/// Set the the channel to be shutdown (see [`SuiteControllerControlHandle::shutdown`])
5044/// if the responder is dropped without sending a response, so that the client
5045/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5046impl std::ops::Drop for SuiteControllerGetEventsResponder {
5047    fn drop(&mut self) {
5048        self.control_handle.shutdown();
5049        // Safety: drops once, never accessed again
5050        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5051    }
5052}
5053
5054impl fidl::endpoints::Responder for SuiteControllerGetEventsResponder {
5055    type ControlHandle = SuiteControllerControlHandle;
5056
5057    fn control_handle(&self) -> &SuiteControllerControlHandle {
5058        &self.control_handle
5059    }
5060
5061    fn drop_without_shutdown(mut self) {
5062        // Safety: drops once, never accessed again due to mem::forget
5063        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5064        // Prevent Drop from running (which would shut down the channel)
5065        std::mem::forget(self);
5066    }
5067}
5068
5069impl SuiteControllerGetEventsResponder {
5070    /// Sends a response to the FIDL transaction.
5071    ///
5072    /// Sets the channel to shutdown if an error occurs.
5073    pub fn send(self, mut result: Result<Vec<SuiteEvent>, LaunchError>) -> Result<(), fidl::Error> {
5074        let _result = self.send_raw(result);
5075        if _result.is_err() {
5076            self.control_handle.shutdown();
5077        }
5078        self.drop_without_shutdown();
5079        _result
5080    }
5081
5082    /// Similar to "send" but does not shutdown the channel if an error occurs.
5083    pub fn send_no_shutdown_on_err(
5084        self,
5085        mut result: Result<Vec<SuiteEvent>, LaunchError>,
5086    ) -> Result<(), fidl::Error> {
5087        let _result = self.send_raw(result);
5088        self.drop_without_shutdown();
5089        _result
5090    }
5091
5092    fn send_raw(
5093        &self,
5094        mut result: Result<Vec<SuiteEvent>, LaunchError>,
5095    ) -> Result<(), fidl::Error> {
5096        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5097            SuiteControllerGetEventsResponse,
5098            LaunchError,
5099        >>(
5100            fidl::encoding::FlexibleResult::new(
5101                result.as_mut().map_err(|e| *e).map(|events| (events.as_mut_slice(),)),
5102            ),
5103            self.tx_id,
5104            0x1f2ec93d2236d1db,
5105            fidl::encoding::DynamicFlags::FLEXIBLE,
5106        )
5107    }
5108}
5109
5110#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5111pub struct SuiteRunnerMarker;
5112
5113impl fidl::endpoints::ProtocolMarker for SuiteRunnerMarker {
5114    type Proxy = SuiteRunnerProxy;
5115    type RequestStream = SuiteRunnerRequestStream;
5116    #[cfg(target_os = "fuchsia")]
5117    type SynchronousProxy = SuiteRunnerSynchronousProxy;
5118
5119    const DEBUG_NAME: &'static str = "fuchsia.test.manager.SuiteRunner";
5120}
5121impl fidl::endpoints::DiscoverableProtocolMarker for SuiteRunnerMarker {}
5122
5123pub trait SuiteRunnerProxyInterface: Send + Sync {
5124    fn r#run(
5125        &self,
5126        test_suite_url: &str,
5127        options: RunSuiteOptions,
5128        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5129    ) -> Result<(), fidl::Error>;
5130}
5131#[derive(Debug)]
5132#[cfg(target_os = "fuchsia")]
5133pub struct SuiteRunnerSynchronousProxy {
5134    client: fidl::client::sync::Client,
5135}
5136
5137#[cfg(target_os = "fuchsia")]
5138impl fidl::endpoints::SynchronousProxy for SuiteRunnerSynchronousProxy {
5139    type Proxy = SuiteRunnerProxy;
5140    type Protocol = SuiteRunnerMarker;
5141
5142    fn from_channel(inner: fidl::Channel) -> Self {
5143        Self::new(inner)
5144    }
5145
5146    fn into_channel(self) -> fidl::Channel {
5147        self.client.into_channel()
5148    }
5149
5150    fn as_channel(&self) -> &fidl::Channel {
5151        self.client.as_channel()
5152    }
5153}
5154
5155#[cfg(target_os = "fuchsia")]
5156impl SuiteRunnerSynchronousProxy {
5157    pub fn new(channel: fidl::Channel) -> Self {
5158        let protocol_name = <SuiteRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5159        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5160    }
5161
5162    pub fn into_channel(self) -> fidl::Channel {
5163        self.client.into_channel()
5164    }
5165
5166    /// Waits until an event arrives and returns it. It is safe for other
5167    /// threads to make concurrent requests while waiting for an event.
5168    pub fn wait_for_event(
5169        &self,
5170        deadline: zx::MonotonicInstant,
5171    ) -> Result<SuiteRunnerEvent, fidl::Error> {
5172        SuiteRunnerEvent::decode(self.client.wait_for_event(deadline)?)
5173    }
5174
5175    /// Run a test suite. A suite is a test component that implements `fuchsia.test.Suite`.
5176    pub fn r#run(
5177        &self,
5178        mut test_suite_url: &str,
5179        mut options: RunSuiteOptions,
5180        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5181    ) -> Result<(), fidl::Error> {
5182        self.client.send::<SuiteRunnerRunRequest>(
5183            (test_suite_url, &mut options, controller),
5184            0x16f5ec6a46c223f0,
5185            fidl::encoding::DynamicFlags::FLEXIBLE,
5186        )
5187    }
5188}
5189
5190#[cfg(target_os = "fuchsia")]
5191impl From<SuiteRunnerSynchronousProxy> for zx::Handle {
5192    fn from(value: SuiteRunnerSynchronousProxy) -> Self {
5193        value.into_channel().into()
5194    }
5195}
5196
5197#[cfg(target_os = "fuchsia")]
5198impl From<fidl::Channel> for SuiteRunnerSynchronousProxy {
5199    fn from(value: fidl::Channel) -> Self {
5200        Self::new(value)
5201    }
5202}
5203
5204#[derive(Debug, Clone)]
5205pub struct SuiteRunnerProxy {
5206    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5207}
5208
5209impl fidl::endpoints::Proxy for SuiteRunnerProxy {
5210    type Protocol = SuiteRunnerMarker;
5211
5212    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5213        Self::new(inner)
5214    }
5215
5216    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5217        self.client.into_channel().map_err(|client| Self { client })
5218    }
5219
5220    fn as_channel(&self) -> &::fidl::AsyncChannel {
5221        self.client.as_channel()
5222    }
5223}
5224
5225impl SuiteRunnerProxy {
5226    /// Create a new Proxy for fuchsia.test.manager/SuiteRunner.
5227    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5228        let protocol_name = <SuiteRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5229        Self { client: fidl::client::Client::new(channel, protocol_name) }
5230    }
5231
5232    /// Get a Stream of events from the remote end of the protocol.
5233    ///
5234    /// # Panics
5235    ///
5236    /// Panics if the event stream was already taken.
5237    pub fn take_event_stream(&self) -> SuiteRunnerEventStream {
5238        SuiteRunnerEventStream { event_receiver: self.client.take_event_receiver() }
5239    }
5240
5241    /// Run a test suite. A suite is a test component that implements `fuchsia.test.Suite`.
5242    pub fn r#run(
5243        &self,
5244        mut test_suite_url: &str,
5245        mut options: RunSuiteOptions,
5246        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5247    ) -> Result<(), fidl::Error> {
5248        SuiteRunnerProxyInterface::r#run(self, test_suite_url, options, controller)
5249    }
5250}
5251
5252impl SuiteRunnerProxyInterface for SuiteRunnerProxy {
5253    fn r#run(
5254        &self,
5255        mut test_suite_url: &str,
5256        mut options: RunSuiteOptions,
5257        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5258    ) -> Result<(), fidl::Error> {
5259        self.client.send::<SuiteRunnerRunRequest>(
5260            (test_suite_url, &mut options, controller),
5261            0x16f5ec6a46c223f0,
5262            fidl::encoding::DynamicFlags::FLEXIBLE,
5263        )
5264    }
5265}
5266
5267pub struct SuiteRunnerEventStream {
5268    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5269}
5270
5271impl std::marker::Unpin for SuiteRunnerEventStream {}
5272
5273impl futures::stream::FusedStream for SuiteRunnerEventStream {
5274    fn is_terminated(&self) -> bool {
5275        self.event_receiver.is_terminated()
5276    }
5277}
5278
5279impl futures::Stream for SuiteRunnerEventStream {
5280    type Item = Result<SuiteRunnerEvent, fidl::Error>;
5281
5282    fn poll_next(
5283        mut self: std::pin::Pin<&mut Self>,
5284        cx: &mut std::task::Context<'_>,
5285    ) -> std::task::Poll<Option<Self::Item>> {
5286        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5287            &mut self.event_receiver,
5288            cx
5289        )?) {
5290            Some(buf) => std::task::Poll::Ready(Some(SuiteRunnerEvent::decode(buf))),
5291            None => std::task::Poll::Ready(None),
5292        }
5293    }
5294}
5295
5296#[derive(Debug)]
5297pub enum SuiteRunnerEvent {
5298    #[non_exhaustive]
5299    _UnknownEvent {
5300        /// Ordinal of the event that was sent.
5301        ordinal: u64,
5302    },
5303}
5304
5305impl SuiteRunnerEvent {
5306    /// Decodes a message buffer as a [`SuiteRunnerEvent`].
5307    fn decode(
5308        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5309    ) -> Result<SuiteRunnerEvent, fidl::Error> {
5310        let (bytes, _handles) = buf.split_mut();
5311        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5312        debug_assert_eq!(tx_header.tx_id, 0);
5313        match tx_header.ordinal {
5314            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5315                Ok(SuiteRunnerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5316            }
5317            _ => Err(fidl::Error::UnknownOrdinal {
5318                ordinal: tx_header.ordinal,
5319                protocol_name: <SuiteRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5320            }),
5321        }
5322    }
5323}
5324
5325/// A Stream of incoming requests for fuchsia.test.manager/SuiteRunner.
5326pub struct SuiteRunnerRequestStream {
5327    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5328    is_terminated: bool,
5329}
5330
5331impl std::marker::Unpin for SuiteRunnerRequestStream {}
5332
5333impl futures::stream::FusedStream for SuiteRunnerRequestStream {
5334    fn is_terminated(&self) -> bool {
5335        self.is_terminated
5336    }
5337}
5338
5339impl fidl::endpoints::RequestStream for SuiteRunnerRequestStream {
5340    type Protocol = SuiteRunnerMarker;
5341    type ControlHandle = SuiteRunnerControlHandle;
5342
5343    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5344        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5345    }
5346
5347    fn control_handle(&self) -> Self::ControlHandle {
5348        SuiteRunnerControlHandle { inner: self.inner.clone() }
5349    }
5350
5351    fn into_inner(
5352        self,
5353    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5354    {
5355        (self.inner, self.is_terminated)
5356    }
5357
5358    fn from_inner(
5359        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5360        is_terminated: bool,
5361    ) -> Self {
5362        Self { inner, is_terminated }
5363    }
5364}
5365
5366impl futures::Stream for SuiteRunnerRequestStream {
5367    type Item = Result<SuiteRunnerRequest, fidl::Error>;
5368
5369    fn poll_next(
5370        mut self: std::pin::Pin<&mut Self>,
5371        cx: &mut std::task::Context<'_>,
5372    ) -> std::task::Poll<Option<Self::Item>> {
5373        let this = &mut *self;
5374        if this.inner.check_shutdown(cx) {
5375            this.is_terminated = true;
5376            return std::task::Poll::Ready(None);
5377        }
5378        if this.is_terminated {
5379            panic!("polled SuiteRunnerRequestStream after completion");
5380        }
5381        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5382            |bytes, handles| {
5383                match this.inner.channel().read_etc(cx, bytes, handles) {
5384                    std::task::Poll::Ready(Ok(())) => {}
5385                    std::task::Poll::Pending => return std::task::Poll::Pending,
5386                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5387                        this.is_terminated = true;
5388                        return std::task::Poll::Ready(None);
5389                    }
5390                    std::task::Poll::Ready(Err(e)) => {
5391                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5392                            e.into(),
5393                        ))))
5394                    }
5395                }
5396
5397                // A message has been received from the channel
5398                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5399
5400                std::task::Poll::Ready(Some(match header.ordinal {
5401                    0x16f5ec6a46c223f0 => {
5402                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5403                        let mut req = fidl::new_empty!(
5404                            SuiteRunnerRunRequest,
5405                            fidl::encoding::DefaultFuchsiaResourceDialect
5406                        );
5407                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SuiteRunnerRunRequest>(&header, _body_bytes, handles, &mut req)?;
5408                        let control_handle = SuiteRunnerControlHandle { inner: this.inner.clone() };
5409                        Ok(SuiteRunnerRequest::Run {
5410                            test_suite_url: req.test_suite_url,
5411                            options: req.options,
5412                            controller: req.controller,
5413
5414                            control_handle,
5415                        })
5416                    }
5417                    _ if header.tx_id == 0
5418                        && header
5419                            .dynamic_flags()
5420                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5421                    {
5422                        Ok(SuiteRunnerRequest::_UnknownMethod {
5423                            ordinal: header.ordinal,
5424                            control_handle: SuiteRunnerControlHandle { inner: this.inner.clone() },
5425                            method_type: fidl::MethodType::OneWay,
5426                        })
5427                    }
5428                    _ if header
5429                        .dynamic_flags()
5430                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5431                    {
5432                        this.inner.send_framework_err(
5433                            fidl::encoding::FrameworkErr::UnknownMethod,
5434                            header.tx_id,
5435                            header.ordinal,
5436                            header.dynamic_flags(),
5437                            (bytes, handles),
5438                        )?;
5439                        Ok(SuiteRunnerRequest::_UnknownMethod {
5440                            ordinal: header.ordinal,
5441                            control_handle: SuiteRunnerControlHandle { inner: this.inner.clone() },
5442                            method_type: fidl::MethodType::TwoWay,
5443                        })
5444                    }
5445                    _ => Err(fidl::Error::UnknownOrdinal {
5446                        ordinal: header.ordinal,
5447                        protocol_name:
5448                            <SuiteRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5449                    }),
5450                }))
5451            },
5452        )
5453    }
5454}
5455
5456/// Runs test suites.
5457#[derive(Debug)]
5458pub enum SuiteRunnerRequest {
5459    /// Run a test suite. A suite is a test component that implements `fuchsia.test.Suite`.
5460    Run {
5461        test_suite_url: String,
5462        options: RunSuiteOptions,
5463        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5464        control_handle: SuiteRunnerControlHandle,
5465    },
5466    /// An interaction was received which does not match any known method.
5467    #[non_exhaustive]
5468    _UnknownMethod {
5469        /// Ordinal of the method that was called.
5470        ordinal: u64,
5471        control_handle: SuiteRunnerControlHandle,
5472        method_type: fidl::MethodType,
5473    },
5474}
5475
5476impl SuiteRunnerRequest {
5477    #[allow(irrefutable_let_patterns)]
5478    pub fn into_run(
5479        self,
5480    ) -> Option<(
5481        String,
5482        RunSuiteOptions,
5483        fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5484        SuiteRunnerControlHandle,
5485    )> {
5486        if let SuiteRunnerRequest::Run { test_suite_url, options, controller, control_handle } =
5487            self
5488        {
5489            Some((test_suite_url, options, controller, control_handle))
5490        } else {
5491            None
5492        }
5493    }
5494
5495    /// Name of the method defined in FIDL
5496    pub fn method_name(&self) -> &'static str {
5497        match *self {
5498            SuiteRunnerRequest::Run { .. } => "run",
5499            SuiteRunnerRequest::_UnknownMethod {
5500                method_type: fidl::MethodType::OneWay, ..
5501            } => "unknown one-way method",
5502            SuiteRunnerRequest::_UnknownMethod {
5503                method_type: fidl::MethodType::TwoWay, ..
5504            } => "unknown two-way method",
5505        }
5506    }
5507}
5508
5509#[derive(Debug, Clone)]
5510pub struct SuiteRunnerControlHandle {
5511    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5512}
5513
5514impl fidl::endpoints::ControlHandle for SuiteRunnerControlHandle {
5515    fn shutdown(&self) {
5516        self.inner.shutdown()
5517    }
5518    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5519        self.inner.shutdown_with_epitaph(status)
5520    }
5521
5522    fn is_closed(&self) -> bool {
5523        self.inner.channel().is_closed()
5524    }
5525    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5526        self.inner.channel().on_closed()
5527    }
5528
5529    #[cfg(target_os = "fuchsia")]
5530    fn signal_peer(
5531        &self,
5532        clear_mask: zx::Signals,
5533        set_mask: zx::Signals,
5534    ) -> Result<(), zx_status::Status> {
5535        use fidl::Peered;
5536        self.inner.channel().signal_peer(clear_mask, set_mask)
5537    }
5538}
5539
5540impl SuiteRunnerControlHandle {}
5541
5542#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5543pub struct TestCaseEnumeratorMarker;
5544
5545impl fidl::endpoints::ProtocolMarker for TestCaseEnumeratorMarker {
5546    type Proxy = TestCaseEnumeratorProxy;
5547    type RequestStream = TestCaseEnumeratorRequestStream;
5548    #[cfg(target_os = "fuchsia")]
5549    type SynchronousProxy = TestCaseEnumeratorSynchronousProxy;
5550
5551    const DEBUG_NAME: &'static str = "fuchsia.test.manager.TestCaseEnumerator";
5552}
5553impl fidl::endpoints::DiscoverableProtocolMarker for TestCaseEnumeratorMarker {}
5554pub type TestCaseEnumeratorEnumerateResult = Result<(), LaunchError>;
5555
5556pub trait TestCaseEnumeratorProxyInterface: Send + Sync {
5557    type EnumerateResponseFut: std::future::Future<Output = Result<TestCaseEnumeratorEnumerateResult, fidl::Error>>
5558        + Send;
5559    fn r#enumerate(
5560        &self,
5561        test_suite_url: &str,
5562        options: EnumerateTestCasesOptions,
5563        iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
5564    ) -> Self::EnumerateResponseFut;
5565}
5566#[derive(Debug)]
5567#[cfg(target_os = "fuchsia")]
5568pub struct TestCaseEnumeratorSynchronousProxy {
5569    client: fidl::client::sync::Client,
5570}
5571
5572#[cfg(target_os = "fuchsia")]
5573impl fidl::endpoints::SynchronousProxy for TestCaseEnumeratorSynchronousProxy {
5574    type Proxy = TestCaseEnumeratorProxy;
5575    type Protocol = TestCaseEnumeratorMarker;
5576
5577    fn from_channel(inner: fidl::Channel) -> Self {
5578        Self::new(inner)
5579    }
5580
5581    fn into_channel(self) -> fidl::Channel {
5582        self.client.into_channel()
5583    }
5584
5585    fn as_channel(&self) -> &fidl::Channel {
5586        self.client.as_channel()
5587    }
5588}
5589
5590#[cfg(target_os = "fuchsia")]
5591impl TestCaseEnumeratorSynchronousProxy {
5592    pub fn new(channel: fidl::Channel) -> Self {
5593        let protocol_name =
5594            <TestCaseEnumeratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5595        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5596    }
5597
5598    pub fn into_channel(self) -> fidl::Channel {
5599        self.client.into_channel()
5600    }
5601
5602    /// Waits until an event arrives and returns it. It is safe for other
5603    /// threads to make concurrent requests while waiting for an event.
5604    pub fn wait_for_event(
5605        &self,
5606        deadline: zx::MonotonicInstant,
5607    ) -> Result<TestCaseEnumeratorEvent, fidl::Error> {
5608        TestCaseEnumeratorEvent::decode(self.client.wait_for_event(deadline)?)
5609    }
5610
5611    /// Creates an iterator for test cases.
5612    pub fn r#enumerate(
5613        &self,
5614        mut test_suite_url: &str,
5615        mut options: EnumerateTestCasesOptions,
5616        mut iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
5617        ___deadline: zx::MonotonicInstant,
5618    ) -> Result<TestCaseEnumeratorEnumerateResult, fidl::Error> {
5619        let _response = self.client.send_query::<
5620            TestCaseEnumeratorEnumerateRequest,
5621            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, LaunchError>,
5622        >(
5623            (test_suite_url, &mut options, iterator,),
5624            0x24f8a91d96134492,
5625            fidl::encoding::DynamicFlags::FLEXIBLE,
5626            ___deadline,
5627        )?
5628        .into_result::<TestCaseEnumeratorMarker>("enumerate")?;
5629        Ok(_response.map(|x| x))
5630    }
5631}
5632
5633#[cfg(target_os = "fuchsia")]
5634impl From<TestCaseEnumeratorSynchronousProxy> for zx::Handle {
5635    fn from(value: TestCaseEnumeratorSynchronousProxy) -> Self {
5636        value.into_channel().into()
5637    }
5638}
5639
5640#[cfg(target_os = "fuchsia")]
5641impl From<fidl::Channel> for TestCaseEnumeratorSynchronousProxy {
5642    fn from(value: fidl::Channel) -> Self {
5643        Self::new(value)
5644    }
5645}
5646
5647#[derive(Debug, Clone)]
5648pub struct TestCaseEnumeratorProxy {
5649    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5650}
5651
5652impl fidl::endpoints::Proxy for TestCaseEnumeratorProxy {
5653    type Protocol = TestCaseEnumeratorMarker;
5654
5655    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5656        Self::new(inner)
5657    }
5658
5659    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5660        self.client.into_channel().map_err(|client| Self { client })
5661    }
5662
5663    fn as_channel(&self) -> &::fidl::AsyncChannel {
5664        self.client.as_channel()
5665    }
5666}
5667
5668impl TestCaseEnumeratorProxy {
5669    /// Create a new Proxy for fuchsia.test.manager/TestCaseEnumerator.
5670    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5671        let protocol_name =
5672            <TestCaseEnumeratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5673        Self { client: fidl::client::Client::new(channel, protocol_name) }
5674    }
5675
5676    /// Get a Stream of events from the remote end of the protocol.
5677    ///
5678    /// # Panics
5679    ///
5680    /// Panics if the event stream was already taken.
5681    pub fn take_event_stream(&self) -> TestCaseEnumeratorEventStream {
5682        TestCaseEnumeratorEventStream { event_receiver: self.client.take_event_receiver() }
5683    }
5684
5685    /// Creates an iterator for test cases.
5686    pub fn r#enumerate(
5687        &self,
5688        mut test_suite_url: &str,
5689        mut options: EnumerateTestCasesOptions,
5690        mut iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
5691    ) -> fidl::client::QueryResponseFut<
5692        TestCaseEnumeratorEnumerateResult,
5693        fidl::encoding::DefaultFuchsiaResourceDialect,
5694    > {
5695        TestCaseEnumeratorProxyInterface::r#enumerate(self, test_suite_url, options, iterator)
5696    }
5697}
5698
5699impl TestCaseEnumeratorProxyInterface for TestCaseEnumeratorProxy {
5700    type EnumerateResponseFut = fidl::client::QueryResponseFut<
5701        TestCaseEnumeratorEnumerateResult,
5702        fidl::encoding::DefaultFuchsiaResourceDialect,
5703    >;
5704    fn r#enumerate(
5705        &self,
5706        mut test_suite_url: &str,
5707        mut options: EnumerateTestCasesOptions,
5708        mut iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
5709    ) -> Self::EnumerateResponseFut {
5710        fn _decode(
5711            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5712        ) -> Result<TestCaseEnumeratorEnumerateResult, fidl::Error> {
5713            let _response = fidl::client::decode_transaction_body::<
5714                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, LaunchError>,
5715                fidl::encoding::DefaultFuchsiaResourceDialect,
5716                0x24f8a91d96134492,
5717            >(_buf?)?
5718            .into_result::<TestCaseEnumeratorMarker>("enumerate")?;
5719            Ok(_response.map(|x| x))
5720        }
5721        self.client.send_query_and_decode::<
5722            TestCaseEnumeratorEnumerateRequest,
5723            TestCaseEnumeratorEnumerateResult,
5724        >(
5725            (test_suite_url, &mut options, iterator,),
5726            0x24f8a91d96134492,
5727            fidl::encoding::DynamicFlags::FLEXIBLE,
5728            _decode,
5729        )
5730    }
5731}
5732
5733pub struct TestCaseEnumeratorEventStream {
5734    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5735}
5736
5737impl std::marker::Unpin for TestCaseEnumeratorEventStream {}
5738
5739impl futures::stream::FusedStream for TestCaseEnumeratorEventStream {
5740    fn is_terminated(&self) -> bool {
5741        self.event_receiver.is_terminated()
5742    }
5743}
5744
5745impl futures::Stream for TestCaseEnumeratorEventStream {
5746    type Item = Result<TestCaseEnumeratorEvent, fidl::Error>;
5747
5748    fn poll_next(
5749        mut self: std::pin::Pin<&mut Self>,
5750        cx: &mut std::task::Context<'_>,
5751    ) -> std::task::Poll<Option<Self::Item>> {
5752        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5753            &mut self.event_receiver,
5754            cx
5755        )?) {
5756            Some(buf) => std::task::Poll::Ready(Some(TestCaseEnumeratorEvent::decode(buf))),
5757            None => std::task::Poll::Ready(None),
5758        }
5759    }
5760}
5761
5762#[derive(Debug)]
5763pub enum TestCaseEnumeratorEvent {
5764    #[non_exhaustive]
5765    _UnknownEvent {
5766        /// Ordinal of the event that was sent.
5767        ordinal: u64,
5768    },
5769}
5770
5771impl TestCaseEnumeratorEvent {
5772    /// Decodes a message buffer as a [`TestCaseEnumeratorEvent`].
5773    fn decode(
5774        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5775    ) -> Result<TestCaseEnumeratorEvent, fidl::Error> {
5776        let (bytes, _handles) = buf.split_mut();
5777        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5778        debug_assert_eq!(tx_header.tx_id, 0);
5779        match tx_header.ordinal {
5780            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5781                Ok(TestCaseEnumeratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5782            }
5783            _ => Err(fidl::Error::UnknownOrdinal {
5784                ordinal: tx_header.ordinal,
5785                protocol_name:
5786                    <TestCaseEnumeratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5787            }),
5788        }
5789    }
5790}
5791
5792/// A Stream of incoming requests for fuchsia.test.manager/TestCaseEnumerator.
5793pub struct TestCaseEnumeratorRequestStream {
5794    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5795    is_terminated: bool,
5796}
5797
5798impl std::marker::Unpin for TestCaseEnumeratorRequestStream {}
5799
5800impl futures::stream::FusedStream for TestCaseEnumeratorRequestStream {
5801    fn is_terminated(&self) -> bool {
5802        self.is_terminated
5803    }
5804}
5805
5806impl fidl::endpoints::RequestStream for TestCaseEnumeratorRequestStream {
5807    type Protocol = TestCaseEnumeratorMarker;
5808    type ControlHandle = TestCaseEnumeratorControlHandle;
5809
5810    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5811        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5812    }
5813
5814    fn control_handle(&self) -> Self::ControlHandle {
5815        TestCaseEnumeratorControlHandle { inner: self.inner.clone() }
5816    }
5817
5818    fn into_inner(
5819        self,
5820    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5821    {
5822        (self.inner, self.is_terminated)
5823    }
5824
5825    fn from_inner(
5826        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5827        is_terminated: bool,
5828    ) -> Self {
5829        Self { inner, is_terminated }
5830    }
5831}
5832
5833impl futures::Stream for TestCaseEnumeratorRequestStream {
5834    type Item = Result<TestCaseEnumeratorRequest, fidl::Error>;
5835
5836    fn poll_next(
5837        mut self: std::pin::Pin<&mut Self>,
5838        cx: &mut std::task::Context<'_>,
5839    ) -> std::task::Poll<Option<Self::Item>> {
5840        let this = &mut *self;
5841        if this.inner.check_shutdown(cx) {
5842            this.is_terminated = true;
5843            return std::task::Poll::Ready(None);
5844        }
5845        if this.is_terminated {
5846            panic!("polled TestCaseEnumeratorRequestStream after completion");
5847        }
5848        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5849            |bytes, handles| {
5850                match this.inner.channel().read_etc(cx, bytes, handles) {
5851                    std::task::Poll::Ready(Ok(())) => {}
5852                    std::task::Poll::Pending => return std::task::Poll::Pending,
5853                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5854                        this.is_terminated = true;
5855                        return std::task::Poll::Ready(None);
5856                    }
5857                    std::task::Poll::Ready(Err(e)) => {
5858                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5859                            e.into(),
5860                        ))))
5861                    }
5862                }
5863
5864                // A message has been received from the channel
5865                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5866
5867                std::task::Poll::Ready(Some(match header.ordinal {
5868                0x24f8a91d96134492 => {
5869                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5870                    let mut req = fidl::new_empty!(TestCaseEnumeratorEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
5871                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TestCaseEnumeratorEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
5872                    let control_handle = TestCaseEnumeratorControlHandle {
5873                        inner: this.inner.clone(),
5874                    };
5875                    Ok(TestCaseEnumeratorRequest::Enumerate {test_suite_url: req.test_suite_url,
5876options: req.options,
5877iterator: req.iterator,
5878
5879                        responder: TestCaseEnumeratorEnumerateResponder {
5880                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5881                            tx_id: header.tx_id,
5882                        },
5883                    })
5884                }
5885                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5886                    Ok(TestCaseEnumeratorRequest::_UnknownMethod {
5887                        ordinal: header.ordinal,
5888                        control_handle: TestCaseEnumeratorControlHandle { inner: this.inner.clone() },
5889                        method_type: fidl::MethodType::OneWay,
5890                    })
5891                }
5892                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5893                    this.inner.send_framework_err(
5894                        fidl::encoding::FrameworkErr::UnknownMethod,
5895                        header.tx_id,
5896                        header.ordinal,
5897                        header.dynamic_flags(),
5898                        (bytes, handles),
5899                    )?;
5900                    Ok(TestCaseEnumeratorRequest::_UnknownMethod {
5901                        ordinal: header.ordinal,
5902                        control_handle: TestCaseEnumeratorControlHandle { inner: this.inner.clone() },
5903                        method_type: fidl::MethodType::TwoWay,
5904                    })
5905                }
5906                _ => Err(fidl::Error::UnknownOrdinal {
5907                    ordinal: header.ordinal,
5908                    protocol_name: <TestCaseEnumeratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5909                }),
5910            }))
5911            },
5912        )
5913    }
5914}
5915
5916/// Enumerates cases in test suites, which implement the `fuchsia.test.Suite` protocol.
5917#[derive(Debug)]
5918pub enum TestCaseEnumeratorRequest {
5919    /// Creates an iterator for test cases.
5920    Enumerate {
5921        test_suite_url: String,
5922        options: EnumerateTestCasesOptions,
5923        iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
5924        responder: TestCaseEnumeratorEnumerateResponder,
5925    },
5926    /// An interaction was received which does not match any known method.
5927    #[non_exhaustive]
5928    _UnknownMethod {
5929        /// Ordinal of the method that was called.
5930        ordinal: u64,
5931        control_handle: TestCaseEnumeratorControlHandle,
5932        method_type: fidl::MethodType,
5933    },
5934}
5935
5936impl TestCaseEnumeratorRequest {
5937    #[allow(irrefutable_let_patterns)]
5938    pub fn into_enumerate(
5939        self,
5940    ) -> Option<(
5941        String,
5942        EnumerateTestCasesOptions,
5943        fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
5944        TestCaseEnumeratorEnumerateResponder,
5945    )> {
5946        if let TestCaseEnumeratorRequest::Enumerate {
5947            test_suite_url,
5948            options,
5949            iterator,
5950            responder,
5951        } = self
5952        {
5953            Some((test_suite_url, options, iterator, responder))
5954        } else {
5955            None
5956        }
5957    }
5958
5959    /// Name of the method defined in FIDL
5960    pub fn method_name(&self) -> &'static str {
5961        match *self {
5962            TestCaseEnumeratorRequest::Enumerate { .. } => "enumerate",
5963            TestCaseEnumeratorRequest::_UnknownMethod {
5964                method_type: fidl::MethodType::OneWay,
5965                ..
5966            } => "unknown one-way method",
5967            TestCaseEnumeratorRequest::_UnknownMethod {
5968                method_type: fidl::MethodType::TwoWay,
5969                ..
5970            } => "unknown two-way method",
5971        }
5972    }
5973}
5974
5975#[derive(Debug, Clone)]
5976pub struct TestCaseEnumeratorControlHandle {
5977    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5978}
5979
5980impl fidl::endpoints::ControlHandle for TestCaseEnumeratorControlHandle {
5981    fn shutdown(&self) {
5982        self.inner.shutdown()
5983    }
5984    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5985        self.inner.shutdown_with_epitaph(status)
5986    }
5987
5988    fn is_closed(&self) -> bool {
5989        self.inner.channel().is_closed()
5990    }
5991    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5992        self.inner.channel().on_closed()
5993    }
5994
5995    #[cfg(target_os = "fuchsia")]
5996    fn signal_peer(
5997        &self,
5998        clear_mask: zx::Signals,
5999        set_mask: zx::Signals,
6000    ) -> Result<(), zx_status::Status> {
6001        use fidl::Peered;
6002        self.inner.channel().signal_peer(clear_mask, set_mask)
6003    }
6004}
6005
6006impl TestCaseEnumeratorControlHandle {}
6007
6008#[must_use = "FIDL methods require a response to be sent"]
6009#[derive(Debug)]
6010pub struct TestCaseEnumeratorEnumerateResponder {
6011    control_handle: std::mem::ManuallyDrop<TestCaseEnumeratorControlHandle>,
6012    tx_id: u32,
6013}
6014
6015/// Set the the channel to be shutdown (see [`TestCaseEnumeratorControlHandle::shutdown`])
6016/// if the responder is dropped without sending a response, so that the client
6017/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6018impl std::ops::Drop for TestCaseEnumeratorEnumerateResponder {
6019    fn drop(&mut self) {
6020        self.control_handle.shutdown();
6021        // Safety: drops once, never accessed again
6022        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6023    }
6024}
6025
6026impl fidl::endpoints::Responder for TestCaseEnumeratorEnumerateResponder {
6027    type ControlHandle = TestCaseEnumeratorControlHandle;
6028
6029    fn control_handle(&self) -> &TestCaseEnumeratorControlHandle {
6030        &self.control_handle
6031    }
6032
6033    fn drop_without_shutdown(mut self) {
6034        // Safety: drops once, never accessed again due to mem::forget
6035        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6036        // Prevent Drop from running (which would shut down the channel)
6037        std::mem::forget(self);
6038    }
6039}
6040
6041impl TestCaseEnumeratorEnumerateResponder {
6042    /// Sends a response to the FIDL transaction.
6043    ///
6044    /// Sets the channel to shutdown if an error occurs.
6045    pub fn send(self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
6046        let _result = self.send_raw(result);
6047        if _result.is_err() {
6048            self.control_handle.shutdown();
6049        }
6050        self.drop_without_shutdown();
6051        _result
6052    }
6053
6054    /// Similar to "send" but does not shutdown the channel if an error occurs.
6055    pub fn send_no_shutdown_on_err(
6056        self,
6057        mut result: Result<(), LaunchError>,
6058    ) -> Result<(), fidl::Error> {
6059        let _result = self.send_raw(result);
6060        self.drop_without_shutdown();
6061        _result
6062    }
6063
6064    fn send_raw(&self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
6065        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6066            fidl::encoding::EmptyStruct,
6067            LaunchError,
6068        >>(
6069            fidl::encoding::FlexibleResult::new(result),
6070            self.tx_id,
6071            0x24f8a91d96134492,
6072            fidl::encoding::DynamicFlags::FLEXIBLE,
6073        )
6074    }
6075}
6076
6077#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6078pub struct TestCaseIteratorMarker;
6079
6080impl fidl::endpoints::ProtocolMarker for TestCaseIteratorMarker {
6081    type Proxy = TestCaseIteratorProxy;
6082    type RequestStream = TestCaseIteratorRequestStream;
6083    #[cfg(target_os = "fuchsia")]
6084    type SynchronousProxy = TestCaseIteratorSynchronousProxy;
6085
6086    const DEBUG_NAME: &'static str = "(anonymous) TestCaseIterator";
6087}
6088
6089pub trait TestCaseIteratorProxyInterface: Send + Sync {
6090    type GetNextResponseFut: std::future::Future<Output = Result<Vec<TestCase>, fidl::Error>> + Send;
6091    fn r#get_next(&self) -> Self::GetNextResponseFut;
6092}
6093#[derive(Debug)]
6094#[cfg(target_os = "fuchsia")]
6095pub struct TestCaseIteratorSynchronousProxy {
6096    client: fidl::client::sync::Client,
6097}
6098
6099#[cfg(target_os = "fuchsia")]
6100impl fidl::endpoints::SynchronousProxy for TestCaseIteratorSynchronousProxy {
6101    type Proxy = TestCaseIteratorProxy;
6102    type Protocol = TestCaseIteratorMarker;
6103
6104    fn from_channel(inner: fidl::Channel) -> Self {
6105        Self::new(inner)
6106    }
6107
6108    fn into_channel(self) -> fidl::Channel {
6109        self.client.into_channel()
6110    }
6111
6112    fn as_channel(&self) -> &fidl::Channel {
6113        self.client.as_channel()
6114    }
6115}
6116
6117#[cfg(target_os = "fuchsia")]
6118impl TestCaseIteratorSynchronousProxy {
6119    pub fn new(channel: fidl::Channel) -> Self {
6120        let protocol_name = <TestCaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6121        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6122    }
6123
6124    pub fn into_channel(self) -> fidl::Channel {
6125        self.client.into_channel()
6126    }
6127
6128    /// Waits until an event arrives and returns it. It is safe for other
6129    /// threads to make concurrent requests while waiting for an event.
6130    pub fn wait_for_event(
6131        &self,
6132        deadline: zx::MonotonicInstant,
6133    ) -> Result<TestCaseIteratorEvent, fidl::Error> {
6134        TestCaseIteratorEvent::decode(self.client.wait_for_event(deadline)?)
6135    }
6136
6137    /// Returns the next batch of test cases. Returns the empty vector to indicate that the
6138    /// iteration is complete.
6139    pub fn r#get_next(
6140        &self,
6141        ___deadline: zx::MonotonicInstant,
6142    ) -> Result<Vec<TestCase>, fidl::Error> {
6143        let _response = self
6144            .client
6145            .send_query::<fidl::encoding::EmptyPayload, TestCaseIteratorGetNextResponse>(
6146                (),
6147                0x37abec519b2ac1be,
6148                fidl::encoding::DynamicFlags::empty(),
6149                ___deadline,
6150            )?;
6151        Ok(_response.test_cases)
6152    }
6153}
6154
6155#[cfg(target_os = "fuchsia")]
6156impl From<TestCaseIteratorSynchronousProxy> for zx::Handle {
6157    fn from(value: TestCaseIteratorSynchronousProxy) -> Self {
6158        value.into_channel().into()
6159    }
6160}
6161
6162#[cfg(target_os = "fuchsia")]
6163impl From<fidl::Channel> for TestCaseIteratorSynchronousProxy {
6164    fn from(value: fidl::Channel) -> Self {
6165        Self::new(value)
6166    }
6167}
6168
6169#[derive(Debug, Clone)]
6170pub struct TestCaseIteratorProxy {
6171    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6172}
6173
6174impl fidl::endpoints::Proxy for TestCaseIteratorProxy {
6175    type Protocol = TestCaseIteratorMarker;
6176
6177    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6178        Self::new(inner)
6179    }
6180
6181    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6182        self.client.into_channel().map_err(|client| Self { client })
6183    }
6184
6185    fn as_channel(&self) -> &::fidl::AsyncChannel {
6186        self.client.as_channel()
6187    }
6188}
6189
6190impl TestCaseIteratorProxy {
6191    /// Create a new Proxy for fuchsia.test.manager/TestCaseIterator.
6192    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6193        let protocol_name = <TestCaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6194        Self { client: fidl::client::Client::new(channel, protocol_name) }
6195    }
6196
6197    /// Get a Stream of events from the remote end of the protocol.
6198    ///
6199    /// # Panics
6200    ///
6201    /// Panics if the event stream was already taken.
6202    pub fn take_event_stream(&self) -> TestCaseIteratorEventStream {
6203        TestCaseIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6204    }
6205
6206    /// Returns the next batch of test cases. Returns the empty vector to indicate that the
6207    /// iteration is complete.
6208    pub fn r#get_next(
6209        &self,
6210    ) -> fidl::client::QueryResponseFut<Vec<TestCase>, fidl::encoding::DefaultFuchsiaResourceDialect>
6211    {
6212        TestCaseIteratorProxyInterface::r#get_next(self)
6213    }
6214}
6215
6216impl TestCaseIteratorProxyInterface for TestCaseIteratorProxy {
6217    type GetNextResponseFut = fidl::client::QueryResponseFut<
6218        Vec<TestCase>,
6219        fidl::encoding::DefaultFuchsiaResourceDialect,
6220    >;
6221    fn r#get_next(&self) -> Self::GetNextResponseFut {
6222        fn _decode(
6223            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6224        ) -> Result<Vec<TestCase>, fidl::Error> {
6225            let _response = fidl::client::decode_transaction_body::<
6226                TestCaseIteratorGetNextResponse,
6227                fidl::encoding::DefaultFuchsiaResourceDialect,
6228                0x37abec519b2ac1be,
6229            >(_buf?)?;
6230            Ok(_response.test_cases)
6231        }
6232        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<TestCase>>(
6233            (),
6234            0x37abec519b2ac1be,
6235            fidl::encoding::DynamicFlags::empty(),
6236            _decode,
6237        )
6238    }
6239}
6240
6241pub struct TestCaseIteratorEventStream {
6242    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6243}
6244
6245impl std::marker::Unpin for TestCaseIteratorEventStream {}
6246
6247impl futures::stream::FusedStream for TestCaseIteratorEventStream {
6248    fn is_terminated(&self) -> bool {
6249        self.event_receiver.is_terminated()
6250    }
6251}
6252
6253impl futures::Stream for TestCaseIteratorEventStream {
6254    type Item = Result<TestCaseIteratorEvent, fidl::Error>;
6255
6256    fn poll_next(
6257        mut self: std::pin::Pin<&mut Self>,
6258        cx: &mut std::task::Context<'_>,
6259    ) -> std::task::Poll<Option<Self::Item>> {
6260        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6261            &mut self.event_receiver,
6262            cx
6263        )?) {
6264            Some(buf) => std::task::Poll::Ready(Some(TestCaseIteratorEvent::decode(buf))),
6265            None => std::task::Poll::Ready(None),
6266        }
6267    }
6268}
6269
6270#[derive(Debug)]
6271pub enum TestCaseIteratorEvent {}
6272
6273impl TestCaseIteratorEvent {
6274    /// Decodes a message buffer as a [`TestCaseIteratorEvent`].
6275    fn decode(
6276        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6277    ) -> Result<TestCaseIteratorEvent, fidl::Error> {
6278        let (bytes, _handles) = buf.split_mut();
6279        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6280        debug_assert_eq!(tx_header.tx_id, 0);
6281        match tx_header.ordinal {
6282            _ => Err(fidl::Error::UnknownOrdinal {
6283                ordinal: tx_header.ordinal,
6284                protocol_name:
6285                    <TestCaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6286            }),
6287        }
6288    }
6289}
6290
6291/// A Stream of incoming requests for fuchsia.test.manager/TestCaseIterator.
6292pub struct TestCaseIteratorRequestStream {
6293    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6294    is_terminated: bool,
6295}
6296
6297impl std::marker::Unpin for TestCaseIteratorRequestStream {}
6298
6299impl futures::stream::FusedStream for TestCaseIteratorRequestStream {
6300    fn is_terminated(&self) -> bool {
6301        self.is_terminated
6302    }
6303}
6304
6305impl fidl::endpoints::RequestStream for TestCaseIteratorRequestStream {
6306    type Protocol = TestCaseIteratorMarker;
6307    type ControlHandle = TestCaseIteratorControlHandle;
6308
6309    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6310        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6311    }
6312
6313    fn control_handle(&self) -> Self::ControlHandle {
6314        TestCaseIteratorControlHandle { inner: self.inner.clone() }
6315    }
6316
6317    fn into_inner(
6318        self,
6319    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6320    {
6321        (self.inner, self.is_terminated)
6322    }
6323
6324    fn from_inner(
6325        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6326        is_terminated: bool,
6327    ) -> Self {
6328        Self { inner, is_terminated }
6329    }
6330}
6331
6332impl futures::Stream for TestCaseIteratorRequestStream {
6333    type Item = Result<TestCaseIteratorRequest, fidl::Error>;
6334
6335    fn poll_next(
6336        mut self: std::pin::Pin<&mut Self>,
6337        cx: &mut std::task::Context<'_>,
6338    ) -> std::task::Poll<Option<Self::Item>> {
6339        let this = &mut *self;
6340        if this.inner.check_shutdown(cx) {
6341            this.is_terminated = true;
6342            return std::task::Poll::Ready(None);
6343        }
6344        if this.is_terminated {
6345            panic!("polled TestCaseIteratorRequestStream after completion");
6346        }
6347        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6348            |bytes, handles| {
6349                match this.inner.channel().read_etc(cx, bytes, handles) {
6350                    std::task::Poll::Ready(Ok(())) => {}
6351                    std::task::Poll::Pending => return std::task::Poll::Pending,
6352                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6353                        this.is_terminated = true;
6354                        return std::task::Poll::Ready(None);
6355                    }
6356                    std::task::Poll::Ready(Err(e)) => {
6357                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6358                            e.into(),
6359                        ))))
6360                    }
6361                }
6362
6363                // A message has been received from the channel
6364                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6365
6366                std::task::Poll::Ready(Some(match header.ordinal {
6367                    0x37abec519b2ac1be => {
6368                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6369                        let mut req = fidl::new_empty!(
6370                            fidl::encoding::EmptyPayload,
6371                            fidl::encoding::DefaultFuchsiaResourceDialect
6372                        );
6373                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6374                        let control_handle =
6375                            TestCaseIteratorControlHandle { inner: this.inner.clone() };
6376                        Ok(TestCaseIteratorRequest::GetNext {
6377                            responder: TestCaseIteratorGetNextResponder {
6378                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6379                                tx_id: header.tx_id,
6380                            },
6381                        })
6382                    }
6383                    _ => Err(fidl::Error::UnknownOrdinal {
6384                        ordinal: header.ordinal,
6385                        protocol_name:
6386                            <TestCaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6387                    }),
6388                }))
6389            },
6390        )
6391    }
6392}
6393
6394/// Iterator for listing available test cases.
6395#[derive(Debug)]
6396pub enum TestCaseIteratorRequest {
6397    /// Returns the next batch of test cases. Returns the empty vector to indicate that the
6398    /// iteration is complete.
6399    GetNext { responder: TestCaseIteratorGetNextResponder },
6400}
6401
6402impl TestCaseIteratorRequest {
6403    #[allow(irrefutable_let_patterns)]
6404    pub fn into_get_next(self) -> Option<(TestCaseIteratorGetNextResponder)> {
6405        if let TestCaseIteratorRequest::GetNext { responder } = self {
6406            Some((responder))
6407        } else {
6408            None
6409        }
6410    }
6411
6412    /// Name of the method defined in FIDL
6413    pub fn method_name(&self) -> &'static str {
6414        match *self {
6415            TestCaseIteratorRequest::GetNext { .. } => "get_next",
6416        }
6417    }
6418}
6419
6420#[derive(Debug, Clone)]
6421pub struct TestCaseIteratorControlHandle {
6422    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6423}
6424
6425impl fidl::endpoints::ControlHandle for TestCaseIteratorControlHandle {
6426    fn shutdown(&self) {
6427        self.inner.shutdown()
6428    }
6429    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6430        self.inner.shutdown_with_epitaph(status)
6431    }
6432
6433    fn is_closed(&self) -> bool {
6434        self.inner.channel().is_closed()
6435    }
6436    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6437        self.inner.channel().on_closed()
6438    }
6439
6440    #[cfg(target_os = "fuchsia")]
6441    fn signal_peer(
6442        &self,
6443        clear_mask: zx::Signals,
6444        set_mask: zx::Signals,
6445    ) -> Result<(), zx_status::Status> {
6446        use fidl::Peered;
6447        self.inner.channel().signal_peer(clear_mask, set_mask)
6448    }
6449}
6450
6451impl TestCaseIteratorControlHandle {}
6452
6453#[must_use = "FIDL methods require a response to be sent"]
6454#[derive(Debug)]
6455pub struct TestCaseIteratorGetNextResponder {
6456    control_handle: std::mem::ManuallyDrop<TestCaseIteratorControlHandle>,
6457    tx_id: u32,
6458}
6459
6460/// Set the the channel to be shutdown (see [`TestCaseIteratorControlHandle::shutdown`])
6461/// if the responder is dropped without sending a response, so that the client
6462/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6463impl std::ops::Drop for TestCaseIteratorGetNextResponder {
6464    fn drop(&mut self) {
6465        self.control_handle.shutdown();
6466        // Safety: drops once, never accessed again
6467        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6468    }
6469}
6470
6471impl fidl::endpoints::Responder for TestCaseIteratorGetNextResponder {
6472    type ControlHandle = TestCaseIteratorControlHandle;
6473
6474    fn control_handle(&self) -> &TestCaseIteratorControlHandle {
6475        &self.control_handle
6476    }
6477
6478    fn drop_without_shutdown(mut self) {
6479        // Safety: drops once, never accessed again due to mem::forget
6480        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6481        // Prevent Drop from running (which would shut down the channel)
6482        std::mem::forget(self);
6483    }
6484}
6485
6486impl TestCaseIteratorGetNextResponder {
6487    /// Sends a response to the FIDL transaction.
6488    ///
6489    /// Sets the channel to shutdown if an error occurs.
6490    pub fn send(self, mut test_cases: &[TestCase]) -> Result<(), fidl::Error> {
6491        let _result = self.send_raw(test_cases);
6492        if _result.is_err() {
6493            self.control_handle.shutdown();
6494        }
6495        self.drop_without_shutdown();
6496        _result
6497    }
6498
6499    /// Similar to "send" but does not shutdown the channel if an error occurs.
6500    pub fn send_no_shutdown_on_err(self, mut test_cases: &[TestCase]) -> Result<(), fidl::Error> {
6501        let _result = self.send_raw(test_cases);
6502        self.drop_without_shutdown();
6503        _result
6504    }
6505
6506    fn send_raw(&self, mut test_cases: &[TestCase]) -> Result<(), fidl::Error> {
6507        self.control_handle.inner.send::<TestCaseIteratorGetNextResponse>(
6508            (test_cases,),
6509            self.tx_id,
6510            0x37abec519b2ac1be,
6511            fidl::encoding::DynamicFlags::empty(),
6512        )
6513    }
6514}
6515
6516mod internal {
6517    use super::*;
6518
6519    impl fidl::encoding::ResourceTypeMarker for CaseArtifact {
6520        type Borrowed<'a> = &'a mut Self;
6521        fn take_or_borrow<'a>(
6522            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6523        ) -> Self::Borrowed<'a> {
6524            value
6525        }
6526    }
6527
6528    unsafe impl fidl::encoding::TypeMarker for CaseArtifact {
6529        type Owned = Self;
6530
6531        #[inline(always)]
6532        fn inline_align(_context: fidl::encoding::Context) -> usize {
6533            8
6534        }
6535
6536        #[inline(always)]
6537        fn inline_size(_context: fidl::encoding::Context) -> usize {
6538            24
6539        }
6540    }
6541
6542    unsafe impl fidl::encoding::Encode<CaseArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
6543        for &mut CaseArtifact
6544    {
6545        #[inline]
6546        unsafe fn encode(
6547            self,
6548            encoder: &mut fidl::encoding::Encoder<
6549                '_,
6550                fidl::encoding::DefaultFuchsiaResourceDialect,
6551            >,
6552            offset: usize,
6553            _depth: fidl::encoding::Depth,
6554        ) -> fidl::Result<()> {
6555            encoder.debug_check_bounds::<CaseArtifact>(offset);
6556            // Delegate to tuple encoding.
6557            fidl::encoding::Encode::<CaseArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6558                (
6559                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.identifier),
6560                    <Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.artifact),
6561                ),
6562                encoder, offset, _depth
6563            )
6564        }
6565    }
6566    unsafe impl<
6567            T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
6568            T1: fidl::encoding::Encode<Artifact, fidl::encoding::DefaultFuchsiaResourceDialect>,
6569        > fidl::encoding::Encode<CaseArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
6570        for (T0, T1)
6571    {
6572        #[inline]
6573        unsafe fn encode(
6574            self,
6575            encoder: &mut fidl::encoding::Encoder<
6576                '_,
6577                fidl::encoding::DefaultFuchsiaResourceDialect,
6578            >,
6579            offset: usize,
6580            depth: fidl::encoding::Depth,
6581        ) -> fidl::Result<()> {
6582            encoder.debug_check_bounds::<CaseArtifact>(offset);
6583            // Zero out padding regions. There's no need to apply masks
6584            // because the unmasked parts will be overwritten by fields.
6585            unsafe {
6586                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
6587                (ptr as *mut u64).write_unaligned(0);
6588            }
6589            // Write the fields.
6590            self.0.encode(encoder, offset + 0, depth)?;
6591            self.1.encode(encoder, offset + 8, depth)?;
6592            Ok(())
6593        }
6594    }
6595
6596    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for CaseArtifact {
6597        #[inline(always)]
6598        fn new_empty() -> Self {
6599            Self {
6600                identifier: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
6601                artifact: fidl::new_empty!(Artifact, fidl::encoding::DefaultFuchsiaResourceDialect),
6602            }
6603        }
6604
6605        #[inline]
6606        unsafe fn decode(
6607            &mut self,
6608            decoder: &mut fidl::encoding::Decoder<
6609                '_,
6610                fidl::encoding::DefaultFuchsiaResourceDialect,
6611            >,
6612            offset: usize,
6613            _depth: fidl::encoding::Depth,
6614        ) -> fidl::Result<()> {
6615            decoder.debug_check_bounds::<Self>(offset);
6616            // Verify that padding bytes are zero.
6617            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
6618            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6619            let mask = 0xffffffff00000000u64;
6620            let maskedval = padval & mask;
6621            if maskedval != 0 {
6622                return Err(fidl::Error::NonZeroPadding {
6623                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
6624                });
6625            }
6626            fidl::decode!(
6627                u32,
6628                fidl::encoding::DefaultFuchsiaResourceDialect,
6629                &mut self.identifier,
6630                decoder,
6631                offset + 0,
6632                _depth
6633            )?;
6634            fidl::decode!(
6635                Artifact,
6636                fidl::encoding::DefaultFuchsiaResourceDialect,
6637                &mut self.artifact,
6638                decoder,
6639                offset + 8,
6640                _depth
6641            )?;
6642            Ok(())
6643        }
6644    }
6645
6646    impl fidl::encoding::ResourceTypeMarker for DebugDataIteratorGetNextCompressedResponse {
6647        type Borrowed<'a> = &'a mut Self;
6648        fn take_or_borrow<'a>(
6649            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6650        ) -> Self::Borrowed<'a> {
6651            value
6652        }
6653    }
6654
6655    unsafe impl fidl::encoding::TypeMarker for DebugDataIteratorGetNextCompressedResponse {
6656        type Owned = Self;
6657
6658        #[inline(always)]
6659        fn inline_align(_context: fidl::encoding::Context) -> usize {
6660            8
6661        }
6662
6663        #[inline(always)]
6664        fn inline_size(_context: fidl::encoding::Context) -> usize {
6665            16
6666        }
6667    }
6668
6669    unsafe impl
6670        fidl::encoding::Encode<
6671            DebugDataIteratorGetNextCompressedResponse,
6672            fidl::encoding::DefaultFuchsiaResourceDialect,
6673        > for &mut DebugDataIteratorGetNextCompressedResponse
6674    {
6675        #[inline]
6676        unsafe fn encode(
6677            self,
6678            encoder: &mut fidl::encoding::Encoder<
6679                '_,
6680                fidl::encoding::DefaultFuchsiaResourceDialect,
6681            >,
6682            offset: usize,
6683            _depth: fidl::encoding::Depth,
6684        ) -> fidl::Result<()> {
6685            encoder.debug_check_bounds::<DebugDataIteratorGetNextCompressedResponse>(offset);
6686            // Delegate to tuple encoding.
6687            fidl::encoding::Encode::<DebugDataIteratorGetNextCompressedResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6688                (
6689                    <fidl::encoding::UnboundedVector<DebugData> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data),
6690                ),
6691                encoder, offset, _depth
6692            )
6693        }
6694    }
6695    unsafe impl<
6696            T0: fidl::encoding::Encode<
6697                fidl::encoding::UnboundedVector<DebugData>,
6698                fidl::encoding::DefaultFuchsiaResourceDialect,
6699            >,
6700        >
6701        fidl::encoding::Encode<
6702            DebugDataIteratorGetNextCompressedResponse,
6703            fidl::encoding::DefaultFuchsiaResourceDialect,
6704        > for (T0,)
6705    {
6706        #[inline]
6707        unsafe fn encode(
6708            self,
6709            encoder: &mut fidl::encoding::Encoder<
6710                '_,
6711                fidl::encoding::DefaultFuchsiaResourceDialect,
6712            >,
6713            offset: usize,
6714            depth: fidl::encoding::Depth,
6715        ) -> fidl::Result<()> {
6716            encoder.debug_check_bounds::<DebugDataIteratorGetNextCompressedResponse>(offset);
6717            // Zero out padding regions. There's no need to apply masks
6718            // because the unmasked parts will be overwritten by fields.
6719            // Write the fields.
6720            self.0.encode(encoder, offset + 0, depth)?;
6721            Ok(())
6722        }
6723    }
6724
6725    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6726        for DebugDataIteratorGetNextCompressedResponse
6727    {
6728        #[inline(always)]
6729        fn new_empty() -> Self {
6730            Self {
6731                data: fidl::new_empty!(
6732                    fidl::encoding::UnboundedVector<DebugData>,
6733                    fidl::encoding::DefaultFuchsiaResourceDialect
6734                ),
6735            }
6736        }
6737
6738        #[inline]
6739        unsafe fn decode(
6740            &mut self,
6741            decoder: &mut fidl::encoding::Decoder<
6742                '_,
6743                fidl::encoding::DefaultFuchsiaResourceDialect,
6744            >,
6745            offset: usize,
6746            _depth: fidl::encoding::Depth,
6747        ) -> fidl::Result<()> {
6748            decoder.debug_check_bounds::<Self>(offset);
6749            // Verify that padding bytes are zero.
6750            fidl::decode!(
6751                fidl::encoding::UnboundedVector<DebugData>,
6752                fidl::encoding::DefaultFuchsiaResourceDialect,
6753                &mut self.data,
6754                decoder,
6755                offset + 0,
6756                _depth
6757            )?;
6758            Ok(())
6759        }
6760    }
6761
6762    impl fidl::encoding::ResourceTypeMarker for DebugDataIteratorGetNextResponse {
6763        type Borrowed<'a> = &'a mut Self;
6764        fn take_or_borrow<'a>(
6765            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6766        ) -> Self::Borrowed<'a> {
6767            value
6768        }
6769    }
6770
6771    unsafe impl fidl::encoding::TypeMarker for DebugDataIteratorGetNextResponse {
6772        type Owned = Self;
6773
6774        #[inline(always)]
6775        fn inline_align(_context: fidl::encoding::Context) -> usize {
6776            8
6777        }
6778
6779        #[inline(always)]
6780        fn inline_size(_context: fidl::encoding::Context) -> usize {
6781            16
6782        }
6783    }
6784
6785    unsafe impl
6786        fidl::encoding::Encode<
6787            DebugDataIteratorGetNextResponse,
6788            fidl::encoding::DefaultFuchsiaResourceDialect,
6789        > for &mut DebugDataIteratorGetNextResponse
6790    {
6791        #[inline]
6792        unsafe fn encode(
6793            self,
6794            encoder: &mut fidl::encoding::Encoder<
6795                '_,
6796                fidl::encoding::DefaultFuchsiaResourceDialect,
6797            >,
6798            offset: usize,
6799            _depth: fidl::encoding::Depth,
6800        ) -> fidl::Result<()> {
6801            encoder.debug_check_bounds::<DebugDataIteratorGetNextResponse>(offset);
6802            // Delegate to tuple encoding.
6803            fidl::encoding::Encode::<DebugDataIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6804                (
6805                    <fidl::encoding::UnboundedVector<DebugData> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data),
6806                ),
6807                encoder, offset, _depth
6808            )
6809        }
6810    }
6811    unsafe impl<
6812            T0: fidl::encoding::Encode<
6813                fidl::encoding::UnboundedVector<DebugData>,
6814                fidl::encoding::DefaultFuchsiaResourceDialect,
6815            >,
6816        >
6817        fidl::encoding::Encode<
6818            DebugDataIteratorGetNextResponse,
6819            fidl::encoding::DefaultFuchsiaResourceDialect,
6820        > for (T0,)
6821    {
6822        #[inline]
6823        unsafe fn encode(
6824            self,
6825            encoder: &mut fidl::encoding::Encoder<
6826                '_,
6827                fidl::encoding::DefaultFuchsiaResourceDialect,
6828            >,
6829            offset: usize,
6830            depth: fidl::encoding::Depth,
6831        ) -> fidl::Result<()> {
6832            encoder.debug_check_bounds::<DebugDataIteratorGetNextResponse>(offset);
6833            // Zero out padding regions. There's no need to apply masks
6834            // because the unmasked parts will be overwritten by fields.
6835            // Write the fields.
6836            self.0.encode(encoder, offset + 0, depth)?;
6837            Ok(())
6838        }
6839    }
6840
6841    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6842        for DebugDataIteratorGetNextResponse
6843    {
6844        #[inline(always)]
6845        fn new_empty() -> Self {
6846            Self {
6847                data: fidl::new_empty!(
6848                    fidl::encoding::UnboundedVector<DebugData>,
6849                    fidl::encoding::DefaultFuchsiaResourceDialect
6850                ),
6851            }
6852        }
6853
6854        #[inline]
6855        unsafe fn decode(
6856            &mut self,
6857            decoder: &mut fidl::encoding::Decoder<
6858                '_,
6859                fidl::encoding::DefaultFuchsiaResourceDialect,
6860            >,
6861            offset: usize,
6862            _depth: fidl::encoding::Depth,
6863        ) -> fidl::Result<()> {
6864            decoder.debug_check_bounds::<Self>(offset);
6865            // Verify that padding bytes are zero.
6866            fidl::decode!(
6867                fidl::encoding::UnboundedVector<DebugData>,
6868                fidl::encoding::DefaultFuchsiaResourceDialect,
6869                &mut self.data,
6870                decoder,
6871                offset + 0,
6872                _depth
6873            )?;
6874            Ok(())
6875        }
6876    }
6877
6878    impl fidl::encoding::ResourceTypeMarker for DirectoryAndToken {
6879        type Borrowed<'a> = &'a mut Self;
6880        fn take_or_borrow<'a>(
6881            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6882        ) -> Self::Borrowed<'a> {
6883            value
6884        }
6885    }
6886
6887    unsafe impl fidl::encoding::TypeMarker for DirectoryAndToken {
6888        type Owned = Self;
6889
6890        #[inline(always)]
6891        fn inline_align(_context: fidl::encoding::Context) -> usize {
6892            4
6893        }
6894
6895        #[inline(always)]
6896        fn inline_size(_context: fidl::encoding::Context) -> usize {
6897            8
6898        }
6899    }
6900
6901    unsafe impl
6902        fidl::encoding::Encode<DirectoryAndToken, fidl::encoding::DefaultFuchsiaResourceDialect>
6903        for &mut DirectoryAndToken
6904    {
6905        #[inline]
6906        unsafe fn encode(
6907            self,
6908            encoder: &mut fidl::encoding::Encoder<
6909                '_,
6910                fidl::encoding::DefaultFuchsiaResourceDialect,
6911            >,
6912            offset: usize,
6913            _depth: fidl::encoding::Depth,
6914        ) -> fidl::Result<()> {
6915            encoder.debug_check_bounds::<DirectoryAndToken>(offset);
6916            // Delegate to tuple encoding.
6917            fidl::encoding::Encode::<DirectoryAndToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6918                (
6919                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.directory),
6920                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
6921                ),
6922                encoder, offset, _depth
6923            )
6924        }
6925    }
6926    unsafe impl<
6927            T0: fidl::encoding::Encode<
6928                fidl::encoding::Endpoint<
6929                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
6930                >,
6931                fidl::encoding::DefaultFuchsiaResourceDialect,
6932            >,
6933            T1: fidl::encoding::Encode<
6934                fidl::encoding::HandleType<
6935                    fidl::EventPair,
6936                    { fidl::ObjectType::EVENTPAIR.into_raw() },
6937                    2147483648,
6938                >,
6939                fidl::encoding::DefaultFuchsiaResourceDialect,
6940            >,
6941        >
6942        fidl::encoding::Encode<DirectoryAndToken, fidl::encoding::DefaultFuchsiaResourceDialect>
6943        for (T0, T1)
6944    {
6945        #[inline]
6946        unsafe fn encode(
6947            self,
6948            encoder: &mut fidl::encoding::Encoder<
6949                '_,
6950                fidl::encoding::DefaultFuchsiaResourceDialect,
6951            >,
6952            offset: usize,
6953            depth: fidl::encoding::Depth,
6954        ) -> fidl::Result<()> {
6955            encoder.debug_check_bounds::<DirectoryAndToken>(offset);
6956            // Zero out padding regions. There's no need to apply masks
6957            // because the unmasked parts will be overwritten by fields.
6958            // Write the fields.
6959            self.0.encode(encoder, offset + 0, depth)?;
6960            self.1.encode(encoder, offset + 4, depth)?;
6961            Ok(())
6962        }
6963    }
6964
6965    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6966        for DirectoryAndToken
6967    {
6968        #[inline(always)]
6969        fn new_empty() -> Self {
6970            Self {
6971                directory: fidl::new_empty!(
6972                    fidl::encoding::Endpoint<
6973                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
6974                    >,
6975                    fidl::encoding::DefaultFuchsiaResourceDialect
6976                ),
6977                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
6978            }
6979        }
6980
6981        #[inline]
6982        unsafe fn decode(
6983            &mut self,
6984            decoder: &mut fidl::encoding::Decoder<
6985                '_,
6986                fidl::encoding::DefaultFuchsiaResourceDialect,
6987            >,
6988            offset: usize,
6989            _depth: fidl::encoding::Depth,
6990        ) -> fidl::Result<()> {
6991            decoder.debug_check_bounds::<Self>(offset);
6992            // Verify that padding bytes are zero.
6993            fidl::decode!(
6994                fidl::encoding::Endpoint<
6995                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
6996                >,
6997                fidl::encoding::DefaultFuchsiaResourceDialect,
6998                &mut self.directory,
6999                decoder,
7000                offset + 0,
7001                _depth
7002            )?;
7003            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 4, _depth)?;
7004            Ok(())
7005        }
7006    }
7007
7008    impl fidl::encoding::ResourceTypeMarker for EarlyBootProfileRegisterWatcherRequest {
7009        type Borrowed<'a> = &'a mut Self;
7010        fn take_or_borrow<'a>(
7011            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7012        ) -> Self::Borrowed<'a> {
7013            value
7014        }
7015    }
7016
7017    unsafe impl fidl::encoding::TypeMarker for EarlyBootProfileRegisterWatcherRequest {
7018        type Owned = Self;
7019
7020        #[inline(always)]
7021        fn inline_align(_context: fidl::encoding::Context) -> usize {
7022            4
7023        }
7024
7025        #[inline(always)]
7026        fn inline_size(_context: fidl::encoding::Context) -> usize {
7027            4
7028        }
7029    }
7030
7031    unsafe impl
7032        fidl::encoding::Encode<
7033            EarlyBootProfileRegisterWatcherRequest,
7034            fidl::encoding::DefaultFuchsiaResourceDialect,
7035        > for &mut EarlyBootProfileRegisterWatcherRequest
7036    {
7037        #[inline]
7038        unsafe fn encode(
7039            self,
7040            encoder: &mut fidl::encoding::Encoder<
7041                '_,
7042                fidl::encoding::DefaultFuchsiaResourceDialect,
7043            >,
7044            offset: usize,
7045            _depth: fidl::encoding::Depth,
7046        ) -> fidl::Result<()> {
7047            encoder.debug_check_bounds::<EarlyBootProfileRegisterWatcherRequest>(offset);
7048            // Delegate to tuple encoding.
7049            fidl::encoding::Encode::<EarlyBootProfileRegisterWatcherRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7050                (
7051                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
7052                ),
7053                encoder, offset, _depth
7054            )
7055        }
7056    }
7057    unsafe impl<
7058            T0: fidl::encoding::Encode<
7059                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>>,
7060                fidl::encoding::DefaultFuchsiaResourceDialect,
7061            >,
7062        >
7063        fidl::encoding::Encode<
7064            EarlyBootProfileRegisterWatcherRequest,
7065            fidl::encoding::DefaultFuchsiaResourceDialect,
7066        > for (T0,)
7067    {
7068        #[inline]
7069        unsafe fn encode(
7070            self,
7071            encoder: &mut fidl::encoding::Encoder<
7072                '_,
7073                fidl::encoding::DefaultFuchsiaResourceDialect,
7074            >,
7075            offset: usize,
7076            depth: fidl::encoding::Depth,
7077        ) -> fidl::Result<()> {
7078            encoder.debug_check_bounds::<EarlyBootProfileRegisterWatcherRequest>(offset);
7079            // Zero out padding regions. There's no need to apply masks
7080            // because the unmasked parts will be overwritten by fields.
7081            // Write the fields.
7082            self.0.encode(encoder, offset + 0, depth)?;
7083            Ok(())
7084        }
7085    }
7086
7087    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7088        for EarlyBootProfileRegisterWatcherRequest
7089    {
7090        #[inline(always)]
7091        fn new_empty() -> Self {
7092            Self {
7093                iterator: fidl::new_empty!(
7094                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>>,
7095                    fidl::encoding::DefaultFuchsiaResourceDialect
7096                ),
7097            }
7098        }
7099
7100        #[inline]
7101        unsafe fn decode(
7102            &mut self,
7103            decoder: &mut fidl::encoding::Decoder<
7104                '_,
7105                fidl::encoding::DefaultFuchsiaResourceDialect,
7106            >,
7107            offset: usize,
7108            _depth: fidl::encoding::Depth,
7109        ) -> fidl::Result<()> {
7110            decoder.debug_check_bounds::<Self>(offset);
7111            // Verify that padding bytes are zero.
7112            fidl::decode!(
7113                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>>,
7114                fidl::encoding::DefaultFuchsiaResourceDialect,
7115                &mut self.iterator,
7116                decoder,
7117                offset + 0,
7118                _depth
7119            )?;
7120            Ok(())
7121        }
7122    }
7123
7124    impl fidl::encoding::ResourceTypeMarker for QueryEnumerateInRealmRequest {
7125        type Borrowed<'a> = &'a mut Self;
7126        fn take_or_borrow<'a>(
7127            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7128        ) -> Self::Borrowed<'a> {
7129            value
7130        }
7131    }
7132
7133    unsafe impl fidl::encoding::TypeMarker for QueryEnumerateInRealmRequest {
7134        type Owned = Self;
7135
7136        #[inline(always)]
7137        fn inline_align(_context: fidl::encoding::Context) -> usize {
7138            8
7139        }
7140
7141        #[inline(always)]
7142        fn inline_size(_context: fidl::encoding::Context) -> usize {
7143            64
7144        }
7145    }
7146
7147    unsafe impl
7148        fidl::encoding::Encode<
7149            QueryEnumerateInRealmRequest,
7150            fidl::encoding::DefaultFuchsiaResourceDialect,
7151        > for &mut QueryEnumerateInRealmRequest
7152    {
7153        #[inline]
7154        unsafe fn encode(
7155            self,
7156            encoder: &mut fidl::encoding::Encoder<
7157                '_,
7158                fidl::encoding::DefaultFuchsiaResourceDialect,
7159            >,
7160            offset: usize,
7161            _depth: fidl::encoding::Depth,
7162        ) -> fidl::Result<()> {
7163            encoder.debug_check_bounds::<QueryEnumerateInRealmRequest>(offset);
7164            // Delegate to tuple encoding.
7165            fidl::encoding::Encode::<QueryEnumerateInRealmRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7166                (
7167                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_url),
7168                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.realm),
7169                    <fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer> as fidl::encoding::ValueTypeMarker>::borrow(&self.offers),
7170                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.test_collection),
7171                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
7172                ),
7173                encoder, offset, _depth
7174            )
7175        }
7176    }
7177    unsafe impl<
7178            T0: fidl::encoding::Encode<
7179                fidl::encoding::BoundedString<4096>,
7180                fidl::encoding::DefaultFuchsiaResourceDialect,
7181            >,
7182            T1: fidl::encoding::Encode<
7183                fidl::encoding::Endpoint<
7184                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7185                >,
7186                fidl::encoding::DefaultFuchsiaResourceDialect,
7187            >,
7188            T2: fidl::encoding::Encode<
7189                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7190                fidl::encoding::DefaultFuchsiaResourceDialect,
7191            >,
7192            T3: fidl::encoding::Encode<
7193                fidl::encoding::UnboundedString,
7194                fidl::encoding::DefaultFuchsiaResourceDialect,
7195            >,
7196            T4: fidl::encoding::Encode<
7197                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7198                fidl::encoding::DefaultFuchsiaResourceDialect,
7199            >,
7200        >
7201        fidl::encoding::Encode<
7202            QueryEnumerateInRealmRequest,
7203            fidl::encoding::DefaultFuchsiaResourceDialect,
7204        > for (T0, T1, T2, T3, T4)
7205    {
7206        #[inline]
7207        unsafe fn encode(
7208            self,
7209            encoder: &mut fidl::encoding::Encoder<
7210                '_,
7211                fidl::encoding::DefaultFuchsiaResourceDialect,
7212            >,
7213            offset: usize,
7214            depth: fidl::encoding::Depth,
7215        ) -> fidl::Result<()> {
7216            encoder.debug_check_bounds::<QueryEnumerateInRealmRequest>(offset);
7217            // Zero out padding regions. There's no need to apply masks
7218            // because the unmasked parts will be overwritten by fields.
7219            unsafe {
7220                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7221                (ptr as *mut u64).write_unaligned(0);
7222            }
7223            unsafe {
7224                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(56);
7225                (ptr as *mut u64).write_unaligned(0);
7226            }
7227            // Write the fields.
7228            self.0.encode(encoder, offset + 0, depth)?;
7229            self.1.encode(encoder, offset + 16, depth)?;
7230            self.2.encode(encoder, offset + 24, depth)?;
7231            self.3.encode(encoder, offset + 40, depth)?;
7232            self.4.encode(encoder, offset + 56, depth)?;
7233            Ok(())
7234        }
7235    }
7236
7237    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7238        for QueryEnumerateInRealmRequest
7239    {
7240        #[inline(always)]
7241        fn new_empty() -> Self {
7242            Self {
7243                test_url: fidl::new_empty!(
7244                    fidl::encoding::BoundedString<4096>,
7245                    fidl::encoding::DefaultFuchsiaResourceDialect
7246                ),
7247                realm: fidl::new_empty!(
7248                    fidl::encoding::Endpoint<
7249                        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7250                    >,
7251                    fidl::encoding::DefaultFuchsiaResourceDialect
7252                ),
7253                offers: fidl::new_empty!(
7254                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7255                    fidl::encoding::DefaultFuchsiaResourceDialect
7256                ),
7257                test_collection: fidl::new_empty!(
7258                    fidl::encoding::UnboundedString,
7259                    fidl::encoding::DefaultFuchsiaResourceDialect
7260                ),
7261                iterator: fidl::new_empty!(
7262                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7263                    fidl::encoding::DefaultFuchsiaResourceDialect
7264                ),
7265            }
7266        }
7267
7268        #[inline]
7269        unsafe fn decode(
7270            &mut self,
7271            decoder: &mut fidl::encoding::Decoder<
7272                '_,
7273                fidl::encoding::DefaultFuchsiaResourceDialect,
7274            >,
7275            offset: usize,
7276            _depth: fidl::encoding::Depth,
7277        ) -> fidl::Result<()> {
7278            decoder.debug_check_bounds::<Self>(offset);
7279            // Verify that padding bytes are zero.
7280            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7281            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7282            let mask = 0xffffffff00000000u64;
7283            let maskedval = padval & mask;
7284            if maskedval != 0 {
7285                return Err(fidl::Error::NonZeroPadding {
7286                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7287                });
7288            }
7289            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(56) };
7290            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7291            let mask = 0xffffffff00000000u64;
7292            let maskedval = padval & mask;
7293            if maskedval != 0 {
7294                return Err(fidl::Error::NonZeroPadding {
7295                    padding_start: offset + 56 + ((mask as u64).trailing_zeros() / 8) as usize,
7296                });
7297            }
7298            fidl::decode!(
7299                fidl::encoding::BoundedString<4096>,
7300                fidl::encoding::DefaultFuchsiaResourceDialect,
7301                &mut self.test_url,
7302                decoder,
7303                offset + 0,
7304                _depth
7305            )?;
7306            fidl::decode!(
7307                fidl::encoding::Endpoint<
7308                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7309                >,
7310                fidl::encoding::DefaultFuchsiaResourceDialect,
7311                &mut self.realm,
7312                decoder,
7313                offset + 16,
7314                _depth
7315            )?;
7316            fidl::decode!(
7317                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7318                fidl::encoding::DefaultFuchsiaResourceDialect,
7319                &mut self.offers,
7320                decoder,
7321                offset + 24,
7322                _depth
7323            )?;
7324            fidl::decode!(
7325                fidl::encoding::UnboundedString,
7326                fidl::encoding::DefaultFuchsiaResourceDialect,
7327                &mut self.test_collection,
7328                decoder,
7329                offset + 40,
7330                _depth
7331            )?;
7332            fidl::decode!(
7333                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7334                fidl::encoding::DefaultFuchsiaResourceDialect,
7335                &mut self.iterator,
7336                decoder,
7337                offset + 56,
7338                _depth
7339            )?;
7340            Ok(())
7341        }
7342    }
7343
7344    impl fidl::encoding::ResourceTypeMarker for QueryEnumerateRequest {
7345        type Borrowed<'a> = &'a mut Self;
7346        fn take_or_borrow<'a>(
7347            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7348        ) -> Self::Borrowed<'a> {
7349            value
7350        }
7351    }
7352
7353    unsafe impl fidl::encoding::TypeMarker for QueryEnumerateRequest {
7354        type Owned = Self;
7355
7356        #[inline(always)]
7357        fn inline_align(_context: fidl::encoding::Context) -> usize {
7358            8
7359        }
7360
7361        #[inline(always)]
7362        fn inline_size(_context: fidl::encoding::Context) -> usize {
7363            24
7364        }
7365    }
7366
7367    unsafe impl
7368        fidl::encoding::Encode<QueryEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
7369        for &mut QueryEnumerateRequest
7370    {
7371        #[inline]
7372        unsafe fn encode(
7373            self,
7374            encoder: &mut fidl::encoding::Encoder<
7375                '_,
7376                fidl::encoding::DefaultFuchsiaResourceDialect,
7377            >,
7378            offset: usize,
7379            _depth: fidl::encoding::Depth,
7380        ) -> fidl::Result<()> {
7381            encoder.debug_check_bounds::<QueryEnumerateRequest>(offset);
7382            // Delegate to tuple encoding.
7383            fidl::encoding::Encode::<QueryEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7384                (
7385                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_url),
7386                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
7387                ),
7388                encoder, offset, _depth
7389            )
7390        }
7391    }
7392    unsafe impl<
7393            T0: fidl::encoding::Encode<
7394                fidl::encoding::BoundedString<4096>,
7395                fidl::encoding::DefaultFuchsiaResourceDialect,
7396            >,
7397            T1: fidl::encoding::Encode<
7398                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7399                fidl::encoding::DefaultFuchsiaResourceDialect,
7400            >,
7401        >
7402        fidl::encoding::Encode<QueryEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
7403        for (T0, T1)
7404    {
7405        #[inline]
7406        unsafe fn encode(
7407            self,
7408            encoder: &mut fidl::encoding::Encoder<
7409                '_,
7410                fidl::encoding::DefaultFuchsiaResourceDialect,
7411            >,
7412            offset: usize,
7413            depth: fidl::encoding::Depth,
7414        ) -> fidl::Result<()> {
7415            encoder.debug_check_bounds::<QueryEnumerateRequest>(offset);
7416            // Zero out padding regions. There's no need to apply masks
7417            // because the unmasked parts will be overwritten by fields.
7418            unsafe {
7419                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7420                (ptr as *mut u64).write_unaligned(0);
7421            }
7422            // Write the fields.
7423            self.0.encode(encoder, offset + 0, depth)?;
7424            self.1.encode(encoder, offset + 16, depth)?;
7425            Ok(())
7426        }
7427    }
7428
7429    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7430        for QueryEnumerateRequest
7431    {
7432        #[inline(always)]
7433        fn new_empty() -> Self {
7434            Self {
7435                test_url: fidl::new_empty!(
7436                    fidl::encoding::BoundedString<4096>,
7437                    fidl::encoding::DefaultFuchsiaResourceDialect
7438                ),
7439                iterator: fidl::new_empty!(
7440                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7441                    fidl::encoding::DefaultFuchsiaResourceDialect
7442                ),
7443            }
7444        }
7445
7446        #[inline]
7447        unsafe fn decode(
7448            &mut self,
7449            decoder: &mut fidl::encoding::Decoder<
7450                '_,
7451                fidl::encoding::DefaultFuchsiaResourceDialect,
7452            >,
7453            offset: usize,
7454            _depth: fidl::encoding::Depth,
7455        ) -> fidl::Result<()> {
7456            decoder.debug_check_bounds::<Self>(offset);
7457            // Verify that padding bytes are zero.
7458            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7459            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7460            let mask = 0xffffffff00000000u64;
7461            let maskedval = padval & mask;
7462            if maskedval != 0 {
7463                return Err(fidl::Error::NonZeroPadding {
7464                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7465                });
7466            }
7467            fidl::decode!(
7468                fidl::encoding::BoundedString<4096>,
7469                fidl::encoding::DefaultFuchsiaResourceDialect,
7470                &mut self.test_url,
7471                decoder,
7472                offset + 0,
7473                _depth
7474            )?;
7475            fidl::decode!(
7476                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7477                fidl::encoding::DefaultFuchsiaResourceDialect,
7478                &mut self.iterator,
7479                decoder,
7480                offset + 16,
7481                _depth
7482            )?;
7483            Ok(())
7484        }
7485    }
7486
7487    impl fidl::encoding::ResourceTypeMarker for RunBuilderAddSuiteInRealmRequest {
7488        type Borrowed<'a> = &'a mut Self;
7489        fn take_or_borrow<'a>(
7490            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7491        ) -> Self::Borrowed<'a> {
7492            value
7493        }
7494    }
7495
7496    unsafe impl fidl::encoding::TypeMarker for RunBuilderAddSuiteInRealmRequest {
7497        type Owned = Self;
7498
7499        #[inline(always)]
7500        fn inline_align(_context: fidl::encoding::Context) -> usize {
7501            8
7502        }
7503
7504        #[inline(always)]
7505        fn inline_size(_context: fidl::encoding::Context) -> usize {
7506            80
7507        }
7508    }
7509
7510    unsafe impl
7511        fidl::encoding::Encode<
7512            RunBuilderAddSuiteInRealmRequest,
7513            fidl::encoding::DefaultFuchsiaResourceDialect,
7514        > for &mut RunBuilderAddSuiteInRealmRequest
7515    {
7516        #[inline]
7517        unsafe fn encode(
7518            self,
7519            encoder: &mut fidl::encoding::Encoder<
7520                '_,
7521                fidl::encoding::DefaultFuchsiaResourceDialect,
7522            >,
7523            offset: usize,
7524            _depth: fidl::encoding::Depth,
7525        ) -> fidl::Result<()> {
7526            encoder.debug_check_bounds::<RunBuilderAddSuiteInRealmRequest>(offset);
7527            // Delegate to tuple encoding.
7528            fidl::encoding::Encode::<RunBuilderAddSuiteInRealmRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7529                (
7530                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.realm),
7531                    <fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer> as fidl::encoding::ValueTypeMarker>::borrow(&self.offers),
7532                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.test_collection),
7533                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_url),
7534                    <RunOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
7535                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
7536                ),
7537                encoder, offset, _depth
7538            )
7539        }
7540    }
7541    unsafe impl<
7542            T0: fidl::encoding::Encode<
7543                fidl::encoding::Endpoint<
7544                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7545                >,
7546                fidl::encoding::DefaultFuchsiaResourceDialect,
7547            >,
7548            T1: fidl::encoding::Encode<
7549                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7550                fidl::encoding::DefaultFuchsiaResourceDialect,
7551            >,
7552            T2: fidl::encoding::Encode<
7553                fidl::encoding::UnboundedString,
7554                fidl::encoding::DefaultFuchsiaResourceDialect,
7555            >,
7556            T3: fidl::encoding::Encode<
7557                fidl::encoding::BoundedString<4096>,
7558                fidl::encoding::DefaultFuchsiaResourceDialect,
7559            >,
7560            T4: fidl::encoding::Encode<RunOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
7561            T5: fidl::encoding::Encode<
7562                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7563                fidl::encoding::DefaultFuchsiaResourceDialect,
7564            >,
7565        >
7566        fidl::encoding::Encode<
7567            RunBuilderAddSuiteInRealmRequest,
7568            fidl::encoding::DefaultFuchsiaResourceDialect,
7569        > for (T0, T1, T2, T3, T4, T5)
7570    {
7571        #[inline]
7572        unsafe fn encode(
7573            self,
7574            encoder: &mut fidl::encoding::Encoder<
7575                '_,
7576                fidl::encoding::DefaultFuchsiaResourceDialect,
7577            >,
7578            offset: usize,
7579            depth: fidl::encoding::Depth,
7580        ) -> fidl::Result<()> {
7581            encoder.debug_check_bounds::<RunBuilderAddSuiteInRealmRequest>(offset);
7582            // Zero out padding regions. There's no need to apply masks
7583            // because the unmasked parts will be overwritten by fields.
7584            unsafe {
7585                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7586                (ptr as *mut u64).write_unaligned(0);
7587            }
7588            unsafe {
7589                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(72);
7590                (ptr as *mut u64).write_unaligned(0);
7591            }
7592            // Write the fields.
7593            self.0.encode(encoder, offset + 0, depth)?;
7594            self.1.encode(encoder, offset + 8, depth)?;
7595            self.2.encode(encoder, offset + 24, depth)?;
7596            self.3.encode(encoder, offset + 40, depth)?;
7597            self.4.encode(encoder, offset + 56, depth)?;
7598            self.5.encode(encoder, offset + 72, depth)?;
7599            Ok(())
7600        }
7601    }
7602
7603    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7604        for RunBuilderAddSuiteInRealmRequest
7605    {
7606        #[inline(always)]
7607        fn new_empty() -> Self {
7608            Self {
7609                realm: fidl::new_empty!(
7610                    fidl::encoding::Endpoint<
7611                        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7612                    >,
7613                    fidl::encoding::DefaultFuchsiaResourceDialect
7614                ),
7615                offers: fidl::new_empty!(
7616                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7617                    fidl::encoding::DefaultFuchsiaResourceDialect
7618                ),
7619                test_collection: fidl::new_empty!(
7620                    fidl::encoding::UnboundedString,
7621                    fidl::encoding::DefaultFuchsiaResourceDialect
7622                ),
7623                test_url: fidl::new_empty!(
7624                    fidl::encoding::BoundedString<4096>,
7625                    fidl::encoding::DefaultFuchsiaResourceDialect
7626                ),
7627                options: fidl::new_empty!(
7628                    RunOptions,
7629                    fidl::encoding::DefaultFuchsiaResourceDialect
7630                ),
7631                controller: fidl::new_empty!(
7632                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7633                    fidl::encoding::DefaultFuchsiaResourceDialect
7634                ),
7635            }
7636        }
7637
7638        #[inline]
7639        unsafe fn decode(
7640            &mut self,
7641            decoder: &mut fidl::encoding::Decoder<
7642                '_,
7643                fidl::encoding::DefaultFuchsiaResourceDialect,
7644            >,
7645            offset: usize,
7646            _depth: fidl::encoding::Depth,
7647        ) -> fidl::Result<()> {
7648            decoder.debug_check_bounds::<Self>(offset);
7649            // Verify that padding bytes are zero.
7650            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7651            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7652            let mask = 0xffffffff00000000u64;
7653            let maskedval = padval & mask;
7654            if maskedval != 0 {
7655                return Err(fidl::Error::NonZeroPadding {
7656                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7657                });
7658            }
7659            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(72) };
7660            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7661            let mask = 0xffffffff00000000u64;
7662            let maskedval = padval & mask;
7663            if maskedval != 0 {
7664                return Err(fidl::Error::NonZeroPadding {
7665                    padding_start: offset + 72 + ((mask as u64).trailing_zeros() / 8) as usize,
7666                });
7667            }
7668            fidl::decode!(
7669                fidl::encoding::Endpoint<
7670                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7671                >,
7672                fidl::encoding::DefaultFuchsiaResourceDialect,
7673                &mut self.realm,
7674                decoder,
7675                offset + 0,
7676                _depth
7677            )?;
7678            fidl::decode!(
7679                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7680                fidl::encoding::DefaultFuchsiaResourceDialect,
7681                &mut self.offers,
7682                decoder,
7683                offset + 8,
7684                _depth
7685            )?;
7686            fidl::decode!(
7687                fidl::encoding::UnboundedString,
7688                fidl::encoding::DefaultFuchsiaResourceDialect,
7689                &mut self.test_collection,
7690                decoder,
7691                offset + 24,
7692                _depth
7693            )?;
7694            fidl::decode!(
7695                fidl::encoding::BoundedString<4096>,
7696                fidl::encoding::DefaultFuchsiaResourceDialect,
7697                &mut self.test_url,
7698                decoder,
7699                offset + 40,
7700                _depth
7701            )?;
7702            fidl::decode!(
7703                RunOptions,
7704                fidl::encoding::DefaultFuchsiaResourceDialect,
7705                &mut self.options,
7706                decoder,
7707                offset + 56,
7708                _depth
7709            )?;
7710            fidl::decode!(
7711                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7712                fidl::encoding::DefaultFuchsiaResourceDialect,
7713                &mut self.controller,
7714                decoder,
7715                offset + 72,
7716                _depth
7717            )?;
7718            Ok(())
7719        }
7720    }
7721
7722    impl fidl::encoding::ResourceTypeMarker for RunBuilderAddSuiteRequest {
7723        type Borrowed<'a> = &'a mut Self;
7724        fn take_or_borrow<'a>(
7725            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7726        ) -> Self::Borrowed<'a> {
7727            value
7728        }
7729    }
7730
7731    unsafe impl fidl::encoding::TypeMarker for RunBuilderAddSuiteRequest {
7732        type Owned = Self;
7733
7734        #[inline(always)]
7735        fn inline_align(_context: fidl::encoding::Context) -> usize {
7736            8
7737        }
7738
7739        #[inline(always)]
7740        fn inline_size(_context: fidl::encoding::Context) -> usize {
7741            40
7742        }
7743    }
7744
7745    unsafe impl
7746        fidl::encoding::Encode<
7747            RunBuilderAddSuiteRequest,
7748            fidl::encoding::DefaultFuchsiaResourceDialect,
7749        > for &mut RunBuilderAddSuiteRequest
7750    {
7751        #[inline]
7752        unsafe fn encode(
7753            self,
7754            encoder: &mut fidl::encoding::Encoder<
7755                '_,
7756                fidl::encoding::DefaultFuchsiaResourceDialect,
7757            >,
7758            offset: usize,
7759            _depth: fidl::encoding::Depth,
7760        ) -> fidl::Result<()> {
7761            encoder.debug_check_bounds::<RunBuilderAddSuiteRequest>(offset);
7762            // Delegate to tuple encoding.
7763            fidl::encoding::Encode::<RunBuilderAddSuiteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7764                (
7765                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_url),
7766                    <RunOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
7767                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
7768                ),
7769                encoder, offset, _depth
7770            )
7771        }
7772    }
7773    unsafe impl<
7774            T0: fidl::encoding::Encode<
7775                fidl::encoding::BoundedString<4096>,
7776                fidl::encoding::DefaultFuchsiaResourceDialect,
7777            >,
7778            T1: fidl::encoding::Encode<RunOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
7779            T2: fidl::encoding::Encode<
7780                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7781                fidl::encoding::DefaultFuchsiaResourceDialect,
7782            >,
7783        >
7784        fidl::encoding::Encode<
7785            RunBuilderAddSuiteRequest,
7786            fidl::encoding::DefaultFuchsiaResourceDialect,
7787        > for (T0, T1, T2)
7788    {
7789        #[inline]
7790        unsafe fn encode(
7791            self,
7792            encoder: &mut fidl::encoding::Encoder<
7793                '_,
7794                fidl::encoding::DefaultFuchsiaResourceDialect,
7795            >,
7796            offset: usize,
7797            depth: fidl::encoding::Depth,
7798        ) -> fidl::Result<()> {
7799            encoder.debug_check_bounds::<RunBuilderAddSuiteRequest>(offset);
7800            // Zero out padding regions. There's no need to apply masks
7801            // because the unmasked parts will be overwritten by fields.
7802            unsafe {
7803                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
7804                (ptr as *mut u64).write_unaligned(0);
7805            }
7806            // Write the fields.
7807            self.0.encode(encoder, offset + 0, depth)?;
7808            self.1.encode(encoder, offset + 16, depth)?;
7809            self.2.encode(encoder, offset + 32, depth)?;
7810            Ok(())
7811        }
7812    }
7813
7814    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7815        for RunBuilderAddSuiteRequest
7816    {
7817        #[inline(always)]
7818        fn new_empty() -> Self {
7819            Self {
7820                test_url: fidl::new_empty!(
7821                    fidl::encoding::BoundedString<4096>,
7822                    fidl::encoding::DefaultFuchsiaResourceDialect
7823                ),
7824                options: fidl::new_empty!(
7825                    RunOptions,
7826                    fidl::encoding::DefaultFuchsiaResourceDialect
7827                ),
7828                controller: fidl::new_empty!(
7829                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7830                    fidl::encoding::DefaultFuchsiaResourceDialect
7831                ),
7832            }
7833        }
7834
7835        #[inline]
7836        unsafe fn decode(
7837            &mut self,
7838            decoder: &mut fidl::encoding::Decoder<
7839                '_,
7840                fidl::encoding::DefaultFuchsiaResourceDialect,
7841            >,
7842            offset: usize,
7843            _depth: fidl::encoding::Depth,
7844        ) -> fidl::Result<()> {
7845            decoder.debug_check_bounds::<Self>(offset);
7846            // Verify that padding bytes are zero.
7847            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
7848            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7849            let mask = 0xffffffff00000000u64;
7850            let maskedval = padval & mask;
7851            if maskedval != 0 {
7852                return Err(fidl::Error::NonZeroPadding {
7853                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
7854                });
7855            }
7856            fidl::decode!(
7857                fidl::encoding::BoundedString<4096>,
7858                fidl::encoding::DefaultFuchsiaResourceDialect,
7859                &mut self.test_url,
7860                decoder,
7861                offset + 0,
7862                _depth
7863            )?;
7864            fidl::decode!(
7865                RunOptions,
7866                fidl::encoding::DefaultFuchsiaResourceDialect,
7867                &mut self.options,
7868                decoder,
7869                offset + 16,
7870                _depth
7871            )?;
7872            fidl::decode!(
7873                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7874                fidl::encoding::DefaultFuchsiaResourceDialect,
7875                &mut self.controller,
7876                decoder,
7877                offset + 32,
7878                _depth
7879            )?;
7880            Ok(())
7881        }
7882    }
7883
7884    impl fidl::encoding::ResourceTypeMarker for RunBuilderBuildRequest {
7885        type Borrowed<'a> = &'a mut Self;
7886        fn take_or_borrow<'a>(
7887            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7888        ) -> Self::Borrowed<'a> {
7889            value
7890        }
7891    }
7892
7893    unsafe impl fidl::encoding::TypeMarker for RunBuilderBuildRequest {
7894        type Owned = Self;
7895
7896        #[inline(always)]
7897        fn inline_align(_context: fidl::encoding::Context) -> usize {
7898            4
7899        }
7900
7901        #[inline(always)]
7902        fn inline_size(_context: fidl::encoding::Context) -> usize {
7903            4
7904        }
7905    }
7906
7907    unsafe impl
7908        fidl::encoding::Encode<
7909            RunBuilderBuildRequest,
7910            fidl::encoding::DefaultFuchsiaResourceDialect,
7911        > for &mut RunBuilderBuildRequest
7912    {
7913        #[inline]
7914        unsafe fn encode(
7915            self,
7916            encoder: &mut fidl::encoding::Encoder<
7917                '_,
7918                fidl::encoding::DefaultFuchsiaResourceDialect,
7919            >,
7920            offset: usize,
7921            _depth: fidl::encoding::Depth,
7922        ) -> fidl::Result<()> {
7923            encoder.debug_check_bounds::<RunBuilderBuildRequest>(offset);
7924            // Delegate to tuple encoding.
7925            fidl::encoding::Encode::<RunBuilderBuildRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7926                (
7927                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RunControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
7928                ),
7929                encoder, offset, _depth
7930            )
7931        }
7932    }
7933    unsafe impl<
7934            T0: fidl::encoding::Encode<
7935                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RunControllerMarker>>,
7936                fidl::encoding::DefaultFuchsiaResourceDialect,
7937            >,
7938        >
7939        fidl::encoding::Encode<
7940            RunBuilderBuildRequest,
7941            fidl::encoding::DefaultFuchsiaResourceDialect,
7942        > for (T0,)
7943    {
7944        #[inline]
7945        unsafe fn encode(
7946            self,
7947            encoder: &mut fidl::encoding::Encoder<
7948                '_,
7949                fidl::encoding::DefaultFuchsiaResourceDialect,
7950            >,
7951            offset: usize,
7952            depth: fidl::encoding::Depth,
7953        ) -> fidl::Result<()> {
7954            encoder.debug_check_bounds::<RunBuilderBuildRequest>(offset);
7955            // Zero out padding regions. There's no need to apply masks
7956            // because the unmasked parts will be overwritten by fields.
7957            // Write the fields.
7958            self.0.encode(encoder, offset + 0, depth)?;
7959            Ok(())
7960        }
7961    }
7962
7963    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7964        for RunBuilderBuildRequest
7965    {
7966        #[inline(always)]
7967        fn new_empty() -> Self {
7968            Self {
7969                controller: fidl::new_empty!(
7970                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RunControllerMarker>>,
7971                    fidl::encoding::DefaultFuchsiaResourceDialect
7972                ),
7973            }
7974        }
7975
7976        #[inline]
7977        unsafe fn decode(
7978            &mut self,
7979            decoder: &mut fidl::encoding::Decoder<
7980                '_,
7981                fidl::encoding::DefaultFuchsiaResourceDialect,
7982            >,
7983            offset: usize,
7984            _depth: fidl::encoding::Depth,
7985        ) -> fidl::Result<()> {
7986            decoder.debug_check_bounds::<Self>(offset);
7987            // Verify that padding bytes are zero.
7988            fidl::decode!(
7989                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RunControllerMarker>>,
7990                fidl::encoding::DefaultFuchsiaResourceDialect,
7991                &mut self.controller,
7992                decoder,
7993                offset + 0,
7994                _depth
7995            )?;
7996            Ok(())
7997        }
7998    }
7999
8000    impl fidl::encoding::ResourceTypeMarker for RunControllerGetEventsResponse {
8001        type Borrowed<'a> = &'a mut Self;
8002        fn take_or_borrow<'a>(
8003            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8004        ) -> Self::Borrowed<'a> {
8005            value
8006        }
8007    }
8008
8009    unsafe impl fidl::encoding::TypeMarker for RunControllerGetEventsResponse {
8010        type Owned = Self;
8011
8012        #[inline(always)]
8013        fn inline_align(_context: fidl::encoding::Context) -> usize {
8014            8
8015        }
8016
8017        #[inline(always)]
8018        fn inline_size(_context: fidl::encoding::Context) -> usize {
8019            16
8020        }
8021    }
8022
8023    unsafe impl
8024        fidl::encoding::Encode<
8025            RunControllerGetEventsResponse,
8026            fidl::encoding::DefaultFuchsiaResourceDialect,
8027        > for &mut RunControllerGetEventsResponse
8028    {
8029        #[inline]
8030        unsafe fn encode(
8031            self,
8032            encoder: &mut fidl::encoding::Encoder<
8033                '_,
8034                fidl::encoding::DefaultFuchsiaResourceDialect,
8035            >,
8036            offset: usize,
8037            _depth: fidl::encoding::Depth,
8038        ) -> fidl::Result<()> {
8039            encoder.debug_check_bounds::<RunControllerGetEventsResponse>(offset);
8040            // Delegate to tuple encoding.
8041            fidl::encoding::Encode::<RunControllerGetEventsResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8042                (
8043                    <fidl::encoding::UnboundedVector<RunEvent> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
8044                ),
8045                encoder, offset, _depth
8046            )
8047        }
8048    }
8049    unsafe impl<
8050            T0: fidl::encoding::Encode<
8051                fidl::encoding::UnboundedVector<RunEvent>,
8052                fidl::encoding::DefaultFuchsiaResourceDialect,
8053            >,
8054        >
8055        fidl::encoding::Encode<
8056            RunControllerGetEventsResponse,
8057            fidl::encoding::DefaultFuchsiaResourceDialect,
8058        > for (T0,)
8059    {
8060        #[inline]
8061        unsafe fn encode(
8062            self,
8063            encoder: &mut fidl::encoding::Encoder<
8064                '_,
8065                fidl::encoding::DefaultFuchsiaResourceDialect,
8066            >,
8067            offset: usize,
8068            depth: fidl::encoding::Depth,
8069        ) -> fidl::Result<()> {
8070            encoder.debug_check_bounds::<RunControllerGetEventsResponse>(offset);
8071            // Zero out padding regions. There's no need to apply masks
8072            // because the unmasked parts will be overwritten by fields.
8073            // Write the fields.
8074            self.0.encode(encoder, offset + 0, depth)?;
8075            Ok(())
8076        }
8077    }
8078
8079    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8080        for RunControllerGetEventsResponse
8081    {
8082        #[inline(always)]
8083        fn new_empty() -> Self {
8084            Self {
8085                events: fidl::new_empty!(
8086                    fidl::encoding::UnboundedVector<RunEvent>,
8087                    fidl::encoding::DefaultFuchsiaResourceDialect
8088                ),
8089            }
8090        }
8091
8092        #[inline]
8093        unsafe fn decode(
8094            &mut self,
8095            decoder: &mut fidl::encoding::Decoder<
8096                '_,
8097                fidl::encoding::DefaultFuchsiaResourceDialect,
8098            >,
8099            offset: usize,
8100            _depth: fidl::encoding::Depth,
8101        ) -> fidl::Result<()> {
8102            decoder.debug_check_bounds::<Self>(offset);
8103            // Verify that padding bytes are zero.
8104            fidl::decode!(
8105                fidl::encoding::UnboundedVector<RunEvent>,
8106                fidl::encoding::DefaultFuchsiaResourceDialect,
8107                &mut self.events,
8108                decoder,
8109                offset + 0,
8110                _depth
8111            )?;
8112            Ok(())
8113        }
8114    }
8115
8116    impl fidl::encoding::ResourceTypeMarker for Stderr {
8117        type Borrowed<'a> = &'a mut Self;
8118        fn take_or_borrow<'a>(
8119            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8120        ) -> Self::Borrowed<'a> {
8121            value
8122        }
8123    }
8124
8125    unsafe impl fidl::encoding::TypeMarker for Stderr {
8126        type Owned = Self;
8127
8128        #[inline(always)]
8129        fn inline_align(_context: fidl::encoding::Context) -> usize {
8130            4
8131        }
8132
8133        #[inline(always)]
8134        fn inline_size(_context: fidl::encoding::Context) -> usize {
8135            4
8136        }
8137    }
8138
8139    unsafe impl fidl::encoding::Encode<Stderr, fidl::encoding::DefaultFuchsiaResourceDialect>
8140        for &mut Stderr
8141    {
8142        #[inline]
8143        unsafe fn encode(
8144            self,
8145            encoder: &mut fidl::encoding::Encoder<
8146                '_,
8147                fidl::encoding::DefaultFuchsiaResourceDialect,
8148            >,
8149            offset: usize,
8150            _depth: fidl::encoding::Depth,
8151        ) -> fidl::Result<()> {
8152            encoder.debug_check_bounds::<Stderr>(offset);
8153            // Delegate to tuple encoding.
8154            fidl::encoding::Encode::<Stderr, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8155                (<fidl::encoding::HandleType<
8156                    fidl::Socket,
8157                    { fidl::ObjectType::SOCKET.into_raw() },
8158                    2147483648,
8159                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8160                    &mut self.socket
8161                ),),
8162                encoder,
8163                offset,
8164                _depth,
8165            )
8166        }
8167    }
8168    unsafe impl<
8169            T0: fidl::encoding::Encode<
8170                fidl::encoding::HandleType<
8171                    fidl::Socket,
8172                    { fidl::ObjectType::SOCKET.into_raw() },
8173                    2147483648,
8174                >,
8175                fidl::encoding::DefaultFuchsiaResourceDialect,
8176            >,
8177        > fidl::encoding::Encode<Stderr, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
8178    {
8179        #[inline]
8180        unsafe fn encode(
8181            self,
8182            encoder: &mut fidl::encoding::Encoder<
8183                '_,
8184                fidl::encoding::DefaultFuchsiaResourceDialect,
8185            >,
8186            offset: usize,
8187            depth: fidl::encoding::Depth,
8188        ) -> fidl::Result<()> {
8189            encoder.debug_check_bounds::<Stderr>(offset);
8190            // Zero out padding regions. There's no need to apply masks
8191            // because the unmasked parts will be overwritten by fields.
8192            // Write the fields.
8193            self.0.encode(encoder, offset + 0, depth)?;
8194            Ok(())
8195        }
8196    }
8197
8198    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Stderr {
8199        #[inline(always)]
8200        fn new_empty() -> Self {
8201            Self {
8202                socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8203            }
8204        }
8205
8206        #[inline]
8207        unsafe fn decode(
8208            &mut self,
8209            decoder: &mut fidl::encoding::Decoder<
8210                '_,
8211                fidl::encoding::DefaultFuchsiaResourceDialect,
8212            >,
8213            offset: usize,
8214            _depth: fidl::encoding::Depth,
8215        ) -> fidl::Result<()> {
8216            decoder.debug_check_bounds::<Self>(offset);
8217            // Verify that padding bytes are zero.
8218            fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
8219            Ok(())
8220        }
8221    }
8222
8223    impl fidl::encoding::ResourceTypeMarker for Stdout {
8224        type Borrowed<'a> = &'a mut Self;
8225        fn take_or_borrow<'a>(
8226            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8227        ) -> Self::Borrowed<'a> {
8228            value
8229        }
8230    }
8231
8232    unsafe impl fidl::encoding::TypeMarker for Stdout {
8233        type Owned = Self;
8234
8235        #[inline(always)]
8236        fn inline_align(_context: fidl::encoding::Context) -> usize {
8237            4
8238        }
8239
8240        #[inline(always)]
8241        fn inline_size(_context: fidl::encoding::Context) -> usize {
8242            4
8243        }
8244    }
8245
8246    unsafe impl fidl::encoding::Encode<Stdout, fidl::encoding::DefaultFuchsiaResourceDialect>
8247        for &mut Stdout
8248    {
8249        #[inline]
8250        unsafe fn encode(
8251            self,
8252            encoder: &mut fidl::encoding::Encoder<
8253                '_,
8254                fidl::encoding::DefaultFuchsiaResourceDialect,
8255            >,
8256            offset: usize,
8257            _depth: fidl::encoding::Depth,
8258        ) -> fidl::Result<()> {
8259            encoder.debug_check_bounds::<Stdout>(offset);
8260            // Delegate to tuple encoding.
8261            fidl::encoding::Encode::<Stdout, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8262                (<fidl::encoding::HandleType<
8263                    fidl::Socket,
8264                    { fidl::ObjectType::SOCKET.into_raw() },
8265                    2147483648,
8266                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8267                    &mut self.socket
8268                ),),
8269                encoder,
8270                offset,
8271                _depth,
8272            )
8273        }
8274    }
8275    unsafe impl<
8276            T0: fidl::encoding::Encode<
8277                fidl::encoding::HandleType<
8278                    fidl::Socket,
8279                    { fidl::ObjectType::SOCKET.into_raw() },
8280                    2147483648,
8281                >,
8282                fidl::encoding::DefaultFuchsiaResourceDialect,
8283            >,
8284        > fidl::encoding::Encode<Stdout, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
8285    {
8286        #[inline]
8287        unsafe fn encode(
8288            self,
8289            encoder: &mut fidl::encoding::Encoder<
8290                '_,
8291                fidl::encoding::DefaultFuchsiaResourceDialect,
8292            >,
8293            offset: usize,
8294            depth: fidl::encoding::Depth,
8295        ) -> fidl::Result<()> {
8296            encoder.debug_check_bounds::<Stdout>(offset);
8297            // Zero out padding regions. There's no need to apply masks
8298            // because the unmasked parts will be overwritten by fields.
8299            // Write the fields.
8300            self.0.encode(encoder, offset + 0, depth)?;
8301            Ok(())
8302        }
8303    }
8304
8305    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Stdout {
8306        #[inline(always)]
8307        fn new_empty() -> Self {
8308            Self {
8309                socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8310            }
8311        }
8312
8313        #[inline]
8314        unsafe fn decode(
8315            &mut self,
8316            decoder: &mut fidl::encoding::Decoder<
8317                '_,
8318                fidl::encoding::DefaultFuchsiaResourceDialect,
8319            >,
8320            offset: usize,
8321            _depth: fidl::encoding::Depth,
8322        ) -> fidl::Result<()> {
8323            decoder.debug_check_bounds::<Self>(offset);
8324            // Verify that padding bytes are zero.
8325            fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
8326            Ok(())
8327        }
8328    }
8329
8330    impl fidl::encoding::ResourceTypeMarker for SuiteArtifact {
8331        type Borrowed<'a> = &'a mut Self;
8332        fn take_or_borrow<'a>(
8333            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8334        ) -> Self::Borrowed<'a> {
8335            value
8336        }
8337    }
8338
8339    unsafe impl fidl::encoding::TypeMarker for SuiteArtifact {
8340        type Owned = Self;
8341
8342        #[inline(always)]
8343        fn inline_align(_context: fidl::encoding::Context) -> usize {
8344            8
8345        }
8346
8347        #[inline(always)]
8348        fn inline_size(_context: fidl::encoding::Context) -> usize {
8349            16
8350        }
8351    }
8352
8353    unsafe impl fidl::encoding::Encode<SuiteArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
8354        for &mut SuiteArtifact
8355    {
8356        #[inline]
8357        unsafe fn encode(
8358            self,
8359            encoder: &mut fidl::encoding::Encoder<
8360                '_,
8361                fidl::encoding::DefaultFuchsiaResourceDialect,
8362            >,
8363            offset: usize,
8364            _depth: fidl::encoding::Depth,
8365        ) -> fidl::Result<()> {
8366            encoder.debug_check_bounds::<SuiteArtifact>(offset);
8367            // Delegate to tuple encoding.
8368            fidl::encoding::Encode::<SuiteArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8369                (
8370                    <Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.artifact),
8371                ),
8372                encoder, offset, _depth
8373            )
8374        }
8375    }
8376    unsafe impl<T0: fidl::encoding::Encode<Artifact, fidl::encoding::DefaultFuchsiaResourceDialect>>
8377        fidl::encoding::Encode<SuiteArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
8378        for (T0,)
8379    {
8380        #[inline]
8381        unsafe fn encode(
8382            self,
8383            encoder: &mut fidl::encoding::Encoder<
8384                '_,
8385                fidl::encoding::DefaultFuchsiaResourceDialect,
8386            >,
8387            offset: usize,
8388            depth: fidl::encoding::Depth,
8389        ) -> fidl::Result<()> {
8390            encoder.debug_check_bounds::<SuiteArtifact>(offset);
8391            // Zero out padding regions. There's no need to apply masks
8392            // because the unmasked parts will be overwritten by fields.
8393            // Write the fields.
8394            self.0.encode(encoder, offset + 0, depth)?;
8395            Ok(())
8396        }
8397    }
8398
8399    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for SuiteArtifact {
8400        #[inline(always)]
8401        fn new_empty() -> Self {
8402            Self {
8403                artifact: fidl::new_empty!(Artifact, fidl::encoding::DefaultFuchsiaResourceDialect),
8404            }
8405        }
8406
8407        #[inline]
8408        unsafe fn decode(
8409            &mut self,
8410            decoder: &mut fidl::encoding::Decoder<
8411                '_,
8412                fidl::encoding::DefaultFuchsiaResourceDialect,
8413            >,
8414            offset: usize,
8415            _depth: fidl::encoding::Depth,
8416        ) -> fidl::Result<()> {
8417            decoder.debug_check_bounds::<Self>(offset);
8418            // Verify that padding bytes are zero.
8419            fidl::decode!(
8420                Artifact,
8421                fidl::encoding::DefaultFuchsiaResourceDialect,
8422                &mut self.artifact,
8423                decoder,
8424                offset + 0,
8425                _depth
8426            )?;
8427            Ok(())
8428        }
8429    }
8430
8431    impl fidl::encoding::ResourceTypeMarker for SuiteControllerGetEventsResponse {
8432        type Borrowed<'a> = &'a mut Self;
8433        fn take_or_borrow<'a>(
8434            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8435        ) -> Self::Borrowed<'a> {
8436            value
8437        }
8438    }
8439
8440    unsafe impl fidl::encoding::TypeMarker for SuiteControllerGetEventsResponse {
8441        type Owned = Self;
8442
8443        #[inline(always)]
8444        fn inline_align(_context: fidl::encoding::Context) -> usize {
8445            8
8446        }
8447
8448        #[inline(always)]
8449        fn inline_size(_context: fidl::encoding::Context) -> usize {
8450            16
8451        }
8452    }
8453
8454    unsafe impl
8455        fidl::encoding::Encode<
8456            SuiteControllerGetEventsResponse,
8457            fidl::encoding::DefaultFuchsiaResourceDialect,
8458        > for &mut SuiteControllerGetEventsResponse
8459    {
8460        #[inline]
8461        unsafe fn encode(
8462            self,
8463            encoder: &mut fidl::encoding::Encoder<
8464                '_,
8465                fidl::encoding::DefaultFuchsiaResourceDialect,
8466            >,
8467            offset: usize,
8468            _depth: fidl::encoding::Depth,
8469        ) -> fidl::Result<()> {
8470            encoder.debug_check_bounds::<SuiteControllerGetEventsResponse>(offset);
8471            // Delegate to tuple encoding.
8472            fidl::encoding::Encode::<SuiteControllerGetEventsResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8473                (
8474                    <fidl::encoding::UnboundedVector<SuiteEvent> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
8475                ),
8476                encoder, offset, _depth
8477            )
8478        }
8479    }
8480    unsafe impl<
8481            T0: fidl::encoding::Encode<
8482                fidl::encoding::UnboundedVector<SuiteEvent>,
8483                fidl::encoding::DefaultFuchsiaResourceDialect,
8484            >,
8485        >
8486        fidl::encoding::Encode<
8487            SuiteControllerGetEventsResponse,
8488            fidl::encoding::DefaultFuchsiaResourceDialect,
8489        > for (T0,)
8490    {
8491        #[inline]
8492        unsafe fn encode(
8493            self,
8494            encoder: &mut fidl::encoding::Encoder<
8495                '_,
8496                fidl::encoding::DefaultFuchsiaResourceDialect,
8497            >,
8498            offset: usize,
8499            depth: fidl::encoding::Depth,
8500        ) -> fidl::Result<()> {
8501            encoder.debug_check_bounds::<SuiteControllerGetEventsResponse>(offset);
8502            // Zero out padding regions. There's no need to apply masks
8503            // because the unmasked parts will be overwritten by fields.
8504            // Write the fields.
8505            self.0.encode(encoder, offset + 0, depth)?;
8506            Ok(())
8507        }
8508    }
8509
8510    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8511        for SuiteControllerGetEventsResponse
8512    {
8513        #[inline(always)]
8514        fn new_empty() -> Self {
8515            Self {
8516                events: fidl::new_empty!(
8517                    fidl::encoding::UnboundedVector<SuiteEvent>,
8518                    fidl::encoding::DefaultFuchsiaResourceDialect
8519                ),
8520            }
8521        }
8522
8523        #[inline]
8524        unsafe fn decode(
8525            &mut self,
8526            decoder: &mut fidl::encoding::Decoder<
8527                '_,
8528                fidl::encoding::DefaultFuchsiaResourceDialect,
8529            >,
8530            offset: usize,
8531            _depth: fidl::encoding::Depth,
8532        ) -> fidl::Result<()> {
8533            decoder.debug_check_bounds::<Self>(offset);
8534            // Verify that padding bytes are zero.
8535            fidl::decode!(
8536                fidl::encoding::UnboundedVector<SuiteEvent>,
8537                fidl::encoding::DefaultFuchsiaResourceDialect,
8538                &mut self.events,
8539                decoder,
8540                offset + 0,
8541                _depth
8542            )?;
8543            Ok(())
8544        }
8545    }
8546
8547    impl fidl::encoding::ResourceTypeMarker for SuiteControllerWatchEventsResponse {
8548        type Borrowed<'a> = &'a mut Self;
8549        fn take_or_borrow<'a>(
8550            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8551        ) -> Self::Borrowed<'a> {
8552            value
8553        }
8554    }
8555
8556    unsafe impl fidl::encoding::TypeMarker for SuiteControllerWatchEventsResponse {
8557        type Owned = Self;
8558
8559        #[inline(always)]
8560        fn inline_align(_context: fidl::encoding::Context) -> usize {
8561            8
8562        }
8563
8564        #[inline(always)]
8565        fn inline_size(_context: fidl::encoding::Context) -> usize {
8566            16
8567        }
8568    }
8569
8570    unsafe impl
8571        fidl::encoding::Encode<
8572            SuiteControllerWatchEventsResponse,
8573            fidl::encoding::DefaultFuchsiaResourceDialect,
8574        > for &mut SuiteControllerWatchEventsResponse
8575    {
8576        #[inline]
8577        unsafe fn encode(
8578            self,
8579            encoder: &mut fidl::encoding::Encoder<
8580                '_,
8581                fidl::encoding::DefaultFuchsiaResourceDialect,
8582            >,
8583            offset: usize,
8584            _depth: fidl::encoding::Depth,
8585        ) -> fidl::Result<()> {
8586            encoder.debug_check_bounds::<SuiteControllerWatchEventsResponse>(offset);
8587            // Delegate to tuple encoding.
8588            fidl::encoding::Encode::<SuiteControllerWatchEventsResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8589                (
8590                    <fidl::encoding::Vector<Event, 1024> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
8591                ),
8592                encoder, offset, _depth
8593            )
8594        }
8595    }
8596    unsafe impl<
8597            T0: fidl::encoding::Encode<
8598                fidl::encoding::Vector<Event, 1024>,
8599                fidl::encoding::DefaultFuchsiaResourceDialect,
8600            >,
8601        >
8602        fidl::encoding::Encode<
8603            SuiteControllerWatchEventsResponse,
8604            fidl::encoding::DefaultFuchsiaResourceDialect,
8605        > for (T0,)
8606    {
8607        #[inline]
8608        unsafe fn encode(
8609            self,
8610            encoder: &mut fidl::encoding::Encoder<
8611                '_,
8612                fidl::encoding::DefaultFuchsiaResourceDialect,
8613            >,
8614            offset: usize,
8615            depth: fidl::encoding::Depth,
8616        ) -> fidl::Result<()> {
8617            encoder.debug_check_bounds::<SuiteControllerWatchEventsResponse>(offset);
8618            // Zero out padding regions. There's no need to apply masks
8619            // because the unmasked parts will be overwritten by fields.
8620            // Write the fields.
8621            self.0.encode(encoder, offset + 0, depth)?;
8622            Ok(())
8623        }
8624    }
8625
8626    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8627        for SuiteControllerWatchEventsResponse
8628    {
8629        #[inline(always)]
8630        fn new_empty() -> Self {
8631            Self {
8632                events: fidl::new_empty!(fidl::encoding::Vector<Event, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect),
8633            }
8634        }
8635
8636        #[inline]
8637        unsafe fn decode(
8638            &mut self,
8639            decoder: &mut fidl::encoding::Decoder<
8640                '_,
8641                fidl::encoding::DefaultFuchsiaResourceDialect,
8642            >,
8643            offset: usize,
8644            _depth: fidl::encoding::Depth,
8645        ) -> fidl::Result<()> {
8646            decoder.debug_check_bounds::<Self>(offset);
8647            // Verify that padding bytes are zero.
8648            fidl::decode!(fidl::encoding::Vector<Event, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.events, decoder, offset + 0, _depth)?;
8649            Ok(())
8650        }
8651    }
8652
8653    impl fidl::encoding::ResourceTypeMarker for SuiteRunnerRunRequest {
8654        type Borrowed<'a> = &'a mut Self;
8655        fn take_or_borrow<'a>(
8656            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8657        ) -> Self::Borrowed<'a> {
8658            value
8659        }
8660    }
8661
8662    unsafe impl fidl::encoding::TypeMarker for SuiteRunnerRunRequest {
8663        type Owned = Self;
8664
8665        #[inline(always)]
8666        fn inline_align(_context: fidl::encoding::Context) -> usize {
8667            8
8668        }
8669
8670        #[inline(always)]
8671        fn inline_size(_context: fidl::encoding::Context) -> usize {
8672            40
8673        }
8674    }
8675
8676    unsafe impl
8677        fidl::encoding::Encode<SuiteRunnerRunRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
8678        for &mut SuiteRunnerRunRequest
8679    {
8680        #[inline]
8681        unsafe fn encode(
8682            self,
8683            encoder: &mut fidl::encoding::Encoder<
8684                '_,
8685                fidl::encoding::DefaultFuchsiaResourceDialect,
8686            >,
8687            offset: usize,
8688            _depth: fidl::encoding::Depth,
8689        ) -> fidl::Result<()> {
8690            encoder.debug_check_bounds::<SuiteRunnerRunRequest>(offset);
8691            // Delegate to tuple encoding.
8692            fidl::encoding::Encode::<SuiteRunnerRunRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8693                (
8694                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_suite_url),
8695                    <RunSuiteOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.options),
8696                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
8697                ),
8698                encoder, offset, _depth
8699            )
8700        }
8701    }
8702    unsafe impl<
8703            T0: fidl::encoding::Encode<
8704                fidl::encoding::BoundedString<4096>,
8705                fidl::encoding::DefaultFuchsiaResourceDialect,
8706            >,
8707            T1: fidl::encoding::Encode<RunSuiteOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
8708            T2: fidl::encoding::Encode<
8709                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
8710                fidl::encoding::DefaultFuchsiaResourceDialect,
8711            >,
8712        >
8713        fidl::encoding::Encode<SuiteRunnerRunRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
8714        for (T0, T1, T2)
8715    {
8716        #[inline]
8717        unsafe fn encode(
8718            self,
8719            encoder: &mut fidl::encoding::Encoder<
8720                '_,
8721                fidl::encoding::DefaultFuchsiaResourceDialect,
8722            >,
8723            offset: usize,
8724            depth: fidl::encoding::Depth,
8725        ) -> fidl::Result<()> {
8726            encoder.debug_check_bounds::<SuiteRunnerRunRequest>(offset);
8727            // Zero out padding regions. There's no need to apply masks
8728            // because the unmasked parts will be overwritten by fields.
8729            unsafe {
8730                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
8731                (ptr as *mut u64).write_unaligned(0);
8732            }
8733            // Write the fields.
8734            self.0.encode(encoder, offset + 0, depth)?;
8735            self.1.encode(encoder, offset + 16, depth)?;
8736            self.2.encode(encoder, offset + 32, depth)?;
8737            Ok(())
8738        }
8739    }
8740
8741    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8742        for SuiteRunnerRunRequest
8743    {
8744        #[inline(always)]
8745        fn new_empty() -> Self {
8746            Self {
8747                test_suite_url: fidl::new_empty!(
8748                    fidl::encoding::BoundedString<4096>,
8749                    fidl::encoding::DefaultFuchsiaResourceDialect
8750                ),
8751                options: fidl::new_empty!(
8752                    RunSuiteOptions,
8753                    fidl::encoding::DefaultFuchsiaResourceDialect
8754                ),
8755                controller: fidl::new_empty!(
8756                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
8757                    fidl::encoding::DefaultFuchsiaResourceDialect
8758                ),
8759            }
8760        }
8761
8762        #[inline]
8763        unsafe fn decode(
8764            &mut self,
8765            decoder: &mut fidl::encoding::Decoder<
8766                '_,
8767                fidl::encoding::DefaultFuchsiaResourceDialect,
8768            >,
8769            offset: usize,
8770            _depth: fidl::encoding::Depth,
8771        ) -> fidl::Result<()> {
8772            decoder.debug_check_bounds::<Self>(offset);
8773            // Verify that padding bytes are zero.
8774            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
8775            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8776            let mask = 0xffffffff00000000u64;
8777            let maskedval = padval & mask;
8778            if maskedval != 0 {
8779                return Err(fidl::Error::NonZeroPadding {
8780                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
8781                });
8782            }
8783            fidl::decode!(
8784                fidl::encoding::BoundedString<4096>,
8785                fidl::encoding::DefaultFuchsiaResourceDialect,
8786                &mut self.test_suite_url,
8787                decoder,
8788                offset + 0,
8789                _depth
8790            )?;
8791            fidl::decode!(
8792                RunSuiteOptions,
8793                fidl::encoding::DefaultFuchsiaResourceDialect,
8794                &mut self.options,
8795                decoder,
8796                offset + 16,
8797                _depth
8798            )?;
8799            fidl::decode!(
8800                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
8801                fidl::encoding::DefaultFuchsiaResourceDialect,
8802                &mut self.controller,
8803                decoder,
8804                offset + 32,
8805                _depth
8806            )?;
8807            Ok(())
8808        }
8809    }
8810
8811    impl fidl::encoding::ResourceTypeMarker for TestCaseEnumeratorEnumerateRequest {
8812        type Borrowed<'a> = &'a mut Self;
8813        fn take_or_borrow<'a>(
8814            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8815        ) -> Self::Borrowed<'a> {
8816            value
8817        }
8818    }
8819
8820    unsafe impl fidl::encoding::TypeMarker for TestCaseEnumeratorEnumerateRequest {
8821        type Owned = Self;
8822
8823        #[inline(always)]
8824        fn inline_align(_context: fidl::encoding::Context) -> usize {
8825            8
8826        }
8827
8828        #[inline(always)]
8829        fn inline_size(_context: fidl::encoding::Context) -> usize {
8830            40
8831        }
8832    }
8833
8834    unsafe impl
8835        fidl::encoding::Encode<
8836            TestCaseEnumeratorEnumerateRequest,
8837            fidl::encoding::DefaultFuchsiaResourceDialect,
8838        > for &mut TestCaseEnumeratorEnumerateRequest
8839    {
8840        #[inline]
8841        unsafe fn encode(
8842            self,
8843            encoder: &mut fidl::encoding::Encoder<
8844                '_,
8845                fidl::encoding::DefaultFuchsiaResourceDialect,
8846            >,
8847            offset: usize,
8848            _depth: fidl::encoding::Depth,
8849        ) -> fidl::Result<()> {
8850            encoder.debug_check_bounds::<TestCaseEnumeratorEnumerateRequest>(offset);
8851            // Delegate to tuple encoding.
8852            fidl::encoding::Encode::<TestCaseEnumeratorEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8853                (
8854                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_suite_url),
8855                    <EnumerateTestCasesOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.options),
8856                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
8857                ),
8858                encoder, offset, _depth
8859            )
8860        }
8861    }
8862    unsafe impl<
8863            T0: fidl::encoding::Encode<
8864                fidl::encoding::BoundedString<4096>,
8865                fidl::encoding::DefaultFuchsiaResourceDialect,
8866            >,
8867            T1: fidl::encoding::Encode<
8868                EnumerateTestCasesOptions,
8869                fidl::encoding::DefaultFuchsiaResourceDialect,
8870            >,
8871            T2: fidl::encoding::Encode<
8872                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>>,
8873                fidl::encoding::DefaultFuchsiaResourceDialect,
8874            >,
8875        >
8876        fidl::encoding::Encode<
8877            TestCaseEnumeratorEnumerateRequest,
8878            fidl::encoding::DefaultFuchsiaResourceDialect,
8879        > for (T0, T1, T2)
8880    {
8881        #[inline]
8882        unsafe fn encode(
8883            self,
8884            encoder: &mut fidl::encoding::Encoder<
8885                '_,
8886                fidl::encoding::DefaultFuchsiaResourceDialect,
8887            >,
8888            offset: usize,
8889            depth: fidl::encoding::Depth,
8890        ) -> fidl::Result<()> {
8891            encoder.debug_check_bounds::<TestCaseEnumeratorEnumerateRequest>(offset);
8892            // Zero out padding regions. There's no need to apply masks
8893            // because the unmasked parts will be overwritten by fields.
8894            unsafe {
8895                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
8896                (ptr as *mut u64).write_unaligned(0);
8897            }
8898            // Write the fields.
8899            self.0.encode(encoder, offset + 0, depth)?;
8900            self.1.encode(encoder, offset + 16, depth)?;
8901            self.2.encode(encoder, offset + 32, depth)?;
8902            Ok(())
8903        }
8904    }
8905
8906    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8907        for TestCaseEnumeratorEnumerateRequest
8908    {
8909        #[inline(always)]
8910        fn new_empty() -> Self {
8911            Self {
8912                test_suite_url: fidl::new_empty!(
8913                    fidl::encoding::BoundedString<4096>,
8914                    fidl::encoding::DefaultFuchsiaResourceDialect
8915                ),
8916                options: fidl::new_empty!(
8917                    EnumerateTestCasesOptions,
8918                    fidl::encoding::DefaultFuchsiaResourceDialect
8919                ),
8920                iterator: fidl::new_empty!(
8921                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>>,
8922                    fidl::encoding::DefaultFuchsiaResourceDialect
8923                ),
8924            }
8925        }
8926
8927        #[inline]
8928        unsafe fn decode(
8929            &mut self,
8930            decoder: &mut fidl::encoding::Decoder<
8931                '_,
8932                fidl::encoding::DefaultFuchsiaResourceDialect,
8933            >,
8934            offset: usize,
8935            _depth: fidl::encoding::Depth,
8936        ) -> fidl::Result<()> {
8937            decoder.debug_check_bounds::<Self>(offset);
8938            // Verify that padding bytes are zero.
8939            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
8940            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8941            let mask = 0xffffffff00000000u64;
8942            let maskedval = padval & mask;
8943            if maskedval != 0 {
8944                return Err(fidl::Error::NonZeroPadding {
8945                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
8946                });
8947            }
8948            fidl::decode!(
8949                fidl::encoding::BoundedString<4096>,
8950                fidl::encoding::DefaultFuchsiaResourceDialect,
8951                &mut self.test_suite_url,
8952                decoder,
8953                offset + 0,
8954                _depth
8955            )?;
8956            fidl::decode!(
8957                EnumerateTestCasesOptions,
8958                fidl::encoding::DefaultFuchsiaResourceDialect,
8959                &mut self.options,
8960                decoder,
8961                offset + 16,
8962                _depth
8963            )?;
8964            fidl::decode!(
8965                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>>,
8966                fidl::encoding::DefaultFuchsiaResourceDialect,
8967                &mut self.iterator,
8968                decoder,
8969                offset + 32,
8970                _depth
8971            )?;
8972            Ok(())
8973        }
8974    }
8975
8976    impl CustomArtifact {
8977        #[inline(always)]
8978        fn max_ordinal_present(&self) -> u64 {
8979            if let Some(_) = self.directory_and_token {
8980                return 2;
8981            }
8982            if let Some(_) = self.component_moniker {
8983                return 1;
8984            }
8985            0
8986        }
8987    }
8988
8989    impl fidl::encoding::ResourceTypeMarker for CustomArtifact {
8990        type Borrowed<'a> = &'a mut Self;
8991        fn take_or_borrow<'a>(
8992            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8993        ) -> Self::Borrowed<'a> {
8994            value
8995        }
8996    }
8997
8998    unsafe impl fidl::encoding::TypeMarker for CustomArtifact {
8999        type Owned = Self;
9000
9001        #[inline(always)]
9002        fn inline_align(_context: fidl::encoding::Context) -> usize {
9003            8
9004        }
9005
9006        #[inline(always)]
9007        fn inline_size(_context: fidl::encoding::Context) -> usize {
9008            16
9009        }
9010    }
9011
9012    unsafe impl
9013        fidl::encoding::Encode<CustomArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
9014        for &mut CustomArtifact
9015    {
9016        unsafe fn encode(
9017            self,
9018            encoder: &mut fidl::encoding::Encoder<
9019                '_,
9020                fidl::encoding::DefaultFuchsiaResourceDialect,
9021            >,
9022            offset: usize,
9023            mut depth: fidl::encoding::Depth,
9024        ) -> fidl::Result<()> {
9025            encoder.debug_check_bounds::<CustomArtifact>(offset);
9026            // Vector header
9027            let max_ordinal: u64 = self.max_ordinal_present();
9028            encoder.write_num(max_ordinal, offset);
9029            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9030            // Calling encoder.out_of_line_offset(0) is not allowed.
9031            if max_ordinal == 0 {
9032                return Ok(());
9033            }
9034            depth.increment()?;
9035            let envelope_size = 8;
9036            let bytes_len = max_ordinal as usize * envelope_size;
9037            #[allow(unused_variables)]
9038            let offset = encoder.out_of_line_offset(bytes_len);
9039            let mut _prev_end_offset: usize = 0;
9040            if 1 > max_ordinal {
9041                return Ok(());
9042            }
9043
9044            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9045            // are envelope_size bytes.
9046            let cur_offset: usize = (1 - 1) * envelope_size;
9047
9048            // Zero reserved fields.
9049            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9050
9051            // Safety:
9052            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9053            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9054            //   envelope_size bytes, there is always sufficient room.
9055            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, fidl::encoding::DefaultFuchsiaResourceDialect>(
9056            self.component_moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
9057            encoder, offset + cur_offset, depth
9058        )?;
9059
9060            _prev_end_offset = cur_offset + envelope_size;
9061            if 2 > max_ordinal {
9062                return Ok(());
9063            }
9064
9065            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9066            // are envelope_size bytes.
9067            let cur_offset: usize = (2 - 1) * envelope_size;
9068
9069            // Zero reserved fields.
9070            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9071
9072            // Safety:
9073            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9074            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9075            //   envelope_size bytes, there is always sufficient room.
9076            fidl::encoding::encode_in_envelope_optional::<
9077                DirectoryAndToken,
9078                fidl::encoding::DefaultFuchsiaResourceDialect,
9079            >(
9080                self.directory_and_token
9081                    .as_mut()
9082                    .map(<DirectoryAndToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9083                encoder,
9084                offset + cur_offset,
9085                depth,
9086            )?;
9087
9088            _prev_end_offset = cur_offset + envelope_size;
9089
9090            Ok(())
9091        }
9092    }
9093
9094    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9095        for CustomArtifact
9096    {
9097        #[inline(always)]
9098        fn new_empty() -> Self {
9099            Self::default()
9100        }
9101
9102        unsafe fn decode(
9103            &mut self,
9104            decoder: &mut fidl::encoding::Decoder<
9105                '_,
9106                fidl::encoding::DefaultFuchsiaResourceDialect,
9107            >,
9108            offset: usize,
9109            mut depth: fidl::encoding::Depth,
9110        ) -> fidl::Result<()> {
9111            decoder.debug_check_bounds::<Self>(offset);
9112            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9113                None => return Err(fidl::Error::NotNullable),
9114                Some(len) => len,
9115            };
9116            // Calling decoder.out_of_line_offset(0) is not allowed.
9117            if len == 0 {
9118                return Ok(());
9119            };
9120            depth.increment()?;
9121            let envelope_size = 8;
9122            let bytes_len = len * envelope_size;
9123            let offset = decoder.out_of_line_offset(bytes_len)?;
9124            // Decode the envelope for each type.
9125            let mut _next_ordinal_to_read = 0;
9126            let mut next_offset = offset;
9127            let end_offset = offset + bytes_len;
9128            _next_ordinal_to_read += 1;
9129            if next_offset >= end_offset {
9130                return Ok(());
9131            }
9132
9133            // Decode unknown envelopes for gaps in ordinals.
9134            while _next_ordinal_to_read < 1 {
9135                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9136                _next_ordinal_to_read += 1;
9137                next_offset += envelope_size;
9138            }
9139
9140            let next_out_of_line = decoder.next_out_of_line();
9141            let handles_before = decoder.remaining_handles();
9142            if let Some((inlined, num_bytes, num_handles)) =
9143                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9144            {
9145                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9146                if inlined != (member_inline_size <= 4) {
9147                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9148                }
9149                let inner_offset;
9150                let mut inner_depth = depth.clone();
9151                if inlined {
9152                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9153                    inner_offset = next_offset;
9154                } else {
9155                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9156                    inner_depth.increment()?;
9157                }
9158                let val_ref = self.component_moniker.get_or_insert_with(|| {
9159                    fidl::new_empty!(
9160                        fidl::encoding::BoundedString<4096>,
9161                        fidl::encoding::DefaultFuchsiaResourceDialect
9162                    )
9163                });
9164                fidl::decode!(
9165                    fidl::encoding::BoundedString<4096>,
9166                    fidl::encoding::DefaultFuchsiaResourceDialect,
9167                    val_ref,
9168                    decoder,
9169                    inner_offset,
9170                    inner_depth
9171                )?;
9172                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9173                {
9174                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9175                }
9176                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9177                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9178                }
9179            }
9180
9181            next_offset += envelope_size;
9182            _next_ordinal_to_read += 1;
9183            if next_offset >= end_offset {
9184                return Ok(());
9185            }
9186
9187            // Decode unknown envelopes for gaps in ordinals.
9188            while _next_ordinal_to_read < 2 {
9189                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9190                _next_ordinal_to_read += 1;
9191                next_offset += envelope_size;
9192            }
9193
9194            let next_out_of_line = decoder.next_out_of_line();
9195            let handles_before = decoder.remaining_handles();
9196            if let Some((inlined, num_bytes, num_handles)) =
9197                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9198            {
9199                let member_inline_size =
9200                    <DirectoryAndToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9201                if inlined != (member_inline_size <= 4) {
9202                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9203                }
9204                let inner_offset;
9205                let mut inner_depth = depth.clone();
9206                if inlined {
9207                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9208                    inner_offset = next_offset;
9209                } else {
9210                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9211                    inner_depth.increment()?;
9212                }
9213                let val_ref = self.directory_and_token.get_or_insert_with(|| {
9214                    fidl::new_empty!(
9215                        DirectoryAndToken,
9216                        fidl::encoding::DefaultFuchsiaResourceDialect
9217                    )
9218                });
9219                fidl::decode!(
9220                    DirectoryAndToken,
9221                    fidl::encoding::DefaultFuchsiaResourceDialect,
9222                    val_ref,
9223                    decoder,
9224                    inner_offset,
9225                    inner_depth
9226                )?;
9227                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9228                {
9229                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9230                }
9231                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9232                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9233                }
9234            }
9235
9236            next_offset += envelope_size;
9237
9238            // Decode the remaining unknown envelopes.
9239            while next_offset < end_offset {
9240                _next_ordinal_to_read += 1;
9241                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9242                next_offset += envelope_size;
9243            }
9244
9245            Ok(())
9246        }
9247    }
9248
9249    impl DebugData {
9250        #[inline(always)]
9251        fn max_ordinal_present(&self) -> u64 {
9252            if let Some(_) = self.socket {
9253                return 2;
9254            }
9255            if let Some(_) = self.name {
9256                return 1;
9257            }
9258            0
9259        }
9260    }
9261
9262    impl fidl::encoding::ResourceTypeMarker for DebugData {
9263        type Borrowed<'a> = &'a mut Self;
9264        fn take_or_borrow<'a>(
9265            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9266        ) -> Self::Borrowed<'a> {
9267            value
9268        }
9269    }
9270
9271    unsafe impl fidl::encoding::TypeMarker for DebugData {
9272        type Owned = Self;
9273
9274        #[inline(always)]
9275        fn inline_align(_context: fidl::encoding::Context) -> usize {
9276            8
9277        }
9278
9279        #[inline(always)]
9280        fn inline_size(_context: fidl::encoding::Context) -> usize {
9281            16
9282        }
9283    }
9284
9285    unsafe impl fidl::encoding::Encode<DebugData, fidl::encoding::DefaultFuchsiaResourceDialect>
9286        for &mut DebugData
9287    {
9288        unsafe fn encode(
9289            self,
9290            encoder: &mut fidl::encoding::Encoder<
9291                '_,
9292                fidl::encoding::DefaultFuchsiaResourceDialect,
9293            >,
9294            offset: usize,
9295            mut depth: fidl::encoding::Depth,
9296        ) -> fidl::Result<()> {
9297            encoder.debug_check_bounds::<DebugData>(offset);
9298            // Vector header
9299            let max_ordinal: u64 = self.max_ordinal_present();
9300            encoder.write_num(max_ordinal, offset);
9301            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9302            // Calling encoder.out_of_line_offset(0) is not allowed.
9303            if max_ordinal == 0 {
9304                return Ok(());
9305            }
9306            depth.increment()?;
9307            let envelope_size = 8;
9308            let bytes_len = max_ordinal as usize * envelope_size;
9309            #[allow(unused_variables)]
9310            let offset = encoder.out_of_line_offset(bytes_len);
9311            let mut _prev_end_offset: usize = 0;
9312            if 1 > max_ordinal {
9313                return Ok(());
9314            }
9315
9316            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9317            // are envelope_size bytes.
9318            let cur_offset: usize = (1 - 1) * envelope_size;
9319
9320            // Zero reserved fields.
9321            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9322
9323            // Safety:
9324            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9325            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9326            //   envelope_size bytes, there is always sufficient room.
9327            fidl::encoding::encode_in_envelope_optional::<
9328                fidl::encoding::BoundedString<512>,
9329                fidl::encoding::DefaultFuchsiaResourceDialect,
9330            >(
9331                self.name.as_ref().map(
9332                    <fidl::encoding::BoundedString<512> as fidl::encoding::ValueTypeMarker>::borrow,
9333                ),
9334                encoder,
9335                offset + cur_offset,
9336                depth,
9337            )?;
9338
9339            _prev_end_offset = cur_offset + envelope_size;
9340            if 2 > max_ordinal {
9341                return Ok(());
9342            }
9343
9344            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9345            // are envelope_size bytes.
9346            let cur_offset: usize = (2 - 1) * envelope_size;
9347
9348            // Zero reserved fields.
9349            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9350
9351            // Safety:
9352            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9353            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9354            //   envelope_size bytes, there is always sufficient room.
9355            fidl::encoding::encode_in_envelope_optional::<
9356                fidl::encoding::HandleType<
9357                    fidl::Socket,
9358                    { fidl::ObjectType::SOCKET.into_raw() },
9359                    2147483648,
9360                >,
9361                fidl::encoding::DefaultFuchsiaResourceDialect,
9362            >(
9363                self.socket.as_mut().map(
9364                    <fidl::encoding::HandleType<
9365                        fidl::Socket,
9366                        { fidl::ObjectType::SOCKET.into_raw() },
9367                        2147483648,
9368                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
9369                ),
9370                encoder,
9371                offset + cur_offset,
9372                depth,
9373            )?;
9374
9375            _prev_end_offset = cur_offset + envelope_size;
9376
9377            Ok(())
9378        }
9379    }
9380
9381    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DebugData {
9382        #[inline(always)]
9383        fn new_empty() -> Self {
9384            Self::default()
9385        }
9386
9387        unsafe fn decode(
9388            &mut self,
9389            decoder: &mut fidl::encoding::Decoder<
9390                '_,
9391                fidl::encoding::DefaultFuchsiaResourceDialect,
9392            >,
9393            offset: usize,
9394            mut depth: fidl::encoding::Depth,
9395        ) -> fidl::Result<()> {
9396            decoder.debug_check_bounds::<Self>(offset);
9397            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9398                None => return Err(fidl::Error::NotNullable),
9399                Some(len) => len,
9400            };
9401            // Calling decoder.out_of_line_offset(0) is not allowed.
9402            if len == 0 {
9403                return Ok(());
9404            };
9405            depth.increment()?;
9406            let envelope_size = 8;
9407            let bytes_len = len * envelope_size;
9408            let offset = decoder.out_of_line_offset(bytes_len)?;
9409            // Decode the envelope for each type.
9410            let mut _next_ordinal_to_read = 0;
9411            let mut next_offset = offset;
9412            let end_offset = offset + bytes_len;
9413            _next_ordinal_to_read += 1;
9414            if next_offset >= end_offset {
9415                return Ok(());
9416            }
9417
9418            // Decode unknown envelopes for gaps in ordinals.
9419            while _next_ordinal_to_read < 1 {
9420                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9421                _next_ordinal_to_read += 1;
9422                next_offset += envelope_size;
9423            }
9424
9425            let next_out_of_line = decoder.next_out_of_line();
9426            let handles_before = decoder.remaining_handles();
9427            if let Some((inlined, num_bytes, num_handles)) =
9428                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9429            {
9430                let member_inline_size =
9431                    <fidl::encoding::BoundedString<512> as fidl::encoding::TypeMarker>::inline_size(
9432                        decoder.context,
9433                    );
9434                if inlined != (member_inline_size <= 4) {
9435                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9436                }
9437                let inner_offset;
9438                let mut inner_depth = depth.clone();
9439                if inlined {
9440                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9441                    inner_offset = next_offset;
9442                } else {
9443                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9444                    inner_depth.increment()?;
9445                }
9446                let val_ref = self.name.get_or_insert_with(|| {
9447                    fidl::new_empty!(
9448                        fidl::encoding::BoundedString<512>,
9449                        fidl::encoding::DefaultFuchsiaResourceDialect
9450                    )
9451                });
9452                fidl::decode!(
9453                    fidl::encoding::BoundedString<512>,
9454                    fidl::encoding::DefaultFuchsiaResourceDialect,
9455                    val_ref,
9456                    decoder,
9457                    inner_offset,
9458                    inner_depth
9459                )?;
9460                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9461                {
9462                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9463                }
9464                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9465                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9466                }
9467            }
9468
9469            next_offset += envelope_size;
9470            _next_ordinal_to_read += 1;
9471            if next_offset >= end_offset {
9472                return Ok(());
9473            }
9474
9475            // Decode unknown envelopes for gaps in ordinals.
9476            while _next_ordinal_to_read < 2 {
9477                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9478                _next_ordinal_to_read += 1;
9479                next_offset += envelope_size;
9480            }
9481
9482            let next_out_of_line = decoder.next_out_of_line();
9483            let handles_before = decoder.remaining_handles();
9484            if let Some((inlined, num_bytes, num_handles)) =
9485                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9486            {
9487                let member_inline_size = <fidl::encoding::HandleType<
9488                    fidl::Socket,
9489                    { fidl::ObjectType::SOCKET.into_raw() },
9490                    2147483648,
9491                > as fidl::encoding::TypeMarker>::inline_size(
9492                    decoder.context
9493                );
9494                if inlined != (member_inline_size <= 4) {
9495                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9496                }
9497                let inner_offset;
9498                let mut inner_depth = depth.clone();
9499                if inlined {
9500                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9501                    inner_offset = next_offset;
9502                } else {
9503                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9504                    inner_depth.increment()?;
9505                }
9506                let val_ref =
9507                self.socket.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
9508                fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
9509                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9510                {
9511                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9512                }
9513                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9514                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9515                }
9516            }
9517
9518            next_offset += envelope_size;
9519
9520            // Decode the remaining unknown envelopes.
9521            while next_offset < end_offset {
9522                _next_ordinal_to_read += 1;
9523                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9524                next_offset += envelope_size;
9525            }
9526
9527            Ok(())
9528        }
9529    }
9530
9531    impl EnumerateTestCasesOptions {
9532        #[inline(always)]
9533        fn max_ordinal_present(&self) -> u64 {
9534            if let Some(_) = self.realm_options {
9535                return 1;
9536            }
9537            0
9538        }
9539    }
9540
9541    impl fidl::encoding::ResourceTypeMarker for EnumerateTestCasesOptions {
9542        type Borrowed<'a> = &'a mut Self;
9543        fn take_or_borrow<'a>(
9544            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9545        ) -> Self::Borrowed<'a> {
9546            value
9547        }
9548    }
9549
9550    unsafe impl fidl::encoding::TypeMarker for EnumerateTestCasesOptions {
9551        type Owned = Self;
9552
9553        #[inline(always)]
9554        fn inline_align(_context: fidl::encoding::Context) -> usize {
9555            8
9556        }
9557
9558        #[inline(always)]
9559        fn inline_size(_context: fidl::encoding::Context) -> usize {
9560            16
9561        }
9562    }
9563
9564    unsafe impl
9565        fidl::encoding::Encode<
9566            EnumerateTestCasesOptions,
9567            fidl::encoding::DefaultFuchsiaResourceDialect,
9568        > for &mut EnumerateTestCasesOptions
9569    {
9570        unsafe fn encode(
9571            self,
9572            encoder: &mut fidl::encoding::Encoder<
9573                '_,
9574                fidl::encoding::DefaultFuchsiaResourceDialect,
9575            >,
9576            offset: usize,
9577            mut depth: fidl::encoding::Depth,
9578        ) -> fidl::Result<()> {
9579            encoder.debug_check_bounds::<EnumerateTestCasesOptions>(offset);
9580            // Vector header
9581            let max_ordinal: u64 = self.max_ordinal_present();
9582            encoder.write_num(max_ordinal, offset);
9583            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9584            // Calling encoder.out_of_line_offset(0) is not allowed.
9585            if max_ordinal == 0 {
9586                return Ok(());
9587            }
9588            depth.increment()?;
9589            let envelope_size = 8;
9590            let bytes_len = max_ordinal as usize * envelope_size;
9591            #[allow(unused_variables)]
9592            let offset = encoder.out_of_line_offset(bytes_len);
9593            let mut _prev_end_offset: usize = 0;
9594            if 1 > max_ordinal {
9595                return Ok(());
9596            }
9597
9598            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9599            // are envelope_size bytes.
9600            let cur_offset: usize = (1 - 1) * envelope_size;
9601
9602            // Zero reserved fields.
9603            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9604
9605            // Safety:
9606            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9607            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9608            //   envelope_size bytes, there is always sufficient room.
9609            fidl::encoding::encode_in_envelope_optional::<
9610                RealmOptions,
9611                fidl::encoding::DefaultFuchsiaResourceDialect,
9612            >(
9613                self.realm_options
9614                    .as_mut()
9615                    .map(<RealmOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9616                encoder,
9617                offset + cur_offset,
9618                depth,
9619            )?;
9620
9621            _prev_end_offset = cur_offset + envelope_size;
9622
9623            Ok(())
9624        }
9625    }
9626
9627    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9628        for EnumerateTestCasesOptions
9629    {
9630        #[inline(always)]
9631        fn new_empty() -> Self {
9632            Self::default()
9633        }
9634
9635        unsafe fn decode(
9636            &mut self,
9637            decoder: &mut fidl::encoding::Decoder<
9638                '_,
9639                fidl::encoding::DefaultFuchsiaResourceDialect,
9640            >,
9641            offset: usize,
9642            mut depth: fidl::encoding::Depth,
9643        ) -> fidl::Result<()> {
9644            decoder.debug_check_bounds::<Self>(offset);
9645            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9646                None => return Err(fidl::Error::NotNullable),
9647                Some(len) => len,
9648            };
9649            // Calling decoder.out_of_line_offset(0) is not allowed.
9650            if len == 0 {
9651                return Ok(());
9652            };
9653            depth.increment()?;
9654            let envelope_size = 8;
9655            let bytes_len = len * envelope_size;
9656            let offset = decoder.out_of_line_offset(bytes_len)?;
9657            // Decode the envelope for each type.
9658            let mut _next_ordinal_to_read = 0;
9659            let mut next_offset = offset;
9660            let end_offset = offset + bytes_len;
9661            _next_ordinal_to_read += 1;
9662            if next_offset >= end_offset {
9663                return Ok(());
9664            }
9665
9666            // Decode unknown envelopes for gaps in ordinals.
9667            while _next_ordinal_to_read < 1 {
9668                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9669                _next_ordinal_to_read += 1;
9670                next_offset += envelope_size;
9671            }
9672
9673            let next_out_of_line = decoder.next_out_of_line();
9674            let handles_before = decoder.remaining_handles();
9675            if let Some((inlined, num_bytes, num_handles)) =
9676                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9677            {
9678                let member_inline_size =
9679                    <RealmOptions as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9680                if inlined != (member_inline_size <= 4) {
9681                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9682                }
9683                let inner_offset;
9684                let mut inner_depth = depth.clone();
9685                if inlined {
9686                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9687                    inner_offset = next_offset;
9688                } else {
9689                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9690                    inner_depth.increment()?;
9691                }
9692                let val_ref = self.realm_options.get_or_insert_with(|| {
9693                    fidl::new_empty!(RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect)
9694                });
9695                fidl::decode!(
9696                    RealmOptions,
9697                    fidl::encoding::DefaultFuchsiaResourceDialect,
9698                    val_ref,
9699                    decoder,
9700                    inner_offset,
9701                    inner_depth
9702                )?;
9703                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9704                {
9705                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9706                }
9707                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9708                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9709                }
9710            }
9711
9712            next_offset += envelope_size;
9713
9714            // Decode the remaining unknown envelopes.
9715            while next_offset < end_offset {
9716                _next_ordinal_to_read += 1;
9717                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9718                next_offset += envelope_size;
9719            }
9720
9721            Ok(())
9722        }
9723    }
9724
9725    impl Event {
9726        #[inline(always)]
9727        fn max_ordinal_present(&self) -> u64 {
9728            if let Some(_) = self.details {
9729                return 2;
9730            }
9731            if let Some(_) = self.timestamp {
9732                return 1;
9733            }
9734            0
9735        }
9736    }
9737
9738    impl fidl::encoding::ResourceTypeMarker for Event {
9739        type Borrowed<'a> = &'a mut Self;
9740        fn take_or_borrow<'a>(
9741            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9742        ) -> Self::Borrowed<'a> {
9743            value
9744        }
9745    }
9746
9747    unsafe impl fidl::encoding::TypeMarker for Event {
9748        type Owned = Self;
9749
9750        #[inline(always)]
9751        fn inline_align(_context: fidl::encoding::Context) -> usize {
9752            8
9753        }
9754
9755        #[inline(always)]
9756        fn inline_size(_context: fidl::encoding::Context) -> usize {
9757            16
9758        }
9759    }
9760
9761    unsafe impl fidl::encoding::Encode<Event, fidl::encoding::DefaultFuchsiaResourceDialect>
9762        for &mut Event
9763    {
9764        unsafe fn encode(
9765            self,
9766            encoder: &mut fidl::encoding::Encoder<
9767                '_,
9768                fidl::encoding::DefaultFuchsiaResourceDialect,
9769            >,
9770            offset: usize,
9771            mut depth: fidl::encoding::Depth,
9772        ) -> fidl::Result<()> {
9773            encoder.debug_check_bounds::<Event>(offset);
9774            // Vector header
9775            let max_ordinal: u64 = self.max_ordinal_present();
9776            encoder.write_num(max_ordinal, offset);
9777            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9778            // Calling encoder.out_of_line_offset(0) is not allowed.
9779            if max_ordinal == 0 {
9780                return Ok(());
9781            }
9782            depth.increment()?;
9783            let envelope_size = 8;
9784            let bytes_len = max_ordinal as usize * envelope_size;
9785            #[allow(unused_variables)]
9786            let offset = encoder.out_of_line_offset(bytes_len);
9787            let mut _prev_end_offset: usize = 0;
9788            if 1 > max_ordinal {
9789                return Ok(());
9790            }
9791
9792            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9793            // are envelope_size bytes.
9794            let cur_offset: usize = (1 - 1) * envelope_size;
9795
9796            // Zero reserved fields.
9797            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9798
9799            // Safety:
9800            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9801            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9802            //   envelope_size bytes, there is always sufficient room.
9803            fidl::encoding::encode_in_envelope_optional::<
9804                i64,
9805                fidl::encoding::DefaultFuchsiaResourceDialect,
9806            >(
9807                self.timestamp.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
9808                encoder,
9809                offset + cur_offset,
9810                depth,
9811            )?;
9812
9813            _prev_end_offset = cur_offset + envelope_size;
9814            if 2 > max_ordinal {
9815                return Ok(());
9816            }
9817
9818            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9819            // are envelope_size bytes.
9820            let cur_offset: usize = (2 - 1) * envelope_size;
9821
9822            // Zero reserved fields.
9823            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9824
9825            // Safety:
9826            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9827            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9828            //   envelope_size bytes, there is always sufficient room.
9829            fidl::encoding::encode_in_envelope_optional::<
9830                EventDetails,
9831                fidl::encoding::DefaultFuchsiaResourceDialect,
9832            >(
9833                self.details
9834                    .as_mut()
9835                    .map(<EventDetails as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9836                encoder,
9837                offset + cur_offset,
9838                depth,
9839            )?;
9840
9841            _prev_end_offset = cur_offset + envelope_size;
9842
9843            Ok(())
9844        }
9845    }
9846
9847    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Event {
9848        #[inline(always)]
9849        fn new_empty() -> Self {
9850            Self::default()
9851        }
9852
9853        unsafe fn decode(
9854            &mut self,
9855            decoder: &mut fidl::encoding::Decoder<
9856                '_,
9857                fidl::encoding::DefaultFuchsiaResourceDialect,
9858            >,
9859            offset: usize,
9860            mut depth: fidl::encoding::Depth,
9861        ) -> fidl::Result<()> {
9862            decoder.debug_check_bounds::<Self>(offset);
9863            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9864                None => return Err(fidl::Error::NotNullable),
9865                Some(len) => len,
9866            };
9867            // Calling decoder.out_of_line_offset(0) is not allowed.
9868            if len == 0 {
9869                return Ok(());
9870            };
9871            depth.increment()?;
9872            let envelope_size = 8;
9873            let bytes_len = len * envelope_size;
9874            let offset = decoder.out_of_line_offset(bytes_len)?;
9875            // Decode the envelope for each type.
9876            let mut _next_ordinal_to_read = 0;
9877            let mut next_offset = offset;
9878            let end_offset = offset + bytes_len;
9879            _next_ordinal_to_read += 1;
9880            if next_offset >= end_offset {
9881                return Ok(());
9882            }
9883
9884            // Decode unknown envelopes for gaps in ordinals.
9885            while _next_ordinal_to_read < 1 {
9886                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9887                _next_ordinal_to_read += 1;
9888                next_offset += envelope_size;
9889            }
9890
9891            let next_out_of_line = decoder.next_out_of_line();
9892            let handles_before = decoder.remaining_handles();
9893            if let Some((inlined, num_bytes, num_handles)) =
9894                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9895            {
9896                let member_inline_size =
9897                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9898                if inlined != (member_inline_size <= 4) {
9899                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9900                }
9901                let inner_offset;
9902                let mut inner_depth = depth.clone();
9903                if inlined {
9904                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9905                    inner_offset = next_offset;
9906                } else {
9907                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9908                    inner_depth.increment()?;
9909                }
9910                let val_ref = self.timestamp.get_or_insert_with(|| {
9911                    fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
9912                });
9913                fidl::decode!(
9914                    i64,
9915                    fidl::encoding::DefaultFuchsiaResourceDialect,
9916                    val_ref,
9917                    decoder,
9918                    inner_offset,
9919                    inner_depth
9920                )?;
9921                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9922                {
9923                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9924                }
9925                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9926                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9927                }
9928            }
9929
9930            next_offset += envelope_size;
9931            _next_ordinal_to_read += 1;
9932            if next_offset >= end_offset {
9933                return Ok(());
9934            }
9935
9936            // Decode unknown envelopes for gaps in ordinals.
9937            while _next_ordinal_to_read < 2 {
9938                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9939                _next_ordinal_to_read += 1;
9940                next_offset += envelope_size;
9941            }
9942
9943            let next_out_of_line = decoder.next_out_of_line();
9944            let handles_before = decoder.remaining_handles();
9945            if let Some((inlined, num_bytes, num_handles)) =
9946                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9947            {
9948                let member_inline_size =
9949                    <EventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9950                if inlined != (member_inline_size <= 4) {
9951                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9952                }
9953                let inner_offset;
9954                let mut inner_depth = depth.clone();
9955                if inlined {
9956                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9957                    inner_offset = next_offset;
9958                } else {
9959                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9960                    inner_depth.increment()?;
9961                }
9962                let val_ref = self.details.get_or_insert_with(|| {
9963                    fidl::new_empty!(EventDetails, fidl::encoding::DefaultFuchsiaResourceDialect)
9964                });
9965                fidl::decode!(
9966                    EventDetails,
9967                    fidl::encoding::DefaultFuchsiaResourceDialect,
9968                    val_ref,
9969                    decoder,
9970                    inner_offset,
9971                    inner_depth
9972                )?;
9973                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9974                {
9975                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9976                }
9977                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9978                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9979                }
9980            }
9981
9982            next_offset += envelope_size;
9983
9984            // Decode the remaining unknown envelopes.
9985            while next_offset < end_offset {
9986                _next_ordinal_to_read += 1;
9987                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9988                next_offset += envelope_size;
9989            }
9990
9991            Ok(())
9992        }
9993    }
9994
9995    impl RealmOptions {
9996        #[inline(always)]
9997        fn max_ordinal_present(&self) -> u64 {
9998            if let Some(_) = self.test_collection {
9999                return 3;
10000            }
10001            if let Some(_) = self.offers {
10002                return 2;
10003            }
10004            if let Some(_) = self.realm {
10005                return 1;
10006            }
10007            0
10008        }
10009    }
10010
10011    impl fidl::encoding::ResourceTypeMarker for RealmOptions {
10012        type Borrowed<'a> = &'a mut Self;
10013        fn take_or_borrow<'a>(
10014            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10015        ) -> Self::Borrowed<'a> {
10016            value
10017        }
10018    }
10019
10020    unsafe impl fidl::encoding::TypeMarker for RealmOptions {
10021        type Owned = Self;
10022
10023        #[inline(always)]
10024        fn inline_align(_context: fidl::encoding::Context) -> usize {
10025            8
10026        }
10027
10028        #[inline(always)]
10029        fn inline_size(_context: fidl::encoding::Context) -> usize {
10030            16
10031        }
10032    }
10033
10034    unsafe impl fidl::encoding::Encode<RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect>
10035        for &mut RealmOptions
10036    {
10037        unsafe fn encode(
10038            self,
10039            encoder: &mut fidl::encoding::Encoder<
10040                '_,
10041                fidl::encoding::DefaultFuchsiaResourceDialect,
10042            >,
10043            offset: usize,
10044            mut depth: fidl::encoding::Depth,
10045        ) -> fidl::Result<()> {
10046            encoder.debug_check_bounds::<RealmOptions>(offset);
10047            // Vector header
10048            let max_ordinal: u64 = self.max_ordinal_present();
10049            encoder.write_num(max_ordinal, offset);
10050            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10051            // Calling encoder.out_of_line_offset(0) is not allowed.
10052            if max_ordinal == 0 {
10053                return Ok(());
10054            }
10055            depth.increment()?;
10056            let envelope_size = 8;
10057            let bytes_len = max_ordinal as usize * envelope_size;
10058            #[allow(unused_variables)]
10059            let offset = encoder.out_of_line_offset(bytes_len);
10060            let mut _prev_end_offset: usize = 0;
10061            if 1 > max_ordinal {
10062                return Ok(());
10063            }
10064
10065            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10066            // are envelope_size bytes.
10067            let cur_offset: usize = (1 - 1) * envelope_size;
10068
10069            // Zero reserved fields.
10070            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10071
10072            // Safety:
10073            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10074            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10075            //   envelope_size bytes, there is always sufficient room.
10076            fidl::encoding::encode_in_envelope_optional::<
10077                fidl::encoding::Endpoint<
10078                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
10079                >,
10080                fidl::encoding::DefaultFuchsiaResourceDialect,
10081            >(
10082                self.realm.as_mut().map(
10083                    <fidl::encoding::Endpoint<
10084                        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
10085                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
10086                ),
10087                encoder,
10088                offset + cur_offset,
10089                depth,
10090            )?;
10091
10092            _prev_end_offset = cur_offset + envelope_size;
10093            if 2 > max_ordinal {
10094                return Ok(());
10095            }
10096
10097            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10098            // are envelope_size bytes.
10099            let cur_offset: usize = (2 - 1) * envelope_size;
10100
10101            // Zero reserved fields.
10102            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10103
10104            // Safety:
10105            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10106            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10107            //   envelope_size bytes, there is always sufficient room.
10108            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect>(
10109            self.offers.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024> as fidl::encoding::ValueTypeMarker>::borrow),
10110            encoder, offset + cur_offset, depth
10111        )?;
10112
10113            _prev_end_offset = cur_offset + envelope_size;
10114            if 3 > max_ordinal {
10115                return Ok(());
10116            }
10117
10118            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10119            // are envelope_size bytes.
10120            let cur_offset: usize = (3 - 1) * envelope_size;
10121
10122            // Zero reserved fields.
10123            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10124
10125            // Safety:
10126            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10127            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10128            //   envelope_size bytes, there is always sufficient room.
10129            fidl::encoding::encode_in_envelope_optional::<
10130                fidl::encoding::BoundedString<255>,
10131                fidl::encoding::DefaultFuchsiaResourceDialect,
10132            >(
10133                self.test_collection.as_ref().map(
10134                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
10135                ),
10136                encoder,
10137                offset + cur_offset,
10138                depth,
10139            )?;
10140
10141            _prev_end_offset = cur_offset + envelope_size;
10142
10143            Ok(())
10144        }
10145    }
10146
10147    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RealmOptions {
10148        #[inline(always)]
10149        fn new_empty() -> Self {
10150            Self::default()
10151        }
10152
10153        unsafe fn decode(
10154            &mut self,
10155            decoder: &mut fidl::encoding::Decoder<
10156                '_,
10157                fidl::encoding::DefaultFuchsiaResourceDialect,
10158            >,
10159            offset: usize,
10160            mut depth: fidl::encoding::Depth,
10161        ) -> fidl::Result<()> {
10162            decoder.debug_check_bounds::<Self>(offset);
10163            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10164                None => return Err(fidl::Error::NotNullable),
10165                Some(len) => len,
10166            };
10167            // Calling decoder.out_of_line_offset(0) is not allowed.
10168            if len == 0 {
10169                return Ok(());
10170            };
10171            depth.increment()?;
10172            let envelope_size = 8;
10173            let bytes_len = len * envelope_size;
10174            let offset = decoder.out_of_line_offset(bytes_len)?;
10175            // Decode the envelope for each type.
10176            let mut _next_ordinal_to_read = 0;
10177            let mut next_offset = offset;
10178            let end_offset = offset + bytes_len;
10179            _next_ordinal_to_read += 1;
10180            if next_offset >= end_offset {
10181                return Ok(());
10182            }
10183
10184            // Decode unknown envelopes for gaps in ordinals.
10185            while _next_ordinal_to_read < 1 {
10186                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10187                _next_ordinal_to_read += 1;
10188                next_offset += envelope_size;
10189            }
10190
10191            let next_out_of_line = decoder.next_out_of_line();
10192            let handles_before = decoder.remaining_handles();
10193            if let Some((inlined, num_bytes, num_handles)) =
10194                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10195            {
10196                let member_inline_size = <fidl::encoding::Endpoint<
10197                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
10198                > as fidl::encoding::TypeMarker>::inline_size(
10199                    decoder.context
10200                );
10201                if inlined != (member_inline_size <= 4) {
10202                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10203                }
10204                let inner_offset;
10205                let mut inner_depth = depth.clone();
10206                if inlined {
10207                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10208                    inner_offset = next_offset;
10209                } else {
10210                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10211                    inner_depth.increment()?;
10212                }
10213                let val_ref = self.realm.get_or_insert_with(|| {
10214                    fidl::new_empty!(
10215                        fidl::encoding::Endpoint<
10216                            fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
10217                        >,
10218                        fidl::encoding::DefaultFuchsiaResourceDialect
10219                    )
10220                });
10221                fidl::decode!(
10222                    fidl::encoding::Endpoint<
10223                        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
10224                    >,
10225                    fidl::encoding::DefaultFuchsiaResourceDialect,
10226                    val_ref,
10227                    decoder,
10228                    inner_offset,
10229                    inner_depth
10230                )?;
10231                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10232                {
10233                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10234                }
10235                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10236                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10237                }
10238            }
10239
10240            next_offset += envelope_size;
10241            _next_ordinal_to_read += 1;
10242            if next_offset >= end_offset {
10243                return Ok(());
10244            }
10245
10246            // Decode unknown envelopes for gaps in ordinals.
10247            while _next_ordinal_to_read < 2 {
10248                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10249                _next_ordinal_to_read += 1;
10250                next_offset += envelope_size;
10251            }
10252
10253            let next_out_of_line = decoder.next_out_of_line();
10254            let handles_before = decoder.remaining_handles();
10255            if let Some((inlined, num_bytes, num_handles)) =
10256                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10257            {
10258                let member_inline_size = <fidl::encoding::Vector<
10259                    fidl_fuchsia_component_decl::Offer,
10260                    1024,
10261                > as fidl::encoding::TypeMarker>::inline_size(
10262                    decoder.context
10263                );
10264                if inlined != (member_inline_size <= 4) {
10265                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10266                }
10267                let inner_offset;
10268                let mut inner_depth = depth.clone();
10269                if inlined {
10270                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10271                    inner_offset = next_offset;
10272                } else {
10273                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10274                    inner_depth.increment()?;
10275                }
10276                let val_ref =
10277                self.offers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect));
10278                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
10279                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10280                {
10281                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10282                }
10283                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10284                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10285                }
10286            }
10287
10288            next_offset += envelope_size;
10289            _next_ordinal_to_read += 1;
10290            if next_offset >= end_offset {
10291                return Ok(());
10292            }
10293
10294            // Decode unknown envelopes for gaps in ordinals.
10295            while _next_ordinal_to_read < 3 {
10296                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10297                _next_ordinal_to_read += 1;
10298                next_offset += envelope_size;
10299            }
10300
10301            let next_out_of_line = decoder.next_out_of_line();
10302            let handles_before = decoder.remaining_handles();
10303            if let Some((inlined, num_bytes, num_handles)) =
10304                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10305            {
10306                let member_inline_size =
10307                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
10308                        decoder.context,
10309                    );
10310                if inlined != (member_inline_size <= 4) {
10311                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10312                }
10313                let inner_offset;
10314                let mut inner_depth = depth.clone();
10315                if inlined {
10316                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10317                    inner_offset = next_offset;
10318                } else {
10319                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10320                    inner_depth.increment()?;
10321                }
10322                let val_ref = self.test_collection.get_or_insert_with(|| {
10323                    fidl::new_empty!(
10324                        fidl::encoding::BoundedString<255>,
10325                        fidl::encoding::DefaultFuchsiaResourceDialect
10326                    )
10327                });
10328                fidl::decode!(
10329                    fidl::encoding::BoundedString<255>,
10330                    fidl::encoding::DefaultFuchsiaResourceDialect,
10331                    val_ref,
10332                    decoder,
10333                    inner_offset,
10334                    inner_depth
10335                )?;
10336                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10337                {
10338                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10339                }
10340                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10341                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10342                }
10343            }
10344
10345            next_offset += envelope_size;
10346
10347            // Decode the remaining unknown envelopes.
10348            while next_offset < end_offset {
10349                _next_ordinal_to_read += 1;
10350                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10351                next_offset += envelope_size;
10352            }
10353
10354            Ok(())
10355        }
10356    }
10357
10358    impl RunEvent {
10359        #[inline(always)]
10360        fn max_ordinal_present(&self) -> u64 {
10361            if let Some(_) = self.payload {
10362                return 2;
10363            }
10364            if let Some(_) = self.timestamp {
10365                return 1;
10366            }
10367            0
10368        }
10369    }
10370
10371    impl fidl::encoding::ResourceTypeMarker for RunEvent {
10372        type Borrowed<'a> = &'a mut Self;
10373        fn take_or_borrow<'a>(
10374            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10375        ) -> Self::Borrowed<'a> {
10376            value
10377        }
10378    }
10379
10380    unsafe impl fidl::encoding::TypeMarker for RunEvent {
10381        type Owned = Self;
10382
10383        #[inline(always)]
10384        fn inline_align(_context: fidl::encoding::Context) -> usize {
10385            8
10386        }
10387
10388        #[inline(always)]
10389        fn inline_size(_context: fidl::encoding::Context) -> usize {
10390            16
10391        }
10392    }
10393
10394    unsafe impl fidl::encoding::Encode<RunEvent, fidl::encoding::DefaultFuchsiaResourceDialect>
10395        for &mut RunEvent
10396    {
10397        unsafe fn encode(
10398            self,
10399            encoder: &mut fidl::encoding::Encoder<
10400                '_,
10401                fidl::encoding::DefaultFuchsiaResourceDialect,
10402            >,
10403            offset: usize,
10404            mut depth: fidl::encoding::Depth,
10405        ) -> fidl::Result<()> {
10406            encoder.debug_check_bounds::<RunEvent>(offset);
10407            // Vector header
10408            let max_ordinal: u64 = self.max_ordinal_present();
10409            encoder.write_num(max_ordinal, offset);
10410            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10411            // Calling encoder.out_of_line_offset(0) is not allowed.
10412            if max_ordinal == 0 {
10413                return Ok(());
10414            }
10415            depth.increment()?;
10416            let envelope_size = 8;
10417            let bytes_len = max_ordinal as usize * envelope_size;
10418            #[allow(unused_variables)]
10419            let offset = encoder.out_of_line_offset(bytes_len);
10420            let mut _prev_end_offset: usize = 0;
10421            if 1 > max_ordinal {
10422                return Ok(());
10423            }
10424
10425            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10426            // are envelope_size bytes.
10427            let cur_offset: usize = (1 - 1) * envelope_size;
10428
10429            // Zero reserved fields.
10430            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10431
10432            // Safety:
10433            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10434            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10435            //   envelope_size bytes, there is always sufficient room.
10436            fidl::encoding::encode_in_envelope_optional::<
10437                i64,
10438                fidl::encoding::DefaultFuchsiaResourceDialect,
10439            >(
10440                self.timestamp.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
10441                encoder,
10442                offset + cur_offset,
10443                depth,
10444            )?;
10445
10446            _prev_end_offset = cur_offset + envelope_size;
10447            if 2 > max_ordinal {
10448                return Ok(());
10449            }
10450
10451            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10452            // are envelope_size bytes.
10453            let cur_offset: usize = (2 - 1) * envelope_size;
10454
10455            // Zero reserved fields.
10456            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10457
10458            // Safety:
10459            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10460            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10461            //   envelope_size bytes, there is always sufficient room.
10462            fidl::encoding::encode_in_envelope_optional::<
10463                RunEventPayload,
10464                fidl::encoding::DefaultFuchsiaResourceDialect,
10465            >(
10466                self.payload
10467                    .as_mut()
10468                    .map(<RunEventPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10469                encoder,
10470                offset + cur_offset,
10471                depth,
10472            )?;
10473
10474            _prev_end_offset = cur_offset + envelope_size;
10475
10476            Ok(())
10477        }
10478    }
10479
10480    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RunEvent {
10481        #[inline(always)]
10482        fn new_empty() -> Self {
10483            Self::default()
10484        }
10485
10486        unsafe fn decode(
10487            &mut self,
10488            decoder: &mut fidl::encoding::Decoder<
10489                '_,
10490                fidl::encoding::DefaultFuchsiaResourceDialect,
10491            >,
10492            offset: usize,
10493            mut depth: fidl::encoding::Depth,
10494        ) -> fidl::Result<()> {
10495            decoder.debug_check_bounds::<Self>(offset);
10496            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10497                None => return Err(fidl::Error::NotNullable),
10498                Some(len) => len,
10499            };
10500            // Calling decoder.out_of_line_offset(0) is not allowed.
10501            if len == 0 {
10502                return Ok(());
10503            };
10504            depth.increment()?;
10505            let envelope_size = 8;
10506            let bytes_len = len * envelope_size;
10507            let offset = decoder.out_of_line_offset(bytes_len)?;
10508            // Decode the envelope for each type.
10509            let mut _next_ordinal_to_read = 0;
10510            let mut next_offset = offset;
10511            let end_offset = offset + bytes_len;
10512            _next_ordinal_to_read += 1;
10513            if next_offset >= end_offset {
10514                return Ok(());
10515            }
10516
10517            // Decode unknown envelopes for gaps in ordinals.
10518            while _next_ordinal_to_read < 1 {
10519                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10520                _next_ordinal_to_read += 1;
10521                next_offset += envelope_size;
10522            }
10523
10524            let next_out_of_line = decoder.next_out_of_line();
10525            let handles_before = decoder.remaining_handles();
10526            if let Some((inlined, num_bytes, num_handles)) =
10527                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10528            {
10529                let member_inline_size =
10530                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10531                if inlined != (member_inline_size <= 4) {
10532                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10533                }
10534                let inner_offset;
10535                let mut inner_depth = depth.clone();
10536                if inlined {
10537                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10538                    inner_offset = next_offset;
10539                } else {
10540                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10541                    inner_depth.increment()?;
10542                }
10543                let val_ref = self.timestamp.get_or_insert_with(|| {
10544                    fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
10545                });
10546                fidl::decode!(
10547                    i64,
10548                    fidl::encoding::DefaultFuchsiaResourceDialect,
10549                    val_ref,
10550                    decoder,
10551                    inner_offset,
10552                    inner_depth
10553                )?;
10554                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10555                {
10556                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10557                }
10558                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10559                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10560                }
10561            }
10562
10563            next_offset += envelope_size;
10564            _next_ordinal_to_read += 1;
10565            if next_offset >= end_offset {
10566                return Ok(());
10567            }
10568
10569            // Decode unknown envelopes for gaps in ordinals.
10570            while _next_ordinal_to_read < 2 {
10571                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10572                _next_ordinal_to_read += 1;
10573                next_offset += envelope_size;
10574            }
10575
10576            let next_out_of_line = decoder.next_out_of_line();
10577            let handles_before = decoder.remaining_handles();
10578            if let Some((inlined, num_bytes, num_handles)) =
10579                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10580            {
10581                let member_inline_size =
10582                    <RunEventPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10583                if inlined != (member_inline_size <= 4) {
10584                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10585                }
10586                let inner_offset;
10587                let mut inner_depth = depth.clone();
10588                if inlined {
10589                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10590                    inner_offset = next_offset;
10591                } else {
10592                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10593                    inner_depth.increment()?;
10594                }
10595                let val_ref = self.payload.get_or_insert_with(|| {
10596                    fidl::new_empty!(RunEventPayload, fidl::encoding::DefaultFuchsiaResourceDialect)
10597                });
10598                fidl::decode!(
10599                    RunEventPayload,
10600                    fidl::encoding::DefaultFuchsiaResourceDialect,
10601                    val_ref,
10602                    decoder,
10603                    inner_offset,
10604                    inner_depth
10605                )?;
10606                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10607                {
10608                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10609                }
10610                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10611                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10612                }
10613            }
10614
10615            next_offset += envelope_size;
10616
10617            // Decode the remaining unknown envelopes.
10618            while next_offset < end_offset {
10619                _next_ordinal_to_read += 1;
10620                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10621                next_offset += envelope_size;
10622            }
10623
10624            Ok(())
10625        }
10626    }
10627
10628    impl RunSuiteOptions {
10629        #[inline(always)]
10630        fn max_ordinal_present(&self) -> u64 {
10631            if let Some(_) = self.break_on_failure {
10632                return 11;
10633            }
10634            if let Some(_) = self.no_exception_channel {
10635                return 10;
10636            }
10637            if let Some(_) = self.accumulate_debug_data {
10638                return 9;
10639            }
10640            if let Some(_) = self.log_interest {
10641                return 8;
10642            }
10643            if let Some(_) = self.logs_iterator_type {
10644                return 7;
10645            }
10646            if let Some(_) = self.test_case_filters {
10647                return 6;
10648            }
10649            if let Some(_) = self.timeout {
10650                return 5;
10651            }
10652            if let Some(_) = self.arguments {
10653                return 4;
10654            }
10655            if let Some(_) = self.max_concurrent_test_case_runs {
10656                return 3;
10657            }
10658            if let Some(_) = self.run_disabled_tests {
10659                return 2;
10660            }
10661            if let Some(_) = self.realm_options {
10662                return 1;
10663            }
10664            0
10665        }
10666    }
10667
10668    impl fidl::encoding::ResourceTypeMarker for RunSuiteOptions {
10669        type Borrowed<'a> = &'a mut Self;
10670        fn take_or_borrow<'a>(
10671            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10672        ) -> Self::Borrowed<'a> {
10673            value
10674        }
10675    }
10676
10677    unsafe impl fidl::encoding::TypeMarker for RunSuiteOptions {
10678        type Owned = Self;
10679
10680        #[inline(always)]
10681        fn inline_align(_context: fidl::encoding::Context) -> usize {
10682            8
10683        }
10684
10685        #[inline(always)]
10686        fn inline_size(_context: fidl::encoding::Context) -> usize {
10687            16
10688        }
10689    }
10690
10691    unsafe impl
10692        fidl::encoding::Encode<RunSuiteOptions, fidl::encoding::DefaultFuchsiaResourceDialect>
10693        for &mut RunSuiteOptions
10694    {
10695        unsafe fn encode(
10696            self,
10697            encoder: &mut fidl::encoding::Encoder<
10698                '_,
10699                fidl::encoding::DefaultFuchsiaResourceDialect,
10700            >,
10701            offset: usize,
10702            mut depth: fidl::encoding::Depth,
10703        ) -> fidl::Result<()> {
10704            encoder.debug_check_bounds::<RunSuiteOptions>(offset);
10705            // Vector header
10706            let max_ordinal: u64 = self.max_ordinal_present();
10707            encoder.write_num(max_ordinal, offset);
10708            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10709            // Calling encoder.out_of_line_offset(0) is not allowed.
10710            if max_ordinal == 0 {
10711                return Ok(());
10712            }
10713            depth.increment()?;
10714            let envelope_size = 8;
10715            let bytes_len = max_ordinal as usize * envelope_size;
10716            #[allow(unused_variables)]
10717            let offset = encoder.out_of_line_offset(bytes_len);
10718            let mut _prev_end_offset: usize = 0;
10719            if 1 > max_ordinal {
10720                return Ok(());
10721            }
10722
10723            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10724            // are envelope_size bytes.
10725            let cur_offset: usize = (1 - 1) * envelope_size;
10726
10727            // Zero reserved fields.
10728            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10729
10730            // Safety:
10731            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10732            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10733            //   envelope_size bytes, there is always sufficient room.
10734            fidl::encoding::encode_in_envelope_optional::<
10735                RealmOptions,
10736                fidl::encoding::DefaultFuchsiaResourceDialect,
10737            >(
10738                self.realm_options
10739                    .as_mut()
10740                    .map(<RealmOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10741                encoder,
10742                offset + cur_offset,
10743                depth,
10744            )?;
10745
10746            _prev_end_offset = cur_offset + envelope_size;
10747            if 2 > max_ordinal {
10748                return Ok(());
10749            }
10750
10751            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10752            // are envelope_size bytes.
10753            let cur_offset: usize = (2 - 1) * envelope_size;
10754
10755            // Zero reserved fields.
10756            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10757
10758            // Safety:
10759            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10760            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10761            //   envelope_size bytes, there is always sufficient room.
10762            fidl::encoding::encode_in_envelope_optional::<
10763                bool,
10764                fidl::encoding::DefaultFuchsiaResourceDialect,
10765            >(
10766                self.run_disabled_tests
10767                    .as_ref()
10768                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10769                encoder,
10770                offset + cur_offset,
10771                depth,
10772            )?;
10773
10774            _prev_end_offset = cur_offset + envelope_size;
10775            if 3 > max_ordinal {
10776                return Ok(());
10777            }
10778
10779            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10780            // are envelope_size bytes.
10781            let cur_offset: usize = (3 - 1) * envelope_size;
10782
10783            // Zero reserved fields.
10784            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10785
10786            // Safety:
10787            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10788            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10789            //   envelope_size bytes, there is always sufficient room.
10790            fidl::encoding::encode_in_envelope_optional::<
10791                u16,
10792                fidl::encoding::DefaultFuchsiaResourceDialect,
10793            >(
10794                self.max_concurrent_test_case_runs
10795                    .as_ref()
10796                    .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
10797                encoder,
10798                offset + cur_offset,
10799                depth,
10800            )?;
10801
10802            _prev_end_offset = cur_offset + envelope_size;
10803            if 4 > max_ordinal {
10804                return Ok(());
10805            }
10806
10807            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10808            // are envelope_size bytes.
10809            let cur_offset: usize = (4 - 1) * envelope_size;
10810
10811            // Zero reserved fields.
10812            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10813
10814            // Safety:
10815            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10816            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10817            //   envelope_size bytes, there is always sufficient room.
10818            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<1024>, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
10819            self.arguments.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<1024>, 4095> as fidl::encoding::ValueTypeMarker>::borrow),
10820            encoder, offset + cur_offset, depth
10821        )?;
10822
10823            _prev_end_offset = cur_offset + envelope_size;
10824            if 5 > max_ordinal {
10825                return Ok(());
10826            }
10827
10828            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10829            // are envelope_size bytes.
10830            let cur_offset: usize = (5 - 1) * envelope_size;
10831
10832            // Zero reserved fields.
10833            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10834
10835            // Safety:
10836            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10837            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10838            //   envelope_size bytes, there is always sufficient room.
10839            fidl::encoding::encode_in_envelope_optional::<
10840                i64,
10841                fidl::encoding::DefaultFuchsiaResourceDialect,
10842            >(
10843                self.timeout.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
10844                encoder,
10845                offset + cur_offset,
10846                depth,
10847            )?;
10848
10849            _prev_end_offset = cur_offset + envelope_size;
10850            if 6 > max_ordinal {
10851                return Ok(());
10852            }
10853
10854            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10855            // are envelope_size bytes.
10856            let cur_offset: usize = (6 - 1) * envelope_size;
10857
10858            // Zero reserved fields.
10859            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10860
10861            // Safety:
10862            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10863            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10864            //   envelope_size bytes, there is always sufficient room.
10865            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect>(
10866            self.test_case_filters.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024> as fidl::encoding::ValueTypeMarker>::borrow),
10867            encoder, offset + cur_offset, depth
10868        )?;
10869
10870            _prev_end_offset = cur_offset + envelope_size;
10871            if 7 > max_ordinal {
10872                return Ok(());
10873            }
10874
10875            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10876            // are envelope_size bytes.
10877            let cur_offset: usize = (7 - 1) * envelope_size;
10878
10879            // Zero reserved fields.
10880            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10881
10882            // Safety:
10883            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10884            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10885            //   envelope_size bytes, there is always sufficient room.
10886            fidl::encoding::encode_in_envelope_optional::<
10887                LogsIteratorType,
10888                fidl::encoding::DefaultFuchsiaResourceDialect,
10889            >(
10890                self.logs_iterator_type
10891                    .as_ref()
10892                    .map(<LogsIteratorType as fidl::encoding::ValueTypeMarker>::borrow),
10893                encoder,
10894                offset + cur_offset,
10895                depth,
10896            )?;
10897
10898            _prev_end_offset = cur_offset + envelope_size;
10899            if 8 > max_ordinal {
10900                return Ok(());
10901            }
10902
10903            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10904            // are envelope_size bytes.
10905            let cur_offset: usize = (8 - 1) * envelope_size;
10906
10907            // Zero reserved fields.
10908            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10909
10910            // Safety:
10911            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10912            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10913            //   envelope_size bytes, there is always sufficient room.
10914            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
10915            self.log_interest.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64> as fidl::encoding::ValueTypeMarker>::borrow),
10916            encoder, offset + cur_offset, depth
10917        )?;
10918
10919            _prev_end_offset = cur_offset + envelope_size;
10920            if 9 > max_ordinal {
10921                return Ok(());
10922            }
10923
10924            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10925            // are envelope_size bytes.
10926            let cur_offset: usize = (9 - 1) * envelope_size;
10927
10928            // Zero reserved fields.
10929            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10930
10931            // Safety:
10932            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10933            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10934            //   envelope_size bytes, there is always sufficient room.
10935            fidl::encoding::encode_in_envelope_optional::<
10936                bool,
10937                fidl::encoding::DefaultFuchsiaResourceDialect,
10938            >(
10939                self.accumulate_debug_data
10940                    .as_ref()
10941                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10942                encoder,
10943                offset + cur_offset,
10944                depth,
10945            )?;
10946
10947            _prev_end_offset = cur_offset + envelope_size;
10948            if 10 > max_ordinal {
10949                return Ok(());
10950            }
10951
10952            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10953            // are envelope_size bytes.
10954            let cur_offset: usize = (10 - 1) * envelope_size;
10955
10956            // Zero reserved fields.
10957            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10958
10959            // Safety:
10960            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10961            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10962            //   envelope_size bytes, there is always sufficient room.
10963            fidl::encoding::encode_in_envelope_optional::<
10964                bool,
10965                fidl::encoding::DefaultFuchsiaResourceDialect,
10966            >(
10967                self.no_exception_channel
10968                    .as_ref()
10969                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10970                encoder,
10971                offset + cur_offset,
10972                depth,
10973            )?;
10974
10975            _prev_end_offset = cur_offset + envelope_size;
10976            if 11 > max_ordinal {
10977                return Ok(());
10978            }
10979
10980            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10981            // are envelope_size bytes.
10982            let cur_offset: usize = (11 - 1) * envelope_size;
10983
10984            // Zero reserved fields.
10985            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10986
10987            // Safety:
10988            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10989            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10990            //   envelope_size bytes, there is always sufficient room.
10991            fidl::encoding::encode_in_envelope_optional::<
10992                bool,
10993                fidl::encoding::DefaultFuchsiaResourceDialect,
10994            >(
10995                self.break_on_failure
10996                    .as_ref()
10997                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10998                encoder,
10999                offset + cur_offset,
11000                depth,
11001            )?;
11002
11003            _prev_end_offset = cur_offset + envelope_size;
11004
11005            Ok(())
11006        }
11007    }
11008
11009    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11010        for RunSuiteOptions
11011    {
11012        #[inline(always)]
11013        fn new_empty() -> Self {
11014            Self::default()
11015        }
11016
11017        unsafe fn decode(
11018            &mut self,
11019            decoder: &mut fidl::encoding::Decoder<
11020                '_,
11021                fidl::encoding::DefaultFuchsiaResourceDialect,
11022            >,
11023            offset: usize,
11024            mut depth: fidl::encoding::Depth,
11025        ) -> fidl::Result<()> {
11026            decoder.debug_check_bounds::<Self>(offset);
11027            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11028                None => return Err(fidl::Error::NotNullable),
11029                Some(len) => len,
11030            };
11031            // Calling decoder.out_of_line_offset(0) is not allowed.
11032            if len == 0 {
11033                return Ok(());
11034            };
11035            depth.increment()?;
11036            let envelope_size = 8;
11037            let bytes_len = len * envelope_size;
11038            let offset = decoder.out_of_line_offset(bytes_len)?;
11039            // Decode the envelope for each type.
11040            let mut _next_ordinal_to_read = 0;
11041            let mut next_offset = offset;
11042            let end_offset = offset + bytes_len;
11043            _next_ordinal_to_read += 1;
11044            if next_offset >= end_offset {
11045                return Ok(());
11046            }
11047
11048            // Decode unknown envelopes for gaps in ordinals.
11049            while _next_ordinal_to_read < 1 {
11050                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11051                _next_ordinal_to_read += 1;
11052                next_offset += envelope_size;
11053            }
11054
11055            let next_out_of_line = decoder.next_out_of_line();
11056            let handles_before = decoder.remaining_handles();
11057            if let Some((inlined, num_bytes, num_handles)) =
11058                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11059            {
11060                let member_inline_size =
11061                    <RealmOptions as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11062                if inlined != (member_inline_size <= 4) {
11063                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11064                }
11065                let inner_offset;
11066                let mut inner_depth = depth.clone();
11067                if inlined {
11068                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11069                    inner_offset = next_offset;
11070                } else {
11071                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11072                    inner_depth.increment()?;
11073                }
11074                let val_ref = self.realm_options.get_or_insert_with(|| {
11075                    fidl::new_empty!(RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect)
11076                });
11077                fidl::decode!(
11078                    RealmOptions,
11079                    fidl::encoding::DefaultFuchsiaResourceDialect,
11080                    val_ref,
11081                    decoder,
11082                    inner_offset,
11083                    inner_depth
11084                )?;
11085                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11086                {
11087                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11088                }
11089                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11090                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11091                }
11092            }
11093
11094            next_offset += envelope_size;
11095            _next_ordinal_to_read += 1;
11096            if next_offset >= end_offset {
11097                return Ok(());
11098            }
11099
11100            // Decode unknown envelopes for gaps in ordinals.
11101            while _next_ordinal_to_read < 2 {
11102                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11103                _next_ordinal_to_read += 1;
11104                next_offset += envelope_size;
11105            }
11106
11107            let next_out_of_line = decoder.next_out_of_line();
11108            let handles_before = decoder.remaining_handles();
11109            if let Some((inlined, num_bytes, num_handles)) =
11110                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11111            {
11112                let member_inline_size =
11113                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11114                if inlined != (member_inline_size <= 4) {
11115                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11116                }
11117                let inner_offset;
11118                let mut inner_depth = depth.clone();
11119                if inlined {
11120                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11121                    inner_offset = next_offset;
11122                } else {
11123                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11124                    inner_depth.increment()?;
11125                }
11126                let val_ref = self.run_disabled_tests.get_or_insert_with(|| {
11127                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11128                });
11129                fidl::decode!(
11130                    bool,
11131                    fidl::encoding::DefaultFuchsiaResourceDialect,
11132                    val_ref,
11133                    decoder,
11134                    inner_offset,
11135                    inner_depth
11136                )?;
11137                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11138                {
11139                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11140                }
11141                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11142                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11143                }
11144            }
11145
11146            next_offset += envelope_size;
11147            _next_ordinal_to_read += 1;
11148            if next_offset >= end_offset {
11149                return Ok(());
11150            }
11151
11152            // Decode unknown envelopes for gaps in ordinals.
11153            while _next_ordinal_to_read < 3 {
11154                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11155                _next_ordinal_to_read += 1;
11156                next_offset += envelope_size;
11157            }
11158
11159            let next_out_of_line = decoder.next_out_of_line();
11160            let handles_before = decoder.remaining_handles();
11161            if let Some((inlined, num_bytes, num_handles)) =
11162                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11163            {
11164                let member_inline_size =
11165                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11166                if inlined != (member_inline_size <= 4) {
11167                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11168                }
11169                let inner_offset;
11170                let mut inner_depth = depth.clone();
11171                if inlined {
11172                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11173                    inner_offset = next_offset;
11174                } else {
11175                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11176                    inner_depth.increment()?;
11177                }
11178                let val_ref = self.max_concurrent_test_case_runs.get_or_insert_with(|| {
11179                    fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect)
11180                });
11181                fidl::decode!(
11182                    u16,
11183                    fidl::encoding::DefaultFuchsiaResourceDialect,
11184                    val_ref,
11185                    decoder,
11186                    inner_offset,
11187                    inner_depth
11188                )?;
11189                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11190                {
11191                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11192                }
11193                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11194                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11195                }
11196            }
11197
11198            next_offset += envelope_size;
11199            _next_ordinal_to_read += 1;
11200            if next_offset >= end_offset {
11201                return Ok(());
11202            }
11203
11204            // Decode unknown envelopes for gaps in ordinals.
11205            while _next_ordinal_to_read < 4 {
11206                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11207                _next_ordinal_to_read += 1;
11208                next_offset += envelope_size;
11209            }
11210
11211            let next_out_of_line = decoder.next_out_of_line();
11212            let handles_before = decoder.remaining_handles();
11213            if let Some((inlined, num_bytes, num_handles)) =
11214                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11215            {
11216                let member_inline_size = <fidl::encoding::Vector<
11217                    fidl::encoding::BoundedString<1024>,
11218                    4095,
11219                > as fidl::encoding::TypeMarker>::inline_size(
11220                    decoder.context
11221                );
11222                if inlined != (member_inline_size <= 4) {
11223                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11224                }
11225                let inner_offset;
11226                let mut inner_depth = depth.clone();
11227                if inlined {
11228                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11229                    inner_offset = next_offset;
11230                } else {
11231                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11232                    inner_depth.increment()?;
11233                }
11234                let val_ref = self.arguments.get_or_insert_with(|| {
11235                    fidl::new_empty!(
11236                        fidl::encoding::Vector<fidl::encoding::BoundedString<1024>, 4095>,
11237                        fidl::encoding::DefaultFuchsiaResourceDialect
11238                    )
11239                });
11240                fidl::decode!(
11241                    fidl::encoding::Vector<fidl::encoding::BoundedString<1024>, 4095>,
11242                    fidl::encoding::DefaultFuchsiaResourceDialect,
11243                    val_ref,
11244                    decoder,
11245                    inner_offset,
11246                    inner_depth
11247                )?;
11248                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11249                {
11250                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11251                }
11252                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11253                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11254                }
11255            }
11256
11257            next_offset += envelope_size;
11258            _next_ordinal_to_read += 1;
11259            if next_offset >= end_offset {
11260                return Ok(());
11261            }
11262
11263            // Decode unknown envelopes for gaps in ordinals.
11264            while _next_ordinal_to_read < 5 {
11265                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11266                _next_ordinal_to_read += 1;
11267                next_offset += envelope_size;
11268            }
11269
11270            let next_out_of_line = decoder.next_out_of_line();
11271            let handles_before = decoder.remaining_handles();
11272            if let Some((inlined, num_bytes, num_handles)) =
11273                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11274            {
11275                let member_inline_size =
11276                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11277                if inlined != (member_inline_size <= 4) {
11278                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11279                }
11280                let inner_offset;
11281                let mut inner_depth = depth.clone();
11282                if inlined {
11283                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11284                    inner_offset = next_offset;
11285                } else {
11286                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11287                    inner_depth.increment()?;
11288                }
11289                let val_ref = self.timeout.get_or_insert_with(|| {
11290                    fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
11291                });
11292                fidl::decode!(
11293                    i64,
11294                    fidl::encoding::DefaultFuchsiaResourceDialect,
11295                    val_ref,
11296                    decoder,
11297                    inner_offset,
11298                    inner_depth
11299                )?;
11300                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11301                {
11302                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11303                }
11304                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11305                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11306                }
11307            }
11308
11309            next_offset += envelope_size;
11310            _next_ordinal_to_read += 1;
11311            if next_offset >= end_offset {
11312                return Ok(());
11313            }
11314
11315            // Decode unknown envelopes for gaps in ordinals.
11316            while _next_ordinal_to_read < 6 {
11317                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11318                _next_ordinal_to_read += 1;
11319                next_offset += envelope_size;
11320            }
11321
11322            let next_out_of_line = decoder.next_out_of_line();
11323            let handles_before = decoder.remaining_handles();
11324            if let Some((inlined, num_bytes, num_handles)) =
11325                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11326            {
11327                let member_inline_size = <fidl::encoding::Vector<
11328                    fidl::encoding::BoundedString<4096>,
11329                    1024,
11330                > as fidl::encoding::TypeMarker>::inline_size(
11331                    decoder.context
11332                );
11333                if inlined != (member_inline_size <= 4) {
11334                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11335                }
11336                let inner_offset;
11337                let mut inner_depth = depth.clone();
11338                if inlined {
11339                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11340                    inner_offset = next_offset;
11341                } else {
11342                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11343                    inner_depth.increment()?;
11344                }
11345                let val_ref = self.test_case_filters.get_or_insert_with(|| {
11346                    fidl::new_empty!(
11347                        fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024>,
11348                        fidl::encoding::DefaultFuchsiaResourceDialect
11349                    )
11350                });
11351                fidl::decode!(
11352                    fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024>,
11353                    fidl::encoding::DefaultFuchsiaResourceDialect,
11354                    val_ref,
11355                    decoder,
11356                    inner_offset,
11357                    inner_depth
11358                )?;
11359                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11360                {
11361                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11362                }
11363                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11364                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11365                }
11366            }
11367
11368            next_offset += envelope_size;
11369            _next_ordinal_to_read += 1;
11370            if next_offset >= end_offset {
11371                return Ok(());
11372            }
11373
11374            // Decode unknown envelopes for gaps in ordinals.
11375            while _next_ordinal_to_read < 7 {
11376                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11377                _next_ordinal_to_read += 1;
11378                next_offset += envelope_size;
11379            }
11380
11381            let next_out_of_line = decoder.next_out_of_line();
11382            let handles_before = decoder.remaining_handles();
11383            if let Some((inlined, num_bytes, num_handles)) =
11384                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11385            {
11386                let member_inline_size =
11387                    <LogsIteratorType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11388                if inlined != (member_inline_size <= 4) {
11389                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11390                }
11391                let inner_offset;
11392                let mut inner_depth = depth.clone();
11393                if inlined {
11394                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11395                    inner_offset = next_offset;
11396                } else {
11397                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11398                    inner_depth.increment()?;
11399                }
11400                let val_ref = self.logs_iterator_type.get_or_insert_with(|| {
11401                    fidl::new_empty!(
11402                        LogsIteratorType,
11403                        fidl::encoding::DefaultFuchsiaResourceDialect
11404                    )
11405                });
11406                fidl::decode!(
11407                    LogsIteratorType,
11408                    fidl::encoding::DefaultFuchsiaResourceDialect,
11409                    val_ref,
11410                    decoder,
11411                    inner_offset,
11412                    inner_depth
11413                )?;
11414                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11415                {
11416                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11417                }
11418                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11419                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11420                }
11421            }
11422
11423            next_offset += envelope_size;
11424            _next_ordinal_to_read += 1;
11425            if next_offset >= end_offset {
11426                return Ok(());
11427            }
11428
11429            // Decode unknown envelopes for gaps in ordinals.
11430            while _next_ordinal_to_read < 8 {
11431                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11432                _next_ordinal_to_read += 1;
11433                next_offset += envelope_size;
11434            }
11435
11436            let next_out_of_line = decoder.next_out_of_line();
11437            let handles_before = decoder.remaining_handles();
11438            if let Some((inlined, num_bytes, num_handles)) =
11439                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11440            {
11441                let member_inline_size = <fidl::encoding::Vector<
11442                    fidl_fuchsia_diagnostics::LogInterestSelector,
11443                    64,
11444                > as fidl::encoding::TypeMarker>::inline_size(
11445                    decoder.context
11446                );
11447                if inlined != (member_inline_size <= 4) {
11448                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11449                }
11450                let inner_offset;
11451                let mut inner_depth = depth.clone();
11452                if inlined {
11453                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11454                    inner_offset = next_offset;
11455                } else {
11456                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11457                    inner_depth.increment()?;
11458                }
11459                let val_ref =
11460                self.log_interest.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
11461                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
11462                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11463                {
11464                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11465                }
11466                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11467                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11468                }
11469            }
11470
11471            next_offset += envelope_size;
11472            _next_ordinal_to_read += 1;
11473            if next_offset >= end_offset {
11474                return Ok(());
11475            }
11476
11477            // Decode unknown envelopes for gaps in ordinals.
11478            while _next_ordinal_to_read < 9 {
11479                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11480                _next_ordinal_to_read += 1;
11481                next_offset += envelope_size;
11482            }
11483
11484            let next_out_of_line = decoder.next_out_of_line();
11485            let handles_before = decoder.remaining_handles();
11486            if let Some((inlined, num_bytes, num_handles)) =
11487                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11488            {
11489                let member_inline_size =
11490                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11491                if inlined != (member_inline_size <= 4) {
11492                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11493                }
11494                let inner_offset;
11495                let mut inner_depth = depth.clone();
11496                if inlined {
11497                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11498                    inner_offset = next_offset;
11499                } else {
11500                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11501                    inner_depth.increment()?;
11502                }
11503                let val_ref = self.accumulate_debug_data.get_or_insert_with(|| {
11504                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11505                });
11506                fidl::decode!(
11507                    bool,
11508                    fidl::encoding::DefaultFuchsiaResourceDialect,
11509                    val_ref,
11510                    decoder,
11511                    inner_offset,
11512                    inner_depth
11513                )?;
11514                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11515                {
11516                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11517                }
11518                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11519                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11520                }
11521            }
11522
11523            next_offset += envelope_size;
11524            _next_ordinal_to_read += 1;
11525            if next_offset >= end_offset {
11526                return Ok(());
11527            }
11528
11529            // Decode unknown envelopes for gaps in ordinals.
11530            while _next_ordinal_to_read < 10 {
11531                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11532                _next_ordinal_to_read += 1;
11533                next_offset += envelope_size;
11534            }
11535
11536            let next_out_of_line = decoder.next_out_of_line();
11537            let handles_before = decoder.remaining_handles();
11538            if let Some((inlined, num_bytes, num_handles)) =
11539                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11540            {
11541                let member_inline_size =
11542                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11543                if inlined != (member_inline_size <= 4) {
11544                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11545                }
11546                let inner_offset;
11547                let mut inner_depth = depth.clone();
11548                if inlined {
11549                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11550                    inner_offset = next_offset;
11551                } else {
11552                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11553                    inner_depth.increment()?;
11554                }
11555                let val_ref = self.no_exception_channel.get_or_insert_with(|| {
11556                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11557                });
11558                fidl::decode!(
11559                    bool,
11560                    fidl::encoding::DefaultFuchsiaResourceDialect,
11561                    val_ref,
11562                    decoder,
11563                    inner_offset,
11564                    inner_depth
11565                )?;
11566                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11567                {
11568                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11569                }
11570                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11571                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11572                }
11573            }
11574
11575            next_offset += envelope_size;
11576            _next_ordinal_to_read += 1;
11577            if next_offset >= end_offset {
11578                return Ok(());
11579            }
11580
11581            // Decode unknown envelopes for gaps in ordinals.
11582            while _next_ordinal_to_read < 11 {
11583                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11584                _next_ordinal_to_read += 1;
11585                next_offset += envelope_size;
11586            }
11587
11588            let next_out_of_line = decoder.next_out_of_line();
11589            let handles_before = decoder.remaining_handles();
11590            if let Some((inlined, num_bytes, num_handles)) =
11591                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11592            {
11593                let member_inline_size =
11594                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11595                if inlined != (member_inline_size <= 4) {
11596                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11597                }
11598                let inner_offset;
11599                let mut inner_depth = depth.clone();
11600                if inlined {
11601                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11602                    inner_offset = next_offset;
11603                } else {
11604                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11605                    inner_depth.increment()?;
11606                }
11607                let val_ref = self.break_on_failure.get_or_insert_with(|| {
11608                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11609                });
11610                fidl::decode!(
11611                    bool,
11612                    fidl::encoding::DefaultFuchsiaResourceDialect,
11613                    val_ref,
11614                    decoder,
11615                    inner_offset,
11616                    inner_depth
11617                )?;
11618                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11619                {
11620                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11621                }
11622                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11623                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11624                }
11625            }
11626
11627            next_offset += envelope_size;
11628
11629            // Decode the remaining unknown envelopes.
11630            while next_offset < end_offset {
11631                _next_ordinal_to_read += 1;
11632                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11633                next_offset += envelope_size;
11634            }
11635
11636            Ok(())
11637        }
11638    }
11639
11640    impl SuiteArtifactGeneratedEventDetails {
11641        #[inline(always)]
11642        fn max_ordinal_present(&self) -> u64 {
11643            if let Some(_) = self.artifact {
11644                return 1;
11645            }
11646            0
11647        }
11648    }
11649
11650    impl fidl::encoding::ResourceTypeMarker for SuiteArtifactGeneratedEventDetails {
11651        type Borrowed<'a> = &'a mut Self;
11652        fn take_or_borrow<'a>(
11653            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11654        ) -> Self::Borrowed<'a> {
11655            value
11656        }
11657    }
11658
11659    unsafe impl fidl::encoding::TypeMarker for SuiteArtifactGeneratedEventDetails {
11660        type Owned = Self;
11661
11662        #[inline(always)]
11663        fn inline_align(_context: fidl::encoding::Context) -> usize {
11664            8
11665        }
11666
11667        #[inline(always)]
11668        fn inline_size(_context: fidl::encoding::Context) -> usize {
11669            16
11670        }
11671    }
11672
11673    unsafe impl
11674        fidl::encoding::Encode<
11675            SuiteArtifactGeneratedEventDetails,
11676            fidl::encoding::DefaultFuchsiaResourceDialect,
11677        > for &mut SuiteArtifactGeneratedEventDetails
11678    {
11679        unsafe fn encode(
11680            self,
11681            encoder: &mut fidl::encoding::Encoder<
11682                '_,
11683                fidl::encoding::DefaultFuchsiaResourceDialect,
11684            >,
11685            offset: usize,
11686            mut depth: fidl::encoding::Depth,
11687        ) -> fidl::Result<()> {
11688            encoder.debug_check_bounds::<SuiteArtifactGeneratedEventDetails>(offset);
11689            // Vector header
11690            let max_ordinal: u64 = self.max_ordinal_present();
11691            encoder.write_num(max_ordinal, offset);
11692            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11693            // Calling encoder.out_of_line_offset(0) is not allowed.
11694            if max_ordinal == 0 {
11695                return Ok(());
11696            }
11697            depth.increment()?;
11698            let envelope_size = 8;
11699            let bytes_len = max_ordinal as usize * envelope_size;
11700            #[allow(unused_variables)]
11701            let offset = encoder.out_of_line_offset(bytes_len);
11702            let mut _prev_end_offset: usize = 0;
11703            if 1 > max_ordinal {
11704                return Ok(());
11705            }
11706
11707            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11708            // are envelope_size bytes.
11709            let cur_offset: usize = (1 - 1) * envelope_size;
11710
11711            // Zero reserved fields.
11712            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11713
11714            // Safety:
11715            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11716            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11717            //   envelope_size bytes, there is always sufficient room.
11718            fidl::encoding::encode_in_envelope_optional::<
11719                Artifact,
11720                fidl::encoding::DefaultFuchsiaResourceDialect,
11721            >(
11722                self.artifact
11723                    .as_mut()
11724                    .map(<Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11725                encoder,
11726                offset + cur_offset,
11727                depth,
11728            )?;
11729
11730            _prev_end_offset = cur_offset + envelope_size;
11731
11732            Ok(())
11733        }
11734    }
11735
11736    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11737        for SuiteArtifactGeneratedEventDetails
11738    {
11739        #[inline(always)]
11740        fn new_empty() -> Self {
11741            Self::default()
11742        }
11743
11744        unsafe fn decode(
11745            &mut self,
11746            decoder: &mut fidl::encoding::Decoder<
11747                '_,
11748                fidl::encoding::DefaultFuchsiaResourceDialect,
11749            >,
11750            offset: usize,
11751            mut depth: fidl::encoding::Depth,
11752        ) -> fidl::Result<()> {
11753            decoder.debug_check_bounds::<Self>(offset);
11754            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11755                None => return Err(fidl::Error::NotNullable),
11756                Some(len) => len,
11757            };
11758            // Calling decoder.out_of_line_offset(0) is not allowed.
11759            if len == 0 {
11760                return Ok(());
11761            };
11762            depth.increment()?;
11763            let envelope_size = 8;
11764            let bytes_len = len * envelope_size;
11765            let offset = decoder.out_of_line_offset(bytes_len)?;
11766            // Decode the envelope for each type.
11767            let mut _next_ordinal_to_read = 0;
11768            let mut next_offset = offset;
11769            let end_offset = offset + bytes_len;
11770            _next_ordinal_to_read += 1;
11771            if next_offset >= end_offset {
11772                return Ok(());
11773            }
11774
11775            // Decode unknown envelopes for gaps in ordinals.
11776            while _next_ordinal_to_read < 1 {
11777                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11778                _next_ordinal_to_read += 1;
11779                next_offset += envelope_size;
11780            }
11781
11782            let next_out_of_line = decoder.next_out_of_line();
11783            let handles_before = decoder.remaining_handles();
11784            if let Some((inlined, num_bytes, num_handles)) =
11785                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11786            {
11787                let member_inline_size =
11788                    <Artifact as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11789                if inlined != (member_inline_size <= 4) {
11790                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11791                }
11792                let inner_offset;
11793                let mut inner_depth = depth.clone();
11794                if inlined {
11795                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11796                    inner_offset = next_offset;
11797                } else {
11798                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11799                    inner_depth.increment()?;
11800                }
11801                let val_ref = self.artifact.get_or_insert_with(|| {
11802                    fidl::new_empty!(Artifact, fidl::encoding::DefaultFuchsiaResourceDialect)
11803                });
11804                fidl::decode!(
11805                    Artifact,
11806                    fidl::encoding::DefaultFuchsiaResourceDialect,
11807                    val_ref,
11808                    decoder,
11809                    inner_offset,
11810                    inner_depth
11811                )?;
11812                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11813                {
11814                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11815                }
11816                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11817                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11818                }
11819            }
11820
11821            next_offset += envelope_size;
11822
11823            // Decode the remaining unknown envelopes.
11824            while next_offset < end_offset {
11825                _next_ordinal_to_read += 1;
11826                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11827                next_offset += envelope_size;
11828            }
11829
11830            Ok(())
11831        }
11832    }
11833
11834    impl SuiteEvent {
11835        #[inline(always)]
11836        fn max_ordinal_present(&self) -> u64 {
11837            if let Some(_) = self.payload {
11838                return 2;
11839            }
11840            if let Some(_) = self.timestamp {
11841                return 1;
11842            }
11843            0
11844        }
11845    }
11846
11847    impl fidl::encoding::ResourceTypeMarker for SuiteEvent {
11848        type Borrowed<'a> = &'a mut Self;
11849        fn take_or_borrow<'a>(
11850            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11851        ) -> Self::Borrowed<'a> {
11852            value
11853        }
11854    }
11855
11856    unsafe impl fidl::encoding::TypeMarker for SuiteEvent {
11857        type Owned = Self;
11858
11859        #[inline(always)]
11860        fn inline_align(_context: fidl::encoding::Context) -> usize {
11861            8
11862        }
11863
11864        #[inline(always)]
11865        fn inline_size(_context: fidl::encoding::Context) -> usize {
11866            16
11867        }
11868    }
11869
11870    unsafe impl fidl::encoding::Encode<SuiteEvent, fidl::encoding::DefaultFuchsiaResourceDialect>
11871        for &mut SuiteEvent
11872    {
11873        unsafe fn encode(
11874            self,
11875            encoder: &mut fidl::encoding::Encoder<
11876                '_,
11877                fidl::encoding::DefaultFuchsiaResourceDialect,
11878            >,
11879            offset: usize,
11880            mut depth: fidl::encoding::Depth,
11881        ) -> fidl::Result<()> {
11882            encoder.debug_check_bounds::<SuiteEvent>(offset);
11883            // Vector header
11884            let max_ordinal: u64 = self.max_ordinal_present();
11885            encoder.write_num(max_ordinal, offset);
11886            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11887            // Calling encoder.out_of_line_offset(0) is not allowed.
11888            if max_ordinal == 0 {
11889                return Ok(());
11890            }
11891            depth.increment()?;
11892            let envelope_size = 8;
11893            let bytes_len = max_ordinal as usize * envelope_size;
11894            #[allow(unused_variables)]
11895            let offset = encoder.out_of_line_offset(bytes_len);
11896            let mut _prev_end_offset: usize = 0;
11897            if 1 > max_ordinal {
11898                return Ok(());
11899            }
11900
11901            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11902            // are envelope_size bytes.
11903            let cur_offset: usize = (1 - 1) * envelope_size;
11904
11905            // Zero reserved fields.
11906            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11907
11908            // Safety:
11909            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11910            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11911            //   envelope_size bytes, there is always sufficient room.
11912            fidl::encoding::encode_in_envelope_optional::<
11913                i64,
11914                fidl::encoding::DefaultFuchsiaResourceDialect,
11915            >(
11916                self.timestamp.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
11917                encoder,
11918                offset + cur_offset,
11919                depth,
11920            )?;
11921
11922            _prev_end_offset = cur_offset + envelope_size;
11923            if 2 > max_ordinal {
11924                return Ok(());
11925            }
11926
11927            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11928            // are envelope_size bytes.
11929            let cur_offset: usize = (2 - 1) * envelope_size;
11930
11931            // Zero reserved fields.
11932            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11933
11934            // Safety:
11935            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11936            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11937            //   envelope_size bytes, there is always sufficient room.
11938            fidl::encoding::encode_in_envelope_optional::<
11939                SuiteEventPayload,
11940                fidl::encoding::DefaultFuchsiaResourceDialect,
11941            >(
11942                self.payload
11943                    .as_mut()
11944                    .map(<SuiteEventPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11945                encoder,
11946                offset + cur_offset,
11947                depth,
11948            )?;
11949
11950            _prev_end_offset = cur_offset + envelope_size;
11951
11952            Ok(())
11953        }
11954    }
11955
11956    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for SuiteEvent {
11957        #[inline(always)]
11958        fn new_empty() -> Self {
11959            Self::default()
11960        }
11961
11962        unsafe fn decode(
11963            &mut self,
11964            decoder: &mut fidl::encoding::Decoder<
11965                '_,
11966                fidl::encoding::DefaultFuchsiaResourceDialect,
11967            >,
11968            offset: usize,
11969            mut depth: fidl::encoding::Depth,
11970        ) -> fidl::Result<()> {
11971            decoder.debug_check_bounds::<Self>(offset);
11972            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11973                None => return Err(fidl::Error::NotNullable),
11974                Some(len) => len,
11975            };
11976            // Calling decoder.out_of_line_offset(0) is not allowed.
11977            if len == 0 {
11978                return Ok(());
11979            };
11980            depth.increment()?;
11981            let envelope_size = 8;
11982            let bytes_len = len * envelope_size;
11983            let offset = decoder.out_of_line_offset(bytes_len)?;
11984            // Decode the envelope for each type.
11985            let mut _next_ordinal_to_read = 0;
11986            let mut next_offset = offset;
11987            let end_offset = offset + bytes_len;
11988            _next_ordinal_to_read += 1;
11989            if next_offset >= end_offset {
11990                return Ok(());
11991            }
11992
11993            // Decode unknown envelopes for gaps in ordinals.
11994            while _next_ordinal_to_read < 1 {
11995                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11996                _next_ordinal_to_read += 1;
11997                next_offset += envelope_size;
11998            }
11999
12000            let next_out_of_line = decoder.next_out_of_line();
12001            let handles_before = decoder.remaining_handles();
12002            if let Some((inlined, num_bytes, num_handles)) =
12003                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12004            {
12005                let member_inline_size =
12006                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12007                if inlined != (member_inline_size <= 4) {
12008                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12009                }
12010                let inner_offset;
12011                let mut inner_depth = depth.clone();
12012                if inlined {
12013                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12014                    inner_offset = next_offset;
12015                } else {
12016                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12017                    inner_depth.increment()?;
12018                }
12019                let val_ref = self.timestamp.get_or_insert_with(|| {
12020                    fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
12021                });
12022                fidl::decode!(
12023                    i64,
12024                    fidl::encoding::DefaultFuchsiaResourceDialect,
12025                    val_ref,
12026                    decoder,
12027                    inner_offset,
12028                    inner_depth
12029                )?;
12030                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12031                {
12032                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12033                }
12034                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12035                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12036                }
12037            }
12038
12039            next_offset += envelope_size;
12040            _next_ordinal_to_read += 1;
12041            if next_offset >= end_offset {
12042                return Ok(());
12043            }
12044
12045            // Decode unknown envelopes for gaps in ordinals.
12046            while _next_ordinal_to_read < 2 {
12047                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12048                _next_ordinal_to_read += 1;
12049                next_offset += envelope_size;
12050            }
12051
12052            let next_out_of_line = decoder.next_out_of_line();
12053            let handles_before = decoder.remaining_handles();
12054            if let Some((inlined, num_bytes, num_handles)) =
12055                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12056            {
12057                let member_inline_size =
12058                    <SuiteEventPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12059                if inlined != (member_inline_size <= 4) {
12060                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12061                }
12062                let inner_offset;
12063                let mut inner_depth = depth.clone();
12064                if inlined {
12065                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12066                    inner_offset = next_offset;
12067                } else {
12068                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12069                    inner_depth.increment()?;
12070                }
12071                let val_ref = self.payload.get_or_insert_with(|| {
12072                    fidl::new_empty!(
12073                        SuiteEventPayload,
12074                        fidl::encoding::DefaultFuchsiaResourceDialect
12075                    )
12076                });
12077                fidl::decode!(
12078                    SuiteEventPayload,
12079                    fidl::encoding::DefaultFuchsiaResourceDialect,
12080                    val_ref,
12081                    decoder,
12082                    inner_offset,
12083                    inner_depth
12084                )?;
12085                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12086                {
12087                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12088                }
12089                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12090                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12091                }
12092            }
12093
12094            next_offset += envelope_size;
12095
12096            // Decode the remaining unknown envelopes.
12097            while next_offset < end_offset {
12098                _next_ordinal_to_read += 1;
12099                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12100                next_offset += envelope_size;
12101            }
12102
12103            Ok(())
12104        }
12105    }
12106
12107    impl TestCaseArtifactGeneratedEventDetails {
12108        #[inline(always)]
12109        fn max_ordinal_present(&self) -> u64 {
12110            if let Some(_) = self.artifact {
12111                return 2;
12112            }
12113            if let Some(_) = self.test_case_id {
12114                return 1;
12115            }
12116            0
12117        }
12118    }
12119
12120    impl fidl::encoding::ResourceTypeMarker for TestCaseArtifactGeneratedEventDetails {
12121        type Borrowed<'a> = &'a mut Self;
12122        fn take_or_borrow<'a>(
12123            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12124        ) -> Self::Borrowed<'a> {
12125            value
12126        }
12127    }
12128
12129    unsafe impl fidl::encoding::TypeMarker for TestCaseArtifactGeneratedEventDetails {
12130        type Owned = Self;
12131
12132        #[inline(always)]
12133        fn inline_align(_context: fidl::encoding::Context) -> usize {
12134            8
12135        }
12136
12137        #[inline(always)]
12138        fn inline_size(_context: fidl::encoding::Context) -> usize {
12139            16
12140        }
12141    }
12142
12143    unsafe impl
12144        fidl::encoding::Encode<
12145            TestCaseArtifactGeneratedEventDetails,
12146            fidl::encoding::DefaultFuchsiaResourceDialect,
12147        > for &mut TestCaseArtifactGeneratedEventDetails
12148    {
12149        unsafe fn encode(
12150            self,
12151            encoder: &mut fidl::encoding::Encoder<
12152                '_,
12153                fidl::encoding::DefaultFuchsiaResourceDialect,
12154            >,
12155            offset: usize,
12156            mut depth: fidl::encoding::Depth,
12157        ) -> fidl::Result<()> {
12158            encoder.debug_check_bounds::<TestCaseArtifactGeneratedEventDetails>(offset);
12159            // Vector header
12160            let max_ordinal: u64 = self.max_ordinal_present();
12161            encoder.write_num(max_ordinal, offset);
12162            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12163            // Calling encoder.out_of_line_offset(0) is not allowed.
12164            if max_ordinal == 0 {
12165                return Ok(());
12166            }
12167            depth.increment()?;
12168            let envelope_size = 8;
12169            let bytes_len = max_ordinal as usize * envelope_size;
12170            #[allow(unused_variables)]
12171            let offset = encoder.out_of_line_offset(bytes_len);
12172            let mut _prev_end_offset: usize = 0;
12173            if 1 > max_ordinal {
12174                return Ok(());
12175            }
12176
12177            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12178            // are envelope_size bytes.
12179            let cur_offset: usize = (1 - 1) * envelope_size;
12180
12181            // Zero reserved fields.
12182            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12183
12184            // Safety:
12185            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12186            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12187            //   envelope_size bytes, there is always sufficient room.
12188            fidl::encoding::encode_in_envelope_optional::<
12189                u32,
12190                fidl::encoding::DefaultFuchsiaResourceDialect,
12191            >(
12192                self.test_case_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
12193                encoder,
12194                offset + cur_offset,
12195                depth,
12196            )?;
12197
12198            _prev_end_offset = cur_offset + envelope_size;
12199            if 2 > max_ordinal {
12200                return Ok(());
12201            }
12202
12203            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12204            // are envelope_size bytes.
12205            let cur_offset: usize = (2 - 1) * envelope_size;
12206
12207            // Zero reserved fields.
12208            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12209
12210            // Safety:
12211            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12212            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12213            //   envelope_size bytes, there is always sufficient room.
12214            fidl::encoding::encode_in_envelope_optional::<
12215                Artifact,
12216                fidl::encoding::DefaultFuchsiaResourceDialect,
12217            >(
12218                self.artifact
12219                    .as_mut()
12220                    .map(<Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12221                encoder,
12222                offset + cur_offset,
12223                depth,
12224            )?;
12225
12226            _prev_end_offset = cur_offset + envelope_size;
12227
12228            Ok(())
12229        }
12230    }
12231
12232    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12233        for TestCaseArtifactGeneratedEventDetails
12234    {
12235        #[inline(always)]
12236        fn new_empty() -> Self {
12237            Self::default()
12238        }
12239
12240        unsafe fn decode(
12241            &mut self,
12242            decoder: &mut fidl::encoding::Decoder<
12243                '_,
12244                fidl::encoding::DefaultFuchsiaResourceDialect,
12245            >,
12246            offset: usize,
12247            mut depth: fidl::encoding::Depth,
12248        ) -> fidl::Result<()> {
12249            decoder.debug_check_bounds::<Self>(offset);
12250            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12251                None => return Err(fidl::Error::NotNullable),
12252                Some(len) => len,
12253            };
12254            // Calling decoder.out_of_line_offset(0) is not allowed.
12255            if len == 0 {
12256                return Ok(());
12257            };
12258            depth.increment()?;
12259            let envelope_size = 8;
12260            let bytes_len = len * envelope_size;
12261            let offset = decoder.out_of_line_offset(bytes_len)?;
12262            // Decode the envelope for each type.
12263            let mut _next_ordinal_to_read = 0;
12264            let mut next_offset = offset;
12265            let end_offset = offset + bytes_len;
12266            _next_ordinal_to_read += 1;
12267            if next_offset >= end_offset {
12268                return Ok(());
12269            }
12270
12271            // Decode unknown envelopes for gaps in ordinals.
12272            while _next_ordinal_to_read < 1 {
12273                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12274                _next_ordinal_to_read += 1;
12275                next_offset += envelope_size;
12276            }
12277
12278            let next_out_of_line = decoder.next_out_of_line();
12279            let handles_before = decoder.remaining_handles();
12280            if let Some((inlined, num_bytes, num_handles)) =
12281                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12282            {
12283                let member_inline_size =
12284                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12285                if inlined != (member_inline_size <= 4) {
12286                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12287                }
12288                let inner_offset;
12289                let mut inner_depth = depth.clone();
12290                if inlined {
12291                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12292                    inner_offset = next_offset;
12293                } else {
12294                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12295                    inner_depth.increment()?;
12296                }
12297                let val_ref = self.test_case_id.get_or_insert_with(|| {
12298                    fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
12299                });
12300                fidl::decode!(
12301                    u32,
12302                    fidl::encoding::DefaultFuchsiaResourceDialect,
12303                    val_ref,
12304                    decoder,
12305                    inner_offset,
12306                    inner_depth
12307                )?;
12308                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12309                {
12310                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12311                }
12312                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12313                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12314                }
12315            }
12316
12317            next_offset += envelope_size;
12318            _next_ordinal_to_read += 1;
12319            if next_offset >= end_offset {
12320                return Ok(());
12321            }
12322
12323            // Decode unknown envelopes for gaps in ordinals.
12324            while _next_ordinal_to_read < 2 {
12325                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12326                _next_ordinal_to_read += 1;
12327                next_offset += envelope_size;
12328            }
12329
12330            let next_out_of_line = decoder.next_out_of_line();
12331            let handles_before = decoder.remaining_handles();
12332            if let Some((inlined, num_bytes, num_handles)) =
12333                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12334            {
12335                let member_inline_size =
12336                    <Artifact as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12337                if inlined != (member_inline_size <= 4) {
12338                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12339                }
12340                let inner_offset;
12341                let mut inner_depth = depth.clone();
12342                if inlined {
12343                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12344                    inner_offset = next_offset;
12345                } else {
12346                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12347                    inner_depth.increment()?;
12348                }
12349                let val_ref = self.artifact.get_or_insert_with(|| {
12350                    fidl::new_empty!(Artifact, fidl::encoding::DefaultFuchsiaResourceDialect)
12351                });
12352                fidl::decode!(
12353                    Artifact,
12354                    fidl::encoding::DefaultFuchsiaResourceDialect,
12355                    val_ref,
12356                    decoder,
12357                    inner_offset,
12358                    inner_depth
12359                )?;
12360                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12361                {
12362                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12363                }
12364                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12365                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12366                }
12367            }
12368
12369            next_offset += envelope_size;
12370
12371            // Decode the remaining unknown envelopes.
12372            while next_offset < end_offset {
12373                _next_ordinal_to_read += 1;
12374                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12375                next_offset += envelope_size;
12376            }
12377
12378            Ok(())
12379        }
12380    }
12381
12382    impl fidl::encoding::ResourceTypeMarker for Artifact {
12383        type Borrowed<'a> = &'a mut Self;
12384        fn take_or_borrow<'a>(
12385            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12386        ) -> Self::Borrowed<'a> {
12387            value
12388        }
12389    }
12390
12391    unsafe impl fidl::encoding::TypeMarker for Artifact {
12392        type Owned = Self;
12393
12394        #[inline(always)]
12395        fn inline_align(_context: fidl::encoding::Context) -> usize {
12396            8
12397        }
12398
12399        #[inline(always)]
12400        fn inline_size(_context: fidl::encoding::Context) -> usize {
12401            16
12402        }
12403    }
12404
12405    unsafe impl fidl::encoding::Encode<Artifact, fidl::encoding::DefaultFuchsiaResourceDialect>
12406        for &mut Artifact
12407    {
12408        #[inline]
12409        unsafe fn encode(
12410            self,
12411            encoder: &mut fidl::encoding::Encoder<
12412                '_,
12413                fidl::encoding::DefaultFuchsiaResourceDialect,
12414            >,
12415            offset: usize,
12416            _depth: fidl::encoding::Depth,
12417        ) -> fidl::Result<()> {
12418            encoder.debug_check_bounds::<Artifact>(offset);
12419            encoder.write_num::<u64>(self.ordinal(), offset);
12420            match self {
12421                Artifact::Stdout(ref mut val) => fidl::encoding::encode_in_envelope::<
12422                    fidl::encoding::HandleType<
12423                        fidl::Socket,
12424                        { fidl::ObjectType::SOCKET.into_raw() },
12425                        2147483648,
12426                    >,
12427                    fidl::encoding::DefaultFuchsiaResourceDialect,
12428                >(
12429                    <fidl::encoding::HandleType<
12430                        fidl::Socket,
12431                        { fidl::ObjectType::SOCKET.into_raw() },
12432                        2147483648,
12433                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12434                        val
12435                    ),
12436                    encoder,
12437                    offset + 8,
12438                    _depth,
12439                ),
12440                Artifact::Stderr(ref mut val) => fidl::encoding::encode_in_envelope::<
12441                    fidl::encoding::HandleType<
12442                        fidl::Socket,
12443                        { fidl::ObjectType::SOCKET.into_raw() },
12444                        2147483648,
12445                    >,
12446                    fidl::encoding::DefaultFuchsiaResourceDialect,
12447                >(
12448                    <fidl::encoding::HandleType<
12449                        fidl::Socket,
12450                        { fidl::ObjectType::SOCKET.into_raw() },
12451                        2147483648,
12452                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12453                        val
12454                    ),
12455                    encoder,
12456                    offset + 8,
12457                    _depth,
12458                ),
12459                Artifact::Log(ref mut val) => fidl::encoding::encode_in_envelope::<
12460                    Syslog,
12461                    fidl::encoding::DefaultFuchsiaResourceDialect,
12462                >(
12463                    <Syslog as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12464                    encoder,
12465                    offset + 8,
12466                    _depth,
12467                ),
12468                Artifact::Custom(ref mut val) => fidl::encoding::encode_in_envelope::<
12469                    CustomArtifact,
12470                    fidl::encoding::DefaultFuchsiaResourceDialect,
12471                >(
12472                    <CustomArtifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12473                    encoder,
12474                    offset + 8,
12475                    _depth,
12476                ),
12477                Artifact::DebugData(ref mut val) => {
12478                    fidl::encoding::encode_in_envelope::<
12479                        fidl::encoding::Endpoint<
12480                            fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
12481                        >,
12482                        fidl::encoding::DefaultFuchsiaResourceDialect,
12483                    >(
12484                        <fidl::encoding::Endpoint<
12485                            fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
12486                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12487                            val
12488                        ),
12489                        encoder,
12490                        offset + 8,
12491                        _depth,
12492                    )
12493                }
12494                Artifact::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
12495            }
12496        }
12497    }
12498
12499    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Artifact {
12500        #[inline(always)]
12501        fn new_empty() -> Self {
12502            Self::__SourceBreaking { unknown_ordinal: 0 }
12503        }
12504
12505        #[inline]
12506        unsafe fn decode(
12507            &mut self,
12508            decoder: &mut fidl::encoding::Decoder<
12509                '_,
12510                fidl::encoding::DefaultFuchsiaResourceDialect,
12511            >,
12512            offset: usize,
12513            mut depth: fidl::encoding::Depth,
12514        ) -> fidl::Result<()> {
12515            decoder.debug_check_bounds::<Self>(offset);
12516            #[allow(unused_variables)]
12517            let next_out_of_line = decoder.next_out_of_line();
12518            let handles_before = decoder.remaining_handles();
12519            let (ordinal, inlined, num_bytes, num_handles) =
12520                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12521
12522            let member_inline_size =
12523                match ordinal {
12524                    1 => <fidl::encoding::HandleType<
12525                        fidl::Socket,
12526                        { fidl::ObjectType::SOCKET.into_raw() },
12527                        2147483648,
12528                    > as fidl::encoding::TypeMarker>::inline_size(
12529                        decoder.context
12530                    ),
12531                    2 => <fidl::encoding::HandleType<
12532                        fidl::Socket,
12533                        { fidl::ObjectType::SOCKET.into_raw() },
12534                        2147483648,
12535                    > as fidl::encoding::TypeMarker>::inline_size(
12536                        decoder.context
12537                    ),
12538                    3 => <Syslog as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12539                    4 => {
12540                        <CustomArtifact as fidl::encoding::TypeMarker>::inline_size(decoder.context)
12541                    }
12542                    5 => <fidl::encoding::Endpoint<
12543                        fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
12544                    > as fidl::encoding::TypeMarker>::inline_size(
12545                        decoder.context
12546                    ),
12547                    0 => return Err(fidl::Error::UnknownUnionTag),
12548                    _ => num_bytes as usize,
12549                };
12550
12551            if inlined != (member_inline_size <= 4) {
12552                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12553            }
12554            let _inner_offset;
12555            if inlined {
12556                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12557                _inner_offset = offset + 8;
12558            } else {
12559                depth.increment()?;
12560                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12561            }
12562            match ordinal {
12563                1 => {
12564                    #[allow(irrefutable_let_patterns)]
12565                    if let Artifact::Stdout(_) = self {
12566                        // Do nothing, read the value into the object
12567                    } else {
12568                        // Initialize `self` to the right variant
12569                        *self = Artifact::Stdout(
12570                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12571                        );
12572                    }
12573                    #[allow(irrefutable_let_patterns)]
12574                    if let Artifact::Stdout(ref mut val) = self {
12575                        fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
12576                    } else {
12577                        unreachable!()
12578                    }
12579                }
12580                2 => {
12581                    #[allow(irrefutable_let_patterns)]
12582                    if let Artifact::Stderr(_) = self {
12583                        // Do nothing, read the value into the object
12584                    } else {
12585                        // Initialize `self` to the right variant
12586                        *self = Artifact::Stderr(
12587                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12588                        );
12589                    }
12590                    #[allow(irrefutable_let_patterns)]
12591                    if let Artifact::Stderr(ref mut val) = self {
12592                        fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
12593                    } else {
12594                        unreachable!()
12595                    }
12596                }
12597                3 => {
12598                    #[allow(irrefutable_let_patterns)]
12599                    if let Artifact::Log(_) = self {
12600                        // Do nothing, read the value into the object
12601                    } else {
12602                        // Initialize `self` to the right variant
12603                        *self = Artifact::Log(fidl::new_empty!(
12604                            Syslog,
12605                            fidl::encoding::DefaultFuchsiaResourceDialect
12606                        ));
12607                    }
12608                    #[allow(irrefutable_let_patterns)]
12609                    if let Artifact::Log(ref mut val) = self {
12610                        fidl::decode!(
12611                            Syslog,
12612                            fidl::encoding::DefaultFuchsiaResourceDialect,
12613                            val,
12614                            decoder,
12615                            _inner_offset,
12616                            depth
12617                        )?;
12618                    } else {
12619                        unreachable!()
12620                    }
12621                }
12622                4 => {
12623                    #[allow(irrefutable_let_patterns)]
12624                    if let Artifact::Custom(_) = self {
12625                        // Do nothing, read the value into the object
12626                    } else {
12627                        // Initialize `self` to the right variant
12628                        *self = Artifact::Custom(fidl::new_empty!(
12629                            CustomArtifact,
12630                            fidl::encoding::DefaultFuchsiaResourceDialect
12631                        ));
12632                    }
12633                    #[allow(irrefutable_let_patterns)]
12634                    if let Artifact::Custom(ref mut val) = self {
12635                        fidl::decode!(
12636                            CustomArtifact,
12637                            fidl::encoding::DefaultFuchsiaResourceDialect,
12638                            val,
12639                            decoder,
12640                            _inner_offset,
12641                            depth
12642                        )?;
12643                    } else {
12644                        unreachable!()
12645                    }
12646                }
12647                5 => {
12648                    #[allow(irrefutable_let_patterns)]
12649                    if let Artifact::DebugData(_) = self {
12650                        // Do nothing, read the value into the object
12651                    } else {
12652                        // Initialize `self` to the right variant
12653                        *self = Artifact::DebugData(fidl::new_empty!(
12654                            fidl::encoding::Endpoint<
12655                                fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
12656                            >,
12657                            fidl::encoding::DefaultFuchsiaResourceDialect
12658                        ));
12659                    }
12660                    #[allow(irrefutable_let_patterns)]
12661                    if let Artifact::DebugData(ref mut val) = self {
12662                        fidl::decode!(
12663                            fidl::encoding::Endpoint<
12664                                fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
12665                            >,
12666                            fidl::encoding::DefaultFuchsiaResourceDialect,
12667                            val,
12668                            decoder,
12669                            _inner_offset,
12670                            depth
12671                        )?;
12672                    } else {
12673                        unreachable!()
12674                    }
12675                }
12676                #[allow(deprecated)]
12677                ordinal => {
12678                    for _ in 0..num_handles {
12679                        decoder.drop_next_handle()?;
12680                    }
12681                    *self = Artifact::__SourceBreaking { unknown_ordinal: ordinal };
12682                }
12683            }
12684            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12685                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12686            }
12687            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12688                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12689            }
12690            Ok(())
12691        }
12692    }
12693
12694    impl fidl::encoding::ResourceTypeMarker for EventDetails {
12695        type Borrowed<'a> = &'a mut Self;
12696        fn take_or_borrow<'a>(
12697            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12698        ) -> Self::Borrowed<'a> {
12699            value
12700        }
12701    }
12702
12703    unsafe impl fidl::encoding::TypeMarker for EventDetails {
12704        type Owned = Self;
12705
12706        #[inline(always)]
12707        fn inline_align(_context: fidl::encoding::Context) -> usize {
12708            8
12709        }
12710
12711        #[inline(always)]
12712        fn inline_size(_context: fidl::encoding::Context) -> usize {
12713            16
12714        }
12715    }
12716
12717    unsafe impl fidl::encoding::Encode<EventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>
12718        for &mut EventDetails
12719    {
12720        #[inline]
12721        unsafe fn encode(
12722            self,
12723            encoder: &mut fidl::encoding::Encoder<
12724                '_,
12725                fidl::encoding::DefaultFuchsiaResourceDialect,
12726            >,
12727            offset: usize,
12728            _depth: fidl::encoding::Depth,
12729        ) -> fidl::Result<()> {
12730            encoder.debug_check_bounds::<EventDetails>(offset);
12731            encoder.write_num::<u64>(self.ordinal(), offset);
12732            match self {
12733            EventDetails::SuiteStarted(ref val) => {
12734                fidl::encoding::encode_in_envelope::<SuiteStartedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12735                    <SuiteStartedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12736                    encoder, offset + 8, _depth
12737                )
12738            }
12739            EventDetails::TestCaseFound(ref val) => {
12740                fidl::encoding::encode_in_envelope::<TestCaseFoundEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12741                    <TestCaseFoundEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12742                    encoder, offset + 8, _depth
12743                )
12744            }
12745            EventDetails::TestCaseStarted(ref val) => {
12746                fidl::encoding::encode_in_envelope::<TestCaseStartedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12747                    <TestCaseStartedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12748                    encoder, offset + 8, _depth
12749                )
12750            }
12751            EventDetails::TestCaseArtifactGenerated(ref mut val) => {
12752                fidl::encoding::encode_in_envelope::<TestCaseArtifactGeneratedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12753                    <TestCaseArtifactGeneratedEventDetails as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12754                    encoder, offset + 8, _depth
12755                )
12756            }
12757            EventDetails::TestCaseStopped(ref val) => {
12758                fidl::encoding::encode_in_envelope::<TestCaseStoppedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12759                    <TestCaseStoppedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12760                    encoder, offset + 8, _depth
12761                )
12762            }
12763            EventDetails::TestCaseFinished(ref val) => {
12764                fidl::encoding::encode_in_envelope::<TestCaseFinishedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12765                    <TestCaseFinishedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12766                    encoder, offset + 8, _depth
12767                )
12768            }
12769            EventDetails::SuiteArtifactGenerated(ref mut val) => {
12770                fidl::encoding::encode_in_envelope::<SuiteArtifactGeneratedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12771                    <SuiteArtifactGeneratedEventDetails as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12772                    encoder, offset + 8, _depth
12773                )
12774            }
12775            EventDetails::SuiteStopped(ref val) => {
12776                fidl::encoding::encode_in_envelope::<SuiteStoppedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12777                    <SuiteStoppedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12778                    encoder, offset + 8, _depth
12779                )
12780            }
12781            EventDetails::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
12782        }
12783        }
12784    }
12785
12786    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for EventDetails {
12787        #[inline(always)]
12788        fn new_empty() -> Self {
12789            Self::__SourceBreaking { unknown_ordinal: 0 }
12790        }
12791
12792        #[inline]
12793        unsafe fn decode(
12794            &mut self,
12795            decoder: &mut fidl::encoding::Decoder<
12796                '_,
12797                fidl::encoding::DefaultFuchsiaResourceDialect,
12798            >,
12799            offset: usize,
12800            mut depth: fidl::encoding::Depth,
12801        ) -> fidl::Result<()> {
12802            decoder.debug_check_bounds::<Self>(offset);
12803            #[allow(unused_variables)]
12804            let next_out_of_line = decoder.next_out_of_line();
12805            let handles_before = decoder.remaining_handles();
12806            let (ordinal, inlined, num_bytes, num_handles) =
12807                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12808
12809            let member_inline_size = match ordinal {
12810            1 => <SuiteStartedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12811            2 => <TestCaseFoundEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12812            3 => <TestCaseStartedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12813            4 => <TestCaseArtifactGeneratedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12814            5 => <TestCaseStoppedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12815            6 => <TestCaseFinishedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12816            7 => <SuiteArtifactGeneratedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12817            8 => <SuiteStoppedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12818            0 => return Err(fidl::Error::UnknownUnionTag),
12819            _ => num_bytes as usize,
12820        };
12821
12822            if inlined != (member_inline_size <= 4) {
12823                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12824            }
12825            let _inner_offset;
12826            if inlined {
12827                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12828                _inner_offset = offset + 8;
12829            } else {
12830                depth.increment()?;
12831                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12832            }
12833            match ordinal {
12834                1 => {
12835                    #[allow(irrefutable_let_patterns)]
12836                    if let EventDetails::SuiteStarted(_) = self {
12837                        // Do nothing, read the value into the object
12838                    } else {
12839                        // Initialize `self` to the right variant
12840                        *self = EventDetails::SuiteStarted(fidl::new_empty!(
12841                            SuiteStartedEventDetails,
12842                            fidl::encoding::DefaultFuchsiaResourceDialect
12843                        ));
12844                    }
12845                    #[allow(irrefutable_let_patterns)]
12846                    if let EventDetails::SuiteStarted(ref mut val) = self {
12847                        fidl::decode!(
12848                            SuiteStartedEventDetails,
12849                            fidl::encoding::DefaultFuchsiaResourceDialect,
12850                            val,
12851                            decoder,
12852                            _inner_offset,
12853                            depth
12854                        )?;
12855                    } else {
12856                        unreachable!()
12857                    }
12858                }
12859                2 => {
12860                    #[allow(irrefutable_let_patterns)]
12861                    if let EventDetails::TestCaseFound(_) = self {
12862                        // Do nothing, read the value into the object
12863                    } else {
12864                        // Initialize `self` to the right variant
12865                        *self = EventDetails::TestCaseFound(fidl::new_empty!(
12866                            TestCaseFoundEventDetails,
12867                            fidl::encoding::DefaultFuchsiaResourceDialect
12868                        ));
12869                    }
12870                    #[allow(irrefutable_let_patterns)]
12871                    if let EventDetails::TestCaseFound(ref mut val) = self {
12872                        fidl::decode!(
12873                            TestCaseFoundEventDetails,
12874                            fidl::encoding::DefaultFuchsiaResourceDialect,
12875                            val,
12876                            decoder,
12877                            _inner_offset,
12878                            depth
12879                        )?;
12880                    } else {
12881                        unreachable!()
12882                    }
12883                }
12884                3 => {
12885                    #[allow(irrefutable_let_patterns)]
12886                    if let EventDetails::TestCaseStarted(_) = self {
12887                        // Do nothing, read the value into the object
12888                    } else {
12889                        // Initialize `self` to the right variant
12890                        *self = EventDetails::TestCaseStarted(fidl::new_empty!(
12891                            TestCaseStartedEventDetails,
12892                            fidl::encoding::DefaultFuchsiaResourceDialect
12893                        ));
12894                    }
12895                    #[allow(irrefutable_let_patterns)]
12896                    if let EventDetails::TestCaseStarted(ref mut val) = self {
12897                        fidl::decode!(
12898                            TestCaseStartedEventDetails,
12899                            fidl::encoding::DefaultFuchsiaResourceDialect,
12900                            val,
12901                            decoder,
12902                            _inner_offset,
12903                            depth
12904                        )?;
12905                    } else {
12906                        unreachable!()
12907                    }
12908                }
12909                4 => {
12910                    #[allow(irrefutable_let_patterns)]
12911                    if let EventDetails::TestCaseArtifactGenerated(_) = self {
12912                        // Do nothing, read the value into the object
12913                    } else {
12914                        // Initialize `self` to the right variant
12915                        *self = EventDetails::TestCaseArtifactGenerated(fidl::new_empty!(
12916                            TestCaseArtifactGeneratedEventDetails,
12917                            fidl::encoding::DefaultFuchsiaResourceDialect
12918                        ));
12919                    }
12920                    #[allow(irrefutable_let_patterns)]
12921                    if let EventDetails::TestCaseArtifactGenerated(ref mut val) = self {
12922                        fidl::decode!(
12923                            TestCaseArtifactGeneratedEventDetails,
12924                            fidl::encoding::DefaultFuchsiaResourceDialect,
12925                            val,
12926                            decoder,
12927                            _inner_offset,
12928                            depth
12929                        )?;
12930                    } else {
12931                        unreachable!()
12932                    }
12933                }
12934                5 => {
12935                    #[allow(irrefutable_let_patterns)]
12936                    if let EventDetails::TestCaseStopped(_) = self {
12937                        // Do nothing, read the value into the object
12938                    } else {
12939                        // Initialize `self` to the right variant
12940                        *self = EventDetails::TestCaseStopped(fidl::new_empty!(
12941                            TestCaseStoppedEventDetails,
12942                            fidl::encoding::DefaultFuchsiaResourceDialect
12943                        ));
12944                    }
12945                    #[allow(irrefutable_let_patterns)]
12946                    if let EventDetails::TestCaseStopped(ref mut val) = self {
12947                        fidl::decode!(
12948                            TestCaseStoppedEventDetails,
12949                            fidl::encoding::DefaultFuchsiaResourceDialect,
12950                            val,
12951                            decoder,
12952                            _inner_offset,
12953                            depth
12954                        )?;
12955                    } else {
12956                        unreachable!()
12957                    }
12958                }
12959                6 => {
12960                    #[allow(irrefutable_let_patterns)]
12961                    if let EventDetails::TestCaseFinished(_) = self {
12962                        // Do nothing, read the value into the object
12963                    } else {
12964                        // Initialize `self` to the right variant
12965                        *self = EventDetails::TestCaseFinished(fidl::new_empty!(
12966                            TestCaseFinishedEventDetails,
12967                            fidl::encoding::DefaultFuchsiaResourceDialect
12968                        ));
12969                    }
12970                    #[allow(irrefutable_let_patterns)]
12971                    if let EventDetails::TestCaseFinished(ref mut val) = self {
12972                        fidl::decode!(
12973                            TestCaseFinishedEventDetails,
12974                            fidl::encoding::DefaultFuchsiaResourceDialect,
12975                            val,
12976                            decoder,
12977                            _inner_offset,
12978                            depth
12979                        )?;
12980                    } else {
12981                        unreachable!()
12982                    }
12983                }
12984                7 => {
12985                    #[allow(irrefutable_let_patterns)]
12986                    if let EventDetails::SuiteArtifactGenerated(_) = self {
12987                        // Do nothing, read the value into the object
12988                    } else {
12989                        // Initialize `self` to the right variant
12990                        *self = EventDetails::SuiteArtifactGenerated(fidl::new_empty!(
12991                            SuiteArtifactGeneratedEventDetails,
12992                            fidl::encoding::DefaultFuchsiaResourceDialect
12993                        ));
12994                    }
12995                    #[allow(irrefutable_let_patterns)]
12996                    if let EventDetails::SuiteArtifactGenerated(ref mut val) = self {
12997                        fidl::decode!(
12998                            SuiteArtifactGeneratedEventDetails,
12999                            fidl::encoding::DefaultFuchsiaResourceDialect,
13000                            val,
13001                            decoder,
13002                            _inner_offset,
13003                            depth
13004                        )?;
13005                    } else {
13006                        unreachable!()
13007                    }
13008                }
13009                8 => {
13010                    #[allow(irrefutable_let_patterns)]
13011                    if let EventDetails::SuiteStopped(_) = self {
13012                        // Do nothing, read the value into the object
13013                    } else {
13014                        // Initialize `self` to the right variant
13015                        *self = EventDetails::SuiteStopped(fidl::new_empty!(
13016                            SuiteStoppedEventDetails,
13017                            fidl::encoding::DefaultFuchsiaResourceDialect
13018                        ));
13019                    }
13020                    #[allow(irrefutable_let_patterns)]
13021                    if let EventDetails::SuiteStopped(ref mut val) = self {
13022                        fidl::decode!(
13023                            SuiteStoppedEventDetails,
13024                            fidl::encoding::DefaultFuchsiaResourceDialect,
13025                            val,
13026                            decoder,
13027                            _inner_offset,
13028                            depth
13029                        )?;
13030                    } else {
13031                        unreachable!()
13032                    }
13033                }
13034                #[allow(deprecated)]
13035                ordinal => {
13036                    for _ in 0..num_handles {
13037                        decoder.drop_next_handle()?;
13038                    }
13039                    *self = EventDetails::__SourceBreaking { unknown_ordinal: ordinal };
13040                }
13041            }
13042            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13043                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13044            }
13045            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13046                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13047            }
13048            Ok(())
13049        }
13050    }
13051
13052    impl fidl::encoding::ResourceTypeMarker for LogsIterator {
13053        type Borrowed<'a> = &'a mut Self;
13054        fn take_or_borrow<'a>(
13055            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13056        ) -> Self::Borrowed<'a> {
13057            value
13058        }
13059    }
13060
13061    unsafe impl fidl::encoding::TypeMarker for LogsIterator {
13062        type Owned = Self;
13063
13064        #[inline(always)]
13065        fn inline_align(_context: fidl::encoding::Context) -> usize {
13066            8
13067        }
13068
13069        #[inline(always)]
13070        fn inline_size(_context: fidl::encoding::Context) -> usize {
13071            16
13072        }
13073    }
13074
13075    unsafe impl fidl::encoding::Encode<LogsIterator, fidl::encoding::DefaultFuchsiaResourceDialect>
13076        for &mut LogsIterator
13077    {
13078        #[inline]
13079        unsafe fn encode(
13080            self,
13081            encoder: &mut fidl::encoding::Encoder<
13082                '_,
13083                fidl::encoding::DefaultFuchsiaResourceDialect,
13084            >,
13085            offset: usize,
13086            _depth: fidl::encoding::Depth,
13087        ) -> fidl::Result<()> {
13088            encoder.debug_check_bounds::<LogsIterator>(offset);
13089            encoder.write_num::<u64>(self.ordinal(), offset);
13090            match self {
13091                LogsIterator::Batch(ref mut val) => fidl::encoding::encode_in_envelope::<
13092                    fidl::encoding::Endpoint<
13093                        fidl::endpoints::ServerEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13094                    >,
13095                    fidl::encoding::DefaultFuchsiaResourceDialect,
13096                >(
13097                    <fidl::encoding::Endpoint<
13098                        fidl::endpoints::ServerEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13099                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13100                        val
13101                    ),
13102                    encoder,
13103                    offset + 8,
13104                    _depth,
13105                ),
13106                LogsIterator::Stream(ref mut val) => fidl::encoding::encode_in_envelope::<
13107                    fidl::encoding::HandleType<
13108                        fidl::Socket,
13109                        { fidl::ObjectType::SOCKET.into_raw() },
13110                        16392,
13111                    >,
13112                    fidl::encoding::DefaultFuchsiaResourceDialect,
13113                >(
13114                    <fidl::encoding::HandleType<
13115                        fidl::Socket,
13116                        { fidl::ObjectType::SOCKET.into_raw() },
13117                        16392,
13118                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13119                        val
13120                    ),
13121                    encoder,
13122                    offset + 8,
13123                    _depth,
13124                ),
13125                LogsIterator::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
13126            }
13127        }
13128    }
13129
13130    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for LogsIterator {
13131        #[inline(always)]
13132        fn new_empty() -> Self {
13133            Self::__SourceBreaking { unknown_ordinal: 0 }
13134        }
13135
13136        #[inline]
13137        unsafe fn decode(
13138            &mut self,
13139            decoder: &mut fidl::encoding::Decoder<
13140                '_,
13141                fidl::encoding::DefaultFuchsiaResourceDialect,
13142            >,
13143            offset: usize,
13144            mut depth: fidl::encoding::Depth,
13145        ) -> fidl::Result<()> {
13146            decoder.debug_check_bounds::<Self>(offset);
13147            #[allow(unused_variables)]
13148            let next_out_of_line = decoder.next_out_of_line();
13149            let handles_before = decoder.remaining_handles();
13150            let (ordinal, inlined, num_bytes, num_handles) =
13151                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13152
13153            let member_inline_size = match ordinal {
13154                2 => <fidl::encoding::Endpoint<
13155                    fidl::endpoints::ServerEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13156                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13157                3 => <fidl::encoding::HandleType<
13158                    fidl::Socket,
13159                    { fidl::ObjectType::SOCKET.into_raw() },
13160                    16392,
13161                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13162                0 => return Err(fidl::Error::UnknownUnionTag),
13163                _ => num_bytes as usize,
13164            };
13165
13166            if inlined != (member_inline_size <= 4) {
13167                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13168            }
13169            let _inner_offset;
13170            if inlined {
13171                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13172                _inner_offset = offset + 8;
13173            } else {
13174                depth.increment()?;
13175                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13176            }
13177            match ordinal {
13178                2 => {
13179                    #[allow(irrefutable_let_patterns)]
13180                    if let LogsIterator::Batch(_) = self {
13181                        // Do nothing, read the value into the object
13182                    } else {
13183                        // Initialize `self` to the right variant
13184                        *self = LogsIterator::Batch(fidl::new_empty!(
13185                            fidl::encoding::Endpoint<
13186                                fidl::endpoints::ServerEnd<
13187                                    fidl_fuchsia_diagnostics::BatchIteratorMarker,
13188                                >,
13189                            >,
13190                            fidl::encoding::DefaultFuchsiaResourceDialect
13191                        ));
13192                    }
13193                    #[allow(irrefutable_let_patterns)]
13194                    if let LogsIterator::Batch(ref mut val) = self {
13195                        fidl::decode!(
13196                            fidl::encoding::Endpoint<
13197                                fidl::endpoints::ServerEnd<
13198                                    fidl_fuchsia_diagnostics::BatchIteratorMarker,
13199                                >,
13200                            >,
13201                            fidl::encoding::DefaultFuchsiaResourceDialect,
13202                            val,
13203                            decoder,
13204                            _inner_offset,
13205                            depth
13206                        )?;
13207                    } else {
13208                        unreachable!()
13209                    }
13210                }
13211                3 => {
13212                    #[allow(irrefutable_let_patterns)]
13213                    if let LogsIterator::Stream(_) = self {
13214                        // Do nothing, read the value into the object
13215                    } else {
13216                        // Initialize `self` to the right variant
13217                        *self = LogsIterator::Stream(
13218                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 16392>, fidl::encoding::DefaultFuchsiaResourceDialect),
13219                        );
13220                    }
13221                    #[allow(irrefutable_let_patterns)]
13222                    if let LogsIterator::Stream(ref mut val) = self {
13223                        fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 16392>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
13224                    } else {
13225                        unreachable!()
13226                    }
13227                }
13228                #[allow(deprecated)]
13229                ordinal => {
13230                    for _ in 0..num_handles {
13231                        decoder.drop_next_handle()?;
13232                    }
13233                    *self = LogsIterator::__SourceBreaking { unknown_ordinal: ordinal };
13234                }
13235            }
13236            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13237                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13238            }
13239            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13240                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13241            }
13242            Ok(())
13243        }
13244    }
13245
13246    impl fidl::encoding::ResourceTypeMarker for RunEventPayload {
13247        type Borrowed<'a> = &'a mut Self;
13248        fn take_or_borrow<'a>(
13249            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13250        ) -> Self::Borrowed<'a> {
13251            value
13252        }
13253    }
13254
13255    unsafe impl fidl::encoding::TypeMarker for RunEventPayload {
13256        type Owned = Self;
13257
13258        #[inline(always)]
13259        fn inline_align(_context: fidl::encoding::Context) -> usize {
13260            8
13261        }
13262
13263        #[inline(always)]
13264        fn inline_size(_context: fidl::encoding::Context) -> usize {
13265            16
13266        }
13267    }
13268
13269    unsafe impl
13270        fidl::encoding::Encode<RunEventPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13271        for &mut RunEventPayload
13272    {
13273        #[inline]
13274        unsafe fn encode(
13275            self,
13276            encoder: &mut fidl::encoding::Encoder<
13277                '_,
13278                fidl::encoding::DefaultFuchsiaResourceDialect,
13279            >,
13280            offset: usize,
13281            _depth: fidl::encoding::Depth,
13282        ) -> fidl::Result<()> {
13283            encoder.debug_check_bounds::<RunEventPayload>(offset);
13284            encoder.write_num::<u64>(self.ordinal(), offset);
13285            match self {
13286                RunEventPayload::RunStarted(ref val) => fidl::encoding::encode_in_envelope::<
13287                    RunStarted,
13288                    fidl::encoding::DefaultFuchsiaResourceDialect,
13289                >(
13290                    <RunStarted as fidl::encoding::ValueTypeMarker>::borrow(val),
13291                    encoder,
13292                    offset + 8,
13293                    _depth,
13294                ),
13295                RunEventPayload::RunStopped(ref val) => fidl::encoding::encode_in_envelope::<
13296                    RunStopped,
13297                    fidl::encoding::DefaultFuchsiaResourceDialect,
13298                >(
13299                    <RunStopped as fidl::encoding::ValueTypeMarker>::borrow(val),
13300                    encoder,
13301                    offset + 8,
13302                    _depth,
13303                ),
13304                RunEventPayload::Artifact(ref mut val) => fidl::encoding::encode_in_envelope::<
13305                    Artifact,
13306                    fidl::encoding::DefaultFuchsiaResourceDialect,
13307                >(
13308                    <Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13309                    encoder,
13310                    offset + 8,
13311                    _depth,
13312                ),
13313                RunEventPayload::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
13314            }
13315        }
13316    }
13317
13318    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13319        for RunEventPayload
13320    {
13321        #[inline(always)]
13322        fn new_empty() -> Self {
13323            Self::__SourceBreaking { unknown_ordinal: 0 }
13324        }
13325
13326        #[inline]
13327        unsafe fn decode(
13328            &mut self,
13329            decoder: &mut fidl::encoding::Decoder<
13330                '_,
13331                fidl::encoding::DefaultFuchsiaResourceDialect,
13332            >,
13333            offset: usize,
13334            mut depth: fidl::encoding::Depth,
13335        ) -> fidl::Result<()> {
13336            decoder.debug_check_bounds::<Self>(offset);
13337            #[allow(unused_variables)]
13338            let next_out_of_line = decoder.next_out_of_line();
13339            let handles_before = decoder.remaining_handles();
13340            let (ordinal, inlined, num_bytes, num_handles) =
13341                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13342
13343            let member_inline_size = match ordinal {
13344                1 => <RunStarted as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13345                2 => <RunStopped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13346                3 => <Artifact as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13347                0 => return Err(fidl::Error::UnknownUnionTag),
13348                _ => num_bytes as usize,
13349            };
13350
13351            if inlined != (member_inline_size <= 4) {
13352                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13353            }
13354            let _inner_offset;
13355            if inlined {
13356                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13357                _inner_offset = offset + 8;
13358            } else {
13359                depth.increment()?;
13360                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13361            }
13362            match ordinal {
13363                1 => {
13364                    #[allow(irrefutable_let_patterns)]
13365                    if let RunEventPayload::RunStarted(_) = self {
13366                        // Do nothing, read the value into the object
13367                    } else {
13368                        // Initialize `self` to the right variant
13369                        *self = RunEventPayload::RunStarted(fidl::new_empty!(
13370                            RunStarted,
13371                            fidl::encoding::DefaultFuchsiaResourceDialect
13372                        ));
13373                    }
13374                    #[allow(irrefutable_let_patterns)]
13375                    if let RunEventPayload::RunStarted(ref mut val) = self {
13376                        fidl::decode!(
13377                            RunStarted,
13378                            fidl::encoding::DefaultFuchsiaResourceDialect,
13379                            val,
13380                            decoder,
13381                            _inner_offset,
13382                            depth
13383                        )?;
13384                    } else {
13385                        unreachable!()
13386                    }
13387                }
13388                2 => {
13389                    #[allow(irrefutable_let_patterns)]
13390                    if let RunEventPayload::RunStopped(_) = self {
13391                        // Do nothing, read the value into the object
13392                    } else {
13393                        // Initialize `self` to the right variant
13394                        *self = RunEventPayload::RunStopped(fidl::new_empty!(
13395                            RunStopped,
13396                            fidl::encoding::DefaultFuchsiaResourceDialect
13397                        ));
13398                    }
13399                    #[allow(irrefutable_let_patterns)]
13400                    if let RunEventPayload::RunStopped(ref mut val) = self {
13401                        fidl::decode!(
13402                            RunStopped,
13403                            fidl::encoding::DefaultFuchsiaResourceDialect,
13404                            val,
13405                            decoder,
13406                            _inner_offset,
13407                            depth
13408                        )?;
13409                    } else {
13410                        unreachable!()
13411                    }
13412                }
13413                3 => {
13414                    #[allow(irrefutable_let_patterns)]
13415                    if let RunEventPayload::Artifact(_) = self {
13416                        // Do nothing, read the value into the object
13417                    } else {
13418                        // Initialize `self` to the right variant
13419                        *self = RunEventPayload::Artifact(fidl::new_empty!(
13420                            Artifact,
13421                            fidl::encoding::DefaultFuchsiaResourceDialect
13422                        ));
13423                    }
13424                    #[allow(irrefutable_let_patterns)]
13425                    if let RunEventPayload::Artifact(ref mut val) = self {
13426                        fidl::decode!(
13427                            Artifact,
13428                            fidl::encoding::DefaultFuchsiaResourceDialect,
13429                            val,
13430                            decoder,
13431                            _inner_offset,
13432                            depth
13433                        )?;
13434                    } else {
13435                        unreachable!()
13436                    }
13437                }
13438                #[allow(deprecated)]
13439                ordinal => {
13440                    for _ in 0..num_handles {
13441                        decoder.drop_next_handle()?;
13442                    }
13443                    *self = RunEventPayload::__SourceBreaking { unknown_ordinal: ordinal };
13444                }
13445            }
13446            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13447                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13448            }
13449            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13450                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13451            }
13452            Ok(())
13453        }
13454    }
13455
13456    impl fidl::encoding::ResourceTypeMarker for SuiteEventPayload {
13457        type Borrowed<'a> = &'a mut Self;
13458        fn take_or_borrow<'a>(
13459            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13460        ) -> Self::Borrowed<'a> {
13461            value
13462        }
13463    }
13464
13465    unsafe impl fidl::encoding::TypeMarker for SuiteEventPayload {
13466        type Owned = Self;
13467
13468        #[inline(always)]
13469        fn inline_align(_context: fidl::encoding::Context) -> usize {
13470            8
13471        }
13472
13473        #[inline(always)]
13474        fn inline_size(_context: fidl::encoding::Context) -> usize {
13475            16
13476        }
13477    }
13478
13479    unsafe impl
13480        fidl::encoding::Encode<SuiteEventPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13481        for &mut SuiteEventPayload
13482    {
13483        #[inline]
13484        unsafe fn encode(
13485            self,
13486            encoder: &mut fidl::encoding::Encoder<
13487                '_,
13488                fidl::encoding::DefaultFuchsiaResourceDialect,
13489            >,
13490            offset: usize,
13491            _depth: fidl::encoding::Depth,
13492        ) -> fidl::Result<()> {
13493            encoder.debug_check_bounds::<SuiteEventPayload>(offset);
13494            encoder.write_num::<u64>(self.ordinal(), offset);
13495            match self {
13496                SuiteEventPayload::CaseFound(ref val) => fidl::encoding::encode_in_envelope::<
13497                    CaseFound,
13498                    fidl::encoding::DefaultFuchsiaResourceDialect,
13499                >(
13500                    <CaseFound as fidl::encoding::ValueTypeMarker>::borrow(val),
13501                    encoder,
13502                    offset + 8,
13503                    _depth,
13504                ),
13505                SuiteEventPayload::CaseStarted(ref val) => fidl::encoding::encode_in_envelope::<
13506                    CaseStarted,
13507                    fidl::encoding::DefaultFuchsiaResourceDialect,
13508                >(
13509                    <CaseStarted as fidl::encoding::ValueTypeMarker>::borrow(val),
13510                    encoder,
13511                    offset + 8,
13512                    _depth,
13513                ),
13514                SuiteEventPayload::CaseStopped(ref val) => fidl::encoding::encode_in_envelope::<
13515                    CaseStopped,
13516                    fidl::encoding::DefaultFuchsiaResourceDialect,
13517                >(
13518                    <CaseStopped as fidl::encoding::ValueTypeMarker>::borrow(val),
13519                    encoder,
13520                    offset + 8,
13521                    _depth,
13522                ),
13523                SuiteEventPayload::CaseFinished(ref val) => fidl::encoding::encode_in_envelope::<
13524                    CaseFinished,
13525                    fidl::encoding::DefaultFuchsiaResourceDialect,
13526                >(
13527                    <CaseFinished as fidl::encoding::ValueTypeMarker>::borrow(val),
13528                    encoder,
13529                    offset + 8,
13530                    _depth,
13531                ),
13532                SuiteEventPayload::CaseArtifact(ref mut val) => {
13533                    fidl::encoding::encode_in_envelope::<
13534                        CaseArtifact,
13535                        fidl::encoding::DefaultFuchsiaResourceDialect,
13536                    >(
13537                        <CaseArtifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13538                        encoder,
13539                        offset + 8,
13540                        _depth,
13541                    )
13542                }
13543                SuiteEventPayload::SuiteArtifact(ref mut val) => {
13544                    fidl::encoding::encode_in_envelope::<
13545                        SuiteArtifact,
13546                        fidl::encoding::DefaultFuchsiaResourceDialect,
13547                    >(
13548                        <SuiteArtifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13549                        encoder,
13550                        offset + 8,
13551                        _depth,
13552                    )
13553                }
13554                SuiteEventPayload::SuiteStarted(ref val) => fidl::encoding::encode_in_envelope::<
13555                    SuiteStarted,
13556                    fidl::encoding::DefaultFuchsiaResourceDialect,
13557                >(
13558                    <SuiteStarted as fidl::encoding::ValueTypeMarker>::borrow(val),
13559                    encoder,
13560                    offset + 8,
13561                    _depth,
13562                ),
13563                SuiteEventPayload::SuiteStopped(ref val) => fidl::encoding::encode_in_envelope::<
13564                    SuiteStopped,
13565                    fidl::encoding::DefaultFuchsiaResourceDialect,
13566                >(
13567                    <SuiteStopped as fidl::encoding::ValueTypeMarker>::borrow(val),
13568                    encoder,
13569                    offset + 8,
13570                    _depth,
13571                ),
13572                SuiteEventPayload::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
13573            }
13574        }
13575    }
13576
13577    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13578        for SuiteEventPayload
13579    {
13580        #[inline(always)]
13581        fn new_empty() -> Self {
13582            Self::__SourceBreaking { unknown_ordinal: 0 }
13583        }
13584
13585        #[inline]
13586        unsafe fn decode(
13587            &mut self,
13588            decoder: &mut fidl::encoding::Decoder<
13589                '_,
13590                fidl::encoding::DefaultFuchsiaResourceDialect,
13591            >,
13592            offset: usize,
13593            mut depth: fidl::encoding::Depth,
13594        ) -> fidl::Result<()> {
13595            decoder.debug_check_bounds::<Self>(offset);
13596            #[allow(unused_variables)]
13597            let next_out_of_line = decoder.next_out_of_line();
13598            let handles_before = decoder.remaining_handles();
13599            let (ordinal, inlined, num_bytes, num_handles) =
13600                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13601
13602            let member_inline_size = match ordinal {
13603                1 => <CaseFound as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13604                2 => <CaseStarted as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13605                3 => <CaseStopped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13606                4 => <CaseFinished as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13607                5 => <CaseArtifact as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13608                6 => <SuiteArtifact as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13609                7 => <SuiteStarted as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13610                8 => <SuiteStopped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13611                0 => return Err(fidl::Error::UnknownUnionTag),
13612                _ => num_bytes as usize,
13613            };
13614
13615            if inlined != (member_inline_size <= 4) {
13616                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13617            }
13618            let _inner_offset;
13619            if inlined {
13620                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13621                _inner_offset = offset + 8;
13622            } else {
13623                depth.increment()?;
13624                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13625            }
13626            match ordinal {
13627                1 => {
13628                    #[allow(irrefutable_let_patterns)]
13629                    if let SuiteEventPayload::CaseFound(_) = self {
13630                        // Do nothing, read the value into the object
13631                    } else {
13632                        // Initialize `self` to the right variant
13633                        *self = SuiteEventPayload::CaseFound(fidl::new_empty!(
13634                            CaseFound,
13635                            fidl::encoding::DefaultFuchsiaResourceDialect
13636                        ));
13637                    }
13638                    #[allow(irrefutable_let_patterns)]
13639                    if let SuiteEventPayload::CaseFound(ref mut val) = self {
13640                        fidl::decode!(
13641                            CaseFound,
13642                            fidl::encoding::DefaultFuchsiaResourceDialect,
13643                            val,
13644                            decoder,
13645                            _inner_offset,
13646                            depth
13647                        )?;
13648                    } else {
13649                        unreachable!()
13650                    }
13651                }
13652                2 => {
13653                    #[allow(irrefutable_let_patterns)]
13654                    if let SuiteEventPayload::CaseStarted(_) = self {
13655                        // Do nothing, read the value into the object
13656                    } else {
13657                        // Initialize `self` to the right variant
13658                        *self = SuiteEventPayload::CaseStarted(fidl::new_empty!(
13659                            CaseStarted,
13660                            fidl::encoding::DefaultFuchsiaResourceDialect
13661                        ));
13662                    }
13663                    #[allow(irrefutable_let_patterns)]
13664                    if let SuiteEventPayload::CaseStarted(ref mut val) = self {
13665                        fidl::decode!(
13666                            CaseStarted,
13667                            fidl::encoding::DefaultFuchsiaResourceDialect,
13668                            val,
13669                            decoder,
13670                            _inner_offset,
13671                            depth
13672                        )?;
13673                    } else {
13674                        unreachable!()
13675                    }
13676                }
13677                3 => {
13678                    #[allow(irrefutable_let_patterns)]
13679                    if let SuiteEventPayload::CaseStopped(_) = self {
13680                        // Do nothing, read the value into the object
13681                    } else {
13682                        // Initialize `self` to the right variant
13683                        *self = SuiteEventPayload::CaseStopped(fidl::new_empty!(
13684                            CaseStopped,
13685                            fidl::encoding::DefaultFuchsiaResourceDialect
13686                        ));
13687                    }
13688                    #[allow(irrefutable_let_patterns)]
13689                    if let SuiteEventPayload::CaseStopped(ref mut val) = self {
13690                        fidl::decode!(
13691                            CaseStopped,
13692                            fidl::encoding::DefaultFuchsiaResourceDialect,
13693                            val,
13694                            decoder,
13695                            _inner_offset,
13696                            depth
13697                        )?;
13698                    } else {
13699                        unreachable!()
13700                    }
13701                }
13702                4 => {
13703                    #[allow(irrefutable_let_patterns)]
13704                    if let SuiteEventPayload::CaseFinished(_) = self {
13705                        // Do nothing, read the value into the object
13706                    } else {
13707                        // Initialize `self` to the right variant
13708                        *self = SuiteEventPayload::CaseFinished(fidl::new_empty!(
13709                            CaseFinished,
13710                            fidl::encoding::DefaultFuchsiaResourceDialect
13711                        ));
13712                    }
13713                    #[allow(irrefutable_let_patterns)]
13714                    if let SuiteEventPayload::CaseFinished(ref mut val) = self {
13715                        fidl::decode!(
13716                            CaseFinished,
13717                            fidl::encoding::DefaultFuchsiaResourceDialect,
13718                            val,
13719                            decoder,
13720                            _inner_offset,
13721                            depth
13722                        )?;
13723                    } else {
13724                        unreachable!()
13725                    }
13726                }
13727                5 => {
13728                    #[allow(irrefutable_let_patterns)]
13729                    if let SuiteEventPayload::CaseArtifact(_) = self {
13730                        // Do nothing, read the value into the object
13731                    } else {
13732                        // Initialize `self` to the right variant
13733                        *self = SuiteEventPayload::CaseArtifact(fidl::new_empty!(
13734                            CaseArtifact,
13735                            fidl::encoding::DefaultFuchsiaResourceDialect
13736                        ));
13737                    }
13738                    #[allow(irrefutable_let_patterns)]
13739                    if let SuiteEventPayload::CaseArtifact(ref mut val) = self {
13740                        fidl::decode!(
13741                            CaseArtifact,
13742                            fidl::encoding::DefaultFuchsiaResourceDialect,
13743                            val,
13744                            decoder,
13745                            _inner_offset,
13746                            depth
13747                        )?;
13748                    } else {
13749                        unreachable!()
13750                    }
13751                }
13752                6 => {
13753                    #[allow(irrefutable_let_patterns)]
13754                    if let SuiteEventPayload::SuiteArtifact(_) = self {
13755                        // Do nothing, read the value into the object
13756                    } else {
13757                        // Initialize `self` to the right variant
13758                        *self = SuiteEventPayload::SuiteArtifact(fidl::new_empty!(
13759                            SuiteArtifact,
13760                            fidl::encoding::DefaultFuchsiaResourceDialect
13761                        ));
13762                    }
13763                    #[allow(irrefutable_let_patterns)]
13764                    if let SuiteEventPayload::SuiteArtifact(ref mut val) = self {
13765                        fidl::decode!(
13766                            SuiteArtifact,
13767                            fidl::encoding::DefaultFuchsiaResourceDialect,
13768                            val,
13769                            decoder,
13770                            _inner_offset,
13771                            depth
13772                        )?;
13773                    } else {
13774                        unreachable!()
13775                    }
13776                }
13777                7 => {
13778                    #[allow(irrefutable_let_patterns)]
13779                    if let SuiteEventPayload::SuiteStarted(_) = self {
13780                        // Do nothing, read the value into the object
13781                    } else {
13782                        // Initialize `self` to the right variant
13783                        *self = SuiteEventPayload::SuiteStarted(fidl::new_empty!(
13784                            SuiteStarted,
13785                            fidl::encoding::DefaultFuchsiaResourceDialect
13786                        ));
13787                    }
13788                    #[allow(irrefutable_let_patterns)]
13789                    if let SuiteEventPayload::SuiteStarted(ref mut val) = self {
13790                        fidl::decode!(
13791                            SuiteStarted,
13792                            fidl::encoding::DefaultFuchsiaResourceDialect,
13793                            val,
13794                            decoder,
13795                            _inner_offset,
13796                            depth
13797                        )?;
13798                    } else {
13799                        unreachable!()
13800                    }
13801                }
13802                8 => {
13803                    #[allow(irrefutable_let_patterns)]
13804                    if let SuiteEventPayload::SuiteStopped(_) = self {
13805                        // Do nothing, read the value into the object
13806                    } else {
13807                        // Initialize `self` to the right variant
13808                        *self = SuiteEventPayload::SuiteStopped(fidl::new_empty!(
13809                            SuiteStopped,
13810                            fidl::encoding::DefaultFuchsiaResourceDialect
13811                        ));
13812                    }
13813                    #[allow(irrefutable_let_patterns)]
13814                    if let SuiteEventPayload::SuiteStopped(ref mut val) = self {
13815                        fidl::decode!(
13816                            SuiteStopped,
13817                            fidl::encoding::DefaultFuchsiaResourceDialect,
13818                            val,
13819                            decoder,
13820                            _inner_offset,
13821                            depth
13822                        )?;
13823                    } else {
13824                        unreachable!()
13825                    }
13826                }
13827                #[allow(deprecated)]
13828                ordinal => {
13829                    for _ in 0..num_handles {
13830                        decoder.drop_next_handle()?;
13831                    }
13832                    *self = SuiteEventPayload::__SourceBreaking { unknown_ordinal: ordinal };
13833                }
13834            }
13835            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13836                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13837            }
13838            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13839                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13840            }
13841            Ok(())
13842        }
13843    }
13844
13845    impl fidl::encoding::ResourceTypeMarker for Syslog {
13846        type Borrowed<'a> = &'a mut Self;
13847        fn take_or_borrow<'a>(
13848            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13849        ) -> Self::Borrowed<'a> {
13850            value
13851        }
13852    }
13853
13854    unsafe impl fidl::encoding::TypeMarker for Syslog {
13855        type Owned = Self;
13856
13857        #[inline(always)]
13858        fn inline_align(_context: fidl::encoding::Context) -> usize {
13859            8
13860        }
13861
13862        #[inline(always)]
13863        fn inline_size(_context: fidl::encoding::Context) -> usize {
13864            16
13865        }
13866    }
13867
13868    unsafe impl fidl::encoding::Encode<Syslog, fidl::encoding::DefaultFuchsiaResourceDialect>
13869        for &mut Syslog
13870    {
13871        #[inline]
13872        unsafe fn encode(
13873            self,
13874            encoder: &mut fidl::encoding::Encoder<
13875                '_,
13876                fidl::encoding::DefaultFuchsiaResourceDialect,
13877            >,
13878            offset: usize,
13879            _depth: fidl::encoding::Depth,
13880        ) -> fidl::Result<()> {
13881            encoder.debug_check_bounds::<Syslog>(offset);
13882            encoder.write_num::<u64>(self.ordinal(), offset);
13883            match self {
13884                Syslog::Batch(ref mut val) => fidl::encoding::encode_in_envelope::<
13885                    fidl::encoding::Endpoint<
13886                        fidl::endpoints::ClientEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13887                    >,
13888                    fidl::encoding::DefaultFuchsiaResourceDialect,
13889                >(
13890                    <fidl::encoding::Endpoint<
13891                        fidl::endpoints::ClientEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13892                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13893                        val
13894                    ),
13895                    encoder,
13896                    offset + 8,
13897                    _depth,
13898                ),
13899                Syslog::Stream(ref mut val) => fidl::encoding::encode_in_envelope::<
13900                    fidl::encoding::HandleType<
13901                        fidl::Socket,
13902                        { fidl::ObjectType::SOCKET.into_raw() },
13903                        2147483648,
13904                    >,
13905                    fidl::encoding::DefaultFuchsiaResourceDialect,
13906                >(
13907                    <fidl::encoding::HandleType<
13908                        fidl::Socket,
13909                        { fidl::ObjectType::SOCKET.into_raw() },
13910                        2147483648,
13911                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13912                        val
13913                    ),
13914                    encoder,
13915                    offset + 8,
13916                    _depth,
13917                ),
13918                Syslog::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
13919            }
13920        }
13921    }
13922
13923    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Syslog {
13924        #[inline(always)]
13925        fn new_empty() -> Self {
13926            Self::__SourceBreaking { unknown_ordinal: 0 }
13927        }
13928
13929        #[inline]
13930        unsafe fn decode(
13931            &mut self,
13932            decoder: &mut fidl::encoding::Decoder<
13933                '_,
13934                fidl::encoding::DefaultFuchsiaResourceDialect,
13935            >,
13936            offset: usize,
13937            mut depth: fidl::encoding::Depth,
13938        ) -> fidl::Result<()> {
13939            decoder.debug_check_bounds::<Self>(offset);
13940            #[allow(unused_variables)]
13941            let next_out_of_line = decoder.next_out_of_line();
13942            let handles_before = decoder.remaining_handles();
13943            let (ordinal, inlined, num_bytes, num_handles) =
13944                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13945
13946            let member_inline_size = match ordinal {
13947                2 => <fidl::encoding::Endpoint<
13948                    fidl::endpoints::ClientEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13949                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13950                3 => <fidl::encoding::HandleType<
13951                    fidl::Socket,
13952                    { fidl::ObjectType::SOCKET.into_raw() },
13953                    2147483648,
13954                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13955                0 => return Err(fidl::Error::UnknownUnionTag),
13956                _ => num_bytes as usize,
13957            };
13958
13959            if inlined != (member_inline_size <= 4) {
13960                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13961            }
13962            let _inner_offset;
13963            if inlined {
13964                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13965                _inner_offset = offset + 8;
13966            } else {
13967                depth.increment()?;
13968                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13969            }
13970            match ordinal {
13971                2 => {
13972                    #[allow(irrefutable_let_patterns)]
13973                    if let Syslog::Batch(_) = self {
13974                        // Do nothing, read the value into the object
13975                    } else {
13976                        // Initialize `self` to the right variant
13977                        *self = Syslog::Batch(fidl::new_empty!(
13978                            fidl::encoding::Endpoint<
13979                                fidl::endpoints::ClientEnd<
13980                                    fidl_fuchsia_diagnostics::BatchIteratorMarker,
13981                                >,
13982                            >,
13983                            fidl::encoding::DefaultFuchsiaResourceDialect
13984                        ));
13985                    }
13986                    #[allow(irrefutable_let_patterns)]
13987                    if let Syslog::Batch(ref mut val) = self {
13988                        fidl::decode!(
13989                            fidl::encoding::Endpoint<
13990                                fidl::endpoints::ClientEnd<
13991                                    fidl_fuchsia_diagnostics::BatchIteratorMarker,
13992                                >,
13993                            >,
13994                            fidl::encoding::DefaultFuchsiaResourceDialect,
13995                            val,
13996                            decoder,
13997                            _inner_offset,
13998                            depth
13999                        )?;
14000                    } else {
14001                        unreachable!()
14002                    }
14003                }
14004                3 => {
14005                    #[allow(irrefutable_let_patterns)]
14006                    if let Syslog::Stream(_) = self {
14007                        // Do nothing, read the value into the object
14008                    } else {
14009                        // Initialize `self` to the right variant
14010                        *self = Syslog::Stream(
14011                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14012                        );
14013                    }
14014                    #[allow(irrefutable_let_patterns)]
14015                    if let Syslog::Stream(ref mut val) = self {
14016                        fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
14017                    } else {
14018                        unreachable!()
14019                    }
14020                }
14021                #[allow(deprecated)]
14022                ordinal => {
14023                    for _ in 0..num_handles {
14024                        decoder.drop_next_handle()?;
14025                    }
14026                    *self = Syslog::__SourceBreaking { unknown_ordinal: ordinal };
14027                }
14028            }
14029            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14030                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14031            }
14032            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14033                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14034            }
14035            Ok(())
14036        }
14037    }
14038}