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::NullableHandle {
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#[cfg(target_os = "fuchsia")]
929impl fidl::endpoints::FromClient for CaseIteratorSynchronousProxy {
930    type Protocol = CaseIteratorMarker;
931
932    fn from_client(value: fidl::endpoints::ClientEnd<CaseIteratorMarker>) -> Self {
933        Self::new(value.into_channel())
934    }
935}
936
937#[derive(Debug, Clone)]
938pub struct CaseIteratorProxy {
939    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
940}
941
942impl fidl::endpoints::Proxy for CaseIteratorProxy {
943    type Protocol = CaseIteratorMarker;
944
945    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
946        Self::new(inner)
947    }
948
949    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
950        self.client.into_channel().map_err(|client| Self { client })
951    }
952
953    fn as_channel(&self) -> &::fidl::AsyncChannel {
954        self.client.as_channel()
955    }
956}
957
958impl CaseIteratorProxy {
959    /// Create a new Proxy for fuchsia.test.manager/CaseIterator.
960    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
961        let protocol_name = <CaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
962        Self { client: fidl::client::Client::new(channel, protocol_name) }
963    }
964
965    /// Get a Stream of events from the remote end of the protocol.
966    ///
967    /// # Panics
968    ///
969    /// Panics if the event stream was already taken.
970    pub fn take_event_stream(&self) -> CaseIteratorEventStream {
971        CaseIteratorEventStream { event_receiver: self.client.take_event_receiver() }
972    }
973
974    /// Returns the next batch of test cases when they are available. Returns the empty vector
975    /// to indicate that the iteration is complete.
976    pub fn r#get_next(
977        &self,
978    ) -> fidl::client::QueryResponseFut<Vec<Case>, fidl::encoding::DefaultFuchsiaResourceDialect>
979    {
980        CaseIteratorProxyInterface::r#get_next(self)
981    }
982}
983
984impl CaseIteratorProxyInterface for CaseIteratorProxy {
985    type GetNextResponseFut =
986        fidl::client::QueryResponseFut<Vec<Case>, fidl::encoding::DefaultFuchsiaResourceDialect>;
987    fn r#get_next(&self) -> Self::GetNextResponseFut {
988        fn _decode(
989            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
990        ) -> Result<Vec<Case>, fidl::Error> {
991            let _response = fidl::client::decode_transaction_body::<
992                CaseIteratorGetNextResponse,
993                fidl::encoding::DefaultFuchsiaResourceDialect,
994                0x7583f97b7486467c,
995            >(_buf?)?;
996            Ok(_response.cases)
997        }
998        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Case>>(
999            (),
1000            0x7583f97b7486467c,
1001            fidl::encoding::DynamicFlags::empty(),
1002            _decode,
1003        )
1004    }
1005}
1006
1007pub struct CaseIteratorEventStream {
1008    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1009}
1010
1011impl std::marker::Unpin for CaseIteratorEventStream {}
1012
1013impl futures::stream::FusedStream for CaseIteratorEventStream {
1014    fn is_terminated(&self) -> bool {
1015        self.event_receiver.is_terminated()
1016    }
1017}
1018
1019impl futures::Stream for CaseIteratorEventStream {
1020    type Item = Result<CaseIteratorEvent, fidl::Error>;
1021
1022    fn poll_next(
1023        mut self: std::pin::Pin<&mut Self>,
1024        cx: &mut std::task::Context<'_>,
1025    ) -> std::task::Poll<Option<Self::Item>> {
1026        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1027            &mut self.event_receiver,
1028            cx
1029        )?) {
1030            Some(buf) => std::task::Poll::Ready(Some(CaseIteratorEvent::decode(buf))),
1031            None => std::task::Poll::Ready(None),
1032        }
1033    }
1034}
1035
1036#[derive(Debug)]
1037pub enum CaseIteratorEvent {}
1038
1039impl CaseIteratorEvent {
1040    /// Decodes a message buffer as a [`CaseIteratorEvent`].
1041    fn decode(
1042        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1043    ) -> Result<CaseIteratorEvent, fidl::Error> {
1044        let (bytes, _handles) = buf.split_mut();
1045        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1046        debug_assert_eq!(tx_header.tx_id, 0);
1047        match tx_header.ordinal {
1048            _ => Err(fidl::Error::UnknownOrdinal {
1049                ordinal: tx_header.ordinal,
1050                protocol_name: <CaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1051            }),
1052        }
1053    }
1054}
1055
1056/// A Stream of incoming requests for fuchsia.test.manager/CaseIterator.
1057pub struct CaseIteratorRequestStream {
1058    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1059    is_terminated: bool,
1060}
1061
1062impl std::marker::Unpin for CaseIteratorRequestStream {}
1063
1064impl futures::stream::FusedStream for CaseIteratorRequestStream {
1065    fn is_terminated(&self) -> bool {
1066        self.is_terminated
1067    }
1068}
1069
1070impl fidl::endpoints::RequestStream for CaseIteratorRequestStream {
1071    type Protocol = CaseIteratorMarker;
1072    type ControlHandle = CaseIteratorControlHandle;
1073
1074    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1075        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1076    }
1077
1078    fn control_handle(&self) -> Self::ControlHandle {
1079        CaseIteratorControlHandle { inner: self.inner.clone() }
1080    }
1081
1082    fn into_inner(
1083        self,
1084    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1085    {
1086        (self.inner, self.is_terminated)
1087    }
1088
1089    fn from_inner(
1090        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1091        is_terminated: bool,
1092    ) -> Self {
1093        Self { inner, is_terminated }
1094    }
1095}
1096
1097impl futures::Stream for CaseIteratorRequestStream {
1098    type Item = Result<CaseIteratorRequest, fidl::Error>;
1099
1100    fn poll_next(
1101        mut self: std::pin::Pin<&mut Self>,
1102        cx: &mut std::task::Context<'_>,
1103    ) -> std::task::Poll<Option<Self::Item>> {
1104        let this = &mut *self;
1105        if this.inner.check_shutdown(cx) {
1106            this.is_terminated = true;
1107            return std::task::Poll::Ready(None);
1108        }
1109        if this.is_terminated {
1110            panic!("polled CaseIteratorRequestStream after completion");
1111        }
1112        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1113            |bytes, handles| {
1114                match this.inner.channel().read_etc(cx, bytes, handles) {
1115                    std::task::Poll::Ready(Ok(())) => {}
1116                    std::task::Poll::Pending => return std::task::Poll::Pending,
1117                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1118                        this.is_terminated = true;
1119                        return std::task::Poll::Ready(None);
1120                    }
1121                    std::task::Poll::Ready(Err(e)) => {
1122                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1123                            e.into(),
1124                        ))));
1125                    }
1126                }
1127
1128                // A message has been received from the channel
1129                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1130
1131                std::task::Poll::Ready(Some(match header.ordinal {
1132                    0x7583f97b7486467c => {
1133                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1134                        let mut req = fidl::new_empty!(
1135                            fidl::encoding::EmptyPayload,
1136                            fidl::encoding::DefaultFuchsiaResourceDialect
1137                        );
1138                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1139                        let control_handle =
1140                            CaseIteratorControlHandle { inner: this.inner.clone() };
1141                        Ok(CaseIteratorRequest::GetNext {
1142                            responder: CaseIteratorGetNextResponder {
1143                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1144                                tx_id: header.tx_id,
1145                            },
1146                        })
1147                    }
1148                    _ => Err(fidl::Error::UnknownOrdinal {
1149                        ordinal: header.ordinal,
1150                        protocol_name:
1151                            <CaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1152                    }),
1153                }))
1154            },
1155        )
1156    }
1157}
1158
1159/// Iterator for listing available test cases.
1160#[derive(Debug)]
1161pub enum CaseIteratorRequest {
1162    /// Returns the next batch of test cases when they are available. Returns the empty vector
1163    /// to indicate that the iteration is complete.
1164    GetNext { responder: CaseIteratorGetNextResponder },
1165}
1166
1167impl CaseIteratorRequest {
1168    #[allow(irrefutable_let_patterns)]
1169    pub fn into_get_next(self) -> Option<(CaseIteratorGetNextResponder)> {
1170        if let CaseIteratorRequest::GetNext { responder } = self { Some((responder)) } else { None }
1171    }
1172
1173    /// Name of the method defined in FIDL
1174    pub fn method_name(&self) -> &'static str {
1175        match *self {
1176            CaseIteratorRequest::GetNext { .. } => "get_next",
1177        }
1178    }
1179}
1180
1181#[derive(Debug, Clone)]
1182pub struct CaseIteratorControlHandle {
1183    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1184}
1185
1186impl fidl::endpoints::ControlHandle for CaseIteratorControlHandle {
1187    fn shutdown(&self) {
1188        self.inner.shutdown()
1189    }
1190
1191    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1192        self.inner.shutdown_with_epitaph(status)
1193    }
1194
1195    fn is_closed(&self) -> bool {
1196        self.inner.channel().is_closed()
1197    }
1198    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1199        self.inner.channel().on_closed()
1200    }
1201
1202    #[cfg(target_os = "fuchsia")]
1203    fn signal_peer(
1204        &self,
1205        clear_mask: zx::Signals,
1206        set_mask: zx::Signals,
1207    ) -> Result<(), zx_status::Status> {
1208        use fidl::Peered;
1209        self.inner.channel().signal_peer(clear_mask, set_mask)
1210    }
1211}
1212
1213impl CaseIteratorControlHandle {}
1214
1215#[must_use = "FIDL methods require a response to be sent"]
1216#[derive(Debug)]
1217pub struct CaseIteratorGetNextResponder {
1218    control_handle: std::mem::ManuallyDrop<CaseIteratorControlHandle>,
1219    tx_id: u32,
1220}
1221
1222/// Set the the channel to be shutdown (see [`CaseIteratorControlHandle::shutdown`])
1223/// if the responder is dropped without sending a response, so that the client
1224/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1225impl std::ops::Drop for CaseIteratorGetNextResponder {
1226    fn drop(&mut self) {
1227        self.control_handle.shutdown();
1228        // Safety: drops once, never accessed again
1229        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1230    }
1231}
1232
1233impl fidl::endpoints::Responder for CaseIteratorGetNextResponder {
1234    type ControlHandle = CaseIteratorControlHandle;
1235
1236    fn control_handle(&self) -> &CaseIteratorControlHandle {
1237        &self.control_handle
1238    }
1239
1240    fn drop_without_shutdown(mut self) {
1241        // Safety: drops once, never accessed again due to mem::forget
1242        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1243        // Prevent Drop from running (which would shut down the channel)
1244        std::mem::forget(self);
1245    }
1246}
1247
1248impl CaseIteratorGetNextResponder {
1249    /// Sends a response to the FIDL transaction.
1250    ///
1251    /// Sets the channel to shutdown if an error occurs.
1252    pub fn send(self, mut cases: &[Case]) -> Result<(), fidl::Error> {
1253        let _result = self.send_raw(cases);
1254        if _result.is_err() {
1255            self.control_handle.shutdown();
1256        }
1257        self.drop_without_shutdown();
1258        _result
1259    }
1260
1261    /// Similar to "send" but does not shutdown the channel if an error occurs.
1262    pub fn send_no_shutdown_on_err(self, mut cases: &[Case]) -> Result<(), fidl::Error> {
1263        let _result = self.send_raw(cases);
1264        self.drop_without_shutdown();
1265        _result
1266    }
1267
1268    fn send_raw(&self, mut cases: &[Case]) -> Result<(), fidl::Error> {
1269        self.control_handle.inner.send::<CaseIteratorGetNextResponse>(
1270            (cases,),
1271            self.tx_id,
1272            0x7583f97b7486467c,
1273            fidl::encoding::DynamicFlags::empty(),
1274        )
1275    }
1276}
1277
1278#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1279pub struct DebugDataIteratorMarker;
1280
1281impl fidl::endpoints::ProtocolMarker for DebugDataIteratorMarker {
1282    type Proxy = DebugDataIteratorProxy;
1283    type RequestStream = DebugDataIteratorRequestStream;
1284    #[cfg(target_os = "fuchsia")]
1285    type SynchronousProxy = DebugDataIteratorSynchronousProxy;
1286
1287    const DEBUG_NAME: &'static str = "(anonymous) DebugDataIterator";
1288}
1289
1290pub trait DebugDataIteratorProxyInterface: Send + Sync {
1291    type GetNextResponseFut: std::future::Future<Output = Result<Vec<DebugData>, fidl::Error>>
1292        + Send;
1293    fn r#get_next(&self) -> Self::GetNextResponseFut;
1294    type GetNextCompressedResponseFut: std::future::Future<Output = Result<Vec<DebugData>, fidl::Error>>
1295        + Send;
1296    fn r#get_next_compressed(&self) -> Self::GetNextCompressedResponseFut;
1297}
1298#[derive(Debug)]
1299#[cfg(target_os = "fuchsia")]
1300pub struct DebugDataIteratorSynchronousProxy {
1301    client: fidl::client::sync::Client,
1302}
1303
1304#[cfg(target_os = "fuchsia")]
1305impl fidl::endpoints::SynchronousProxy for DebugDataIteratorSynchronousProxy {
1306    type Proxy = DebugDataIteratorProxy;
1307    type Protocol = DebugDataIteratorMarker;
1308
1309    fn from_channel(inner: fidl::Channel) -> Self {
1310        Self::new(inner)
1311    }
1312
1313    fn into_channel(self) -> fidl::Channel {
1314        self.client.into_channel()
1315    }
1316
1317    fn as_channel(&self) -> &fidl::Channel {
1318        self.client.as_channel()
1319    }
1320}
1321
1322#[cfg(target_os = "fuchsia")]
1323impl DebugDataIteratorSynchronousProxy {
1324    pub fn new(channel: fidl::Channel) -> Self {
1325        let protocol_name =
1326            <DebugDataIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1327        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1328    }
1329
1330    pub fn into_channel(self) -> fidl::Channel {
1331        self.client.into_channel()
1332    }
1333
1334    /// Waits until an event arrives and returns it. It is safe for other
1335    /// threads to make concurrent requests while waiting for an event.
1336    pub fn wait_for_event(
1337        &self,
1338        deadline: zx::MonotonicInstant,
1339    ) -> Result<DebugDataIteratorEvent, fidl::Error> {
1340        DebugDataIteratorEvent::decode(self.client.wait_for_event(deadline)?)
1341    }
1342
1343    /// Retrieve the next batch of debug data. This is a hanging get; if no data is
1344    /// immediately available, the call hangs until data is available. After all data has
1345    /// been returned, the call returns an empty vector.
1346    pub fn r#get_next(
1347        &self,
1348        ___deadline: zx::MonotonicInstant,
1349    ) -> Result<Vec<DebugData>, fidl::Error> {
1350        let _response = self
1351            .client
1352            .send_query::<fidl::encoding::EmptyPayload, DebugDataIteratorGetNextResponse>(
1353                (),
1354                0x9ef24c823f5ad60,
1355                fidl::encoding::DynamicFlags::empty(),
1356                ___deadline,
1357            )?;
1358        Ok(_response.data)
1359    }
1360
1361    /// Retrieve the next batch of debug data (compressed using zstd). This is
1362    /// a hanging get; if no data is immediately available, the call hangs until
1363    /// data is available. After all data has been returned, the call returns an empty vector.
1364    pub fn r#get_next_compressed(
1365        &self,
1366        ___deadline: zx::MonotonicInstant,
1367    ) -> Result<Vec<DebugData>, fidl::Error> {
1368        let _response = self
1369            .client
1370            .send_query::<fidl::encoding::EmptyPayload, DebugDataIteratorGetNextCompressedResponse>(
1371                (),
1372                0x6765e9cb918301f4,
1373                fidl::encoding::DynamicFlags::empty(),
1374                ___deadline,
1375            )?;
1376        Ok(_response.data)
1377    }
1378}
1379
1380#[cfg(target_os = "fuchsia")]
1381impl From<DebugDataIteratorSynchronousProxy> for zx::NullableHandle {
1382    fn from(value: DebugDataIteratorSynchronousProxy) -> Self {
1383        value.into_channel().into()
1384    }
1385}
1386
1387#[cfg(target_os = "fuchsia")]
1388impl From<fidl::Channel> for DebugDataIteratorSynchronousProxy {
1389    fn from(value: fidl::Channel) -> Self {
1390        Self::new(value)
1391    }
1392}
1393
1394#[cfg(target_os = "fuchsia")]
1395impl fidl::endpoints::FromClient for DebugDataIteratorSynchronousProxy {
1396    type Protocol = DebugDataIteratorMarker;
1397
1398    fn from_client(value: fidl::endpoints::ClientEnd<DebugDataIteratorMarker>) -> Self {
1399        Self::new(value.into_channel())
1400    }
1401}
1402
1403#[derive(Debug, Clone)]
1404pub struct DebugDataIteratorProxy {
1405    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1406}
1407
1408impl fidl::endpoints::Proxy for DebugDataIteratorProxy {
1409    type Protocol = DebugDataIteratorMarker;
1410
1411    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1412        Self::new(inner)
1413    }
1414
1415    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1416        self.client.into_channel().map_err(|client| Self { client })
1417    }
1418
1419    fn as_channel(&self) -> &::fidl::AsyncChannel {
1420        self.client.as_channel()
1421    }
1422}
1423
1424impl DebugDataIteratorProxy {
1425    /// Create a new Proxy for fuchsia.test.manager/DebugDataIterator.
1426    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1427        let protocol_name =
1428            <DebugDataIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1429        Self { client: fidl::client::Client::new(channel, protocol_name) }
1430    }
1431
1432    /// Get a Stream of events from the remote end of the protocol.
1433    ///
1434    /// # Panics
1435    ///
1436    /// Panics if the event stream was already taken.
1437    pub fn take_event_stream(&self) -> DebugDataIteratorEventStream {
1438        DebugDataIteratorEventStream { event_receiver: self.client.take_event_receiver() }
1439    }
1440
1441    /// Retrieve the next batch of debug data. This is a hanging get; if no data is
1442    /// immediately available, the call hangs until data is available. After all data has
1443    /// been returned, the call returns an empty vector.
1444    pub fn r#get_next(
1445        &self,
1446    ) -> fidl::client::QueryResponseFut<Vec<DebugData>, fidl::encoding::DefaultFuchsiaResourceDialect>
1447    {
1448        DebugDataIteratorProxyInterface::r#get_next(self)
1449    }
1450
1451    /// Retrieve the next batch of debug data (compressed using zstd). This is
1452    /// a hanging get; if no data is immediately available, the call hangs until
1453    /// data is available. After all data has been returned, the call returns an empty vector.
1454    pub fn r#get_next_compressed(
1455        &self,
1456    ) -> fidl::client::QueryResponseFut<Vec<DebugData>, fidl::encoding::DefaultFuchsiaResourceDialect>
1457    {
1458        DebugDataIteratorProxyInterface::r#get_next_compressed(self)
1459    }
1460}
1461
1462impl DebugDataIteratorProxyInterface for DebugDataIteratorProxy {
1463    type GetNextResponseFut = fidl::client::QueryResponseFut<
1464        Vec<DebugData>,
1465        fidl::encoding::DefaultFuchsiaResourceDialect,
1466    >;
1467    fn r#get_next(&self) -> Self::GetNextResponseFut {
1468        fn _decode(
1469            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1470        ) -> Result<Vec<DebugData>, fidl::Error> {
1471            let _response = fidl::client::decode_transaction_body::<
1472                DebugDataIteratorGetNextResponse,
1473                fidl::encoding::DefaultFuchsiaResourceDialect,
1474                0x9ef24c823f5ad60,
1475            >(_buf?)?;
1476            Ok(_response.data)
1477        }
1478        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<DebugData>>(
1479            (),
1480            0x9ef24c823f5ad60,
1481            fidl::encoding::DynamicFlags::empty(),
1482            _decode,
1483        )
1484    }
1485
1486    type GetNextCompressedResponseFut = fidl::client::QueryResponseFut<
1487        Vec<DebugData>,
1488        fidl::encoding::DefaultFuchsiaResourceDialect,
1489    >;
1490    fn r#get_next_compressed(&self) -> Self::GetNextCompressedResponseFut {
1491        fn _decode(
1492            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1493        ) -> Result<Vec<DebugData>, fidl::Error> {
1494            let _response = fidl::client::decode_transaction_body::<
1495                DebugDataIteratorGetNextCompressedResponse,
1496                fidl::encoding::DefaultFuchsiaResourceDialect,
1497                0x6765e9cb918301f4,
1498            >(_buf?)?;
1499            Ok(_response.data)
1500        }
1501        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<DebugData>>(
1502            (),
1503            0x6765e9cb918301f4,
1504            fidl::encoding::DynamicFlags::empty(),
1505            _decode,
1506        )
1507    }
1508}
1509
1510pub struct DebugDataIteratorEventStream {
1511    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1512}
1513
1514impl std::marker::Unpin for DebugDataIteratorEventStream {}
1515
1516impl futures::stream::FusedStream for DebugDataIteratorEventStream {
1517    fn is_terminated(&self) -> bool {
1518        self.event_receiver.is_terminated()
1519    }
1520}
1521
1522impl futures::Stream for DebugDataIteratorEventStream {
1523    type Item = Result<DebugDataIteratorEvent, fidl::Error>;
1524
1525    fn poll_next(
1526        mut self: std::pin::Pin<&mut Self>,
1527        cx: &mut std::task::Context<'_>,
1528    ) -> std::task::Poll<Option<Self::Item>> {
1529        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1530            &mut self.event_receiver,
1531            cx
1532        )?) {
1533            Some(buf) => std::task::Poll::Ready(Some(DebugDataIteratorEvent::decode(buf))),
1534            None => std::task::Poll::Ready(None),
1535        }
1536    }
1537}
1538
1539#[derive(Debug)]
1540pub enum DebugDataIteratorEvent {}
1541
1542impl DebugDataIteratorEvent {
1543    /// Decodes a message buffer as a [`DebugDataIteratorEvent`].
1544    fn decode(
1545        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1546    ) -> Result<DebugDataIteratorEvent, fidl::Error> {
1547        let (bytes, _handles) = buf.split_mut();
1548        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1549        debug_assert_eq!(tx_header.tx_id, 0);
1550        match tx_header.ordinal {
1551            _ => Err(fidl::Error::UnknownOrdinal {
1552                ordinal: tx_header.ordinal,
1553                protocol_name:
1554                    <DebugDataIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1555            }),
1556        }
1557    }
1558}
1559
1560/// A Stream of incoming requests for fuchsia.test.manager/DebugDataIterator.
1561pub struct DebugDataIteratorRequestStream {
1562    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1563    is_terminated: bool,
1564}
1565
1566impl std::marker::Unpin for DebugDataIteratorRequestStream {}
1567
1568impl futures::stream::FusedStream for DebugDataIteratorRequestStream {
1569    fn is_terminated(&self) -> bool {
1570        self.is_terminated
1571    }
1572}
1573
1574impl fidl::endpoints::RequestStream for DebugDataIteratorRequestStream {
1575    type Protocol = DebugDataIteratorMarker;
1576    type ControlHandle = DebugDataIteratorControlHandle;
1577
1578    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1579        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1580    }
1581
1582    fn control_handle(&self) -> Self::ControlHandle {
1583        DebugDataIteratorControlHandle { inner: self.inner.clone() }
1584    }
1585
1586    fn into_inner(
1587        self,
1588    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1589    {
1590        (self.inner, self.is_terminated)
1591    }
1592
1593    fn from_inner(
1594        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1595        is_terminated: bool,
1596    ) -> Self {
1597        Self { inner, is_terminated }
1598    }
1599}
1600
1601impl futures::Stream for DebugDataIteratorRequestStream {
1602    type Item = Result<DebugDataIteratorRequest, fidl::Error>;
1603
1604    fn poll_next(
1605        mut self: std::pin::Pin<&mut Self>,
1606        cx: &mut std::task::Context<'_>,
1607    ) -> std::task::Poll<Option<Self::Item>> {
1608        let this = &mut *self;
1609        if this.inner.check_shutdown(cx) {
1610            this.is_terminated = true;
1611            return std::task::Poll::Ready(None);
1612        }
1613        if this.is_terminated {
1614            panic!("polled DebugDataIteratorRequestStream after completion");
1615        }
1616        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1617            |bytes, handles| {
1618                match this.inner.channel().read_etc(cx, bytes, handles) {
1619                    std::task::Poll::Ready(Ok(())) => {}
1620                    std::task::Poll::Pending => return std::task::Poll::Pending,
1621                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1622                        this.is_terminated = true;
1623                        return std::task::Poll::Ready(None);
1624                    }
1625                    std::task::Poll::Ready(Err(e)) => {
1626                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1627                            e.into(),
1628                        ))));
1629                    }
1630                }
1631
1632                // A message has been received from the channel
1633                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1634
1635                std::task::Poll::Ready(Some(match header.ordinal {
1636                    0x9ef24c823f5ad60 => {
1637                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1638                        let mut req = fidl::new_empty!(
1639                            fidl::encoding::EmptyPayload,
1640                            fidl::encoding::DefaultFuchsiaResourceDialect
1641                        );
1642                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1643                        let control_handle =
1644                            DebugDataIteratorControlHandle { inner: this.inner.clone() };
1645                        Ok(DebugDataIteratorRequest::GetNext {
1646                            responder: DebugDataIteratorGetNextResponder {
1647                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1648                                tx_id: header.tx_id,
1649                            },
1650                        })
1651                    }
1652                    0x6765e9cb918301f4 => {
1653                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1654                        let mut req = fidl::new_empty!(
1655                            fidl::encoding::EmptyPayload,
1656                            fidl::encoding::DefaultFuchsiaResourceDialect
1657                        );
1658                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1659                        let control_handle =
1660                            DebugDataIteratorControlHandle { inner: this.inner.clone() };
1661                        Ok(DebugDataIteratorRequest::GetNextCompressed {
1662                            responder: DebugDataIteratorGetNextCompressedResponder {
1663                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1664                                tx_id: header.tx_id,
1665                            },
1666                        })
1667                    }
1668                    _ => Err(fidl::Error::UnknownOrdinal {
1669                        ordinal: header.ordinal,
1670                        protocol_name:
1671                            <DebugDataIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1672                    }),
1673                }))
1674            },
1675        )
1676    }
1677}
1678
1679/// An iterator protocol over which a client may retrieve debug data information.
1680#[derive(Debug)]
1681pub enum DebugDataIteratorRequest {
1682    /// Retrieve the next batch of debug data. This is a hanging get; if no data is
1683    /// immediately available, the call hangs until data is available. After all data has
1684    /// been returned, the call returns an empty vector.
1685    GetNext { responder: DebugDataIteratorGetNextResponder },
1686    /// Retrieve the next batch of debug data (compressed using zstd). This is
1687    /// a hanging get; if no data is immediately available, the call hangs until
1688    /// data is available. After all data has been returned, the call returns an empty vector.
1689    GetNextCompressed { responder: DebugDataIteratorGetNextCompressedResponder },
1690}
1691
1692impl DebugDataIteratorRequest {
1693    #[allow(irrefutable_let_patterns)]
1694    pub fn into_get_next(self) -> Option<(DebugDataIteratorGetNextResponder)> {
1695        if let DebugDataIteratorRequest::GetNext { responder } = self {
1696            Some((responder))
1697        } else {
1698            None
1699        }
1700    }
1701
1702    #[allow(irrefutable_let_patterns)]
1703    pub fn into_get_next_compressed(self) -> Option<(DebugDataIteratorGetNextCompressedResponder)> {
1704        if let DebugDataIteratorRequest::GetNextCompressed { responder } = self {
1705            Some((responder))
1706        } else {
1707            None
1708        }
1709    }
1710
1711    /// Name of the method defined in FIDL
1712    pub fn method_name(&self) -> &'static str {
1713        match *self {
1714            DebugDataIteratorRequest::GetNext { .. } => "get_next",
1715            DebugDataIteratorRequest::GetNextCompressed { .. } => "get_next_compressed",
1716        }
1717    }
1718}
1719
1720#[derive(Debug, Clone)]
1721pub struct DebugDataIteratorControlHandle {
1722    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1723}
1724
1725impl fidl::endpoints::ControlHandle for DebugDataIteratorControlHandle {
1726    fn shutdown(&self) {
1727        self.inner.shutdown()
1728    }
1729
1730    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1731        self.inner.shutdown_with_epitaph(status)
1732    }
1733
1734    fn is_closed(&self) -> bool {
1735        self.inner.channel().is_closed()
1736    }
1737    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1738        self.inner.channel().on_closed()
1739    }
1740
1741    #[cfg(target_os = "fuchsia")]
1742    fn signal_peer(
1743        &self,
1744        clear_mask: zx::Signals,
1745        set_mask: zx::Signals,
1746    ) -> Result<(), zx_status::Status> {
1747        use fidl::Peered;
1748        self.inner.channel().signal_peer(clear_mask, set_mask)
1749    }
1750}
1751
1752impl DebugDataIteratorControlHandle {}
1753
1754#[must_use = "FIDL methods require a response to be sent"]
1755#[derive(Debug)]
1756pub struct DebugDataIteratorGetNextResponder {
1757    control_handle: std::mem::ManuallyDrop<DebugDataIteratorControlHandle>,
1758    tx_id: u32,
1759}
1760
1761/// Set the the channel to be shutdown (see [`DebugDataIteratorControlHandle::shutdown`])
1762/// if the responder is dropped without sending a response, so that the client
1763/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1764impl std::ops::Drop for DebugDataIteratorGetNextResponder {
1765    fn drop(&mut self) {
1766        self.control_handle.shutdown();
1767        // Safety: drops once, never accessed again
1768        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1769    }
1770}
1771
1772impl fidl::endpoints::Responder for DebugDataIteratorGetNextResponder {
1773    type ControlHandle = DebugDataIteratorControlHandle;
1774
1775    fn control_handle(&self) -> &DebugDataIteratorControlHandle {
1776        &self.control_handle
1777    }
1778
1779    fn drop_without_shutdown(mut self) {
1780        // Safety: drops once, never accessed again due to mem::forget
1781        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1782        // Prevent Drop from running (which would shut down the channel)
1783        std::mem::forget(self);
1784    }
1785}
1786
1787impl DebugDataIteratorGetNextResponder {
1788    /// Sends a response to the FIDL transaction.
1789    ///
1790    /// Sets the channel to shutdown if an error occurs.
1791    pub fn send(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1792        let _result = self.send_raw(data);
1793        if _result.is_err() {
1794            self.control_handle.shutdown();
1795        }
1796        self.drop_without_shutdown();
1797        _result
1798    }
1799
1800    /// Similar to "send" but does not shutdown the channel if an error occurs.
1801    pub fn send_no_shutdown_on_err(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1802        let _result = self.send_raw(data);
1803        self.drop_without_shutdown();
1804        _result
1805    }
1806
1807    fn send_raw(&self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1808        self.control_handle.inner.send::<DebugDataIteratorGetNextResponse>(
1809            (data.as_mut(),),
1810            self.tx_id,
1811            0x9ef24c823f5ad60,
1812            fidl::encoding::DynamicFlags::empty(),
1813        )
1814    }
1815}
1816
1817#[must_use = "FIDL methods require a response to be sent"]
1818#[derive(Debug)]
1819pub struct DebugDataIteratorGetNextCompressedResponder {
1820    control_handle: std::mem::ManuallyDrop<DebugDataIteratorControlHandle>,
1821    tx_id: u32,
1822}
1823
1824/// Set the the channel to be shutdown (see [`DebugDataIteratorControlHandle::shutdown`])
1825/// if the responder is dropped without sending a response, so that the client
1826/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1827impl std::ops::Drop for DebugDataIteratorGetNextCompressedResponder {
1828    fn drop(&mut self) {
1829        self.control_handle.shutdown();
1830        // Safety: drops once, never accessed again
1831        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1832    }
1833}
1834
1835impl fidl::endpoints::Responder for DebugDataIteratorGetNextCompressedResponder {
1836    type ControlHandle = DebugDataIteratorControlHandle;
1837
1838    fn control_handle(&self) -> &DebugDataIteratorControlHandle {
1839        &self.control_handle
1840    }
1841
1842    fn drop_without_shutdown(mut self) {
1843        // Safety: drops once, never accessed again due to mem::forget
1844        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1845        // Prevent Drop from running (which would shut down the channel)
1846        std::mem::forget(self);
1847    }
1848}
1849
1850impl DebugDataIteratorGetNextCompressedResponder {
1851    /// Sends a response to the FIDL transaction.
1852    ///
1853    /// Sets the channel to shutdown if an error occurs.
1854    pub fn send(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1855        let _result = self.send_raw(data);
1856        if _result.is_err() {
1857            self.control_handle.shutdown();
1858        }
1859        self.drop_without_shutdown();
1860        _result
1861    }
1862
1863    /// Similar to "send" but does not shutdown the channel if an error occurs.
1864    pub fn send_no_shutdown_on_err(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1865        let _result = self.send_raw(data);
1866        self.drop_without_shutdown();
1867        _result
1868    }
1869
1870    fn send_raw(&self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1871        self.control_handle.inner.send::<DebugDataIteratorGetNextCompressedResponse>(
1872            (data.as_mut(),),
1873            self.tx_id,
1874            0x6765e9cb918301f4,
1875            fidl::encoding::DynamicFlags::empty(),
1876        )
1877    }
1878}
1879
1880#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1881pub struct EarlyBootProfileMarker;
1882
1883impl fidl::endpoints::ProtocolMarker for EarlyBootProfileMarker {
1884    type Proxy = EarlyBootProfileProxy;
1885    type RequestStream = EarlyBootProfileRequestStream;
1886    #[cfg(target_os = "fuchsia")]
1887    type SynchronousProxy = EarlyBootProfileSynchronousProxy;
1888
1889    const DEBUG_NAME: &'static str = "fuchsia.test.manager.EarlyBootProfile";
1890}
1891impl fidl::endpoints::DiscoverableProtocolMarker for EarlyBootProfileMarker {}
1892
1893pub trait EarlyBootProfileProxyInterface: Send + Sync {
1894    fn r#register_watcher(
1895        &self,
1896        iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
1897    ) -> Result<(), fidl::Error>;
1898}
1899#[derive(Debug)]
1900#[cfg(target_os = "fuchsia")]
1901pub struct EarlyBootProfileSynchronousProxy {
1902    client: fidl::client::sync::Client,
1903}
1904
1905#[cfg(target_os = "fuchsia")]
1906impl fidl::endpoints::SynchronousProxy for EarlyBootProfileSynchronousProxy {
1907    type Proxy = EarlyBootProfileProxy;
1908    type Protocol = EarlyBootProfileMarker;
1909
1910    fn from_channel(inner: fidl::Channel) -> Self {
1911        Self::new(inner)
1912    }
1913
1914    fn into_channel(self) -> fidl::Channel {
1915        self.client.into_channel()
1916    }
1917
1918    fn as_channel(&self) -> &fidl::Channel {
1919        self.client.as_channel()
1920    }
1921}
1922
1923#[cfg(target_os = "fuchsia")]
1924impl EarlyBootProfileSynchronousProxy {
1925    pub fn new(channel: fidl::Channel) -> Self {
1926        let protocol_name = <EarlyBootProfileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1927        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1928    }
1929
1930    pub fn into_channel(self) -> fidl::Channel {
1931        self.client.into_channel()
1932    }
1933
1934    /// Waits until an event arrives and returns it. It is safe for other
1935    /// threads to make concurrent requests while waiting for an event.
1936    pub fn wait_for_event(
1937        &self,
1938        deadline: zx::MonotonicInstant,
1939    ) -> Result<EarlyBootProfileEvent, fidl::Error> {
1940        EarlyBootProfileEvent::decode(self.client.wait_for_event(deadline)?)
1941    }
1942
1943    /// Register iterator for watching early boot profiles.
1944    pub fn r#register_watcher(
1945        &self,
1946        mut iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
1947    ) -> Result<(), fidl::Error> {
1948        self.client.send::<EarlyBootProfileRegisterWatcherRequest>(
1949            (iterator,),
1950            0x6bd6b03803b93715,
1951            fidl::encoding::DynamicFlags::empty(),
1952        )
1953    }
1954}
1955
1956#[cfg(target_os = "fuchsia")]
1957impl From<EarlyBootProfileSynchronousProxy> for zx::NullableHandle {
1958    fn from(value: EarlyBootProfileSynchronousProxy) -> Self {
1959        value.into_channel().into()
1960    }
1961}
1962
1963#[cfg(target_os = "fuchsia")]
1964impl From<fidl::Channel> for EarlyBootProfileSynchronousProxy {
1965    fn from(value: fidl::Channel) -> Self {
1966        Self::new(value)
1967    }
1968}
1969
1970#[cfg(target_os = "fuchsia")]
1971impl fidl::endpoints::FromClient for EarlyBootProfileSynchronousProxy {
1972    type Protocol = EarlyBootProfileMarker;
1973
1974    fn from_client(value: fidl::endpoints::ClientEnd<EarlyBootProfileMarker>) -> Self {
1975        Self::new(value.into_channel())
1976    }
1977}
1978
1979#[derive(Debug, Clone)]
1980pub struct EarlyBootProfileProxy {
1981    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1982}
1983
1984impl fidl::endpoints::Proxy for EarlyBootProfileProxy {
1985    type Protocol = EarlyBootProfileMarker;
1986
1987    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1988        Self::new(inner)
1989    }
1990
1991    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1992        self.client.into_channel().map_err(|client| Self { client })
1993    }
1994
1995    fn as_channel(&self) -> &::fidl::AsyncChannel {
1996        self.client.as_channel()
1997    }
1998}
1999
2000impl EarlyBootProfileProxy {
2001    /// Create a new Proxy for fuchsia.test.manager/EarlyBootProfile.
2002    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2003        let protocol_name = <EarlyBootProfileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2004        Self { client: fidl::client::Client::new(channel, protocol_name) }
2005    }
2006
2007    /// Get a Stream of events from the remote end of the protocol.
2008    ///
2009    /// # Panics
2010    ///
2011    /// Panics if the event stream was already taken.
2012    pub fn take_event_stream(&self) -> EarlyBootProfileEventStream {
2013        EarlyBootProfileEventStream { event_receiver: self.client.take_event_receiver() }
2014    }
2015
2016    /// Register iterator for watching early boot profiles.
2017    pub fn r#register_watcher(
2018        &self,
2019        mut iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
2020    ) -> Result<(), fidl::Error> {
2021        EarlyBootProfileProxyInterface::r#register_watcher(self, iterator)
2022    }
2023}
2024
2025impl EarlyBootProfileProxyInterface for EarlyBootProfileProxy {
2026    fn r#register_watcher(
2027        &self,
2028        mut iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
2029    ) -> Result<(), fidl::Error> {
2030        self.client.send::<EarlyBootProfileRegisterWatcherRequest>(
2031            (iterator,),
2032            0x6bd6b03803b93715,
2033            fidl::encoding::DynamicFlags::empty(),
2034        )
2035    }
2036}
2037
2038pub struct EarlyBootProfileEventStream {
2039    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2040}
2041
2042impl std::marker::Unpin for EarlyBootProfileEventStream {}
2043
2044impl futures::stream::FusedStream for EarlyBootProfileEventStream {
2045    fn is_terminated(&self) -> bool {
2046        self.event_receiver.is_terminated()
2047    }
2048}
2049
2050impl futures::Stream for EarlyBootProfileEventStream {
2051    type Item = Result<EarlyBootProfileEvent, fidl::Error>;
2052
2053    fn poll_next(
2054        mut self: std::pin::Pin<&mut Self>,
2055        cx: &mut std::task::Context<'_>,
2056    ) -> std::task::Poll<Option<Self::Item>> {
2057        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2058            &mut self.event_receiver,
2059            cx
2060        )?) {
2061            Some(buf) => std::task::Poll::Ready(Some(EarlyBootProfileEvent::decode(buf))),
2062            None => std::task::Poll::Ready(None),
2063        }
2064    }
2065}
2066
2067#[derive(Debug)]
2068pub enum EarlyBootProfileEvent {
2069    #[non_exhaustive]
2070    _UnknownEvent {
2071        /// Ordinal of the event that was sent.
2072        ordinal: u64,
2073    },
2074}
2075
2076impl EarlyBootProfileEvent {
2077    /// Decodes a message buffer as a [`EarlyBootProfileEvent`].
2078    fn decode(
2079        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2080    ) -> Result<EarlyBootProfileEvent, fidl::Error> {
2081        let (bytes, _handles) = buf.split_mut();
2082        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2083        debug_assert_eq!(tx_header.tx_id, 0);
2084        match tx_header.ordinal {
2085            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2086                Ok(EarlyBootProfileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2087            }
2088            _ => Err(fidl::Error::UnknownOrdinal {
2089                ordinal: tx_header.ordinal,
2090                protocol_name:
2091                    <EarlyBootProfileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2092            }),
2093        }
2094    }
2095}
2096
2097/// A Stream of incoming requests for fuchsia.test.manager/EarlyBootProfile.
2098pub struct EarlyBootProfileRequestStream {
2099    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2100    is_terminated: bool,
2101}
2102
2103impl std::marker::Unpin for EarlyBootProfileRequestStream {}
2104
2105impl futures::stream::FusedStream for EarlyBootProfileRequestStream {
2106    fn is_terminated(&self) -> bool {
2107        self.is_terminated
2108    }
2109}
2110
2111impl fidl::endpoints::RequestStream for EarlyBootProfileRequestStream {
2112    type Protocol = EarlyBootProfileMarker;
2113    type ControlHandle = EarlyBootProfileControlHandle;
2114
2115    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2116        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2117    }
2118
2119    fn control_handle(&self) -> Self::ControlHandle {
2120        EarlyBootProfileControlHandle { inner: self.inner.clone() }
2121    }
2122
2123    fn into_inner(
2124        self,
2125    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2126    {
2127        (self.inner, self.is_terminated)
2128    }
2129
2130    fn from_inner(
2131        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2132        is_terminated: bool,
2133    ) -> Self {
2134        Self { inner, is_terminated }
2135    }
2136}
2137
2138impl futures::Stream for EarlyBootProfileRequestStream {
2139    type Item = Result<EarlyBootProfileRequest, fidl::Error>;
2140
2141    fn poll_next(
2142        mut self: std::pin::Pin<&mut Self>,
2143        cx: &mut std::task::Context<'_>,
2144    ) -> std::task::Poll<Option<Self::Item>> {
2145        let this = &mut *self;
2146        if this.inner.check_shutdown(cx) {
2147            this.is_terminated = true;
2148            return std::task::Poll::Ready(None);
2149        }
2150        if this.is_terminated {
2151            panic!("polled EarlyBootProfileRequestStream after completion");
2152        }
2153        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2154            |bytes, handles| {
2155                match this.inner.channel().read_etc(cx, bytes, handles) {
2156                    std::task::Poll::Ready(Ok(())) => {}
2157                    std::task::Poll::Pending => return std::task::Poll::Pending,
2158                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2159                        this.is_terminated = true;
2160                        return std::task::Poll::Ready(None);
2161                    }
2162                    std::task::Poll::Ready(Err(e)) => {
2163                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2164                            e.into(),
2165                        ))));
2166                    }
2167                }
2168
2169                // A message has been received from the channel
2170                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2171
2172                std::task::Poll::Ready(Some(match header.ordinal {
2173                    0x6bd6b03803b93715 => {
2174                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2175                        let mut req = fidl::new_empty!(
2176                            EarlyBootProfileRegisterWatcherRequest,
2177                            fidl::encoding::DefaultFuchsiaResourceDialect
2178                        );
2179                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EarlyBootProfileRegisterWatcherRequest>(&header, _body_bytes, handles, &mut req)?;
2180                        let control_handle =
2181                            EarlyBootProfileControlHandle { inner: this.inner.clone() };
2182                        Ok(EarlyBootProfileRequest::RegisterWatcher {
2183                            iterator: req.iterator,
2184
2185                            control_handle,
2186                        })
2187                    }
2188                    _ if header.tx_id == 0
2189                        && header
2190                            .dynamic_flags()
2191                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2192                    {
2193                        Ok(EarlyBootProfileRequest::_UnknownMethod {
2194                            ordinal: header.ordinal,
2195                            control_handle: EarlyBootProfileControlHandle {
2196                                inner: this.inner.clone(),
2197                            },
2198                            method_type: fidl::MethodType::OneWay,
2199                        })
2200                    }
2201                    _ if header
2202                        .dynamic_flags()
2203                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2204                    {
2205                        this.inner.send_framework_err(
2206                            fidl::encoding::FrameworkErr::UnknownMethod,
2207                            header.tx_id,
2208                            header.ordinal,
2209                            header.dynamic_flags(),
2210                            (bytes, handles),
2211                        )?;
2212                        Ok(EarlyBootProfileRequest::_UnknownMethod {
2213                            ordinal: header.ordinal,
2214                            control_handle: EarlyBootProfileControlHandle {
2215                                inner: this.inner.clone(),
2216                            },
2217                            method_type: fidl::MethodType::TwoWay,
2218                        })
2219                    }
2220                    _ => Err(fidl::Error::UnknownOrdinal {
2221                        ordinal: header.ordinal,
2222                        protocol_name:
2223                            <EarlyBootProfileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2224                    }),
2225                }))
2226            },
2227        )
2228    }
2229}
2230
2231/// Protocol to manage Early boot profiles. This should be called by our clients
2232/// after running all the tests.
2233#[derive(Debug)]
2234pub enum EarlyBootProfileRequest {
2235    /// Register iterator for watching early boot profiles.
2236    RegisterWatcher {
2237        iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
2238        control_handle: EarlyBootProfileControlHandle,
2239    },
2240    /// An interaction was received which does not match any known method.
2241    #[non_exhaustive]
2242    _UnknownMethod {
2243        /// Ordinal of the method that was called.
2244        ordinal: u64,
2245        control_handle: EarlyBootProfileControlHandle,
2246        method_type: fidl::MethodType,
2247    },
2248}
2249
2250impl EarlyBootProfileRequest {
2251    #[allow(irrefutable_let_patterns)]
2252    pub fn into_register_watcher(
2253        self,
2254    ) -> Option<(fidl::endpoints::ServerEnd<DebugDataIteratorMarker>, EarlyBootProfileControlHandle)>
2255    {
2256        if let EarlyBootProfileRequest::RegisterWatcher { iterator, control_handle } = self {
2257            Some((iterator, control_handle))
2258        } else {
2259            None
2260        }
2261    }
2262
2263    /// Name of the method defined in FIDL
2264    pub fn method_name(&self) -> &'static str {
2265        match *self {
2266            EarlyBootProfileRequest::RegisterWatcher { .. } => "register_watcher",
2267            EarlyBootProfileRequest::_UnknownMethod {
2268                method_type: fidl::MethodType::OneWay,
2269                ..
2270            } => "unknown one-way method",
2271            EarlyBootProfileRequest::_UnknownMethod {
2272                method_type: fidl::MethodType::TwoWay,
2273                ..
2274            } => "unknown two-way method",
2275        }
2276    }
2277}
2278
2279#[derive(Debug, Clone)]
2280pub struct EarlyBootProfileControlHandle {
2281    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2282}
2283
2284impl fidl::endpoints::ControlHandle for EarlyBootProfileControlHandle {
2285    fn shutdown(&self) {
2286        self.inner.shutdown()
2287    }
2288
2289    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2290        self.inner.shutdown_with_epitaph(status)
2291    }
2292
2293    fn is_closed(&self) -> bool {
2294        self.inner.channel().is_closed()
2295    }
2296    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2297        self.inner.channel().on_closed()
2298    }
2299
2300    #[cfg(target_os = "fuchsia")]
2301    fn signal_peer(
2302        &self,
2303        clear_mask: zx::Signals,
2304        set_mask: zx::Signals,
2305    ) -> Result<(), zx_status::Status> {
2306        use fidl::Peered;
2307        self.inner.channel().signal_peer(clear_mask, set_mask)
2308    }
2309}
2310
2311impl EarlyBootProfileControlHandle {}
2312
2313#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2314pub struct QueryMarker;
2315
2316impl fidl::endpoints::ProtocolMarker for QueryMarker {
2317    type Proxy = QueryProxy;
2318    type RequestStream = QueryRequestStream;
2319    #[cfg(target_os = "fuchsia")]
2320    type SynchronousProxy = QuerySynchronousProxy;
2321
2322    const DEBUG_NAME: &'static str = "fuchsia.test.manager.Query";
2323}
2324impl fidl::endpoints::DiscoverableProtocolMarker for QueryMarker {}
2325pub type QueryEnumerateResult = Result<(), LaunchError>;
2326pub type QueryEnumerateInRealmResult = Result<(), LaunchError>;
2327
2328pub trait QueryProxyInterface: Send + Sync {
2329    type EnumerateResponseFut: std::future::Future<Output = Result<QueryEnumerateResult, fidl::Error>>
2330        + Send;
2331    fn r#enumerate(
2332        &self,
2333        test_url: &str,
2334        iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2335    ) -> Self::EnumerateResponseFut;
2336    type EnumerateInRealmResponseFut: std::future::Future<Output = Result<QueryEnumerateInRealmResult, fidl::Error>>
2337        + Send;
2338    fn r#enumerate_in_realm(
2339        &self,
2340        test_url: &str,
2341        realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2342        offers: &[fidl_fuchsia_component_decl::Offer],
2343        test_collection: &str,
2344        iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2345    ) -> Self::EnumerateInRealmResponseFut;
2346}
2347#[derive(Debug)]
2348#[cfg(target_os = "fuchsia")]
2349pub struct QuerySynchronousProxy {
2350    client: fidl::client::sync::Client,
2351}
2352
2353#[cfg(target_os = "fuchsia")]
2354impl fidl::endpoints::SynchronousProxy for QuerySynchronousProxy {
2355    type Proxy = QueryProxy;
2356    type Protocol = QueryMarker;
2357
2358    fn from_channel(inner: fidl::Channel) -> Self {
2359        Self::new(inner)
2360    }
2361
2362    fn into_channel(self) -> fidl::Channel {
2363        self.client.into_channel()
2364    }
2365
2366    fn as_channel(&self) -> &fidl::Channel {
2367        self.client.as_channel()
2368    }
2369}
2370
2371#[cfg(target_os = "fuchsia")]
2372impl QuerySynchronousProxy {
2373    pub fn new(channel: fidl::Channel) -> Self {
2374        let protocol_name = <QueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2375        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2376    }
2377
2378    pub fn into_channel(self) -> fidl::Channel {
2379        self.client.into_channel()
2380    }
2381
2382    /// Waits until an event arrives and returns it. It is safe for other
2383    /// threads to make concurrent requests while waiting for an event.
2384    pub fn wait_for_event(
2385        &self,
2386        deadline: zx::MonotonicInstant,
2387    ) -> Result<QueryEvent, fidl::Error> {
2388        QueryEvent::decode(self.client.wait_for_event(deadline)?)
2389    }
2390
2391    /// Enumerates test cases.
2392    pub fn r#enumerate(
2393        &self,
2394        mut test_url: &str,
2395        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2396        ___deadline: zx::MonotonicInstant,
2397    ) -> Result<QueryEnumerateResult, fidl::Error> {
2398        let _response = self.client.send_query::<
2399            QueryEnumerateRequest,
2400            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LaunchError>,
2401        >(
2402            (test_url, iterator,),
2403            0x6cd89c1f2728d418,
2404            fidl::encoding::DynamicFlags::empty(),
2405            ___deadline,
2406        )?;
2407        Ok(_response.map(|x| x))
2408    }
2409
2410    /// Enumerates test cases in non-hermetic tests.
2411    pub fn r#enumerate_in_realm(
2412        &self,
2413        mut test_url: &str,
2414        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2415        mut offers: &[fidl_fuchsia_component_decl::Offer],
2416        mut test_collection: &str,
2417        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2418        ___deadline: zx::MonotonicInstant,
2419    ) -> Result<QueryEnumerateInRealmResult, fidl::Error> {
2420        let _response = self.client.send_query::<
2421            QueryEnumerateInRealmRequest,
2422            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LaunchError>,
2423        >(
2424            (test_url, realm, offers, test_collection, iterator,),
2425            0x7f7f533194a51ec5,
2426            fidl::encoding::DynamicFlags::empty(),
2427            ___deadline,
2428        )?;
2429        Ok(_response.map(|x| x))
2430    }
2431}
2432
2433#[cfg(target_os = "fuchsia")]
2434impl From<QuerySynchronousProxy> for zx::NullableHandle {
2435    fn from(value: QuerySynchronousProxy) -> Self {
2436        value.into_channel().into()
2437    }
2438}
2439
2440#[cfg(target_os = "fuchsia")]
2441impl From<fidl::Channel> for QuerySynchronousProxy {
2442    fn from(value: fidl::Channel) -> Self {
2443        Self::new(value)
2444    }
2445}
2446
2447#[cfg(target_os = "fuchsia")]
2448impl fidl::endpoints::FromClient for QuerySynchronousProxy {
2449    type Protocol = QueryMarker;
2450
2451    fn from_client(value: fidl::endpoints::ClientEnd<QueryMarker>) -> Self {
2452        Self::new(value.into_channel())
2453    }
2454}
2455
2456#[derive(Debug, Clone)]
2457pub struct QueryProxy {
2458    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2459}
2460
2461impl fidl::endpoints::Proxy for QueryProxy {
2462    type Protocol = QueryMarker;
2463
2464    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2465        Self::new(inner)
2466    }
2467
2468    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2469        self.client.into_channel().map_err(|client| Self { client })
2470    }
2471
2472    fn as_channel(&self) -> &::fidl::AsyncChannel {
2473        self.client.as_channel()
2474    }
2475}
2476
2477impl QueryProxy {
2478    /// Create a new Proxy for fuchsia.test.manager/Query.
2479    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2480        let protocol_name = <QueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2481        Self { client: fidl::client::Client::new(channel, protocol_name) }
2482    }
2483
2484    /// Get a Stream of events from the remote end of the protocol.
2485    ///
2486    /// # Panics
2487    ///
2488    /// Panics if the event stream was already taken.
2489    pub fn take_event_stream(&self) -> QueryEventStream {
2490        QueryEventStream { event_receiver: self.client.take_event_receiver() }
2491    }
2492
2493    /// Enumerates test cases.
2494    pub fn r#enumerate(
2495        &self,
2496        mut test_url: &str,
2497        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2498    ) -> fidl::client::QueryResponseFut<
2499        QueryEnumerateResult,
2500        fidl::encoding::DefaultFuchsiaResourceDialect,
2501    > {
2502        QueryProxyInterface::r#enumerate(self, test_url, iterator)
2503    }
2504
2505    /// Enumerates test cases in non-hermetic tests.
2506    pub fn r#enumerate_in_realm(
2507        &self,
2508        mut test_url: &str,
2509        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2510        mut offers: &[fidl_fuchsia_component_decl::Offer],
2511        mut test_collection: &str,
2512        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2513    ) -> fidl::client::QueryResponseFut<
2514        QueryEnumerateInRealmResult,
2515        fidl::encoding::DefaultFuchsiaResourceDialect,
2516    > {
2517        QueryProxyInterface::r#enumerate_in_realm(
2518            self,
2519            test_url,
2520            realm,
2521            offers,
2522            test_collection,
2523            iterator,
2524        )
2525    }
2526}
2527
2528impl QueryProxyInterface for QueryProxy {
2529    type EnumerateResponseFut = fidl::client::QueryResponseFut<
2530        QueryEnumerateResult,
2531        fidl::encoding::DefaultFuchsiaResourceDialect,
2532    >;
2533    fn r#enumerate(
2534        &self,
2535        mut test_url: &str,
2536        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2537    ) -> Self::EnumerateResponseFut {
2538        fn _decode(
2539            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2540        ) -> Result<QueryEnumerateResult, fidl::Error> {
2541            let _response = fidl::client::decode_transaction_body::<
2542                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LaunchError>,
2543                fidl::encoding::DefaultFuchsiaResourceDialect,
2544                0x6cd89c1f2728d418,
2545            >(_buf?)?;
2546            Ok(_response.map(|x| x))
2547        }
2548        self.client.send_query_and_decode::<QueryEnumerateRequest, QueryEnumerateResult>(
2549            (test_url, iterator),
2550            0x6cd89c1f2728d418,
2551            fidl::encoding::DynamicFlags::empty(),
2552            _decode,
2553        )
2554    }
2555
2556    type EnumerateInRealmResponseFut = fidl::client::QueryResponseFut<
2557        QueryEnumerateInRealmResult,
2558        fidl::encoding::DefaultFuchsiaResourceDialect,
2559    >;
2560    fn r#enumerate_in_realm(
2561        &self,
2562        mut test_url: &str,
2563        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2564        mut offers: &[fidl_fuchsia_component_decl::Offer],
2565        mut test_collection: &str,
2566        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2567    ) -> Self::EnumerateInRealmResponseFut {
2568        fn _decode(
2569            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2570        ) -> Result<QueryEnumerateInRealmResult, fidl::Error> {
2571            let _response = fidl::client::decode_transaction_body::<
2572                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LaunchError>,
2573                fidl::encoding::DefaultFuchsiaResourceDialect,
2574                0x7f7f533194a51ec5,
2575            >(_buf?)?;
2576            Ok(_response.map(|x| x))
2577        }
2578        self.client
2579            .send_query_and_decode::<QueryEnumerateInRealmRequest, QueryEnumerateInRealmResult>(
2580                (test_url, realm, offers, test_collection, iterator),
2581                0x7f7f533194a51ec5,
2582                fidl::encoding::DynamicFlags::empty(),
2583                _decode,
2584            )
2585    }
2586}
2587
2588pub struct QueryEventStream {
2589    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2590}
2591
2592impl std::marker::Unpin for QueryEventStream {}
2593
2594impl futures::stream::FusedStream for QueryEventStream {
2595    fn is_terminated(&self) -> bool {
2596        self.event_receiver.is_terminated()
2597    }
2598}
2599
2600impl futures::Stream for QueryEventStream {
2601    type Item = Result<QueryEvent, fidl::Error>;
2602
2603    fn poll_next(
2604        mut self: std::pin::Pin<&mut Self>,
2605        cx: &mut std::task::Context<'_>,
2606    ) -> std::task::Poll<Option<Self::Item>> {
2607        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2608            &mut self.event_receiver,
2609            cx
2610        )?) {
2611            Some(buf) => std::task::Poll::Ready(Some(QueryEvent::decode(buf))),
2612            None => std::task::Poll::Ready(None),
2613        }
2614    }
2615}
2616
2617#[derive(Debug)]
2618pub enum QueryEvent {
2619    #[non_exhaustive]
2620    _UnknownEvent {
2621        /// Ordinal of the event that was sent.
2622        ordinal: u64,
2623    },
2624}
2625
2626impl QueryEvent {
2627    /// Decodes a message buffer as a [`QueryEvent`].
2628    fn decode(
2629        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2630    ) -> Result<QueryEvent, fidl::Error> {
2631        let (bytes, _handles) = buf.split_mut();
2632        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2633        debug_assert_eq!(tx_header.tx_id, 0);
2634        match tx_header.ordinal {
2635            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2636                Ok(QueryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2637            }
2638            _ => Err(fidl::Error::UnknownOrdinal {
2639                ordinal: tx_header.ordinal,
2640                protocol_name: <QueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2641            }),
2642        }
2643    }
2644}
2645
2646/// A Stream of incoming requests for fuchsia.test.manager/Query.
2647pub struct QueryRequestStream {
2648    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2649    is_terminated: bool,
2650}
2651
2652impl std::marker::Unpin for QueryRequestStream {}
2653
2654impl futures::stream::FusedStream for QueryRequestStream {
2655    fn is_terminated(&self) -> bool {
2656        self.is_terminated
2657    }
2658}
2659
2660impl fidl::endpoints::RequestStream for QueryRequestStream {
2661    type Protocol = QueryMarker;
2662    type ControlHandle = QueryControlHandle;
2663
2664    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2665        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2666    }
2667
2668    fn control_handle(&self) -> Self::ControlHandle {
2669        QueryControlHandle { inner: self.inner.clone() }
2670    }
2671
2672    fn into_inner(
2673        self,
2674    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2675    {
2676        (self.inner, self.is_terminated)
2677    }
2678
2679    fn from_inner(
2680        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2681        is_terminated: bool,
2682    ) -> Self {
2683        Self { inner, is_terminated }
2684    }
2685}
2686
2687impl futures::Stream for QueryRequestStream {
2688    type Item = Result<QueryRequest, fidl::Error>;
2689
2690    fn poll_next(
2691        mut self: std::pin::Pin<&mut Self>,
2692        cx: &mut std::task::Context<'_>,
2693    ) -> std::task::Poll<Option<Self::Item>> {
2694        let this = &mut *self;
2695        if this.inner.check_shutdown(cx) {
2696            this.is_terminated = true;
2697            return std::task::Poll::Ready(None);
2698        }
2699        if this.is_terminated {
2700            panic!("polled QueryRequestStream after completion");
2701        }
2702        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2703            |bytes, handles| {
2704                match this.inner.channel().read_etc(cx, bytes, handles) {
2705                    std::task::Poll::Ready(Ok(())) => {}
2706                    std::task::Poll::Pending => return std::task::Poll::Pending,
2707                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2708                        this.is_terminated = true;
2709                        return std::task::Poll::Ready(None);
2710                    }
2711                    std::task::Poll::Ready(Err(e)) => {
2712                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2713                            e.into(),
2714                        ))));
2715                    }
2716                }
2717
2718                // A message has been received from the channel
2719                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2720
2721                std::task::Poll::Ready(Some(match header.ordinal {
2722                    0x6cd89c1f2728d418 => {
2723                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2724                        let mut req = fidl::new_empty!(
2725                            QueryEnumerateRequest,
2726                            fidl::encoding::DefaultFuchsiaResourceDialect
2727                        );
2728                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<QueryEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
2729                        let control_handle = QueryControlHandle { inner: this.inner.clone() };
2730                        Ok(QueryRequest::Enumerate {
2731                            test_url: req.test_url,
2732                            iterator: req.iterator,
2733
2734                            responder: QueryEnumerateResponder {
2735                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2736                                tx_id: header.tx_id,
2737                            },
2738                        })
2739                    }
2740                    0x7f7f533194a51ec5 => {
2741                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2742                        let mut req = fidl::new_empty!(
2743                            QueryEnumerateInRealmRequest,
2744                            fidl::encoding::DefaultFuchsiaResourceDialect
2745                        );
2746                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<QueryEnumerateInRealmRequest>(&header, _body_bytes, handles, &mut req)?;
2747                        let control_handle = QueryControlHandle { inner: this.inner.clone() };
2748                        Ok(QueryRequest::EnumerateInRealm {
2749                            test_url: req.test_url,
2750                            realm: req.realm,
2751                            offers: req.offers,
2752                            test_collection: req.test_collection,
2753                            iterator: req.iterator,
2754
2755                            responder: QueryEnumerateInRealmResponder {
2756                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2757                                tx_id: header.tx_id,
2758                            },
2759                        })
2760                    }
2761                    _ if header.tx_id == 0
2762                        && header
2763                            .dynamic_flags()
2764                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2765                    {
2766                        Ok(QueryRequest::_UnknownMethod {
2767                            ordinal: header.ordinal,
2768                            control_handle: QueryControlHandle { inner: this.inner.clone() },
2769                            method_type: fidl::MethodType::OneWay,
2770                        })
2771                    }
2772                    _ if header
2773                        .dynamic_flags()
2774                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2775                    {
2776                        this.inner.send_framework_err(
2777                            fidl::encoding::FrameworkErr::UnknownMethod,
2778                            header.tx_id,
2779                            header.ordinal,
2780                            header.dynamic_flags(),
2781                            (bytes, handles),
2782                        )?;
2783                        Ok(QueryRequest::_UnknownMethod {
2784                            ordinal: header.ordinal,
2785                            control_handle: QueryControlHandle { inner: this.inner.clone() },
2786                            method_type: fidl::MethodType::TwoWay,
2787                        })
2788                    }
2789                    _ => Err(fidl::Error::UnknownOrdinal {
2790                        ordinal: header.ordinal,
2791                        protocol_name: <QueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2792                    }),
2793                }))
2794            },
2795        )
2796    }
2797}
2798
2799#[derive(Debug)]
2800pub enum QueryRequest {
2801    /// Enumerates test cases.
2802    Enumerate {
2803        test_url: String,
2804        iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2805        responder: QueryEnumerateResponder,
2806    },
2807    /// Enumerates test cases in non-hermetic tests.
2808    EnumerateInRealm {
2809        test_url: String,
2810        realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2811        offers: Vec<fidl_fuchsia_component_decl::Offer>,
2812        test_collection: String,
2813        iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2814        responder: QueryEnumerateInRealmResponder,
2815    },
2816    /// An interaction was received which does not match any known method.
2817    #[non_exhaustive]
2818    _UnknownMethod {
2819        /// Ordinal of the method that was called.
2820        ordinal: u64,
2821        control_handle: QueryControlHandle,
2822        method_type: fidl::MethodType,
2823    },
2824}
2825
2826impl QueryRequest {
2827    #[allow(irrefutable_let_patterns)]
2828    pub fn into_enumerate(
2829        self,
2830    ) -> Option<(String, fidl::endpoints::ServerEnd<CaseIteratorMarker>, QueryEnumerateResponder)>
2831    {
2832        if let QueryRequest::Enumerate { test_url, iterator, responder } = self {
2833            Some((test_url, iterator, responder))
2834        } else {
2835            None
2836        }
2837    }
2838
2839    #[allow(irrefutable_let_patterns)]
2840    pub fn into_enumerate_in_realm(
2841        self,
2842    ) -> Option<(
2843        String,
2844        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2845        Vec<fidl_fuchsia_component_decl::Offer>,
2846        String,
2847        fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2848        QueryEnumerateInRealmResponder,
2849    )> {
2850        if let QueryRequest::EnumerateInRealm {
2851            test_url,
2852            realm,
2853            offers,
2854            test_collection,
2855            iterator,
2856            responder,
2857        } = self
2858        {
2859            Some((test_url, realm, offers, test_collection, iterator, responder))
2860        } else {
2861            None
2862        }
2863    }
2864
2865    /// Name of the method defined in FIDL
2866    pub fn method_name(&self) -> &'static str {
2867        match *self {
2868            QueryRequest::Enumerate { .. } => "enumerate",
2869            QueryRequest::EnumerateInRealm { .. } => "enumerate_in_realm",
2870            QueryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
2871                "unknown one-way method"
2872            }
2873            QueryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
2874                "unknown two-way method"
2875            }
2876        }
2877    }
2878}
2879
2880#[derive(Debug, Clone)]
2881pub struct QueryControlHandle {
2882    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2883}
2884
2885impl fidl::endpoints::ControlHandle for QueryControlHandle {
2886    fn shutdown(&self) {
2887        self.inner.shutdown()
2888    }
2889
2890    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2891        self.inner.shutdown_with_epitaph(status)
2892    }
2893
2894    fn is_closed(&self) -> bool {
2895        self.inner.channel().is_closed()
2896    }
2897    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2898        self.inner.channel().on_closed()
2899    }
2900
2901    #[cfg(target_os = "fuchsia")]
2902    fn signal_peer(
2903        &self,
2904        clear_mask: zx::Signals,
2905        set_mask: zx::Signals,
2906    ) -> Result<(), zx_status::Status> {
2907        use fidl::Peered;
2908        self.inner.channel().signal_peer(clear_mask, set_mask)
2909    }
2910}
2911
2912impl QueryControlHandle {}
2913
2914#[must_use = "FIDL methods require a response to be sent"]
2915#[derive(Debug)]
2916pub struct QueryEnumerateResponder {
2917    control_handle: std::mem::ManuallyDrop<QueryControlHandle>,
2918    tx_id: u32,
2919}
2920
2921/// Set the the channel to be shutdown (see [`QueryControlHandle::shutdown`])
2922/// if the responder is dropped without sending a response, so that the client
2923/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2924impl std::ops::Drop for QueryEnumerateResponder {
2925    fn drop(&mut self) {
2926        self.control_handle.shutdown();
2927        // Safety: drops once, never accessed again
2928        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2929    }
2930}
2931
2932impl fidl::endpoints::Responder for QueryEnumerateResponder {
2933    type ControlHandle = QueryControlHandle;
2934
2935    fn control_handle(&self) -> &QueryControlHandle {
2936        &self.control_handle
2937    }
2938
2939    fn drop_without_shutdown(mut self) {
2940        // Safety: drops once, never accessed again due to mem::forget
2941        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2942        // Prevent Drop from running (which would shut down the channel)
2943        std::mem::forget(self);
2944    }
2945}
2946
2947impl QueryEnumerateResponder {
2948    /// Sends a response to the FIDL transaction.
2949    ///
2950    /// Sets the channel to shutdown if an error occurs.
2951    pub fn send(self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
2952        let _result = self.send_raw(result);
2953        if _result.is_err() {
2954            self.control_handle.shutdown();
2955        }
2956        self.drop_without_shutdown();
2957        _result
2958    }
2959
2960    /// Similar to "send" but does not shutdown the channel if an error occurs.
2961    pub fn send_no_shutdown_on_err(
2962        self,
2963        mut result: Result<(), LaunchError>,
2964    ) -> Result<(), fidl::Error> {
2965        let _result = self.send_raw(result);
2966        self.drop_without_shutdown();
2967        _result
2968    }
2969
2970    fn send_raw(&self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
2971        self.control_handle.inner.send::<fidl::encoding::ResultType<
2972            fidl::encoding::EmptyStruct,
2973            LaunchError,
2974        >>(
2975            result,
2976            self.tx_id,
2977            0x6cd89c1f2728d418,
2978            fidl::encoding::DynamicFlags::empty(),
2979        )
2980    }
2981}
2982
2983#[must_use = "FIDL methods require a response to be sent"]
2984#[derive(Debug)]
2985pub struct QueryEnumerateInRealmResponder {
2986    control_handle: std::mem::ManuallyDrop<QueryControlHandle>,
2987    tx_id: u32,
2988}
2989
2990/// Set the the channel to be shutdown (see [`QueryControlHandle::shutdown`])
2991/// if the responder is dropped without sending a response, so that the client
2992/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2993impl std::ops::Drop for QueryEnumerateInRealmResponder {
2994    fn drop(&mut self) {
2995        self.control_handle.shutdown();
2996        // Safety: drops once, never accessed again
2997        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2998    }
2999}
3000
3001impl fidl::endpoints::Responder for QueryEnumerateInRealmResponder {
3002    type ControlHandle = QueryControlHandle;
3003
3004    fn control_handle(&self) -> &QueryControlHandle {
3005        &self.control_handle
3006    }
3007
3008    fn drop_without_shutdown(mut self) {
3009        // Safety: drops once, never accessed again due to mem::forget
3010        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3011        // Prevent Drop from running (which would shut down the channel)
3012        std::mem::forget(self);
3013    }
3014}
3015
3016impl QueryEnumerateInRealmResponder {
3017    /// Sends a response to the FIDL transaction.
3018    ///
3019    /// Sets the channel to shutdown if an error occurs.
3020    pub fn send(self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
3021        let _result = self.send_raw(result);
3022        if _result.is_err() {
3023            self.control_handle.shutdown();
3024        }
3025        self.drop_without_shutdown();
3026        _result
3027    }
3028
3029    /// Similar to "send" but does not shutdown the channel if an error occurs.
3030    pub fn send_no_shutdown_on_err(
3031        self,
3032        mut result: Result<(), LaunchError>,
3033    ) -> Result<(), fidl::Error> {
3034        let _result = self.send_raw(result);
3035        self.drop_without_shutdown();
3036        _result
3037    }
3038
3039    fn send_raw(&self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
3040        self.control_handle.inner.send::<fidl::encoding::ResultType<
3041            fidl::encoding::EmptyStruct,
3042            LaunchError,
3043        >>(
3044            result,
3045            self.tx_id,
3046            0x7f7f533194a51ec5,
3047            fidl::encoding::DynamicFlags::empty(),
3048        )
3049    }
3050}
3051
3052#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3053pub struct RunBuilderMarker;
3054
3055impl fidl::endpoints::ProtocolMarker for RunBuilderMarker {
3056    type Proxy = RunBuilderProxy;
3057    type RequestStream = RunBuilderRequestStream;
3058    #[cfg(target_os = "fuchsia")]
3059    type SynchronousProxy = RunBuilderSynchronousProxy;
3060
3061    const DEBUG_NAME: &'static str = "fuchsia.test.manager.RunBuilder";
3062}
3063impl fidl::endpoints::DiscoverableProtocolMarker for RunBuilderMarker {}
3064
3065pub trait RunBuilderProxyInterface: Send + Sync {
3066    fn r#add_suite(
3067        &self,
3068        test_url: &str,
3069        options: &RunOptions,
3070        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3071    ) -> Result<(), fidl::Error>;
3072    fn r#add_suite_in_realm(
3073        &self,
3074        realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3075        offers: &[fidl_fuchsia_component_decl::Offer],
3076        test_collection: &str,
3077        test_url: &str,
3078        options: &RunOptions,
3079        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3080    ) -> Result<(), fidl::Error>;
3081    fn r#with_scheduling_options(&self, options: &SchedulingOptions) -> Result<(), fidl::Error>;
3082    fn r#build(
3083        &self,
3084        controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
3085    ) -> Result<(), fidl::Error>;
3086}
3087#[derive(Debug)]
3088#[cfg(target_os = "fuchsia")]
3089pub struct RunBuilderSynchronousProxy {
3090    client: fidl::client::sync::Client,
3091}
3092
3093#[cfg(target_os = "fuchsia")]
3094impl fidl::endpoints::SynchronousProxy for RunBuilderSynchronousProxy {
3095    type Proxy = RunBuilderProxy;
3096    type Protocol = RunBuilderMarker;
3097
3098    fn from_channel(inner: fidl::Channel) -> Self {
3099        Self::new(inner)
3100    }
3101
3102    fn into_channel(self) -> fidl::Channel {
3103        self.client.into_channel()
3104    }
3105
3106    fn as_channel(&self) -> &fidl::Channel {
3107        self.client.as_channel()
3108    }
3109}
3110
3111#[cfg(target_os = "fuchsia")]
3112impl RunBuilderSynchronousProxy {
3113    pub fn new(channel: fidl::Channel) -> Self {
3114        let protocol_name = <RunBuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3115        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3116    }
3117
3118    pub fn into_channel(self) -> fidl::Channel {
3119        self.client.into_channel()
3120    }
3121
3122    /// Waits until an event arrives and returns it. It is safe for other
3123    /// threads to make concurrent requests while waiting for an event.
3124    pub fn wait_for_event(
3125        &self,
3126        deadline: zx::MonotonicInstant,
3127    ) -> Result<RunBuilderEvent, fidl::Error> {
3128        RunBuilderEvent::decode(self.client.wait_for_event(deadline)?)
3129    }
3130
3131    /// Add a suite to this run. A suite is a component that implements
3132    /// `fuchsia.test.Suite`. Implementors of this API will talk to test suites
3133    /// using "Suite" protocol and return results using `controller`. The
3134    /// controller is also used to control the execution of the test suite.
3135    pub fn r#add_suite(
3136        &self,
3137        mut test_url: &str,
3138        mut options: &RunOptions,
3139        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3140    ) -> Result<(), fidl::Error> {
3141        self.client.send::<RunBuilderAddSuiteRequest>(
3142            (test_url, options, controller),
3143            0x71e7f9a06daac486,
3144            fidl::encoding::DynamicFlags::FLEXIBLE,
3145        )
3146    }
3147
3148    /// Add a suite to this run which would run in provided 'realm'. A suite is
3149    /// a component that implements `fuchsia.test.Suite`. Implementors of this
3150    /// API will talk to test suites using "Suite" protocol and return results
3151    /// using `controller`. The controller is also used to control the execution
3152    /// of the test suite.
3153    pub fn r#add_suite_in_realm(
3154        &self,
3155        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3156        mut offers: &[fidl_fuchsia_component_decl::Offer],
3157        mut test_collection: &str,
3158        mut test_url: &str,
3159        mut options: &RunOptions,
3160        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3161    ) -> Result<(), fidl::Error> {
3162        self.client.send::<RunBuilderAddSuiteInRealmRequest>(
3163            (realm, offers, test_collection, test_url, options, controller),
3164            0x4d10c582715a8683,
3165            fidl::encoding::DynamicFlags::FLEXIBLE,
3166        )
3167    }
3168
3169    /// Specify scheduling options used for this run.
3170    pub fn r#with_scheduling_options(
3171        &self,
3172        mut options: &SchedulingOptions,
3173    ) -> Result<(), fidl::Error> {
3174        self.client.send::<RunBuilderWithSchedulingOptionsRequest>(
3175            (options,),
3176            0x55e73fdbeade0b0b,
3177            fidl::encoding::DynamicFlags::FLEXIBLE,
3178        )
3179    }
3180
3181    /// Build and schedule the run.
3182    ///
3183    /// This runs all suites added with their respective filters and closes the
3184    /// channel once it is done.
3185    pub fn r#build(
3186        &self,
3187        mut controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
3188    ) -> Result<(), fidl::Error> {
3189        self.client.send::<RunBuilderBuildRequest>(
3190            (controller,),
3191            0x7879f2360ff1f160,
3192            fidl::encoding::DynamicFlags::FLEXIBLE,
3193        )
3194    }
3195}
3196
3197#[cfg(target_os = "fuchsia")]
3198impl From<RunBuilderSynchronousProxy> for zx::NullableHandle {
3199    fn from(value: RunBuilderSynchronousProxy) -> Self {
3200        value.into_channel().into()
3201    }
3202}
3203
3204#[cfg(target_os = "fuchsia")]
3205impl From<fidl::Channel> for RunBuilderSynchronousProxy {
3206    fn from(value: fidl::Channel) -> Self {
3207        Self::new(value)
3208    }
3209}
3210
3211#[cfg(target_os = "fuchsia")]
3212impl fidl::endpoints::FromClient for RunBuilderSynchronousProxy {
3213    type Protocol = RunBuilderMarker;
3214
3215    fn from_client(value: fidl::endpoints::ClientEnd<RunBuilderMarker>) -> Self {
3216        Self::new(value.into_channel())
3217    }
3218}
3219
3220#[derive(Debug, Clone)]
3221pub struct RunBuilderProxy {
3222    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3223}
3224
3225impl fidl::endpoints::Proxy for RunBuilderProxy {
3226    type Protocol = RunBuilderMarker;
3227
3228    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3229        Self::new(inner)
3230    }
3231
3232    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3233        self.client.into_channel().map_err(|client| Self { client })
3234    }
3235
3236    fn as_channel(&self) -> &::fidl::AsyncChannel {
3237        self.client.as_channel()
3238    }
3239}
3240
3241impl RunBuilderProxy {
3242    /// Create a new Proxy for fuchsia.test.manager/RunBuilder.
3243    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3244        let protocol_name = <RunBuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3245        Self { client: fidl::client::Client::new(channel, protocol_name) }
3246    }
3247
3248    /// Get a Stream of events from the remote end of the protocol.
3249    ///
3250    /// # Panics
3251    ///
3252    /// Panics if the event stream was already taken.
3253    pub fn take_event_stream(&self) -> RunBuilderEventStream {
3254        RunBuilderEventStream { event_receiver: self.client.take_event_receiver() }
3255    }
3256
3257    /// Add a suite to this run. A suite is a component that implements
3258    /// `fuchsia.test.Suite`. Implementors of this API will talk to test suites
3259    /// using "Suite" protocol and return results using `controller`. The
3260    /// controller is also used to control the execution of the test suite.
3261    pub fn r#add_suite(
3262        &self,
3263        mut test_url: &str,
3264        mut options: &RunOptions,
3265        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3266    ) -> Result<(), fidl::Error> {
3267        RunBuilderProxyInterface::r#add_suite(self, test_url, options, controller)
3268    }
3269
3270    /// Add a suite to this run which would run in provided 'realm'. A suite is
3271    /// a component that implements `fuchsia.test.Suite`. Implementors of this
3272    /// API will talk to test suites using "Suite" protocol and return results
3273    /// using `controller`. The controller is also used to control the execution
3274    /// of the test suite.
3275    pub fn r#add_suite_in_realm(
3276        &self,
3277        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3278        mut offers: &[fidl_fuchsia_component_decl::Offer],
3279        mut test_collection: &str,
3280        mut test_url: &str,
3281        mut options: &RunOptions,
3282        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3283    ) -> Result<(), fidl::Error> {
3284        RunBuilderProxyInterface::r#add_suite_in_realm(
3285            self,
3286            realm,
3287            offers,
3288            test_collection,
3289            test_url,
3290            options,
3291            controller,
3292        )
3293    }
3294
3295    /// Specify scheduling options used for this run.
3296    pub fn r#with_scheduling_options(
3297        &self,
3298        mut options: &SchedulingOptions,
3299    ) -> Result<(), fidl::Error> {
3300        RunBuilderProxyInterface::r#with_scheduling_options(self, options)
3301    }
3302
3303    /// Build and schedule the run.
3304    ///
3305    /// This runs all suites added with their respective filters and closes the
3306    /// channel once it is done.
3307    pub fn r#build(
3308        &self,
3309        mut controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
3310    ) -> Result<(), fidl::Error> {
3311        RunBuilderProxyInterface::r#build(self, controller)
3312    }
3313}
3314
3315impl RunBuilderProxyInterface for RunBuilderProxy {
3316    fn r#add_suite(
3317        &self,
3318        mut test_url: &str,
3319        mut options: &RunOptions,
3320        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3321    ) -> Result<(), fidl::Error> {
3322        self.client.send::<RunBuilderAddSuiteRequest>(
3323            (test_url, options, controller),
3324            0x71e7f9a06daac486,
3325            fidl::encoding::DynamicFlags::FLEXIBLE,
3326        )
3327    }
3328
3329    fn r#add_suite_in_realm(
3330        &self,
3331        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3332        mut offers: &[fidl_fuchsia_component_decl::Offer],
3333        mut test_collection: &str,
3334        mut test_url: &str,
3335        mut options: &RunOptions,
3336        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3337    ) -> Result<(), fidl::Error> {
3338        self.client.send::<RunBuilderAddSuiteInRealmRequest>(
3339            (realm, offers, test_collection, test_url, options, controller),
3340            0x4d10c582715a8683,
3341            fidl::encoding::DynamicFlags::FLEXIBLE,
3342        )
3343    }
3344
3345    fn r#with_scheduling_options(
3346        &self,
3347        mut options: &SchedulingOptions,
3348    ) -> Result<(), fidl::Error> {
3349        self.client.send::<RunBuilderWithSchedulingOptionsRequest>(
3350            (options,),
3351            0x55e73fdbeade0b0b,
3352            fidl::encoding::DynamicFlags::FLEXIBLE,
3353        )
3354    }
3355
3356    fn r#build(
3357        &self,
3358        mut controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
3359    ) -> Result<(), fidl::Error> {
3360        self.client.send::<RunBuilderBuildRequest>(
3361            (controller,),
3362            0x7879f2360ff1f160,
3363            fidl::encoding::DynamicFlags::FLEXIBLE,
3364        )
3365    }
3366}
3367
3368pub struct RunBuilderEventStream {
3369    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3370}
3371
3372impl std::marker::Unpin for RunBuilderEventStream {}
3373
3374impl futures::stream::FusedStream for RunBuilderEventStream {
3375    fn is_terminated(&self) -> bool {
3376        self.event_receiver.is_terminated()
3377    }
3378}
3379
3380impl futures::Stream for RunBuilderEventStream {
3381    type Item = Result<RunBuilderEvent, fidl::Error>;
3382
3383    fn poll_next(
3384        mut self: std::pin::Pin<&mut Self>,
3385        cx: &mut std::task::Context<'_>,
3386    ) -> std::task::Poll<Option<Self::Item>> {
3387        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3388            &mut self.event_receiver,
3389            cx
3390        )?) {
3391            Some(buf) => std::task::Poll::Ready(Some(RunBuilderEvent::decode(buf))),
3392            None => std::task::Poll::Ready(None),
3393        }
3394    }
3395}
3396
3397#[derive(Debug)]
3398pub enum RunBuilderEvent {
3399    #[non_exhaustive]
3400    _UnknownEvent {
3401        /// Ordinal of the event that was sent.
3402        ordinal: u64,
3403    },
3404}
3405
3406impl RunBuilderEvent {
3407    /// Decodes a message buffer as a [`RunBuilderEvent`].
3408    fn decode(
3409        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3410    ) -> Result<RunBuilderEvent, fidl::Error> {
3411        let (bytes, _handles) = buf.split_mut();
3412        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3413        debug_assert_eq!(tx_header.tx_id, 0);
3414        match tx_header.ordinal {
3415            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3416                Ok(RunBuilderEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3417            }
3418            _ => Err(fidl::Error::UnknownOrdinal {
3419                ordinal: tx_header.ordinal,
3420                protocol_name: <RunBuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3421            }),
3422        }
3423    }
3424}
3425
3426/// A Stream of incoming requests for fuchsia.test.manager/RunBuilder.
3427pub struct RunBuilderRequestStream {
3428    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3429    is_terminated: bool,
3430}
3431
3432impl std::marker::Unpin for RunBuilderRequestStream {}
3433
3434impl futures::stream::FusedStream for RunBuilderRequestStream {
3435    fn is_terminated(&self) -> bool {
3436        self.is_terminated
3437    }
3438}
3439
3440impl fidl::endpoints::RequestStream for RunBuilderRequestStream {
3441    type Protocol = RunBuilderMarker;
3442    type ControlHandle = RunBuilderControlHandle;
3443
3444    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3445        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3446    }
3447
3448    fn control_handle(&self) -> Self::ControlHandle {
3449        RunBuilderControlHandle { inner: self.inner.clone() }
3450    }
3451
3452    fn into_inner(
3453        self,
3454    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3455    {
3456        (self.inner, self.is_terminated)
3457    }
3458
3459    fn from_inner(
3460        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3461        is_terminated: bool,
3462    ) -> Self {
3463        Self { inner, is_terminated }
3464    }
3465}
3466
3467impl futures::Stream for RunBuilderRequestStream {
3468    type Item = Result<RunBuilderRequest, fidl::Error>;
3469
3470    fn poll_next(
3471        mut self: std::pin::Pin<&mut Self>,
3472        cx: &mut std::task::Context<'_>,
3473    ) -> std::task::Poll<Option<Self::Item>> {
3474        let this = &mut *self;
3475        if this.inner.check_shutdown(cx) {
3476            this.is_terminated = true;
3477            return std::task::Poll::Ready(None);
3478        }
3479        if this.is_terminated {
3480            panic!("polled RunBuilderRequestStream after completion");
3481        }
3482        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3483            |bytes, handles| {
3484                match this.inner.channel().read_etc(cx, bytes, handles) {
3485                    std::task::Poll::Ready(Ok(())) => {}
3486                    std::task::Poll::Pending => return std::task::Poll::Pending,
3487                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3488                        this.is_terminated = true;
3489                        return std::task::Poll::Ready(None);
3490                    }
3491                    std::task::Poll::Ready(Err(e)) => {
3492                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3493                            e.into(),
3494                        ))));
3495                    }
3496                }
3497
3498                // A message has been received from the channel
3499                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3500
3501                std::task::Poll::Ready(Some(match header.ordinal {
3502                    0x71e7f9a06daac486 => {
3503                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3504                        let mut req = fidl::new_empty!(
3505                            RunBuilderAddSuiteRequest,
3506                            fidl::encoding::DefaultFuchsiaResourceDialect
3507                        );
3508                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunBuilderAddSuiteRequest>(&header, _body_bytes, handles, &mut req)?;
3509                        let control_handle = RunBuilderControlHandle { inner: this.inner.clone() };
3510                        Ok(RunBuilderRequest::AddSuite {
3511                            test_url: req.test_url,
3512                            options: req.options,
3513                            controller: req.controller,
3514
3515                            control_handle,
3516                        })
3517                    }
3518                    0x4d10c582715a8683 => {
3519                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3520                        let mut req = fidl::new_empty!(
3521                            RunBuilderAddSuiteInRealmRequest,
3522                            fidl::encoding::DefaultFuchsiaResourceDialect
3523                        );
3524                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunBuilderAddSuiteInRealmRequest>(&header, _body_bytes, handles, &mut req)?;
3525                        let control_handle = RunBuilderControlHandle { inner: this.inner.clone() };
3526                        Ok(RunBuilderRequest::AddSuiteInRealm {
3527                            realm: req.realm,
3528                            offers: req.offers,
3529                            test_collection: req.test_collection,
3530                            test_url: req.test_url,
3531                            options: req.options,
3532                            controller: req.controller,
3533
3534                            control_handle,
3535                        })
3536                    }
3537                    0x55e73fdbeade0b0b => {
3538                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3539                        let mut req = fidl::new_empty!(
3540                            RunBuilderWithSchedulingOptionsRequest,
3541                            fidl::encoding::DefaultFuchsiaResourceDialect
3542                        );
3543                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunBuilderWithSchedulingOptionsRequest>(&header, _body_bytes, handles, &mut req)?;
3544                        let control_handle = RunBuilderControlHandle { inner: this.inner.clone() };
3545                        Ok(RunBuilderRequest::WithSchedulingOptions {
3546                            options: req.options,
3547
3548                            control_handle,
3549                        })
3550                    }
3551                    0x7879f2360ff1f160 => {
3552                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3553                        let mut req = fidl::new_empty!(
3554                            RunBuilderBuildRequest,
3555                            fidl::encoding::DefaultFuchsiaResourceDialect
3556                        );
3557                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunBuilderBuildRequest>(&header, _body_bytes, handles, &mut req)?;
3558                        let control_handle = RunBuilderControlHandle { inner: this.inner.clone() };
3559                        Ok(RunBuilderRequest::Build { controller: req.controller, control_handle })
3560                    }
3561                    _ if header.tx_id == 0
3562                        && header
3563                            .dynamic_flags()
3564                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3565                    {
3566                        Ok(RunBuilderRequest::_UnknownMethod {
3567                            ordinal: header.ordinal,
3568                            control_handle: RunBuilderControlHandle { inner: this.inner.clone() },
3569                            method_type: fidl::MethodType::OneWay,
3570                        })
3571                    }
3572                    _ if header
3573                        .dynamic_flags()
3574                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3575                    {
3576                        this.inner.send_framework_err(
3577                            fidl::encoding::FrameworkErr::UnknownMethod,
3578                            header.tx_id,
3579                            header.ordinal,
3580                            header.dynamic_flags(),
3581                            (bytes, handles),
3582                        )?;
3583                        Ok(RunBuilderRequest::_UnknownMethod {
3584                            ordinal: header.ordinal,
3585                            control_handle: RunBuilderControlHandle { inner: this.inner.clone() },
3586                            method_type: fidl::MethodType::TwoWay,
3587                        })
3588                    }
3589                    _ => Err(fidl::Error::UnknownOrdinal {
3590                        ordinal: header.ordinal,
3591                        protocol_name:
3592                            <RunBuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3593                    }),
3594                }))
3595            },
3596        )
3597    }
3598}
3599
3600/// This is the entry point of running test suites. A test "run" consists of
3601/// multiple test "suites" which consists of running multiple "test cases".
3602#[derive(Debug)]
3603pub enum RunBuilderRequest {
3604    /// Add a suite to this run. A suite is a component that implements
3605    /// `fuchsia.test.Suite`. Implementors of this API will talk to test suites
3606    /// using "Suite" protocol and return results using `controller`. The
3607    /// controller is also used to control the execution of the test suite.
3608    AddSuite {
3609        test_url: String,
3610        options: RunOptions,
3611        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3612        control_handle: RunBuilderControlHandle,
3613    },
3614    /// Add a suite to this run which would run in provided 'realm'. A suite is
3615    /// a component that implements `fuchsia.test.Suite`. Implementors of this
3616    /// API will talk to test suites using "Suite" protocol and return results
3617    /// using `controller`. The controller is also used to control the execution
3618    /// of the test suite.
3619    AddSuiteInRealm {
3620        realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3621        offers: Vec<fidl_fuchsia_component_decl::Offer>,
3622        test_collection: String,
3623        test_url: String,
3624        options: RunOptions,
3625        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3626        control_handle: RunBuilderControlHandle,
3627    },
3628    /// Specify scheduling options used for this run.
3629    WithSchedulingOptions { options: SchedulingOptions, control_handle: RunBuilderControlHandle },
3630    /// Build and schedule the run.
3631    ///
3632    /// This runs all suites added with their respective filters and closes the
3633    /// channel once it is done.
3634    Build {
3635        controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
3636        control_handle: RunBuilderControlHandle,
3637    },
3638    /// An interaction was received which does not match any known method.
3639    #[non_exhaustive]
3640    _UnknownMethod {
3641        /// Ordinal of the method that was called.
3642        ordinal: u64,
3643        control_handle: RunBuilderControlHandle,
3644        method_type: fidl::MethodType,
3645    },
3646}
3647
3648impl RunBuilderRequest {
3649    #[allow(irrefutable_let_patterns)]
3650    pub fn into_add_suite(
3651        self,
3652    ) -> Option<(
3653        String,
3654        RunOptions,
3655        fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3656        RunBuilderControlHandle,
3657    )> {
3658        if let RunBuilderRequest::AddSuite { test_url, options, controller, control_handle } = self
3659        {
3660            Some((test_url, options, controller, control_handle))
3661        } else {
3662            None
3663        }
3664    }
3665
3666    #[allow(irrefutable_let_patterns)]
3667    pub fn into_add_suite_in_realm(
3668        self,
3669    ) -> Option<(
3670        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3671        Vec<fidl_fuchsia_component_decl::Offer>,
3672        String,
3673        String,
3674        RunOptions,
3675        fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3676        RunBuilderControlHandle,
3677    )> {
3678        if let RunBuilderRequest::AddSuiteInRealm {
3679            realm,
3680            offers,
3681            test_collection,
3682            test_url,
3683            options,
3684            controller,
3685            control_handle,
3686        } = self
3687        {
3688            Some((realm, offers, test_collection, test_url, options, controller, control_handle))
3689        } else {
3690            None
3691        }
3692    }
3693
3694    #[allow(irrefutable_let_patterns)]
3695    pub fn into_with_scheduling_options(
3696        self,
3697    ) -> Option<(SchedulingOptions, RunBuilderControlHandle)> {
3698        if let RunBuilderRequest::WithSchedulingOptions { options, control_handle } = self {
3699            Some((options, control_handle))
3700        } else {
3701            None
3702        }
3703    }
3704
3705    #[allow(irrefutable_let_patterns)]
3706    pub fn into_build(
3707        self,
3708    ) -> Option<(fidl::endpoints::ServerEnd<RunControllerMarker>, RunBuilderControlHandle)> {
3709        if let RunBuilderRequest::Build { controller, control_handle } = self {
3710            Some((controller, control_handle))
3711        } else {
3712            None
3713        }
3714    }
3715
3716    /// Name of the method defined in FIDL
3717    pub fn method_name(&self) -> &'static str {
3718        match *self {
3719            RunBuilderRequest::AddSuite { .. } => "add_suite",
3720            RunBuilderRequest::AddSuiteInRealm { .. } => "add_suite_in_realm",
3721            RunBuilderRequest::WithSchedulingOptions { .. } => "with_scheduling_options",
3722            RunBuilderRequest::Build { .. } => "build",
3723            RunBuilderRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
3724                "unknown one-way method"
3725            }
3726            RunBuilderRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
3727                "unknown two-way method"
3728            }
3729        }
3730    }
3731}
3732
3733#[derive(Debug, Clone)]
3734pub struct RunBuilderControlHandle {
3735    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3736}
3737
3738impl fidl::endpoints::ControlHandle for RunBuilderControlHandle {
3739    fn shutdown(&self) {
3740        self.inner.shutdown()
3741    }
3742
3743    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3744        self.inner.shutdown_with_epitaph(status)
3745    }
3746
3747    fn is_closed(&self) -> bool {
3748        self.inner.channel().is_closed()
3749    }
3750    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3751        self.inner.channel().on_closed()
3752    }
3753
3754    #[cfg(target_os = "fuchsia")]
3755    fn signal_peer(
3756        &self,
3757        clear_mask: zx::Signals,
3758        set_mask: zx::Signals,
3759    ) -> Result<(), zx_status::Status> {
3760        use fidl::Peered;
3761        self.inner.channel().signal_peer(clear_mask, set_mask)
3762    }
3763}
3764
3765impl RunBuilderControlHandle {}
3766
3767#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3768pub struct RunControllerMarker;
3769
3770impl fidl::endpoints::ProtocolMarker for RunControllerMarker {
3771    type Proxy = RunControllerProxy;
3772    type RequestStream = RunControllerRequestStream;
3773    #[cfg(target_os = "fuchsia")]
3774    type SynchronousProxy = RunControllerSynchronousProxy;
3775
3776    const DEBUG_NAME: &'static str = "fuchsia.test.manager.RunController";
3777}
3778impl fidl::endpoints::DiscoverableProtocolMarker for RunControllerMarker {}
3779
3780pub trait RunControllerProxyInterface: Send + Sync {
3781    fn r#stop(&self) -> Result<(), fidl::Error>;
3782    fn r#kill(&self) -> Result<(), fidl::Error>;
3783    type GetEventsResponseFut: std::future::Future<Output = Result<Vec<RunEvent>, fidl::Error>>
3784        + Send;
3785    fn r#get_events(&self) -> Self::GetEventsResponseFut;
3786}
3787#[derive(Debug)]
3788#[cfg(target_os = "fuchsia")]
3789pub struct RunControllerSynchronousProxy {
3790    client: fidl::client::sync::Client,
3791}
3792
3793#[cfg(target_os = "fuchsia")]
3794impl fidl::endpoints::SynchronousProxy for RunControllerSynchronousProxy {
3795    type Proxy = RunControllerProxy;
3796    type Protocol = RunControllerMarker;
3797
3798    fn from_channel(inner: fidl::Channel) -> Self {
3799        Self::new(inner)
3800    }
3801
3802    fn into_channel(self) -> fidl::Channel {
3803        self.client.into_channel()
3804    }
3805
3806    fn as_channel(&self) -> &fidl::Channel {
3807        self.client.as_channel()
3808    }
3809}
3810
3811#[cfg(target_os = "fuchsia")]
3812impl RunControllerSynchronousProxy {
3813    pub fn new(channel: fidl::Channel) -> Self {
3814        let protocol_name = <RunControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3815        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3816    }
3817
3818    pub fn into_channel(self) -> fidl::Channel {
3819        self.client.into_channel()
3820    }
3821
3822    /// Waits until an event arrives and returns it. It is safe for other
3823    /// threads to make concurrent requests while waiting for an event.
3824    pub fn wait_for_event(
3825        &self,
3826        deadline: zx::MonotonicInstant,
3827    ) -> Result<RunControllerEvent, fidl::Error> {
3828        RunControllerEvent::decode(self.client.wait_for_event(deadline)?)
3829    }
3830
3831    /// Stop the run gracefully. RunController will disconnect after all
3832    /// resources are released and all the events in this controller are drained.
3833    /// This method is used to allow the run to complete tests that are in progress,
3834    /// but will prevent starting new tests.
3835    pub fn r#stop(&self) -> Result<(), fidl::Error> {
3836        self.client.send::<fidl::encoding::EmptyPayload>(
3837            (),
3838            0x24972633e2cf712d,
3839            fidl::encoding::DynamicFlags::FLEXIBLE,
3840        )
3841    }
3842
3843    /// Immediately terminate the run. RunController will disconnect after all
3844    /// resources are released. This method will terminate tests even if they
3845    /// are in progress.
3846    pub fn r#kill(&self) -> Result<(), fidl::Error> {
3847        self.client.send::<fidl::encoding::EmptyPayload>(
3848            (),
3849            0x6e62104929fc55c5,
3850            fidl::encoding::DynamicFlags::FLEXIBLE,
3851        )
3852    }
3853
3854    /// Iterator over events for the run. This method is a hanging get; it
3855    /// returns an empty vector only when there will be no further events
3856    /// (the run completed).
3857    pub fn r#get_events(
3858        &self,
3859        ___deadline: zx::MonotonicInstant,
3860    ) -> Result<Vec<RunEvent>, fidl::Error> {
3861        let _response = self
3862            .client
3863            .send_query::<fidl::encoding::EmptyPayload, RunControllerGetEventsResponse>(
3864                (),
3865                0x273bbd98cfcea4ba,
3866                fidl::encoding::DynamicFlags::empty(),
3867                ___deadline,
3868            )?;
3869        Ok(_response.events)
3870    }
3871}
3872
3873#[cfg(target_os = "fuchsia")]
3874impl From<RunControllerSynchronousProxy> for zx::NullableHandle {
3875    fn from(value: RunControllerSynchronousProxy) -> Self {
3876        value.into_channel().into()
3877    }
3878}
3879
3880#[cfg(target_os = "fuchsia")]
3881impl From<fidl::Channel> for RunControllerSynchronousProxy {
3882    fn from(value: fidl::Channel) -> Self {
3883        Self::new(value)
3884    }
3885}
3886
3887#[cfg(target_os = "fuchsia")]
3888impl fidl::endpoints::FromClient for RunControllerSynchronousProxy {
3889    type Protocol = RunControllerMarker;
3890
3891    fn from_client(value: fidl::endpoints::ClientEnd<RunControllerMarker>) -> Self {
3892        Self::new(value.into_channel())
3893    }
3894}
3895
3896#[derive(Debug, Clone)]
3897pub struct RunControllerProxy {
3898    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3899}
3900
3901impl fidl::endpoints::Proxy for RunControllerProxy {
3902    type Protocol = RunControllerMarker;
3903
3904    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3905        Self::new(inner)
3906    }
3907
3908    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3909        self.client.into_channel().map_err(|client| Self { client })
3910    }
3911
3912    fn as_channel(&self) -> &::fidl::AsyncChannel {
3913        self.client.as_channel()
3914    }
3915}
3916
3917impl RunControllerProxy {
3918    /// Create a new Proxy for fuchsia.test.manager/RunController.
3919    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3920        let protocol_name = <RunControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3921        Self { client: fidl::client::Client::new(channel, protocol_name) }
3922    }
3923
3924    /// Get a Stream of events from the remote end of the protocol.
3925    ///
3926    /// # Panics
3927    ///
3928    /// Panics if the event stream was already taken.
3929    pub fn take_event_stream(&self) -> RunControllerEventStream {
3930        RunControllerEventStream { event_receiver: self.client.take_event_receiver() }
3931    }
3932
3933    /// Stop the run gracefully. RunController will disconnect after all
3934    /// resources are released and all the events in this controller are drained.
3935    /// This method is used to allow the run to complete tests that are in progress,
3936    /// but will prevent starting new tests.
3937    pub fn r#stop(&self) -> Result<(), fidl::Error> {
3938        RunControllerProxyInterface::r#stop(self)
3939    }
3940
3941    /// Immediately terminate the run. RunController will disconnect after all
3942    /// resources are released. This method will terminate tests even if they
3943    /// are in progress.
3944    pub fn r#kill(&self) -> Result<(), fidl::Error> {
3945        RunControllerProxyInterface::r#kill(self)
3946    }
3947
3948    /// Iterator over events for the run. This method is a hanging get; it
3949    /// returns an empty vector only when there will be no further events
3950    /// (the run completed).
3951    pub fn r#get_events(
3952        &self,
3953    ) -> fidl::client::QueryResponseFut<Vec<RunEvent>, fidl::encoding::DefaultFuchsiaResourceDialect>
3954    {
3955        RunControllerProxyInterface::r#get_events(self)
3956    }
3957}
3958
3959impl RunControllerProxyInterface for RunControllerProxy {
3960    fn r#stop(&self) -> Result<(), fidl::Error> {
3961        self.client.send::<fidl::encoding::EmptyPayload>(
3962            (),
3963            0x24972633e2cf712d,
3964            fidl::encoding::DynamicFlags::FLEXIBLE,
3965        )
3966    }
3967
3968    fn r#kill(&self) -> Result<(), fidl::Error> {
3969        self.client.send::<fidl::encoding::EmptyPayload>(
3970            (),
3971            0x6e62104929fc55c5,
3972            fidl::encoding::DynamicFlags::FLEXIBLE,
3973        )
3974    }
3975
3976    type GetEventsResponseFut = fidl::client::QueryResponseFut<
3977        Vec<RunEvent>,
3978        fidl::encoding::DefaultFuchsiaResourceDialect,
3979    >;
3980    fn r#get_events(&self) -> Self::GetEventsResponseFut {
3981        fn _decode(
3982            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3983        ) -> Result<Vec<RunEvent>, fidl::Error> {
3984            let _response = fidl::client::decode_transaction_body::<
3985                RunControllerGetEventsResponse,
3986                fidl::encoding::DefaultFuchsiaResourceDialect,
3987                0x273bbd98cfcea4ba,
3988            >(_buf?)?;
3989            Ok(_response.events)
3990        }
3991        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<RunEvent>>(
3992            (),
3993            0x273bbd98cfcea4ba,
3994            fidl::encoding::DynamicFlags::empty(),
3995            _decode,
3996        )
3997    }
3998}
3999
4000pub struct RunControllerEventStream {
4001    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4002}
4003
4004impl std::marker::Unpin for RunControllerEventStream {}
4005
4006impl futures::stream::FusedStream for RunControllerEventStream {
4007    fn is_terminated(&self) -> bool {
4008        self.event_receiver.is_terminated()
4009    }
4010}
4011
4012impl futures::Stream for RunControllerEventStream {
4013    type Item = Result<RunControllerEvent, fidl::Error>;
4014
4015    fn poll_next(
4016        mut self: std::pin::Pin<&mut Self>,
4017        cx: &mut std::task::Context<'_>,
4018    ) -> std::task::Poll<Option<Self::Item>> {
4019        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4020            &mut self.event_receiver,
4021            cx
4022        )?) {
4023            Some(buf) => std::task::Poll::Ready(Some(RunControllerEvent::decode(buf))),
4024            None => std::task::Poll::Ready(None),
4025        }
4026    }
4027}
4028
4029#[derive(Debug)]
4030pub enum RunControllerEvent {
4031    #[non_exhaustive]
4032    _UnknownEvent {
4033        /// Ordinal of the event that was sent.
4034        ordinal: u64,
4035    },
4036}
4037
4038impl RunControllerEvent {
4039    /// Decodes a message buffer as a [`RunControllerEvent`].
4040    fn decode(
4041        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4042    ) -> Result<RunControllerEvent, fidl::Error> {
4043        let (bytes, _handles) = buf.split_mut();
4044        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4045        debug_assert_eq!(tx_header.tx_id, 0);
4046        match tx_header.ordinal {
4047            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4048                Ok(RunControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4049            }
4050            _ => Err(fidl::Error::UnknownOrdinal {
4051                ordinal: tx_header.ordinal,
4052                protocol_name: <RunControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4053            }),
4054        }
4055    }
4056}
4057
4058/// A Stream of incoming requests for fuchsia.test.manager/RunController.
4059pub struct RunControllerRequestStream {
4060    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4061    is_terminated: bool,
4062}
4063
4064impl std::marker::Unpin for RunControllerRequestStream {}
4065
4066impl futures::stream::FusedStream for RunControllerRequestStream {
4067    fn is_terminated(&self) -> bool {
4068        self.is_terminated
4069    }
4070}
4071
4072impl fidl::endpoints::RequestStream for RunControllerRequestStream {
4073    type Protocol = RunControllerMarker;
4074    type ControlHandle = RunControllerControlHandle;
4075
4076    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4077        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4078    }
4079
4080    fn control_handle(&self) -> Self::ControlHandle {
4081        RunControllerControlHandle { inner: self.inner.clone() }
4082    }
4083
4084    fn into_inner(
4085        self,
4086    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4087    {
4088        (self.inner, self.is_terminated)
4089    }
4090
4091    fn from_inner(
4092        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4093        is_terminated: bool,
4094    ) -> Self {
4095        Self { inner, is_terminated }
4096    }
4097}
4098
4099impl futures::Stream for RunControllerRequestStream {
4100    type Item = Result<RunControllerRequest, fidl::Error>;
4101
4102    fn poll_next(
4103        mut self: std::pin::Pin<&mut Self>,
4104        cx: &mut std::task::Context<'_>,
4105    ) -> std::task::Poll<Option<Self::Item>> {
4106        let this = &mut *self;
4107        if this.inner.check_shutdown(cx) {
4108            this.is_terminated = true;
4109            return std::task::Poll::Ready(None);
4110        }
4111        if this.is_terminated {
4112            panic!("polled RunControllerRequestStream after completion");
4113        }
4114        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4115            |bytes, handles| {
4116                match this.inner.channel().read_etc(cx, bytes, handles) {
4117                    std::task::Poll::Ready(Ok(())) => {}
4118                    std::task::Poll::Pending => return std::task::Poll::Pending,
4119                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4120                        this.is_terminated = true;
4121                        return std::task::Poll::Ready(None);
4122                    }
4123                    std::task::Poll::Ready(Err(e)) => {
4124                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4125                            e.into(),
4126                        ))));
4127                    }
4128                }
4129
4130                // A message has been received from the channel
4131                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4132
4133                std::task::Poll::Ready(Some(match header.ordinal {
4134                    0x24972633e2cf712d => {
4135                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4136                        let mut req = fidl::new_empty!(
4137                            fidl::encoding::EmptyPayload,
4138                            fidl::encoding::DefaultFuchsiaResourceDialect
4139                        );
4140                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4141                        let control_handle =
4142                            RunControllerControlHandle { inner: this.inner.clone() };
4143                        Ok(RunControllerRequest::Stop { control_handle })
4144                    }
4145                    0x6e62104929fc55c5 => {
4146                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4147                        let mut req = fidl::new_empty!(
4148                            fidl::encoding::EmptyPayload,
4149                            fidl::encoding::DefaultFuchsiaResourceDialect
4150                        );
4151                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4152                        let control_handle =
4153                            RunControllerControlHandle { inner: this.inner.clone() };
4154                        Ok(RunControllerRequest::Kill { control_handle })
4155                    }
4156                    0x273bbd98cfcea4ba => {
4157                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4158                        let mut req = fidl::new_empty!(
4159                            fidl::encoding::EmptyPayload,
4160                            fidl::encoding::DefaultFuchsiaResourceDialect
4161                        );
4162                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4163                        let control_handle =
4164                            RunControllerControlHandle { inner: this.inner.clone() };
4165                        Ok(RunControllerRequest::GetEvents {
4166                            responder: RunControllerGetEventsResponder {
4167                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4168                                tx_id: header.tx_id,
4169                            },
4170                        })
4171                    }
4172                    _ if header.tx_id == 0
4173                        && header
4174                            .dynamic_flags()
4175                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4176                    {
4177                        Ok(RunControllerRequest::_UnknownMethod {
4178                            ordinal: header.ordinal,
4179                            control_handle: RunControllerControlHandle {
4180                                inner: this.inner.clone(),
4181                            },
4182                            method_type: fidl::MethodType::OneWay,
4183                        })
4184                    }
4185                    _ if header
4186                        .dynamic_flags()
4187                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4188                    {
4189                        this.inner.send_framework_err(
4190                            fidl::encoding::FrameworkErr::UnknownMethod,
4191                            header.tx_id,
4192                            header.ordinal,
4193                            header.dynamic_flags(),
4194                            (bytes, handles),
4195                        )?;
4196                        Ok(RunControllerRequest::_UnknownMethod {
4197                            ordinal: header.ordinal,
4198                            control_handle: RunControllerControlHandle {
4199                                inner: this.inner.clone(),
4200                            },
4201                            method_type: fidl::MethodType::TwoWay,
4202                        })
4203                    }
4204                    _ => Err(fidl::Error::UnknownOrdinal {
4205                        ordinal: header.ordinal,
4206                        protocol_name:
4207                            <RunControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4208                    }),
4209                }))
4210            },
4211        )
4212    }
4213}
4214
4215/// The server end will disconnect after all the suite runs have finished and
4216/// the events are drained.
4217/// If the client disconnects, the tests will be terminated immediately and all
4218/// results discarded.
4219#[derive(Debug)]
4220pub enum RunControllerRequest {
4221    /// Stop the run gracefully. RunController will disconnect after all
4222    /// resources are released and all the events in this controller are drained.
4223    /// This method is used to allow the run to complete tests that are in progress,
4224    /// but will prevent starting new tests.
4225    Stop { control_handle: RunControllerControlHandle },
4226    /// Immediately terminate the run. RunController will disconnect after all
4227    /// resources are released. This method will terminate tests even if they
4228    /// are in progress.
4229    Kill { control_handle: RunControllerControlHandle },
4230    /// Iterator over events for the run. This method is a hanging get; it
4231    /// returns an empty vector only when there will be no further events
4232    /// (the run completed).
4233    GetEvents { responder: RunControllerGetEventsResponder },
4234    /// An interaction was received which does not match any known method.
4235    #[non_exhaustive]
4236    _UnknownMethod {
4237        /// Ordinal of the method that was called.
4238        ordinal: u64,
4239        control_handle: RunControllerControlHandle,
4240        method_type: fidl::MethodType,
4241    },
4242}
4243
4244impl RunControllerRequest {
4245    #[allow(irrefutable_let_patterns)]
4246    pub fn into_stop(self) -> Option<(RunControllerControlHandle)> {
4247        if let RunControllerRequest::Stop { control_handle } = self {
4248            Some((control_handle))
4249        } else {
4250            None
4251        }
4252    }
4253
4254    #[allow(irrefutable_let_patterns)]
4255    pub fn into_kill(self) -> Option<(RunControllerControlHandle)> {
4256        if let RunControllerRequest::Kill { control_handle } = self {
4257            Some((control_handle))
4258        } else {
4259            None
4260        }
4261    }
4262
4263    #[allow(irrefutable_let_patterns)]
4264    pub fn into_get_events(self) -> Option<(RunControllerGetEventsResponder)> {
4265        if let RunControllerRequest::GetEvents { responder } = self {
4266            Some((responder))
4267        } else {
4268            None
4269        }
4270    }
4271
4272    /// Name of the method defined in FIDL
4273    pub fn method_name(&self) -> &'static str {
4274        match *self {
4275            RunControllerRequest::Stop { .. } => "stop",
4276            RunControllerRequest::Kill { .. } => "kill",
4277            RunControllerRequest::GetEvents { .. } => "get_events",
4278            RunControllerRequest::_UnknownMethod {
4279                method_type: fidl::MethodType::OneWay, ..
4280            } => "unknown one-way method",
4281            RunControllerRequest::_UnknownMethod {
4282                method_type: fidl::MethodType::TwoWay, ..
4283            } => "unknown two-way method",
4284        }
4285    }
4286}
4287
4288#[derive(Debug, Clone)]
4289pub struct RunControllerControlHandle {
4290    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4291}
4292
4293impl fidl::endpoints::ControlHandle for RunControllerControlHandle {
4294    fn shutdown(&self) {
4295        self.inner.shutdown()
4296    }
4297
4298    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4299        self.inner.shutdown_with_epitaph(status)
4300    }
4301
4302    fn is_closed(&self) -> bool {
4303        self.inner.channel().is_closed()
4304    }
4305    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4306        self.inner.channel().on_closed()
4307    }
4308
4309    #[cfg(target_os = "fuchsia")]
4310    fn signal_peer(
4311        &self,
4312        clear_mask: zx::Signals,
4313        set_mask: zx::Signals,
4314    ) -> Result<(), zx_status::Status> {
4315        use fidl::Peered;
4316        self.inner.channel().signal_peer(clear_mask, set_mask)
4317    }
4318}
4319
4320impl RunControllerControlHandle {}
4321
4322#[must_use = "FIDL methods require a response to be sent"]
4323#[derive(Debug)]
4324pub struct RunControllerGetEventsResponder {
4325    control_handle: std::mem::ManuallyDrop<RunControllerControlHandle>,
4326    tx_id: u32,
4327}
4328
4329/// Set the the channel to be shutdown (see [`RunControllerControlHandle::shutdown`])
4330/// if the responder is dropped without sending a response, so that the client
4331/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4332impl std::ops::Drop for RunControllerGetEventsResponder {
4333    fn drop(&mut self) {
4334        self.control_handle.shutdown();
4335        // Safety: drops once, never accessed again
4336        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4337    }
4338}
4339
4340impl fidl::endpoints::Responder for RunControllerGetEventsResponder {
4341    type ControlHandle = RunControllerControlHandle;
4342
4343    fn control_handle(&self) -> &RunControllerControlHandle {
4344        &self.control_handle
4345    }
4346
4347    fn drop_without_shutdown(mut self) {
4348        // Safety: drops once, never accessed again due to mem::forget
4349        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4350        // Prevent Drop from running (which would shut down the channel)
4351        std::mem::forget(self);
4352    }
4353}
4354
4355impl RunControllerGetEventsResponder {
4356    /// Sends a response to the FIDL transaction.
4357    ///
4358    /// Sets the channel to shutdown if an error occurs.
4359    pub fn send(self, mut events: Vec<RunEvent>) -> Result<(), fidl::Error> {
4360        let _result = self.send_raw(events);
4361        if _result.is_err() {
4362            self.control_handle.shutdown();
4363        }
4364        self.drop_without_shutdown();
4365        _result
4366    }
4367
4368    /// Similar to "send" but does not shutdown the channel if an error occurs.
4369    pub fn send_no_shutdown_on_err(self, mut events: Vec<RunEvent>) -> Result<(), fidl::Error> {
4370        let _result = self.send_raw(events);
4371        self.drop_without_shutdown();
4372        _result
4373    }
4374
4375    fn send_raw(&self, mut events: Vec<RunEvent>) -> Result<(), fidl::Error> {
4376        self.control_handle.inner.send::<RunControllerGetEventsResponse>(
4377            (events.as_mut(),),
4378            self.tx_id,
4379            0x273bbd98cfcea4ba,
4380            fidl::encoding::DynamicFlags::empty(),
4381        )
4382    }
4383}
4384
4385#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4386pub struct SuiteControllerMarker;
4387
4388impl fidl::endpoints::ProtocolMarker for SuiteControllerMarker {
4389    type Proxy = SuiteControllerProxy;
4390    type RequestStream = SuiteControllerRequestStream;
4391    #[cfg(target_os = "fuchsia")]
4392    type SynchronousProxy = SuiteControllerSynchronousProxy;
4393
4394    const DEBUG_NAME: &'static str = "(anonymous) SuiteController";
4395}
4396pub type SuiteControllerWatchEventsResult = Result<Vec<Event>, LaunchError>;
4397pub type SuiteControllerGetEventsResult = Result<Vec<SuiteEvent>, LaunchError>;
4398
4399pub trait SuiteControllerProxyInterface: Send + Sync {
4400    fn r#stop(&self) -> Result<(), fidl::Error>;
4401    fn r#kill(&self) -> Result<(), fidl::Error>;
4402    type WatchEventsResponseFut: std::future::Future<Output = Result<SuiteControllerWatchEventsResult, fidl::Error>>
4403        + Send;
4404    fn r#watch_events(&self) -> Self::WatchEventsResponseFut;
4405    type GetEventsResponseFut: std::future::Future<Output = Result<SuiteControllerGetEventsResult, fidl::Error>>
4406        + Send;
4407    fn r#get_events(&self) -> Self::GetEventsResponseFut;
4408}
4409#[derive(Debug)]
4410#[cfg(target_os = "fuchsia")]
4411pub struct SuiteControllerSynchronousProxy {
4412    client: fidl::client::sync::Client,
4413}
4414
4415#[cfg(target_os = "fuchsia")]
4416impl fidl::endpoints::SynchronousProxy for SuiteControllerSynchronousProxy {
4417    type Proxy = SuiteControllerProxy;
4418    type Protocol = SuiteControllerMarker;
4419
4420    fn from_channel(inner: fidl::Channel) -> Self {
4421        Self::new(inner)
4422    }
4423
4424    fn into_channel(self) -> fidl::Channel {
4425        self.client.into_channel()
4426    }
4427
4428    fn as_channel(&self) -> &fidl::Channel {
4429        self.client.as_channel()
4430    }
4431}
4432
4433#[cfg(target_os = "fuchsia")]
4434impl SuiteControllerSynchronousProxy {
4435    pub fn new(channel: fidl::Channel) -> Self {
4436        let protocol_name = <SuiteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4437        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4438    }
4439
4440    pub fn into_channel(self) -> fidl::Channel {
4441        self.client.into_channel()
4442    }
4443
4444    /// Waits until an event arrives and returns it. It is safe for other
4445    /// threads to make concurrent requests while waiting for an event.
4446    pub fn wait_for_event(
4447        &self,
4448        deadline: zx::MonotonicInstant,
4449    ) -> Result<SuiteControllerEvent, fidl::Error> {
4450        SuiteControllerEvent::decode(self.client.wait_for_event(deadline)?)
4451    }
4452
4453    /// Stop the suite run gracefully. SuiteController will disconnect after
4454    /// all resources are released and all the events in this controller are drained.
4455    pub fn r#stop(&self) -> Result<(), fidl::Error> {
4456        self.client.send::<fidl::encoding::EmptyPayload>(
4457            (),
4458            0x4675fc6c8f404fef,
4459            fidl::encoding::DynamicFlags::FLEXIBLE,
4460        )
4461    }
4462
4463    /// Immediately terminate the run. SuiteController will disconnect after
4464    /// all resources are released. This method will terminate tests even if
4465    /// they are in progress.
4466    pub fn r#kill(&self) -> Result<(), fidl::Error> {
4467        self.client.send::<fidl::encoding::EmptyPayload>(
4468            (),
4469            0x5f813fb72887fc17,
4470            fidl::encoding::DynamicFlags::FLEXIBLE,
4471        )
4472    }
4473
4474    /// Returns events when they're available using a hanging get pattern. Returns an empty
4475    /// vector to indicate there will be no further events.
4476    pub fn r#watch_events(
4477        &self,
4478        ___deadline: zx::MonotonicInstant,
4479    ) -> Result<SuiteControllerWatchEventsResult, fidl::Error> {
4480        let _response =
4481            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
4482                SuiteControllerWatchEventsResponse,
4483                LaunchError,
4484            >>(
4485                (),
4486                0x5d1a75b1d06839b4,
4487                fidl::encoding::DynamicFlags::empty(),
4488                ___deadline,
4489            )?;
4490        Ok(_response.map(|x| x.events))
4491    }
4492
4493    /// Iterator over events for the run. This method is a hanging get; it
4494    /// returns an empty vector only when there will be no further events
4495    /// (the run completed).
4496    pub fn r#get_events(
4497        &self,
4498        ___deadline: zx::MonotonicInstant,
4499    ) -> Result<SuiteControllerGetEventsResult, fidl::Error> {
4500        let _response = self.client.send_query::<
4501            fidl::encoding::EmptyPayload,
4502            fidl::encoding::FlexibleResultType<SuiteControllerGetEventsResponse, LaunchError>,
4503        >(
4504            (),
4505            0x1f2ec93d2236d1db,
4506            fidl::encoding::DynamicFlags::FLEXIBLE,
4507            ___deadline,
4508        )?
4509        .into_result::<SuiteControllerMarker>("get_events")?;
4510        Ok(_response.map(|x| x.events))
4511    }
4512}
4513
4514#[cfg(target_os = "fuchsia")]
4515impl From<SuiteControllerSynchronousProxy> for zx::NullableHandle {
4516    fn from(value: SuiteControllerSynchronousProxy) -> Self {
4517        value.into_channel().into()
4518    }
4519}
4520
4521#[cfg(target_os = "fuchsia")]
4522impl From<fidl::Channel> for SuiteControllerSynchronousProxy {
4523    fn from(value: fidl::Channel) -> Self {
4524        Self::new(value)
4525    }
4526}
4527
4528#[cfg(target_os = "fuchsia")]
4529impl fidl::endpoints::FromClient for SuiteControllerSynchronousProxy {
4530    type Protocol = SuiteControllerMarker;
4531
4532    fn from_client(value: fidl::endpoints::ClientEnd<SuiteControllerMarker>) -> Self {
4533        Self::new(value.into_channel())
4534    }
4535}
4536
4537#[derive(Debug, Clone)]
4538pub struct SuiteControllerProxy {
4539    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4540}
4541
4542impl fidl::endpoints::Proxy for SuiteControllerProxy {
4543    type Protocol = SuiteControllerMarker;
4544
4545    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4546        Self::new(inner)
4547    }
4548
4549    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4550        self.client.into_channel().map_err(|client| Self { client })
4551    }
4552
4553    fn as_channel(&self) -> &::fidl::AsyncChannel {
4554        self.client.as_channel()
4555    }
4556}
4557
4558impl SuiteControllerProxy {
4559    /// Create a new Proxy for fuchsia.test.manager/SuiteController.
4560    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4561        let protocol_name = <SuiteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4562        Self { client: fidl::client::Client::new(channel, protocol_name) }
4563    }
4564
4565    /// Get a Stream of events from the remote end of the protocol.
4566    ///
4567    /// # Panics
4568    ///
4569    /// Panics if the event stream was already taken.
4570    pub fn take_event_stream(&self) -> SuiteControllerEventStream {
4571        SuiteControllerEventStream { event_receiver: self.client.take_event_receiver() }
4572    }
4573
4574    /// Stop the suite run gracefully. SuiteController will disconnect after
4575    /// all resources are released and all the events in this controller are drained.
4576    pub fn r#stop(&self) -> Result<(), fidl::Error> {
4577        SuiteControllerProxyInterface::r#stop(self)
4578    }
4579
4580    /// Immediately terminate the run. SuiteController will disconnect after
4581    /// all resources are released. This method will terminate tests even if
4582    /// they are in progress.
4583    pub fn r#kill(&self) -> Result<(), fidl::Error> {
4584        SuiteControllerProxyInterface::r#kill(self)
4585    }
4586
4587    /// Returns events when they're available using a hanging get pattern. Returns an empty
4588    /// vector to indicate there will be no further events.
4589    pub fn r#watch_events(
4590        &self,
4591    ) -> fidl::client::QueryResponseFut<
4592        SuiteControllerWatchEventsResult,
4593        fidl::encoding::DefaultFuchsiaResourceDialect,
4594    > {
4595        SuiteControllerProxyInterface::r#watch_events(self)
4596    }
4597
4598    /// Iterator over events for the run. This method is a hanging get; it
4599    /// returns an empty vector only when there will be no further events
4600    /// (the run completed).
4601    pub fn r#get_events(
4602        &self,
4603    ) -> fidl::client::QueryResponseFut<
4604        SuiteControllerGetEventsResult,
4605        fidl::encoding::DefaultFuchsiaResourceDialect,
4606    > {
4607        SuiteControllerProxyInterface::r#get_events(self)
4608    }
4609}
4610
4611impl SuiteControllerProxyInterface for SuiteControllerProxy {
4612    fn r#stop(&self) -> Result<(), fidl::Error> {
4613        self.client.send::<fidl::encoding::EmptyPayload>(
4614            (),
4615            0x4675fc6c8f404fef,
4616            fidl::encoding::DynamicFlags::FLEXIBLE,
4617        )
4618    }
4619
4620    fn r#kill(&self) -> Result<(), fidl::Error> {
4621        self.client.send::<fidl::encoding::EmptyPayload>(
4622            (),
4623            0x5f813fb72887fc17,
4624            fidl::encoding::DynamicFlags::FLEXIBLE,
4625        )
4626    }
4627
4628    type WatchEventsResponseFut = fidl::client::QueryResponseFut<
4629        SuiteControllerWatchEventsResult,
4630        fidl::encoding::DefaultFuchsiaResourceDialect,
4631    >;
4632    fn r#watch_events(&self) -> Self::WatchEventsResponseFut {
4633        fn _decode(
4634            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4635        ) -> Result<SuiteControllerWatchEventsResult, fidl::Error> {
4636            let _response = fidl::client::decode_transaction_body::<
4637                fidl::encoding::ResultType<SuiteControllerWatchEventsResponse, LaunchError>,
4638                fidl::encoding::DefaultFuchsiaResourceDialect,
4639                0x5d1a75b1d06839b4,
4640            >(_buf?)?;
4641            Ok(_response.map(|x| x.events))
4642        }
4643        self.client.send_query_and_decode::<
4644            fidl::encoding::EmptyPayload,
4645            SuiteControllerWatchEventsResult,
4646        >(
4647            (),
4648            0x5d1a75b1d06839b4,
4649            fidl::encoding::DynamicFlags::empty(),
4650            _decode,
4651        )
4652    }
4653
4654    type GetEventsResponseFut = fidl::client::QueryResponseFut<
4655        SuiteControllerGetEventsResult,
4656        fidl::encoding::DefaultFuchsiaResourceDialect,
4657    >;
4658    fn r#get_events(&self) -> Self::GetEventsResponseFut {
4659        fn _decode(
4660            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4661        ) -> Result<SuiteControllerGetEventsResult, fidl::Error> {
4662            let _response = fidl::client::decode_transaction_body::<
4663                fidl::encoding::FlexibleResultType<SuiteControllerGetEventsResponse, LaunchError>,
4664                fidl::encoding::DefaultFuchsiaResourceDialect,
4665                0x1f2ec93d2236d1db,
4666            >(_buf?)?
4667            .into_result::<SuiteControllerMarker>("get_events")?;
4668            Ok(_response.map(|x| x.events))
4669        }
4670        self.client
4671            .send_query_and_decode::<fidl::encoding::EmptyPayload, SuiteControllerGetEventsResult>(
4672                (),
4673                0x1f2ec93d2236d1db,
4674                fidl::encoding::DynamicFlags::FLEXIBLE,
4675                _decode,
4676            )
4677    }
4678}
4679
4680pub struct SuiteControllerEventStream {
4681    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4682}
4683
4684impl std::marker::Unpin for SuiteControllerEventStream {}
4685
4686impl futures::stream::FusedStream for SuiteControllerEventStream {
4687    fn is_terminated(&self) -> bool {
4688        self.event_receiver.is_terminated()
4689    }
4690}
4691
4692impl futures::Stream for SuiteControllerEventStream {
4693    type Item = Result<SuiteControllerEvent, fidl::Error>;
4694
4695    fn poll_next(
4696        mut self: std::pin::Pin<&mut Self>,
4697        cx: &mut std::task::Context<'_>,
4698    ) -> std::task::Poll<Option<Self::Item>> {
4699        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4700            &mut self.event_receiver,
4701            cx
4702        )?) {
4703            Some(buf) => std::task::Poll::Ready(Some(SuiteControllerEvent::decode(buf))),
4704            None => std::task::Poll::Ready(None),
4705        }
4706    }
4707}
4708
4709#[derive(Debug)]
4710pub enum SuiteControllerEvent {
4711    #[non_exhaustive]
4712    _UnknownEvent {
4713        /// Ordinal of the event that was sent.
4714        ordinal: u64,
4715    },
4716}
4717
4718impl SuiteControllerEvent {
4719    /// Decodes a message buffer as a [`SuiteControllerEvent`].
4720    fn decode(
4721        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4722    ) -> Result<SuiteControllerEvent, fidl::Error> {
4723        let (bytes, _handles) = buf.split_mut();
4724        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4725        debug_assert_eq!(tx_header.tx_id, 0);
4726        match tx_header.ordinal {
4727            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4728                Ok(SuiteControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4729            }
4730            _ => Err(fidl::Error::UnknownOrdinal {
4731                ordinal: tx_header.ordinal,
4732                protocol_name:
4733                    <SuiteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4734            }),
4735        }
4736    }
4737}
4738
4739/// A Stream of incoming requests for fuchsia.test.manager/SuiteController.
4740pub struct SuiteControllerRequestStream {
4741    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4742    is_terminated: bool,
4743}
4744
4745impl std::marker::Unpin for SuiteControllerRequestStream {}
4746
4747impl futures::stream::FusedStream for SuiteControllerRequestStream {
4748    fn is_terminated(&self) -> bool {
4749        self.is_terminated
4750    }
4751}
4752
4753impl fidl::endpoints::RequestStream for SuiteControllerRequestStream {
4754    type Protocol = SuiteControllerMarker;
4755    type ControlHandle = SuiteControllerControlHandle;
4756
4757    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4758        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4759    }
4760
4761    fn control_handle(&self) -> Self::ControlHandle {
4762        SuiteControllerControlHandle { inner: self.inner.clone() }
4763    }
4764
4765    fn into_inner(
4766        self,
4767    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4768    {
4769        (self.inner, self.is_terminated)
4770    }
4771
4772    fn from_inner(
4773        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4774        is_terminated: bool,
4775    ) -> Self {
4776        Self { inner, is_terminated }
4777    }
4778}
4779
4780impl futures::Stream for SuiteControllerRequestStream {
4781    type Item = Result<SuiteControllerRequest, fidl::Error>;
4782
4783    fn poll_next(
4784        mut self: std::pin::Pin<&mut Self>,
4785        cx: &mut std::task::Context<'_>,
4786    ) -> std::task::Poll<Option<Self::Item>> {
4787        let this = &mut *self;
4788        if this.inner.check_shutdown(cx) {
4789            this.is_terminated = true;
4790            return std::task::Poll::Ready(None);
4791        }
4792        if this.is_terminated {
4793            panic!("polled SuiteControllerRequestStream after completion");
4794        }
4795        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4796            |bytes, handles| {
4797                match this.inner.channel().read_etc(cx, bytes, handles) {
4798                    std::task::Poll::Ready(Ok(())) => {}
4799                    std::task::Poll::Pending => return std::task::Poll::Pending,
4800                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4801                        this.is_terminated = true;
4802                        return std::task::Poll::Ready(None);
4803                    }
4804                    std::task::Poll::Ready(Err(e)) => {
4805                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4806                            e.into(),
4807                        ))));
4808                    }
4809                }
4810
4811                // A message has been received from the channel
4812                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4813
4814                std::task::Poll::Ready(Some(match header.ordinal {
4815                    0x4675fc6c8f404fef => {
4816                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4817                        let mut req = fidl::new_empty!(
4818                            fidl::encoding::EmptyPayload,
4819                            fidl::encoding::DefaultFuchsiaResourceDialect
4820                        );
4821                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4822                        let control_handle =
4823                            SuiteControllerControlHandle { inner: this.inner.clone() };
4824                        Ok(SuiteControllerRequest::Stop { control_handle })
4825                    }
4826                    0x5f813fb72887fc17 => {
4827                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4828                        let mut req = fidl::new_empty!(
4829                            fidl::encoding::EmptyPayload,
4830                            fidl::encoding::DefaultFuchsiaResourceDialect
4831                        );
4832                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4833                        let control_handle =
4834                            SuiteControllerControlHandle { inner: this.inner.clone() };
4835                        Ok(SuiteControllerRequest::Kill { control_handle })
4836                    }
4837                    0x5d1a75b1d06839b4 => {
4838                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4839                        let mut req = fidl::new_empty!(
4840                            fidl::encoding::EmptyPayload,
4841                            fidl::encoding::DefaultFuchsiaResourceDialect
4842                        );
4843                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4844                        let control_handle =
4845                            SuiteControllerControlHandle { inner: this.inner.clone() };
4846                        Ok(SuiteControllerRequest::WatchEvents {
4847                            responder: SuiteControllerWatchEventsResponder {
4848                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4849                                tx_id: header.tx_id,
4850                            },
4851                        })
4852                    }
4853                    0x1f2ec93d2236d1db => {
4854                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4855                        let mut req = fidl::new_empty!(
4856                            fidl::encoding::EmptyPayload,
4857                            fidl::encoding::DefaultFuchsiaResourceDialect
4858                        );
4859                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4860                        let control_handle =
4861                            SuiteControllerControlHandle { inner: this.inner.clone() };
4862                        Ok(SuiteControllerRequest::GetEvents {
4863                            responder: SuiteControllerGetEventsResponder {
4864                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4865                                tx_id: header.tx_id,
4866                            },
4867                        })
4868                    }
4869                    _ if header.tx_id == 0
4870                        && header
4871                            .dynamic_flags()
4872                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4873                    {
4874                        Ok(SuiteControllerRequest::_UnknownMethod {
4875                            ordinal: header.ordinal,
4876                            control_handle: SuiteControllerControlHandle {
4877                                inner: this.inner.clone(),
4878                            },
4879                            method_type: fidl::MethodType::OneWay,
4880                        })
4881                    }
4882                    _ if header
4883                        .dynamic_flags()
4884                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4885                    {
4886                        this.inner.send_framework_err(
4887                            fidl::encoding::FrameworkErr::UnknownMethod,
4888                            header.tx_id,
4889                            header.ordinal,
4890                            header.dynamic_flags(),
4891                            (bytes, handles),
4892                        )?;
4893                        Ok(SuiteControllerRequest::_UnknownMethod {
4894                            ordinal: header.ordinal,
4895                            control_handle: SuiteControllerControlHandle {
4896                                inner: this.inner.clone(),
4897                            },
4898                            method_type: fidl::MethodType::TwoWay,
4899                        })
4900                    }
4901                    _ => Err(fidl::Error::UnknownOrdinal {
4902                        ordinal: header.ordinal,
4903                        protocol_name:
4904                            <SuiteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4905                    }),
4906                }))
4907            },
4908        )
4909    }
4910}
4911
4912/// Provides for control and monitoring of a running test suite started with `SuiteRunner.RunSuite`.
4913///
4914/// The server closes its end of the channel after the suite run has finished and all events have
4915/// been delivered via `WatchEvents`. If the client disconnects, the suite is terminated immediately
4916/// and all results discarded.
4917#[derive(Debug)]
4918pub enum SuiteControllerRequest {
4919    /// Stop the suite run gracefully. SuiteController will disconnect after
4920    /// all resources are released and all the events in this controller are drained.
4921    Stop { control_handle: SuiteControllerControlHandle },
4922    /// Immediately terminate the run. SuiteController will disconnect after
4923    /// all resources are released. This method will terminate tests even if
4924    /// they are in progress.
4925    Kill { control_handle: SuiteControllerControlHandle },
4926    /// Returns events when they're available using a hanging get pattern. Returns an empty
4927    /// vector to indicate there will be no further events.
4928    WatchEvents { responder: SuiteControllerWatchEventsResponder },
4929    /// Iterator over events for the run. This method is a hanging get; it
4930    /// returns an empty vector only when there will be no further events
4931    /// (the run completed).
4932    GetEvents { responder: SuiteControllerGetEventsResponder },
4933    /// An interaction was received which does not match any known method.
4934    #[non_exhaustive]
4935    _UnknownMethod {
4936        /// Ordinal of the method that was called.
4937        ordinal: u64,
4938        control_handle: SuiteControllerControlHandle,
4939        method_type: fidl::MethodType,
4940    },
4941}
4942
4943impl SuiteControllerRequest {
4944    #[allow(irrefutable_let_patterns)]
4945    pub fn into_stop(self) -> Option<(SuiteControllerControlHandle)> {
4946        if let SuiteControllerRequest::Stop { control_handle } = self {
4947            Some((control_handle))
4948        } else {
4949            None
4950        }
4951    }
4952
4953    #[allow(irrefutable_let_patterns)]
4954    pub fn into_kill(self) -> Option<(SuiteControllerControlHandle)> {
4955        if let SuiteControllerRequest::Kill { control_handle } = self {
4956            Some((control_handle))
4957        } else {
4958            None
4959        }
4960    }
4961
4962    #[allow(irrefutable_let_patterns)]
4963    pub fn into_watch_events(self) -> Option<(SuiteControllerWatchEventsResponder)> {
4964        if let SuiteControllerRequest::WatchEvents { responder } = self {
4965            Some((responder))
4966        } else {
4967            None
4968        }
4969    }
4970
4971    #[allow(irrefutable_let_patterns)]
4972    pub fn into_get_events(self) -> Option<(SuiteControllerGetEventsResponder)> {
4973        if let SuiteControllerRequest::GetEvents { responder } = self {
4974            Some((responder))
4975        } else {
4976            None
4977        }
4978    }
4979
4980    /// Name of the method defined in FIDL
4981    pub fn method_name(&self) -> &'static str {
4982        match *self {
4983            SuiteControllerRequest::Stop { .. } => "stop",
4984            SuiteControllerRequest::Kill { .. } => "kill",
4985            SuiteControllerRequest::WatchEvents { .. } => "watch_events",
4986            SuiteControllerRequest::GetEvents { .. } => "get_events",
4987            SuiteControllerRequest::_UnknownMethod {
4988                method_type: fidl::MethodType::OneWay,
4989                ..
4990            } => "unknown one-way method",
4991            SuiteControllerRequest::_UnknownMethod {
4992                method_type: fidl::MethodType::TwoWay,
4993                ..
4994            } => "unknown two-way method",
4995        }
4996    }
4997}
4998
4999#[derive(Debug, Clone)]
5000pub struct SuiteControllerControlHandle {
5001    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5002}
5003
5004impl fidl::endpoints::ControlHandle for SuiteControllerControlHandle {
5005    fn shutdown(&self) {
5006        self.inner.shutdown()
5007    }
5008
5009    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5010        self.inner.shutdown_with_epitaph(status)
5011    }
5012
5013    fn is_closed(&self) -> bool {
5014        self.inner.channel().is_closed()
5015    }
5016    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5017        self.inner.channel().on_closed()
5018    }
5019
5020    #[cfg(target_os = "fuchsia")]
5021    fn signal_peer(
5022        &self,
5023        clear_mask: zx::Signals,
5024        set_mask: zx::Signals,
5025    ) -> Result<(), zx_status::Status> {
5026        use fidl::Peered;
5027        self.inner.channel().signal_peer(clear_mask, set_mask)
5028    }
5029}
5030
5031impl SuiteControllerControlHandle {}
5032
5033#[must_use = "FIDL methods require a response to be sent"]
5034#[derive(Debug)]
5035pub struct SuiteControllerWatchEventsResponder {
5036    control_handle: std::mem::ManuallyDrop<SuiteControllerControlHandle>,
5037    tx_id: u32,
5038}
5039
5040/// Set the the channel to be shutdown (see [`SuiteControllerControlHandle::shutdown`])
5041/// if the responder is dropped without sending a response, so that the client
5042/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5043impl std::ops::Drop for SuiteControllerWatchEventsResponder {
5044    fn drop(&mut self) {
5045        self.control_handle.shutdown();
5046        // Safety: drops once, never accessed again
5047        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5048    }
5049}
5050
5051impl fidl::endpoints::Responder for SuiteControllerWatchEventsResponder {
5052    type ControlHandle = SuiteControllerControlHandle;
5053
5054    fn control_handle(&self) -> &SuiteControllerControlHandle {
5055        &self.control_handle
5056    }
5057
5058    fn drop_without_shutdown(mut self) {
5059        // Safety: drops once, never accessed again due to mem::forget
5060        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5061        // Prevent Drop from running (which would shut down the channel)
5062        std::mem::forget(self);
5063    }
5064}
5065
5066impl SuiteControllerWatchEventsResponder {
5067    /// Sends a response to the FIDL transaction.
5068    ///
5069    /// Sets the channel to shutdown if an error occurs.
5070    pub fn send(self, mut result: Result<Vec<Event>, LaunchError>) -> Result<(), fidl::Error> {
5071        let _result = self.send_raw(result);
5072        if _result.is_err() {
5073            self.control_handle.shutdown();
5074        }
5075        self.drop_without_shutdown();
5076        _result
5077    }
5078
5079    /// Similar to "send" but does not shutdown the channel if an error occurs.
5080    pub fn send_no_shutdown_on_err(
5081        self,
5082        mut result: Result<Vec<Event>, LaunchError>,
5083    ) -> Result<(), fidl::Error> {
5084        let _result = self.send_raw(result);
5085        self.drop_without_shutdown();
5086        _result
5087    }
5088
5089    fn send_raw(&self, mut result: Result<Vec<Event>, LaunchError>) -> Result<(), fidl::Error> {
5090        self.control_handle.inner.send::<fidl::encoding::ResultType<
5091            SuiteControllerWatchEventsResponse,
5092            LaunchError,
5093        >>(
5094            result.as_mut().map_err(|e| *e).map(|events| (events.as_mut_slice(),)),
5095            self.tx_id,
5096            0x5d1a75b1d06839b4,
5097            fidl::encoding::DynamicFlags::empty(),
5098        )
5099    }
5100}
5101
5102#[must_use = "FIDL methods require a response to be sent"]
5103#[derive(Debug)]
5104pub struct SuiteControllerGetEventsResponder {
5105    control_handle: std::mem::ManuallyDrop<SuiteControllerControlHandle>,
5106    tx_id: u32,
5107}
5108
5109/// Set the the channel to be shutdown (see [`SuiteControllerControlHandle::shutdown`])
5110/// if the responder is dropped without sending a response, so that the client
5111/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5112impl std::ops::Drop for SuiteControllerGetEventsResponder {
5113    fn drop(&mut self) {
5114        self.control_handle.shutdown();
5115        // Safety: drops once, never accessed again
5116        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5117    }
5118}
5119
5120impl fidl::endpoints::Responder for SuiteControllerGetEventsResponder {
5121    type ControlHandle = SuiteControllerControlHandle;
5122
5123    fn control_handle(&self) -> &SuiteControllerControlHandle {
5124        &self.control_handle
5125    }
5126
5127    fn drop_without_shutdown(mut self) {
5128        // Safety: drops once, never accessed again due to mem::forget
5129        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5130        // Prevent Drop from running (which would shut down the channel)
5131        std::mem::forget(self);
5132    }
5133}
5134
5135impl SuiteControllerGetEventsResponder {
5136    /// Sends a response to the FIDL transaction.
5137    ///
5138    /// Sets the channel to shutdown if an error occurs.
5139    pub fn send(self, mut result: Result<Vec<SuiteEvent>, LaunchError>) -> Result<(), fidl::Error> {
5140        let _result = self.send_raw(result);
5141        if _result.is_err() {
5142            self.control_handle.shutdown();
5143        }
5144        self.drop_without_shutdown();
5145        _result
5146    }
5147
5148    /// Similar to "send" but does not shutdown the channel if an error occurs.
5149    pub fn send_no_shutdown_on_err(
5150        self,
5151        mut result: Result<Vec<SuiteEvent>, LaunchError>,
5152    ) -> Result<(), fidl::Error> {
5153        let _result = self.send_raw(result);
5154        self.drop_without_shutdown();
5155        _result
5156    }
5157
5158    fn send_raw(
5159        &self,
5160        mut result: Result<Vec<SuiteEvent>, LaunchError>,
5161    ) -> Result<(), fidl::Error> {
5162        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5163            SuiteControllerGetEventsResponse,
5164            LaunchError,
5165        >>(
5166            fidl::encoding::FlexibleResult::new(
5167                result.as_mut().map_err(|e| *e).map(|events| (events.as_mut_slice(),)),
5168            ),
5169            self.tx_id,
5170            0x1f2ec93d2236d1db,
5171            fidl::encoding::DynamicFlags::FLEXIBLE,
5172        )
5173    }
5174}
5175
5176#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5177pub struct SuiteRunnerMarker;
5178
5179impl fidl::endpoints::ProtocolMarker for SuiteRunnerMarker {
5180    type Proxy = SuiteRunnerProxy;
5181    type RequestStream = SuiteRunnerRequestStream;
5182    #[cfg(target_os = "fuchsia")]
5183    type SynchronousProxy = SuiteRunnerSynchronousProxy;
5184
5185    const DEBUG_NAME: &'static str = "fuchsia.test.manager.SuiteRunner";
5186}
5187impl fidl::endpoints::DiscoverableProtocolMarker for SuiteRunnerMarker {}
5188
5189pub trait SuiteRunnerProxyInterface: Send + Sync {
5190    fn r#run(
5191        &self,
5192        test_suite_url: &str,
5193        options: RunSuiteOptions,
5194        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5195    ) -> Result<(), fidl::Error>;
5196}
5197#[derive(Debug)]
5198#[cfg(target_os = "fuchsia")]
5199pub struct SuiteRunnerSynchronousProxy {
5200    client: fidl::client::sync::Client,
5201}
5202
5203#[cfg(target_os = "fuchsia")]
5204impl fidl::endpoints::SynchronousProxy for SuiteRunnerSynchronousProxy {
5205    type Proxy = SuiteRunnerProxy;
5206    type Protocol = SuiteRunnerMarker;
5207
5208    fn from_channel(inner: fidl::Channel) -> Self {
5209        Self::new(inner)
5210    }
5211
5212    fn into_channel(self) -> fidl::Channel {
5213        self.client.into_channel()
5214    }
5215
5216    fn as_channel(&self) -> &fidl::Channel {
5217        self.client.as_channel()
5218    }
5219}
5220
5221#[cfg(target_os = "fuchsia")]
5222impl SuiteRunnerSynchronousProxy {
5223    pub fn new(channel: fidl::Channel) -> Self {
5224        let protocol_name = <SuiteRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5225        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5226    }
5227
5228    pub fn into_channel(self) -> fidl::Channel {
5229        self.client.into_channel()
5230    }
5231
5232    /// Waits until an event arrives and returns it. It is safe for other
5233    /// threads to make concurrent requests while waiting for an event.
5234    pub fn wait_for_event(
5235        &self,
5236        deadline: zx::MonotonicInstant,
5237    ) -> Result<SuiteRunnerEvent, fidl::Error> {
5238        SuiteRunnerEvent::decode(self.client.wait_for_event(deadline)?)
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        self.client.send::<SuiteRunnerRunRequest>(
5249            (test_suite_url, &mut options, controller),
5250            0x16f5ec6a46c223f0,
5251            fidl::encoding::DynamicFlags::FLEXIBLE,
5252        )
5253    }
5254}
5255
5256#[cfg(target_os = "fuchsia")]
5257impl From<SuiteRunnerSynchronousProxy> for zx::NullableHandle {
5258    fn from(value: SuiteRunnerSynchronousProxy) -> Self {
5259        value.into_channel().into()
5260    }
5261}
5262
5263#[cfg(target_os = "fuchsia")]
5264impl From<fidl::Channel> for SuiteRunnerSynchronousProxy {
5265    fn from(value: fidl::Channel) -> Self {
5266        Self::new(value)
5267    }
5268}
5269
5270#[cfg(target_os = "fuchsia")]
5271impl fidl::endpoints::FromClient for SuiteRunnerSynchronousProxy {
5272    type Protocol = SuiteRunnerMarker;
5273
5274    fn from_client(value: fidl::endpoints::ClientEnd<SuiteRunnerMarker>) -> Self {
5275        Self::new(value.into_channel())
5276    }
5277}
5278
5279#[derive(Debug, Clone)]
5280pub struct SuiteRunnerProxy {
5281    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5282}
5283
5284impl fidl::endpoints::Proxy for SuiteRunnerProxy {
5285    type Protocol = SuiteRunnerMarker;
5286
5287    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5288        Self::new(inner)
5289    }
5290
5291    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5292        self.client.into_channel().map_err(|client| Self { client })
5293    }
5294
5295    fn as_channel(&self) -> &::fidl::AsyncChannel {
5296        self.client.as_channel()
5297    }
5298}
5299
5300impl SuiteRunnerProxy {
5301    /// Create a new Proxy for fuchsia.test.manager/SuiteRunner.
5302    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5303        let protocol_name = <SuiteRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5304        Self { client: fidl::client::Client::new(channel, protocol_name) }
5305    }
5306
5307    /// Get a Stream of events from the remote end of the protocol.
5308    ///
5309    /// # Panics
5310    ///
5311    /// Panics if the event stream was already taken.
5312    pub fn take_event_stream(&self) -> SuiteRunnerEventStream {
5313        SuiteRunnerEventStream { event_receiver: self.client.take_event_receiver() }
5314    }
5315
5316    /// Run a test suite. A suite is a test component that implements `fuchsia.test.Suite`.
5317    pub fn r#run(
5318        &self,
5319        mut test_suite_url: &str,
5320        mut options: RunSuiteOptions,
5321        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5322    ) -> Result<(), fidl::Error> {
5323        SuiteRunnerProxyInterface::r#run(self, test_suite_url, options, controller)
5324    }
5325}
5326
5327impl SuiteRunnerProxyInterface for SuiteRunnerProxy {
5328    fn r#run(
5329        &self,
5330        mut test_suite_url: &str,
5331        mut options: RunSuiteOptions,
5332        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5333    ) -> Result<(), fidl::Error> {
5334        self.client.send::<SuiteRunnerRunRequest>(
5335            (test_suite_url, &mut options, controller),
5336            0x16f5ec6a46c223f0,
5337            fidl::encoding::DynamicFlags::FLEXIBLE,
5338        )
5339    }
5340}
5341
5342pub struct SuiteRunnerEventStream {
5343    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5344}
5345
5346impl std::marker::Unpin for SuiteRunnerEventStream {}
5347
5348impl futures::stream::FusedStream for SuiteRunnerEventStream {
5349    fn is_terminated(&self) -> bool {
5350        self.event_receiver.is_terminated()
5351    }
5352}
5353
5354impl futures::Stream for SuiteRunnerEventStream {
5355    type Item = Result<SuiteRunnerEvent, fidl::Error>;
5356
5357    fn poll_next(
5358        mut self: std::pin::Pin<&mut Self>,
5359        cx: &mut std::task::Context<'_>,
5360    ) -> std::task::Poll<Option<Self::Item>> {
5361        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5362            &mut self.event_receiver,
5363            cx
5364        )?) {
5365            Some(buf) => std::task::Poll::Ready(Some(SuiteRunnerEvent::decode(buf))),
5366            None => std::task::Poll::Ready(None),
5367        }
5368    }
5369}
5370
5371#[derive(Debug)]
5372pub enum SuiteRunnerEvent {
5373    #[non_exhaustive]
5374    _UnknownEvent {
5375        /// Ordinal of the event that was sent.
5376        ordinal: u64,
5377    },
5378}
5379
5380impl SuiteRunnerEvent {
5381    /// Decodes a message buffer as a [`SuiteRunnerEvent`].
5382    fn decode(
5383        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5384    ) -> Result<SuiteRunnerEvent, fidl::Error> {
5385        let (bytes, _handles) = buf.split_mut();
5386        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5387        debug_assert_eq!(tx_header.tx_id, 0);
5388        match tx_header.ordinal {
5389            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5390                Ok(SuiteRunnerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5391            }
5392            _ => Err(fidl::Error::UnknownOrdinal {
5393                ordinal: tx_header.ordinal,
5394                protocol_name: <SuiteRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5395            }),
5396        }
5397    }
5398}
5399
5400/// A Stream of incoming requests for fuchsia.test.manager/SuiteRunner.
5401pub struct SuiteRunnerRequestStream {
5402    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5403    is_terminated: bool,
5404}
5405
5406impl std::marker::Unpin for SuiteRunnerRequestStream {}
5407
5408impl futures::stream::FusedStream for SuiteRunnerRequestStream {
5409    fn is_terminated(&self) -> bool {
5410        self.is_terminated
5411    }
5412}
5413
5414impl fidl::endpoints::RequestStream for SuiteRunnerRequestStream {
5415    type Protocol = SuiteRunnerMarker;
5416    type ControlHandle = SuiteRunnerControlHandle;
5417
5418    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5419        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5420    }
5421
5422    fn control_handle(&self) -> Self::ControlHandle {
5423        SuiteRunnerControlHandle { inner: self.inner.clone() }
5424    }
5425
5426    fn into_inner(
5427        self,
5428    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5429    {
5430        (self.inner, self.is_terminated)
5431    }
5432
5433    fn from_inner(
5434        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5435        is_terminated: bool,
5436    ) -> Self {
5437        Self { inner, is_terminated }
5438    }
5439}
5440
5441impl futures::Stream for SuiteRunnerRequestStream {
5442    type Item = Result<SuiteRunnerRequest, fidl::Error>;
5443
5444    fn poll_next(
5445        mut self: std::pin::Pin<&mut Self>,
5446        cx: &mut std::task::Context<'_>,
5447    ) -> std::task::Poll<Option<Self::Item>> {
5448        let this = &mut *self;
5449        if this.inner.check_shutdown(cx) {
5450            this.is_terminated = true;
5451            return std::task::Poll::Ready(None);
5452        }
5453        if this.is_terminated {
5454            panic!("polled SuiteRunnerRequestStream after completion");
5455        }
5456        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5457            |bytes, handles| {
5458                match this.inner.channel().read_etc(cx, bytes, handles) {
5459                    std::task::Poll::Ready(Ok(())) => {}
5460                    std::task::Poll::Pending => return std::task::Poll::Pending,
5461                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5462                        this.is_terminated = true;
5463                        return std::task::Poll::Ready(None);
5464                    }
5465                    std::task::Poll::Ready(Err(e)) => {
5466                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5467                            e.into(),
5468                        ))));
5469                    }
5470                }
5471
5472                // A message has been received from the channel
5473                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5474
5475                std::task::Poll::Ready(Some(match header.ordinal {
5476                    0x16f5ec6a46c223f0 => {
5477                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5478                        let mut req = fidl::new_empty!(
5479                            SuiteRunnerRunRequest,
5480                            fidl::encoding::DefaultFuchsiaResourceDialect
5481                        );
5482                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SuiteRunnerRunRequest>(&header, _body_bytes, handles, &mut req)?;
5483                        let control_handle = SuiteRunnerControlHandle { inner: this.inner.clone() };
5484                        Ok(SuiteRunnerRequest::Run {
5485                            test_suite_url: req.test_suite_url,
5486                            options: req.options,
5487                            controller: req.controller,
5488
5489                            control_handle,
5490                        })
5491                    }
5492                    _ if header.tx_id == 0
5493                        && header
5494                            .dynamic_flags()
5495                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5496                    {
5497                        Ok(SuiteRunnerRequest::_UnknownMethod {
5498                            ordinal: header.ordinal,
5499                            control_handle: SuiteRunnerControlHandle { inner: this.inner.clone() },
5500                            method_type: fidl::MethodType::OneWay,
5501                        })
5502                    }
5503                    _ if header
5504                        .dynamic_flags()
5505                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5506                    {
5507                        this.inner.send_framework_err(
5508                            fidl::encoding::FrameworkErr::UnknownMethod,
5509                            header.tx_id,
5510                            header.ordinal,
5511                            header.dynamic_flags(),
5512                            (bytes, handles),
5513                        )?;
5514                        Ok(SuiteRunnerRequest::_UnknownMethod {
5515                            ordinal: header.ordinal,
5516                            control_handle: SuiteRunnerControlHandle { inner: this.inner.clone() },
5517                            method_type: fidl::MethodType::TwoWay,
5518                        })
5519                    }
5520                    _ => Err(fidl::Error::UnknownOrdinal {
5521                        ordinal: header.ordinal,
5522                        protocol_name:
5523                            <SuiteRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5524                    }),
5525                }))
5526            },
5527        )
5528    }
5529}
5530
5531/// Runs test suites.
5532#[derive(Debug)]
5533pub enum SuiteRunnerRequest {
5534    /// Run a test suite. A suite is a test component that implements `fuchsia.test.Suite`.
5535    Run {
5536        test_suite_url: String,
5537        options: RunSuiteOptions,
5538        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5539        control_handle: SuiteRunnerControlHandle,
5540    },
5541    /// An interaction was received which does not match any known method.
5542    #[non_exhaustive]
5543    _UnknownMethod {
5544        /// Ordinal of the method that was called.
5545        ordinal: u64,
5546        control_handle: SuiteRunnerControlHandle,
5547        method_type: fidl::MethodType,
5548    },
5549}
5550
5551impl SuiteRunnerRequest {
5552    #[allow(irrefutable_let_patterns)]
5553    pub fn into_run(
5554        self,
5555    ) -> Option<(
5556        String,
5557        RunSuiteOptions,
5558        fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5559        SuiteRunnerControlHandle,
5560    )> {
5561        if let SuiteRunnerRequest::Run { test_suite_url, options, controller, control_handle } =
5562            self
5563        {
5564            Some((test_suite_url, options, controller, control_handle))
5565        } else {
5566            None
5567        }
5568    }
5569
5570    /// Name of the method defined in FIDL
5571    pub fn method_name(&self) -> &'static str {
5572        match *self {
5573            SuiteRunnerRequest::Run { .. } => "run",
5574            SuiteRunnerRequest::_UnknownMethod {
5575                method_type: fidl::MethodType::OneWay, ..
5576            } => "unknown one-way method",
5577            SuiteRunnerRequest::_UnknownMethod {
5578                method_type: fidl::MethodType::TwoWay, ..
5579            } => "unknown two-way method",
5580        }
5581    }
5582}
5583
5584#[derive(Debug, Clone)]
5585pub struct SuiteRunnerControlHandle {
5586    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5587}
5588
5589impl fidl::endpoints::ControlHandle for SuiteRunnerControlHandle {
5590    fn shutdown(&self) {
5591        self.inner.shutdown()
5592    }
5593
5594    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5595        self.inner.shutdown_with_epitaph(status)
5596    }
5597
5598    fn is_closed(&self) -> bool {
5599        self.inner.channel().is_closed()
5600    }
5601    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5602        self.inner.channel().on_closed()
5603    }
5604
5605    #[cfg(target_os = "fuchsia")]
5606    fn signal_peer(
5607        &self,
5608        clear_mask: zx::Signals,
5609        set_mask: zx::Signals,
5610    ) -> Result<(), zx_status::Status> {
5611        use fidl::Peered;
5612        self.inner.channel().signal_peer(clear_mask, set_mask)
5613    }
5614}
5615
5616impl SuiteRunnerControlHandle {}
5617
5618#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5619pub struct TestCaseEnumeratorMarker;
5620
5621impl fidl::endpoints::ProtocolMarker for TestCaseEnumeratorMarker {
5622    type Proxy = TestCaseEnumeratorProxy;
5623    type RequestStream = TestCaseEnumeratorRequestStream;
5624    #[cfg(target_os = "fuchsia")]
5625    type SynchronousProxy = TestCaseEnumeratorSynchronousProxy;
5626
5627    const DEBUG_NAME: &'static str = "fuchsia.test.manager.TestCaseEnumerator";
5628}
5629impl fidl::endpoints::DiscoverableProtocolMarker for TestCaseEnumeratorMarker {}
5630pub type TestCaseEnumeratorEnumerateResult = Result<(), LaunchError>;
5631
5632pub trait TestCaseEnumeratorProxyInterface: Send + Sync {
5633    type EnumerateResponseFut: std::future::Future<Output = Result<TestCaseEnumeratorEnumerateResult, fidl::Error>>
5634        + Send;
5635    fn r#enumerate(
5636        &self,
5637        test_suite_url: &str,
5638        options: EnumerateTestCasesOptions,
5639        iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
5640    ) -> Self::EnumerateResponseFut;
5641}
5642#[derive(Debug)]
5643#[cfg(target_os = "fuchsia")]
5644pub struct TestCaseEnumeratorSynchronousProxy {
5645    client: fidl::client::sync::Client,
5646}
5647
5648#[cfg(target_os = "fuchsia")]
5649impl fidl::endpoints::SynchronousProxy for TestCaseEnumeratorSynchronousProxy {
5650    type Proxy = TestCaseEnumeratorProxy;
5651    type Protocol = TestCaseEnumeratorMarker;
5652
5653    fn from_channel(inner: fidl::Channel) -> Self {
5654        Self::new(inner)
5655    }
5656
5657    fn into_channel(self) -> fidl::Channel {
5658        self.client.into_channel()
5659    }
5660
5661    fn as_channel(&self) -> &fidl::Channel {
5662        self.client.as_channel()
5663    }
5664}
5665
5666#[cfg(target_os = "fuchsia")]
5667impl TestCaseEnumeratorSynchronousProxy {
5668    pub fn new(channel: fidl::Channel) -> Self {
5669        let protocol_name =
5670            <TestCaseEnumeratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5671        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5672    }
5673
5674    pub fn into_channel(self) -> fidl::Channel {
5675        self.client.into_channel()
5676    }
5677
5678    /// Waits until an event arrives and returns it. It is safe for other
5679    /// threads to make concurrent requests while waiting for an event.
5680    pub fn wait_for_event(
5681        &self,
5682        deadline: zx::MonotonicInstant,
5683    ) -> Result<TestCaseEnumeratorEvent, fidl::Error> {
5684        TestCaseEnumeratorEvent::decode(self.client.wait_for_event(deadline)?)
5685    }
5686
5687    /// Creates an iterator for test cases.
5688    pub fn r#enumerate(
5689        &self,
5690        mut test_suite_url: &str,
5691        mut options: EnumerateTestCasesOptions,
5692        mut iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
5693        ___deadline: zx::MonotonicInstant,
5694    ) -> Result<TestCaseEnumeratorEnumerateResult, fidl::Error> {
5695        let _response = self.client.send_query::<
5696            TestCaseEnumeratorEnumerateRequest,
5697            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, LaunchError>,
5698        >(
5699            (test_suite_url, &mut options, iterator,),
5700            0x24f8a91d96134492,
5701            fidl::encoding::DynamicFlags::FLEXIBLE,
5702            ___deadline,
5703        )?
5704        .into_result::<TestCaseEnumeratorMarker>("enumerate")?;
5705        Ok(_response.map(|x| x))
5706    }
5707}
5708
5709#[cfg(target_os = "fuchsia")]
5710impl From<TestCaseEnumeratorSynchronousProxy> for zx::NullableHandle {
5711    fn from(value: TestCaseEnumeratorSynchronousProxy) -> Self {
5712        value.into_channel().into()
5713    }
5714}
5715
5716#[cfg(target_os = "fuchsia")]
5717impl From<fidl::Channel> for TestCaseEnumeratorSynchronousProxy {
5718    fn from(value: fidl::Channel) -> Self {
5719        Self::new(value)
5720    }
5721}
5722
5723#[cfg(target_os = "fuchsia")]
5724impl fidl::endpoints::FromClient for TestCaseEnumeratorSynchronousProxy {
5725    type Protocol = TestCaseEnumeratorMarker;
5726
5727    fn from_client(value: fidl::endpoints::ClientEnd<TestCaseEnumeratorMarker>) -> Self {
5728        Self::new(value.into_channel())
5729    }
5730}
5731
5732#[derive(Debug, Clone)]
5733pub struct TestCaseEnumeratorProxy {
5734    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5735}
5736
5737impl fidl::endpoints::Proxy for TestCaseEnumeratorProxy {
5738    type Protocol = TestCaseEnumeratorMarker;
5739
5740    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5741        Self::new(inner)
5742    }
5743
5744    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5745        self.client.into_channel().map_err(|client| Self { client })
5746    }
5747
5748    fn as_channel(&self) -> &::fidl::AsyncChannel {
5749        self.client.as_channel()
5750    }
5751}
5752
5753impl TestCaseEnumeratorProxy {
5754    /// Create a new Proxy for fuchsia.test.manager/TestCaseEnumerator.
5755    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5756        let protocol_name =
5757            <TestCaseEnumeratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5758        Self { client: fidl::client::Client::new(channel, protocol_name) }
5759    }
5760
5761    /// Get a Stream of events from the remote end of the protocol.
5762    ///
5763    /// # Panics
5764    ///
5765    /// Panics if the event stream was already taken.
5766    pub fn take_event_stream(&self) -> TestCaseEnumeratorEventStream {
5767        TestCaseEnumeratorEventStream { event_receiver: self.client.take_event_receiver() }
5768    }
5769
5770    /// Creates an iterator for test cases.
5771    pub fn r#enumerate(
5772        &self,
5773        mut test_suite_url: &str,
5774        mut options: EnumerateTestCasesOptions,
5775        mut iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
5776    ) -> fidl::client::QueryResponseFut<
5777        TestCaseEnumeratorEnumerateResult,
5778        fidl::encoding::DefaultFuchsiaResourceDialect,
5779    > {
5780        TestCaseEnumeratorProxyInterface::r#enumerate(self, test_suite_url, options, iterator)
5781    }
5782}
5783
5784impl TestCaseEnumeratorProxyInterface for TestCaseEnumeratorProxy {
5785    type EnumerateResponseFut = fidl::client::QueryResponseFut<
5786        TestCaseEnumeratorEnumerateResult,
5787        fidl::encoding::DefaultFuchsiaResourceDialect,
5788    >;
5789    fn r#enumerate(
5790        &self,
5791        mut test_suite_url: &str,
5792        mut options: EnumerateTestCasesOptions,
5793        mut iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
5794    ) -> Self::EnumerateResponseFut {
5795        fn _decode(
5796            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5797        ) -> Result<TestCaseEnumeratorEnumerateResult, fidl::Error> {
5798            let _response = fidl::client::decode_transaction_body::<
5799                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, LaunchError>,
5800                fidl::encoding::DefaultFuchsiaResourceDialect,
5801                0x24f8a91d96134492,
5802            >(_buf?)?
5803            .into_result::<TestCaseEnumeratorMarker>("enumerate")?;
5804            Ok(_response.map(|x| x))
5805        }
5806        self.client.send_query_and_decode::<
5807            TestCaseEnumeratorEnumerateRequest,
5808            TestCaseEnumeratorEnumerateResult,
5809        >(
5810            (test_suite_url, &mut options, iterator,),
5811            0x24f8a91d96134492,
5812            fidl::encoding::DynamicFlags::FLEXIBLE,
5813            _decode,
5814        )
5815    }
5816}
5817
5818pub struct TestCaseEnumeratorEventStream {
5819    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5820}
5821
5822impl std::marker::Unpin for TestCaseEnumeratorEventStream {}
5823
5824impl futures::stream::FusedStream for TestCaseEnumeratorEventStream {
5825    fn is_terminated(&self) -> bool {
5826        self.event_receiver.is_terminated()
5827    }
5828}
5829
5830impl futures::Stream for TestCaseEnumeratorEventStream {
5831    type Item = Result<TestCaseEnumeratorEvent, fidl::Error>;
5832
5833    fn poll_next(
5834        mut self: std::pin::Pin<&mut Self>,
5835        cx: &mut std::task::Context<'_>,
5836    ) -> std::task::Poll<Option<Self::Item>> {
5837        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5838            &mut self.event_receiver,
5839            cx
5840        )?) {
5841            Some(buf) => std::task::Poll::Ready(Some(TestCaseEnumeratorEvent::decode(buf))),
5842            None => std::task::Poll::Ready(None),
5843        }
5844    }
5845}
5846
5847#[derive(Debug)]
5848pub enum TestCaseEnumeratorEvent {
5849    #[non_exhaustive]
5850    _UnknownEvent {
5851        /// Ordinal of the event that was sent.
5852        ordinal: u64,
5853    },
5854}
5855
5856impl TestCaseEnumeratorEvent {
5857    /// Decodes a message buffer as a [`TestCaseEnumeratorEvent`].
5858    fn decode(
5859        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5860    ) -> Result<TestCaseEnumeratorEvent, fidl::Error> {
5861        let (bytes, _handles) = buf.split_mut();
5862        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5863        debug_assert_eq!(tx_header.tx_id, 0);
5864        match tx_header.ordinal {
5865            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5866                Ok(TestCaseEnumeratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5867            }
5868            _ => Err(fidl::Error::UnknownOrdinal {
5869                ordinal: tx_header.ordinal,
5870                protocol_name:
5871                    <TestCaseEnumeratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5872            }),
5873        }
5874    }
5875}
5876
5877/// A Stream of incoming requests for fuchsia.test.manager/TestCaseEnumerator.
5878pub struct TestCaseEnumeratorRequestStream {
5879    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5880    is_terminated: bool,
5881}
5882
5883impl std::marker::Unpin for TestCaseEnumeratorRequestStream {}
5884
5885impl futures::stream::FusedStream for TestCaseEnumeratorRequestStream {
5886    fn is_terminated(&self) -> bool {
5887        self.is_terminated
5888    }
5889}
5890
5891impl fidl::endpoints::RequestStream for TestCaseEnumeratorRequestStream {
5892    type Protocol = TestCaseEnumeratorMarker;
5893    type ControlHandle = TestCaseEnumeratorControlHandle;
5894
5895    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5896        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5897    }
5898
5899    fn control_handle(&self) -> Self::ControlHandle {
5900        TestCaseEnumeratorControlHandle { inner: self.inner.clone() }
5901    }
5902
5903    fn into_inner(
5904        self,
5905    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5906    {
5907        (self.inner, self.is_terminated)
5908    }
5909
5910    fn from_inner(
5911        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5912        is_terminated: bool,
5913    ) -> Self {
5914        Self { inner, is_terminated }
5915    }
5916}
5917
5918impl futures::Stream for TestCaseEnumeratorRequestStream {
5919    type Item = Result<TestCaseEnumeratorRequest, fidl::Error>;
5920
5921    fn poll_next(
5922        mut self: std::pin::Pin<&mut Self>,
5923        cx: &mut std::task::Context<'_>,
5924    ) -> std::task::Poll<Option<Self::Item>> {
5925        let this = &mut *self;
5926        if this.inner.check_shutdown(cx) {
5927            this.is_terminated = true;
5928            return std::task::Poll::Ready(None);
5929        }
5930        if this.is_terminated {
5931            panic!("polled TestCaseEnumeratorRequestStream after completion");
5932        }
5933        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5934            |bytes, handles| {
5935                match this.inner.channel().read_etc(cx, bytes, handles) {
5936                    std::task::Poll::Ready(Ok(())) => {}
5937                    std::task::Poll::Pending => return std::task::Poll::Pending,
5938                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5939                        this.is_terminated = true;
5940                        return std::task::Poll::Ready(None);
5941                    }
5942                    std::task::Poll::Ready(Err(e)) => {
5943                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5944                            e.into(),
5945                        ))));
5946                    }
5947                }
5948
5949                // A message has been received from the channel
5950                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5951
5952                std::task::Poll::Ready(Some(match header.ordinal {
5953                0x24f8a91d96134492 => {
5954                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5955                    let mut req = fidl::new_empty!(TestCaseEnumeratorEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
5956                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TestCaseEnumeratorEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
5957                    let control_handle = TestCaseEnumeratorControlHandle {
5958                        inner: this.inner.clone(),
5959                    };
5960                    Ok(TestCaseEnumeratorRequest::Enumerate {test_suite_url: req.test_suite_url,
5961options: req.options,
5962iterator: req.iterator,
5963
5964                        responder: TestCaseEnumeratorEnumerateResponder {
5965                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5966                            tx_id: header.tx_id,
5967                        },
5968                    })
5969                }
5970                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5971                    Ok(TestCaseEnumeratorRequest::_UnknownMethod {
5972                        ordinal: header.ordinal,
5973                        control_handle: TestCaseEnumeratorControlHandle { inner: this.inner.clone() },
5974                        method_type: fidl::MethodType::OneWay,
5975                    })
5976                }
5977                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5978                    this.inner.send_framework_err(
5979                        fidl::encoding::FrameworkErr::UnknownMethod,
5980                        header.tx_id,
5981                        header.ordinal,
5982                        header.dynamic_flags(),
5983                        (bytes, handles),
5984                    )?;
5985                    Ok(TestCaseEnumeratorRequest::_UnknownMethod {
5986                        ordinal: header.ordinal,
5987                        control_handle: TestCaseEnumeratorControlHandle { inner: this.inner.clone() },
5988                        method_type: fidl::MethodType::TwoWay,
5989                    })
5990                }
5991                _ => Err(fidl::Error::UnknownOrdinal {
5992                    ordinal: header.ordinal,
5993                    protocol_name: <TestCaseEnumeratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5994                }),
5995            }))
5996            },
5997        )
5998    }
5999}
6000
6001/// Enumerates cases in test suites, which implement the `fuchsia.test.Suite` protocol.
6002#[derive(Debug)]
6003pub enum TestCaseEnumeratorRequest {
6004    /// Creates an iterator for test cases.
6005    Enumerate {
6006        test_suite_url: String,
6007        options: EnumerateTestCasesOptions,
6008        iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
6009        responder: TestCaseEnumeratorEnumerateResponder,
6010    },
6011    /// An interaction was received which does not match any known method.
6012    #[non_exhaustive]
6013    _UnknownMethod {
6014        /// Ordinal of the method that was called.
6015        ordinal: u64,
6016        control_handle: TestCaseEnumeratorControlHandle,
6017        method_type: fidl::MethodType,
6018    },
6019}
6020
6021impl TestCaseEnumeratorRequest {
6022    #[allow(irrefutable_let_patterns)]
6023    pub fn into_enumerate(
6024        self,
6025    ) -> Option<(
6026        String,
6027        EnumerateTestCasesOptions,
6028        fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
6029        TestCaseEnumeratorEnumerateResponder,
6030    )> {
6031        if let TestCaseEnumeratorRequest::Enumerate {
6032            test_suite_url,
6033            options,
6034            iterator,
6035            responder,
6036        } = self
6037        {
6038            Some((test_suite_url, options, iterator, responder))
6039        } else {
6040            None
6041        }
6042    }
6043
6044    /// Name of the method defined in FIDL
6045    pub fn method_name(&self) -> &'static str {
6046        match *self {
6047            TestCaseEnumeratorRequest::Enumerate { .. } => "enumerate",
6048            TestCaseEnumeratorRequest::_UnknownMethod {
6049                method_type: fidl::MethodType::OneWay,
6050                ..
6051            } => "unknown one-way method",
6052            TestCaseEnumeratorRequest::_UnknownMethod {
6053                method_type: fidl::MethodType::TwoWay,
6054                ..
6055            } => "unknown two-way method",
6056        }
6057    }
6058}
6059
6060#[derive(Debug, Clone)]
6061pub struct TestCaseEnumeratorControlHandle {
6062    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6063}
6064
6065impl fidl::endpoints::ControlHandle for TestCaseEnumeratorControlHandle {
6066    fn shutdown(&self) {
6067        self.inner.shutdown()
6068    }
6069
6070    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6071        self.inner.shutdown_with_epitaph(status)
6072    }
6073
6074    fn is_closed(&self) -> bool {
6075        self.inner.channel().is_closed()
6076    }
6077    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6078        self.inner.channel().on_closed()
6079    }
6080
6081    #[cfg(target_os = "fuchsia")]
6082    fn signal_peer(
6083        &self,
6084        clear_mask: zx::Signals,
6085        set_mask: zx::Signals,
6086    ) -> Result<(), zx_status::Status> {
6087        use fidl::Peered;
6088        self.inner.channel().signal_peer(clear_mask, set_mask)
6089    }
6090}
6091
6092impl TestCaseEnumeratorControlHandle {}
6093
6094#[must_use = "FIDL methods require a response to be sent"]
6095#[derive(Debug)]
6096pub struct TestCaseEnumeratorEnumerateResponder {
6097    control_handle: std::mem::ManuallyDrop<TestCaseEnumeratorControlHandle>,
6098    tx_id: u32,
6099}
6100
6101/// Set the the channel to be shutdown (see [`TestCaseEnumeratorControlHandle::shutdown`])
6102/// if the responder is dropped without sending a response, so that the client
6103/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6104impl std::ops::Drop for TestCaseEnumeratorEnumerateResponder {
6105    fn drop(&mut self) {
6106        self.control_handle.shutdown();
6107        // Safety: drops once, never accessed again
6108        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6109    }
6110}
6111
6112impl fidl::endpoints::Responder for TestCaseEnumeratorEnumerateResponder {
6113    type ControlHandle = TestCaseEnumeratorControlHandle;
6114
6115    fn control_handle(&self) -> &TestCaseEnumeratorControlHandle {
6116        &self.control_handle
6117    }
6118
6119    fn drop_without_shutdown(mut self) {
6120        // Safety: drops once, never accessed again due to mem::forget
6121        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6122        // Prevent Drop from running (which would shut down the channel)
6123        std::mem::forget(self);
6124    }
6125}
6126
6127impl TestCaseEnumeratorEnumerateResponder {
6128    /// Sends a response to the FIDL transaction.
6129    ///
6130    /// Sets the channel to shutdown if an error occurs.
6131    pub fn send(self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
6132        let _result = self.send_raw(result);
6133        if _result.is_err() {
6134            self.control_handle.shutdown();
6135        }
6136        self.drop_without_shutdown();
6137        _result
6138    }
6139
6140    /// Similar to "send" but does not shutdown the channel if an error occurs.
6141    pub fn send_no_shutdown_on_err(
6142        self,
6143        mut result: Result<(), LaunchError>,
6144    ) -> Result<(), fidl::Error> {
6145        let _result = self.send_raw(result);
6146        self.drop_without_shutdown();
6147        _result
6148    }
6149
6150    fn send_raw(&self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
6151        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6152            fidl::encoding::EmptyStruct,
6153            LaunchError,
6154        >>(
6155            fidl::encoding::FlexibleResult::new(result),
6156            self.tx_id,
6157            0x24f8a91d96134492,
6158            fidl::encoding::DynamicFlags::FLEXIBLE,
6159        )
6160    }
6161}
6162
6163#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6164pub struct TestCaseIteratorMarker;
6165
6166impl fidl::endpoints::ProtocolMarker for TestCaseIteratorMarker {
6167    type Proxy = TestCaseIteratorProxy;
6168    type RequestStream = TestCaseIteratorRequestStream;
6169    #[cfg(target_os = "fuchsia")]
6170    type SynchronousProxy = TestCaseIteratorSynchronousProxy;
6171
6172    const DEBUG_NAME: &'static str = "(anonymous) TestCaseIterator";
6173}
6174
6175pub trait TestCaseIteratorProxyInterface: Send + Sync {
6176    type GetNextResponseFut: std::future::Future<Output = Result<Vec<TestCase>, fidl::Error>> + Send;
6177    fn r#get_next(&self) -> Self::GetNextResponseFut;
6178}
6179#[derive(Debug)]
6180#[cfg(target_os = "fuchsia")]
6181pub struct TestCaseIteratorSynchronousProxy {
6182    client: fidl::client::sync::Client,
6183}
6184
6185#[cfg(target_os = "fuchsia")]
6186impl fidl::endpoints::SynchronousProxy for TestCaseIteratorSynchronousProxy {
6187    type Proxy = TestCaseIteratorProxy;
6188    type Protocol = TestCaseIteratorMarker;
6189
6190    fn from_channel(inner: fidl::Channel) -> Self {
6191        Self::new(inner)
6192    }
6193
6194    fn into_channel(self) -> fidl::Channel {
6195        self.client.into_channel()
6196    }
6197
6198    fn as_channel(&self) -> &fidl::Channel {
6199        self.client.as_channel()
6200    }
6201}
6202
6203#[cfg(target_os = "fuchsia")]
6204impl TestCaseIteratorSynchronousProxy {
6205    pub fn new(channel: fidl::Channel) -> Self {
6206        let protocol_name = <TestCaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6207        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6208    }
6209
6210    pub fn into_channel(self) -> fidl::Channel {
6211        self.client.into_channel()
6212    }
6213
6214    /// Waits until an event arrives and returns it. It is safe for other
6215    /// threads to make concurrent requests while waiting for an event.
6216    pub fn wait_for_event(
6217        &self,
6218        deadline: zx::MonotonicInstant,
6219    ) -> Result<TestCaseIteratorEvent, fidl::Error> {
6220        TestCaseIteratorEvent::decode(self.client.wait_for_event(deadline)?)
6221    }
6222
6223    /// Returns the next batch of test cases. Returns the empty vector to indicate that the
6224    /// iteration is complete.
6225    pub fn r#get_next(
6226        &self,
6227        ___deadline: zx::MonotonicInstant,
6228    ) -> Result<Vec<TestCase>, fidl::Error> {
6229        let _response = self
6230            .client
6231            .send_query::<fidl::encoding::EmptyPayload, TestCaseIteratorGetNextResponse>(
6232                (),
6233                0x37abec519b2ac1be,
6234                fidl::encoding::DynamicFlags::empty(),
6235                ___deadline,
6236            )?;
6237        Ok(_response.test_cases)
6238    }
6239}
6240
6241#[cfg(target_os = "fuchsia")]
6242impl From<TestCaseIteratorSynchronousProxy> for zx::NullableHandle {
6243    fn from(value: TestCaseIteratorSynchronousProxy) -> Self {
6244        value.into_channel().into()
6245    }
6246}
6247
6248#[cfg(target_os = "fuchsia")]
6249impl From<fidl::Channel> for TestCaseIteratorSynchronousProxy {
6250    fn from(value: fidl::Channel) -> Self {
6251        Self::new(value)
6252    }
6253}
6254
6255#[cfg(target_os = "fuchsia")]
6256impl fidl::endpoints::FromClient for TestCaseIteratorSynchronousProxy {
6257    type Protocol = TestCaseIteratorMarker;
6258
6259    fn from_client(value: fidl::endpoints::ClientEnd<TestCaseIteratorMarker>) -> Self {
6260        Self::new(value.into_channel())
6261    }
6262}
6263
6264#[derive(Debug, Clone)]
6265pub struct TestCaseIteratorProxy {
6266    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6267}
6268
6269impl fidl::endpoints::Proxy for TestCaseIteratorProxy {
6270    type Protocol = TestCaseIteratorMarker;
6271
6272    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6273        Self::new(inner)
6274    }
6275
6276    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6277        self.client.into_channel().map_err(|client| Self { client })
6278    }
6279
6280    fn as_channel(&self) -> &::fidl::AsyncChannel {
6281        self.client.as_channel()
6282    }
6283}
6284
6285impl TestCaseIteratorProxy {
6286    /// Create a new Proxy for fuchsia.test.manager/TestCaseIterator.
6287    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6288        let protocol_name = <TestCaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6289        Self { client: fidl::client::Client::new(channel, protocol_name) }
6290    }
6291
6292    /// Get a Stream of events from the remote end of the protocol.
6293    ///
6294    /// # Panics
6295    ///
6296    /// Panics if the event stream was already taken.
6297    pub fn take_event_stream(&self) -> TestCaseIteratorEventStream {
6298        TestCaseIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6299    }
6300
6301    /// Returns the next batch of test cases. Returns the empty vector to indicate that the
6302    /// iteration is complete.
6303    pub fn r#get_next(
6304        &self,
6305    ) -> fidl::client::QueryResponseFut<Vec<TestCase>, fidl::encoding::DefaultFuchsiaResourceDialect>
6306    {
6307        TestCaseIteratorProxyInterface::r#get_next(self)
6308    }
6309}
6310
6311impl TestCaseIteratorProxyInterface for TestCaseIteratorProxy {
6312    type GetNextResponseFut = fidl::client::QueryResponseFut<
6313        Vec<TestCase>,
6314        fidl::encoding::DefaultFuchsiaResourceDialect,
6315    >;
6316    fn r#get_next(&self) -> Self::GetNextResponseFut {
6317        fn _decode(
6318            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6319        ) -> Result<Vec<TestCase>, fidl::Error> {
6320            let _response = fidl::client::decode_transaction_body::<
6321                TestCaseIteratorGetNextResponse,
6322                fidl::encoding::DefaultFuchsiaResourceDialect,
6323                0x37abec519b2ac1be,
6324            >(_buf?)?;
6325            Ok(_response.test_cases)
6326        }
6327        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<TestCase>>(
6328            (),
6329            0x37abec519b2ac1be,
6330            fidl::encoding::DynamicFlags::empty(),
6331            _decode,
6332        )
6333    }
6334}
6335
6336pub struct TestCaseIteratorEventStream {
6337    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6338}
6339
6340impl std::marker::Unpin for TestCaseIteratorEventStream {}
6341
6342impl futures::stream::FusedStream for TestCaseIteratorEventStream {
6343    fn is_terminated(&self) -> bool {
6344        self.event_receiver.is_terminated()
6345    }
6346}
6347
6348impl futures::Stream for TestCaseIteratorEventStream {
6349    type Item = Result<TestCaseIteratorEvent, fidl::Error>;
6350
6351    fn poll_next(
6352        mut self: std::pin::Pin<&mut Self>,
6353        cx: &mut std::task::Context<'_>,
6354    ) -> std::task::Poll<Option<Self::Item>> {
6355        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6356            &mut self.event_receiver,
6357            cx
6358        )?) {
6359            Some(buf) => std::task::Poll::Ready(Some(TestCaseIteratorEvent::decode(buf))),
6360            None => std::task::Poll::Ready(None),
6361        }
6362    }
6363}
6364
6365#[derive(Debug)]
6366pub enum TestCaseIteratorEvent {}
6367
6368impl TestCaseIteratorEvent {
6369    /// Decodes a message buffer as a [`TestCaseIteratorEvent`].
6370    fn decode(
6371        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6372    ) -> Result<TestCaseIteratorEvent, fidl::Error> {
6373        let (bytes, _handles) = buf.split_mut();
6374        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6375        debug_assert_eq!(tx_header.tx_id, 0);
6376        match tx_header.ordinal {
6377            _ => Err(fidl::Error::UnknownOrdinal {
6378                ordinal: tx_header.ordinal,
6379                protocol_name:
6380                    <TestCaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6381            }),
6382        }
6383    }
6384}
6385
6386/// A Stream of incoming requests for fuchsia.test.manager/TestCaseIterator.
6387pub struct TestCaseIteratorRequestStream {
6388    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6389    is_terminated: bool,
6390}
6391
6392impl std::marker::Unpin for TestCaseIteratorRequestStream {}
6393
6394impl futures::stream::FusedStream for TestCaseIteratorRequestStream {
6395    fn is_terminated(&self) -> bool {
6396        self.is_terminated
6397    }
6398}
6399
6400impl fidl::endpoints::RequestStream for TestCaseIteratorRequestStream {
6401    type Protocol = TestCaseIteratorMarker;
6402    type ControlHandle = TestCaseIteratorControlHandle;
6403
6404    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6405        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6406    }
6407
6408    fn control_handle(&self) -> Self::ControlHandle {
6409        TestCaseIteratorControlHandle { inner: self.inner.clone() }
6410    }
6411
6412    fn into_inner(
6413        self,
6414    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6415    {
6416        (self.inner, self.is_terminated)
6417    }
6418
6419    fn from_inner(
6420        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6421        is_terminated: bool,
6422    ) -> Self {
6423        Self { inner, is_terminated }
6424    }
6425}
6426
6427impl futures::Stream for TestCaseIteratorRequestStream {
6428    type Item = Result<TestCaseIteratorRequest, fidl::Error>;
6429
6430    fn poll_next(
6431        mut self: std::pin::Pin<&mut Self>,
6432        cx: &mut std::task::Context<'_>,
6433    ) -> std::task::Poll<Option<Self::Item>> {
6434        let this = &mut *self;
6435        if this.inner.check_shutdown(cx) {
6436            this.is_terminated = true;
6437            return std::task::Poll::Ready(None);
6438        }
6439        if this.is_terminated {
6440            panic!("polled TestCaseIteratorRequestStream after completion");
6441        }
6442        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6443            |bytes, handles| {
6444                match this.inner.channel().read_etc(cx, bytes, handles) {
6445                    std::task::Poll::Ready(Ok(())) => {}
6446                    std::task::Poll::Pending => return std::task::Poll::Pending,
6447                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6448                        this.is_terminated = true;
6449                        return std::task::Poll::Ready(None);
6450                    }
6451                    std::task::Poll::Ready(Err(e)) => {
6452                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6453                            e.into(),
6454                        ))));
6455                    }
6456                }
6457
6458                // A message has been received from the channel
6459                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6460
6461                std::task::Poll::Ready(Some(match header.ordinal {
6462                    0x37abec519b2ac1be => {
6463                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6464                        let mut req = fidl::new_empty!(
6465                            fidl::encoding::EmptyPayload,
6466                            fidl::encoding::DefaultFuchsiaResourceDialect
6467                        );
6468                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6469                        let control_handle =
6470                            TestCaseIteratorControlHandle { inner: this.inner.clone() };
6471                        Ok(TestCaseIteratorRequest::GetNext {
6472                            responder: TestCaseIteratorGetNextResponder {
6473                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6474                                tx_id: header.tx_id,
6475                            },
6476                        })
6477                    }
6478                    _ => Err(fidl::Error::UnknownOrdinal {
6479                        ordinal: header.ordinal,
6480                        protocol_name:
6481                            <TestCaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6482                    }),
6483                }))
6484            },
6485        )
6486    }
6487}
6488
6489/// Iterator for listing available test cases.
6490#[derive(Debug)]
6491pub enum TestCaseIteratorRequest {
6492    /// Returns the next batch of test cases. Returns the empty vector to indicate that the
6493    /// iteration is complete.
6494    GetNext { responder: TestCaseIteratorGetNextResponder },
6495}
6496
6497impl TestCaseIteratorRequest {
6498    #[allow(irrefutable_let_patterns)]
6499    pub fn into_get_next(self) -> Option<(TestCaseIteratorGetNextResponder)> {
6500        if let TestCaseIteratorRequest::GetNext { responder } = self {
6501            Some((responder))
6502        } else {
6503            None
6504        }
6505    }
6506
6507    /// Name of the method defined in FIDL
6508    pub fn method_name(&self) -> &'static str {
6509        match *self {
6510            TestCaseIteratorRequest::GetNext { .. } => "get_next",
6511        }
6512    }
6513}
6514
6515#[derive(Debug, Clone)]
6516pub struct TestCaseIteratorControlHandle {
6517    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6518}
6519
6520impl fidl::endpoints::ControlHandle for TestCaseIteratorControlHandle {
6521    fn shutdown(&self) {
6522        self.inner.shutdown()
6523    }
6524
6525    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6526        self.inner.shutdown_with_epitaph(status)
6527    }
6528
6529    fn is_closed(&self) -> bool {
6530        self.inner.channel().is_closed()
6531    }
6532    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6533        self.inner.channel().on_closed()
6534    }
6535
6536    #[cfg(target_os = "fuchsia")]
6537    fn signal_peer(
6538        &self,
6539        clear_mask: zx::Signals,
6540        set_mask: zx::Signals,
6541    ) -> Result<(), zx_status::Status> {
6542        use fidl::Peered;
6543        self.inner.channel().signal_peer(clear_mask, set_mask)
6544    }
6545}
6546
6547impl TestCaseIteratorControlHandle {}
6548
6549#[must_use = "FIDL methods require a response to be sent"]
6550#[derive(Debug)]
6551pub struct TestCaseIteratorGetNextResponder {
6552    control_handle: std::mem::ManuallyDrop<TestCaseIteratorControlHandle>,
6553    tx_id: u32,
6554}
6555
6556/// Set the the channel to be shutdown (see [`TestCaseIteratorControlHandle::shutdown`])
6557/// if the responder is dropped without sending a response, so that the client
6558/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6559impl std::ops::Drop for TestCaseIteratorGetNextResponder {
6560    fn drop(&mut self) {
6561        self.control_handle.shutdown();
6562        // Safety: drops once, never accessed again
6563        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6564    }
6565}
6566
6567impl fidl::endpoints::Responder for TestCaseIteratorGetNextResponder {
6568    type ControlHandle = TestCaseIteratorControlHandle;
6569
6570    fn control_handle(&self) -> &TestCaseIteratorControlHandle {
6571        &self.control_handle
6572    }
6573
6574    fn drop_without_shutdown(mut self) {
6575        // Safety: drops once, never accessed again due to mem::forget
6576        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6577        // Prevent Drop from running (which would shut down the channel)
6578        std::mem::forget(self);
6579    }
6580}
6581
6582impl TestCaseIteratorGetNextResponder {
6583    /// Sends a response to the FIDL transaction.
6584    ///
6585    /// Sets the channel to shutdown if an error occurs.
6586    pub fn send(self, mut test_cases: &[TestCase]) -> Result<(), fidl::Error> {
6587        let _result = self.send_raw(test_cases);
6588        if _result.is_err() {
6589            self.control_handle.shutdown();
6590        }
6591        self.drop_without_shutdown();
6592        _result
6593    }
6594
6595    /// Similar to "send" but does not shutdown the channel if an error occurs.
6596    pub fn send_no_shutdown_on_err(self, mut test_cases: &[TestCase]) -> Result<(), fidl::Error> {
6597        let _result = self.send_raw(test_cases);
6598        self.drop_without_shutdown();
6599        _result
6600    }
6601
6602    fn send_raw(&self, mut test_cases: &[TestCase]) -> Result<(), fidl::Error> {
6603        self.control_handle.inner.send::<TestCaseIteratorGetNextResponse>(
6604            (test_cases,),
6605            self.tx_id,
6606            0x37abec519b2ac1be,
6607            fidl::encoding::DynamicFlags::empty(),
6608        )
6609    }
6610}
6611
6612mod internal {
6613    use super::*;
6614
6615    impl fidl::encoding::ResourceTypeMarker for CaseArtifact {
6616        type Borrowed<'a> = &'a mut Self;
6617        fn take_or_borrow<'a>(
6618            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6619        ) -> Self::Borrowed<'a> {
6620            value
6621        }
6622    }
6623
6624    unsafe impl fidl::encoding::TypeMarker for CaseArtifact {
6625        type Owned = Self;
6626
6627        #[inline(always)]
6628        fn inline_align(_context: fidl::encoding::Context) -> usize {
6629            8
6630        }
6631
6632        #[inline(always)]
6633        fn inline_size(_context: fidl::encoding::Context) -> usize {
6634            24
6635        }
6636    }
6637
6638    unsafe impl fidl::encoding::Encode<CaseArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
6639        for &mut CaseArtifact
6640    {
6641        #[inline]
6642        unsafe fn encode(
6643            self,
6644            encoder: &mut fidl::encoding::Encoder<
6645                '_,
6646                fidl::encoding::DefaultFuchsiaResourceDialect,
6647            >,
6648            offset: usize,
6649            _depth: fidl::encoding::Depth,
6650        ) -> fidl::Result<()> {
6651            encoder.debug_check_bounds::<CaseArtifact>(offset);
6652            // Delegate to tuple encoding.
6653            fidl::encoding::Encode::<CaseArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6654                (
6655                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.identifier),
6656                    <Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.artifact),
6657                ),
6658                encoder, offset, _depth
6659            )
6660        }
6661    }
6662    unsafe impl<
6663        T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
6664        T1: fidl::encoding::Encode<Artifact, fidl::encoding::DefaultFuchsiaResourceDialect>,
6665    > fidl::encoding::Encode<CaseArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
6666        for (T0, T1)
6667    {
6668        #[inline]
6669        unsafe fn encode(
6670            self,
6671            encoder: &mut fidl::encoding::Encoder<
6672                '_,
6673                fidl::encoding::DefaultFuchsiaResourceDialect,
6674            >,
6675            offset: usize,
6676            depth: fidl::encoding::Depth,
6677        ) -> fidl::Result<()> {
6678            encoder.debug_check_bounds::<CaseArtifact>(offset);
6679            // Zero out padding regions. There's no need to apply masks
6680            // because the unmasked parts will be overwritten by fields.
6681            unsafe {
6682                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
6683                (ptr as *mut u64).write_unaligned(0);
6684            }
6685            // Write the fields.
6686            self.0.encode(encoder, offset + 0, depth)?;
6687            self.1.encode(encoder, offset + 8, depth)?;
6688            Ok(())
6689        }
6690    }
6691
6692    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for CaseArtifact {
6693        #[inline(always)]
6694        fn new_empty() -> Self {
6695            Self {
6696                identifier: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
6697                artifact: fidl::new_empty!(Artifact, fidl::encoding::DefaultFuchsiaResourceDialect),
6698            }
6699        }
6700
6701        #[inline]
6702        unsafe fn decode(
6703            &mut self,
6704            decoder: &mut fidl::encoding::Decoder<
6705                '_,
6706                fidl::encoding::DefaultFuchsiaResourceDialect,
6707            >,
6708            offset: usize,
6709            _depth: fidl::encoding::Depth,
6710        ) -> fidl::Result<()> {
6711            decoder.debug_check_bounds::<Self>(offset);
6712            // Verify that padding bytes are zero.
6713            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
6714            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6715            let mask = 0xffffffff00000000u64;
6716            let maskedval = padval & mask;
6717            if maskedval != 0 {
6718                return Err(fidl::Error::NonZeroPadding {
6719                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
6720                });
6721            }
6722            fidl::decode!(
6723                u32,
6724                fidl::encoding::DefaultFuchsiaResourceDialect,
6725                &mut self.identifier,
6726                decoder,
6727                offset + 0,
6728                _depth
6729            )?;
6730            fidl::decode!(
6731                Artifact,
6732                fidl::encoding::DefaultFuchsiaResourceDialect,
6733                &mut self.artifact,
6734                decoder,
6735                offset + 8,
6736                _depth
6737            )?;
6738            Ok(())
6739        }
6740    }
6741
6742    impl fidl::encoding::ResourceTypeMarker for DebugDataIteratorGetNextCompressedResponse {
6743        type Borrowed<'a> = &'a mut Self;
6744        fn take_or_borrow<'a>(
6745            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6746        ) -> Self::Borrowed<'a> {
6747            value
6748        }
6749    }
6750
6751    unsafe impl fidl::encoding::TypeMarker for DebugDataIteratorGetNextCompressedResponse {
6752        type Owned = Self;
6753
6754        #[inline(always)]
6755        fn inline_align(_context: fidl::encoding::Context) -> usize {
6756            8
6757        }
6758
6759        #[inline(always)]
6760        fn inline_size(_context: fidl::encoding::Context) -> usize {
6761            16
6762        }
6763    }
6764
6765    unsafe impl
6766        fidl::encoding::Encode<
6767            DebugDataIteratorGetNextCompressedResponse,
6768            fidl::encoding::DefaultFuchsiaResourceDialect,
6769        > for &mut DebugDataIteratorGetNextCompressedResponse
6770    {
6771        #[inline]
6772        unsafe fn encode(
6773            self,
6774            encoder: &mut fidl::encoding::Encoder<
6775                '_,
6776                fidl::encoding::DefaultFuchsiaResourceDialect,
6777            >,
6778            offset: usize,
6779            _depth: fidl::encoding::Depth,
6780        ) -> fidl::Result<()> {
6781            encoder.debug_check_bounds::<DebugDataIteratorGetNextCompressedResponse>(offset);
6782            // Delegate to tuple encoding.
6783            fidl::encoding::Encode::<DebugDataIteratorGetNextCompressedResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6784                (
6785                    <fidl::encoding::UnboundedVector<DebugData> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data),
6786                ),
6787                encoder, offset, _depth
6788            )
6789        }
6790    }
6791    unsafe impl<
6792        T0: fidl::encoding::Encode<
6793                fidl::encoding::UnboundedVector<DebugData>,
6794                fidl::encoding::DefaultFuchsiaResourceDialect,
6795            >,
6796    >
6797        fidl::encoding::Encode<
6798            DebugDataIteratorGetNextCompressedResponse,
6799            fidl::encoding::DefaultFuchsiaResourceDialect,
6800        > for (T0,)
6801    {
6802        #[inline]
6803        unsafe fn encode(
6804            self,
6805            encoder: &mut fidl::encoding::Encoder<
6806                '_,
6807                fidl::encoding::DefaultFuchsiaResourceDialect,
6808            >,
6809            offset: usize,
6810            depth: fidl::encoding::Depth,
6811        ) -> fidl::Result<()> {
6812            encoder.debug_check_bounds::<DebugDataIteratorGetNextCompressedResponse>(offset);
6813            // Zero out padding regions. There's no need to apply masks
6814            // because the unmasked parts will be overwritten by fields.
6815            // Write the fields.
6816            self.0.encode(encoder, offset + 0, depth)?;
6817            Ok(())
6818        }
6819    }
6820
6821    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6822        for DebugDataIteratorGetNextCompressedResponse
6823    {
6824        #[inline(always)]
6825        fn new_empty() -> Self {
6826            Self {
6827                data: fidl::new_empty!(
6828                    fidl::encoding::UnboundedVector<DebugData>,
6829                    fidl::encoding::DefaultFuchsiaResourceDialect
6830                ),
6831            }
6832        }
6833
6834        #[inline]
6835        unsafe fn decode(
6836            &mut self,
6837            decoder: &mut fidl::encoding::Decoder<
6838                '_,
6839                fidl::encoding::DefaultFuchsiaResourceDialect,
6840            >,
6841            offset: usize,
6842            _depth: fidl::encoding::Depth,
6843        ) -> fidl::Result<()> {
6844            decoder.debug_check_bounds::<Self>(offset);
6845            // Verify that padding bytes are zero.
6846            fidl::decode!(
6847                fidl::encoding::UnboundedVector<DebugData>,
6848                fidl::encoding::DefaultFuchsiaResourceDialect,
6849                &mut self.data,
6850                decoder,
6851                offset + 0,
6852                _depth
6853            )?;
6854            Ok(())
6855        }
6856    }
6857
6858    impl fidl::encoding::ResourceTypeMarker for DebugDataIteratorGetNextResponse {
6859        type Borrowed<'a> = &'a mut Self;
6860        fn take_or_borrow<'a>(
6861            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6862        ) -> Self::Borrowed<'a> {
6863            value
6864        }
6865    }
6866
6867    unsafe impl fidl::encoding::TypeMarker for DebugDataIteratorGetNextResponse {
6868        type Owned = Self;
6869
6870        #[inline(always)]
6871        fn inline_align(_context: fidl::encoding::Context) -> usize {
6872            8
6873        }
6874
6875        #[inline(always)]
6876        fn inline_size(_context: fidl::encoding::Context) -> usize {
6877            16
6878        }
6879    }
6880
6881    unsafe impl
6882        fidl::encoding::Encode<
6883            DebugDataIteratorGetNextResponse,
6884            fidl::encoding::DefaultFuchsiaResourceDialect,
6885        > for &mut DebugDataIteratorGetNextResponse
6886    {
6887        #[inline]
6888        unsafe fn encode(
6889            self,
6890            encoder: &mut fidl::encoding::Encoder<
6891                '_,
6892                fidl::encoding::DefaultFuchsiaResourceDialect,
6893            >,
6894            offset: usize,
6895            _depth: fidl::encoding::Depth,
6896        ) -> fidl::Result<()> {
6897            encoder.debug_check_bounds::<DebugDataIteratorGetNextResponse>(offset);
6898            // Delegate to tuple encoding.
6899            fidl::encoding::Encode::<DebugDataIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6900                (
6901                    <fidl::encoding::UnboundedVector<DebugData> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data),
6902                ),
6903                encoder, offset, _depth
6904            )
6905        }
6906    }
6907    unsafe impl<
6908        T0: fidl::encoding::Encode<
6909                fidl::encoding::UnboundedVector<DebugData>,
6910                fidl::encoding::DefaultFuchsiaResourceDialect,
6911            >,
6912    >
6913        fidl::encoding::Encode<
6914            DebugDataIteratorGetNextResponse,
6915            fidl::encoding::DefaultFuchsiaResourceDialect,
6916        > for (T0,)
6917    {
6918        #[inline]
6919        unsafe fn encode(
6920            self,
6921            encoder: &mut fidl::encoding::Encoder<
6922                '_,
6923                fidl::encoding::DefaultFuchsiaResourceDialect,
6924            >,
6925            offset: usize,
6926            depth: fidl::encoding::Depth,
6927        ) -> fidl::Result<()> {
6928            encoder.debug_check_bounds::<DebugDataIteratorGetNextResponse>(offset);
6929            // Zero out padding regions. There's no need to apply masks
6930            // because the unmasked parts will be overwritten by fields.
6931            // Write the fields.
6932            self.0.encode(encoder, offset + 0, depth)?;
6933            Ok(())
6934        }
6935    }
6936
6937    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6938        for DebugDataIteratorGetNextResponse
6939    {
6940        #[inline(always)]
6941        fn new_empty() -> Self {
6942            Self {
6943                data: fidl::new_empty!(
6944                    fidl::encoding::UnboundedVector<DebugData>,
6945                    fidl::encoding::DefaultFuchsiaResourceDialect
6946                ),
6947            }
6948        }
6949
6950        #[inline]
6951        unsafe fn decode(
6952            &mut self,
6953            decoder: &mut fidl::encoding::Decoder<
6954                '_,
6955                fidl::encoding::DefaultFuchsiaResourceDialect,
6956            >,
6957            offset: usize,
6958            _depth: fidl::encoding::Depth,
6959        ) -> fidl::Result<()> {
6960            decoder.debug_check_bounds::<Self>(offset);
6961            // Verify that padding bytes are zero.
6962            fidl::decode!(
6963                fidl::encoding::UnboundedVector<DebugData>,
6964                fidl::encoding::DefaultFuchsiaResourceDialect,
6965                &mut self.data,
6966                decoder,
6967                offset + 0,
6968                _depth
6969            )?;
6970            Ok(())
6971        }
6972    }
6973
6974    impl fidl::encoding::ResourceTypeMarker for DirectoryAndToken {
6975        type Borrowed<'a> = &'a mut Self;
6976        fn take_or_borrow<'a>(
6977            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6978        ) -> Self::Borrowed<'a> {
6979            value
6980        }
6981    }
6982
6983    unsafe impl fidl::encoding::TypeMarker for DirectoryAndToken {
6984        type Owned = Self;
6985
6986        #[inline(always)]
6987        fn inline_align(_context: fidl::encoding::Context) -> usize {
6988            4
6989        }
6990
6991        #[inline(always)]
6992        fn inline_size(_context: fidl::encoding::Context) -> usize {
6993            8
6994        }
6995    }
6996
6997    unsafe impl
6998        fidl::encoding::Encode<DirectoryAndToken, fidl::encoding::DefaultFuchsiaResourceDialect>
6999        for &mut DirectoryAndToken
7000    {
7001        #[inline]
7002        unsafe fn encode(
7003            self,
7004            encoder: &mut fidl::encoding::Encoder<
7005                '_,
7006                fidl::encoding::DefaultFuchsiaResourceDialect,
7007            >,
7008            offset: usize,
7009            _depth: fidl::encoding::Depth,
7010        ) -> fidl::Result<()> {
7011            encoder.debug_check_bounds::<DirectoryAndToken>(offset);
7012            // Delegate to tuple encoding.
7013            fidl::encoding::Encode::<DirectoryAndToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7014                (
7015                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.directory),
7016                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
7017                ),
7018                encoder, offset, _depth
7019            )
7020        }
7021    }
7022    unsafe impl<
7023        T0: fidl::encoding::Encode<
7024                fidl::encoding::Endpoint<
7025                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
7026                >,
7027                fidl::encoding::DefaultFuchsiaResourceDialect,
7028            >,
7029        T1: fidl::encoding::Encode<
7030                fidl::encoding::HandleType<
7031                    fidl::EventPair,
7032                    { fidl::ObjectType::EVENTPAIR.into_raw() },
7033                    2147483648,
7034                >,
7035                fidl::encoding::DefaultFuchsiaResourceDialect,
7036            >,
7037    > fidl::encoding::Encode<DirectoryAndToken, fidl::encoding::DefaultFuchsiaResourceDialect>
7038        for (T0, T1)
7039    {
7040        #[inline]
7041        unsafe fn encode(
7042            self,
7043            encoder: &mut fidl::encoding::Encoder<
7044                '_,
7045                fidl::encoding::DefaultFuchsiaResourceDialect,
7046            >,
7047            offset: usize,
7048            depth: fidl::encoding::Depth,
7049        ) -> fidl::Result<()> {
7050            encoder.debug_check_bounds::<DirectoryAndToken>(offset);
7051            // Zero out padding regions. There's no need to apply masks
7052            // because the unmasked parts will be overwritten by fields.
7053            // Write the fields.
7054            self.0.encode(encoder, offset + 0, depth)?;
7055            self.1.encode(encoder, offset + 4, depth)?;
7056            Ok(())
7057        }
7058    }
7059
7060    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7061        for DirectoryAndToken
7062    {
7063        #[inline(always)]
7064        fn new_empty() -> Self {
7065            Self {
7066                directory: fidl::new_empty!(
7067                    fidl::encoding::Endpoint<
7068                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
7069                    >,
7070                    fidl::encoding::DefaultFuchsiaResourceDialect
7071                ),
7072                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
7073            }
7074        }
7075
7076        #[inline]
7077        unsafe fn decode(
7078            &mut self,
7079            decoder: &mut fidl::encoding::Decoder<
7080                '_,
7081                fidl::encoding::DefaultFuchsiaResourceDialect,
7082            >,
7083            offset: usize,
7084            _depth: fidl::encoding::Depth,
7085        ) -> fidl::Result<()> {
7086            decoder.debug_check_bounds::<Self>(offset);
7087            // Verify that padding bytes are zero.
7088            fidl::decode!(
7089                fidl::encoding::Endpoint<
7090                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
7091                >,
7092                fidl::encoding::DefaultFuchsiaResourceDialect,
7093                &mut self.directory,
7094                decoder,
7095                offset + 0,
7096                _depth
7097            )?;
7098            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 4, _depth)?;
7099            Ok(())
7100        }
7101    }
7102
7103    impl fidl::encoding::ResourceTypeMarker for EarlyBootProfileRegisterWatcherRequest {
7104        type Borrowed<'a> = &'a mut Self;
7105        fn take_or_borrow<'a>(
7106            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7107        ) -> Self::Borrowed<'a> {
7108            value
7109        }
7110    }
7111
7112    unsafe impl fidl::encoding::TypeMarker for EarlyBootProfileRegisterWatcherRequest {
7113        type Owned = Self;
7114
7115        #[inline(always)]
7116        fn inline_align(_context: fidl::encoding::Context) -> usize {
7117            4
7118        }
7119
7120        #[inline(always)]
7121        fn inline_size(_context: fidl::encoding::Context) -> usize {
7122            4
7123        }
7124    }
7125
7126    unsafe impl
7127        fidl::encoding::Encode<
7128            EarlyBootProfileRegisterWatcherRequest,
7129            fidl::encoding::DefaultFuchsiaResourceDialect,
7130        > for &mut EarlyBootProfileRegisterWatcherRequest
7131    {
7132        #[inline]
7133        unsafe fn encode(
7134            self,
7135            encoder: &mut fidl::encoding::Encoder<
7136                '_,
7137                fidl::encoding::DefaultFuchsiaResourceDialect,
7138            >,
7139            offset: usize,
7140            _depth: fidl::encoding::Depth,
7141        ) -> fidl::Result<()> {
7142            encoder.debug_check_bounds::<EarlyBootProfileRegisterWatcherRequest>(offset);
7143            // Delegate to tuple encoding.
7144            fidl::encoding::Encode::<EarlyBootProfileRegisterWatcherRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7145                (
7146                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
7147                ),
7148                encoder, offset, _depth
7149            )
7150        }
7151    }
7152    unsafe impl<
7153        T0: fidl::encoding::Encode<
7154                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>>,
7155                fidl::encoding::DefaultFuchsiaResourceDialect,
7156            >,
7157    >
7158        fidl::encoding::Encode<
7159            EarlyBootProfileRegisterWatcherRequest,
7160            fidl::encoding::DefaultFuchsiaResourceDialect,
7161        > for (T0,)
7162    {
7163        #[inline]
7164        unsafe fn encode(
7165            self,
7166            encoder: &mut fidl::encoding::Encoder<
7167                '_,
7168                fidl::encoding::DefaultFuchsiaResourceDialect,
7169            >,
7170            offset: usize,
7171            depth: fidl::encoding::Depth,
7172        ) -> fidl::Result<()> {
7173            encoder.debug_check_bounds::<EarlyBootProfileRegisterWatcherRequest>(offset);
7174            // Zero out padding regions. There's no need to apply masks
7175            // because the unmasked parts will be overwritten by fields.
7176            // Write the fields.
7177            self.0.encode(encoder, offset + 0, depth)?;
7178            Ok(())
7179        }
7180    }
7181
7182    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7183        for EarlyBootProfileRegisterWatcherRequest
7184    {
7185        #[inline(always)]
7186        fn new_empty() -> Self {
7187            Self {
7188                iterator: fidl::new_empty!(
7189                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>>,
7190                    fidl::encoding::DefaultFuchsiaResourceDialect
7191                ),
7192            }
7193        }
7194
7195        #[inline]
7196        unsafe fn decode(
7197            &mut self,
7198            decoder: &mut fidl::encoding::Decoder<
7199                '_,
7200                fidl::encoding::DefaultFuchsiaResourceDialect,
7201            >,
7202            offset: usize,
7203            _depth: fidl::encoding::Depth,
7204        ) -> fidl::Result<()> {
7205            decoder.debug_check_bounds::<Self>(offset);
7206            // Verify that padding bytes are zero.
7207            fidl::decode!(
7208                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>>,
7209                fidl::encoding::DefaultFuchsiaResourceDialect,
7210                &mut self.iterator,
7211                decoder,
7212                offset + 0,
7213                _depth
7214            )?;
7215            Ok(())
7216        }
7217    }
7218
7219    impl fidl::encoding::ResourceTypeMarker for QueryEnumerateInRealmRequest {
7220        type Borrowed<'a> = &'a mut Self;
7221        fn take_or_borrow<'a>(
7222            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7223        ) -> Self::Borrowed<'a> {
7224            value
7225        }
7226    }
7227
7228    unsafe impl fidl::encoding::TypeMarker for QueryEnumerateInRealmRequest {
7229        type Owned = Self;
7230
7231        #[inline(always)]
7232        fn inline_align(_context: fidl::encoding::Context) -> usize {
7233            8
7234        }
7235
7236        #[inline(always)]
7237        fn inline_size(_context: fidl::encoding::Context) -> usize {
7238            64
7239        }
7240    }
7241
7242    unsafe impl
7243        fidl::encoding::Encode<
7244            QueryEnumerateInRealmRequest,
7245            fidl::encoding::DefaultFuchsiaResourceDialect,
7246        > for &mut QueryEnumerateInRealmRequest
7247    {
7248        #[inline]
7249        unsafe fn encode(
7250            self,
7251            encoder: &mut fidl::encoding::Encoder<
7252                '_,
7253                fidl::encoding::DefaultFuchsiaResourceDialect,
7254            >,
7255            offset: usize,
7256            _depth: fidl::encoding::Depth,
7257        ) -> fidl::Result<()> {
7258            encoder.debug_check_bounds::<QueryEnumerateInRealmRequest>(offset);
7259            // Delegate to tuple encoding.
7260            fidl::encoding::Encode::<QueryEnumerateInRealmRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7261                (
7262                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_url),
7263                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.realm),
7264                    <fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer> as fidl::encoding::ValueTypeMarker>::borrow(&self.offers),
7265                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.test_collection),
7266                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
7267                ),
7268                encoder, offset, _depth
7269            )
7270        }
7271    }
7272    unsafe impl<
7273        T0: fidl::encoding::Encode<
7274                fidl::encoding::BoundedString<4096>,
7275                fidl::encoding::DefaultFuchsiaResourceDialect,
7276            >,
7277        T1: fidl::encoding::Encode<
7278                fidl::encoding::Endpoint<
7279                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7280                >,
7281                fidl::encoding::DefaultFuchsiaResourceDialect,
7282            >,
7283        T2: fidl::encoding::Encode<
7284                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7285                fidl::encoding::DefaultFuchsiaResourceDialect,
7286            >,
7287        T3: fidl::encoding::Encode<
7288                fidl::encoding::UnboundedString,
7289                fidl::encoding::DefaultFuchsiaResourceDialect,
7290            >,
7291        T4: fidl::encoding::Encode<
7292                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7293                fidl::encoding::DefaultFuchsiaResourceDialect,
7294            >,
7295    >
7296        fidl::encoding::Encode<
7297            QueryEnumerateInRealmRequest,
7298            fidl::encoding::DefaultFuchsiaResourceDialect,
7299        > for (T0, T1, T2, T3, T4)
7300    {
7301        #[inline]
7302        unsafe fn encode(
7303            self,
7304            encoder: &mut fidl::encoding::Encoder<
7305                '_,
7306                fidl::encoding::DefaultFuchsiaResourceDialect,
7307            >,
7308            offset: usize,
7309            depth: fidl::encoding::Depth,
7310        ) -> fidl::Result<()> {
7311            encoder.debug_check_bounds::<QueryEnumerateInRealmRequest>(offset);
7312            // Zero out padding regions. There's no need to apply masks
7313            // because the unmasked parts will be overwritten by fields.
7314            unsafe {
7315                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7316                (ptr as *mut u64).write_unaligned(0);
7317            }
7318            unsafe {
7319                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(56);
7320                (ptr as *mut u64).write_unaligned(0);
7321            }
7322            // Write the fields.
7323            self.0.encode(encoder, offset + 0, depth)?;
7324            self.1.encode(encoder, offset + 16, depth)?;
7325            self.2.encode(encoder, offset + 24, depth)?;
7326            self.3.encode(encoder, offset + 40, depth)?;
7327            self.4.encode(encoder, offset + 56, depth)?;
7328            Ok(())
7329        }
7330    }
7331
7332    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7333        for QueryEnumerateInRealmRequest
7334    {
7335        #[inline(always)]
7336        fn new_empty() -> Self {
7337            Self {
7338                test_url: fidl::new_empty!(
7339                    fidl::encoding::BoundedString<4096>,
7340                    fidl::encoding::DefaultFuchsiaResourceDialect
7341                ),
7342                realm: fidl::new_empty!(
7343                    fidl::encoding::Endpoint<
7344                        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7345                    >,
7346                    fidl::encoding::DefaultFuchsiaResourceDialect
7347                ),
7348                offers: fidl::new_empty!(
7349                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7350                    fidl::encoding::DefaultFuchsiaResourceDialect
7351                ),
7352                test_collection: fidl::new_empty!(
7353                    fidl::encoding::UnboundedString,
7354                    fidl::encoding::DefaultFuchsiaResourceDialect
7355                ),
7356                iterator: fidl::new_empty!(
7357                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7358                    fidl::encoding::DefaultFuchsiaResourceDialect
7359                ),
7360            }
7361        }
7362
7363        #[inline]
7364        unsafe fn decode(
7365            &mut self,
7366            decoder: &mut fidl::encoding::Decoder<
7367                '_,
7368                fidl::encoding::DefaultFuchsiaResourceDialect,
7369            >,
7370            offset: usize,
7371            _depth: fidl::encoding::Depth,
7372        ) -> fidl::Result<()> {
7373            decoder.debug_check_bounds::<Self>(offset);
7374            // Verify that padding bytes are zero.
7375            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7376            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7377            let mask = 0xffffffff00000000u64;
7378            let maskedval = padval & mask;
7379            if maskedval != 0 {
7380                return Err(fidl::Error::NonZeroPadding {
7381                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7382                });
7383            }
7384            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(56) };
7385            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7386            let mask = 0xffffffff00000000u64;
7387            let maskedval = padval & mask;
7388            if maskedval != 0 {
7389                return Err(fidl::Error::NonZeroPadding {
7390                    padding_start: offset + 56 + ((mask as u64).trailing_zeros() / 8) as usize,
7391                });
7392            }
7393            fidl::decode!(
7394                fidl::encoding::BoundedString<4096>,
7395                fidl::encoding::DefaultFuchsiaResourceDialect,
7396                &mut self.test_url,
7397                decoder,
7398                offset + 0,
7399                _depth
7400            )?;
7401            fidl::decode!(
7402                fidl::encoding::Endpoint<
7403                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7404                >,
7405                fidl::encoding::DefaultFuchsiaResourceDialect,
7406                &mut self.realm,
7407                decoder,
7408                offset + 16,
7409                _depth
7410            )?;
7411            fidl::decode!(
7412                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7413                fidl::encoding::DefaultFuchsiaResourceDialect,
7414                &mut self.offers,
7415                decoder,
7416                offset + 24,
7417                _depth
7418            )?;
7419            fidl::decode!(
7420                fidl::encoding::UnboundedString,
7421                fidl::encoding::DefaultFuchsiaResourceDialect,
7422                &mut self.test_collection,
7423                decoder,
7424                offset + 40,
7425                _depth
7426            )?;
7427            fidl::decode!(
7428                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7429                fidl::encoding::DefaultFuchsiaResourceDialect,
7430                &mut self.iterator,
7431                decoder,
7432                offset + 56,
7433                _depth
7434            )?;
7435            Ok(())
7436        }
7437    }
7438
7439    impl fidl::encoding::ResourceTypeMarker for QueryEnumerateRequest {
7440        type Borrowed<'a> = &'a mut Self;
7441        fn take_or_borrow<'a>(
7442            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7443        ) -> Self::Borrowed<'a> {
7444            value
7445        }
7446    }
7447
7448    unsafe impl fidl::encoding::TypeMarker for QueryEnumerateRequest {
7449        type Owned = Self;
7450
7451        #[inline(always)]
7452        fn inline_align(_context: fidl::encoding::Context) -> usize {
7453            8
7454        }
7455
7456        #[inline(always)]
7457        fn inline_size(_context: fidl::encoding::Context) -> usize {
7458            24
7459        }
7460    }
7461
7462    unsafe impl
7463        fidl::encoding::Encode<QueryEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
7464        for &mut QueryEnumerateRequest
7465    {
7466        #[inline]
7467        unsafe fn encode(
7468            self,
7469            encoder: &mut fidl::encoding::Encoder<
7470                '_,
7471                fidl::encoding::DefaultFuchsiaResourceDialect,
7472            >,
7473            offset: usize,
7474            _depth: fidl::encoding::Depth,
7475        ) -> fidl::Result<()> {
7476            encoder.debug_check_bounds::<QueryEnumerateRequest>(offset);
7477            // Delegate to tuple encoding.
7478            fidl::encoding::Encode::<QueryEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7479                (
7480                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_url),
7481                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
7482                ),
7483                encoder, offset, _depth
7484            )
7485        }
7486    }
7487    unsafe impl<
7488        T0: fidl::encoding::Encode<
7489                fidl::encoding::BoundedString<4096>,
7490                fidl::encoding::DefaultFuchsiaResourceDialect,
7491            >,
7492        T1: fidl::encoding::Encode<
7493                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7494                fidl::encoding::DefaultFuchsiaResourceDialect,
7495            >,
7496    >
7497        fidl::encoding::Encode<QueryEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
7498        for (T0, T1)
7499    {
7500        #[inline]
7501        unsafe fn encode(
7502            self,
7503            encoder: &mut fidl::encoding::Encoder<
7504                '_,
7505                fidl::encoding::DefaultFuchsiaResourceDialect,
7506            >,
7507            offset: usize,
7508            depth: fidl::encoding::Depth,
7509        ) -> fidl::Result<()> {
7510            encoder.debug_check_bounds::<QueryEnumerateRequest>(offset);
7511            // Zero out padding regions. There's no need to apply masks
7512            // because the unmasked parts will be overwritten by fields.
7513            unsafe {
7514                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7515                (ptr as *mut u64).write_unaligned(0);
7516            }
7517            // Write the fields.
7518            self.0.encode(encoder, offset + 0, depth)?;
7519            self.1.encode(encoder, offset + 16, depth)?;
7520            Ok(())
7521        }
7522    }
7523
7524    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7525        for QueryEnumerateRequest
7526    {
7527        #[inline(always)]
7528        fn new_empty() -> Self {
7529            Self {
7530                test_url: fidl::new_empty!(
7531                    fidl::encoding::BoundedString<4096>,
7532                    fidl::encoding::DefaultFuchsiaResourceDialect
7533                ),
7534                iterator: fidl::new_empty!(
7535                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7536                    fidl::encoding::DefaultFuchsiaResourceDialect
7537                ),
7538            }
7539        }
7540
7541        #[inline]
7542        unsafe fn decode(
7543            &mut self,
7544            decoder: &mut fidl::encoding::Decoder<
7545                '_,
7546                fidl::encoding::DefaultFuchsiaResourceDialect,
7547            >,
7548            offset: usize,
7549            _depth: fidl::encoding::Depth,
7550        ) -> fidl::Result<()> {
7551            decoder.debug_check_bounds::<Self>(offset);
7552            // Verify that padding bytes are zero.
7553            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7554            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7555            let mask = 0xffffffff00000000u64;
7556            let maskedval = padval & mask;
7557            if maskedval != 0 {
7558                return Err(fidl::Error::NonZeroPadding {
7559                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7560                });
7561            }
7562            fidl::decode!(
7563                fidl::encoding::BoundedString<4096>,
7564                fidl::encoding::DefaultFuchsiaResourceDialect,
7565                &mut self.test_url,
7566                decoder,
7567                offset + 0,
7568                _depth
7569            )?;
7570            fidl::decode!(
7571                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7572                fidl::encoding::DefaultFuchsiaResourceDialect,
7573                &mut self.iterator,
7574                decoder,
7575                offset + 16,
7576                _depth
7577            )?;
7578            Ok(())
7579        }
7580    }
7581
7582    impl fidl::encoding::ResourceTypeMarker for RunBuilderAddSuiteInRealmRequest {
7583        type Borrowed<'a> = &'a mut Self;
7584        fn take_or_borrow<'a>(
7585            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7586        ) -> Self::Borrowed<'a> {
7587            value
7588        }
7589    }
7590
7591    unsafe impl fidl::encoding::TypeMarker for RunBuilderAddSuiteInRealmRequest {
7592        type Owned = Self;
7593
7594        #[inline(always)]
7595        fn inline_align(_context: fidl::encoding::Context) -> usize {
7596            8
7597        }
7598
7599        #[inline(always)]
7600        fn inline_size(_context: fidl::encoding::Context) -> usize {
7601            80
7602        }
7603    }
7604
7605    unsafe impl
7606        fidl::encoding::Encode<
7607            RunBuilderAddSuiteInRealmRequest,
7608            fidl::encoding::DefaultFuchsiaResourceDialect,
7609        > for &mut RunBuilderAddSuiteInRealmRequest
7610    {
7611        #[inline]
7612        unsafe fn encode(
7613            self,
7614            encoder: &mut fidl::encoding::Encoder<
7615                '_,
7616                fidl::encoding::DefaultFuchsiaResourceDialect,
7617            >,
7618            offset: usize,
7619            _depth: fidl::encoding::Depth,
7620        ) -> fidl::Result<()> {
7621            encoder.debug_check_bounds::<RunBuilderAddSuiteInRealmRequest>(offset);
7622            // Delegate to tuple encoding.
7623            fidl::encoding::Encode::<RunBuilderAddSuiteInRealmRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7624                (
7625                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.realm),
7626                    <fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer> as fidl::encoding::ValueTypeMarker>::borrow(&self.offers),
7627                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.test_collection),
7628                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_url),
7629                    <RunOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
7630                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
7631                ),
7632                encoder, offset, _depth
7633            )
7634        }
7635    }
7636    unsafe impl<
7637        T0: fidl::encoding::Encode<
7638                fidl::encoding::Endpoint<
7639                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7640                >,
7641                fidl::encoding::DefaultFuchsiaResourceDialect,
7642            >,
7643        T1: fidl::encoding::Encode<
7644                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7645                fidl::encoding::DefaultFuchsiaResourceDialect,
7646            >,
7647        T2: fidl::encoding::Encode<
7648                fidl::encoding::UnboundedString,
7649                fidl::encoding::DefaultFuchsiaResourceDialect,
7650            >,
7651        T3: fidl::encoding::Encode<
7652                fidl::encoding::BoundedString<4096>,
7653                fidl::encoding::DefaultFuchsiaResourceDialect,
7654            >,
7655        T4: fidl::encoding::Encode<RunOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
7656        T5: fidl::encoding::Encode<
7657                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7658                fidl::encoding::DefaultFuchsiaResourceDialect,
7659            >,
7660    >
7661        fidl::encoding::Encode<
7662            RunBuilderAddSuiteInRealmRequest,
7663            fidl::encoding::DefaultFuchsiaResourceDialect,
7664        > for (T0, T1, T2, T3, T4, T5)
7665    {
7666        #[inline]
7667        unsafe fn encode(
7668            self,
7669            encoder: &mut fidl::encoding::Encoder<
7670                '_,
7671                fidl::encoding::DefaultFuchsiaResourceDialect,
7672            >,
7673            offset: usize,
7674            depth: fidl::encoding::Depth,
7675        ) -> fidl::Result<()> {
7676            encoder.debug_check_bounds::<RunBuilderAddSuiteInRealmRequest>(offset);
7677            // Zero out padding regions. There's no need to apply masks
7678            // because the unmasked parts will be overwritten by fields.
7679            unsafe {
7680                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7681                (ptr as *mut u64).write_unaligned(0);
7682            }
7683            unsafe {
7684                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(72);
7685                (ptr as *mut u64).write_unaligned(0);
7686            }
7687            // Write the fields.
7688            self.0.encode(encoder, offset + 0, depth)?;
7689            self.1.encode(encoder, offset + 8, depth)?;
7690            self.2.encode(encoder, offset + 24, depth)?;
7691            self.3.encode(encoder, offset + 40, depth)?;
7692            self.4.encode(encoder, offset + 56, depth)?;
7693            self.5.encode(encoder, offset + 72, depth)?;
7694            Ok(())
7695        }
7696    }
7697
7698    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7699        for RunBuilderAddSuiteInRealmRequest
7700    {
7701        #[inline(always)]
7702        fn new_empty() -> Self {
7703            Self {
7704                realm: fidl::new_empty!(
7705                    fidl::encoding::Endpoint<
7706                        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7707                    >,
7708                    fidl::encoding::DefaultFuchsiaResourceDialect
7709                ),
7710                offers: fidl::new_empty!(
7711                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7712                    fidl::encoding::DefaultFuchsiaResourceDialect
7713                ),
7714                test_collection: fidl::new_empty!(
7715                    fidl::encoding::UnboundedString,
7716                    fidl::encoding::DefaultFuchsiaResourceDialect
7717                ),
7718                test_url: fidl::new_empty!(
7719                    fidl::encoding::BoundedString<4096>,
7720                    fidl::encoding::DefaultFuchsiaResourceDialect
7721                ),
7722                options: fidl::new_empty!(
7723                    RunOptions,
7724                    fidl::encoding::DefaultFuchsiaResourceDialect
7725                ),
7726                controller: fidl::new_empty!(
7727                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7728                    fidl::encoding::DefaultFuchsiaResourceDialect
7729                ),
7730            }
7731        }
7732
7733        #[inline]
7734        unsafe fn decode(
7735            &mut self,
7736            decoder: &mut fidl::encoding::Decoder<
7737                '_,
7738                fidl::encoding::DefaultFuchsiaResourceDialect,
7739            >,
7740            offset: usize,
7741            _depth: fidl::encoding::Depth,
7742        ) -> fidl::Result<()> {
7743            decoder.debug_check_bounds::<Self>(offset);
7744            // Verify that padding bytes are zero.
7745            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7746            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7747            let mask = 0xffffffff00000000u64;
7748            let maskedval = padval & mask;
7749            if maskedval != 0 {
7750                return Err(fidl::Error::NonZeroPadding {
7751                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7752                });
7753            }
7754            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(72) };
7755            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7756            let mask = 0xffffffff00000000u64;
7757            let maskedval = padval & mask;
7758            if maskedval != 0 {
7759                return Err(fidl::Error::NonZeroPadding {
7760                    padding_start: offset + 72 + ((mask as u64).trailing_zeros() / 8) as usize,
7761                });
7762            }
7763            fidl::decode!(
7764                fidl::encoding::Endpoint<
7765                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7766                >,
7767                fidl::encoding::DefaultFuchsiaResourceDialect,
7768                &mut self.realm,
7769                decoder,
7770                offset + 0,
7771                _depth
7772            )?;
7773            fidl::decode!(
7774                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7775                fidl::encoding::DefaultFuchsiaResourceDialect,
7776                &mut self.offers,
7777                decoder,
7778                offset + 8,
7779                _depth
7780            )?;
7781            fidl::decode!(
7782                fidl::encoding::UnboundedString,
7783                fidl::encoding::DefaultFuchsiaResourceDialect,
7784                &mut self.test_collection,
7785                decoder,
7786                offset + 24,
7787                _depth
7788            )?;
7789            fidl::decode!(
7790                fidl::encoding::BoundedString<4096>,
7791                fidl::encoding::DefaultFuchsiaResourceDialect,
7792                &mut self.test_url,
7793                decoder,
7794                offset + 40,
7795                _depth
7796            )?;
7797            fidl::decode!(
7798                RunOptions,
7799                fidl::encoding::DefaultFuchsiaResourceDialect,
7800                &mut self.options,
7801                decoder,
7802                offset + 56,
7803                _depth
7804            )?;
7805            fidl::decode!(
7806                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7807                fidl::encoding::DefaultFuchsiaResourceDialect,
7808                &mut self.controller,
7809                decoder,
7810                offset + 72,
7811                _depth
7812            )?;
7813            Ok(())
7814        }
7815    }
7816
7817    impl fidl::encoding::ResourceTypeMarker for RunBuilderAddSuiteRequest {
7818        type Borrowed<'a> = &'a mut Self;
7819        fn take_or_borrow<'a>(
7820            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7821        ) -> Self::Borrowed<'a> {
7822            value
7823        }
7824    }
7825
7826    unsafe impl fidl::encoding::TypeMarker for RunBuilderAddSuiteRequest {
7827        type Owned = Self;
7828
7829        #[inline(always)]
7830        fn inline_align(_context: fidl::encoding::Context) -> usize {
7831            8
7832        }
7833
7834        #[inline(always)]
7835        fn inline_size(_context: fidl::encoding::Context) -> usize {
7836            40
7837        }
7838    }
7839
7840    unsafe impl
7841        fidl::encoding::Encode<
7842            RunBuilderAddSuiteRequest,
7843            fidl::encoding::DefaultFuchsiaResourceDialect,
7844        > for &mut RunBuilderAddSuiteRequest
7845    {
7846        #[inline]
7847        unsafe fn encode(
7848            self,
7849            encoder: &mut fidl::encoding::Encoder<
7850                '_,
7851                fidl::encoding::DefaultFuchsiaResourceDialect,
7852            >,
7853            offset: usize,
7854            _depth: fidl::encoding::Depth,
7855        ) -> fidl::Result<()> {
7856            encoder.debug_check_bounds::<RunBuilderAddSuiteRequest>(offset);
7857            // Delegate to tuple encoding.
7858            fidl::encoding::Encode::<RunBuilderAddSuiteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7859                (
7860                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_url),
7861                    <RunOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
7862                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
7863                ),
7864                encoder, offset, _depth
7865            )
7866        }
7867    }
7868    unsafe impl<
7869        T0: fidl::encoding::Encode<
7870                fidl::encoding::BoundedString<4096>,
7871                fidl::encoding::DefaultFuchsiaResourceDialect,
7872            >,
7873        T1: fidl::encoding::Encode<RunOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
7874        T2: fidl::encoding::Encode<
7875                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7876                fidl::encoding::DefaultFuchsiaResourceDialect,
7877            >,
7878    >
7879        fidl::encoding::Encode<
7880            RunBuilderAddSuiteRequest,
7881            fidl::encoding::DefaultFuchsiaResourceDialect,
7882        > for (T0, T1, T2)
7883    {
7884        #[inline]
7885        unsafe fn encode(
7886            self,
7887            encoder: &mut fidl::encoding::Encoder<
7888                '_,
7889                fidl::encoding::DefaultFuchsiaResourceDialect,
7890            >,
7891            offset: usize,
7892            depth: fidl::encoding::Depth,
7893        ) -> fidl::Result<()> {
7894            encoder.debug_check_bounds::<RunBuilderAddSuiteRequest>(offset);
7895            // Zero out padding regions. There's no need to apply masks
7896            // because the unmasked parts will be overwritten by fields.
7897            unsafe {
7898                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
7899                (ptr as *mut u64).write_unaligned(0);
7900            }
7901            // Write the fields.
7902            self.0.encode(encoder, offset + 0, depth)?;
7903            self.1.encode(encoder, offset + 16, depth)?;
7904            self.2.encode(encoder, offset + 32, depth)?;
7905            Ok(())
7906        }
7907    }
7908
7909    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7910        for RunBuilderAddSuiteRequest
7911    {
7912        #[inline(always)]
7913        fn new_empty() -> Self {
7914            Self {
7915                test_url: fidl::new_empty!(
7916                    fidl::encoding::BoundedString<4096>,
7917                    fidl::encoding::DefaultFuchsiaResourceDialect
7918                ),
7919                options: fidl::new_empty!(
7920                    RunOptions,
7921                    fidl::encoding::DefaultFuchsiaResourceDialect
7922                ),
7923                controller: fidl::new_empty!(
7924                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7925                    fidl::encoding::DefaultFuchsiaResourceDialect
7926                ),
7927            }
7928        }
7929
7930        #[inline]
7931        unsafe fn decode(
7932            &mut self,
7933            decoder: &mut fidl::encoding::Decoder<
7934                '_,
7935                fidl::encoding::DefaultFuchsiaResourceDialect,
7936            >,
7937            offset: usize,
7938            _depth: fidl::encoding::Depth,
7939        ) -> fidl::Result<()> {
7940            decoder.debug_check_bounds::<Self>(offset);
7941            // Verify that padding bytes are zero.
7942            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
7943            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7944            let mask = 0xffffffff00000000u64;
7945            let maskedval = padval & mask;
7946            if maskedval != 0 {
7947                return Err(fidl::Error::NonZeroPadding {
7948                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
7949                });
7950            }
7951            fidl::decode!(
7952                fidl::encoding::BoundedString<4096>,
7953                fidl::encoding::DefaultFuchsiaResourceDialect,
7954                &mut self.test_url,
7955                decoder,
7956                offset + 0,
7957                _depth
7958            )?;
7959            fidl::decode!(
7960                RunOptions,
7961                fidl::encoding::DefaultFuchsiaResourceDialect,
7962                &mut self.options,
7963                decoder,
7964                offset + 16,
7965                _depth
7966            )?;
7967            fidl::decode!(
7968                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7969                fidl::encoding::DefaultFuchsiaResourceDialect,
7970                &mut self.controller,
7971                decoder,
7972                offset + 32,
7973                _depth
7974            )?;
7975            Ok(())
7976        }
7977    }
7978
7979    impl fidl::encoding::ResourceTypeMarker for RunBuilderBuildRequest {
7980        type Borrowed<'a> = &'a mut Self;
7981        fn take_or_borrow<'a>(
7982            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7983        ) -> Self::Borrowed<'a> {
7984            value
7985        }
7986    }
7987
7988    unsafe impl fidl::encoding::TypeMarker for RunBuilderBuildRequest {
7989        type Owned = Self;
7990
7991        #[inline(always)]
7992        fn inline_align(_context: fidl::encoding::Context) -> usize {
7993            4
7994        }
7995
7996        #[inline(always)]
7997        fn inline_size(_context: fidl::encoding::Context) -> usize {
7998            4
7999        }
8000    }
8001
8002    unsafe impl
8003        fidl::encoding::Encode<
8004            RunBuilderBuildRequest,
8005            fidl::encoding::DefaultFuchsiaResourceDialect,
8006        > for &mut RunBuilderBuildRequest
8007    {
8008        #[inline]
8009        unsafe fn encode(
8010            self,
8011            encoder: &mut fidl::encoding::Encoder<
8012                '_,
8013                fidl::encoding::DefaultFuchsiaResourceDialect,
8014            >,
8015            offset: usize,
8016            _depth: fidl::encoding::Depth,
8017        ) -> fidl::Result<()> {
8018            encoder.debug_check_bounds::<RunBuilderBuildRequest>(offset);
8019            // Delegate to tuple encoding.
8020            fidl::encoding::Encode::<RunBuilderBuildRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8021                (
8022                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RunControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
8023                ),
8024                encoder, offset, _depth
8025            )
8026        }
8027    }
8028    unsafe impl<
8029        T0: fidl::encoding::Encode<
8030                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RunControllerMarker>>,
8031                fidl::encoding::DefaultFuchsiaResourceDialect,
8032            >,
8033    >
8034        fidl::encoding::Encode<
8035            RunBuilderBuildRequest,
8036            fidl::encoding::DefaultFuchsiaResourceDialect,
8037        > for (T0,)
8038    {
8039        #[inline]
8040        unsafe fn encode(
8041            self,
8042            encoder: &mut fidl::encoding::Encoder<
8043                '_,
8044                fidl::encoding::DefaultFuchsiaResourceDialect,
8045            >,
8046            offset: usize,
8047            depth: fidl::encoding::Depth,
8048        ) -> fidl::Result<()> {
8049            encoder.debug_check_bounds::<RunBuilderBuildRequest>(offset);
8050            // Zero out padding regions. There's no need to apply masks
8051            // because the unmasked parts will be overwritten by fields.
8052            // Write the fields.
8053            self.0.encode(encoder, offset + 0, depth)?;
8054            Ok(())
8055        }
8056    }
8057
8058    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8059        for RunBuilderBuildRequest
8060    {
8061        #[inline(always)]
8062        fn new_empty() -> Self {
8063            Self {
8064                controller: fidl::new_empty!(
8065                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RunControllerMarker>>,
8066                    fidl::encoding::DefaultFuchsiaResourceDialect
8067                ),
8068            }
8069        }
8070
8071        #[inline]
8072        unsafe fn decode(
8073            &mut self,
8074            decoder: &mut fidl::encoding::Decoder<
8075                '_,
8076                fidl::encoding::DefaultFuchsiaResourceDialect,
8077            >,
8078            offset: usize,
8079            _depth: fidl::encoding::Depth,
8080        ) -> fidl::Result<()> {
8081            decoder.debug_check_bounds::<Self>(offset);
8082            // Verify that padding bytes are zero.
8083            fidl::decode!(
8084                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RunControllerMarker>>,
8085                fidl::encoding::DefaultFuchsiaResourceDialect,
8086                &mut self.controller,
8087                decoder,
8088                offset + 0,
8089                _depth
8090            )?;
8091            Ok(())
8092        }
8093    }
8094
8095    impl fidl::encoding::ResourceTypeMarker for RunControllerGetEventsResponse {
8096        type Borrowed<'a> = &'a mut Self;
8097        fn take_or_borrow<'a>(
8098            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8099        ) -> Self::Borrowed<'a> {
8100            value
8101        }
8102    }
8103
8104    unsafe impl fidl::encoding::TypeMarker for RunControllerGetEventsResponse {
8105        type Owned = Self;
8106
8107        #[inline(always)]
8108        fn inline_align(_context: fidl::encoding::Context) -> usize {
8109            8
8110        }
8111
8112        #[inline(always)]
8113        fn inline_size(_context: fidl::encoding::Context) -> usize {
8114            16
8115        }
8116    }
8117
8118    unsafe impl
8119        fidl::encoding::Encode<
8120            RunControllerGetEventsResponse,
8121            fidl::encoding::DefaultFuchsiaResourceDialect,
8122        > for &mut RunControllerGetEventsResponse
8123    {
8124        #[inline]
8125        unsafe fn encode(
8126            self,
8127            encoder: &mut fidl::encoding::Encoder<
8128                '_,
8129                fidl::encoding::DefaultFuchsiaResourceDialect,
8130            >,
8131            offset: usize,
8132            _depth: fidl::encoding::Depth,
8133        ) -> fidl::Result<()> {
8134            encoder.debug_check_bounds::<RunControllerGetEventsResponse>(offset);
8135            // Delegate to tuple encoding.
8136            fidl::encoding::Encode::<RunControllerGetEventsResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8137                (
8138                    <fidl::encoding::UnboundedVector<RunEvent> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
8139                ),
8140                encoder, offset, _depth
8141            )
8142        }
8143    }
8144    unsafe impl<
8145        T0: fidl::encoding::Encode<
8146                fidl::encoding::UnboundedVector<RunEvent>,
8147                fidl::encoding::DefaultFuchsiaResourceDialect,
8148            >,
8149    >
8150        fidl::encoding::Encode<
8151            RunControllerGetEventsResponse,
8152            fidl::encoding::DefaultFuchsiaResourceDialect,
8153        > for (T0,)
8154    {
8155        #[inline]
8156        unsafe fn encode(
8157            self,
8158            encoder: &mut fidl::encoding::Encoder<
8159                '_,
8160                fidl::encoding::DefaultFuchsiaResourceDialect,
8161            >,
8162            offset: usize,
8163            depth: fidl::encoding::Depth,
8164        ) -> fidl::Result<()> {
8165            encoder.debug_check_bounds::<RunControllerGetEventsResponse>(offset);
8166            // Zero out padding regions. There's no need to apply masks
8167            // because the unmasked parts will be overwritten by fields.
8168            // Write the fields.
8169            self.0.encode(encoder, offset + 0, depth)?;
8170            Ok(())
8171        }
8172    }
8173
8174    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8175        for RunControllerGetEventsResponse
8176    {
8177        #[inline(always)]
8178        fn new_empty() -> Self {
8179            Self {
8180                events: fidl::new_empty!(
8181                    fidl::encoding::UnboundedVector<RunEvent>,
8182                    fidl::encoding::DefaultFuchsiaResourceDialect
8183                ),
8184            }
8185        }
8186
8187        #[inline]
8188        unsafe fn decode(
8189            &mut self,
8190            decoder: &mut fidl::encoding::Decoder<
8191                '_,
8192                fidl::encoding::DefaultFuchsiaResourceDialect,
8193            >,
8194            offset: usize,
8195            _depth: fidl::encoding::Depth,
8196        ) -> fidl::Result<()> {
8197            decoder.debug_check_bounds::<Self>(offset);
8198            // Verify that padding bytes are zero.
8199            fidl::decode!(
8200                fidl::encoding::UnboundedVector<RunEvent>,
8201                fidl::encoding::DefaultFuchsiaResourceDialect,
8202                &mut self.events,
8203                decoder,
8204                offset + 0,
8205                _depth
8206            )?;
8207            Ok(())
8208        }
8209    }
8210
8211    impl fidl::encoding::ResourceTypeMarker for Stderr {
8212        type Borrowed<'a> = &'a mut Self;
8213        fn take_or_borrow<'a>(
8214            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8215        ) -> Self::Borrowed<'a> {
8216            value
8217        }
8218    }
8219
8220    unsafe impl fidl::encoding::TypeMarker for Stderr {
8221        type Owned = Self;
8222
8223        #[inline(always)]
8224        fn inline_align(_context: fidl::encoding::Context) -> usize {
8225            4
8226        }
8227
8228        #[inline(always)]
8229        fn inline_size(_context: fidl::encoding::Context) -> usize {
8230            4
8231        }
8232    }
8233
8234    unsafe impl fidl::encoding::Encode<Stderr, fidl::encoding::DefaultFuchsiaResourceDialect>
8235        for &mut Stderr
8236    {
8237        #[inline]
8238        unsafe fn encode(
8239            self,
8240            encoder: &mut fidl::encoding::Encoder<
8241                '_,
8242                fidl::encoding::DefaultFuchsiaResourceDialect,
8243            >,
8244            offset: usize,
8245            _depth: fidl::encoding::Depth,
8246        ) -> fidl::Result<()> {
8247            encoder.debug_check_bounds::<Stderr>(offset);
8248            // Delegate to tuple encoding.
8249            fidl::encoding::Encode::<Stderr, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8250                (<fidl::encoding::HandleType<
8251                    fidl::Socket,
8252                    { fidl::ObjectType::SOCKET.into_raw() },
8253                    2147483648,
8254                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8255                    &mut self.socket
8256                ),),
8257                encoder,
8258                offset,
8259                _depth,
8260            )
8261        }
8262    }
8263    unsafe impl<
8264        T0: fidl::encoding::Encode<
8265                fidl::encoding::HandleType<
8266                    fidl::Socket,
8267                    { fidl::ObjectType::SOCKET.into_raw() },
8268                    2147483648,
8269                >,
8270                fidl::encoding::DefaultFuchsiaResourceDialect,
8271            >,
8272    > fidl::encoding::Encode<Stderr, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
8273    {
8274        #[inline]
8275        unsafe fn encode(
8276            self,
8277            encoder: &mut fidl::encoding::Encoder<
8278                '_,
8279                fidl::encoding::DefaultFuchsiaResourceDialect,
8280            >,
8281            offset: usize,
8282            depth: fidl::encoding::Depth,
8283        ) -> fidl::Result<()> {
8284            encoder.debug_check_bounds::<Stderr>(offset);
8285            // Zero out padding regions. There's no need to apply masks
8286            // because the unmasked parts will be overwritten by fields.
8287            // Write the fields.
8288            self.0.encode(encoder, offset + 0, depth)?;
8289            Ok(())
8290        }
8291    }
8292
8293    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Stderr {
8294        #[inline(always)]
8295        fn new_empty() -> Self {
8296            Self {
8297                socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8298            }
8299        }
8300
8301        #[inline]
8302        unsafe fn decode(
8303            &mut self,
8304            decoder: &mut fidl::encoding::Decoder<
8305                '_,
8306                fidl::encoding::DefaultFuchsiaResourceDialect,
8307            >,
8308            offset: usize,
8309            _depth: fidl::encoding::Depth,
8310        ) -> fidl::Result<()> {
8311            decoder.debug_check_bounds::<Self>(offset);
8312            // Verify that padding bytes are zero.
8313            fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
8314            Ok(())
8315        }
8316    }
8317
8318    impl fidl::encoding::ResourceTypeMarker for Stdout {
8319        type Borrowed<'a> = &'a mut Self;
8320        fn take_or_borrow<'a>(
8321            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8322        ) -> Self::Borrowed<'a> {
8323            value
8324        }
8325    }
8326
8327    unsafe impl fidl::encoding::TypeMarker for Stdout {
8328        type Owned = Self;
8329
8330        #[inline(always)]
8331        fn inline_align(_context: fidl::encoding::Context) -> usize {
8332            4
8333        }
8334
8335        #[inline(always)]
8336        fn inline_size(_context: fidl::encoding::Context) -> usize {
8337            4
8338        }
8339    }
8340
8341    unsafe impl fidl::encoding::Encode<Stdout, fidl::encoding::DefaultFuchsiaResourceDialect>
8342        for &mut Stdout
8343    {
8344        #[inline]
8345        unsafe fn encode(
8346            self,
8347            encoder: &mut fidl::encoding::Encoder<
8348                '_,
8349                fidl::encoding::DefaultFuchsiaResourceDialect,
8350            >,
8351            offset: usize,
8352            _depth: fidl::encoding::Depth,
8353        ) -> fidl::Result<()> {
8354            encoder.debug_check_bounds::<Stdout>(offset);
8355            // Delegate to tuple encoding.
8356            fidl::encoding::Encode::<Stdout, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8357                (<fidl::encoding::HandleType<
8358                    fidl::Socket,
8359                    { fidl::ObjectType::SOCKET.into_raw() },
8360                    2147483648,
8361                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8362                    &mut self.socket
8363                ),),
8364                encoder,
8365                offset,
8366                _depth,
8367            )
8368        }
8369    }
8370    unsafe impl<
8371        T0: fidl::encoding::Encode<
8372                fidl::encoding::HandleType<
8373                    fidl::Socket,
8374                    { fidl::ObjectType::SOCKET.into_raw() },
8375                    2147483648,
8376                >,
8377                fidl::encoding::DefaultFuchsiaResourceDialect,
8378            >,
8379    > fidl::encoding::Encode<Stdout, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
8380    {
8381        #[inline]
8382        unsafe fn encode(
8383            self,
8384            encoder: &mut fidl::encoding::Encoder<
8385                '_,
8386                fidl::encoding::DefaultFuchsiaResourceDialect,
8387            >,
8388            offset: usize,
8389            depth: fidl::encoding::Depth,
8390        ) -> fidl::Result<()> {
8391            encoder.debug_check_bounds::<Stdout>(offset);
8392            // Zero out padding regions. There's no need to apply masks
8393            // because the unmasked parts will be overwritten by fields.
8394            // Write the fields.
8395            self.0.encode(encoder, offset + 0, depth)?;
8396            Ok(())
8397        }
8398    }
8399
8400    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Stdout {
8401        #[inline(always)]
8402        fn new_empty() -> Self {
8403            Self {
8404                socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8405            }
8406        }
8407
8408        #[inline]
8409        unsafe fn decode(
8410            &mut self,
8411            decoder: &mut fidl::encoding::Decoder<
8412                '_,
8413                fidl::encoding::DefaultFuchsiaResourceDialect,
8414            >,
8415            offset: usize,
8416            _depth: fidl::encoding::Depth,
8417        ) -> fidl::Result<()> {
8418            decoder.debug_check_bounds::<Self>(offset);
8419            // Verify that padding bytes are zero.
8420            fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
8421            Ok(())
8422        }
8423    }
8424
8425    impl fidl::encoding::ResourceTypeMarker for SuiteArtifact {
8426        type Borrowed<'a> = &'a mut Self;
8427        fn take_or_borrow<'a>(
8428            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8429        ) -> Self::Borrowed<'a> {
8430            value
8431        }
8432    }
8433
8434    unsafe impl fidl::encoding::TypeMarker for SuiteArtifact {
8435        type Owned = Self;
8436
8437        #[inline(always)]
8438        fn inline_align(_context: fidl::encoding::Context) -> usize {
8439            8
8440        }
8441
8442        #[inline(always)]
8443        fn inline_size(_context: fidl::encoding::Context) -> usize {
8444            16
8445        }
8446    }
8447
8448    unsafe impl fidl::encoding::Encode<SuiteArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
8449        for &mut SuiteArtifact
8450    {
8451        #[inline]
8452        unsafe fn encode(
8453            self,
8454            encoder: &mut fidl::encoding::Encoder<
8455                '_,
8456                fidl::encoding::DefaultFuchsiaResourceDialect,
8457            >,
8458            offset: usize,
8459            _depth: fidl::encoding::Depth,
8460        ) -> fidl::Result<()> {
8461            encoder.debug_check_bounds::<SuiteArtifact>(offset);
8462            // Delegate to tuple encoding.
8463            fidl::encoding::Encode::<SuiteArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8464                (
8465                    <Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.artifact),
8466                ),
8467                encoder, offset, _depth
8468            )
8469        }
8470    }
8471    unsafe impl<T0: fidl::encoding::Encode<Artifact, fidl::encoding::DefaultFuchsiaResourceDialect>>
8472        fidl::encoding::Encode<SuiteArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
8473        for (T0,)
8474    {
8475        #[inline]
8476        unsafe fn encode(
8477            self,
8478            encoder: &mut fidl::encoding::Encoder<
8479                '_,
8480                fidl::encoding::DefaultFuchsiaResourceDialect,
8481            >,
8482            offset: usize,
8483            depth: fidl::encoding::Depth,
8484        ) -> fidl::Result<()> {
8485            encoder.debug_check_bounds::<SuiteArtifact>(offset);
8486            // Zero out padding regions. There's no need to apply masks
8487            // because the unmasked parts will be overwritten by fields.
8488            // Write the fields.
8489            self.0.encode(encoder, offset + 0, depth)?;
8490            Ok(())
8491        }
8492    }
8493
8494    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for SuiteArtifact {
8495        #[inline(always)]
8496        fn new_empty() -> Self {
8497            Self {
8498                artifact: fidl::new_empty!(Artifact, fidl::encoding::DefaultFuchsiaResourceDialect),
8499            }
8500        }
8501
8502        #[inline]
8503        unsafe fn decode(
8504            &mut self,
8505            decoder: &mut fidl::encoding::Decoder<
8506                '_,
8507                fidl::encoding::DefaultFuchsiaResourceDialect,
8508            >,
8509            offset: usize,
8510            _depth: fidl::encoding::Depth,
8511        ) -> fidl::Result<()> {
8512            decoder.debug_check_bounds::<Self>(offset);
8513            // Verify that padding bytes are zero.
8514            fidl::decode!(
8515                Artifact,
8516                fidl::encoding::DefaultFuchsiaResourceDialect,
8517                &mut self.artifact,
8518                decoder,
8519                offset + 0,
8520                _depth
8521            )?;
8522            Ok(())
8523        }
8524    }
8525
8526    impl fidl::encoding::ResourceTypeMarker for SuiteControllerGetEventsResponse {
8527        type Borrowed<'a> = &'a mut Self;
8528        fn take_or_borrow<'a>(
8529            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8530        ) -> Self::Borrowed<'a> {
8531            value
8532        }
8533    }
8534
8535    unsafe impl fidl::encoding::TypeMarker for SuiteControllerGetEventsResponse {
8536        type Owned = Self;
8537
8538        #[inline(always)]
8539        fn inline_align(_context: fidl::encoding::Context) -> usize {
8540            8
8541        }
8542
8543        #[inline(always)]
8544        fn inline_size(_context: fidl::encoding::Context) -> usize {
8545            16
8546        }
8547    }
8548
8549    unsafe impl
8550        fidl::encoding::Encode<
8551            SuiteControllerGetEventsResponse,
8552            fidl::encoding::DefaultFuchsiaResourceDialect,
8553        > for &mut SuiteControllerGetEventsResponse
8554    {
8555        #[inline]
8556        unsafe fn encode(
8557            self,
8558            encoder: &mut fidl::encoding::Encoder<
8559                '_,
8560                fidl::encoding::DefaultFuchsiaResourceDialect,
8561            >,
8562            offset: usize,
8563            _depth: fidl::encoding::Depth,
8564        ) -> fidl::Result<()> {
8565            encoder.debug_check_bounds::<SuiteControllerGetEventsResponse>(offset);
8566            // Delegate to tuple encoding.
8567            fidl::encoding::Encode::<SuiteControllerGetEventsResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8568                (
8569                    <fidl::encoding::UnboundedVector<SuiteEvent> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
8570                ),
8571                encoder, offset, _depth
8572            )
8573        }
8574    }
8575    unsafe impl<
8576        T0: fidl::encoding::Encode<
8577                fidl::encoding::UnboundedVector<SuiteEvent>,
8578                fidl::encoding::DefaultFuchsiaResourceDialect,
8579            >,
8580    >
8581        fidl::encoding::Encode<
8582            SuiteControllerGetEventsResponse,
8583            fidl::encoding::DefaultFuchsiaResourceDialect,
8584        > for (T0,)
8585    {
8586        #[inline]
8587        unsafe fn encode(
8588            self,
8589            encoder: &mut fidl::encoding::Encoder<
8590                '_,
8591                fidl::encoding::DefaultFuchsiaResourceDialect,
8592            >,
8593            offset: usize,
8594            depth: fidl::encoding::Depth,
8595        ) -> fidl::Result<()> {
8596            encoder.debug_check_bounds::<SuiteControllerGetEventsResponse>(offset);
8597            // Zero out padding regions. There's no need to apply masks
8598            // because the unmasked parts will be overwritten by fields.
8599            // Write the fields.
8600            self.0.encode(encoder, offset + 0, depth)?;
8601            Ok(())
8602        }
8603    }
8604
8605    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8606        for SuiteControllerGetEventsResponse
8607    {
8608        #[inline(always)]
8609        fn new_empty() -> Self {
8610            Self {
8611                events: fidl::new_empty!(
8612                    fidl::encoding::UnboundedVector<SuiteEvent>,
8613                    fidl::encoding::DefaultFuchsiaResourceDialect
8614                ),
8615            }
8616        }
8617
8618        #[inline]
8619        unsafe fn decode(
8620            &mut self,
8621            decoder: &mut fidl::encoding::Decoder<
8622                '_,
8623                fidl::encoding::DefaultFuchsiaResourceDialect,
8624            >,
8625            offset: usize,
8626            _depth: fidl::encoding::Depth,
8627        ) -> fidl::Result<()> {
8628            decoder.debug_check_bounds::<Self>(offset);
8629            // Verify that padding bytes are zero.
8630            fidl::decode!(
8631                fidl::encoding::UnboundedVector<SuiteEvent>,
8632                fidl::encoding::DefaultFuchsiaResourceDialect,
8633                &mut self.events,
8634                decoder,
8635                offset + 0,
8636                _depth
8637            )?;
8638            Ok(())
8639        }
8640    }
8641
8642    impl fidl::encoding::ResourceTypeMarker for SuiteControllerWatchEventsResponse {
8643        type Borrowed<'a> = &'a mut Self;
8644        fn take_or_borrow<'a>(
8645            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8646        ) -> Self::Borrowed<'a> {
8647            value
8648        }
8649    }
8650
8651    unsafe impl fidl::encoding::TypeMarker for SuiteControllerWatchEventsResponse {
8652        type Owned = Self;
8653
8654        #[inline(always)]
8655        fn inline_align(_context: fidl::encoding::Context) -> usize {
8656            8
8657        }
8658
8659        #[inline(always)]
8660        fn inline_size(_context: fidl::encoding::Context) -> usize {
8661            16
8662        }
8663    }
8664
8665    unsafe impl
8666        fidl::encoding::Encode<
8667            SuiteControllerWatchEventsResponse,
8668            fidl::encoding::DefaultFuchsiaResourceDialect,
8669        > for &mut SuiteControllerWatchEventsResponse
8670    {
8671        #[inline]
8672        unsafe fn encode(
8673            self,
8674            encoder: &mut fidl::encoding::Encoder<
8675                '_,
8676                fidl::encoding::DefaultFuchsiaResourceDialect,
8677            >,
8678            offset: usize,
8679            _depth: fidl::encoding::Depth,
8680        ) -> fidl::Result<()> {
8681            encoder.debug_check_bounds::<SuiteControllerWatchEventsResponse>(offset);
8682            // Delegate to tuple encoding.
8683            fidl::encoding::Encode::<SuiteControllerWatchEventsResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8684                (
8685                    <fidl::encoding::Vector<Event, 1024> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
8686                ),
8687                encoder, offset, _depth
8688            )
8689        }
8690    }
8691    unsafe impl<
8692        T0: fidl::encoding::Encode<
8693                fidl::encoding::Vector<Event, 1024>,
8694                fidl::encoding::DefaultFuchsiaResourceDialect,
8695            >,
8696    >
8697        fidl::encoding::Encode<
8698            SuiteControllerWatchEventsResponse,
8699            fidl::encoding::DefaultFuchsiaResourceDialect,
8700        > for (T0,)
8701    {
8702        #[inline]
8703        unsafe fn encode(
8704            self,
8705            encoder: &mut fidl::encoding::Encoder<
8706                '_,
8707                fidl::encoding::DefaultFuchsiaResourceDialect,
8708            >,
8709            offset: usize,
8710            depth: fidl::encoding::Depth,
8711        ) -> fidl::Result<()> {
8712            encoder.debug_check_bounds::<SuiteControllerWatchEventsResponse>(offset);
8713            // Zero out padding regions. There's no need to apply masks
8714            // because the unmasked parts will be overwritten by fields.
8715            // Write the fields.
8716            self.0.encode(encoder, offset + 0, depth)?;
8717            Ok(())
8718        }
8719    }
8720
8721    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8722        for SuiteControllerWatchEventsResponse
8723    {
8724        #[inline(always)]
8725        fn new_empty() -> Self {
8726            Self {
8727                events: fidl::new_empty!(fidl::encoding::Vector<Event, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect),
8728            }
8729        }
8730
8731        #[inline]
8732        unsafe fn decode(
8733            &mut self,
8734            decoder: &mut fidl::encoding::Decoder<
8735                '_,
8736                fidl::encoding::DefaultFuchsiaResourceDialect,
8737            >,
8738            offset: usize,
8739            _depth: fidl::encoding::Depth,
8740        ) -> fidl::Result<()> {
8741            decoder.debug_check_bounds::<Self>(offset);
8742            // Verify that padding bytes are zero.
8743            fidl::decode!(fidl::encoding::Vector<Event, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.events, decoder, offset + 0, _depth)?;
8744            Ok(())
8745        }
8746    }
8747
8748    impl fidl::encoding::ResourceTypeMarker for SuiteRunnerRunRequest {
8749        type Borrowed<'a> = &'a mut Self;
8750        fn take_or_borrow<'a>(
8751            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8752        ) -> Self::Borrowed<'a> {
8753            value
8754        }
8755    }
8756
8757    unsafe impl fidl::encoding::TypeMarker for SuiteRunnerRunRequest {
8758        type Owned = Self;
8759
8760        #[inline(always)]
8761        fn inline_align(_context: fidl::encoding::Context) -> usize {
8762            8
8763        }
8764
8765        #[inline(always)]
8766        fn inline_size(_context: fidl::encoding::Context) -> usize {
8767            40
8768        }
8769    }
8770
8771    unsafe impl
8772        fidl::encoding::Encode<SuiteRunnerRunRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
8773        for &mut SuiteRunnerRunRequest
8774    {
8775        #[inline]
8776        unsafe fn encode(
8777            self,
8778            encoder: &mut fidl::encoding::Encoder<
8779                '_,
8780                fidl::encoding::DefaultFuchsiaResourceDialect,
8781            >,
8782            offset: usize,
8783            _depth: fidl::encoding::Depth,
8784        ) -> fidl::Result<()> {
8785            encoder.debug_check_bounds::<SuiteRunnerRunRequest>(offset);
8786            // Delegate to tuple encoding.
8787            fidl::encoding::Encode::<SuiteRunnerRunRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8788                (
8789                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_suite_url),
8790                    <RunSuiteOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.options),
8791                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
8792                ),
8793                encoder, offset, _depth
8794            )
8795        }
8796    }
8797    unsafe impl<
8798        T0: fidl::encoding::Encode<
8799                fidl::encoding::BoundedString<4096>,
8800                fidl::encoding::DefaultFuchsiaResourceDialect,
8801            >,
8802        T1: fidl::encoding::Encode<RunSuiteOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
8803        T2: fidl::encoding::Encode<
8804                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
8805                fidl::encoding::DefaultFuchsiaResourceDialect,
8806            >,
8807    >
8808        fidl::encoding::Encode<SuiteRunnerRunRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
8809        for (T0, T1, T2)
8810    {
8811        #[inline]
8812        unsafe fn encode(
8813            self,
8814            encoder: &mut fidl::encoding::Encoder<
8815                '_,
8816                fidl::encoding::DefaultFuchsiaResourceDialect,
8817            >,
8818            offset: usize,
8819            depth: fidl::encoding::Depth,
8820        ) -> fidl::Result<()> {
8821            encoder.debug_check_bounds::<SuiteRunnerRunRequest>(offset);
8822            // Zero out padding regions. There's no need to apply masks
8823            // because the unmasked parts will be overwritten by fields.
8824            unsafe {
8825                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
8826                (ptr as *mut u64).write_unaligned(0);
8827            }
8828            // Write the fields.
8829            self.0.encode(encoder, offset + 0, depth)?;
8830            self.1.encode(encoder, offset + 16, depth)?;
8831            self.2.encode(encoder, offset + 32, depth)?;
8832            Ok(())
8833        }
8834    }
8835
8836    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8837        for SuiteRunnerRunRequest
8838    {
8839        #[inline(always)]
8840        fn new_empty() -> Self {
8841            Self {
8842                test_suite_url: fidl::new_empty!(
8843                    fidl::encoding::BoundedString<4096>,
8844                    fidl::encoding::DefaultFuchsiaResourceDialect
8845                ),
8846                options: fidl::new_empty!(
8847                    RunSuiteOptions,
8848                    fidl::encoding::DefaultFuchsiaResourceDialect
8849                ),
8850                controller: fidl::new_empty!(
8851                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
8852                    fidl::encoding::DefaultFuchsiaResourceDialect
8853                ),
8854            }
8855        }
8856
8857        #[inline]
8858        unsafe fn decode(
8859            &mut self,
8860            decoder: &mut fidl::encoding::Decoder<
8861                '_,
8862                fidl::encoding::DefaultFuchsiaResourceDialect,
8863            >,
8864            offset: usize,
8865            _depth: fidl::encoding::Depth,
8866        ) -> fidl::Result<()> {
8867            decoder.debug_check_bounds::<Self>(offset);
8868            // Verify that padding bytes are zero.
8869            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
8870            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8871            let mask = 0xffffffff00000000u64;
8872            let maskedval = padval & mask;
8873            if maskedval != 0 {
8874                return Err(fidl::Error::NonZeroPadding {
8875                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
8876                });
8877            }
8878            fidl::decode!(
8879                fidl::encoding::BoundedString<4096>,
8880                fidl::encoding::DefaultFuchsiaResourceDialect,
8881                &mut self.test_suite_url,
8882                decoder,
8883                offset + 0,
8884                _depth
8885            )?;
8886            fidl::decode!(
8887                RunSuiteOptions,
8888                fidl::encoding::DefaultFuchsiaResourceDialect,
8889                &mut self.options,
8890                decoder,
8891                offset + 16,
8892                _depth
8893            )?;
8894            fidl::decode!(
8895                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
8896                fidl::encoding::DefaultFuchsiaResourceDialect,
8897                &mut self.controller,
8898                decoder,
8899                offset + 32,
8900                _depth
8901            )?;
8902            Ok(())
8903        }
8904    }
8905
8906    impl fidl::encoding::ResourceTypeMarker for TestCaseEnumeratorEnumerateRequest {
8907        type Borrowed<'a> = &'a mut Self;
8908        fn take_or_borrow<'a>(
8909            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8910        ) -> Self::Borrowed<'a> {
8911            value
8912        }
8913    }
8914
8915    unsafe impl fidl::encoding::TypeMarker for TestCaseEnumeratorEnumerateRequest {
8916        type Owned = Self;
8917
8918        #[inline(always)]
8919        fn inline_align(_context: fidl::encoding::Context) -> usize {
8920            8
8921        }
8922
8923        #[inline(always)]
8924        fn inline_size(_context: fidl::encoding::Context) -> usize {
8925            40
8926        }
8927    }
8928
8929    unsafe impl
8930        fidl::encoding::Encode<
8931            TestCaseEnumeratorEnumerateRequest,
8932            fidl::encoding::DefaultFuchsiaResourceDialect,
8933        > for &mut TestCaseEnumeratorEnumerateRequest
8934    {
8935        #[inline]
8936        unsafe fn encode(
8937            self,
8938            encoder: &mut fidl::encoding::Encoder<
8939                '_,
8940                fidl::encoding::DefaultFuchsiaResourceDialect,
8941            >,
8942            offset: usize,
8943            _depth: fidl::encoding::Depth,
8944        ) -> fidl::Result<()> {
8945            encoder.debug_check_bounds::<TestCaseEnumeratorEnumerateRequest>(offset);
8946            // Delegate to tuple encoding.
8947            fidl::encoding::Encode::<TestCaseEnumeratorEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8948                (
8949                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_suite_url),
8950                    <EnumerateTestCasesOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.options),
8951                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
8952                ),
8953                encoder, offset, _depth
8954            )
8955        }
8956    }
8957    unsafe impl<
8958        T0: fidl::encoding::Encode<
8959                fidl::encoding::BoundedString<4096>,
8960                fidl::encoding::DefaultFuchsiaResourceDialect,
8961            >,
8962        T1: fidl::encoding::Encode<
8963                EnumerateTestCasesOptions,
8964                fidl::encoding::DefaultFuchsiaResourceDialect,
8965            >,
8966        T2: fidl::encoding::Encode<
8967                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>>,
8968                fidl::encoding::DefaultFuchsiaResourceDialect,
8969            >,
8970    >
8971        fidl::encoding::Encode<
8972            TestCaseEnumeratorEnumerateRequest,
8973            fidl::encoding::DefaultFuchsiaResourceDialect,
8974        > for (T0, T1, T2)
8975    {
8976        #[inline]
8977        unsafe fn encode(
8978            self,
8979            encoder: &mut fidl::encoding::Encoder<
8980                '_,
8981                fidl::encoding::DefaultFuchsiaResourceDialect,
8982            >,
8983            offset: usize,
8984            depth: fidl::encoding::Depth,
8985        ) -> fidl::Result<()> {
8986            encoder.debug_check_bounds::<TestCaseEnumeratorEnumerateRequest>(offset);
8987            // Zero out padding regions. There's no need to apply masks
8988            // because the unmasked parts will be overwritten by fields.
8989            unsafe {
8990                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
8991                (ptr as *mut u64).write_unaligned(0);
8992            }
8993            // Write the fields.
8994            self.0.encode(encoder, offset + 0, depth)?;
8995            self.1.encode(encoder, offset + 16, depth)?;
8996            self.2.encode(encoder, offset + 32, depth)?;
8997            Ok(())
8998        }
8999    }
9000
9001    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9002        for TestCaseEnumeratorEnumerateRequest
9003    {
9004        #[inline(always)]
9005        fn new_empty() -> Self {
9006            Self {
9007                test_suite_url: fidl::new_empty!(
9008                    fidl::encoding::BoundedString<4096>,
9009                    fidl::encoding::DefaultFuchsiaResourceDialect
9010                ),
9011                options: fidl::new_empty!(
9012                    EnumerateTestCasesOptions,
9013                    fidl::encoding::DefaultFuchsiaResourceDialect
9014                ),
9015                iterator: fidl::new_empty!(
9016                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>>,
9017                    fidl::encoding::DefaultFuchsiaResourceDialect
9018                ),
9019            }
9020        }
9021
9022        #[inline]
9023        unsafe fn decode(
9024            &mut self,
9025            decoder: &mut fidl::encoding::Decoder<
9026                '_,
9027                fidl::encoding::DefaultFuchsiaResourceDialect,
9028            >,
9029            offset: usize,
9030            _depth: fidl::encoding::Depth,
9031        ) -> fidl::Result<()> {
9032            decoder.debug_check_bounds::<Self>(offset);
9033            // Verify that padding bytes are zero.
9034            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
9035            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9036            let mask = 0xffffffff00000000u64;
9037            let maskedval = padval & mask;
9038            if maskedval != 0 {
9039                return Err(fidl::Error::NonZeroPadding {
9040                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
9041                });
9042            }
9043            fidl::decode!(
9044                fidl::encoding::BoundedString<4096>,
9045                fidl::encoding::DefaultFuchsiaResourceDialect,
9046                &mut self.test_suite_url,
9047                decoder,
9048                offset + 0,
9049                _depth
9050            )?;
9051            fidl::decode!(
9052                EnumerateTestCasesOptions,
9053                fidl::encoding::DefaultFuchsiaResourceDialect,
9054                &mut self.options,
9055                decoder,
9056                offset + 16,
9057                _depth
9058            )?;
9059            fidl::decode!(
9060                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>>,
9061                fidl::encoding::DefaultFuchsiaResourceDialect,
9062                &mut self.iterator,
9063                decoder,
9064                offset + 32,
9065                _depth
9066            )?;
9067            Ok(())
9068        }
9069    }
9070
9071    impl CustomArtifact {
9072        #[inline(always)]
9073        fn max_ordinal_present(&self) -> u64 {
9074            if let Some(_) = self.directory_and_token {
9075                return 2;
9076            }
9077            if let Some(_) = self.component_moniker {
9078                return 1;
9079            }
9080            0
9081        }
9082    }
9083
9084    impl fidl::encoding::ResourceTypeMarker for CustomArtifact {
9085        type Borrowed<'a> = &'a mut Self;
9086        fn take_or_borrow<'a>(
9087            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9088        ) -> Self::Borrowed<'a> {
9089            value
9090        }
9091    }
9092
9093    unsafe impl fidl::encoding::TypeMarker for CustomArtifact {
9094        type Owned = Self;
9095
9096        #[inline(always)]
9097        fn inline_align(_context: fidl::encoding::Context) -> usize {
9098            8
9099        }
9100
9101        #[inline(always)]
9102        fn inline_size(_context: fidl::encoding::Context) -> usize {
9103            16
9104        }
9105    }
9106
9107    unsafe impl
9108        fidl::encoding::Encode<CustomArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
9109        for &mut CustomArtifact
9110    {
9111        unsafe fn encode(
9112            self,
9113            encoder: &mut fidl::encoding::Encoder<
9114                '_,
9115                fidl::encoding::DefaultFuchsiaResourceDialect,
9116            >,
9117            offset: usize,
9118            mut depth: fidl::encoding::Depth,
9119        ) -> fidl::Result<()> {
9120            encoder.debug_check_bounds::<CustomArtifact>(offset);
9121            // Vector header
9122            let max_ordinal: u64 = self.max_ordinal_present();
9123            encoder.write_num(max_ordinal, offset);
9124            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9125            // Calling encoder.out_of_line_offset(0) is not allowed.
9126            if max_ordinal == 0 {
9127                return Ok(());
9128            }
9129            depth.increment()?;
9130            let envelope_size = 8;
9131            let bytes_len = max_ordinal as usize * envelope_size;
9132            #[allow(unused_variables)]
9133            let offset = encoder.out_of_line_offset(bytes_len);
9134            let mut _prev_end_offset: usize = 0;
9135            if 1 > max_ordinal {
9136                return Ok(());
9137            }
9138
9139            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9140            // are envelope_size bytes.
9141            let cur_offset: usize = (1 - 1) * envelope_size;
9142
9143            // Zero reserved fields.
9144            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9145
9146            // Safety:
9147            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9148            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9149            //   envelope_size bytes, there is always sufficient room.
9150            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, fidl::encoding::DefaultFuchsiaResourceDialect>(
9151            self.component_moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
9152            encoder, offset + cur_offset, depth
9153        )?;
9154
9155            _prev_end_offset = cur_offset + envelope_size;
9156            if 2 > max_ordinal {
9157                return Ok(());
9158            }
9159
9160            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9161            // are envelope_size bytes.
9162            let cur_offset: usize = (2 - 1) * envelope_size;
9163
9164            // Zero reserved fields.
9165            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9166
9167            // Safety:
9168            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9169            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9170            //   envelope_size bytes, there is always sufficient room.
9171            fidl::encoding::encode_in_envelope_optional::<
9172                DirectoryAndToken,
9173                fidl::encoding::DefaultFuchsiaResourceDialect,
9174            >(
9175                self.directory_and_token
9176                    .as_mut()
9177                    .map(<DirectoryAndToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9178                encoder,
9179                offset + cur_offset,
9180                depth,
9181            )?;
9182
9183            _prev_end_offset = cur_offset + envelope_size;
9184
9185            Ok(())
9186        }
9187    }
9188
9189    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9190        for CustomArtifact
9191    {
9192        #[inline(always)]
9193        fn new_empty() -> Self {
9194            Self::default()
9195        }
9196
9197        unsafe fn decode(
9198            &mut self,
9199            decoder: &mut fidl::encoding::Decoder<
9200                '_,
9201                fidl::encoding::DefaultFuchsiaResourceDialect,
9202            >,
9203            offset: usize,
9204            mut depth: fidl::encoding::Depth,
9205        ) -> fidl::Result<()> {
9206            decoder.debug_check_bounds::<Self>(offset);
9207            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9208                None => return Err(fidl::Error::NotNullable),
9209                Some(len) => len,
9210            };
9211            // Calling decoder.out_of_line_offset(0) is not allowed.
9212            if len == 0 {
9213                return Ok(());
9214            };
9215            depth.increment()?;
9216            let envelope_size = 8;
9217            let bytes_len = len * envelope_size;
9218            let offset = decoder.out_of_line_offset(bytes_len)?;
9219            // Decode the envelope for each type.
9220            let mut _next_ordinal_to_read = 0;
9221            let mut next_offset = offset;
9222            let end_offset = offset + bytes_len;
9223            _next_ordinal_to_read += 1;
9224            if next_offset >= end_offset {
9225                return Ok(());
9226            }
9227
9228            // Decode unknown envelopes for gaps in ordinals.
9229            while _next_ordinal_to_read < 1 {
9230                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9231                _next_ordinal_to_read += 1;
9232                next_offset += envelope_size;
9233            }
9234
9235            let next_out_of_line = decoder.next_out_of_line();
9236            let handles_before = decoder.remaining_handles();
9237            if let Some((inlined, num_bytes, num_handles)) =
9238                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9239            {
9240                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9241                if inlined != (member_inline_size <= 4) {
9242                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9243                }
9244                let inner_offset;
9245                let mut inner_depth = depth.clone();
9246                if inlined {
9247                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9248                    inner_offset = next_offset;
9249                } else {
9250                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9251                    inner_depth.increment()?;
9252                }
9253                let val_ref = self.component_moniker.get_or_insert_with(|| {
9254                    fidl::new_empty!(
9255                        fidl::encoding::BoundedString<4096>,
9256                        fidl::encoding::DefaultFuchsiaResourceDialect
9257                    )
9258                });
9259                fidl::decode!(
9260                    fidl::encoding::BoundedString<4096>,
9261                    fidl::encoding::DefaultFuchsiaResourceDialect,
9262                    val_ref,
9263                    decoder,
9264                    inner_offset,
9265                    inner_depth
9266                )?;
9267                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9268                {
9269                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9270                }
9271                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9272                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9273                }
9274            }
9275
9276            next_offset += envelope_size;
9277            _next_ordinal_to_read += 1;
9278            if next_offset >= end_offset {
9279                return Ok(());
9280            }
9281
9282            // Decode unknown envelopes for gaps in ordinals.
9283            while _next_ordinal_to_read < 2 {
9284                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9285                _next_ordinal_to_read += 1;
9286                next_offset += envelope_size;
9287            }
9288
9289            let next_out_of_line = decoder.next_out_of_line();
9290            let handles_before = decoder.remaining_handles();
9291            if let Some((inlined, num_bytes, num_handles)) =
9292                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9293            {
9294                let member_inline_size =
9295                    <DirectoryAndToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9296                if inlined != (member_inline_size <= 4) {
9297                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9298                }
9299                let inner_offset;
9300                let mut inner_depth = depth.clone();
9301                if inlined {
9302                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9303                    inner_offset = next_offset;
9304                } else {
9305                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9306                    inner_depth.increment()?;
9307                }
9308                let val_ref = self.directory_and_token.get_or_insert_with(|| {
9309                    fidl::new_empty!(
9310                        DirectoryAndToken,
9311                        fidl::encoding::DefaultFuchsiaResourceDialect
9312                    )
9313                });
9314                fidl::decode!(
9315                    DirectoryAndToken,
9316                    fidl::encoding::DefaultFuchsiaResourceDialect,
9317                    val_ref,
9318                    decoder,
9319                    inner_offset,
9320                    inner_depth
9321                )?;
9322                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9323                {
9324                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9325                }
9326                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9327                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9328                }
9329            }
9330
9331            next_offset += envelope_size;
9332
9333            // Decode the remaining unknown envelopes.
9334            while next_offset < end_offset {
9335                _next_ordinal_to_read += 1;
9336                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9337                next_offset += envelope_size;
9338            }
9339
9340            Ok(())
9341        }
9342    }
9343
9344    impl DebugData {
9345        #[inline(always)]
9346        fn max_ordinal_present(&self) -> u64 {
9347            if let Some(_) = self.socket {
9348                return 2;
9349            }
9350            if let Some(_) = self.name {
9351                return 1;
9352            }
9353            0
9354        }
9355    }
9356
9357    impl fidl::encoding::ResourceTypeMarker for DebugData {
9358        type Borrowed<'a> = &'a mut Self;
9359        fn take_or_borrow<'a>(
9360            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9361        ) -> Self::Borrowed<'a> {
9362            value
9363        }
9364    }
9365
9366    unsafe impl fidl::encoding::TypeMarker for DebugData {
9367        type Owned = Self;
9368
9369        #[inline(always)]
9370        fn inline_align(_context: fidl::encoding::Context) -> usize {
9371            8
9372        }
9373
9374        #[inline(always)]
9375        fn inline_size(_context: fidl::encoding::Context) -> usize {
9376            16
9377        }
9378    }
9379
9380    unsafe impl fidl::encoding::Encode<DebugData, fidl::encoding::DefaultFuchsiaResourceDialect>
9381        for &mut DebugData
9382    {
9383        unsafe fn encode(
9384            self,
9385            encoder: &mut fidl::encoding::Encoder<
9386                '_,
9387                fidl::encoding::DefaultFuchsiaResourceDialect,
9388            >,
9389            offset: usize,
9390            mut depth: fidl::encoding::Depth,
9391        ) -> fidl::Result<()> {
9392            encoder.debug_check_bounds::<DebugData>(offset);
9393            // Vector header
9394            let max_ordinal: u64 = self.max_ordinal_present();
9395            encoder.write_num(max_ordinal, offset);
9396            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9397            // Calling encoder.out_of_line_offset(0) is not allowed.
9398            if max_ordinal == 0 {
9399                return Ok(());
9400            }
9401            depth.increment()?;
9402            let envelope_size = 8;
9403            let bytes_len = max_ordinal as usize * envelope_size;
9404            #[allow(unused_variables)]
9405            let offset = encoder.out_of_line_offset(bytes_len);
9406            let mut _prev_end_offset: usize = 0;
9407            if 1 > max_ordinal {
9408                return Ok(());
9409            }
9410
9411            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9412            // are envelope_size bytes.
9413            let cur_offset: usize = (1 - 1) * envelope_size;
9414
9415            // Zero reserved fields.
9416            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9417
9418            // Safety:
9419            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9420            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9421            //   envelope_size bytes, there is always sufficient room.
9422            fidl::encoding::encode_in_envelope_optional::<
9423                fidl::encoding::BoundedString<512>,
9424                fidl::encoding::DefaultFuchsiaResourceDialect,
9425            >(
9426                self.name.as_ref().map(
9427                    <fidl::encoding::BoundedString<512> as fidl::encoding::ValueTypeMarker>::borrow,
9428                ),
9429                encoder,
9430                offset + cur_offset,
9431                depth,
9432            )?;
9433
9434            _prev_end_offset = cur_offset + envelope_size;
9435            if 2 > max_ordinal {
9436                return Ok(());
9437            }
9438
9439            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9440            // are envelope_size bytes.
9441            let cur_offset: usize = (2 - 1) * envelope_size;
9442
9443            // Zero reserved fields.
9444            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9445
9446            // Safety:
9447            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9448            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9449            //   envelope_size bytes, there is always sufficient room.
9450            fidl::encoding::encode_in_envelope_optional::<
9451                fidl::encoding::HandleType<
9452                    fidl::Socket,
9453                    { fidl::ObjectType::SOCKET.into_raw() },
9454                    2147483648,
9455                >,
9456                fidl::encoding::DefaultFuchsiaResourceDialect,
9457            >(
9458                self.socket.as_mut().map(
9459                    <fidl::encoding::HandleType<
9460                        fidl::Socket,
9461                        { fidl::ObjectType::SOCKET.into_raw() },
9462                        2147483648,
9463                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
9464                ),
9465                encoder,
9466                offset + cur_offset,
9467                depth,
9468            )?;
9469
9470            _prev_end_offset = cur_offset + envelope_size;
9471
9472            Ok(())
9473        }
9474    }
9475
9476    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DebugData {
9477        #[inline(always)]
9478        fn new_empty() -> Self {
9479            Self::default()
9480        }
9481
9482        unsafe fn decode(
9483            &mut self,
9484            decoder: &mut fidl::encoding::Decoder<
9485                '_,
9486                fidl::encoding::DefaultFuchsiaResourceDialect,
9487            >,
9488            offset: usize,
9489            mut depth: fidl::encoding::Depth,
9490        ) -> fidl::Result<()> {
9491            decoder.debug_check_bounds::<Self>(offset);
9492            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9493                None => return Err(fidl::Error::NotNullable),
9494                Some(len) => len,
9495            };
9496            // Calling decoder.out_of_line_offset(0) is not allowed.
9497            if len == 0 {
9498                return Ok(());
9499            };
9500            depth.increment()?;
9501            let envelope_size = 8;
9502            let bytes_len = len * envelope_size;
9503            let offset = decoder.out_of_line_offset(bytes_len)?;
9504            // Decode the envelope for each type.
9505            let mut _next_ordinal_to_read = 0;
9506            let mut next_offset = offset;
9507            let end_offset = offset + bytes_len;
9508            _next_ordinal_to_read += 1;
9509            if next_offset >= end_offset {
9510                return Ok(());
9511            }
9512
9513            // Decode unknown envelopes for gaps in ordinals.
9514            while _next_ordinal_to_read < 1 {
9515                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9516                _next_ordinal_to_read += 1;
9517                next_offset += envelope_size;
9518            }
9519
9520            let next_out_of_line = decoder.next_out_of_line();
9521            let handles_before = decoder.remaining_handles();
9522            if let Some((inlined, num_bytes, num_handles)) =
9523                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9524            {
9525                let member_inline_size =
9526                    <fidl::encoding::BoundedString<512> as fidl::encoding::TypeMarker>::inline_size(
9527                        decoder.context,
9528                    );
9529                if inlined != (member_inline_size <= 4) {
9530                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9531                }
9532                let inner_offset;
9533                let mut inner_depth = depth.clone();
9534                if inlined {
9535                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9536                    inner_offset = next_offset;
9537                } else {
9538                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9539                    inner_depth.increment()?;
9540                }
9541                let val_ref = self.name.get_or_insert_with(|| {
9542                    fidl::new_empty!(
9543                        fidl::encoding::BoundedString<512>,
9544                        fidl::encoding::DefaultFuchsiaResourceDialect
9545                    )
9546                });
9547                fidl::decode!(
9548                    fidl::encoding::BoundedString<512>,
9549                    fidl::encoding::DefaultFuchsiaResourceDialect,
9550                    val_ref,
9551                    decoder,
9552                    inner_offset,
9553                    inner_depth
9554                )?;
9555                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9556                {
9557                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9558                }
9559                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9560                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9561                }
9562            }
9563
9564            next_offset += envelope_size;
9565            _next_ordinal_to_read += 1;
9566            if next_offset >= end_offset {
9567                return Ok(());
9568            }
9569
9570            // Decode unknown envelopes for gaps in ordinals.
9571            while _next_ordinal_to_read < 2 {
9572                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9573                _next_ordinal_to_read += 1;
9574                next_offset += envelope_size;
9575            }
9576
9577            let next_out_of_line = decoder.next_out_of_line();
9578            let handles_before = decoder.remaining_handles();
9579            if let Some((inlined, num_bytes, num_handles)) =
9580                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9581            {
9582                let member_inline_size = <fidl::encoding::HandleType<
9583                    fidl::Socket,
9584                    { fidl::ObjectType::SOCKET.into_raw() },
9585                    2147483648,
9586                > as fidl::encoding::TypeMarker>::inline_size(
9587                    decoder.context
9588                );
9589                if inlined != (member_inline_size <= 4) {
9590                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9591                }
9592                let inner_offset;
9593                let mut inner_depth = depth.clone();
9594                if inlined {
9595                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9596                    inner_offset = next_offset;
9597                } else {
9598                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9599                    inner_depth.increment()?;
9600                }
9601                let val_ref =
9602                self.socket.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
9603                fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
9604                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9605                {
9606                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9607                }
9608                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9609                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9610                }
9611            }
9612
9613            next_offset += envelope_size;
9614
9615            // Decode the remaining unknown envelopes.
9616            while next_offset < end_offset {
9617                _next_ordinal_to_read += 1;
9618                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9619                next_offset += envelope_size;
9620            }
9621
9622            Ok(())
9623        }
9624    }
9625
9626    impl EnumerateTestCasesOptions {
9627        #[inline(always)]
9628        fn max_ordinal_present(&self) -> u64 {
9629            if let Some(_) = self.realm_options {
9630                return 1;
9631            }
9632            0
9633        }
9634    }
9635
9636    impl fidl::encoding::ResourceTypeMarker for EnumerateTestCasesOptions {
9637        type Borrowed<'a> = &'a mut Self;
9638        fn take_or_borrow<'a>(
9639            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9640        ) -> Self::Borrowed<'a> {
9641            value
9642        }
9643    }
9644
9645    unsafe impl fidl::encoding::TypeMarker for EnumerateTestCasesOptions {
9646        type Owned = Self;
9647
9648        #[inline(always)]
9649        fn inline_align(_context: fidl::encoding::Context) -> usize {
9650            8
9651        }
9652
9653        #[inline(always)]
9654        fn inline_size(_context: fidl::encoding::Context) -> usize {
9655            16
9656        }
9657    }
9658
9659    unsafe impl
9660        fidl::encoding::Encode<
9661            EnumerateTestCasesOptions,
9662            fidl::encoding::DefaultFuchsiaResourceDialect,
9663        > for &mut EnumerateTestCasesOptions
9664    {
9665        unsafe fn encode(
9666            self,
9667            encoder: &mut fidl::encoding::Encoder<
9668                '_,
9669                fidl::encoding::DefaultFuchsiaResourceDialect,
9670            >,
9671            offset: usize,
9672            mut depth: fidl::encoding::Depth,
9673        ) -> fidl::Result<()> {
9674            encoder.debug_check_bounds::<EnumerateTestCasesOptions>(offset);
9675            // Vector header
9676            let max_ordinal: u64 = self.max_ordinal_present();
9677            encoder.write_num(max_ordinal, offset);
9678            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9679            // Calling encoder.out_of_line_offset(0) is not allowed.
9680            if max_ordinal == 0 {
9681                return Ok(());
9682            }
9683            depth.increment()?;
9684            let envelope_size = 8;
9685            let bytes_len = max_ordinal as usize * envelope_size;
9686            #[allow(unused_variables)]
9687            let offset = encoder.out_of_line_offset(bytes_len);
9688            let mut _prev_end_offset: usize = 0;
9689            if 1 > max_ordinal {
9690                return Ok(());
9691            }
9692
9693            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9694            // are envelope_size bytes.
9695            let cur_offset: usize = (1 - 1) * envelope_size;
9696
9697            // Zero reserved fields.
9698            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9699
9700            // Safety:
9701            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9702            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9703            //   envelope_size bytes, there is always sufficient room.
9704            fidl::encoding::encode_in_envelope_optional::<
9705                RealmOptions,
9706                fidl::encoding::DefaultFuchsiaResourceDialect,
9707            >(
9708                self.realm_options
9709                    .as_mut()
9710                    .map(<RealmOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9711                encoder,
9712                offset + cur_offset,
9713                depth,
9714            )?;
9715
9716            _prev_end_offset = cur_offset + envelope_size;
9717
9718            Ok(())
9719        }
9720    }
9721
9722    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9723        for EnumerateTestCasesOptions
9724    {
9725        #[inline(always)]
9726        fn new_empty() -> Self {
9727            Self::default()
9728        }
9729
9730        unsafe fn decode(
9731            &mut self,
9732            decoder: &mut fidl::encoding::Decoder<
9733                '_,
9734                fidl::encoding::DefaultFuchsiaResourceDialect,
9735            >,
9736            offset: usize,
9737            mut depth: fidl::encoding::Depth,
9738        ) -> fidl::Result<()> {
9739            decoder.debug_check_bounds::<Self>(offset);
9740            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9741                None => return Err(fidl::Error::NotNullable),
9742                Some(len) => len,
9743            };
9744            // Calling decoder.out_of_line_offset(0) is not allowed.
9745            if len == 0 {
9746                return Ok(());
9747            };
9748            depth.increment()?;
9749            let envelope_size = 8;
9750            let bytes_len = len * envelope_size;
9751            let offset = decoder.out_of_line_offset(bytes_len)?;
9752            // Decode the envelope for each type.
9753            let mut _next_ordinal_to_read = 0;
9754            let mut next_offset = offset;
9755            let end_offset = offset + bytes_len;
9756            _next_ordinal_to_read += 1;
9757            if next_offset >= end_offset {
9758                return Ok(());
9759            }
9760
9761            // Decode unknown envelopes for gaps in ordinals.
9762            while _next_ordinal_to_read < 1 {
9763                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9764                _next_ordinal_to_read += 1;
9765                next_offset += envelope_size;
9766            }
9767
9768            let next_out_of_line = decoder.next_out_of_line();
9769            let handles_before = decoder.remaining_handles();
9770            if let Some((inlined, num_bytes, num_handles)) =
9771                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9772            {
9773                let member_inline_size =
9774                    <RealmOptions as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9775                if inlined != (member_inline_size <= 4) {
9776                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9777                }
9778                let inner_offset;
9779                let mut inner_depth = depth.clone();
9780                if inlined {
9781                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9782                    inner_offset = next_offset;
9783                } else {
9784                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9785                    inner_depth.increment()?;
9786                }
9787                let val_ref = self.realm_options.get_or_insert_with(|| {
9788                    fidl::new_empty!(RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect)
9789                });
9790                fidl::decode!(
9791                    RealmOptions,
9792                    fidl::encoding::DefaultFuchsiaResourceDialect,
9793                    val_ref,
9794                    decoder,
9795                    inner_offset,
9796                    inner_depth
9797                )?;
9798                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9799                {
9800                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9801                }
9802                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9803                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9804                }
9805            }
9806
9807            next_offset += envelope_size;
9808
9809            // Decode the remaining unknown envelopes.
9810            while next_offset < end_offset {
9811                _next_ordinal_to_read += 1;
9812                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9813                next_offset += envelope_size;
9814            }
9815
9816            Ok(())
9817        }
9818    }
9819
9820    impl Event {
9821        #[inline(always)]
9822        fn max_ordinal_present(&self) -> u64 {
9823            if let Some(_) = self.details {
9824                return 2;
9825            }
9826            if let Some(_) = self.timestamp {
9827                return 1;
9828            }
9829            0
9830        }
9831    }
9832
9833    impl fidl::encoding::ResourceTypeMarker for Event {
9834        type Borrowed<'a> = &'a mut Self;
9835        fn take_or_borrow<'a>(
9836            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9837        ) -> Self::Borrowed<'a> {
9838            value
9839        }
9840    }
9841
9842    unsafe impl fidl::encoding::TypeMarker for Event {
9843        type Owned = Self;
9844
9845        #[inline(always)]
9846        fn inline_align(_context: fidl::encoding::Context) -> usize {
9847            8
9848        }
9849
9850        #[inline(always)]
9851        fn inline_size(_context: fidl::encoding::Context) -> usize {
9852            16
9853        }
9854    }
9855
9856    unsafe impl fidl::encoding::Encode<Event, fidl::encoding::DefaultFuchsiaResourceDialect>
9857        for &mut Event
9858    {
9859        unsafe fn encode(
9860            self,
9861            encoder: &mut fidl::encoding::Encoder<
9862                '_,
9863                fidl::encoding::DefaultFuchsiaResourceDialect,
9864            >,
9865            offset: usize,
9866            mut depth: fidl::encoding::Depth,
9867        ) -> fidl::Result<()> {
9868            encoder.debug_check_bounds::<Event>(offset);
9869            // Vector header
9870            let max_ordinal: u64 = self.max_ordinal_present();
9871            encoder.write_num(max_ordinal, offset);
9872            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9873            // Calling encoder.out_of_line_offset(0) is not allowed.
9874            if max_ordinal == 0 {
9875                return Ok(());
9876            }
9877            depth.increment()?;
9878            let envelope_size = 8;
9879            let bytes_len = max_ordinal as usize * envelope_size;
9880            #[allow(unused_variables)]
9881            let offset = encoder.out_of_line_offset(bytes_len);
9882            let mut _prev_end_offset: usize = 0;
9883            if 1 > max_ordinal {
9884                return Ok(());
9885            }
9886
9887            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9888            // are envelope_size bytes.
9889            let cur_offset: usize = (1 - 1) * envelope_size;
9890
9891            // Zero reserved fields.
9892            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9893
9894            // Safety:
9895            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9896            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9897            //   envelope_size bytes, there is always sufficient room.
9898            fidl::encoding::encode_in_envelope_optional::<
9899                i64,
9900                fidl::encoding::DefaultFuchsiaResourceDialect,
9901            >(
9902                self.timestamp.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
9903                encoder,
9904                offset + cur_offset,
9905                depth,
9906            )?;
9907
9908            _prev_end_offset = cur_offset + envelope_size;
9909            if 2 > max_ordinal {
9910                return Ok(());
9911            }
9912
9913            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9914            // are envelope_size bytes.
9915            let cur_offset: usize = (2 - 1) * envelope_size;
9916
9917            // Zero reserved fields.
9918            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9919
9920            // Safety:
9921            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9922            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9923            //   envelope_size bytes, there is always sufficient room.
9924            fidl::encoding::encode_in_envelope_optional::<
9925                EventDetails,
9926                fidl::encoding::DefaultFuchsiaResourceDialect,
9927            >(
9928                self.details
9929                    .as_mut()
9930                    .map(<EventDetails as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9931                encoder,
9932                offset + cur_offset,
9933                depth,
9934            )?;
9935
9936            _prev_end_offset = cur_offset + envelope_size;
9937
9938            Ok(())
9939        }
9940    }
9941
9942    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Event {
9943        #[inline(always)]
9944        fn new_empty() -> Self {
9945            Self::default()
9946        }
9947
9948        unsafe fn decode(
9949            &mut self,
9950            decoder: &mut fidl::encoding::Decoder<
9951                '_,
9952                fidl::encoding::DefaultFuchsiaResourceDialect,
9953            >,
9954            offset: usize,
9955            mut depth: fidl::encoding::Depth,
9956        ) -> fidl::Result<()> {
9957            decoder.debug_check_bounds::<Self>(offset);
9958            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9959                None => return Err(fidl::Error::NotNullable),
9960                Some(len) => len,
9961            };
9962            // Calling decoder.out_of_line_offset(0) is not allowed.
9963            if len == 0 {
9964                return Ok(());
9965            };
9966            depth.increment()?;
9967            let envelope_size = 8;
9968            let bytes_len = len * envelope_size;
9969            let offset = decoder.out_of_line_offset(bytes_len)?;
9970            // Decode the envelope for each type.
9971            let mut _next_ordinal_to_read = 0;
9972            let mut next_offset = offset;
9973            let end_offset = offset + bytes_len;
9974            _next_ordinal_to_read += 1;
9975            if next_offset >= end_offset {
9976                return Ok(());
9977            }
9978
9979            // Decode unknown envelopes for gaps in ordinals.
9980            while _next_ordinal_to_read < 1 {
9981                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9982                _next_ordinal_to_read += 1;
9983                next_offset += envelope_size;
9984            }
9985
9986            let next_out_of_line = decoder.next_out_of_line();
9987            let handles_before = decoder.remaining_handles();
9988            if let Some((inlined, num_bytes, num_handles)) =
9989                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9990            {
9991                let member_inline_size =
9992                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9993                if inlined != (member_inline_size <= 4) {
9994                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9995                }
9996                let inner_offset;
9997                let mut inner_depth = depth.clone();
9998                if inlined {
9999                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10000                    inner_offset = next_offset;
10001                } else {
10002                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10003                    inner_depth.increment()?;
10004                }
10005                let val_ref = self.timestamp.get_or_insert_with(|| {
10006                    fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
10007                });
10008                fidl::decode!(
10009                    i64,
10010                    fidl::encoding::DefaultFuchsiaResourceDialect,
10011                    val_ref,
10012                    decoder,
10013                    inner_offset,
10014                    inner_depth
10015                )?;
10016                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10017                {
10018                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10019                }
10020                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10021                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10022                }
10023            }
10024
10025            next_offset += envelope_size;
10026            _next_ordinal_to_read += 1;
10027            if next_offset >= end_offset {
10028                return Ok(());
10029            }
10030
10031            // Decode unknown envelopes for gaps in ordinals.
10032            while _next_ordinal_to_read < 2 {
10033                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10034                _next_ordinal_to_read += 1;
10035                next_offset += envelope_size;
10036            }
10037
10038            let next_out_of_line = decoder.next_out_of_line();
10039            let handles_before = decoder.remaining_handles();
10040            if let Some((inlined, num_bytes, num_handles)) =
10041                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10042            {
10043                let member_inline_size =
10044                    <EventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10045                if inlined != (member_inline_size <= 4) {
10046                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10047                }
10048                let inner_offset;
10049                let mut inner_depth = depth.clone();
10050                if inlined {
10051                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10052                    inner_offset = next_offset;
10053                } else {
10054                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10055                    inner_depth.increment()?;
10056                }
10057                let val_ref = self.details.get_or_insert_with(|| {
10058                    fidl::new_empty!(EventDetails, fidl::encoding::DefaultFuchsiaResourceDialect)
10059                });
10060                fidl::decode!(
10061                    EventDetails,
10062                    fidl::encoding::DefaultFuchsiaResourceDialect,
10063                    val_ref,
10064                    decoder,
10065                    inner_offset,
10066                    inner_depth
10067                )?;
10068                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10069                {
10070                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10071                }
10072                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10073                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10074                }
10075            }
10076
10077            next_offset += envelope_size;
10078
10079            // Decode the remaining unknown envelopes.
10080            while next_offset < end_offset {
10081                _next_ordinal_to_read += 1;
10082                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10083                next_offset += envelope_size;
10084            }
10085
10086            Ok(())
10087        }
10088    }
10089
10090    impl RealmOptions {
10091        #[inline(always)]
10092        fn max_ordinal_present(&self) -> u64 {
10093            if let Some(_) = self.test_collection {
10094                return 3;
10095            }
10096            if let Some(_) = self.offers {
10097                return 2;
10098            }
10099            if let Some(_) = self.realm {
10100                return 1;
10101            }
10102            0
10103        }
10104    }
10105
10106    impl fidl::encoding::ResourceTypeMarker for RealmOptions {
10107        type Borrowed<'a> = &'a mut Self;
10108        fn take_or_borrow<'a>(
10109            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10110        ) -> Self::Borrowed<'a> {
10111            value
10112        }
10113    }
10114
10115    unsafe impl fidl::encoding::TypeMarker for RealmOptions {
10116        type Owned = Self;
10117
10118        #[inline(always)]
10119        fn inline_align(_context: fidl::encoding::Context) -> usize {
10120            8
10121        }
10122
10123        #[inline(always)]
10124        fn inline_size(_context: fidl::encoding::Context) -> usize {
10125            16
10126        }
10127    }
10128
10129    unsafe impl fidl::encoding::Encode<RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect>
10130        for &mut RealmOptions
10131    {
10132        unsafe fn encode(
10133            self,
10134            encoder: &mut fidl::encoding::Encoder<
10135                '_,
10136                fidl::encoding::DefaultFuchsiaResourceDialect,
10137            >,
10138            offset: usize,
10139            mut depth: fidl::encoding::Depth,
10140        ) -> fidl::Result<()> {
10141            encoder.debug_check_bounds::<RealmOptions>(offset);
10142            // Vector header
10143            let max_ordinal: u64 = self.max_ordinal_present();
10144            encoder.write_num(max_ordinal, offset);
10145            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10146            // Calling encoder.out_of_line_offset(0) is not allowed.
10147            if max_ordinal == 0 {
10148                return Ok(());
10149            }
10150            depth.increment()?;
10151            let envelope_size = 8;
10152            let bytes_len = max_ordinal as usize * envelope_size;
10153            #[allow(unused_variables)]
10154            let offset = encoder.out_of_line_offset(bytes_len);
10155            let mut _prev_end_offset: usize = 0;
10156            if 1 > max_ordinal {
10157                return Ok(());
10158            }
10159
10160            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10161            // are envelope_size bytes.
10162            let cur_offset: usize = (1 - 1) * envelope_size;
10163
10164            // Zero reserved fields.
10165            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10166
10167            // Safety:
10168            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10169            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10170            //   envelope_size bytes, there is always sufficient room.
10171            fidl::encoding::encode_in_envelope_optional::<
10172                fidl::encoding::Endpoint<
10173                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
10174                >,
10175                fidl::encoding::DefaultFuchsiaResourceDialect,
10176            >(
10177                self.realm.as_mut().map(
10178                    <fidl::encoding::Endpoint<
10179                        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
10180                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
10181                ),
10182                encoder,
10183                offset + cur_offset,
10184                depth,
10185            )?;
10186
10187            _prev_end_offset = cur_offset + envelope_size;
10188            if 2 > max_ordinal {
10189                return Ok(());
10190            }
10191
10192            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10193            // are envelope_size bytes.
10194            let cur_offset: usize = (2 - 1) * envelope_size;
10195
10196            // Zero reserved fields.
10197            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10198
10199            // Safety:
10200            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10201            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10202            //   envelope_size bytes, there is always sufficient room.
10203            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect>(
10204            self.offers.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024> as fidl::encoding::ValueTypeMarker>::borrow),
10205            encoder, offset + cur_offset, depth
10206        )?;
10207
10208            _prev_end_offset = cur_offset + envelope_size;
10209            if 3 > max_ordinal {
10210                return Ok(());
10211            }
10212
10213            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10214            // are envelope_size bytes.
10215            let cur_offset: usize = (3 - 1) * envelope_size;
10216
10217            // Zero reserved fields.
10218            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10219
10220            // Safety:
10221            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10222            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10223            //   envelope_size bytes, there is always sufficient room.
10224            fidl::encoding::encode_in_envelope_optional::<
10225                fidl::encoding::BoundedString<255>,
10226                fidl::encoding::DefaultFuchsiaResourceDialect,
10227            >(
10228                self.test_collection.as_ref().map(
10229                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
10230                ),
10231                encoder,
10232                offset + cur_offset,
10233                depth,
10234            )?;
10235
10236            _prev_end_offset = cur_offset + envelope_size;
10237
10238            Ok(())
10239        }
10240    }
10241
10242    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RealmOptions {
10243        #[inline(always)]
10244        fn new_empty() -> Self {
10245            Self::default()
10246        }
10247
10248        unsafe fn decode(
10249            &mut self,
10250            decoder: &mut fidl::encoding::Decoder<
10251                '_,
10252                fidl::encoding::DefaultFuchsiaResourceDialect,
10253            >,
10254            offset: usize,
10255            mut depth: fidl::encoding::Depth,
10256        ) -> fidl::Result<()> {
10257            decoder.debug_check_bounds::<Self>(offset);
10258            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10259                None => return Err(fidl::Error::NotNullable),
10260                Some(len) => len,
10261            };
10262            // Calling decoder.out_of_line_offset(0) is not allowed.
10263            if len == 0 {
10264                return Ok(());
10265            };
10266            depth.increment()?;
10267            let envelope_size = 8;
10268            let bytes_len = len * envelope_size;
10269            let offset = decoder.out_of_line_offset(bytes_len)?;
10270            // Decode the envelope for each type.
10271            let mut _next_ordinal_to_read = 0;
10272            let mut next_offset = offset;
10273            let end_offset = offset + bytes_len;
10274            _next_ordinal_to_read += 1;
10275            if next_offset >= end_offset {
10276                return Ok(());
10277            }
10278
10279            // Decode unknown envelopes for gaps in ordinals.
10280            while _next_ordinal_to_read < 1 {
10281                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10282                _next_ordinal_to_read += 1;
10283                next_offset += envelope_size;
10284            }
10285
10286            let next_out_of_line = decoder.next_out_of_line();
10287            let handles_before = decoder.remaining_handles();
10288            if let Some((inlined, num_bytes, num_handles)) =
10289                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10290            {
10291                let member_inline_size = <fidl::encoding::Endpoint<
10292                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
10293                > as fidl::encoding::TypeMarker>::inline_size(
10294                    decoder.context
10295                );
10296                if inlined != (member_inline_size <= 4) {
10297                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10298                }
10299                let inner_offset;
10300                let mut inner_depth = depth.clone();
10301                if inlined {
10302                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10303                    inner_offset = next_offset;
10304                } else {
10305                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10306                    inner_depth.increment()?;
10307                }
10308                let val_ref = self.realm.get_or_insert_with(|| {
10309                    fidl::new_empty!(
10310                        fidl::encoding::Endpoint<
10311                            fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
10312                        >,
10313                        fidl::encoding::DefaultFuchsiaResourceDialect
10314                    )
10315                });
10316                fidl::decode!(
10317                    fidl::encoding::Endpoint<
10318                        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
10319                    >,
10320                    fidl::encoding::DefaultFuchsiaResourceDialect,
10321                    val_ref,
10322                    decoder,
10323                    inner_offset,
10324                    inner_depth
10325                )?;
10326                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10327                {
10328                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10329                }
10330                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10331                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10332                }
10333            }
10334
10335            next_offset += envelope_size;
10336            _next_ordinal_to_read += 1;
10337            if next_offset >= end_offset {
10338                return Ok(());
10339            }
10340
10341            // Decode unknown envelopes for gaps in ordinals.
10342            while _next_ordinal_to_read < 2 {
10343                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10344                _next_ordinal_to_read += 1;
10345                next_offset += envelope_size;
10346            }
10347
10348            let next_out_of_line = decoder.next_out_of_line();
10349            let handles_before = decoder.remaining_handles();
10350            if let Some((inlined, num_bytes, num_handles)) =
10351                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10352            {
10353                let member_inline_size = <fidl::encoding::Vector<
10354                    fidl_fuchsia_component_decl::Offer,
10355                    1024,
10356                > as fidl::encoding::TypeMarker>::inline_size(
10357                    decoder.context
10358                );
10359                if inlined != (member_inline_size <= 4) {
10360                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10361                }
10362                let inner_offset;
10363                let mut inner_depth = depth.clone();
10364                if inlined {
10365                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10366                    inner_offset = next_offset;
10367                } else {
10368                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10369                    inner_depth.increment()?;
10370                }
10371                let val_ref =
10372                self.offers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect));
10373                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
10374                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10375                {
10376                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10377                }
10378                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10379                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10380                }
10381            }
10382
10383            next_offset += envelope_size;
10384            _next_ordinal_to_read += 1;
10385            if next_offset >= end_offset {
10386                return Ok(());
10387            }
10388
10389            // Decode unknown envelopes for gaps in ordinals.
10390            while _next_ordinal_to_read < 3 {
10391                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10392                _next_ordinal_to_read += 1;
10393                next_offset += envelope_size;
10394            }
10395
10396            let next_out_of_line = decoder.next_out_of_line();
10397            let handles_before = decoder.remaining_handles();
10398            if let Some((inlined, num_bytes, num_handles)) =
10399                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10400            {
10401                let member_inline_size =
10402                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
10403                        decoder.context,
10404                    );
10405                if inlined != (member_inline_size <= 4) {
10406                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10407                }
10408                let inner_offset;
10409                let mut inner_depth = depth.clone();
10410                if inlined {
10411                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10412                    inner_offset = next_offset;
10413                } else {
10414                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10415                    inner_depth.increment()?;
10416                }
10417                let val_ref = self.test_collection.get_or_insert_with(|| {
10418                    fidl::new_empty!(
10419                        fidl::encoding::BoundedString<255>,
10420                        fidl::encoding::DefaultFuchsiaResourceDialect
10421                    )
10422                });
10423                fidl::decode!(
10424                    fidl::encoding::BoundedString<255>,
10425                    fidl::encoding::DefaultFuchsiaResourceDialect,
10426                    val_ref,
10427                    decoder,
10428                    inner_offset,
10429                    inner_depth
10430                )?;
10431                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10432                {
10433                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10434                }
10435                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10436                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10437                }
10438            }
10439
10440            next_offset += envelope_size;
10441
10442            // Decode the remaining unknown envelopes.
10443            while next_offset < end_offset {
10444                _next_ordinal_to_read += 1;
10445                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10446                next_offset += envelope_size;
10447            }
10448
10449            Ok(())
10450        }
10451    }
10452
10453    impl RunEvent {
10454        #[inline(always)]
10455        fn max_ordinal_present(&self) -> u64 {
10456            if let Some(_) = self.payload {
10457                return 2;
10458            }
10459            if let Some(_) = self.timestamp {
10460                return 1;
10461            }
10462            0
10463        }
10464    }
10465
10466    impl fidl::encoding::ResourceTypeMarker for RunEvent {
10467        type Borrowed<'a> = &'a mut Self;
10468        fn take_or_borrow<'a>(
10469            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10470        ) -> Self::Borrowed<'a> {
10471            value
10472        }
10473    }
10474
10475    unsafe impl fidl::encoding::TypeMarker for RunEvent {
10476        type Owned = Self;
10477
10478        #[inline(always)]
10479        fn inline_align(_context: fidl::encoding::Context) -> usize {
10480            8
10481        }
10482
10483        #[inline(always)]
10484        fn inline_size(_context: fidl::encoding::Context) -> usize {
10485            16
10486        }
10487    }
10488
10489    unsafe impl fidl::encoding::Encode<RunEvent, fidl::encoding::DefaultFuchsiaResourceDialect>
10490        for &mut RunEvent
10491    {
10492        unsafe fn encode(
10493            self,
10494            encoder: &mut fidl::encoding::Encoder<
10495                '_,
10496                fidl::encoding::DefaultFuchsiaResourceDialect,
10497            >,
10498            offset: usize,
10499            mut depth: fidl::encoding::Depth,
10500        ) -> fidl::Result<()> {
10501            encoder.debug_check_bounds::<RunEvent>(offset);
10502            // Vector header
10503            let max_ordinal: u64 = self.max_ordinal_present();
10504            encoder.write_num(max_ordinal, offset);
10505            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10506            // Calling encoder.out_of_line_offset(0) is not allowed.
10507            if max_ordinal == 0 {
10508                return Ok(());
10509            }
10510            depth.increment()?;
10511            let envelope_size = 8;
10512            let bytes_len = max_ordinal as usize * envelope_size;
10513            #[allow(unused_variables)]
10514            let offset = encoder.out_of_line_offset(bytes_len);
10515            let mut _prev_end_offset: usize = 0;
10516            if 1 > max_ordinal {
10517                return Ok(());
10518            }
10519
10520            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10521            // are envelope_size bytes.
10522            let cur_offset: usize = (1 - 1) * envelope_size;
10523
10524            // Zero reserved fields.
10525            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10526
10527            // Safety:
10528            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10529            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10530            //   envelope_size bytes, there is always sufficient room.
10531            fidl::encoding::encode_in_envelope_optional::<
10532                i64,
10533                fidl::encoding::DefaultFuchsiaResourceDialect,
10534            >(
10535                self.timestamp.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
10536                encoder,
10537                offset + cur_offset,
10538                depth,
10539            )?;
10540
10541            _prev_end_offset = cur_offset + envelope_size;
10542            if 2 > max_ordinal {
10543                return Ok(());
10544            }
10545
10546            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10547            // are envelope_size bytes.
10548            let cur_offset: usize = (2 - 1) * envelope_size;
10549
10550            // Zero reserved fields.
10551            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10552
10553            // Safety:
10554            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10555            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10556            //   envelope_size bytes, there is always sufficient room.
10557            fidl::encoding::encode_in_envelope_optional::<
10558                RunEventPayload,
10559                fidl::encoding::DefaultFuchsiaResourceDialect,
10560            >(
10561                self.payload
10562                    .as_mut()
10563                    .map(<RunEventPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10564                encoder,
10565                offset + cur_offset,
10566                depth,
10567            )?;
10568
10569            _prev_end_offset = cur_offset + envelope_size;
10570
10571            Ok(())
10572        }
10573    }
10574
10575    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RunEvent {
10576        #[inline(always)]
10577        fn new_empty() -> Self {
10578            Self::default()
10579        }
10580
10581        unsafe fn decode(
10582            &mut self,
10583            decoder: &mut fidl::encoding::Decoder<
10584                '_,
10585                fidl::encoding::DefaultFuchsiaResourceDialect,
10586            >,
10587            offset: usize,
10588            mut depth: fidl::encoding::Depth,
10589        ) -> fidl::Result<()> {
10590            decoder.debug_check_bounds::<Self>(offset);
10591            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10592                None => return Err(fidl::Error::NotNullable),
10593                Some(len) => len,
10594            };
10595            // Calling decoder.out_of_line_offset(0) is not allowed.
10596            if len == 0 {
10597                return Ok(());
10598            };
10599            depth.increment()?;
10600            let envelope_size = 8;
10601            let bytes_len = len * envelope_size;
10602            let offset = decoder.out_of_line_offset(bytes_len)?;
10603            // Decode the envelope for each type.
10604            let mut _next_ordinal_to_read = 0;
10605            let mut next_offset = offset;
10606            let end_offset = offset + bytes_len;
10607            _next_ordinal_to_read += 1;
10608            if next_offset >= end_offset {
10609                return Ok(());
10610            }
10611
10612            // Decode unknown envelopes for gaps in ordinals.
10613            while _next_ordinal_to_read < 1 {
10614                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10615                _next_ordinal_to_read += 1;
10616                next_offset += envelope_size;
10617            }
10618
10619            let next_out_of_line = decoder.next_out_of_line();
10620            let handles_before = decoder.remaining_handles();
10621            if let Some((inlined, num_bytes, num_handles)) =
10622                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10623            {
10624                let member_inline_size =
10625                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10626                if inlined != (member_inline_size <= 4) {
10627                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10628                }
10629                let inner_offset;
10630                let mut inner_depth = depth.clone();
10631                if inlined {
10632                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10633                    inner_offset = next_offset;
10634                } else {
10635                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10636                    inner_depth.increment()?;
10637                }
10638                let val_ref = self.timestamp.get_or_insert_with(|| {
10639                    fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
10640                });
10641                fidl::decode!(
10642                    i64,
10643                    fidl::encoding::DefaultFuchsiaResourceDialect,
10644                    val_ref,
10645                    decoder,
10646                    inner_offset,
10647                    inner_depth
10648                )?;
10649                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10650                {
10651                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10652                }
10653                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10654                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10655                }
10656            }
10657
10658            next_offset += envelope_size;
10659            _next_ordinal_to_read += 1;
10660            if next_offset >= end_offset {
10661                return Ok(());
10662            }
10663
10664            // Decode unknown envelopes for gaps in ordinals.
10665            while _next_ordinal_to_read < 2 {
10666                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10667                _next_ordinal_to_read += 1;
10668                next_offset += envelope_size;
10669            }
10670
10671            let next_out_of_line = decoder.next_out_of_line();
10672            let handles_before = decoder.remaining_handles();
10673            if let Some((inlined, num_bytes, num_handles)) =
10674                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10675            {
10676                let member_inline_size =
10677                    <RunEventPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10678                if inlined != (member_inline_size <= 4) {
10679                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10680                }
10681                let inner_offset;
10682                let mut inner_depth = depth.clone();
10683                if inlined {
10684                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10685                    inner_offset = next_offset;
10686                } else {
10687                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10688                    inner_depth.increment()?;
10689                }
10690                let val_ref = self.payload.get_or_insert_with(|| {
10691                    fidl::new_empty!(RunEventPayload, fidl::encoding::DefaultFuchsiaResourceDialect)
10692                });
10693                fidl::decode!(
10694                    RunEventPayload,
10695                    fidl::encoding::DefaultFuchsiaResourceDialect,
10696                    val_ref,
10697                    decoder,
10698                    inner_offset,
10699                    inner_depth
10700                )?;
10701                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10702                {
10703                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10704                }
10705                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10706                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10707                }
10708            }
10709
10710            next_offset += envelope_size;
10711
10712            // Decode the remaining unknown envelopes.
10713            while next_offset < end_offset {
10714                _next_ordinal_to_read += 1;
10715                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10716                next_offset += envelope_size;
10717            }
10718
10719            Ok(())
10720        }
10721    }
10722
10723    impl RunSuiteOptions {
10724        #[inline(always)]
10725        fn max_ordinal_present(&self) -> u64 {
10726            if let Some(_) = self.break_on_failure {
10727                return 11;
10728            }
10729            if let Some(_) = self.no_exception_channel {
10730                return 10;
10731            }
10732            if let Some(_) = self.accumulate_debug_data {
10733                return 9;
10734            }
10735            if let Some(_) = self.log_interest {
10736                return 8;
10737            }
10738            if let Some(_) = self.logs_iterator_type {
10739                return 7;
10740            }
10741            if let Some(_) = self.test_case_filters {
10742                return 6;
10743            }
10744            if let Some(_) = self.timeout {
10745                return 5;
10746            }
10747            if let Some(_) = self.arguments {
10748                return 4;
10749            }
10750            if let Some(_) = self.max_concurrent_test_case_runs {
10751                return 3;
10752            }
10753            if let Some(_) = self.run_disabled_tests {
10754                return 2;
10755            }
10756            if let Some(_) = self.realm_options {
10757                return 1;
10758            }
10759            0
10760        }
10761    }
10762
10763    impl fidl::encoding::ResourceTypeMarker for RunSuiteOptions {
10764        type Borrowed<'a> = &'a mut Self;
10765        fn take_or_borrow<'a>(
10766            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10767        ) -> Self::Borrowed<'a> {
10768            value
10769        }
10770    }
10771
10772    unsafe impl fidl::encoding::TypeMarker for RunSuiteOptions {
10773        type Owned = Self;
10774
10775        #[inline(always)]
10776        fn inline_align(_context: fidl::encoding::Context) -> usize {
10777            8
10778        }
10779
10780        #[inline(always)]
10781        fn inline_size(_context: fidl::encoding::Context) -> usize {
10782            16
10783        }
10784    }
10785
10786    unsafe impl
10787        fidl::encoding::Encode<RunSuiteOptions, fidl::encoding::DefaultFuchsiaResourceDialect>
10788        for &mut RunSuiteOptions
10789    {
10790        unsafe fn encode(
10791            self,
10792            encoder: &mut fidl::encoding::Encoder<
10793                '_,
10794                fidl::encoding::DefaultFuchsiaResourceDialect,
10795            >,
10796            offset: usize,
10797            mut depth: fidl::encoding::Depth,
10798        ) -> fidl::Result<()> {
10799            encoder.debug_check_bounds::<RunSuiteOptions>(offset);
10800            // Vector header
10801            let max_ordinal: u64 = self.max_ordinal_present();
10802            encoder.write_num(max_ordinal, offset);
10803            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10804            // Calling encoder.out_of_line_offset(0) is not allowed.
10805            if max_ordinal == 0 {
10806                return Ok(());
10807            }
10808            depth.increment()?;
10809            let envelope_size = 8;
10810            let bytes_len = max_ordinal as usize * envelope_size;
10811            #[allow(unused_variables)]
10812            let offset = encoder.out_of_line_offset(bytes_len);
10813            let mut _prev_end_offset: usize = 0;
10814            if 1 > max_ordinal {
10815                return Ok(());
10816            }
10817
10818            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10819            // are envelope_size bytes.
10820            let cur_offset: usize = (1 - 1) * envelope_size;
10821
10822            // Zero reserved fields.
10823            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10824
10825            // Safety:
10826            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10827            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10828            //   envelope_size bytes, there is always sufficient room.
10829            fidl::encoding::encode_in_envelope_optional::<
10830                RealmOptions,
10831                fidl::encoding::DefaultFuchsiaResourceDialect,
10832            >(
10833                self.realm_options
10834                    .as_mut()
10835                    .map(<RealmOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10836                encoder,
10837                offset + cur_offset,
10838                depth,
10839            )?;
10840
10841            _prev_end_offset = cur_offset + envelope_size;
10842            if 2 > max_ordinal {
10843                return Ok(());
10844            }
10845
10846            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10847            // are envelope_size bytes.
10848            let cur_offset: usize = (2 - 1) * envelope_size;
10849
10850            // Zero reserved fields.
10851            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10852
10853            // Safety:
10854            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10855            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10856            //   envelope_size bytes, there is always sufficient room.
10857            fidl::encoding::encode_in_envelope_optional::<
10858                bool,
10859                fidl::encoding::DefaultFuchsiaResourceDialect,
10860            >(
10861                self.run_disabled_tests
10862                    .as_ref()
10863                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10864                encoder,
10865                offset + cur_offset,
10866                depth,
10867            )?;
10868
10869            _prev_end_offset = cur_offset + envelope_size;
10870            if 3 > max_ordinal {
10871                return Ok(());
10872            }
10873
10874            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10875            // are envelope_size bytes.
10876            let cur_offset: usize = (3 - 1) * envelope_size;
10877
10878            // Zero reserved fields.
10879            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10880
10881            // Safety:
10882            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10883            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10884            //   envelope_size bytes, there is always sufficient room.
10885            fidl::encoding::encode_in_envelope_optional::<
10886                u16,
10887                fidl::encoding::DefaultFuchsiaResourceDialect,
10888            >(
10889                self.max_concurrent_test_case_runs
10890                    .as_ref()
10891                    .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
10892                encoder,
10893                offset + cur_offset,
10894                depth,
10895            )?;
10896
10897            _prev_end_offset = cur_offset + envelope_size;
10898            if 4 > max_ordinal {
10899                return Ok(());
10900            }
10901
10902            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10903            // are envelope_size bytes.
10904            let cur_offset: usize = (4 - 1) * envelope_size;
10905
10906            // Zero reserved fields.
10907            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10908
10909            // Safety:
10910            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10911            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10912            //   envelope_size bytes, there is always sufficient room.
10913            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<16384>, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
10914            self.arguments.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<16384>, 4095> as fidl::encoding::ValueTypeMarker>::borrow),
10915            encoder, offset + cur_offset, depth
10916        )?;
10917
10918            _prev_end_offset = cur_offset + envelope_size;
10919            if 5 > max_ordinal {
10920                return Ok(());
10921            }
10922
10923            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10924            // are envelope_size bytes.
10925            let cur_offset: usize = (5 - 1) * envelope_size;
10926
10927            // Zero reserved fields.
10928            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10929
10930            // Safety:
10931            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10932            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10933            //   envelope_size bytes, there is always sufficient room.
10934            fidl::encoding::encode_in_envelope_optional::<
10935                i64,
10936                fidl::encoding::DefaultFuchsiaResourceDialect,
10937            >(
10938                self.timeout.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
10939                encoder,
10940                offset + cur_offset,
10941                depth,
10942            )?;
10943
10944            _prev_end_offset = cur_offset + envelope_size;
10945            if 6 > max_ordinal {
10946                return Ok(());
10947            }
10948
10949            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10950            // are envelope_size bytes.
10951            let cur_offset: usize = (6 - 1) * envelope_size;
10952
10953            // Zero reserved fields.
10954            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10955
10956            // Safety:
10957            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10958            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10959            //   envelope_size bytes, there is always sufficient room.
10960            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect>(
10961            self.test_case_filters.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024> as fidl::encoding::ValueTypeMarker>::borrow),
10962            encoder, offset + cur_offset, depth
10963        )?;
10964
10965            _prev_end_offset = cur_offset + envelope_size;
10966            if 7 > max_ordinal {
10967                return Ok(());
10968            }
10969
10970            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10971            // are envelope_size bytes.
10972            let cur_offset: usize = (7 - 1) * envelope_size;
10973
10974            // Zero reserved fields.
10975            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10976
10977            // Safety:
10978            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10979            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10980            //   envelope_size bytes, there is always sufficient room.
10981            fidl::encoding::encode_in_envelope_optional::<
10982                LogsIteratorType,
10983                fidl::encoding::DefaultFuchsiaResourceDialect,
10984            >(
10985                self.logs_iterator_type
10986                    .as_ref()
10987                    .map(<LogsIteratorType as fidl::encoding::ValueTypeMarker>::borrow),
10988                encoder,
10989                offset + cur_offset,
10990                depth,
10991            )?;
10992
10993            _prev_end_offset = cur_offset + envelope_size;
10994            if 8 > max_ordinal {
10995                return Ok(());
10996            }
10997
10998            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10999            // are envelope_size bytes.
11000            let cur_offset: usize = (8 - 1) * envelope_size;
11001
11002            // Zero reserved fields.
11003            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11004
11005            // Safety:
11006            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11007            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11008            //   envelope_size bytes, there is always sufficient room.
11009            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11010            self.log_interest.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64> as fidl::encoding::ValueTypeMarker>::borrow),
11011            encoder, offset + cur_offset, depth
11012        )?;
11013
11014            _prev_end_offset = cur_offset + envelope_size;
11015            if 9 > max_ordinal {
11016                return Ok(());
11017            }
11018
11019            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11020            // are envelope_size bytes.
11021            let cur_offset: usize = (9 - 1) * envelope_size;
11022
11023            // Zero reserved fields.
11024            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11025
11026            // Safety:
11027            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11028            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11029            //   envelope_size bytes, there is always sufficient room.
11030            fidl::encoding::encode_in_envelope_optional::<
11031                bool,
11032                fidl::encoding::DefaultFuchsiaResourceDialect,
11033            >(
11034                self.accumulate_debug_data
11035                    .as_ref()
11036                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11037                encoder,
11038                offset + cur_offset,
11039                depth,
11040            )?;
11041
11042            _prev_end_offset = cur_offset + envelope_size;
11043            if 10 > max_ordinal {
11044                return Ok(());
11045            }
11046
11047            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11048            // are envelope_size bytes.
11049            let cur_offset: usize = (10 - 1) * envelope_size;
11050
11051            // Zero reserved fields.
11052            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11053
11054            // Safety:
11055            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11056            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11057            //   envelope_size bytes, there is always sufficient room.
11058            fidl::encoding::encode_in_envelope_optional::<
11059                bool,
11060                fidl::encoding::DefaultFuchsiaResourceDialect,
11061            >(
11062                self.no_exception_channel
11063                    .as_ref()
11064                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11065                encoder,
11066                offset + cur_offset,
11067                depth,
11068            )?;
11069
11070            _prev_end_offset = cur_offset + envelope_size;
11071            if 11 > max_ordinal {
11072                return Ok(());
11073            }
11074
11075            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11076            // are envelope_size bytes.
11077            let cur_offset: usize = (11 - 1) * envelope_size;
11078
11079            // Zero reserved fields.
11080            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11081
11082            // Safety:
11083            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11084            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11085            //   envelope_size bytes, there is always sufficient room.
11086            fidl::encoding::encode_in_envelope_optional::<
11087                bool,
11088                fidl::encoding::DefaultFuchsiaResourceDialect,
11089            >(
11090                self.break_on_failure
11091                    .as_ref()
11092                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11093                encoder,
11094                offset + cur_offset,
11095                depth,
11096            )?;
11097
11098            _prev_end_offset = cur_offset + envelope_size;
11099
11100            Ok(())
11101        }
11102    }
11103
11104    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11105        for RunSuiteOptions
11106    {
11107        #[inline(always)]
11108        fn new_empty() -> Self {
11109            Self::default()
11110        }
11111
11112        unsafe fn decode(
11113            &mut self,
11114            decoder: &mut fidl::encoding::Decoder<
11115                '_,
11116                fidl::encoding::DefaultFuchsiaResourceDialect,
11117            >,
11118            offset: usize,
11119            mut depth: fidl::encoding::Depth,
11120        ) -> fidl::Result<()> {
11121            decoder.debug_check_bounds::<Self>(offset);
11122            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11123                None => return Err(fidl::Error::NotNullable),
11124                Some(len) => len,
11125            };
11126            // Calling decoder.out_of_line_offset(0) is not allowed.
11127            if len == 0 {
11128                return Ok(());
11129            };
11130            depth.increment()?;
11131            let envelope_size = 8;
11132            let bytes_len = len * envelope_size;
11133            let offset = decoder.out_of_line_offset(bytes_len)?;
11134            // Decode the envelope for each type.
11135            let mut _next_ordinal_to_read = 0;
11136            let mut next_offset = offset;
11137            let end_offset = offset + bytes_len;
11138            _next_ordinal_to_read += 1;
11139            if next_offset >= end_offset {
11140                return Ok(());
11141            }
11142
11143            // Decode unknown envelopes for gaps in ordinals.
11144            while _next_ordinal_to_read < 1 {
11145                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11146                _next_ordinal_to_read += 1;
11147                next_offset += envelope_size;
11148            }
11149
11150            let next_out_of_line = decoder.next_out_of_line();
11151            let handles_before = decoder.remaining_handles();
11152            if let Some((inlined, num_bytes, num_handles)) =
11153                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11154            {
11155                let member_inline_size =
11156                    <RealmOptions as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11157                if inlined != (member_inline_size <= 4) {
11158                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11159                }
11160                let inner_offset;
11161                let mut inner_depth = depth.clone();
11162                if inlined {
11163                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11164                    inner_offset = next_offset;
11165                } else {
11166                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11167                    inner_depth.increment()?;
11168                }
11169                let val_ref = self.realm_options.get_or_insert_with(|| {
11170                    fidl::new_empty!(RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect)
11171                });
11172                fidl::decode!(
11173                    RealmOptions,
11174                    fidl::encoding::DefaultFuchsiaResourceDialect,
11175                    val_ref,
11176                    decoder,
11177                    inner_offset,
11178                    inner_depth
11179                )?;
11180                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11181                {
11182                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11183                }
11184                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11185                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11186                }
11187            }
11188
11189            next_offset += envelope_size;
11190            _next_ordinal_to_read += 1;
11191            if next_offset >= end_offset {
11192                return Ok(());
11193            }
11194
11195            // Decode unknown envelopes for gaps in ordinals.
11196            while _next_ordinal_to_read < 2 {
11197                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11198                _next_ordinal_to_read += 1;
11199                next_offset += envelope_size;
11200            }
11201
11202            let next_out_of_line = decoder.next_out_of_line();
11203            let handles_before = decoder.remaining_handles();
11204            if let Some((inlined, num_bytes, num_handles)) =
11205                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11206            {
11207                let member_inline_size =
11208                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11209                if inlined != (member_inline_size <= 4) {
11210                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11211                }
11212                let inner_offset;
11213                let mut inner_depth = depth.clone();
11214                if inlined {
11215                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11216                    inner_offset = next_offset;
11217                } else {
11218                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11219                    inner_depth.increment()?;
11220                }
11221                let val_ref = self.run_disabled_tests.get_or_insert_with(|| {
11222                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11223                });
11224                fidl::decode!(
11225                    bool,
11226                    fidl::encoding::DefaultFuchsiaResourceDialect,
11227                    val_ref,
11228                    decoder,
11229                    inner_offset,
11230                    inner_depth
11231                )?;
11232                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11233                {
11234                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11235                }
11236                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11237                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11238                }
11239            }
11240
11241            next_offset += envelope_size;
11242            _next_ordinal_to_read += 1;
11243            if next_offset >= end_offset {
11244                return Ok(());
11245            }
11246
11247            // Decode unknown envelopes for gaps in ordinals.
11248            while _next_ordinal_to_read < 3 {
11249                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11250                _next_ordinal_to_read += 1;
11251                next_offset += envelope_size;
11252            }
11253
11254            let next_out_of_line = decoder.next_out_of_line();
11255            let handles_before = decoder.remaining_handles();
11256            if let Some((inlined, num_bytes, num_handles)) =
11257                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11258            {
11259                let member_inline_size =
11260                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11261                if inlined != (member_inline_size <= 4) {
11262                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11263                }
11264                let inner_offset;
11265                let mut inner_depth = depth.clone();
11266                if inlined {
11267                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11268                    inner_offset = next_offset;
11269                } else {
11270                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11271                    inner_depth.increment()?;
11272                }
11273                let val_ref = self.max_concurrent_test_case_runs.get_or_insert_with(|| {
11274                    fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect)
11275                });
11276                fidl::decode!(
11277                    u16,
11278                    fidl::encoding::DefaultFuchsiaResourceDialect,
11279                    val_ref,
11280                    decoder,
11281                    inner_offset,
11282                    inner_depth
11283                )?;
11284                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11285                {
11286                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11287                }
11288                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11289                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11290                }
11291            }
11292
11293            next_offset += envelope_size;
11294            _next_ordinal_to_read += 1;
11295            if next_offset >= end_offset {
11296                return Ok(());
11297            }
11298
11299            // Decode unknown envelopes for gaps in ordinals.
11300            while _next_ordinal_to_read < 4 {
11301                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11302                _next_ordinal_to_read += 1;
11303                next_offset += envelope_size;
11304            }
11305
11306            let next_out_of_line = decoder.next_out_of_line();
11307            let handles_before = decoder.remaining_handles();
11308            if let Some((inlined, num_bytes, num_handles)) =
11309                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11310            {
11311                let member_inline_size = <fidl::encoding::Vector<
11312                    fidl::encoding::BoundedString<16384>,
11313                    4095,
11314                > as fidl::encoding::TypeMarker>::inline_size(
11315                    decoder.context
11316                );
11317                if inlined != (member_inline_size <= 4) {
11318                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11319                }
11320                let inner_offset;
11321                let mut inner_depth = depth.clone();
11322                if inlined {
11323                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11324                    inner_offset = next_offset;
11325                } else {
11326                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11327                    inner_depth.increment()?;
11328                }
11329                let val_ref = self.arguments.get_or_insert_with(|| {
11330                    fidl::new_empty!(
11331                        fidl::encoding::Vector<fidl::encoding::BoundedString<16384>, 4095>,
11332                        fidl::encoding::DefaultFuchsiaResourceDialect
11333                    )
11334                });
11335                fidl::decode!(
11336                    fidl::encoding::Vector<fidl::encoding::BoundedString<16384>, 4095>,
11337                    fidl::encoding::DefaultFuchsiaResourceDialect,
11338                    val_ref,
11339                    decoder,
11340                    inner_offset,
11341                    inner_depth
11342                )?;
11343                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11344                {
11345                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11346                }
11347                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11348                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11349                }
11350            }
11351
11352            next_offset += envelope_size;
11353            _next_ordinal_to_read += 1;
11354            if next_offset >= end_offset {
11355                return Ok(());
11356            }
11357
11358            // Decode unknown envelopes for gaps in ordinals.
11359            while _next_ordinal_to_read < 5 {
11360                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11361                _next_ordinal_to_read += 1;
11362                next_offset += envelope_size;
11363            }
11364
11365            let next_out_of_line = decoder.next_out_of_line();
11366            let handles_before = decoder.remaining_handles();
11367            if let Some((inlined, num_bytes, num_handles)) =
11368                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11369            {
11370                let member_inline_size =
11371                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11372                if inlined != (member_inline_size <= 4) {
11373                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11374                }
11375                let inner_offset;
11376                let mut inner_depth = depth.clone();
11377                if inlined {
11378                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11379                    inner_offset = next_offset;
11380                } else {
11381                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11382                    inner_depth.increment()?;
11383                }
11384                let val_ref = self.timeout.get_or_insert_with(|| {
11385                    fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
11386                });
11387                fidl::decode!(
11388                    i64,
11389                    fidl::encoding::DefaultFuchsiaResourceDialect,
11390                    val_ref,
11391                    decoder,
11392                    inner_offset,
11393                    inner_depth
11394                )?;
11395                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11396                {
11397                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11398                }
11399                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11400                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11401                }
11402            }
11403
11404            next_offset += envelope_size;
11405            _next_ordinal_to_read += 1;
11406            if next_offset >= end_offset {
11407                return Ok(());
11408            }
11409
11410            // Decode unknown envelopes for gaps in ordinals.
11411            while _next_ordinal_to_read < 6 {
11412                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11413                _next_ordinal_to_read += 1;
11414                next_offset += envelope_size;
11415            }
11416
11417            let next_out_of_line = decoder.next_out_of_line();
11418            let handles_before = decoder.remaining_handles();
11419            if let Some((inlined, num_bytes, num_handles)) =
11420                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11421            {
11422                let member_inline_size = <fidl::encoding::Vector<
11423                    fidl::encoding::BoundedString<4096>,
11424                    1024,
11425                > as fidl::encoding::TypeMarker>::inline_size(
11426                    decoder.context
11427                );
11428                if inlined != (member_inline_size <= 4) {
11429                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11430                }
11431                let inner_offset;
11432                let mut inner_depth = depth.clone();
11433                if inlined {
11434                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11435                    inner_offset = next_offset;
11436                } else {
11437                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11438                    inner_depth.increment()?;
11439                }
11440                let val_ref = self.test_case_filters.get_or_insert_with(|| {
11441                    fidl::new_empty!(
11442                        fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024>,
11443                        fidl::encoding::DefaultFuchsiaResourceDialect
11444                    )
11445                });
11446                fidl::decode!(
11447                    fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024>,
11448                    fidl::encoding::DefaultFuchsiaResourceDialect,
11449                    val_ref,
11450                    decoder,
11451                    inner_offset,
11452                    inner_depth
11453                )?;
11454                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11455                {
11456                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11457                }
11458                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11459                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11460                }
11461            }
11462
11463            next_offset += envelope_size;
11464            _next_ordinal_to_read += 1;
11465            if next_offset >= end_offset {
11466                return Ok(());
11467            }
11468
11469            // Decode unknown envelopes for gaps in ordinals.
11470            while _next_ordinal_to_read < 7 {
11471                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11472                _next_ordinal_to_read += 1;
11473                next_offset += envelope_size;
11474            }
11475
11476            let next_out_of_line = decoder.next_out_of_line();
11477            let handles_before = decoder.remaining_handles();
11478            if let Some((inlined, num_bytes, num_handles)) =
11479                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11480            {
11481                let member_inline_size =
11482                    <LogsIteratorType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11483                if inlined != (member_inline_size <= 4) {
11484                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11485                }
11486                let inner_offset;
11487                let mut inner_depth = depth.clone();
11488                if inlined {
11489                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11490                    inner_offset = next_offset;
11491                } else {
11492                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11493                    inner_depth.increment()?;
11494                }
11495                let val_ref = self.logs_iterator_type.get_or_insert_with(|| {
11496                    fidl::new_empty!(
11497                        LogsIteratorType,
11498                        fidl::encoding::DefaultFuchsiaResourceDialect
11499                    )
11500                });
11501                fidl::decode!(
11502                    LogsIteratorType,
11503                    fidl::encoding::DefaultFuchsiaResourceDialect,
11504                    val_ref,
11505                    decoder,
11506                    inner_offset,
11507                    inner_depth
11508                )?;
11509                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11510                {
11511                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11512                }
11513                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11514                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11515                }
11516            }
11517
11518            next_offset += envelope_size;
11519            _next_ordinal_to_read += 1;
11520            if next_offset >= end_offset {
11521                return Ok(());
11522            }
11523
11524            // Decode unknown envelopes for gaps in ordinals.
11525            while _next_ordinal_to_read < 8 {
11526                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11527                _next_ordinal_to_read += 1;
11528                next_offset += envelope_size;
11529            }
11530
11531            let next_out_of_line = decoder.next_out_of_line();
11532            let handles_before = decoder.remaining_handles();
11533            if let Some((inlined, num_bytes, num_handles)) =
11534                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11535            {
11536                let member_inline_size = <fidl::encoding::Vector<
11537                    fidl_fuchsia_diagnostics::LogInterestSelector,
11538                    64,
11539                > as fidl::encoding::TypeMarker>::inline_size(
11540                    decoder.context
11541                );
11542                if inlined != (member_inline_size <= 4) {
11543                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11544                }
11545                let inner_offset;
11546                let mut inner_depth = depth.clone();
11547                if inlined {
11548                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11549                    inner_offset = next_offset;
11550                } else {
11551                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11552                    inner_depth.increment()?;
11553                }
11554                let val_ref =
11555                self.log_interest.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
11556                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
11557                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11558                {
11559                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11560                }
11561                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11562                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11563                }
11564            }
11565
11566            next_offset += envelope_size;
11567            _next_ordinal_to_read += 1;
11568            if next_offset >= end_offset {
11569                return Ok(());
11570            }
11571
11572            // Decode unknown envelopes for gaps in ordinals.
11573            while _next_ordinal_to_read < 9 {
11574                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11575                _next_ordinal_to_read += 1;
11576                next_offset += envelope_size;
11577            }
11578
11579            let next_out_of_line = decoder.next_out_of_line();
11580            let handles_before = decoder.remaining_handles();
11581            if let Some((inlined, num_bytes, num_handles)) =
11582                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11583            {
11584                let member_inline_size =
11585                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11586                if inlined != (member_inline_size <= 4) {
11587                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11588                }
11589                let inner_offset;
11590                let mut inner_depth = depth.clone();
11591                if inlined {
11592                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11593                    inner_offset = next_offset;
11594                } else {
11595                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11596                    inner_depth.increment()?;
11597                }
11598                let val_ref = self.accumulate_debug_data.get_or_insert_with(|| {
11599                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11600                });
11601                fidl::decode!(
11602                    bool,
11603                    fidl::encoding::DefaultFuchsiaResourceDialect,
11604                    val_ref,
11605                    decoder,
11606                    inner_offset,
11607                    inner_depth
11608                )?;
11609                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11610                {
11611                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11612                }
11613                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11614                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11615                }
11616            }
11617
11618            next_offset += envelope_size;
11619            _next_ordinal_to_read += 1;
11620            if next_offset >= end_offset {
11621                return Ok(());
11622            }
11623
11624            // Decode unknown envelopes for gaps in ordinals.
11625            while _next_ordinal_to_read < 10 {
11626                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11627                _next_ordinal_to_read += 1;
11628                next_offset += envelope_size;
11629            }
11630
11631            let next_out_of_line = decoder.next_out_of_line();
11632            let handles_before = decoder.remaining_handles();
11633            if let Some((inlined, num_bytes, num_handles)) =
11634                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11635            {
11636                let member_inline_size =
11637                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11638                if inlined != (member_inline_size <= 4) {
11639                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11640                }
11641                let inner_offset;
11642                let mut inner_depth = depth.clone();
11643                if inlined {
11644                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11645                    inner_offset = next_offset;
11646                } else {
11647                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11648                    inner_depth.increment()?;
11649                }
11650                let val_ref = self.no_exception_channel.get_or_insert_with(|| {
11651                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11652                });
11653                fidl::decode!(
11654                    bool,
11655                    fidl::encoding::DefaultFuchsiaResourceDialect,
11656                    val_ref,
11657                    decoder,
11658                    inner_offset,
11659                    inner_depth
11660                )?;
11661                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11662                {
11663                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11664                }
11665                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11666                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11667                }
11668            }
11669
11670            next_offset += envelope_size;
11671            _next_ordinal_to_read += 1;
11672            if next_offset >= end_offset {
11673                return Ok(());
11674            }
11675
11676            // Decode unknown envelopes for gaps in ordinals.
11677            while _next_ordinal_to_read < 11 {
11678                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11679                _next_ordinal_to_read += 1;
11680                next_offset += envelope_size;
11681            }
11682
11683            let next_out_of_line = decoder.next_out_of_line();
11684            let handles_before = decoder.remaining_handles();
11685            if let Some((inlined, num_bytes, num_handles)) =
11686                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11687            {
11688                let member_inline_size =
11689                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11690                if inlined != (member_inline_size <= 4) {
11691                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11692                }
11693                let inner_offset;
11694                let mut inner_depth = depth.clone();
11695                if inlined {
11696                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11697                    inner_offset = next_offset;
11698                } else {
11699                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11700                    inner_depth.increment()?;
11701                }
11702                let val_ref = self.break_on_failure.get_or_insert_with(|| {
11703                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11704                });
11705                fidl::decode!(
11706                    bool,
11707                    fidl::encoding::DefaultFuchsiaResourceDialect,
11708                    val_ref,
11709                    decoder,
11710                    inner_offset,
11711                    inner_depth
11712                )?;
11713                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11714                {
11715                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11716                }
11717                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11718                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11719                }
11720            }
11721
11722            next_offset += envelope_size;
11723
11724            // Decode the remaining unknown envelopes.
11725            while next_offset < end_offset {
11726                _next_ordinal_to_read += 1;
11727                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11728                next_offset += envelope_size;
11729            }
11730
11731            Ok(())
11732        }
11733    }
11734
11735    impl SuiteArtifactGeneratedEventDetails {
11736        #[inline(always)]
11737        fn max_ordinal_present(&self) -> u64 {
11738            if let Some(_) = self.artifact {
11739                return 1;
11740            }
11741            0
11742        }
11743    }
11744
11745    impl fidl::encoding::ResourceTypeMarker for SuiteArtifactGeneratedEventDetails {
11746        type Borrowed<'a> = &'a mut Self;
11747        fn take_or_borrow<'a>(
11748            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11749        ) -> Self::Borrowed<'a> {
11750            value
11751        }
11752    }
11753
11754    unsafe impl fidl::encoding::TypeMarker for SuiteArtifactGeneratedEventDetails {
11755        type Owned = Self;
11756
11757        #[inline(always)]
11758        fn inline_align(_context: fidl::encoding::Context) -> usize {
11759            8
11760        }
11761
11762        #[inline(always)]
11763        fn inline_size(_context: fidl::encoding::Context) -> usize {
11764            16
11765        }
11766    }
11767
11768    unsafe impl
11769        fidl::encoding::Encode<
11770            SuiteArtifactGeneratedEventDetails,
11771            fidl::encoding::DefaultFuchsiaResourceDialect,
11772        > for &mut SuiteArtifactGeneratedEventDetails
11773    {
11774        unsafe fn encode(
11775            self,
11776            encoder: &mut fidl::encoding::Encoder<
11777                '_,
11778                fidl::encoding::DefaultFuchsiaResourceDialect,
11779            >,
11780            offset: usize,
11781            mut depth: fidl::encoding::Depth,
11782        ) -> fidl::Result<()> {
11783            encoder.debug_check_bounds::<SuiteArtifactGeneratedEventDetails>(offset);
11784            // Vector header
11785            let max_ordinal: u64 = self.max_ordinal_present();
11786            encoder.write_num(max_ordinal, offset);
11787            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11788            // Calling encoder.out_of_line_offset(0) is not allowed.
11789            if max_ordinal == 0 {
11790                return Ok(());
11791            }
11792            depth.increment()?;
11793            let envelope_size = 8;
11794            let bytes_len = max_ordinal as usize * envelope_size;
11795            #[allow(unused_variables)]
11796            let offset = encoder.out_of_line_offset(bytes_len);
11797            let mut _prev_end_offset: usize = 0;
11798            if 1 > max_ordinal {
11799                return Ok(());
11800            }
11801
11802            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11803            // are envelope_size bytes.
11804            let cur_offset: usize = (1 - 1) * envelope_size;
11805
11806            // Zero reserved fields.
11807            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11808
11809            // Safety:
11810            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11811            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11812            //   envelope_size bytes, there is always sufficient room.
11813            fidl::encoding::encode_in_envelope_optional::<
11814                Artifact,
11815                fidl::encoding::DefaultFuchsiaResourceDialect,
11816            >(
11817                self.artifact
11818                    .as_mut()
11819                    .map(<Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11820                encoder,
11821                offset + cur_offset,
11822                depth,
11823            )?;
11824
11825            _prev_end_offset = cur_offset + envelope_size;
11826
11827            Ok(())
11828        }
11829    }
11830
11831    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11832        for SuiteArtifactGeneratedEventDetails
11833    {
11834        #[inline(always)]
11835        fn new_empty() -> Self {
11836            Self::default()
11837        }
11838
11839        unsafe fn decode(
11840            &mut self,
11841            decoder: &mut fidl::encoding::Decoder<
11842                '_,
11843                fidl::encoding::DefaultFuchsiaResourceDialect,
11844            >,
11845            offset: usize,
11846            mut depth: fidl::encoding::Depth,
11847        ) -> fidl::Result<()> {
11848            decoder.debug_check_bounds::<Self>(offset);
11849            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11850                None => return Err(fidl::Error::NotNullable),
11851                Some(len) => len,
11852            };
11853            // Calling decoder.out_of_line_offset(0) is not allowed.
11854            if len == 0 {
11855                return Ok(());
11856            };
11857            depth.increment()?;
11858            let envelope_size = 8;
11859            let bytes_len = len * envelope_size;
11860            let offset = decoder.out_of_line_offset(bytes_len)?;
11861            // Decode the envelope for each type.
11862            let mut _next_ordinal_to_read = 0;
11863            let mut next_offset = offset;
11864            let end_offset = offset + bytes_len;
11865            _next_ordinal_to_read += 1;
11866            if next_offset >= end_offset {
11867                return Ok(());
11868            }
11869
11870            // Decode unknown envelopes for gaps in ordinals.
11871            while _next_ordinal_to_read < 1 {
11872                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11873                _next_ordinal_to_read += 1;
11874                next_offset += envelope_size;
11875            }
11876
11877            let next_out_of_line = decoder.next_out_of_line();
11878            let handles_before = decoder.remaining_handles();
11879            if let Some((inlined, num_bytes, num_handles)) =
11880                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11881            {
11882                let member_inline_size =
11883                    <Artifact as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11884                if inlined != (member_inline_size <= 4) {
11885                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11886                }
11887                let inner_offset;
11888                let mut inner_depth = depth.clone();
11889                if inlined {
11890                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11891                    inner_offset = next_offset;
11892                } else {
11893                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11894                    inner_depth.increment()?;
11895                }
11896                let val_ref = self.artifact.get_or_insert_with(|| {
11897                    fidl::new_empty!(Artifact, fidl::encoding::DefaultFuchsiaResourceDialect)
11898                });
11899                fidl::decode!(
11900                    Artifact,
11901                    fidl::encoding::DefaultFuchsiaResourceDialect,
11902                    val_ref,
11903                    decoder,
11904                    inner_offset,
11905                    inner_depth
11906                )?;
11907                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11908                {
11909                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11910                }
11911                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11912                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11913                }
11914            }
11915
11916            next_offset += envelope_size;
11917
11918            // Decode the remaining unknown envelopes.
11919            while next_offset < end_offset {
11920                _next_ordinal_to_read += 1;
11921                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11922                next_offset += envelope_size;
11923            }
11924
11925            Ok(())
11926        }
11927    }
11928
11929    impl SuiteEvent {
11930        #[inline(always)]
11931        fn max_ordinal_present(&self) -> u64 {
11932            if let Some(_) = self.payload {
11933                return 2;
11934            }
11935            if let Some(_) = self.timestamp {
11936                return 1;
11937            }
11938            0
11939        }
11940    }
11941
11942    impl fidl::encoding::ResourceTypeMarker for SuiteEvent {
11943        type Borrowed<'a> = &'a mut Self;
11944        fn take_or_borrow<'a>(
11945            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11946        ) -> Self::Borrowed<'a> {
11947            value
11948        }
11949    }
11950
11951    unsafe impl fidl::encoding::TypeMarker for SuiteEvent {
11952        type Owned = Self;
11953
11954        #[inline(always)]
11955        fn inline_align(_context: fidl::encoding::Context) -> usize {
11956            8
11957        }
11958
11959        #[inline(always)]
11960        fn inline_size(_context: fidl::encoding::Context) -> usize {
11961            16
11962        }
11963    }
11964
11965    unsafe impl fidl::encoding::Encode<SuiteEvent, fidl::encoding::DefaultFuchsiaResourceDialect>
11966        for &mut SuiteEvent
11967    {
11968        unsafe fn encode(
11969            self,
11970            encoder: &mut fidl::encoding::Encoder<
11971                '_,
11972                fidl::encoding::DefaultFuchsiaResourceDialect,
11973            >,
11974            offset: usize,
11975            mut depth: fidl::encoding::Depth,
11976        ) -> fidl::Result<()> {
11977            encoder.debug_check_bounds::<SuiteEvent>(offset);
11978            // Vector header
11979            let max_ordinal: u64 = self.max_ordinal_present();
11980            encoder.write_num(max_ordinal, offset);
11981            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11982            // Calling encoder.out_of_line_offset(0) is not allowed.
11983            if max_ordinal == 0 {
11984                return Ok(());
11985            }
11986            depth.increment()?;
11987            let envelope_size = 8;
11988            let bytes_len = max_ordinal as usize * envelope_size;
11989            #[allow(unused_variables)]
11990            let offset = encoder.out_of_line_offset(bytes_len);
11991            let mut _prev_end_offset: usize = 0;
11992            if 1 > max_ordinal {
11993                return Ok(());
11994            }
11995
11996            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11997            // are envelope_size bytes.
11998            let cur_offset: usize = (1 - 1) * envelope_size;
11999
12000            // Zero reserved fields.
12001            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12002
12003            // Safety:
12004            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12005            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12006            //   envelope_size bytes, there is always sufficient room.
12007            fidl::encoding::encode_in_envelope_optional::<
12008                i64,
12009                fidl::encoding::DefaultFuchsiaResourceDialect,
12010            >(
12011                self.timestamp.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
12012                encoder,
12013                offset + cur_offset,
12014                depth,
12015            )?;
12016
12017            _prev_end_offset = cur_offset + envelope_size;
12018            if 2 > max_ordinal {
12019                return Ok(());
12020            }
12021
12022            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12023            // are envelope_size bytes.
12024            let cur_offset: usize = (2 - 1) * envelope_size;
12025
12026            // Zero reserved fields.
12027            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12028
12029            // Safety:
12030            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12031            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12032            //   envelope_size bytes, there is always sufficient room.
12033            fidl::encoding::encode_in_envelope_optional::<
12034                SuiteEventPayload,
12035                fidl::encoding::DefaultFuchsiaResourceDialect,
12036            >(
12037                self.payload
12038                    .as_mut()
12039                    .map(<SuiteEventPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12040                encoder,
12041                offset + cur_offset,
12042                depth,
12043            )?;
12044
12045            _prev_end_offset = cur_offset + envelope_size;
12046
12047            Ok(())
12048        }
12049    }
12050
12051    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for SuiteEvent {
12052        #[inline(always)]
12053        fn new_empty() -> Self {
12054            Self::default()
12055        }
12056
12057        unsafe fn decode(
12058            &mut self,
12059            decoder: &mut fidl::encoding::Decoder<
12060                '_,
12061                fidl::encoding::DefaultFuchsiaResourceDialect,
12062            >,
12063            offset: usize,
12064            mut depth: fidl::encoding::Depth,
12065        ) -> fidl::Result<()> {
12066            decoder.debug_check_bounds::<Self>(offset);
12067            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12068                None => return Err(fidl::Error::NotNullable),
12069                Some(len) => len,
12070            };
12071            // Calling decoder.out_of_line_offset(0) is not allowed.
12072            if len == 0 {
12073                return Ok(());
12074            };
12075            depth.increment()?;
12076            let envelope_size = 8;
12077            let bytes_len = len * envelope_size;
12078            let offset = decoder.out_of_line_offset(bytes_len)?;
12079            // Decode the envelope for each type.
12080            let mut _next_ordinal_to_read = 0;
12081            let mut next_offset = offset;
12082            let end_offset = offset + bytes_len;
12083            _next_ordinal_to_read += 1;
12084            if next_offset >= end_offset {
12085                return Ok(());
12086            }
12087
12088            // Decode unknown envelopes for gaps in ordinals.
12089            while _next_ordinal_to_read < 1 {
12090                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12091                _next_ordinal_to_read += 1;
12092                next_offset += envelope_size;
12093            }
12094
12095            let next_out_of_line = decoder.next_out_of_line();
12096            let handles_before = decoder.remaining_handles();
12097            if let Some((inlined, num_bytes, num_handles)) =
12098                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12099            {
12100                let member_inline_size =
12101                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12102                if inlined != (member_inline_size <= 4) {
12103                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12104                }
12105                let inner_offset;
12106                let mut inner_depth = depth.clone();
12107                if inlined {
12108                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12109                    inner_offset = next_offset;
12110                } else {
12111                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12112                    inner_depth.increment()?;
12113                }
12114                let val_ref = self.timestamp.get_or_insert_with(|| {
12115                    fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
12116                });
12117                fidl::decode!(
12118                    i64,
12119                    fidl::encoding::DefaultFuchsiaResourceDialect,
12120                    val_ref,
12121                    decoder,
12122                    inner_offset,
12123                    inner_depth
12124                )?;
12125                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12126                {
12127                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12128                }
12129                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12130                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12131                }
12132            }
12133
12134            next_offset += envelope_size;
12135            _next_ordinal_to_read += 1;
12136            if next_offset >= end_offset {
12137                return Ok(());
12138            }
12139
12140            // Decode unknown envelopes for gaps in ordinals.
12141            while _next_ordinal_to_read < 2 {
12142                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12143                _next_ordinal_to_read += 1;
12144                next_offset += envelope_size;
12145            }
12146
12147            let next_out_of_line = decoder.next_out_of_line();
12148            let handles_before = decoder.remaining_handles();
12149            if let Some((inlined, num_bytes, num_handles)) =
12150                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12151            {
12152                let member_inline_size =
12153                    <SuiteEventPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12154                if inlined != (member_inline_size <= 4) {
12155                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12156                }
12157                let inner_offset;
12158                let mut inner_depth = depth.clone();
12159                if inlined {
12160                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12161                    inner_offset = next_offset;
12162                } else {
12163                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12164                    inner_depth.increment()?;
12165                }
12166                let val_ref = self.payload.get_or_insert_with(|| {
12167                    fidl::new_empty!(
12168                        SuiteEventPayload,
12169                        fidl::encoding::DefaultFuchsiaResourceDialect
12170                    )
12171                });
12172                fidl::decode!(
12173                    SuiteEventPayload,
12174                    fidl::encoding::DefaultFuchsiaResourceDialect,
12175                    val_ref,
12176                    decoder,
12177                    inner_offset,
12178                    inner_depth
12179                )?;
12180                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12181                {
12182                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12183                }
12184                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12185                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12186                }
12187            }
12188
12189            next_offset += envelope_size;
12190
12191            // Decode the remaining unknown envelopes.
12192            while next_offset < end_offset {
12193                _next_ordinal_to_read += 1;
12194                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12195                next_offset += envelope_size;
12196            }
12197
12198            Ok(())
12199        }
12200    }
12201
12202    impl TestCaseArtifactGeneratedEventDetails {
12203        #[inline(always)]
12204        fn max_ordinal_present(&self) -> u64 {
12205            if let Some(_) = self.artifact {
12206                return 2;
12207            }
12208            if let Some(_) = self.test_case_id {
12209                return 1;
12210            }
12211            0
12212        }
12213    }
12214
12215    impl fidl::encoding::ResourceTypeMarker for TestCaseArtifactGeneratedEventDetails {
12216        type Borrowed<'a> = &'a mut Self;
12217        fn take_or_borrow<'a>(
12218            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12219        ) -> Self::Borrowed<'a> {
12220            value
12221        }
12222    }
12223
12224    unsafe impl fidl::encoding::TypeMarker for TestCaseArtifactGeneratedEventDetails {
12225        type Owned = Self;
12226
12227        #[inline(always)]
12228        fn inline_align(_context: fidl::encoding::Context) -> usize {
12229            8
12230        }
12231
12232        #[inline(always)]
12233        fn inline_size(_context: fidl::encoding::Context) -> usize {
12234            16
12235        }
12236    }
12237
12238    unsafe impl
12239        fidl::encoding::Encode<
12240            TestCaseArtifactGeneratedEventDetails,
12241            fidl::encoding::DefaultFuchsiaResourceDialect,
12242        > for &mut TestCaseArtifactGeneratedEventDetails
12243    {
12244        unsafe fn encode(
12245            self,
12246            encoder: &mut fidl::encoding::Encoder<
12247                '_,
12248                fidl::encoding::DefaultFuchsiaResourceDialect,
12249            >,
12250            offset: usize,
12251            mut depth: fidl::encoding::Depth,
12252        ) -> fidl::Result<()> {
12253            encoder.debug_check_bounds::<TestCaseArtifactGeneratedEventDetails>(offset);
12254            // Vector header
12255            let max_ordinal: u64 = self.max_ordinal_present();
12256            encoder.write_num(max_ordinal, offset);
12257            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12258            // Calling encoder.out_of_line_offset(0) is not allowed.
12259            if max_ordinal == 0 {
12260                return Ok(());
12261            }
12262            depth.increment()?;
12263            let envelope_size = 8;
12264            let bytes_len = max_ordinal as usize * envelope_size;
12265            #[allow(unused_variables)]
12266            let offset = encoder.out_of_line_offset(bytes_len);
12267            let mut _prev_end_offset: usize = 0;
12268            if 1 > max_ordinal {
12269                return Ok(());
12270            }
12271
12272            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12273            // are envelope_size bytes.
12274            let cur_offset: usize = (1 - 1) * envelope_size;
12275
12276            // Zero reserved fields.
12277            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12278
12279            // Safety:
12280            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12281            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12282            //   envelope_size bytes, there is always sufficient room.
12283            fidl::encoding::encode_in_envelope_optional::<
12284                u32,
12285                fidl::encoding::DefaultFuchsiaResourceDialect,
12286            >(
12287                self.test_case_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
12288                encoder,
12289                offset + cur_offset,
12290                depth,
12291            )?;
12292
12293            _prev_end_offset = cur_offset + envelope_size;
12294            if 2 > max_ordinal {
12295                return Ok(());
12296            }
12297
12298            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12299            // are envelope_size bytes.
12300            let cur_offset: usize = (2 - 1) * envelope_size;
12301
12302            // Zero reserved fields.
12303            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12304
12305            // Safety:
12306            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12307            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12308            //   envelope_size bytes, there is always sufficient room.
12309            fidl::encoding::encode_in_envelope_optional::<
12310                Artifact,
12311                fidl::encoding::DefaultFuchsiaResourceDialect,
12312            >(
12313                self.artifact
12314                    .as_mut()
12315                    .map(<Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12316                encoder,
12317                offset + cur_offset,
12318                depth,
12319            )?;
12320
12321            _prev_end_offset = cur_offset + envelope_size;
12322
12323            Ok(())
12324        }
12325    }
12326
12327    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12328        for TestCaseArtifactGeneratedEventDetails
12329    {
12330        #[inline(always)]
12331        fn new_empty() -> Self {
12332            Self::default()
12333        }
12334
12335        unsafe fn decode(
12336            &mut self,
12337            decoder: &mut fidl::encoding::Decoder<
12338                '_,
12339                fidl::encoding::DefaultFuchsiaResourceDialect,
12340            >,
12341            offset: usize,
12342            mut depth: fidl::encoding::Depth,
12343        ) -> fidl::Result<()> {
12344            decoder.debug_check_bounds::<Self>(offset);
12345            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12346                None => return Err(fidl::Error::NotNullable),
12347                Some(len) => len,
12348            };
12349            // Calling decoder.out_of_line_offset(0) is not allowed.
12350            if len == 0 {
12351                return Ok(());
12352            };
12353            depth.increment()?;
12354            let envelope_size = 8;
12355            let bytes_len = len * envelope_size;
12356            let offset = decoder.out_of_line_offset(bytes_len)?;
12357            // Decode the envelope for each type.
12358            let mut _next_ordinal_to_read = 0;
12359            let mut next_offset = offset;
12360            let end_offset = offset + bytes_len;
12361            _next_ordinal_to_read += 1;
12362            if next_offset >= end_offset {
12363                return Ok(());
12364            }
12365
12366            // Decode unknown envelopes for gaps in ordinals.
12367            while _next_ordinal_to_read < 1 {
12368                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12369                _next_ordinal_to_read += 1;
12370                next_offset += envelope_size;
12371            }
12372
12373            let next_out_of_line = decoder.next_out_of_line();
12374            let handles_before = decoder.remaining_handles();
12375            if let Some((inlined, num_bytes, num_handles)) =
12376                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12377            {
12378                let member_inline_size =
12379                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12380                if inlined != (member_inline_size <= 4) {
12381                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12382                }
12383                let inner_offset;
12384                let mut inner_depth = depth.clone();
12385                if inlined {
12386                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12387                    inner_offset = next_offset;
12388                } else {
12389                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12390                    inner_depth.increment()?;
12391                }
12392                let val_ref = self.test_case_id.get_or_insert_with(|| {
12393                    fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
12394                });
12395                fidl::decode!(
12396                    u32,
12397                    fidl::encoding::DefaultFuchsiaResourceDialect,
12398                    val_ref,
12399                    decoder,
12400                    inner_offset,
12401                    inner_depth
12402                )?;
12403                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12404                {
12405                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12406                }
12407                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12408                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12409                }
12410            }
12411
12412            next_offset += envelope_size;
12413            _next_ordinal_to_read += 1;
12414            if next_offset >= end_offset {
12415                return Ok(());
12416            }
12417
12418            // Decode unknown envelopes for gaps in ordinals.
12419            while _next_ordinal_to_read < 2 {
12420                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12421                _next_ordinal_to_read += 1;
12422                next_offset += envelope_size;
12423            }
12424
12425            let next_out_of_line = decoder.next_out_of_line();
12426            let handles_before = decoder.remaining_handles();
12427            if let Some((inlined, num_bytes, num_handles)) =
12428                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12429            {
12430                let member_inline_size =
12431                    <Artifact as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12432                if inlined != (member_inline_size <= 4) {
12433                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12434                }
12435                let inner_offset;
12436                let mut inner_depth = depth.clone();
12437                if inlined {
12438                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12439                    inner_offset = next_offset;
12440                } else {
12441                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12442                    inner_depth.increment()?;
12443                }
12444                let val_ref = self.artifact.get_or_insert_with(|| {
12445                    fidl::new_empty!(Artifact, fidl::encoding::DefaultFuchsiaResourceDialect)
12446                });
12447                fidl::decode!(
12448                    Artifact,
12449                    fidl::encoding::DefaultFuchsiaResourceDialect,
12450                    val_ref,
12451                    decoder,
12452                    inner_offset,
12453                    inner_depth
12454                )?;
12455                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12456                {
12457                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12458                }
12459                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12460                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12461                }
12462            }
12463
12464            next_offset += envelope_size;
12465
12466            // Decode the remaining unknown envelopes.
12467            while next_offset < end_offset {
12468                _next_ordinal_to_read += 1;
12469                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12470                next_offset += envelope_size;
12471            }
12472
12473            Ok(())
12474        }
12475    }
12476
12477    impl fidl::encoding::ResourceTypeMarker for Artifact {
12478        type Borrowed<'a> = &'a mut Self;
12479        fn take_or_borrow<'a>(
12480            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12481        ) -> Self::Borrowed<'a> {
12482            value
12483        }
12484    }
12485
12486    unsafe impl fidl::encoding::TypeMarker for Artifact {
12487        type Owned = Self;
12488
12489        #[inline(always)]
12490        fn inline_align(_context: fidl::encoding::Context) -> usize {
12491            8
12492        }
12493
12494        #[inline(always)]
12495        fn inline_size(_context: fidl::encoding::Context) -> usize {
12496            16
12497        }
12498    }
12499
12500    unsafe impl fidl::encoding::Encode<Artifact, fidl::encoding::DefaultFuchsiaResourceDialect>
12501        for &mut Artifact
12502    {
12503        #[inline]
12504        unsafe fn encode(
12505            self,
12506            encoder: &mut fidl::encoding::Encoder<
12507                '_,
12508                fidl::encoding::DefaultFuchsiaResourceDialect,
12509            >,
12510            offset: usize,
12511            _depth: fidl::encoding::Depth,
12512        ) -> fidl::Result<()> {
12513            encoder.debug_check_bounds::<Artifact>(offset);
12514            encoder.write_num::<u64>(self.ordinal(), offset);
12515            match self {
12516                Artifact::Stdout(ref mut val) => fidl::encoding::encode_in_envelope::<
12517                    fidl::encoding::HandleType<
12518                        fidl::Socket,
12519                        { fidl::ObjectType::SOCKET.into_raw() },
12520                        2147483648,
12521                    >,
12522                    fidl::encoding::DefaultFuchsiaResourceDialect,
12523                >(
12524                    <fidl::encoding::HandleType<
12525                        fidl::Socket,
12526                        { fidl::ObjectType::SOCKET.into_raw() },
12527                        2147483648,
12528                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12529                        val
12530                    ),
12531                    encoder,
12532                    offset + 8,
12533                    _depth,
12534                ),
12535                Artifact::Stderr(ref mut val) => fidl::encoding::encode_in_envelope::<
12536                    fidl::encoding::HandleType<
12537                        fidl::Socket,
12538                        { fidl::ObjectType::SOCKET.into_raw() },
12539                        2147483648,
12540                    >,
12541                    fidl::encoding::DefaultFuchsiaResourceDialect,
12542                >(
12543                    <fidl::encoding::HandleType<
12544                        fidl::Socket,
12545                        { fidl::ObjectType::SOCKET.into_raw() },
12546                        2147483648,
12547                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12548                        val
12549                    ),
12550                    encoder,
12551                    offset + 8,
12552                    _depth,
12553                ),
12554                Artifact::Log(ref mut val) => fidl::encoding::encode_in_envelope::<
12555                    Syslog,
12556                    fidl::encoding::DefaultFuchsiaResourceDialect,
12557                >(
12558                    <Syslog as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12559                    encoder,
12560                    offset + 8,
12561                    _depth,
12562                ),
12563                Artifact::Custom(ref mut val) => fidl::encoding::encode_in_envelope::<
12564                    CustomArtifact,
12565                    fidl::encoding::DefaultFuchsiaResourceDialect,
12566                >(
12567                    <CustomArtifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12568                    encoder,
12569                    offset + 8,
12570                    _depth,
12571                ),
12572                Artifact::DebugData(ref mut val) => {
12573                    fidl::encoding::encode_in_envelope::<
12574                        fidl::encoding::Endpoint<
12575                            fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
12576                        >,
12577                        fidl::encoding::DefaultFuchsiaResourceDialect,
12578                    >(
12579                        <fidl::encoding::Endpoint<
12580                            fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
12581                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12582                            val
12583                        ),
12584                        encoder,
12585                        offset + 8,
12586                        _depth,
12587                    )
12588                }
12589                Artifact::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
12590            }
12591        }
12592    }
12593
12594    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Artifact {
12595        #[inline(always)]
12596        fn new_empty() -> Self {
12597            Self::__SourceBreaking { unknown_ordinal: 0 }
12598        }
12599
12600        #[inline]
12601        unsafe fn decode(
12602            &mut self,
12603            decoder: &mut fidl::encoding::Decoder<
12604                '_,
12605                fidl::encoding::DefaultFuchsiaResourceDialect,
12606            >,
12607            offset: usize,
12608            mut depth: fidl::encoding::Depth,
12609        ) -> fidl::Result<()> {
12610            decoder.debug_check_bounds::<Self>(offset);
12611            #[allow(unused_variables)]
12612            let next_out_of_line = decoder.next_out_of_line();
12613            let handles_before = decoder.remaining_handles();
12614            let (ordinal, inlined, num_bytes, num_handles) =
12615                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12616
12617            let member_inline_size =
12618                match ordinal {
12619                    1 => <fidl::encoding::HandleType<
12620                        fidl::Socket,
12621                        { fidl::ObjectType::SOCKET.into_raw() },
12622                        2147483648,
12623                    > as fidl::encoding::TypeMarker>::inline_size(
12624                        decoder.context
12625                    ),
12626                    2 => <fidl::encoding::HandleType<
12627                        fidl::Socket,
12628                        { fidl::ObjectType::SOCKET.into_raw() },
12629                        2147483648,
12630                    > as fidl::encoding::TypeMarker>::inline_size(
12631                        decoder.context
12632                    ),
12633                    3 => <Syslog as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12634                    4 => {
12635                        <CustomArtifact as fidl::encoding::TypeMarker>::inline_size(decoder.context)
12636                    }
12637                    5 => <fidl::encoding::Endpoint<
12638                        fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
12639                    > as fidl::encoding::TypeMarker>::inline_size(
12640                        decoder.context
12641                    ),
12642                    0 => return Err(fidl::Error::UnknownUnionTag),
12643                    _ => num_bytes as usize,
12644                };
12645
12646            if inlined != (member_inline_size <= 4) {
12647                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12648            }
12649            let _inner_offset;
12650            if inlined {
12651                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12652                _inner_offset = offset + 8;
12653            } else {
12654                depth.increment()?;
12655                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12656            }
12657            match ordinal {
12658                1 => {
12659                    #[allow(irrefutable_let_patterns)]
12660                    if let Artifact::Stdout(_) = self {
12661                        // Do nothing, read the value into the object
12662                    } else {
12663                        // Initialize `self` to the right variant
12664                        *self = Artifact::Stdout(
12665                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12666                        );
12667                    }
12668                    #[allow(irrefutable_let_patterns)]
12669                    if let Artifact::Stdout(ref mut val) = self {
12670                        fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
12671                    } else {
12672                        unreachable!()
12673                    }
12674                }
12675                2 => {
12676                    #[allow(irrefutable_let_patterns)]
12677                    if let Artifact::Stderr(_) = self {
12678                        // Do nothing, read the value into the object
12679                    } else {
12680                        // Initialize `self` to the right variant
12681                        *self = Artifact::Stderr(
12682                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12683                        );
12684                    }
12685                    #[allow(irrefutable_let_patterns)]
12686                    if let Artifact::Stderr(ref mut val) = self {
12687                        fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
12688                    } else {
12689                        unreachable!()
12690                    }
12691                }
12692                3 => {
12693                    #[allow(irrefutable_let_patterns)]
12694                    if let Artifact::Log(_) = self {
12695                        // Do nothing, read the value into the object
12696                    } else {
12697                        // Initialize `self` to the right variant
12698                        *self = Artifact::Log(fidl::new_empty!(
12699                            Syslog,
12700                            fidl::encoding::DefaultFuchsiaResourceDialect
12701                        ));
12702                    }
12703                    #[allow(irrefutable_let_patterns)]
12704                    if let Artifact::Log(ref mut val) = self {
12705                        fidl::decode!(
12706                            Syslog,
12707                            fidl::encoding::DefaultFuchsiaResourceDialect,
12708                            val,
12709                            decoder,
12710                            _inner_offset,
12711                            depth
12712                        )?;
12713                    } else {
12714                        unreachable!()
12715                    }
12716                }
12717                4 => {
12718                    #[allow(irrefutable_let_patterns)]
12719                    if let Artifact::Custom(_) = self {
12720                        // Do nothing, read the value into the object
12721                    } else {
12722                        // Initialize `self` to the right variant
12723                        *self = Artifact::Custom(fidl::new_empty!(
12724                            CustomArtifact,
12725                            fidl::encoding::DefaultFuchsiaResourceDialect
12726                        ));
12727                    }
12728                    #[allow(irrefutable_let_patterns)]
12729                    if let Artifact::Custom(ref mut val) = self {
12730                        fidl::decode!(
12731                            CustomArtifact,
12732                            fidl::encoding::DefaultFuchsiaResourceDialect,
12733                            val,
12734                            decoder,
12735                            _inner_offset,
12736                            depth
12737                        )?;
12738                    } else {
12739                        unreachable!()
12740                    }
12741                }
12742                5 => {
12743                    #[allow(irrefutable_let_patterns)]
12744                    if let Artifact::DebugData(_) = self {
12745                        // Do nothing, read the value into the object
12746                    } else {
12747                        // Initialize `self` to the right variant
12748                        *self = Artifact::DebugData(fidl::new_empty!(
12749                            fidl::encoding::Endpoint<
12750                                fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
12751                            >,
12752                            fidl::encoding::DefaultFuchsiaResourceDialect
12753                        ));
12754                    }
12755                    #[allow(irrefutable_let_patterns)]
12756                    if let Artifact::DebugData(ref mut val) = self {
12757                        fidl::decode!(
12758                            fidl::encoding::Endpoint<
12759                                fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
12760                            >,
12761                            fidl::encoding::DefaultFuchsiaResourceDialect,
12762                            val,
12763                            decoder,
12764                            _inner_offset,
12765                            depth
12766                        )?;
12767                    } else {
12768                        unreachable!()
12769                    }
12770                }
12771                #[allow(deprecated)]
12772                ordinal => {
12773                    for _ in 0..num_handles {
12774                        decoder.drop_next_handle()?;
12775                    }
12776                    *self = Artifact::__SourceBreaking { unknown_ordinal: ordinal };
12777                }
12778            }
12779            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12780                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12781            }
12782            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12783                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12784            }
12785            Ok(())
12786        }
12787    }
12788
12789    impl fidl::encoding::ResourceTypeMarker for EventDetails {
12790        type Borrowed<'a> = &'a mut Self;
12791        fn take_or_borrow<'a>(
12792            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12793        ) -> Self::Borrowed<'a> {
12794            value
12795        }
12796    }
12797
12798    unsafe impl fidl::encoding::TypeMarker for EventDetails {
12799        type Owned = Self;
12800
12801        #[inline(always)]
12802        fn inline_align(_context: fidl::encoding::Context) -> usize {
12803            8
12804        }
12805
12806        #[inline(always)]
12807        fn inline_size(_context: fidl::encoding::Context) -> usize {
12808            16
12809        }
12810    }
12811
12812    unsafe impl fidl::encoding::Encode<EventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>
12813        for &mut EventDetails
12814    {
12815        #[inline]
12816        unsafe fn encode(
12817            self,
12818            encoder: &mut fidl::encoding::Encoder<
12819                '_,
12820                fidl::encoding::DefaultFuchsiaResourceDialect,
12821            >,
12822            offset: usize,
12823            _depth: fidl::encoding::Depth,
12824        ) -> fidl::Result<()> {
12825            encoder.debug_check_bounds::<EventDetails>(offset);
12826            encoder.write_num::<u64>(self.ordinal(), offset);
12827            match self {
12828            EventDetails::SuiteStarted(ref val) => {
12829                fidl::encoding::encode_in_envelope::<SuiteStartedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12830                    <SuiteStartedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12831                    encoder, offset + 8, _depth
12832                )
12833            }
12834            EventDetails::TestCaseFound(ref val) => {
12835                fidl::encoding::encode_in_envelope::<TestCaseFoundEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12836                    <TestCaseFoundEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12837                    encoder, offset + 8, _depth
12838                )
12839            }
12840            EventDetails::TestCaseStarted(ref val) => {
12841                fidl::encoding::encode_in_envelope::<TestCaseStartedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12842                    <TestCaseStartedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12843                    encoder, offset + 8, _depth
12844                )
12845            }
12846            EventDetails::TestCaseArtifactGenerated(ref mut val) => {
12847                fidl::encoding::encode_in_envelope::<TestCaseArtifactGeneratedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12848                    <TestCaseArtifactGeneratedEventDetails as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12849                    encoder, offset + 8, _depth
12850                )
12851            }
12852            EventDetails::TestCaseStopped(ref val) => {
12853                fidl::encoding::encode_in_envelope::<TestCaseStoppedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12854                    <TestCaseStoppedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12855                    encoder, offset + 8, _depth
12856                )
12857            }
12858            EventDetails::TestCaseFinished(ref val) => {
12859                fidl::encoding::encode_in_envelope::<TestCaseFinishedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12860                    <TestCaseFinishedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12861                    encoder, offset + 8, _depth
12862                )
12863            }
12864            EventDetails::SuiteArtifactGenerated(ref mut val) => {
12865                fidl::encoding::encode_in_envelope::<SuiteArtifactGeneratedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12866                    <SuiteArtifactGeneratedEventDetails as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12867                    encoder, offset + 8, _depth
12868                )
12869            }
12870            EventDetails::SuiteStopped(ref val) => {
12871                fidl::encoding::encode_in_envelope::<SuiteStoppedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12872                    <SuiteStoppedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12873                    encoder, offset + 8, _depth
12874                )
12875            }
12876            EventDetails::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
12877        }
12878        }
12879    }
12880
12881    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for EventDetails {
12882        #[inline(always)]
12883        fn new_empty() -> Self {
12884            Self::__SourceBreaking { unknown_ordinal: 0 }
12885        }
12886
12887        #[inline]
12888        unsafe fn decode(
12889            &mut self,
12890            decoder: &mut fidl::encoding::Decoder<
12891                '_,
12892                fidl::encoding::DefaultFuchsiaResourceDialect,
12893            >,
12894            offset: usize,
12895            mut depth: fidl::encoding::Depth,
12896        ) -> fidl::Result<()> {
12897            decoder.debug_check_bounds::<Self>(offset);
12898            #[allow(unused_variables)]
12899            let next_out_of_line = decoder.next_out_of_line();
12900            let handles_before = decoder.remaining_handles();
12901            let (ordinal, inlined, num_bytes, num_handles) =
12902                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12903
12904            let member_inline_size = match ordinal {
12905            1 => <SuiteStartedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12906            2 => <TestCaseFoundEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12907            3 => <TestCaseStartedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12908            4 => <TestCaseArtifactGeneratedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12909            5 => <TestCaseStoppedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12910            6 => <TestCaseFinishedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12911            7 => <SuiteArtifactGeneratedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12912            8 => <SuiteStoppedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12913            0 => return Err(fidl::Error::UnknownUnionTag),
12914            _ => num_bytes as usize,
12915        };
12916
12917            if inlined != (member_inline_size <= 4) {
12918                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12919            }
12920            let _inner_offset;
12921            if inlined {
12922                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12923                _inner_offset = offset + 8;
12924            } else {
12925                depth.increment()?;
12926                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12927            }
12928            match ordinal {
12929                1 => {
12930                    #[allow(irrefutable_let_patterns)]
12931                    if let EventDetails::SuiteStarted(_) = self {
12932                        // Do nothing, read the value into the object
12933                    } else {
12934                        // Initialize `self` to the right variant
12935                        *self = EventDetails::SuiteStarted(fidl::new_empty!(
12936                            SuiteStartedEventDetails,
12937                            fidl::encoding::DefaultFuchsiaResourceDialect
12938                        ));
12939                    }
12940                    #[allow(irrefutable_let_patterns)]
12941                    if let EventDetails::SuiteStarted(ref mut val) = self {
12942                        fidl::decode!(
12943                            SuiteStartedEventDetails,
12944                            fidl::encoding::DefaultFuchsiaResourceDialect,
12945                            val,
12946                            decoder,
12947                            _inner_offset,
12948                            depth
12949                        )?;
12950                    } else {
12951                        unreachable!()
12952                    }
12953                }
12954                2 => {
12955                    #[allow(irrefutable_let_patterns)]
12956                    if let EventDetails::TestCaseFound(_) = self {
12957                        // Do nothing, read the value into the object
12958                    } else {
12959                        // Initialize `self` to the right variant
12960                        *self = EventDetails::TestCaseFound(fidl::new_empty!(
12961                            TestCaseFoundEventDetails,
12962                            fidl::encoding::DefaultFuchsiaResourceDialect
12963                        ));
12964                    }
12965                    #[allow(irrefutable_let_patterns)]
12966                    if let EventDetails::TestCaseFound(ref mut val) = self {
12967                        fidl::decode!(
12968                            TestCaseFoundEventDetails,
12969                            fidl::encoding::DefaultFuchsiaResourceDialect,
12970                            val,
12971                            decoder,
12972                            _inner_offset,
12973                            depth
12974                        )?;
12975                    } else {
12976                        unreachable!()
12977                    }
12978                }
12979                3 => {
12980                    #[allow(irrefutable_let_patterns)]
12981                    if let EventDetails::TestCaseStarted(_) = self {
12982                        // Do nothing, read the value into the object
12983                    } else {
12984                        // Initialize `self` to the right variant
12985                        *self = EventDetails::TestCaseStarted(fidl::new_empty!(
12986                            TestCaseStartedEventDetails,
12987                            fidl::encoding::DefaultFuchsiaResourceDialect
12988                        ));
12989                    }
12990                    #[allow(irrefutable_let_patterns)]
12991                    if let EventDetails::TestCaseStarted(ref mut val) = self {
12992                        fidl::decode!(
12993                            TestCaseStartedEventDetails,
12994                            fidl::encoding::DefaultFuchsiaResourceDialect,
12995                            val,
12996                            decoder,
12997                            _inner_offset,
12998                            depth
12999                        )?;
13000                    } else {
13001                        unreachable!()
13002                    }
13003                }
13004                4 => {
13005                    #[allow(irrefutable_let_patterns)]
13006                    if let EventDetails::TestCaseArtifactGenerated(_) = self {
13007                        // Do nothing, read the value into the object
13008                    } else {
13009                        // Initialize `self` to the right variant
13010                        *self = EventDetails::TestCaseArtifactGenerated(fidl::new_empty!(
13011                            TestCaseArtifactGeneratedEventDetails,
13012                            fidl::encoding::DefaultFuchsiaResourceDialect
13013                        ));
13014                    }
13015                    #[allow(irrefutable_let_patterns)]
13016                    if let EventDetails::TestCaseArtifactGenerated(ref mut val) = self {
13017                        fidl::decode!(
13018                            TestCaseArtifactGeneratedEventDetails,
13019                            fidl::encoding::DefaultFuchsiaResourceDialect,
13020                            val,
13021                            decoder,
13022                            _inner_offset,
13023                            depth
13024                        )?;
13025                    } else {
13026                        unreachable!()
13027                    }
13028                }
13029                5 => {
13030                    #[allow(irrefutable_let_patterns)]
13031                    if let EventDetails::TestCaseStopped(_) = self {
13032                        // Do nothing, read the value into the object
13033                    } else {
13034                        // Initialize `self` to the right variant
13035                        *self = EventDetails::TestCaseStopped(fidl::new_empty!(
13036                            TestCaseStoppedEventDetails,
13037                            fidl::encoding::DefaultFuchsiaResourceDialect
13038                        ));
13039                    }
13040                    #[allow(irrefutable_let_patterns)]
13041                    if let EventDetails::TestCaseStopped(ref mut val) = self {
13042                        fidl::decode!(
13043                            TestCaseStoppedEventDetails,
13044                            fidl::encoding::DefaultFuchsiaResourceDialect,
13045                            val,
13046                            decoder,
13047                            _inner_offset,
13048                            depth
13049                        )?;
13050                    } else {
13051                        unreachable!()
13052                    }
13053                }
13054                6 => {
13055                    #[allow(irrefutable_let_patterns)]
13056                    if let EventDetails::TestCaseFinished(_) = self {
13057                        // Do nothing, read the value into the object
13058                    } else {
13059                        // Initialize `self` to the right variant
13060                        *self = EventDetails::TestCaseFinished(fidl::new_empty!(
13061                            TestCaseFinishedEventDetails,
13062                            fidl::encoding::DefaultFuchsiaResourceDialect
13063                        ));
13064                    }
13065                    #[allow(irrefutable_let_patterns)]
13066                    if let EventDetails::TestCaseFinished(ref mut val) = self {
13067                        fidl::decode!(
13068                            TestCaseFinishedEventDetails,
13069                            fidl::encoding::DefaultFuchsiaResourceDialect,
13070                            val,
13071                            decoder,
13072                            _inner_offset,
13073                            depth
13074                        )?;
13075                    } else {
13076                        unreachable!()
13077                    }
13078                }
13079                7 => {
13080                    #[allow(irrefutable_let_patterns)]
13081                    if let EventDetails::SuiteArtifactGenerated(_) = self {
13082                        // Do nothing, read the value into the object
13083                    } else {
13084                        // Initialize `self` to the right variant
13085                        *self = EventDetails::SuiteArtifactGenerated(fidl::new_empty!(
13086                            SuiteArtifactGeneratedEventDetails,
13087                            fidl::encoding::DefaultFuchsiaResourceDialect
13088                        ));
13089                    }
13090                    #[allow(irrefutable_let_patterns)]
13091                    if let EventDetails::SuiteArtifactGenerated(ref mut val) = self {
13092                        fidl::decode!(
13093                            SuiteArtifactGeneratedEventDetails,
13094                            fidl::encoding::DefaultFuchsiaResourceDialect,
13095                            val,
13096                            decoder,
13097                            _inner_offset,
13098                            depth
13099                        )?;
13100                    } else {
13101                        unreachable!()
13102                    }
13103                }
13104                8 => {
13105                    #[allow(irrefutable_let_patterns)]
13106                    if let EventDetails::SuiteStopped(_) = self {
13107                        // Do nothing, read the value into the object
13108                    } else {
13109                        // Initialize `self` to the right variant
13110                        *self = EventDetails::SuiteStopped(fidl::new_empty!(
13111                            SuiteStoppedEventDetails,
13112                            fidl::encoding::DefaultFuchsiaResourceDialect
13113                        ));
13114                    }
13115                    #[allow(irrefutable_let_patterns)]
13116                    if let EventDetails::SuiteStopped(ref mut val) = self {
13117                        fidl::decode!(
13118                            SuiteStoppedEventDetails,
13119                            fidl::encoding::DefaultFuchsiaResourceDialect,
13120                            val,
13121                            decoder,
13122                            _inner_offset,
13123                            depth
13124                        )?;
13125                    } else {
13126                        unreachable!()
13127                    }
13128                }
13129                #[allow(deprecated)]
13130                ordinal => {
13131                    for _ in 0..num_handles {
13132                        decoder.drop_next_handle()?;
13133                    }
13134                    *self = EventDetails::__SourceBreaking { unknown_ordinal: ordinal };
13135                }
13136            }
13137            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13138                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13139            }
13140            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13141                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13142            }
13143            Ok(())
13144        }
13145    }
13146
13147    impl fidl::encoding::ResourceTypeMarker for LogsIterator {
13148        type Borrowed<'a> = &'a mut Self;
13149        fn take_or_borrow<'a>(
13150            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13151        ) -> Self::Borrowed<'a> {
13152            value
13153        }
13154    }
13155
13156    unsafe impl fidl::encoding::TypeMarker for LogsIterator {
13157        type Owned = Self;
13158
13159        #[inline(always)]
13160        fn inline_align(_context: fidl::encoding::Context) -> usize {
13161            8
13162        }
13163
13164        #[inline(always)]
13165        fn inline_size(_context: fidl::encoding::Context) -> usize {
13166            16
13167        }
13168    }
13169
13170    unsafe impl fidl::encoding::Encode<LogsIterator, fidl::encoding::DefaultFuchsiaResourceDialect>
13171        for &mut LogsIterator
13172    {
13173        #[inline]
13174        unsafe fn encode(
13175            self,
13176            encoder: &mut fidl::encoding::Encoder<
13177                '_,
13178                fidl::encoding::DefaultFuchsiaResourceDialect,
13179            >,
13180            offset: usize,
13181            _depth: fidl::encoding::Depth,
13182        ) -> fidl::Result<()> {
13183            encoder.debug_check_bounds::<LogsIterator>(offset);
13184            encoder.write_num::<u64>(self.ordinal(), offset);
13185            match self {
13186                LogsIterator::Batch(ref mut val) => fidl::encoding::encode_in_envelope::<
13187                    fidl::encoding::Endpoint<
13188                        fidl::endpoints::ServerEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13189                    >,
13190                    fidl::encoding::DefaultFuchsiaResourceDialect,
13191                >(
13192                    <fidl::encoding::Endpoint<
13193                        fidl::endpoints::ServerEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13194                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13195                        val
13196                    ),
13197                    encoder,
13198                    offset + 8,
13199                    _depth,
13200                ),
13201                LogsIterator::Stream(ref mut val) => fidl::encoding::encode_in_envelope::<
13202                    fidl::encoding::HandleType<
13203                        fidl::Socket,
13204                        { fidl::ObjectType::SOCKET.into_raw() },
13205                        16392,
13206                    >,
13207                    fidl::encoding::DefaultFuchsiaResourceDialect,
13208                >(
13209                    <fidl::encoding::HandleType<
13210                        fidl::Socket,
13211                        { fidl::ObjectType::SOCKET.into_raw() },
13212                        16392,
13213                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13214                        val
13215                    ),
13216                    encoder,
13217                    offset + 8,
13218                    _depth,
13219                ),
13220                LogsIterator::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
13221            }
13222        }
13223    }
13224
13225    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for LogsIterator {
13226        #[inline(always)]
13227        fn new_empty() -> Self {
13228            Self::__SourceBreaking { unknown_ordinal: 0 }
13229        }
13230
13231        #[inline]
13232        unsafe fn decode(
13233            &mut self,
13234            decoder: &mut fidl::encoding::Decoder<
13235                '_,
13236                fidl::encoding::DefaultFuchsiaResourceDialect,
13237            >,
13238            offset: usize,
13239            mut depth: fidl::encoding::Depth,
13240        ) -> fidl::Result<()> {
13241            decoder.debug_check_bounds::<Self>(offset);
13242            #[allow(unused_variables)]
13243            let next_out_of_line = decoder.next_out_of_line();
13244            let handles_before = decoder.remaining_handles();
13245            let (ordinal, inlined, num_bytes, num_handles) =
13246                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13247
13248            let member_inline_size = match ordinal {
13249                2 => <fidl::encoding::Endpoint<
13250                    fidl::endpoints::ServerEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13251                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13252                3 => <fidl::encoding::HandleType<
13253                    fidl::Socket,
13254                    { fidl::ObjectType::SOCKET.into_raw() },
13255                    16392,
13256                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13257                0 => return Err(fidl::Error::UnknownUnionTag),
13258                _ => num_bytes as usize,
13259            };
13260
13261            if inlined != (member_inline_size <= 4) {
13262                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13263            }
13264            let _inner_offset;
13265            if inlined {
13266                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13267                _inner_offset = offset + 8;
13268            } else {
13269                depth.increment()?;
13270                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13271            }
13272            match ordinal {
13273                2 => {
13274                    #[allow(irrefutable_let_patterns)]
13275                    if let LogsIterator::Batch(_) = self {
13276                        // Do nothing, read the value into the object
13277                    } else {
13278                        // Initialize `self` to the right variant
13279                        *self = LogsIterator::Batch(fidl::new_empty!(
13280                            fidl::encoding::Endpoint<
13281                                fidl::endpoints::ServerEnd<
13282                                    fidl_fuchsia_diagnostics::BatchIteratorMarker,
13283                                >,
13284                            >,
13285                            fidl::encoding::DefaultFuchsiaResourceDialect
13286                        ));
13287                    }
13288                    #[allow(irrefutable_let_patterns)]
13289                    if let LogsIterator::Batch(ref mut val) = self {
13290                        fidl::decode!(
13291                            fidl::encoding::Endpoint<
13292                                fidl::endpoints::ServerEnd<
13293                                    fidl_fuchsia_diagnostics::BatchIteratorMarker,
13294                                >,
13295                            >,
13296                            fidl::encoding::DefaultFuchsiaResourceDialect,
13297                            val,
13298                            decoder,
13299                            _inner_offset,
13300                            depth
13301                        )?;
13302                    } else {
13303                        unreachable!()
13304                    }
13305                }
13306                3 => {
13307                    #[allow(irrefutable_let_patterns)]
13308                    if let LogsIterator::Stream(_) = self {
13309                        // Do nothing, read the value into the object
13310                    } else {
13311                        // Initialize `self` to the right variant
13312                        *self = LogsIterator::Stream(
13313                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 16392>, fidl::encoding::DefaultFuchsiaResourceDialect),
13314                        );
13315                    }
13316                    #[allow(irrefutable_let_patterns)]
13317                    if let LogsIterator::Stream(ref mut val) = self {
13318                        fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 16392>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
13319                    } else {
13320                        unreachable!()
13321                    }
13322                }
13323                #[allow(deprecated)]
13324                ordinal => {
13325                    for _ in 0..num_handles {
13326                        decoder.drop_next_handle()?;
13327                    }
13328                    *self = LogsIterator::__SourceBreaking { unknown_ordinal: ordinal };
13329                }
13330            }
13331            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13332                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13333            }
13334            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13335                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13336            }
13337            Ok(())
13338        }
13339    }
13340
13341    impl fidl::encoding::ResourceTypeMarker for RunEventPayload {
13342        type Borrowed<'a> = &'a mut Self;
13343        fn take_or_borrow<'a>(
13344            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13345        ) -> Self::Borrowed<'a> {
13346            value
13347        }
13348    }
13349
13350    unsafe impl fidl::encoding::TypeMarker for RunEventPayload {
13351        type Owned = Self;
13352
13353        #[inline(always)]
13354        fn inline_align(_context: fidl::encoding::Context) -> usize {
13355            8
13356        }
13357
13358        #[inline(always)]
13359        fn inline_size(_context: fidl::encoding::Context) -> usize {
13360            16
13361        }
13362    }
13363
13364    unsafe impl
13365        fidl::encoding::Encode<RunEventPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13366        for &mut RunEventPayload
13367    {
13368        #[inline]
13369        unsafe fn encode(
13370            self,
13371            encoder: &mut fidl::encoding::Encoder<
13372                '_,
13373                fidl::encoding::DefaultFuchsiaResourceDialect,
13374            >,
13375            offset: usize,
13376            _depth: fidl::encoding::Depth,
13377        ) -> fidl::Result<()> {
13378            encoder.debug_check_bounds::<RunEventPayload>(offset);
13379            encoder.write_num::<u64>(self.ordinal(), offset);
13380            match self {
13381                RunEventPayload::RunStarted(ref val) => fidl::encoding::encode_in_envelope::<
13382                    RunStarted,
13383                    fidl::encoding::DefaultFuchsiaResourceDialect,
13384                >(
13385                    <RunStarted as fidl::encoding::ValueTypeMarker>::borrow(val),
13386                    encoder,
13387                    offset + 8,
13388                    _depth,
13389                ),
13390                RunEventPayload::RunStopped(ref val) => fidl::encoding::encode_in_envelope::<
13391                    RunStopped,
13392                    fidl::encoding::DefaultFuchsiaResourceDialect,
13393                >(
13394                    <RunStopped as fidl::encoding::ValueTypeMarker>::borrow(val),
13395                    encoder,
13396                    offset + 8,
13397                    _depth,
13398                ),
13399                RunEventPayload::Artifact(ref mut val) => fidl::encoding::encode_in_envelope::<
13400                    Artifact,
13401                    fidl::encoding::DefaultFuchsiaResourceDialect,
13402                >(
13403                    <Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13404                    encoder,
13405                    offset + 8,
13406                    _depth,
13407                ),
13408                RunEventPayload::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
13409            }
13410        }
13411    }
13412
13413    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13414        for RunEventPayload
13415    {
13416        #[inline(always)]
13417        fn new_empty() -> Self {
13418            Self::__SourceBreaking { unknown_ordinal: 0 }
13419        }
13420
13421        #[inline]
13422        unsafe fn decode(
13423            &mut self,
13424            decoder: &mut fidl::encoding::Decoder<
13425                '_,
13426                fidl::encoding::DefaultFuchsiaResourceDialect,
13427            >,
13428            offset: usize,
13429            mut depth: fidl::encoding::Depth,
13430        ) -> fidl::Result<()> {
13431            decoder.debug_check_bounds::<Self>(offset);
13432            #[allow(unused_variables)]
13433            let next_out_of_line = decoder.next_out_of_line();
13434            let handles_before = decoder.remaining_handles();
13435            let (ordinal, inlined, num_bytes, num_handles) =
13436                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13437
13438            let member_inline_size = match ordinal {
13439                1 => <RunStarted as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13440                2 => <RunStopped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13441                3 => <Artifact as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13442                0 => return Err(fidl::Error::UnknownUnionTag),
13443                _ => num_bytes as usize,
13444            };
13445
13446            if inlined != (member_inline_size <= 4) {
13447                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13448            }
13449            let _inner_offset;
13450            if inlined {
13451                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13452                _inner_offset = offset + 8;
13453            } else {
13454                depth.increment()?;
13455                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13456            }
13457            match ordinal {
13458                1 => {
13459                    #[allow(irrefutable_let_patterns)]
13460                    if let RunEventPayload::RunStarted(_) = self {
13461                        // Do nothing, read the value into the object
13462                    } else {
13463                        // Initialize `self` to the right variant
13464                        *self = RunEventPayload::RunStarted(fidl::new_empty!(
13465                            RunStarted,
13466                            fidl::encoding::DefaultFuchsiaResourceDialect
13467                        ));
13468                    }
13469                    #[allow(irrefutable_let_patterns)]
13470                    if let RunEventPayload::RunStarted(ref mut val) = self {
13471                        fidl::decode!(
13472                            RunStarted,
13473                            fidl::encoding::DefaultFuchsiaResourceDialect,
13474                            val,
13475                            decoder,
13476                            _inner_offset,
13477                            depth
13478                        )?;
13479                    } else {
13480                        unreachable!()
13481                    }
13482                }
13483                2 => {
13484                    #[allow(irrefutable_let_patterns)]
13485                    if let RunEventPayload::RunStopped(_) = self {
13486                        // Do nothing, read the value into the object
13487                    } else {
13488                        // Initialize `self` to the right variant
13489                        *self = RunEventPayload::RunStopped(fidl::new_empty!(
13490                            RunStopped,
13491                            fidl::encoding::DefaultFuchsiaResourceDialect
13492                        ));
13493                    }
13494                    #[allow(irrefutable_let_patterns)]
13495                    if let RunEventPayload::RunStopped(ref mut val) = self {
13496                        fidl::decode!(
13497                            RunStopped,
13498                            fidl::encoding::DefaultFuchsiaResourceDialect,
13499                            val,
13500                            decoder,
13501                            _inner_offset,
13502                            depth
13503                        )?;
13504                    } else {
13505                        unreachable!()
13506                    }
13507                }
13508                3 => {
13509                    #[allow(irrefutable_let_patterns)]
13510                    if let RunEventPayload::Artifact(_) = self {
13511                        // Do nothing, read the value into the object
13512                    } else {
13513                        // Initialize `self` to the right variant
13514                        *self = RunEventPayload::Artifact(fidl::new_empty!(
13515                            Artifact,
13516                            fidl::encoding::DefaultFuchsiaResourceDialect
13517                        ));
13518                    }
13519                    #[allow(irrefutable_let_patterns)]
13520                    if let RunEventPayload::Artifact(ref mut val) = self {
13521                        fidl::decode!(
13522                            Artifact,
13523                            fidl::encoding::DefaultFuchsiaResourceDialect,
13524                            val,
13525                            decoder,
13526                            _inner_offset,
13527                            depth
13528                        )?;
13529                    } else {
13530                        unreachable!()
13531                    }
13532                }
13533                #[allow(deprecated)]
13534                ordinal => {
13535                    for _ in 0..num_handles {
13536                        decoder.drop_next_handle()?;
13537                    }
13538                    *self = RunEventPayload::__SourceBreaking { unknown_ordinal: ordinal };
13539                }
13540            }
13541            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13542                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13543            }
13544            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13545                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13546            }
13547            Ok(())
13548        }
13549    }
13550
13551    impl fidl::encoding::ResourceTypeMarker for SuiteEventPayload {
13552        type Borrowed<'a> = &'a mut Self;
13553        fn take_or_borrow<'a>(
13554            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13555        ) -> Self::Borrowed<'a> {
13556            value
13557        }
13558    }
13559
13560    unsafe impl fidl::encoding::TypeMarker for SuiteEventPayload {
13561        type Owned = Self;
13562
13563        #[inline(always)]
13564        fn inline_align(_context: fidl::encoding::Context) -> usize {
13565            8
13566        }
13567
13568        #[inline(always)]
13569        fn inline_size(_context: fidl::encoding::Context) -> usize {
13570            16
13571        }
13572    }
13573
13574    unsafe impl
13575        fidl::encoding::Encode<SuiteEventPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13576        for &mut SuiteEventPayload
13577    {
13578        #[inline]
13579        unsafe fn encode(
13580            self,
13581            encoder: &mut fidl::encoding::Encoder<
13582                '_,
13583                fidl::encoding::DefaultFuchsiaResourceDialect,
13584            >,
13585            offset: usize,
13586            _depth: fidl::encoding::Depth,
13587        ) -> fidl::Result<()> {
13588            encoder.debug_check_bounds::<SuiteEventPayload>(offset);
13589            encoder.write_num::<u64>(self.ordinal(), offset);
13590            match self {
13591                SuiteEventPayload::CaseFound(ref val) => fidl::encoding::encode_in_envelope::<
13592                    CaseFound,
13593                    fidl::encoding::DefaultFuchsiaResourceDialect,
13594                >(
13595                    <CaseFound as fidl::encoding::ValueTypeMarker>::borrow(val),
13596                    encoder,
13597                    offset + 8,
13598                    _depth,
13599                ),
13600                SuiteEventPayload::CaseStarted(ref val) => fidl::encoding::encode_in_envelope::<
13601                    CaseStarted,
13602                    fidl::encoding::DefaultFuchsiaResourceDialect,
13603                >(
13604                    <CaseStarted as fidl::encoding::ValueTypeMarker>::borrow(val),
13605                    encoder,
13606                    offset + 8,
13607                    _depth,
13608                ),
13609                SuiteEventPayload::CaseStopped(ref val) => fidl::encoding::encode_in_envelope::<
13610                    CaseStopped,
13611                    fidl::encoding::DefaultFuchsiaResourceDialect,
13612                >(
13613                    <CaseStopped as fidl::encoding::ValueTypeMarker>::borrow(val),
13614                    encoder,
13615                    offset + 8,
13616                    _depth,
13617                ),
13618                SuiteEventPayload::CaseFinished(ref val) => fidl::encoding::encode_in_envelope::<
13619                    CaseFinished,
13620                    fidl::encoding::DefaultFuchsiaResourceDialect,
13621                >(
13622                    <CaseFinished as fidl::encoding::ValueTypeMarker>::borrow(val),
13623                    encoder,
13624                    offset + 8,
13625                    _depth,
13626                ),
13627                SuiteEventPayload::CaseArtifact(ref mut val) => {
13628                    fidl::encoding::encode_in_envelope::<
13629                        CaseArtifact,
13630                        fidl::encoding::DefaultFuchsiaResourceDialect,
13631                    >(
13632                        <CaseArtifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13633                        encoder,
13634                        offset + 8,
13635                        _depth,
13636                    )
13637                }
13638                SuiteEventPayload::SuiteArtifact(ref mut val) => {
13639                    fidl::encoding::encode_in_envelope::<
13640                        SuiteArtifact,
13641                        fidl::encoding::DefaultFuchsiaResourceDialect,
13642                    >(
13643                        <SuiteArtifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13644                        encoder,
13645                        offset + 8,
13646                        _depth,
13647                    )
13648                }
13649                SuiteEventPayload::SuiteStarted(ref val) => fidl::encoding::encode_in_envelope::<
13650                    SuiteStarted,
13651                    fidl::encoding::DefaultFuchsiaResourceDialect,
13652                >(
13653                    <SuiteStarted as fidl::encoding::ValueTypeMarker>::borrow(val),
13654                    encoder,
13655                    offset + 8,
13656                    _depth,
13657                ),
13658                SuiteEventPayload::SuiteStopped(ref val) => fidl::encoding::encode_in_envelope::<
13659                    SuiteStopped,
13660                    fidl::encoding::DefaultFuchsiaResourceDialect,
13661                >(
13662                    <SuiteStopped as fidl::encoding::ValueTypeMarker>::borrow(val),
13663                    encoder,
13664                    offset + 8,
13665                    _depth,
13666                ),
13667                SuiteEventPayload::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
13668            }
13669        }
13670    }
13671
13672    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13673        for SuiteEventPayload
13674    {
13675        #[inline(always)]
13676        fn new_empty() -> Self {
13677            Self::__SourceBreaking { unknown_ordinal: 0 }
13678        }
13679
13680        #[inline]
13681        unsafe fn decode(
13682            &mut self,
13683            decoder: &mut fidl::encoding::Decoder<
13684                '_,
13685                fidl::encoding::DefaultFuchsiaResourceDialect,
13686            >,
13687            offset: usize,
13688            mut depth: fidl::encoding::Depth,
13689        ) -> fidl::Result<()> {
13690            decoder.debug_check_bounds::<Self>(offset);
13691            #[allow(unused_variables)]
13692            let next_out_of_line = decoder.next_out_of_line();
13693            let handles_before = decoder.remaining_handles();
13694            let (ordinal, inlined, num_bytes, num_handles) =
13695                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13696
13697            let member_inline_size = match ordinal {
13698                1 => <CaseFound as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13699                2 => <CaseStarted as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13700                3 => <CaseStopped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13701                4 => <CaseFinished as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13702                5 => <CaseArtifact as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13703                6 => <SuiteArtifact as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13704                7 => <SuiteStarted as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13705                8 => <SuiteStopped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13706                0 => return Err(fidl::Error::UnknownUnionTag),
13707                _ => num_bytes as usize,
13708            };
13709
13710            if inlined != (member_inline_size <= 4) {
13711                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13712            }
13713            let _inner_offset;
13714            if inlined {
13715                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13716                _inner_offset = offset + 8;
13717            } else {
13718                depth.increment()?;
13719                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13720            }
13721            match ordinal {
13722                1 => {
13723                    #[allow(irrefutable_let_patterns)]
13724                    if let SuiteEventPayload::CaseFound(_) = self {
13725                        // Do nothing, read the value into the object
13726                    } else {
13727                        // Initialize `self` to the right variant
13728                        *self = SuiteEventPayload::CaseFound(fidl::new_empty!(
13729                            CaseFound,
13730                            fidl::encoding::DefaultFuchsiaResourceDialect
13731                        ));
13732                    }
13733                    #[allow(irrefutable_let_patterns)]
13734                    if let SuiteEventPayload::CaseFound(ref mut val) = self {
13735                        fidl::decode!(
13736                            CaseFound,
13737                            fidl::encoding::DefaultFuchsiaResourceDialect,
13738                            val,
13739                            decoder,
13740                            _inner_offset,
13741                            depth
13742                        )?;
13743                    } else {
13744                        unreachable!()
13745                    }
13746                }
13747                2 => {
13748                    #[allow(irrefutable_let_patterns)]
13749                    if let SuiteEventPayload::CaseStarted(_) = self {
13750                        // Do nothing, read the value into the object
13751                    } else {
13752                        // Initialize `self` to the right variant
13753                        *self = SuiteEventPayload::CaseStarted(fidl::new_empty!(
13754                            CaseStarted,
13755                            fidl::encoding::DefaultFuchsiaResourceDialect
13756                        ));
13757                    }
13758                    #[allow(irrefutable_let_patterns)]
13759                    if let SuiteEventPayload::CaseStarted(ref mut val) = self {
13760                        fidl::decode!(
13761                            CaseStarted,
13762                            fidl::encoding::DefaultFuchsiaResourceDialect,
13763                            val,
13764                            decoder,
13765                            _inner_offset,
13766                            depth
13767                        )?;
13768                    } else {
13769                        unreachable!()
13770                    }
13771                }
13772                3 => {
13773                    #[allow(irrefutable_let_patterns)]
13774                    if let SuiteEventPayload::CaseStopped(_) = self {
13775                        // Do nothing, read the value into the object
13776                    } else {
13777                        // Initialize `self` to the right variant
13778                        *self = SuiteEventPayload::CaseStopped(fidl::new_empty!(
13779                            CaseStopped,
13780                            fidl::encoding::DefaultFuchsiaResourceDialect
13781                        ));
13782                    }
13783                    #[allow(irrefutable_let_patterns)]
13784                    if let SuiteEventPayload::CaseStopped(ref mut val) = self {
13785                        fidl::decode!(
13786                            CaseStopped,
13787                            fidl::encoding::DefaultFuchsiaResourceDialect,
13788                            val,
13789                            decoder,
13790                            _inner_offset,
13791                            depth
13792                        )?;
13793                    } else {
13794                        unreachable!()
13795                    }
13796                }
13797                4 => {
13798                    #[allow(irrefutable_let_patterns)]
13799                    if let SuiteEventPayload::CaseFinished(_) = self {
13800                        // Do nothing, read the value into the object
13801                    } else {
13802                        // Initialize `self` to the right variant
13803                        *self = SuiteEventPayload::CaseFinished(fidl::new_empty!(
13804                            CaseFinished,
13805                            fidl::encoding::DefaultFuchsiaResourceDialect
13806                        ));
13807                    }
13808                    #[allow(irrefutable_let_patterns)]
13809                    if let SuiteEventPayload::CaseFinished(ref mut val) = self {
13810                        fidl::decode!(
13811                            CaseFinished,
13812                            fidl::encoding::DefaultFuchsiaResourceDialect,
13813                            val,
13814                            decoder,
13815                            _inner_offset,
13816                            depth
13817                        )?;
13818                    } else {
13819                        unreachable!()
13820                    }
13821                }
13822                5 => {
13823                    #[allow(irrefutable_let_patterns)]
13824                    if let SuiteEventPayload::CaseArtifact(_) = self {
13825                        // Do nothing, read the value into the object
13826                    } else {
13827                        // Initialize `self` to the right variant
13828                        *self = SuiteEventPayload::CaseArtifact(fidl::new_empty!(
13829                            CaseArtifact,
13830                            fidl::encoding::DefaultFuchsiaResourceDialect
13831                        ));
13832                    }
13833                    #[allow(irrefutable_let_patterns)]
13834                    if let SuiteEventPayload::CaseArtifact(ref mut val) = self {
13835                        fidl::decode!(
13836                            CaseArtifact,
13837                            fidl::encoding::DefaultFuchsiaResourceDialect,
13838                            val,
13839                            decoder,
13840                            _inner_offset,
13841                            depth
13842                        )?;
13843                    } else {
13844                        unreachable!()
13845                    }
13846                }
13847                6 => {
13848                    #[allow(irrefutable_let_patterns)]
13849                    if let SuiteEventPayload::SuiteArtifact(_) = self {
13850                        // Do nothing, read the value into the object
13851                    } else {
13852                        // Initialize `self` to the right variant
13853                        *self = SuiteEventPayload::SuiteArtifact(fidl::new_empty!(
13854                            SuiteArtifact,
13855                            fidl::encoding::DefaultFuchsiaResourceDialect
13856                        ));
13857                    }
13858                    #[allow(irrefutable_let_patterns)]
13859                    if let SuiteEventPayload::SuiteArtifact(ref mut val) = self {
13860                        fidl::decode!(
13861                            SuiteArtifact,
13862                            fidl::encoding::DefaultFuchsiaResourceDialect,
13863                            val,
13864                            decoder,
13865                            _inner_offset,
13866                            depth
13867                        )?;
13868                    } else {
13869                        unreachable!()
13870                    }
13871                }
13872                7 => {
13873                    #[allow(irrefutable_let_patterns)]
13874                    if let SuiteEventPayload::SuiteStarted(_) = self {
13875                        // Do nothing, read the value into the object
13876                    } else {
13877                        // Initialize `self` to the right variant
13878                        *self = SuiteEventPayload::SuiteStarted(fidl::new_empty!(
13879                            SuiteStarted,
13880                            fidl::encoding::DefaultFuchsiaResourceDialect
13881                        ));
13882                    }
13883                    #[allow(irrefutable_let_patterns)]
13884                    if let SuiteEventPayload::SuiteStarted(ref mut val) = self {
13885                        fidl::decode!(
13886                            SuiteStarted,
13887                            fidl::encoding::DefaultFuchsiaResourceDialect,
13888                            val,
13889                            decoder,
13890                            _inner_offset,
13891                            depth
13892                        )?;
13893                    } else {
13894                        unreachable!()
13895                    }
13896                }
13897                8 => {
13898                    #[allow(irrefutable_let_patterns)]
13899                    if let SuiteEventPayload::SuiteStopped(_) = self {
13900                        // Do nothing, read the value into the object
13901                    } else {
13902                        // Initialize `self` to the right variant
13903                        *self = SuiteEventPayload::SuiteStopped(fidl::new_empty!(
13904                            SuiteStopped,
13905                            fidl::encoding::DefaultFuchsiaResourceDialect
13906                        ));
13907                    }
13908                    #[allow(irrefutable_let_patterns)]
13909                    if let SuiteEventPayload::SuiteStopped(ref mut val) = self {
13910                        fidl::decode!(
13911                            SuiteStopped,
13912                            fidl::encoding::DefaultFuchsiaResourceDialect,
13913                            val,
13914                            decoder,
13915                            _inner_offset,
13916                            depth
13917                        )?;
13918                    } else {
13919                        unreachable!()
13920                    }
13921                }
13922                #[allow(deprecated)]
13923                ordinal => {
13924                    for _ in 0..num_handles {
13925                        decoder.drop_next_handle()?;
13926                    }
13927                    *self = SuiteEventPayload::__SourceBreaking { unknown_ordinal: ordinal };
13928                }
13929            }
13930            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13931                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13932            }
13933            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13934                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13935            }
13936            Ok(())
13937        }
13938    }
13939
13940    impl fidl::encoding::ResourceTypeMarker for Syslog {
13941        type Borrowed<'a> = &'a mut Self;
13942        fn take_or_borrow<'a>(
13943            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13944        ) -> Self::Borrowed<'a> {
13945            value
13946        }
13947    }
13948
13949    unsafe impl fidl::encoding::TypeMarker for Syslog {
13950        type Owned = Self;
13951
13952        #[inline(always)]
13953        fn inline_align(_context: fidl::encoding::Context) -> usize {
13954            8
13955        }
13956
13957        #[inline(always)]
13958        fn inline_size(_context: fidl::encoding::Context) -> usize {
13959            16
13960        }
13961    }
13962
13963    unsafe impl fidl::encoding::Encode<Syslog, fidl::encoding::DefaultFuchsiaResourceDialect>
13964        for &mut Syslog
13965    {
13966        #[inline]
13967        unsafe fn encode(
13968            self,
13969            encoder: &mut fidl::encoding::Encoder<
13970                '_,
13971                fidl::encoding::DefaultFuchsiaResourceDialect,
13972            >,
13973            offset: usize,
13974            _depth: fidl::encoding::Depth,
13975        ) -> fidl::Result<()> {
13976            encoder.debug_check_bounds::<Syslog>(offset);
13977            encoder.write_num::<u64>(self.ordinal(), offset);
13978            match self {
13979                Syslog::Batch(ref mut val) => fidl::encoding::encode_in_envelope::<
13980                    fidl::encoding::Endpoint<
13981                        fidl::endpoints::ClientEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13982                    >,
13983                    fidl::encoding::DefaultFuchsiaResourceDialect,
13984                >(
13985                    <fidl::encoding::Endpoint<
13986                        fidl::endpoints::ClientEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13987                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13988                        val
13989                    ),
13990                    encoder,
13991                    offset + 8,
13992                    _depth,
13993                ),
13994                Syslog::Stream(ref mut val) => fidl::encoding::encode_in_envelope::<
13995                    fidl::encoding::HandleType<
13996                        fidl::Socket,
13997                        { fidl::ObjectType::SOCKET.into_raw() },
13998                        2147483648,
13999                    >,
14000                    fidl::encoding::DefaultFuchsiaResourceDialect,
14001                >(
14002                    <fidl::encoding::HandleType<
14003                        fidl::Socket,
14004                        { fidl::ObjectType::SOCKET.into_raw() },
14005                        2147483648,
14006                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14007                        val
14008                    ),
14009                    encoder,
14010                    offset + 8,
14011                    _depth,
14012                ),
14013                Syslog::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
14014            }
14015        }
14016    }
14017
14018    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Syslog {
14019        #[inline(always)]
14020        fn new_empty() -> Self {
14021            Self::__SourceBreaking { unknown_ordinal: 0 }
14022        }
14023
14024        #[inline]
14025        unsafe fn decode(
14026            &mut self,
14027            decoder: &mut fidl::encoding::Decoder<
14028                '_,
14029                fidl::encoding::DefaultFuchsiaResourceDialect,
14030            >,
14031            offset: usize,
14032            mut depth: fidl::encoding::Depth,
14033        ) -> fidl::Result<()> {
14034            decoder.debug_check_bounds::<Self>(offset);
14035            #[allow(unused_variables)]
14036            let next_out_of_line = decoder.next_out_of_line();
14037            let handles_before = decoder.remaining_handles();
14038            let (ordinal, inlined, num_bytes, num_handles) =
14039                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14040
14041            let member_inline_size = match ordinal {
14042                2 => <fidl::encoding::Endpoint<
14043                    fidl::endpoints::ClientEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
14044                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14045                3 => <fidl::encoding::HandleType<
14046                    fidl::Socket,
14047                    { fidl::ObjectType::SOCKET.into_raw() },
14048                    2147483648,
14049                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14050                0 => return Err(fidl::Error::UnknownUnionTag),
14051                _ => num_bytes as usize,
14052            };
14053
14054            if inlined != (member_inline_size <= 4) {
14055                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14056            }
14057            let _inner_offset;
14058            if inlined {
14059                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14060                _inner_offset = offset + 8;
14061            } else {
14062                depth.increment()?;
14063                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14064            }
14065            match ordinal {
14066                2 => {
14067                    #[allow(irrefutable_let_patterns)]
14068                    if let Syslog::Batch(_) = self {
14069                        // Do nothing, read the value into the object
14070                    } else {
14071                        // Initialize `self` to the right variant
14072                        *self = Syslog::Batch(fidl::new_empty!(
14073                            fidl::encoding::Endpoint<
14074                                fidl::endpoints::ClientEnd<
14075                                    fidl_fuchsia_diagnostics::BatchIteratorMarker,
14076                                >,
14077                            >,
14078                            fidl::encoding::DefaultFuchsiaResourceDialect
14079                        ));
14080                    }
14081                    #[allow(irrefutable_let_patterns)]
14082                    if let Syslog::Batch(ref mut val) = self {
14083                        fidl::decode!(
14084                            fidl::encoding::Endpoint<
14085                                fidl::endpoints::ClientEnd<
14086                                    fidl_fuchsia_diagnostics::BatchIteratorMarker,
14087                                >,
14088                            >,
14089                            fidl::encoding::DefaultFuchsiaResourceDialect,
14090                            val,
14091                            decoder,
14092                            _inner_offset,
14093                            depth
14094                        )?;
14095                    } else {
14096                        unreachable!()
14097                    }
14098                }
14099                3 => {
14100                    #[allow(irrefutable_let_patterns)]
14101                    if let Syslog::Stream(_) = self {
14102                        // Do nothing, read the value into the object
14103                    } else {
14104                        // Initialize `self` to the right variant
14105                        *self = Syslog::Stream(
14106                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14107                        );
14108                    }
14109                    #[allow(irrefutable_let_patterns)]
14110                    if let Syslog::Stream(ref mut val) = self {
14111                        fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
14112                    } else {
14113                        unreachable!()
14114                    }
14115                }
14116                #[allow(deprecated)]
14117                ordinal => {
14118                    for _ in 0..num_handles {
14119                        decoder.drop_next_handle()?;
14120                    }
14121                    *self = Syslog::__SourceBreaking { unknown_ordinal: ordinal };
14122                }
14123            }
14124            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14125                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14126            }
14127            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14128                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14129            }
14130            Ok(())
14131        }
14132    }
14133}