Skip to main content

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        Self { client: fidl::client::sync::Client::new(channel) }
884    }
885
886    pub fn into_channel(self) -> fidl::Channel {
887        self.client.into_channel()
888    }
889
890    /// Waits until an event arrives and returns it. It is safe for other
891    /// threads to make concurrent requests while waiting for an event.
892    pub fn wait_for_event(
893        &self,
894        deadline: zx::MonotonicInstant,
895    ) -> Result<CaseIteratorEvent, fidl::Error> {
896        CaseIteratorEvent::decode(self.client.wait_for_event::<CaseIteratorMarker>(deadline)?)
897    }
898
899    /// Returns the next batch of test cases when they are available. Returns the empty vector
900    /// to indicate that the iteration is complete.
901    pub fn r#get_next(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<Case>, fidl::Error> {
902        let _response = self.client.send_query::<
903            fidl::encoding::EmptyPayload,
904            CaseIteratorGetNextResponse,
905            CaseIteratorMarker,
906        >(
907            (),
908            0x7583f97b7486467c,
909            fidl::encoding::DynamicFlags::empty(),
910            ___deadline,
911        )?;
912        Ok(_response.cases)
913    }
914}
915
916#[cfg(target_os = "fuchsia")]
917impl From<CaseIteratorSynchronousProxy> for zx::NullableHandle {
918    fn from(value: CaseIteratorSynchronousProxy) -> Self {
919        value.into_channel().into()
920    }
921}
922
923#[cfg(target_os = "fuchsia")]
924impl From<fidl::Channel> for CaseIteratorSynchronousProxy {
925    fn from(value: fidl::Channel) -> Self {
926        Self::new(value)
927    }
928}
929
930#[cfg(target_os = "fuchsia")]
931impl fidl::endpoints::FromClient for CaseIteratorSynchronousProxy {
932    type Protocol = CaseIteratorMarker;
933
934    fn from_client(value: fidl::endpoints::ClientEnd<CaseIteratorMarker>) -> Self {
935        Self::new(value.into_channel())
936    }
937}
938
939#[derive(Debug, Clone)]
940pub struct CaseIteratorProxy {
941    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
942}
943
944impl fidl::endpoints::Proxy for CaseIteratorProxy {
945    type Protocol = CaseIteratorMarker;
946
947    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
948        Self::new(inner)
949    }
950
951    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
952        self.client.into_channel().map_err(|client| Self { client })
953    }
954
955    fn as_channel(&self) -> &::fidl::AsyncChannel {
956        self.client.as_channel()
957    }
958}
959
960impl CaseIteratorProxy {
961    /// Create a new Proxy for fuchsia.test.manager/CaseIterator.
962    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
963        let protocol_name = <CaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
964        Self { client: fidl::client::Client::new(channel, protocol_name) }
965    }
966
967    /// Get a Stream of events from the remote end of the protocol.
968    ///
969    /// # Panics
970    ///
971    /// Panics if the event stream was already taken.
972    pub fn take_event_stream(&self) -> CaseIteratorEventStream {
973        CaseIteratorEventStream { event_receiver: self.client.take_event_receiver() }
974    }
975
976    /// Returns the next batch of test cases when they are available. Returns the empty vector
977    /// to indicate that the iteration is complete.
978    pub fn r#get_next(
979        &self,
980    ) -> fidl::client::QueryResponseFut<Vec<Case>, fidl::encoding::DefaultFuchsiaResourceDialect>
981    {
982        CaseIteratorProxyInterface::r#get_next(self)
983    }
984}
985
986impl CaseIteratorProxyInterface for CaseIteratorProxy {
987    type GetNextResponseFut =
988        fidl::client::QueryResponseFut<Vec<Case>, fidl::encoding::DefaultFuchsiaResourceDialect>;
989    fn r#get_next(&self) -> Self::GetNextResponseFut {
990        fn _decode(
991            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
992        ) -> Result<Vec<Case>, fidl::Error> {
993            let _response = fidl::client::decode_transaction_body::<
994                CaseIteratorGetNextResponse,
995                fidl::encoding::DefaultFuchsiaResourceDialect,
996                0x7583f97b7486467c,
997            >(_buf?)?;
998            Ok(_response.cases)
999        }
1000        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Case>>(
1001            (),
1002            0x7583f97b7486467c,
1003            fidl::encoding::DynamicFlags::empty(),
1004            _decode,
1005        )
1006    }
1007}
1008
1009pub struct CaseIteratorEventStream {
1010    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1011}
1012
1013impl std::marker::Unpin for CaseIteratorEventStream {}
1014
1015impl futures::stream::FusedStream for CaseIteratorEventStream {
1016    fn is_terminated(&self) -> bool {
1017        self.event_receiver.is_terminated()
1018    }
1019}
1020
1021impl futures::Stream for CaseIteratorEventStream {
1022    type Item = Result<CaseIteratorEvent, fidl::Error>;
1023
1024    fn poll_next(
1025        mut self: std::pin::Pin<&mut Self>,
1026        cx: &mut std::task::Context<'_>,
1027    ) -> std::task::Poll<Option<Self::Item>> {
1028        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1029            &mut self.event_receiver,
1030            cx
1031        )?) {
1032            Some(buf) => std::task::Poll::Ready(Some(CaseIteratorEvent::decode(buf))),
1033            None => std::task::Poll::Ready(None),
1034        }
1035    }
1036}
1037
1038#[derive(Debug)]
1039pub enum CaseIteratorEvent {}
1040
1041impl CaseIteratorEvent {
1042    /// Decodes a message buffer as a [`CaseIteratorEvent`].
1043    fn decode(
1044        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1045    ) -> Result<CaseIteratorEvent, fidl::Error> {
1046        let (bytes, _handles) = buf.split_mut();
1047        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1048        debug_assert_eq!(tx_header.tx_id, 0);
1049        match tx_header.ordinal {
1050            _ => Err(fidl::Error::UnknownOrdinal {
1051                ordinal: tx_header.ordinal,
1052                protocol_name: <CaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1053            }),
1054        }
1055    }
1056}
1057
1058/// A Stream of incoming requests for fuchsia.test.manager/CaseIterator.
1059pub struct CaseIteratorRequestStream {
1060    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1061    is_terminated: bool,
1062}
1063
1064impl std::marker::Unpin for CaseIteratorRequestStream {}
1065
1066impl futures::stream::FusedStream for CaseIteratorRequestStream {
1067    fn is_terminated(&self) -> bool {
1068        self.is_terminated
1069    }
1070}
1071
1072impl fidl::endpoints::RequestStream for CaseIteratorRequestStream {
1073    type Protocol = CaseIteratorMarker;
1074    type ControlHandle = CaseIteratorControlHandle;
1075
1076    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1077        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1078    }
1079
1080    fn control_handle(&self) -> Self::ControlHandle {
1081        CaseIteratorControlHandle { inner: self.inner.clone() }
1082    }
1083
1084    fn into_inner(
1085        self,
1086    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1087    {
1088        (self.inner, self.is_terminated)
1089    }
1090
1091    fn from_inner(
1092        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1093        is_terminated: bool,
1094    ) -> Self {
1095        Self { inner, is_terminated }
1096    }
1097}
1098
1099impl futures::Stream for CaseIteratorRequestStream {
1100    type Item = Result<CaseIteratorRequest, fidl::Error>;
1101
1102    fn poll_next(
1103        mut self: std::pin::Pin<&mut Self>,
1104        cx: &mut std::task::Context<'_>,
1105    ) -> std::task::Poll<Option<Self::Item>> {
1106        let this = &mut *self;
1107        if this.inner.check_shutdown(cx) {
1108            this.is_terminated = true;
1109            return std::task::Poll::Ready(None);
1110        }
1111        if this.is_terminated {
1112            panic!("polled CaseIteratorRequestStream after completion");
1113        }
1114        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1115            |bytes, handles| {
1116                match this.inner.channel().read_etc(cx, bytes, handles) {
1117                    std::task::Poll::Ready(Ok(())) => {}
1118                    std::task::Poll::Pending => return std::task::Poll::Pending,
1119                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1120                        this.is_terminated = true;
1121                        return std::task::Poll::Ready(None);
1122                    }
1123                    std::task::Poll::Ready(Err(e)) => {
1124                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1125                            e.into(),
1126                        ))));
1127                    }
1128                }
1129
1130                // A message has been received from the channel
1131                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1132
1133                std::task::Poll::Ready(Some(match header.ordinal {
1134                    0x7583f97b7486467c => {
1135                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1136                        let mut req = fidl::new_empty!(
1137                            fidl::encoding::EmptyPayload,
1138                            fidl::encoding::DefaultFuchsiaResourceDialect
1139                        );
1140                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1141                        let control_handle =
1142                            CaseIteratorControlHandle { inner: this.inner.clone() };
1143                        Ok(CaseIteratorRequest::GetNext {
1144                            responder: CaseIteratorGetNextResponder {
1145                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1146                                tx_id: header.tx_id,
1147                            },
1148                        })
1149                    }
1150                    _ => Err(fidl::Error::UnknownOrdinal {
1151                        ordinal: header.ordinal,
1152                        protocol_name:
1153                            <CaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1154                    }),
1155                }))
1156            },
1157        )
1158    }
1159}
1160
1161/// Iterator for listing available test cases.
1162#[derive(Debug)]
1163pub enum CaseIteratorRequest {
1164    /// Returns the next batch of test cases when they are available. Returns the empty vector
1165    /// to indicate that the iteration is complete.
1166    GetNext { responder: CaseIteratorGetNextResponder },
1167}
1168
1169impl CaseIteratorRequest {
1170    #[allow(irrefutable_let_patterns)]
1171    pub fn into_get_next(self) -> Option<(CaseIteratorGetNextResponder)> {
1172        if let CaseIteratorRequest::GetNext { responder } = self { Some((responder)) } else { None }
1173    }
1174
1175    /// Name of the method defined in FIDL
1176    pub fn method_name(&self) -> &'static str {
1177        match *self {
1178            CaseIteratorRequest::GetNext { .. } => "get_next",
1179        }
1180    }
1181}
1182
1183#[derive(Debug, Clone)]
1184pub struct CaseIteratorControlHandle {
1185    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1186}
1187
1188impl fidl::endpoints::ControlHandle for CaseIteratorControlHandle {
1189    fn shutdown(&self) {
1190        self.inner.shutdown()
1191    }
1192
1193    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1194        self.inner.shutdown_with_epitaph(status)
1195    }
1196
1197    fn is_closed(&self) -> bool {
1198        self.inner.channel().is_closed()
1199    }
1200    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1201        self.inner.channel().on_closed()
1202    }
1203
1204    #[cfg(target_os = "fuchsia")]
1205    fn signal_peer(
1206        &self,
1207        clear_mask: zx::Signals,
1208        set_mask: zx::Signals,
1209    ) -> Result<(), zx_status::Status> {
1210        use fidl::Peered;
1211        self.inner.channel().signal_peer(clear_mask, set_mask)
1212    }
1213}
1214
1215impl CaseIteratorControlHandle {}
1216
1217#[must_use = "FIDL methods require a response to be sent"]
1218#[derive(Debug)]
1219pub struct CaseIteratorGetNextResponder {
1220    control_handle: std::mem::ManuallyDrop<CaseIteratorControlHandle>,
1221    tx_id: u32,
1222}
1223
1224/// Set the the channel to be shutdown (see [`CaseIteratorControlHandle::shutdown`])
1225/// if the responder is dropped without sending a response, so that the client
1226/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1227impl std::ops::Drop for CaseIteratorGetNextResponder {
1228    fn drop(&mut self) {
1229        self.control_handle.shutdown();
1230        // Safety: drops once, never accessed again
1231        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1232    }
1233}
1234
1235impl fidl::endpoints::Responder for CaseIteratorGetNextResponder {
1236    type ControlHandle = CaseIteratorControlHandle;
1237
1238    fn control_handle(&self) -> &CaseIteratorControlHandle {
1239        &self.control_handle
1240    }
1241
1242    fn drop_without_shutdown(mut self) {
1243        // Safety: drops once, never accessed again due to mem::forget
1244        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1245        // Prevent Drop from running (which would shut down the channel)
1246        std::mem::forget(self);
1247    }
1248}
1249
1250impl CaseIteratorGetNextResponder {
1251    /// Sends a response to the FIDL transaction.
1252    ///
1253    /// Sets the channel to shutdown if an error occurs.
1254    pub fn send(self, mut cases: &[Case]) -> Result<(), fidl::Error> {
1255        let _result = self.send_raw(cases);
1256        if _result.is_err() {
1257            self.control_handle.shutdown();
1258        }
1259        self.drop_without_shutdown();
1260        _result
1261    }
1262
1263    /// Similar to "send" but does not shutdown the channel if an error occurs.
1264    pub fn send_no_shutdown_on_err(self, mut cases: &[Case]) -> Result<(), fidl::Error> {
1265        let _result = self.send_raw(cases);
1266        self.drop_without_shutdown();
1267        _result
1268    }
1269
1270    fn send_raw(&self, mut cases: &[Case]) -> Result<(), fidl::Error> {
1271        self.control_handle.inner.send::<CaseIteratorGetNextResponse>(
1272            (cases,),
1273            self.tx_id,
1274            0x7583f97b7486467c,
1275            fidl::encoding::DynamicFlags::empty(),
1276        )
1277    }
1278}
1279
1280#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1281pub struct DebugDataIteratorMarker;
1282
1283impl fidl::endpoints::ProtocolMarker for DebugDataIteratorMarker {
1284    type Proxy = DebugDataIteratorProxy;
1285    type RequestStream = DebugDataIteratorRequestStream;
1286    #[cfg(target_os = "fuchsia")]
1287    type SynchronousProxy = DebugDataIteratorSynchronousProxy;
1288
1289    const DEBUG_NAME: &'static str = "(anonymous) DebugDataIterator";
1290}
1291
1292pub trait DebugDataIteratorProxyInterface: Send + Sync {
1293    type GetNextResponseFut: std::future::Future<Output = Result<Vec<DebugData>, fidl::Error>>
1294        + Send;
1295    fn r#get_next(&self) -> Self::GetNextResponseFut;
1296    type GetNextCompressedResponseFut: std::future::Future<Output = Result<Vec<DebugData>, fidl::Error>>
1297        + Send;
1298    fn r#get_next_compressed(&self) -> Self::GetNextCompressedResponseFut;
1299}
1300#[derive(Debug)]
1301#[cfg(target_os = "fuchsia")]
1302pub struct DebugDataIteratorSynchronousProxy {
1303    client: fidl::client::sync::Client,
1304}
1305
1306#[cfg(target_os = "fuchsia")]
1307impl fidl::endpoints::SynchronousProxy for DebugDataIteratorSynchronousProxy {
1308    type Proxy = DebugDataIteratorProxy;
1309    type Protocol = DebugDataIteratorMarker;
1310
1311    fn from_channel(inner: fidl::Channel) -> Self {
1312        Self::new(inner)
1313    }
1314
1315    fn into_channel(self) -> fidl::Channel {
1316        self.client.into_channel()
1317    }
1318
1319    fn as_channel(&self) -> &fidl::Channel {
1320        self.client.as_channel()
1321    }
1322}
1323
1324#[cfg(target_os = "fuchsia")]
1325impl DebugDataIteratorSynchronousProxy {
1326    pub fn new(channel: fidl::Channel) -> Self {
1327        Self { client: fidl::client::sync::Client::new(channel) }
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(
1341            self.client.wait_for_event::<DebugDataIteratorMarker>(deadline)?,
1342        )
1343    }
1344
1345    /// Retrieve the next batch of debug data. This is a hanging get; if no data is
1346    /// immediately available, the call hangs until data is available. After all data has
1347    /// been returned, the call returns an empty vector.
1348    pub fn r#get_next(
1349        &self,
1350        ___deadline: zx::MonotonicInstant,
1351    ) -> Result<Vec<DebugData>, fidl::Error> {
1352        let _response = self.client.send_query::<
1353            fidl::encoding::EmptyPayload,
1354            DebugDataIteratorGetNextResponse,
1355            DebugDataIteratorMarker,
1356        >(
1357            (),
1358            0x9ef24c823f5ad60,
1359            fidl::encoding::DynamicFlags::empty(),
1360            ___deadline,
1361        )?;
1362        Ok(_response.data)
1363    }
1364
1365    /// Retrieve the next batch of debug data (compressed using zstd). This is
1366    /// a hanging get; if no data is immediately available, the call hangs until
1367    /// data is available. After all data has been returned, the call returns an empty vector.
1368    pub fn r#get_next_compressed(
1369        &self,
1370        ___deadline: zx::MonotonicInstant,
1371    ) -> Result<Vec<DebugData>, fidl::Error> {
1372        let _response = self.client.send_query::<
1373            fidl::encoding::EmptyPayload,
1374            DebugDataIteratorGetNextCompressedResponse,
1375            DebugDataIteratorMarker,
1376        >(
1377            (),
1378            0x6765e9cb918301f4,
1379            fidl::encoding::DynamicFlags::empty(),
1380            ___deadline,
1381        )?;
1382        Ok(_response.data)
1383    }
1384}
1385
1386#[cfg(target_os = "fuchsia")]
1387impl From<DebugDataIteratorSynchronousProxy> for zx::NullableHandle {
1388    fn from(value: DebugDataIteratorSynchronousProxy) -> Self {
1389        value.into_channel().into()
1390    }
1391}
1392
1393#[cfg(target_os = "fuchsia")]
1394impl From<fidl::Channel> for DebugDataIteratorSynchronousProxy {
1395    fn from(value: fidl::Channel) -> Self {
1396        Self::new(value)
1397    }
1398}
1399
1400#[cfg(target_os = "fuchsia")]
1401impl fidl::endpoints::FromClient for DebugDataIteratorSynchronousProxy {
1402    type Protocol = DebugDataIteratorMarker;
1403
1404    fn from_client(value: fidl::endpoints::ClientEnd<DebugDataIteratorMarker>) -> Self {
1405        Self::new(value.into_channel())
1406    }
1407}
1408
1409#[derive(Debug, Clone)]
1410pub struct DebugDataIteratorProxy {
1411    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1412}
1413
1414impl fidl::endpoints::Proxy for DebugDataIteratorProxy {
1415    type Protocol = DebugDataIteratorMarker;
1416
1417    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1418        Self::new(inner)
1419    }
1420
1421    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1422        self.client.into_channel().map_err(|client| Self { client })
1423    }
1424
1425    fn as_channel(&self) -> &::fidl::AsyncChannel {
1426        self.client.as_channel()
1427    }
1428}
1429
1430impl DebugDataIteratorProxy {
1431    /// Create a new Proxy for fuchsia.test.manager/DebugDataIterator.
1432    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1433        let protocol_name =
1434            <DebugDataIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1435        Self { client: fidl::client::Client::new(channel, protocol_name) }
1436    }
1437
1438    /// Get a Stream of events from the remote end of the protocol.
1439    ///
1440    /// # Panics
1441    ///
1442    /// Panics if the event stream was already taken.
1443    pub fn take_event_stream(&self) -> DebugDataIteratorEventStream {
1444        DebugDataIteratorEventStream { event_receiver: self.client.take_event_receiver() }
1445    }
1446
1447    /// Retrieve the next batch of debug data. This is a hanging get; if no data is
1448    /// immediately available, the call hangs until data is available. After all data has
1449    /// been returned, the call returns an empty vector.
1450    pub fn r#get_next(
1451        &self,
1452    ) -> fidl::client::QueryResponseFut<Vec<DebugData>, fidl::encoding::DefaultFuchsiaResourceDialect>
1453    {
1454        DebugDataIteratorProxyInterface::r#get_next(self)
1455    }
1456
1457    /// Retrieve the next batch of debug data (compressed using zstd). This is
1458    /// a hanging get; if no data is immediately available, the call hangs until
1459    /// data is available. After all data has been returned, the call returns an empty vector.
1460    pub fn r#get_next_compressed(
1461        &self,
1462    ) -> fidl::client::QueryResponseFut<Vec<DebugData>, fidl::encoding::DefaultFuchsiaResourceDialect>
1463    {
1464        DebugDataIteratorProxyInterface::r#get_next_compressed(self)
1465    }
1466}
1467
1468impl DebugDataIteratorProxyInterface for DebugDataIteratorProxy {
1469    type GetNextResponseFut = fidl::client::QueryResponseFut<
1470        Vec<DebugData>,
1471        fidl::encoding::DefaultFuchsiaResourceDialect,
1472    >;
1473    fn r#get_next(&self) -> Self::GetNextResponseFut {
1474        fn _decode(
1475            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1476        ) -> Result<Vec<DebugData>, fidl::Error> {
1477            let _response = fidl::client::decode_transaction_body::<
1478                DebugDataIteratorGetNextResponse,
1479                fidl::encoding::DefaultFuchsiaResourceDialect,
1480                0x9ef24c823f5ad60,
1481            >(_buf?)?;
1482            Ok(_response.data)
1483        }
1484        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<DebugData>>(
1485            (),
1486            0x9ef24c823f5ad60,
1487            fidl::encoding::DynamicFlags::empty(),
1488            _decode,
1489        )
1490    }
1491
1492    type GetNextCompressedResponseFut = fidl::client::QueryResponseFut<
1493        Vec<DebugData>,
1494        fidl::encoding::DefaultFuchsiaResourceDialect,
1495    >;
1496    fn r#get_next_compressed(&self) -> Self::GetNextCompressedResponseFut {
1497        fn _decode(
1498            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1499        ) -> Result<Vec<DebugData>, fidl::Error> {
1500            let _response = fidl::client::decode_transaction_body::<
1501                DebugDataIteratorGetNextCompressedResponse,
1502                fidl::encoding::DefaultFuchsiaResourceDialect,
1503                0x6765e9cb918301f4,
1504            >(_buf?)?;
1505            Ok(_response.data)
1506        }
1507        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<DebugData>>(
1508            (),
1509            0x6765e9cb918301f4,
1510            fidl::encoding::DynamicFlags::empty(),
1511            _decode,
1512        )
1513    }
1514}
1515
1516pub struct DebugDataIteratorEventStream {
1517    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1518}
1519
1520impl std::marker::Unpin for DebugDataIteratorEventStream {}
1521
1522impl futures::stream::FusedStream for DebugDataIteratorEventStream {
1523    fn is_terminated(&self) -> bool {
1524        self.event_receiver.is_terminated()
1525    }
1526}
1527
1528impl futures::Stream for DebugDataIteratorEventStream {
1529    type Item = Result<DebugDataIteratorEvent, fidl::Error>;
1530
1531    fn poll_next(
1532        mut self: std::pin::Pin<&mut Self>,
1533        cx: &mut std::task::Context<'_>,
1534    ) -> std::task::Poll<Option<Self::Item>> {
1535        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1536            &mut self.event_receiver,
1537            cx
1538        )?) {
1539            Some(buf) => std::task::Poll::Ready(Some(DebugDataIteratorEvent::decode(buf))),
1540            None => std::task::Poll::Ready(None),
1541        }
1542    }
1543}
1544
1545#[derive(Debug)]
1546pub enum DebugDataIteratorEvent {}
1547
1548impl DebugDataIteratorEvent {
1549    /// Decodes a message buffer as a [`DebugDataIteratorEvent`].
1550    fn decode(
1551        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1552    ) -> Result<DebugDataIteratorEvent, fidl::Error> {
1553        let (bytes, _handles) = buf.split_mut();
1554        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1555        debug_assert_eq!(tx_header.tx_id, 0);
1556        match tx_header.ordinal {
1557            _ => Err(fidl::Error::UnknownOrdinal {
1558                ordinal: tx_header.ordinal,
1559                protocol_name:
1560                    <DebugDataIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1561            }),
1562        }
1563    }
1564}
1565
1566/// A Stream of incoming requests for fuchsia.test.manager/DebugDataIterator.
1567pub struct DebugDataIteratorRequestStream {
1568    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1569    is_terminated: bool,
1570}
1571
1572impl std::marker::Unpin for DebugDataIteratorRequestStream {}
1573
1574impl futures::stream::FusedStream for DebugDataIteratorRequestStream {
1575    fn is_terminated(&self) -> bool {
1576        self.is_terminated
1577    }
1578}
1579
1580impl fidl::endpoints::RequestStream for DebugDataIteratorRequestStream {
1581    type Protocol = DebugDataIteratorMarker;
1582    type ControlHandle = DebugDataIteratorControlHandle;
1583
1584    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1585        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1586    }
1587
1588    fn control_handle(&self) -> Self::ControlHandle {
1589        DebugDataIteratorControlHandle { inner: self.inner.clone() }
1590    }
1591
1592    fn into_inner(
1593        self,
1594    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1595    {
1596        (self.inner, self.is_terminated)
1597    }
1598
1599    fn from_inner(
1600        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1601        is_terminated: bool,
1602    ) -> Self {
1603        Self { inner, is_terminated }
1604    }
1605}
1606
1607impl futures::Stream for DebugDataIteratorRequestStream {
1608    type Item = Result<DebugDataIteratorRequest, fidl::Error>;
1609
1610    fn poll_next(
1611        mut self: std::pin::Pin<&mut Self>,
1612        cx: &mut std::task::Context<'_>,
1613    ) -> std::task::Poll<Option<Self::Item>> {
1614        let this = &mut *self;
1615        if this.inner.check_shutdown(cx) {
1616            this.is_terminated = true;
1617            return std::task::Poll::Ready(None);
1618        }
1619        if this.is_terminated {
1620            panic!("polled DebugDataIteratorRequestStream after completion");
1621        }
1622        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1623            |bytes, handles| {
1624                match this.inner.channel().read_etc(cx, bytes, handles) {
1625                    std::task::Poll::Ready(Ok(())) => {}
1626                    std::task::Poll::Pending => return std::task::Poll::Pending,
1627                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1628                        this.is_terminated = true;
1629                        return std::task::Poll::Ready(None);
1630                    }
1631                    std::task::Poll::Ready(Err(e)) => {
1632                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1633                            e.into(),
1634                        ))));
1635                    }
1636                }
1637
1638                // A message has been received from the channel
1639                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1640
1641                std::task::Poll::Ready(Some(match header.ordinal {
1642                    0x9ef24c823f5ad60 => {
1643                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1644                        let mut req = fidl::new_empty!(
1645                            fidl::encoding::EmptyPayload,
1646                            fidl::encoding::DefaultFuchsiaResourceDialect
1647                        );
1648                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1649                        let control_handle =
1650                            DebugDataIteratorControlHandle { inner: this.inner.clone() };
1651                        Ok(DebugDataIteratorRequest::GetNext {
1652                            responder: DebugDataIteratorGetNextResponder {
1653                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1654                                tx_id: header.tx_id,
1655                            },
1656                        })
1657                    }
1658                    0x6765e9cb918301f4 => {
1659                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1660                        let mut req = fidl::new_empty!(
1661                            fidl::encoding::EmptyPayload,
1662                            fidl::encoding::DefaultFuchsiaResourceDialect
1663                        );
1664                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1665                        let control_handle =
1666                            DebugDataIteratorControlHandle { inner: this.inner.clone() };
1667                        Ok(DebugDataIteratorRequest::GetNextCompressed {
1668                            responder: DebugDataIteratorGetNextCompressedResponder {
1669                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1670                                tx_id: header.tx_id,
1671                            },
1672                        })
1673                    }
1674                    _ => Err(fidl::Error::UnknownOrdinal {
1675                        ordinal: header.ordinal,
1676                        protocol_name:
1677                            <DebugDataIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1678                    }),
1679                }))
1680            },
1681        )
1682    }
1683}
1684
1685/// An iterator protocol over which a client may retrieve debug data information.
1686#[derive(Debug)]
1687pub enum DebugDataIteratorRequest {
1688    /// Retrieve the next batch of debug data. This is a hanging get; if no data is
1689    /// immediately available, the call hangs until data is available. After all data has
1690    /// been returned, the call returns an empty vector.
1691    GetNext { responder: DebugDataIteratorGetNextResponder },
1692    /// Retrieve the next batch of debug data (compressed using zstd). This is
1693    /// a hanging get; if no data is immediately available, the call hangs until
1694    /// data is available. After all data has been returned, the call returns an empty vector.
1695    GetNextCompressed { responder: DebugDataIteratorGetNextCompressedResponder },
1696}
1697
1698impl DebugDataIteratorRequest {
1699    #[allow(irrefutable_let_patterns)]
1700    pub fn into_get_next(self) -> Option<(DebugDataIteratorGetNextResponder)> {
1701        if let DebugDataIteratorRequest::GetNext { responder } = self {
1702            Some((responder))
1703        } else {
1704            None
1705        }
1706    }
1707
1708    #[allow(irrefutable_let_patterns)]
1709    pub fn into_get_next_compressed(self) -> Option<(DebugDataIteratorGetNextCompressedResponder)> {
1710        if let DebugDataIteratorRequest::GetNextCompressed { responder } = self {
1711            Some((responder))
1712        } else {
1713            None
1714        }
1715    }
1716
1717    /// Name of the method defined in FIDL
1718    pub fn method_name(&self) -> &'static str {
1719        match *self {
1720            DebugDataIteratorRequest::GetNext { .. } => "get_next",
1721            DebugDataIteratorRequest::GetNextCompressed { .. } => "get_next_compressed",
1722        }
1723    }
1724}
1725
1726#[derive(Debug, Clone)]
1727pub struct DebugDataIteratorControlHandle {
1728    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1729}
1730
1731impl fidl::endpoints::ControlHandle for DebugDataIteratorControlHandle {
1732    fn shutdown(&self) {
1733        self.inner.shutdown()
1734    }
1735
1736    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1737        self.inner.shutdown_with_epitaph(status)
1738    }
1739
1740    fn is_closed(&self) -> bool {
1741        self.inner.channel().is_closed()
1742    }
1743    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1744        self.inner.channel().on_closed()
1745    }
1746
1747    #[cfg(target_os = "fuchsia")]
1748    fn signal_peer(
1749        &self,
1750        clear_mask: zx::Signals,
1751        set_mask: zx::Signals,
1752    ) -> Result<(), zx_status::Status> {
1753        use fidl::Peered;
1754        self.inner.channel().signal_peer(clear_mask, set_mask)
1755    }
1756}
1757
1758impl DebugDataIteratorControlHandle {}
1759
1760#[must_use = "FIDL methods require a response to be sent"]
1761#[derive(Debug)]
1762pub struct DebugDataIteratorGetNextResponder {
1763    control_handle: std::mem::ManuallyDrop<DebugDataIteratorControlHandle>,
1764    tx_id: u32,
1765}
1766
1767/// Set the the channel to be shutdown (see [`DebugDataIteratorControlHandle::shutdown`])
1768/// if the responder is dropped without sending a response, so that the client
1769/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1770impl std::ops::Drop for DebugDataIteratorGetNextResponder {
1771    fn drop(&mut self) {
1772        self.control_handle.shutdown();
1773        // Safety: drops once, never accessed again
1774        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1775    }
1776}
1777
1778impl fidl::endpoints::Responder for DebugDataIteratorGetNextResponder {
1779    type ControlHandle = DebugDataIteratorControlHandle;
1780
1781    fn control_handle(&self) -> &DebugDataIteratorControlHandle {
1782        &self.control_handle
1783    }
1784
1785    fn drop_without_shutdown(mut self) {
1786        // Safety: drops once, never accessed again due to mem::forget
1787        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1788        // Prevent Drop from running (which would shut down the channel)
1789        std::mem::forget(self);
1790    }
1791}
1792
1793impl DebugDataIteratorGetNextResponder {
1794    /// Sends a response to the FIDL transaction.
1795    ///
1796    /// Sets the channel to shutdown if an error occurs.
1797    pub fn send(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1798        let _result = self.send_raw(data);
1799        if _result.is_err() {
1800            self.control_handle.shutdown();
1801        }
1802        self.drop_without_shutdown();
1803        _result
1804    }
1805
1806    /// Similar to "send" but does not shutdown the channel if an error occurs.
1807    pub fn send_no_shutdown_on_err(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1808        let _result = self.send_raw(data);
1809        self.drop_without_shutdown();
1810        _result
1811    }
1812
1813    fn send_raw(&self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1814        self.control_handle.inner.send::<DebugDataIteratorGetNextResponse>(
1815            (data.as_mut(),),
1816            self.tx_id,
1817            0x9ef24c823f5ad60,
1818            fidl::encoding::DynamicFlags::empty(),
1819        )
1820    }
1821}
1822
1823#[must_use = "FIDL methods require a response to be sent"]
1824#[derive(Debug)]
1825pub struct DebugDataIteratorGetNextCompressedResponder {
1826    control_handle: std::mem::ManuallyDrop<DebugDataIteratorControlHandle>,
1827    tx_id: u32,
1828}
1829
1830/// Set the the channel to be shutdown (see [`DebugDataIteratorControlHandle::shutdown`])
1831/// if the responder is dropped without sending a response, so that the client
1832/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1833impl std::ops::Drop for DebugDataIteratorGetNextCompressedResponder {
1834    fn drop(&mut self) {
1835        self.control_handle.shutdown();
1836        // Safety: drops once, never accessed again
1837        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1838    }
1839}
1840
1841impl fidl::endpoints::Responder for DebugDataIteratorGetNextCompressedResponder {
1842    type ControlHandle = DebugDataIteratorControlHandle;
1843
1844    fn control_handle(&self) -> &DebugDataIteratorControlHandle {
1845        &self.control_handle
1846    }
1847
1848    fn drop_without_shutdown(mut self) {
1849        // Safety: drops once, never accessed again due to mem::forget
1850        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1851        // Prevent Drop from running (which would shut down the channel)
1852        std::mem::forget(self);
1853    }
1854}
1855
1856impl DebugDataIteratorGetNextCompressedResponder {
1857    /// Sends a response to the FIDL transaction.
1858    ///
1859    /// Sets the channel to shutdown if an error occurs.
1860    pub fn send(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1861        let _result = self.send_raw(data);
1862        if _result.is_err() {
1863            self.control_handle.shutdown();
1864        }
1865        self.drop_without_shutdown();
1866        _result
1867    }
1868
1869    /// Similar to "send" but does not shutdown the channel if an error occurs.
1870    pub fn send_no_shutdown_on_err(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1871        let _result = self.send_raw(data);
1872        self.drop_without_shutdown();
1873        _result
1874    }
1875
1876    fn send_raw(&self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1877        self.control_handle.inner.send::<DebugDataIteratorGetNextCompressedResponse>(
1878            (data.as_mut(),),
1879            self.tx_id,
1880            0x6765e9cb918301f4,
1881            fidl::encoding::DynamicFlags::empty(),
1882        )
1883    }
1884}
1885
1886#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1887pub struct EarlyBootProfileMarker;
1888
1889impl fidl::endpoints::ProtocolMarker for EarlyBootProfileMarker {
1890    type Proxy = EarlyBootProfileProxy;
1891    type RequestStream = EarlyBootProfileRequestStream;
1892    #[cfg(target_os = "fuchsia")]
1893    type SynchronousProxy = EarlyBootProfileSynchronousProxy;
1894
1895    const DEBUG_NAME: &'static str = "fuchsia.test.manager.EarlyBootProfile";
1896}
1897impl fidl::endpoints::DiscoverableProtocolMarker for EarlyBootProfileMarker {}
1898
1899pub trait EarlyBootProfileProxyInterface: Send + Sync {
1900    fn r#register_watcher(
1901        &self,
1902        iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
1903    ) -> Result<(), fidl::Error>;
1904}
1905#[derive(Debug)]
1906#[cfg(target_os = "fuchsia")]
1907pub struct EarlyBootProfileSynchronousProxy {
1908    client: fidl::client::sync::Client,
1909}
1910
1911#[cfg(target_os = "fuchsia")]
1912impl fidl::endpoints::SynchronousProxy for EarlyBootProfileSynchronousProxy {
1913    type Proxy = EarlyBootProfileProxy;
1914    type Protocol = EarlyBootProfileMarker;
1915
1916    fn from_channel(inner: fidl::Channel) -> Self {
1917        Self::new(inner)
1918    }
1919
1920    fn into_channel(self) -> fidl::Channel {
1921        self.client.into_channel()
1922    }
1923
1924    fn as_channel(&self) -> &fidl::Channel {
1925        self.client.as_channel()
1926    }
1927}
1928
1929#[cfg(target_os = "fuchsia")]
1930impl EarlyBootProfileSynchronousProxy {
1931    pub fn new(channel: fidl::Channel) -> Self {
1932        Self { client: fidl::client::sync::Client::new(channel) }
1933    }
1934
1935    pub fn into_channel(self) -> fidl::Channel {
1936        self.client.into_channel()
1937    }
1938
1939    /// Waits until an event arrives and returns it. It is safe for other
1940    /// threads to make concurrent requests while waiting for an event.
1941    pub fn wait_for_event(
1942        &self,
1943        deadline: zx::MonotonicInstant,
1944    ) -> Result<EarlyBootProfileEvent, fidl::Error> {
1945        EarlyBootProfileEvent::decode(
1946            self.client.wait_for_event::<EarlyBootProfileMarker>(deadline)?,
1947        )
1948    }
1949
1950    /// Register iterator for watching early boot profiles.
1951    pub fn r#register_watcher(
1952        &self,
1953        mut iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
1954    ) -> Result<(), fidl::Error> {
1955        self.client.send::<EarlyBootProfileRegisterWatcherRequest>(
1956            (iterator,),
1957            0x6bd6b03803b93715,
1958            fidl::encoding::DynamicFlags::empty(),
1959        )
1960    }
1961}
1962
1963#[cfg(target_os = "fuchsia")]
1964impl From<EarlyBootProfileSynchronousProxy> for zx::NullableHandle {
1965    fn from(value: EarlyBootProfileSynchronousProxy) -> Self {
1966        value.into_channel().into()
1967    }
1968}
1969
1970#[cfg(target_os = "fuchsia")]
1971impl From<fidl::Channel> for EarlyBootProfileSynchronousProxy {
1972    fn from(value: fidl::Channel) -> Self {
1973        Self::new(value)
1974    }
1975}
1976
1977#[cfg(target_os = "fuchsia")]
1978impl fidl::endpoints::FromClient for EarlyBootProfileSynchronousProxy {
1979    type Protocol = EarlyBootProfileMarker;
1980
1981    fn from_client(value: fidl::endpoints::ClientEnd<EarlyBootProfileMarker>) -> Self {
1982        Self::new(value.into_channel())
1983    }
1984}
1985
1986#[derive(Debug, Clone)]
1987pub struct EarlyBootProfileProxy {
1988    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1989}
1990
1991impl fidl::endpoints::Proxy for EarlyBootProfileProxy {
1992    type Protocol = EarlyBootProfileMarker;
1993
1994    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1995        Self::new(inner)
1996    }
1997
1998    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1999        self.client.into_channel().map_err(|client| Self { client })
2000    }
2001
2002    fn as_channel(&self) -> &::fidl::AsyncChannel {
2003        self.client.as_channel()
2004    }
2005}
2006
2007impl EarlyBootProfileProxy {
2008    /// Create a new Proxy for fuchsia.test.manager/EarlyBootProfile.
2009    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2010        let protocol_name = <EarlyBootProfileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2011        Self { client: fidl::client::Client::new(channel, protocol_name) }
2012    }
2013
2014    /// Get a Stream of events from the remote end of the protocol.
2015    ///
2016    /// # Panics
2017    ///
2018    /// Panics if the event stream was already taken.
2019    pub fn take_event_stream(&self) -> EarlyBootProfileEventStream {
2020        EarlyBootProfileEventStream { event_receiver: self.client.take_event_receiver() }
2021    }
2022
2023    /// Register iterator for watching early boot profiles.
2024    pub fn r#register_watcher(
2025        &self,
2026        mut iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
2027    ) -> Result<(), fidl::Error> {
2028        EarlyBootProfileProxyInterface::r#register_watcher(self, iterator)
2029    }
2030}
2031
2032impl EarlyBootProfileProxyInterface for EarlyBootProfileProxy {
2033    fn r#register_watcher(
2034        &self,
2035        mut iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
2036    ) -> Result<(), fidl::Error> {
2037        self.client.send::<EarlyBootProfileRegisterWatcherRequest>(
2038            (iterator,),
2039            0x6bd6b03803b93715,
2040            fidl::encoding::DynamicFlags::empty(),
2041        )
2042    }
2043}
2044
2045pub struct EarlyBootProfileEventStream {
2046    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2047}
2048
2049impl std::marker::Unpin for EarlyBootProfileEventStream {}
2050
2051impl futures::stream::FusedStream for EarlyBootProfileEventStream {
2052    fn is_terminated(&self) -> bool {
2053        self.event_receiver.is_terminated()
2054    }
2055}
2056
2057impl futures::Stream for EarlyBootProfileEventStream {
2058    type Item = Result<EarlyBootProfileEvent, fidl::Error>;
2059
2060    fn poll_next(
2061        mut self: std::pin::Pin<&mut Self>,
2062        cx: &mut std::task::Context<'_>,
2063    ) -> std::task::Poll<Option<Self::Item>> {
2064        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2065            &mut self.event_receiver,
2066            cx
2067        )?) {
2068            Some(buf) => std::task::Poll::Ready(Some(EarlyBootProfileEvent::decode(buf))),
2069            None => std::task::Poll::Ready(None),
2070        }
2071    }
2072}
2073
2074#[derive(Debug)]
2075pub enum EarlyBootProfileEvent {
2076    #[non_exhaustive]
2077    _UnknownEvent {
2078        /// Ordinal of the event that was sent.
2079        ordinal: u64,
2080    },
2081}
2082
2083impl EarlyBootProfileEvent {
2084    /// Decodes a message buffer as a [`EarlyBootProfileEvent`].
2085    fn decode(
2086        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2087    ) -> Result<EarlyBootProfileEvent, fidl::Error> {
2088        let (bytes, _handles) = buf.split_mut();
2089        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2090        debug_assert_eq!(tx_header.tx_id, 0);
2091        match tx_header.ordinal {
2092            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2093                Ok(EarlyBootProfileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2094            }
2095            _ => Err(fidl::Error::UnknownOrdinal {
2096                ordinal: tx_header.ordinal,
2097                protocol_name:
2098                    <EarlyBootProfileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2099            }),
2100        }
2101    }
2102}
2103
2104/// A Stream of incoming requests for fuchsia.test.manager/EarlyBootProfile.
2105pub struct EarlyBootProfileRequestStream {
2106    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2107    is_terminated: bool,
2108}
2109
2110impl std::marker::Unpin for EarlyBootProfileRequestStream {}
2111
2112impl futures::stream::FusedStream for EarlyBootProfileRequestStream {
2113    fn is_terminated(&self) -> bool {
2114        self.is_terminated
2115    }
2116}
2117
2118impl fidl::endpoints::RequestStream for EarlyBootProfileRequestStream {
2119    type Protocol = EarlyBootProfileMarker;
2120    type ControlHandle = EarlyBootProfileControlHandle;
2121
2122    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2123        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2124    }
2125
2126    fn control_handle(&self) -> Self::ControlHandle {
2127        EarlyBootProfileControlHandle { inner: self.inner.clone() }
2128    }
2129
2130    fn into_inner(
2131        self,
2132    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2133    {
2134        (self.inner, self.is_terminated)
2135    }
2136
2137    fn from_inner(
2138        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2139        is_terminated: bool,
2140    ) -> Self {
2141        Self { inner, is_terminated }
2142    }
2143}
2144
2145impl futures::Stream for EarlyBootProfileRequestStream {
2146    type Item = Result<EarlyBootProfileRequest, fidl::Error>;
2147
2148    fn poll_next(
2149        mut self: std::pin::Pin<&mut Self>,
2150        cx: &mut std::task::Context<'_>,
2151    ) -> std::task::Poll<Option<Self::Item>> {
2152        let this = &mut *self;
2153        if this.inner.check_shutdown(cx) {
2154            this.is_terminated = true;
2155            return std::task::Poll::Ready(None);
2156        }
2157        if this.is_terminated {
2158            panic!("polled EarlyBootProfileRequestStream after completion");
2159        }
2160        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2161            |bytes, handles| {
2162                match this.inner.channel().read_etc(cx, bytes, handles) {
2163                    std::task::Poll::Ready(Ok(())) => {}
2164                    std::task::Poll::Pending => return std::task::Poll::Pending,
2165                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2166                        this.is_terminated = true;
2167                        return std::task::Poll::Ready(None);
2168                    }
2169                    std::task::Poll::Ready(Err(e)) => {
2170                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2171                            e.into(),
2172                        ))));
2173                    }
2174                }
2175
2176                // A message has been received from the channel
2177                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2178
2179                std::task::Poll::Ready(Some(match header.ordinal {
2180                    0x6bd6b03803b93715 => {
2181                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2182                        let mut req = fidl::new_empty!(
2183                            EarlyBootProfileRegisterWatcherRequest,
2184                            fidl::encoding::DefaultFuchsiaResourceDialect
2185                        );
2186                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EarlyBootProfileRegisterWatcherRequest>(&header, _body_bytes, handles, &mut req)?;
2187                        let control_handle =
2188                            EarlyBootProfileControlHandle { inner: this.inner.clone() };
2189                        Ok(EarlyBootProfileRequest::RegisterWatcher {
2190                            iterator: req.iterator,
2191
2192                            control_handle,
2193                        })
2194                    }
2195                    _ if header.tx_id == 0
2196                        && header
2197                            .dynamic_flags()
2198                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2199                    {
2200                        Ok(EarlyBootProfileRequest::_UnknownMethod {
2201                            ordinal: header.ordinal,
2202                            control_handle: EarlyBootProfileControlHandle {
2203                                inner: this.inner.clone(),
2204                            },
2205                            method_type: fidl::MethodType::OneWay,
2206                        })
2207                    }
2208                    _ if header
2209                        .dynamic_flags()
2210                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2211                    {
2212                        this.inner.send_framework_err(
2213                            fidl::encoding::FrameworkErr::UnknownMethod,
2214                            header.tx_id,
2215                            header.ordinal,
2216                            header.dynamic_flags(),
2217                            (bytes, handles),
2218                        )?;
2219                        Ok(EarlyBootProfileRequest::_UnknownMethod {
2220                            ordinal: header.ordinal,
2221                            control_handle: EarlyBootProfileControlHandle {
2222                                inner: this.inner.clone(),
2223                            },
2224                            method_type: fidl::MethodType::TwoWay,
2225                        })
2226                    }
2227                    _ => Err(fidl::Error::UnknownOrdinal {
2228                        ordinal: header.ordinal,
2229                        protocol_name:
2230                            <EarlyBootProfileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2231                    }),
2232                }))
2233            },
2234        )
2235    }
2236}
2237
2238/// Protocol to manage Early boot profiles. This should be called by our clients
2239/// after running all the tests.
2240#[derive(Debug)]
2241pub enum EarlyBootProfileRequest {
2242    /// Register iterator for watching early boot profiles.
2243    RegisterWatcher {
2244        iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
2245        control_handle: EarlyBootProfileControlHandle,
2246    },
2247    /// An interaction was received which does not match any known method.
2248    #[non_exhaustive]
2249    _UnknownMethod {
2250        /// Ordinal of the method that was called.
2251        ordinal: u64,
2252        control_handle: EarlyBootProfileControlHandle,
2253        method_type: fidl::MethodType,
2254    },
2255}
2256
2257impl EarlyBootProfileRequest {
2258    #[allow(irrefutable_let_patterns)]
2259    pub fn into_register_watcher(
2260        self,
2261    ) -> Option<(fidl::endpoints::ServerEnd<DebugDataIteratorMarker>, EarlyBootProfileControlHandle)>
2262    {
2263        if let EarlyBootProfileRequest::RegisterWatcher { iterator, control_handle } = self {
2264            Some((iterator, control_handle))
2265        } else {
2266            None
2267        }
2268    }
2269
2270    /// Name of the method defined in FIDL
2271    pub fn method_name(&self) -> &'static str {
2272        match *self {
2273            EarlyBootProfileRequest::RegisterWatcher { .. } => "register_watcher",
2274            EarlyBootProfileRequest::_UnknownMethod {
2275                method_type: fidl::MethodType::OneWay,
2276                ..
2277            } => "unknown one-way method",
2278            EarlyBootProfileRequest::_UnknownMethod {
2279                method_type: fidl::MethodType::TwoWay,
2280                ..
2281            } => "unknown two-way method",
2282        }
2283    }
2284}
2285
2286#[derive(Debug, Clone)]
2287pub struct EarlyBootProfileControlHandle {
2288    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2289}
2290
2291impl fidl::endpoints::ControlHandle for EarlyBootProfileControlHandle {
2292    fn shutdown(&self) {
2293        self.inner.shutdown()
2294    }
2295
2296    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2297        self.inner.shutdown_with_epitaph(status)
2298    }
2299
2300    fn is_closed(&self) -> bool {
2301        self.inner.channel().is_closed()
2302    }
2303    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2304        self.inner.channel().on_closed()
2305    }
2306
2307    #[cfg(target_os = "fuchsia")]
2308    fn signal_peer(
2309        &self,
2310        clear_mask: zx::Signals,
2311        set_mask: zx::Signals,
2312    ) -> Result<(), zx_status::Status> {
2313        use fidl::Peered;
2314        self.inner.channel().signal_peer(clear_mask, set_mask)
2315    }
2316}
2317
2318impl EarlyBootProfileControlHandle {}
2319
2320#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2321pub struct QueryMarker;
2322
2323impl fidl::endpoints::ProtocolMarker for QueryMarker {
2324    type Proxy = QueryProxy;
2325    type RequestStream = QueryRequestStream;
2326    #[cfg(target_os = "fuchsia")]
2327    type SynchronousProxy = QuerySynchronousProxy;
2328
2329    const DEBUG_NAME: &'static str = "fuchsia.test.manager.Query";
2330}
2331impl fidl::endpoints::DiscoverableProtocolMarker for QueryMarker {}
2332pub type QueryEnumerateResult = Result<(), LaunchError>;
2333pub type QueryEnumerateInRealmResult = Result<(), LaunchError>;
2334
2335pub trait QueryProxyInterface: Send + Sync {
2336    type EnumerateResponseFut: std::future::Future<Output = Result<QueryEnumerateResult, fidl::Error>>
2337        + Send;
2338    fn r#enumerate(
2339        &self,
2340        test_url: &str,
2341        iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2342    ) -> Self::EnumerateResponseFut;
2343    type EnumerateInRealmResponseFut: std::future::Future<Output = Result<QueryEnumerateInRealmResult, fidl::Error>>
2344        + Send;
2345    fn r#enumerate_in_realm(
2346        &self,
2347        test_url: &str,
2348        realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2349        offers: &[fidl_fuchsia_component_decl::Offer],
2350        test_collection: &str,
2351        iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2352    ) -> Self::EnumerateInRealmResponseFut;
2353}
2354#[derive(Debug)]
2355#[cfg(target_os = "fuchsia")]
2356pub struct QuerySynchronousProxy {
2357    client: fidl::client::sync::Client,
2358}
2359
2360#[cfg(target_os = "fuchsia")]
2361impl fidl::endpoints::SynchronousProxy for QuerySynchronousProxy {
2362    type Proxy = QueryProxy;
2363    type Protocol = QueryMarker;
2364
2365    fn from_channel(inner: fidl::Channel) -> Self {
2366        Self::new(inner)
2367    }
2368
2369    fn into_channel(self) -> fidl::Channel {
2370        self.client.into_channel()
2371    }
2372
2373    fn as_channel(&self) -> &fidl::Channel {
2374        self.client.as_channel()
2375    }
2376}
2377
2378#[cfg(target_os = "fuchsia")]
2379impl QuerySynchronousProxy {
2380    pub fn new(channel: fidl::Channel) -> Self {
2381        Self { client: fidl::client::sync::Client::new(channel) }
2382    }
2383
2384    pub fn into_channel(self) -> fidl::Channel {
2385        self.client.into_channel()
2386    }
2387
2388    /// Waits until an event arrives and returns it. It is safe for other
2389    /// threads to make concurrent requests while waiting for an event.
2390    pub fn wait_for_event(
2391        &self,
2392        deadline: zx::MonotonicInstant,
2393    ) -> Result<QueryEvent, fidl::Error> {
2394        QueryEvent::decode(self.client.wait_for_event::<QueryMarker>(deadline)?)
2395    }
2396
2397    /// Enumerates test cases.
2398    pub fn r#enumerate(
2399        &self,
2400        mut test_url: &str,
2401        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2402        ___deadline: zx::MonotonicInstant,
2403    ) -> Result<QueryEnumerateResult, fidl::Error> {
2404        let _response = self.client.send_query::<
2405            QueryEnumerateRequest,
2406            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LaunchError>,
2407            QueryMarker,
2408        >(
2409            (test_url, iterator,),
2410            0x6cd89c1f2728d418,
2411            fidl::encoding::DynamicFlags::empty(),
2412            ___deadline,
2413        )?;
2414        Ok(_response.map(|x| x))
2415    }
2416
2417    /// Enumerates test cases in non-hermetic tests.
2418    pub fn r#enumerate_in_realm(
2419        &self,
2420        mut test_url: &str,
2421        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2422        mut offers: &[fidl_fuchsia_component_decl::Offer],
2423        mut test_collection: &str,
2424        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2425        ___deadline: zx::MonotonicInstant,
2426    ) -> Result<QueryEnumerateInRealmResult, fidl::Error> {
2427        let _response = self.client.send_query::<
2428            QueryEnumerateInRealmRequest,
2429            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LaunchError>,
2430            QueryMarker,
2431        >(
2432            (test_url, realm, offers, test_collection, iterator,),
2433            0x7f7f533194a51ec5,
2434            fidl::encoding::DynamicFlags::empty(),
2435            ___deadline,
2436        )?;
2437        Ok(_response.map(|x| x))
2438    }
2439}
2440
2441#[cfg(target_os = "fuchsia")]
2442impl From<QuerySynchronousProxy> for zx::NullableHandle {
2443    fn from(value: QuerySynchronousProxy) -> Self {
2444        value.into_channel().into()
2445    }
2446}
2447
2448#[cfg(target_os = "fuchsia")]
2449impl From<fidl::Channel> for QuerySynchronousProxy {
2450    fn from(value: fidl::Channel) -> Self {
2451        Self::new(value)
2452    }
2453}
2454
2455#[cfg(target_os = "fuchsia")]
2456impl fidl::endpoints::FromClient for QuerySynchronousProxy {
2457    type Protocol = QueryMarker;
2458
2459    fn from_client(value: fidl::endpoints::ClientEnd<QueryMarker>) -> Self {
2460        Self::new(value.into_channel())
2461    }
2462}
2463
2464#[derive(Debug, Clone)]
2465pub struct QueryProxy {
2466    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2467}
2468
2469impl fidl::endpoints::Proxy for QueryProxy {
2470    type Protocol = QueryMarker;
2471
2472    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2473        Self::new(inner)
2474    }
2475
2476    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2477        self.client.into_channel().map_err(|client| Self { client })
2478    }
2479
2480    fn as_channel(&self) -> &::fidl::AsyncChannel {
2481        self.client.as_channel()
2482    }
2483}
2484
2485impl QueryProxy {
2486    /// Create a new Proxy for fuchsia.test.manager/Query.
2487    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2488        let protocol_name = <QueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2489        Self { client: fidl::client::Client::new(channel, protocol_name) }
2490    }
2491
2492    /// Get a Stream of events from the remote end of the protocol.
2493    ///
2494    /// # Panics
2495    ///
2496    /// Panics if the event stream was already taken.
2497    pub fn take_event_stream(&self) -> QueryEventStream {
2498        QueryEventStream { event_receiver: self.client.take_event_receiver() }
2499    }
2500
2501    /// Enumerates test cases.
2502    pub fn r#enumerate(
2503        &self,
2504        mut test_url: &str,
2505        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2506    ) -> fidl::client::QueryResponseFut<
2507        QueryEnumerateResult,
2508        fidl::encoding::DefaultFuchsiaResourceDialect,
2509    > {
2510        QueryProxyInterface::r#enumerate(self, test_url, iterator)
2511    }
2512
2513    /// Enumerates test cases in non-hermetic tests.
2514    pub fn r#enumerate_in_realm(
2515        &self,
2516        mut test_url: &str,
2517        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2518        mut offers: &[fidl_fuchsia_component_decl::Offer],
2519        mut test_collection: &str,
2520        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2521    ) -> fidl::client::QueryResponseFut<
2522        QueryEnumerateInRealmResult,
2523        fidl::encoding::DefaultFuchsiaResourceDialect,
2524    > {
2525        QueryProxyInterface::r#enumerate_in_realm(
2526            self,
2527            test_url,
2528            realm,
2529            offers,
2530            test_collection,
2531            iterator,
2532        )
2533    }
2534}
2535
2536impl QueryProxyInterface for QueryProxy {
2537    type EnumerateResponseFut = fidl::client::QueryResponseFut<
2538        QueryEnumerateResult,
2539        fidl::encoding::DefaultFuchsiaResourceDialect,
2540    >;
2541    fn r#enumerate(
2542        &self,
2543        mut test_url: &str,
2544        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2545    ) -> Self::EnumerateResponseFut {
2546        fn _decode(
2547            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2548        ) -> Result<QueryEnumerateResult, fidl::Error> {
2549            let _response = fidl::client::decode_transaction_body::<
2550                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LaunchError>,
2551                fidl::encoding::DefaultFuchsiaResourceDialect,
2552                0x6cd89c1f2728d418,
2553            >(_buf?)?;
2554            Ok(_response.map(|x| x))
2555        }
2556        self.client.send_query_and_decode::<QueryEnumerateRequest, QueryEnumerateResult>(
2557            (test_url, iterator),
2558            0x6cd89c1f2728d418,
2559            fidl::encoding::DynamicFlags::empty(),
2560            _decode,
2561        )
2562    }
2563
2564    type EnumerateInRealmResponseFut = fidl::client::QueryResponseFut<
2565        QueryEnumerateInRealmResult,
2566        fidl::encoding::DefaultFuchsiaResourceDialect,
2567    >;
2568    fn r#enumerate_in_realm(
2569        &self,
2570        mut test_url: &str,
2571        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2572        mut offers: &[fidl_fuchsia_component_decl::Offer],
2573        mut test_collection: &str,
2574        mut iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2575    ) -> Self::EnumerateInRealmResponseFut {
2576        fn _decode(
2577            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2578        ) -> Result<QueryEnumerateInRealmResult, fidl::Error> {
2579            let _response = fidl::client::decode_transaction_body::<
2580                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LaunchError>,
2581                fidl::encoding::DefaultFuchsiaResourceDialect,
2582                0x7f7f533194a51ec5,
2583            >(_buf?)?;
2584            Ok(_response.map(|x| x))
2585        }
2586        self.client
2587            .send_query_and_decode::<QueryEnumerateInRealmRequest, QueryEnumerateInRealmResult>(
2588                (test_url, realm, offers, test_collection, iterator),
2589                0x7f7f533194a51ec5,
2590                fidl::encoding::DynamicFlags::empty(),
2591                _decode,
2592            )
2593    }
2594}
2595
2596pub struct QueryEventStream {
2597    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2598}
2599
2600impl std::marker::Unpin for QueryEventStream {}
2601
2602impl futures::stream::FusedStream for QueryEventStream {
2603    fn is_terminated(&self) -> bool {
2604        self.event_receiver.is_terminated()
2605    }
2606}
2607
2608impl futures::Stream for QueryEventStream {
2609    type Item = Result<QueryEvent, fidl::Error>;
2610
2611    fn poll_next(
2612        mut self: std::pin::Pin<&mut Self>,
2613        cx: &mut std::task::Context<'_>,
2614    ) -> std::task::Poll<Option<Self::Item>> {
2615        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2616            &mut self.event_receiver,
2617            cx
2618        )?) {
2619            Some(buf) => std::task::Poll::Ready(Some(QueryEvent::decode(buf))),
2620            None => std::task::Poll::Ready(None),
2621        }
2622    }
2623}
2624
2625#[derive(Debug)]
2626pub enum QueryEvent {
2627    #[non_exhaustive]
2628    _UnknownEvent {
2629        /// Ordinal of the event that was sent.
2630        ordinal: u64,
2631    },
2632}
2633
2634impl QueryEvent {
2635    /// Decodes a message buffer as a [`QueryEvent`].
2636    fn decode(
2637        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2638    ) -> Result<QueryEvent, fidl::Error> {
2639        let (bytes, _handles) = buf.split_mut();
2640        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2641        debug_assert_eq!(tx_header.tx_id, 0);
2642        match tx_header.ordinal {
2643            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2644                Ok(QueryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2645            }
2646            _ => Err(fidl::Error::UnknownOrdinal {
2647                ordinal: tx_header.ordinal,
2648                protocol_name: <QueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2649            }),
2650        }
2651    }
2652}
2653
2654/// A Stream of incoming requests for fuchsia.test.manager/Query.
2655pub struct QueryRequestStream {
2656    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2657    is_terminated: bool,
2658}
2659
2660impl std::marker::Unpin for QueryRequestStream {}
2661
2662impl futures::stream::FusedStream for QueryRequestStream {
2663    fn is_terminated(&self) -> bool {
2664        self.is_terminated
2665    }
2666}
2667
2668impl fidl::endpoints::RequestStream for QueryRequestStream {
2669    type Protocol = QueryMarker;
2670    type ControlHandle = QueryControlHandle;
2671
2672    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2673        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2674    }
2675
2676    fn control_handle(&self) -> Self::ControlHandle {
2677        QueryControlHandle { inner: self.inner.clone() }
2678    }
2679
2680    fn into_inner(
2681        self,
2682    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2683    {
2684        (self.inner, self.is_terminated)
2685    }
2686
2687    fn from_inner(
2688        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2689        is_terminated: bool,
2690    ) -> Self {
2691        Self { inner, is_terminated }
2692    }
2693}
2694
2695impl futures::Stream for QueryRequestStream {
2696    type Item = Result<QueryRequest, fidl::Error>;
2697
2698    fn poll_next(
2699        mut self: std::pin::Pin<&mut Self>,
2700        cx: &mut std::task::Context<'_>,
2701    ) -> std::task::Poll<Option<Self::Item>> {
2702        let this = &mut *self;
2703        if this.inner.check_shutdown(cx) {
2704            this.is_terminated = true;
2705            return std::task::Poll::Ready(None);
2706        }
2707        if this.is_terminated {
2708            panic!("polled QueryRequestStream after completion");
2709        }
2710        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2711            |bytes, handles| {
2712                match this.inner.channel().read_etc(cx, bytes, handles) {
2713                    std::task::Poll::Ready(Ok(())) => {}
2714                    std::task::Poll::Pending => return std::task::Poll::Pending,
2715                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2716                        this.is_terminated = true;
2717                        return std::task::Poll::Ready(None);
2718                    }
2719                    std::task::Poll::Ready(Err(e)) => {
2720                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2721                            e.into(),
2722                        ))));
2723                    }
2724                }
2725
2726                // A message has been received from the channel
2727                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2728
2729                std::task::Poll::Ready(Some(match header.ordinal {
2730                    0x6cd89c1f2728d418 => {
2731                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2732                        let mut req = fidl::new_empty!(
2733                            QueryEnumerateRequest,
2734                            fidl::encoding::DefaultFuchsiaResourceDialect
2735                        );
2736                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<QueryEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
2737                        let control_handle = QueryControlHandle { inner: this.inner.clone() };
2738                        Ok(QueryRequest::Enumerate {
2739                            test_url: req.test_url,
2740                            iterator: req.iterator,
2741
2742                            responder: QueryEnumerateResponder {
2743                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2744                                tx_id: header.tx_id,
2745                            },
2746                        })
2747                    }
2748                    0x7f7f533194a51ec5 => {
2749                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2750                        let mut req = fidl::new_empty!(
2751                            QueryEnumerateInRealmRequest,
2752                            fidl::encoding::DefaultFuchsiaResourceDialect
2753                        );
2754                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<QueryEnumerateInRealmRequest>(&header, _body_bytes, handles, &mut req)?;
2755                        let control_handle = QueryControlHandle { inner: this.inner.clone() };
2756                        Ok(QueryRequest::EnumerateInRealm {
2757                            test_url: req.test_url,
2758                            realm: req.realm,
2759                            offers: req.offers,
2760                            test_collection: req.test_collection,
2761                            iterator: req.iterator,
2762
2763                            responder: QueryEnumerateInRealmResponder {
2764                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2765                                tx_id: header.tx_id,
2766                            },
2767                        })
2768                    }
2769                    _ if header.tx_id == 0
2770                        && header
2771                            .dynamic_flags()
2772                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2773                    {
2774                        Ok(QueryRequest::_UnknownMethod {
2775                            ordinal: header.ordinal,
2776                            control_handle: QueryControlHandle { inner: this.inner.clone() },
2777                            method_type: fidl::MethodType::OneWay,
2778                        })
2779                    }
2780                    _ if header
2781                        .dynamic_flags()
2782                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2783                    {
2784                        this.inner.send_framework_err(
2785                            fidl::encoding::FrameworkErr::UnknownMethod,
2786                            header.tx_id,
2787                            header.ordinal,
2788                            header.dynamic_flags(),
2789                            (bytes, handles),
2790                        )?;
2791                        Ok(QueryRequest::_UnknownMethod {
2792                            ordinal: header.ordinal,
2793                            control_handle: QueryControlHandle { inner: this.inner.clone() },
2794                            method_type: fidl::MethodType::TwoWay,
2795                        })
2796                    }
2797                    _ => Err(fidl::Error::UnknownOrdinal {
2798                        ordinal: header.ordinal,
2799                        protocol_name: <QueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2800                    }),
2801                }))
2802            },
2803        )
2804    }
2805}
2806
2807#[derive(Debug)]
2808pub enum QueryRequest {
2809    /// Enumerates test cases.
2810    Enumerate {
2811        test_url: String,
2812        iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2813        responder: QueryEnumerateResponder,
2814    },
2815    /// Enumerates test cases in non-hermetic tests.
2816    EnumerateInRealm {
2817        test_url: String,
2818        realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2819        offers: Vec<fidl_fuchsia_component_decl::Offer>,
2820        test_collection: String,
2821        iterator: fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2822        responder: QueryEnumerateInRealmResponder,
2823    },
2824    /// An interaction was received which does not match any known method.
2825    #[non_exhaustive]
2826    _UnknownMethod {
2827        /// Ordinal of the method that was called.
2828        ordinal: u64,
2829        control_handle: QueryControlHandle,
2830        method_type: fidl::MethodType,
2831    },
2832}
2833
2834impl QueryRequest {
2835    #[allow(irrefutable_let_patterns)]
2836    pub fn into_enumerate(
2837        self,
2838    ) -> Option<(String, fidl::endpoints::ServerEnd<CaseIteratorMarker>, QueryEnumerateResponder)>
2839    {
2840        if let QueryRequest::Enumerate { test_url, iterator, responder } = self {
2841            Some((test_url, iterator, responder))
2842        } else {
2843            None
2844        }
2845    }
2846
2847    #[allow(irrefutable_let_patterns)]
2848    pub fn into_enumerate_in_realm(
2849        self,
2850    ) -> Option<(
2851        String,
2852        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
2853        Vec<fidl_fuchsia_component_decl::Offer>,
2854        String,
2855        fidl::endpoints::ServerEnd<CaseIteratorMarker>,
2856        QueryEnumerateInRealmResponder,
2857    )> {
2858        if let QueryRequest::EnumerateInRealm {
2859            test_url,
2860            realm,
2861            offers,
2862            test_collection,
2863            iterator,
2864            responder,
2865        } = self
2866        {
2867            Some((test_url, realm, offers, test_collection, iterator, responder))
2868        } else {
2869            None
2870        }
2871    }
2872
2873    /// Name of the method defined in FIDL
2874    pub fn method_name(&self) -> &'static str {
2875        match *self {
2876            QueryRequest::Enumerate { .. } => "enumerate",
2877            QueryRequest::EnumerateInRealm { .. } => "enumerate_in_realm",
2878            QueryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
2879                "unknown one-way method"
2880            }
2881            QueryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
2882                "unknown two-way method"
2883            }
2884        }
2885    }
2886}
2887
2888#[derive(Debug, Clone)]
2889pub struct QueryControlHandle {
2890    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2891}
2892
2893impl fidl::endpoints::ControlHandle for QueryControlHandle {
2894    fn shutdown(&self) {
2895        self.inner.shutdown()
2896    }
2897
2898    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2899        self.inner.shutdown_with_epitaph(status)
2900    }
2901
2902    fn is_closed(&self) -> bool {
2903        self.inner.channel().is_closed()
2904    }
2905    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2906        self.inner.channel().on_closed()
2907    }
2908
2909    #[cfg(target_os = "fuchsia")]
2910    fn signal_peer(
2911        &self,
2912        clear_mask: zx::Signals,
2913        set_mask: zx::Signals,
2914    ) -> Result<(), zx_status::Status> {
2915        use fidl::Peered;
2916        self.inner.channel().signal_peer(clear_mask, set_mask)
2917    }
2918}
2919
2920impl QueryControlHandle {}
2921
2922#[must_use = "FIDL methods require a response to be sent"]
2923#[derive(Debug)]
2924pub struct QueryEnumerateResponder {
2925    control_handle: std::mem::ManuallyDrop<QueryControlHandle>,
2926    tx_id: u32,
2927}
2928
2929/// Set the the channel to be shutdown (see [`QueryControlHandle::shutdown`])
2930/// if the responder is dropped without sending a response, so that the client
2931/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2932impl std::ops::Drop for QueryEnumerateResponder {
2933    fn drop(&mut self) {
2934        self.control_handle.shutdown();
2935        // Safety: drops once, never accessed again
2936        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2937    }
2938}
2939
2940impl fidl::endpoints::Responder for QueryEnumerateResponder {
2941    type ControlHandle = QueryControlHandle;
2942
2943    fn control_handle(&self) -> &QueryControlHandle {
2944        &self.control_handle
2945    }
2946
2947    fn drop_without_shutdown(mut self) {
2948        // Safety: drops once, never accessed again due to mem::forget
2949        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2950        // Prevent Drop from running (which would shut down the channel)
2951        std::mem::forget(self);
2952    }
2953}
2954
2955impl QueryEnumerateResponder {
2956    /// Sends a response to the FIDL transaction.
2957    ///
2958    /// Sets the channel to shutdown if an error occurs.
2959    pub fn send(self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
2960        let _result = self.send_raw(result);
2961        if _result.is_err() {
2962            self.control_handle.shutdown();
2963        }
2964        self.drop_without_shutdown();
2965        _result
2966    }
2967
2968    /// Similar to "send" but does not shutdown the channel if an error occurs.
2969    pub fn send_no_shutdown_on_err(
2970        self,
2971        mut result: Result<(), LaunchError>,
2972    ) -> Result<(), fidl::Error> {
2973        let _result = self.send_raw(result);
2974        self.drop_without_shutdown();
2975        _result
2976    }
2977
2978    fn send_raw(&self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
2979        self.control_handle.inner.send::<fidl::encoding::ResultType<
2980            fidl::encoding::EmptyStruct,
2981            LaunchError,
2982        >>(
2983            result,
2984            self.tx_id,
2985            0x6cd89c1f2728d418,
2986            fidl::encoding::DynamicFlags::empty(),
2987        )
2988    }
2989}
2990
2991#[must_use = "FIDL methods require a response to be sent"]
2992#[derive(Debug)]
2993pub struct QueryEnumerateInRealmResponder {
2994    control_handle: std::mem::ManuallyDrop<QueryControlHandle>,
2995    tx_id: u32,
2996}
2997
2998/// Set the the channel to be shutdown (see [`QueryControlHandle::shutdown`])
2999/// if the responder is dropped without sending a response, so that the client
3000/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3001impl std::ops::Drop for QueryEnumerateInRealmResponder {
3002    fn drop(&mut self) {
3003        self.control_handle.shutdown();
3004        // Safety: drops once, never accessed again
3005        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3006    }
3007}
3008
3009impl fidl::endpoints::Responder for QueryEnumerateInRealmResponder {
3010    type ControlHandle = QueryControlHandle;
3011
3012    fn control_handle(&self) -> &QueryControlHandle {
3013        &self.control_handle
3014    }
3015
3016    fn drop_without_shutdown(mut self) {
3017        // Safety: drops once, never accessed again due to mem::forget
3018        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3019        // Prevent Drop from running (which would shut down the channel)
3020        std::mem::forget(self);
3021    }
3022}
3023
3024impl QueryEnumerateInRealmResponder {
3025    /// Sends a response to the FIDL transaction.
3026    ///
3027    /// Sets the channel to shutdown if an error occurs.
3028    pub fn send(self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
3029        let _result = self.send_raw(result);
3030        if _result.is_err() {
3031            self.control_handle.shutdown();
3032        }
3033        self.drop_without_shutdown();
3034        _result
3035    }
3036
3037    /// Similar to "send" but does not shutdown the channel if an error occurs.
3038    pub fn send_no_shutdown_on_err(
3039        self,
3040        mut result: Result<(), LaunchError>,
3041    ) -> Result<(), fidl::Error> {
3042        let _result = self.send_raw(result);
3043        self.drop_without_shutdown();
3044        _result
3045    }
3046
3047    fn send_raw(&self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
3048        self.control_handle.inner.send::<fidl::encoding::ResultType<
3049            fidl::encoding::EmptyStruct,
3050            LaunchError,
3051        >>(
3052            result,
3053            self.tx_id,
3054            0x7f7f533194a51ec5,
3055            fidl::encoding::DynamicFlags::empty(),
3056        )
3057    }
3058}
3059
3060#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3061pub struct RunBuilderMarker;
3062
3063impl fidl::endpoints::ProtocolMarker for RunBuilderMarker {
3064    type Proxy = RunBuilderProxy;
3065    type RequestStream = RunBuilderRequestStream;
3066    #[cfg(target_os = "fuchsia")]
3067    type SynchronousProxy = RunBuilderSynchronousProxy;
3068
3069    const DEBUG_NAME: &'static str = "fuchsia.test.manager.RunBuilder";
3070}
3071impl fidl::endpoints::DiscoverableProtocolMarker for RunBuilderMarker {}
3072
3073pub trait RunBuilderProxyInterface: Send + Sync {
3074    fn r#add_suite(
3075        &self,
3076        test_url: &str,
3077        options: &RunOptions,
3078        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3079    ) -> Result<(), fidl::Error>;
3080    fn r#add_suite_in_realm(
3081        &self,
3082        realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3083        offers: &[fidl_fuchsia_component_decl::Offer],
3084        test_collection: &str,
3085        test_url: &str,
3086        options: &RunOptions,
3087        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3088    ) -> Result<(), fidl::Error>;
3089    fn r#with_scheduling_options(&self, options: &SchedulingOptions) -> Result<(), fidl::Error>;
3090    fn r#build(
3091        &self,
3092        controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
3093    ) -> Result<(), fidl::Error>;
3094}
3095#[derive(Debug)]
3096#[cfg(target_os = "fuchsia")]
3097pub struct RunBuilderSynchronousProxy {
3098    client: fidl::client::sync::Client,
3099}
3100
3101#[cfg(target_os = "fuchsia")]
3102impl fidl::endpoints::SynchronousProxy for RunBuilderSynchronousProxy {
3103    type Proxy = RunBuilderProxy;
3104    type Protocol = RunBuilderMarker;
3105
3106    fn from_channel(inner: fidl::Channel) -> Self {
3107        Self::new(inner)
3108    }
3109
3110    fn into_channel(self) -> fidl::Channel {
3111        self.client.into_channel()
3112    }
3113
3114    fn as_channel(&self) -> &fidl::Channel {
3115        self.client.as_channel()
3116    }
3117}
3118
3119#[cfg(target_os = "fuchsia")]
3120impl RunBuilderSynchronousProxy {
3121    pub fn new(channel: fidl::Channel) -> Self {
3122        Self { client: fidl::client::sync::Client::new(channel) }
3123    }
3124
3125    pub fn into_channel(self) -> fidl::Channel {
3126        self.client.into_channel()
3127    }
3128
3129    /// Waits until an event arrives and returns it. It is safe for other
3130    /// threads to make concurrent requests while waiting for an event.
3131    pub fn wait_for_event(
3132        &self,
3133        deadline: zx::MonotonicInstant,
3134    ) -> Result<RunBuilderEvent, fidl::Error> {
3135        RunBuilderEvent::decode(self.client.wait_for_event::<RunBuilderMarker>(deadline)?)
3136    }
3137
3138    /// Add a suite to this run. A suite is a component that implements
3139    /// `fuchsia.test.Suite`. Implementors of this API will talk to test suites
3140    /// using "Suite" protocol and return results using `controller`. The
3141    /// controller is also used to control the execution of the test suite.
3142    pub fn r#add_suite(
3143        &self,
3144        mut test_url: &str,
3145        mut options: &RunOptions,
3146        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3147    ) -> Result<(), fidl::Error> {
3148        self.client.send::<RunBuilderAddSuiteRequest>(
3149            (test_url, options, controller),
3150            0x71e7f9a06daac486,
3151            fidl::encoding::DynamicFlags::FLEXIBLE,
3152        )
3153    }
3154
3155    /// Add a suite to this run which would run in provided 'realm'. A suite is
3156    /// a component that implements `fuchsia.test.Suite`. Implementors of this
3157    /// API will talk to test suites using "Suite" protocol and return results
3158    /// using `controller`. The controller is also used to control the execution
3159    /// of the test suite.
3160    pub fn r#add_suite_in_realm(
3161        &self,
3162        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3163        mut offers: &[fidl_fuchsia_component_decl::Offer],
3164        mut test_collection: &str,
3165        mut test_url: &str,
3166        mut options: &RunOptions,
3167        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3168    ) -> Result<(), fidl::Error> {
3169        self.client.send::<RunBuilderAddSuiteInRealmRequest>(
3170            (realm, offers, test_collection, test_url, options, controller),
3171            0x4d10c582715a8683,
3172            fidl::encoding::DynamicFlags::FLEXIBLE,
3173        )
3174    }
3175
3176    /// Specify scheduling options used for this run.
3177    pub fn r#with_scheduling_options(
3178        &self,
3179        mut options: &SchedulingOptions,
3180    ) -> Result<(), fidl::Error> {
3181        self.client.send::<RunBuilderWithSchedulingOptionsRequest>(
3182            (options,),
3183            0x55e73fdbeade0b0b,
3184            fidl::encoding::DynamicFlags::FLEXIBLE,
3185        )
3186    }
3187
3188    /// Build and schedule the run.
3189    ///
3190    /// This runs all suites added with their respective filters and closes the
3191    /// channel once it is done.
3192    pub fn r#build(
3193        &self,
3194        mut controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
3195    ) -> Result<(), fidl::Error> {
3196        self.client.send::<RunBuilderBuildRequest>(
3197            (controller,),
3198            0x7879f2360ff1f160,
3199            fidl::encoding::DynamicFlags::FLEXIBLE,
3200        )
3201    }
3202}
3203
3204#[cfg(target_os = "fuchsia")]
3205impl From<RunBuilderSynchronousProxy> for zx::NullableHandle {
3206    fn from(value: RunBuilderSynchronousProxy) -> Self {
3207        value.into_channel().into()
3208    }
3209}
3210
3211#[cfg(target_os = "fuchsia")]
3212impl From<fidl::Channel> for RunBuilderSynchronousProxy {
3213    fn from(value: fidl::Channel) -> Self {
3214        Self::new(value)
3215    }
3216}
3217
3218#[cfg(target_os = "fuchsia")]
3219impl fidl::endpoints::FromClient for RunBuilderSynchronousProxy {
3220    type Protocol = RunBuilderMarker;
3221
3222    fn from_client(value: fidl::endpoints::ClientEnd<RunBuilderMarker>) -> Self {
3223        Self::new(value.into_channel())
3224    }
3225}
3226
3227#[derive(Debug, Clone)]
3228pub struct RunBuilderProxy {
3229    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3230}
3231
3232impl fidl::endpoints::Proxy for RunBuilderProxy {
3233    type Protocol = RunBuilderMarker;
3234
3235    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3236        Self::new(inner)
3237    }
3238
3239    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3240        self.client.into_channel().map_err(|client| Self { client })
3241    }
3242
3243    fn as_channel(&self) -> &::fidl::AsyncChannel {
3244        self.client.as_channel()
3245    }
3246}
3247
3248impl RunBuilderProxy {
3249    /// Create a new Proxy for fuchsia.test.manager/RunBuilder.
3250    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3251        let protocol_name = <RunBuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3252        Self { client: fidl::client::Client::new(channel, protocol_name) }
3253    }
3254
3255    /// Get a Stream of events from the remote end of the protocol.
3256    ///
3257    /// # Panics
3258    ///
3259    /// Panics if the event stream was already taken.
3260    pub fn take_event_stream(&self) -> RunBuilderEventStream {
3261        RunBuilderEventStream { event_receiver: self.client.take_event_receiver() }
3262    }
3263
3264    /// Add a suite to this run. A suite is a component that implements
3265    /// `fuchsia.test.Suite`. Implementors of this API will talk to test suites
3266    /// using "Suite" protocol and return results using `controller`. The
3267    /// controller is also used to control the execution of the test suite.
3268    pub fn r#add_suite(
3269        &self,
3270        mut test_url: &str,
3271        mut options: &RunOptions,
3272        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3273    ) -> Result<(), fidl::Error> {
3274        RunBuilderProxyInterface::r#add_suite(self, test_url, options, controller)
3275    }
3276
3277    /// Add a suite to this run which would run in provided 'realm'. A suite is
3278    /// a component that implements `fuchsia.test.Suite`. Implementors of this
3279    /// API will talk to test suites using "Suite" protocol and return results
3280    /// using `controller`. The controller is also used to control the execution
3281    /// of the test suite.
3282    pub fn r#add_suite_in_realm(
3283        &self,
3284        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3285        mut offers: &[fidl_fuchsia_component_decl::Offer],
3286        mut test_collection: &str,
3287        mut test_url: &str,
3288        mut options: &RunOptions,
3289        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3290    ) -> Result<(), fidl::Error> {
3291        RunBuilderProxyInterface::r#add_suite_in_realm(
3292            self,
3293            realm,
3294            offers,
3295            test_collection,
3296            test_url,
3297            options,
3298            controller,
3299        )
3300    }
3301
3302    /// Specify scheduling options used for this run.
3303    pub fn r#with_scheduling_options(
3304        &self,
3305        mut options: &SchedulingOptions,
3306    ) -> Result<(), fidl::Error> {
3307        RunBuilderProxyInterface::r#with_scheduling_options(self, options)
3308    }
3309
3310    /// Build and schedule the run.
3311    ///
3312    /// This runs all suites added with their respective filters and closes the
3313    /// channel once it is done.
3314    pub fn r#build(
3315        &self,
3316        mut controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
3317    ) -> Result<(), fidl::Error> {
3318        RunBuilderProxyInterface::r#build(self, controller)
3319    }
3320}
3321
3322impl RunBuilderProxyInterface for RunBuilderProxy {
3323    fn r#add_suite(
3324        &self,
3325        mut test_url: &str,
3326        mut options: &RunOptions,
3327        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3328    ) -> Result<(), fidl::Error> {
3329        self.client.send::<RunBuilderAddSuiteRequest>(
3330            (test_url, options, controller),
3331            0x71e7f9a06daac486,
3332            fidl::encoding::DynamicFlags::FLEXIBLE,
3333        )
3334    }
3335
3336    fn r#add_suite_in_realm(
3337        &self,
3338        mut realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3339        mut offers: &[fidl_fuchsia_component_decl::Offer],
3340        mut test_collection: &str,
3341        mut test_url: &str,
3342        mut options: &RunOptions,
3343        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3344    ) -> Result<(), fidl::Error> {
3345        self.client.send::<RunBuilderAddSuiteInRealmRequest>(
3346            (realm, offers, test_collection, test_url, options, controller),
3347            0x4d10c582715a8683,
3348            fidl::encoding::DynamicFlags::FLEXIBLE,
3349        )
3350    }
3351
3352    fn r#with_scheduling_options(
3353        &self,
3354        mut options: &SchedulingOptions,
3355    ) -> Result<(), fidl::Error> {
3356        self.client.send::<RunBuilderWithSchedulingOptionsRequest>(
3357            (options,),
3358            0x55e73fdbeade0b0b,
3359            fidl::encoding::DynamicFlags::FLEXIBLE,
3360        )
3361    }
3362
3363    fn r#build(
3364        &self,
3365        mut controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
3366    ) -> Result<(), fidl::Error> {
3367        self.client.send::<RunBuilderBuildRequest>(
3368            (controller,),
3369            0x7879f2360ff1f160,
3370            fidl::encoding::DynamicFlags::FLEXIBLE,
3371        )
3372    }
3373}
3374
3375pub struct RunBuilderEventStream {
3376    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3377}
3378
3379impl std::marker::Unpin for RunBuilderEventStream {}
3380
3381impl futures::stream::FusedStream for RunBuilderEventStream {
3382    fn is_terminated(&self) -> bool {
3383        self.event_receiver.is_terminated()
3384    }
3385}
3386
3387impl futures::Stream for RunBuilderEventStream {
3388    type Item = Result<RunBuilderEvent, fidl::Error>;
3389
3390    fn poll_next(
3391        mut self: std::pin::Pin<&mut Self>,
3392        cx: &mut std::task::Context<'_>,
3393    ) -> std::task::Poll<Option<Self::Item>> {
3394        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3395            &mut self.event_receiver,
3396            cx
3397        )?) {
3398            Some(buf) => std::task::Poll::Ready(Some(RunBuilderEvent::decode(buf))),
3399            None => std::task::Poll::Ready(None),
3400        }
3401    }
3402}
3403
3404#[derive(Debug)]
3405pub enum RunBuilderEvent {
3406    #[non_exhaustive]
3407    _UnknownEvent {
3408        /// Ordinal of the event that was sent.
3409        ordinal: u64,
3410    },
3411}
3412
3413impl RunBuilderEvent {
3414    /// Decodes a message buffer as a [`RunBuilderEvent`].
3415    fn decode(
3416        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3417    ) -> Result<RunBuilderEvent, fidl::Error> {
3418        let (bytes, _handles) = buf.split_mut();
3419        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3420        debug_assert_eq!(tx_header.tx_id, 0);
3421        match tx_header.ordinal {
3422            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3423                Ok(RunBuilderEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3424            }
3425            _ => Err(fidl::Error::UnknownOrdinal {
3426                ordinal: tx_header.ordinal,
3427                protocol_name: <RunBuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3428            }),
3429        }
3430    }
3431}
3432
3433/// A Stream of incoming requests for fuchsia.test.manager/RunBuilder.
3434pub struct RunBuilderRequestStream {
3435    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3436    is_terminated: bool,
3437}
3438
3439impl std::marker::Unpin for RunBuilderRequestStream {}
3440
3441impl futures::stream::FusedStream for RunBuilderRequestStream {
3442    fn is_terminated(&self) -> bool {
3443        self.is_terminated
3444    }
3445}
3446
3447impl fidl::endpoints::RequestStream for RunBuilderRequestStream {
3448    type Protocol = RunBuilderMarker;
3449    type ControlHandle = RunBuilderControlHandle;
3450
3451    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3452        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3453    }
3454
3455    fn control_handle(&self) -> Self::ControlHandle {
3456        RunBuilderControlHandle { inner: self.inner.clone() }
3457    }
3458
3459    fn into_inner(
3460        self,
3461    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3462    {
3463        (self.inner, self.is_terminated)
3464    }
3465
3466    fn from_inner(
3467        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3468        is_terminated: bool,
3469    ) -> Self {
3470        Self { inner, is_terminated }
3471    }
3472}
3473
3474impl futures::Stream for RunBuilderRequestStream {
3475    type Item = Result<RunBuilderRequest, fidl::Error>;
3476
3477    fn poll_next(
3478        mut self: std::pin::Pin<&mut Self>,
3479        cx: &mut std::task::Context<'_>,
3480    ) -> std::task::Poll<Option<Self::Item>> {
3481        let this = &mut *self;
3482        if this.inner.check_shutdown(cx) {
3483            this.is_terminated = true;
3484            return std::task::Poll::Ready(None);
3485        }
3486        if this.is_terminated {
3487            panic!("polled RunBuilderRequestStream after completion");
3488        }
3489        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3490            |bytes, handles| {
3491                match this.inner.channel().read_etc(cx, bytes, handles) {
3492                    std::task::Poll::Ready(Ok(())) => {}
3493                    std::task::Poll::Pending => return std::task::Poll::Pending,
3494                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3495                        this.is_terminated = true;
3496                        return std::task::Poll::Ready(None);
3497                    }
3498                    std::task::Poll::Ready(Err(e)) => {
3499                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3500                            e.into(),
3501                        ))));
3502                    }
3503                }
3504
3505                // A message has been received from the channel
3506                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3507
3508                std::task::Poll::Ready(Some(match header.ordinal {
3509                    0x71e7f9a06daac486 => {
3510                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3511                        let mut req = fidl::new_empty!(
3512                            RunBuilderAddSuiteRequest,
3513                            fidl::encoding::DefaultFuchsiaResourceDialect
3514                        );
3515                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunBuilderAddSuiteRequest>(&header, _body_bytes, handles, &mut req)?;
3516                        let control_handle = RunBuilderControlHandle { inner: this.inner.clone() };
3517                        Ok(RunBuilderRequest::AddSuite {
3518                            test_url: req.test_url,
3519                            options: req.options,
3520                            controller: req.controller,
3521
3522                            control_handle,
3523                        })
3524                    }
3525                    0x4d10c582715a8683 => {
3526                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3527                        let mut req = fidl::new_empty!(
3528                            RunBuilderAddSuiteInRealmRequest,
3529                            fidl::encoding::DefaultFuchsiaResourceDialect
3530                        );
3531                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunBuilderAddSuiteInRealmRequest>(&header, _body_bytes, handles, &mut req)?;
3532                        let control_handle = RunBuilderControlHandle { inner: this.inner.clone() };
3533                        Ok(RunBuilderRequest::AddSuiteInRealm {
3534                            realm: req.realm,
3535                            offers: req.offers,
3536                            test_collection: req.test_collection,
3537                            test_url: req.test_url,
3538                            options: req.options,
3539                            controller: req.controller,
3540
3541                            control_handle,
3542                        })
3543                    }
3544                    0x55e73fdbeade0b0b => {
3545                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3546                        let mut req = fidl::new_empty!(
3547                            RunBuilderWithSchedulingOptionsRequest,
3548                            fidl::encoding::DefaultFuchsiaResourceDialect
3549                        );
3550                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunBuilderWithSchedulingOptionsRequest>(&header, _body_bytes, handles, &mut req)?;
3551                        let control_handle = RunBuilderControlHandle { inner: this.inner.clone() };
3552                        Ok(RunBuilderRequest::WithSchedulingOptions {
3553                            options: req.options,
3554
3555                            control_handle,
3556                        })
3557                    }
3558                    0x7879f2360ff1f160 => {
3559                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3560                        let mut req = fidl::new_empty!(
3561                            RunBuilderBuildRequest,
3562                            fidl::encoding::DefaultFuchsiaResourceDialect
3563                        );
3564                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunBuilderBuildRequest>(&header, _body_bytes, handles, &mut req)?;
3565                        let control_handle = RunBuilderControlHandle { inner: this.inner.clone() };
3566                        Ok(RunBuilderRequest::Build { controller: req.controller, control_handle })
3567                    }
3568                    _ if header.tx_id == 0
3569                        && header
3570                            .dynamic_flags()
3571                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3572                    {
3573                        Ok(RunBuilderRequest::_UnknownMethod {
3574                            ordinal: header.ordinal,
3575                            control_handle: RunBuilderControlHandle { inner: this.inner.clone() },
3576                            method_type: fidl::MethodType::OneWay,
3577                        })
3578                    }
3579                    _ if header
3580                        .dynamic_flags()
3581                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3582                    {
3583                        this.inner.send_framework_err(
3584                            fidl::encoding::FrameworkErr::UnknownMethod,
3585                            header.tx_id,
3586                            header.ordinal,
3587                            header.dynamic_flags(),
3588                            (bytes, handles),
3589                        )?;
3590                        Ok(RunBuilderRequest::_UnknownMethod {
3591                            ordinal: header.ordinal,
3592                            control_handle: RunBuilderControlHandle { inner: this.inner.clone() },
3593                            method_type: fidl::MethodType::TwoWay,
3594                        })
3595                    }
3596                    _ => Err(fidl::Error::UnknownOrdinal {
3597                        ordinal: header.ordinal,
3598                        protocol_name:
3599                            <RunBuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3600                    }),
3601                }))
3602            },
3603        )
3604    }
3605}
3606
3607/// This is the entry point of running test suites. A test "run" consists of
3608/// multiple test "suites" which consists of running multiple "test cases".
3609#[derive(Debug)]
3610pub enum RunBuilderRequest {
3611    /// Add a suite to this run. A suite is a component that implements
3612    /// `fuchsia.test.Suite`. Implementors of this API will talk to test suites
3613    /// using "Suite" protocol and return results using `controller`. The
3614    /// controller is also used to control the execution of the test suite.
3615    AddSuite {
3616        test_url: String,
3617        options: RunOptions,
3618        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3619        control_handle: RunBuilderControlHandle,
3620    },
3621    /// Add a suite to this run which would run in provided 'realm'. A suite is
3622    /// a component that implements `fuchsia.test.Suite`. Implementors of this
3623    /// API will talk to test suites using "Suite" protocol and return results
3624    /// using `controller`. The controller is also used to control the execution
3625    /// of the test suite.
3626    AddSuiteInRealm {
3627        realm: fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3628        offers: Vec<fidl_fuchsia_component_decl::Offer>,
3629        test_collection: String,
3630        test_url: String,
3631        options: RunOptions,
3632        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3633        control_handle: RunBuilderControlHandle,
3634    },
3635    /// Specify scheduling options used for this run.
3636    WithSchedulingOptions { options: SchedulingOptions, control_handle: RunBuilderControlHandle },
3637    /// Build and schedule the run.
3638    ///
3639    /// This runs all suites added with their respective filters and closes the
3640    /// channel once it is done.
3641    Build {
3642        controller: fidl::endpoints::ServerEnd<RunControllerMarker>,
3643        control_handle: RunBuilderControlHandle,
3644    },
3645    /// An interaction was received which does not match any known method.
3646    #[non_exhaustive]
3647    _UnknownMethod {
3648        /// Ordinal of the method that was called.
3649        ordinal: u64,
3650        control_handle: RunBuilderControlHandle,
3651        method_type: fidl::MethodType,
3652    },
3653}
3654
3655impl RunBuilderRequest {
3656    #[allow(irrefutable_let_patterns)]
3657    pub fn into_add_suite(
3658        self,
3659    ) -> Option<(
3660        String,
3661        RunOptions,
3662        fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3663        RunBuilderControlHandle,
3664    )> {
3665        if let RunBuilderRequest::AddSuite { test_url, options, controller, control_handle } = self
3666        {
3667            Some((test_url, options, controller, control_handle))
3668        } else {
3669            None
3670        }
3671    }
3672
3673    #[allow(irrefutable_let_patterns)]
3674    pub fn into_add_suite_in_realm(
3675        self,
3676    ) -> Option<(
3677        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
3678        Vec<fidl_fuchsia_component_decl::Offer>,
3679        String,
3680        String,
3681        RunOptions,
3682        fidl::endpoints::ServerEnd<SuiteControllerMarker>,
3683        RunBuilderControlHandle,
3684    )> {
3685        if let RunBuilderRequest::AddSuiteInRealm {
3686            realm,
3687            offers,
3688            test_collection,
3689            test_url,
3690            options,
3691            controller,
3692            control_handle,
3693        } = self
3694        {
3695            Some((realm, offers, test_collection, test_url, options, controller, control_handle))
3696        } else {
3697            None
3698        }
3699    }
3700
3701    #[allow(irrefutable_let_patterns)]
3702    pub fn into_with_scheduling_options(
3703        self,
3704    ) -> Option<(SchedulingOptions, RunBuilderControlHandle)> {
3705        if let RunBuilderRequest::WithSchedulingOptions { options, control_handle } = self {
3706            Some((options, control_handle))
3707        } else {
3708            None
3709        }
3710    }
3711
3712    #[allow(irrefutable_let_patterns)]
3713    pub fn into_build(
3714        self,
3715    ) -> Option<(fidl::endpoints::ServerEnd<RunControllerMarker>, RunBuilderControlHandle)> {
3716        if let RunBuilderRequest::Build { controller, control_handle } = self {
3717            Some((controller, control_handle))
3718        } else {
3719            None
3720        }
3721    }
3722
3723    /// Name of the method defined in FIDL
3724    pub fn method_name(&self) -> &'static str {
3725        match *self {
3726            RunBuilderRequest::AddSuite { .. } => "add_suite",
3727            RunBuilderRequest::AddSuiteInRealm { .. } => "add_suite_in_realm",
3728            RunBuilderRequest::WithSchedulingOptions { .. } => "with_scheduling_options",
3729            RunBuilderRequest::Build { .. } => "build",
3730            RunBuilderRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
3731                "unknown one-way method"
3732            }
3733            RunBuilderRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
3734                "unknown two-way method"
3735            }
3736        }
3737    }
3738}
3739
3740#[derive(Debug, Clone)]
3741pub struct RunBuilderControlHandle {
3742    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3743}
3744
3745impl fidl::endpoints::ControlHandle for RunBuilderControlHandle {
3746    fn shutdown(&self) {
3747        self.inner.shutdown()
3748    }
3749
3750    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3751        self.inner.shutdown_with_epitaph(status)
3752    }
3753
3754    fn is_closed(&self) -> bool {
3755        self.inner.channel().is_closed()
3756    }
3757    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3758        self.inner.channel().on_closed()
3759    }
3760
3761    #[cfg(target_os = "fuchsia")]
3762    fn signal_peer(
3763        &self,
3764        clear_mask: zx::Signals,
3765        set_mask: zx::Signals,
3766    ) -> Result<(), zx_status::Status> {
3767        use fidl::Peered;
3768        self.inner.channel().signal_peer(clear_mask, set_mask)
3769    }
3770}
3771
3772impl RunBuilderControlHandle {}
3773
3774#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3775pub struct RunControllerMarker;
3776
3777impl fidl::endpoints::ProtocolMarker for RunControllerMarker {
3778    type Proxy = RunControllerProxy;
3779    type RequestStream = RunControllerRequestStream;
3780    #[cfg(target_os = "fuchsia")]
3781    type SynchronousProxy = RunControllerSynchronousProxy;
3782
3783    const DEBUG_NAME: &'static str = "fuchsia.test.manager.RunController";
3784}
3785impl fidl::endpoints::DiscoverableProtocolMarker for RunControllerMarker {}
3786
3787pub trait RunControllerProxyInterface: Send + Sync {
3788    fn r#stop(&self) -> Result<(), fidl::Error>;
3789    fn r#kill(&self) -> Result<(), fidl::Error>;
3790    type GetEventsResponseFut: std::future::Future<Output = Result<Vec<RunEvent>, fidl::Error>>
3791        + Send;
3792    fn r#get_events(&self) -> Self::GetEventsResponseFut;
3793}
3794#[derive(Debug)]
3795#[cfg(target_os = "fuchsia")]
3796pub struct RunControllerSynchronousProxy {
3797    client: fidl::client::sync::Client,
3798}
3799
3800#[cfg(target_os = "fuchsia")]
3801impl fidl::endpoints::SynchronousProxy for RunControllerSynchronousProxy {
3802    type Proxy = RunControllerProxy;
3803    type Protocol = RunControllerMarker;
3804
3805    fn from_channel(inner: fidl::Channel) -> Self {
3806        Self::new(inner)
3807    }
3808
3809    fn into_channel(self) -> fidl::Channel {
3810        self.client.into_channel()
3811    }
3812
3813    fn as_channel(&self) -> &fidl::Channel {
3814        self.client.as_channel()
3815    }
3816}
3817
3818#[cfg(target_os = "fuchsia")]
3819impl RunControllerSynchronousProxy {
3820    pub fn new(channel: fidl::Channel) -> Self {
3821        Self { client: fidl::client::sync::Client::new(channel) }
3822    }
3823
3824    pub fn into_channel(self) -> fidl::Channel {
3825        self.client.into_channel()
3826    }
3827
3828    /// Waits until an event arrives and returns it. It is safe for other
3829    /// threads to make concurrent requests while waiting for an event.
3830    pub fn wait_for_event(
3831        &self,
3832        deadline: zx::MonotonicInstant,
3833    ) -> Result<RunControllerEvent, fidl::Error> {
3834        RunControllerEvent::decode(self.client.wait_for_event::<RunControllerMarker>(deadline)?)
3835    }
3836
3837    /// Stop the run gracefully. RunController will disconnect after all
3838    /// resources are released and all the events in this controller are drained.
3839    /// This method is used to allow the run to complete tests that are in progress,
3840    /// but will prevent starting new tests.
3841    pub fn r#stop(&self) -> Result<(), fidl::Error> {
3842        self.client.send::<fidl::encoding::EmptyPayload>(
3843            (),
3844            0x24972633e2cf712d,
3845            fidl::encoding::DynamicFlags::FLEXIBLE,
3846        )
3847    }
3848
3849    /// Immediately terminate the run. RunController will disconnect after all
3850    /// resources are released. This method will terminate tests even if they
3851    /// are in progress.
3852    pub fn r#kill(&self) -> Result<(), fidl::Error> {
3853        self.client.send::<fidl::encoding::EmptyPayload>(
3854            (),
3855            0x6e62104929fc55c5,
3856            fidl::encoding::DynamicFlags::FLEXIBLE,
3857        )
3858    }
3859
3860    /// Iterator over events for the run. This method is a hanging get; it
3861    /// returns an empty vector only when there will be no further events
3862    /// (the run completed).
3863    pub fn r#get_events(
3864        &self,
3865        ___deadline: zx::MonotonicInstant,
3866    ) -> Result<Vec<RunEvent>, fidl::Error> {
3867        let _response = self.client.send_query::<
3868            fidl::encoding::EmptyPayload,
3869            RunControllerGetEventsResponse,
3870            RunControllerMarker,
3871        >(
3872            (),
3873            0x273bbd98cfcea4ba,
3874            fidl::encoding::DynamicFlags::empty(),
3875            ___deadline,
3876        )?;
3877        Ok(_response.events)
3878    }
3879}
3880
3881#[cfg(target_os = "fuchsia")]
3882impl From<RunControllerSynchronousProxy> for zx::NullableHandle {
3883    fn from(value: RunControllerSynchronousProxy) -> Self {
3884        value.into_channel().into()
3885    }
3886}
3887
3888#[cfg(target_os = "fuchsia")]
3889impl From<fidl::Channel> for RunControllerSynchronousProxy {
3890    fn from(value: fidl::Channel) -> Self {
3891        Self::new(value)
3892    }
3893}
3894
3895#[cfg(target_os = "fuchsia")]
3896impl fidl::endpoints::FromClient for RunControllerSynchronousProxy {
3897    type Protocol = RunControllerMarker;
3898
3899    fn from_client(value: fidl::endpoints::ClientEnd<RunControllerMarker>) -> Self {
3900        Self::new(value.into_channel())
3901    }
3902}
3903
3904#[derive(Debug, Clone)]
3905pub struct RunControllerProxy {
3906    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3907}
3908
3909impl fidl::endpoints::Proxy for RunControllerProxy {
3910    type Protocol = RunControllerMarker;
3911
3912    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3913        Self::new(inner)
3914    }
3915
3916    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3917        self.client.into_channel().map_err(|client| Self { client })
3918    }
3919
3920    fn as_channel(&self) -> &::fidl::AsyncChannel {
3921        self.client.as_channel()
3922    }
3923}
3924
3925impl RunControllerProxy {
3926    /// Create a new Proxy for fuchsia.test.manager/RunController.
3927    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3928        let protocol_name = <RunControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3929        Self { client: fidl::client::Client::new(channel, protocol_name) }
3930    }
3931
3932    /// Get a Stream of events from the remote end of the protocol.
3933    ///
3934    /// # Panics
3935    ///
3936    /// Panics if the event stream was already taken.
3937    pub fn take_event_stream(&self) -> RunControllerEventStream {
3938        RunControllerEventStream { event_receiver: self.client.take_event_receiver() }
3939    }
3940
3941    /// Stop the run gracefully. RunController will disconnect after all
3942    /// resources are released and all the events in this controller are drained.
3943    /// This method is used to allow the run to complete tests that are in progress,
3944    /// but will prevent starting new tests.
3945    pub fn r#stop(&self) -> Result<(), fidl::Error> {
3946        RunControllerProxyInterface::r#stop(self)
3947    }
3948
3949    /// Immediately terminate the run. RunController will disconnect after all
3950    /// resources are released. This method will terminate tests even if they
3951    /// are in progress.
3952    pub fn r#kill(&self) -> Result<(), fidl::Error> {
3953        RunControllerProxyInterface::r#kill(self)
3954    }
3955
3956    /// Iterator over events for the run. This method is a hanging get; it
3957    /// returns an empty vector only when there will be no further events
3958    /// (the run completed).
3959    pub fn r#get_events(
3960        &self,
3961    ) -> fidl::client::QueryResponseFut<Vec<RunEvent>, fidl::encoding::DefaultFuchsiaResourceDialect>
3962    {
3963        RunControllerProxyInterface::r#get_events(self)
3964    }
3965}
3966
3967impl RunControllerProxyInterface for RunControllerProxy {
3968    fn r#stop(&self) -> Result<(), fidl::Error> {
3969        self.client.send::<fidl::encoding::EmptyPayload>(
3970            (),
3971            0x24972633e2cf712d,
3972            fidl::encoding::DynamicFlags::FLEXIBLE,
3973        )
3974    }
3975
3976    fn r#kill(&self) -> Result<(), fidl::Error> {
3977        self.client.send::<fidl::encoding::EmptyPayload>(
3978            (),
3979            0x6e62104929fc55c5,
3980            fidl::encoding::DynamicFlags::FLEXIBLE,
3981        )
3982    }
3983
3984    type GetEventsResponseFut = fidl::client::QueryResponseFut<
3985        Vec<RunEvent>,
3986        fidl::encoding::DefaultFuchsiaResourceDialect,
3987    >;
3988    fn r#get_events(&self) -> Self::GetEventsResponseFut {
3989        fn _decode(
3990            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3991        ) -> Result<Vec<RunEvent>, fidl::Error> {
3992            let _response = fidl::client::decode_transaction_body::<
3993                RunControllerGetEventsResponse,
3994                fidl::encoding::DefaultFuchsiaResourceDialect,
3995                0x273bbd98cfcea4ba,
3996            >(_buf?)?;
3997            Ok(_response.events)
3998        }
3999        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<RunEvent>>(
4000            (),
4001            0x273bbd98cfcea4ba,
4002            fidl::encoding::DynamicFlags::empty(),
4003            _decode,
4004        )
4005    }
4006}
4007
4008pub struct RunControllerEventStream {
4009    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4010}
4011
4012impl std::marker::Unpin for RunControllerEventStream {}
4013
4014impl futures::stream::FusedStream for RunControllerEventStream {
4015    fn is_terminated(&self) -> bool {
4016        self.event_receiver.is_terminated()
4017    }
4018}
4019
4020impl futures::Stream for RunControllerEventStream {
4021    type Item = Result<RunControllerEvent, fidl::Error>;
4022
4023    fn poll_next(
4024        mut self: std::pin::Pin<&mut Self>,
4025        cx: &mut std::task::Context<'_>,
4026    ) -> std::task::Poll<Option<Self::Item>> {
4027        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4028            &mut self.event_receiver,
4029            cx
4030        )?) {
4031            Some(buf) => std::task::Poll::Ready(Some(RunControllerEvent::decode(buf))),
4032            None => std::task::Poll::Ready(None),
4033        }
4034    }
4035}
4036
4037#[derive(Debug)]
4038pub enum RunControllerEvent {
4039    #[non_exhaustive]
4040    _UnknownEvent {
4041        /// Ordinal of the event that was sent.
4042        ordinal: u64,
4043    },
4044}
4045
4046impl RunControllerEvent {
4047    /// Decodes a message buffer as a [`RunControllerEvent`].
4048    fn decode(
4049        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4050    ) -> Result<RunControllerEvent, fidl::Error> {
4051        let (bytes, _handles) = buf.split_mut();
4052        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4053        debug_assert_eq!(tx_header.tx_id, 0);
4054        match tx_header.ordinal {
4055            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4056                Ok(RunControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4057            }
4058            _ => Err(fidl::Error::UnknownOrdinal {
4059                ordinal: tx_header.ordinal,
4060                protocol_name: <RunControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4061            }),
4062        }
4063    }
4064}
4065
4066/// A Stream of incoming requests for fuchsia.test.manager/RunController.
4067pub struct RunControllerRequestStream {
4068    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4069    is_terminated: bool,
4070}
4071
4072impl std::marker::Unpin for RunControllerRequestStream {}
4073
4074impl futures::stream::FusedStream for RunControllerRequestStream {
4075    fn is_terminated(&self) -> bool {
4076        self.is_terminated
4077    }
4078}
4079
4080impl fidl::endpoints::RequestStream for RunControllerRequestStream {
4081    type Protocol = RunControllerMarker;
4082    type ControlHandle = RunControllerControlHandle;
4083
4084    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4085        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4086    }
4087
4088    fn control_handle(&self) -> Self::ControlHandle {
4089        RunControllerControlHandle { inner: self.inner.clone() }
4090    }
4091
4092    fn into_inner(
4093        self,
4094    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4095    {
4096        (self.inner, self.is_terminated)
4097    }
4098
4099    fn from_inner(
4100        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4101        is_terminated: bool,
4102    ) -> Self {
4103        Self { inner, is_terminated }
4104    }
4105}
4106
4107impl futures::Stream for RunControllerRequestStream {
4108    type Item = Result<RunControllerRequest, fidl::Error>;
4109
4110    fn poll_next(
4111        mut self: std::pin::Pin<&mut Self>,
4112        cx: &mut std::task::Context<'_>,
4113    ) -> std::task::Poll<Option<Self::Item>> {
4114        let this = &mut *self;
4115        if this.inner.check_shutdown(cx) {
4116            this.is_terminated = true;
4117            return std::task::Poll::Ready(None);
4118        }
4119        if this.is_terminated {
4120            panic!("polled RunControllerRequestStream after completion");
4121        }
4122        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4123            |bytes, handles| {
4124                match this.inner.channel().read_etc(cx, bytes, handles) {
4125                    std::task::Poll::Ready(Ok(())) => {}
4126                    std::task::Poll::Pending => return std::task::Poll::Pending,
4127                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4128                        this.is_terminated = true;
4129                        return std::task::Poll::Ready(None);
4130                    }
4131                    std::task::Poll::Ready(Err(e)) => {
4132                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4133                            e.into(),
4134                        ))));
4135                    }
4136                }
4137
4138                // A message has been received from the channel
4139                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4140
4141                std::task::Poll::Ready(Some(match header.ordinal {
4142                    0x24972633e2cf712d => {
4143                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4144                        let mut req = fidl::new_empty!(
4145                            fidl::encoding::EmptyPayload,
4146                            fidl::encoding::DefaultFuchsiaResourceDialect
4147                        );
4148                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4149                        let control_handle =
4150                            RunControllerControlHandle { inner: this.inner.clone() };
4151                        Ok(RunControllerRequest::Stop { control_handle })
4152                    }
4153                    0x6e62104929fc55c5 => {
4154                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4155                        let mut req = fidl::new_empty!(
4156                            fidl::encoding::EmptyPayload,
4157                            fidl::encoding::DefaultFuchsiaResourceDialect
4158                        );
4159                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4160                        let control_handle =
4161                            RunControllerControlHandle { inner: this.inner.clone() };
4162                        Ok(RunControllerRequest::Kill { control_handle })
4163                    }
4164                    0x273bbd98cfcea4ba => {
4165                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4166                        let mut req = fidl::new_empty!(
4167                            fidl::encoding::EmptyPayload,
4168                            fidl::encoding::DefaultFuchsiaResourceDialect
4169                        );
4170                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4171                        let control_handle =
4172                            RunControllerControlHandle { inner: this.inner.clone() };
4173                        Ok(RunControllerRequest::GetEvents {
4174                            responder: RunControllerGetEventsResponder {
4175                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4176                                tx_id: header.tx_id,
4177                            },
4178                        })
4179                    }
4180                    _ if header.tx_id == 0
4181                        && header
4182                            .dynamic_flags()
4183                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4184                    {
4185                        Ok(RunControllerRequest::_UnknownMethod {
4186                            ordinal: header.ordinal,
4187                            control_handle: RunControllerControlHandle {
4188                                inner: this.inner.clone(),
4189                            },
4190                            method_type: fidl::MethodType::OneWay,
4191                        })
4192                    }
4193                    _ if header
4194                        .dynamic_flags()
4195                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4196                    {
4197                        this.inner.send_framework_err(
4198                            fidl::encoding::FrameworkErr::UnknownMethod,
4199                            header.tx_id,
4200                            header.ordinal,
4201                            header.dynamic_flags(),
4202                            (bytes, handles),
4203                        )?;
4204                        Ok(RunControllerRequest::_UnknownMethod {
4205                            ordinal: header.ordinal,
4206                            control_handle: RunControllerControlHandle {
4207                                inner: this.inner.clone(),
4208                            },
4209                            method_type: fidl::MethodType::TwoWay,
4210                        })
4211                    }
4212                    _ => Err(fidl::Error::UnknownOrdinal {
4213                        ordinal: header.ordinal,
4214                        protocol_name:
4215                            <RunControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4216                    }),
4217                }))
4218            },
4219        )
4220    }
4221}
4222
4223/// The server end will disconnect after all the suite runs have finished and
4224/// the events are drained.
4225/// If the client disconnects, the tests will be terminated immediately and all
4226/// results discarded.
4227#[derive(Debug)]
4228pub enum RunControllerRequest {
4229    /// Stop the run gracefully. RunController will disconnect after all
4230    /// resources are released and all the events in this controller are drained.
4231    /// This method is used to allow the run to complete tests that are in progress,
4232    /// but will prevent starting new tests.
4233    Stop { control_handle: RunControllerControlHandle },
4234    /// Immediately terminate the run. RunController will disconnect after all
4235    /// resources are released. This method will terminate tests even if they
4236    /// are in progress.
4237    Kill { control_handle: RunControllerControlHandle },
4238    /// Iterator over events for the run. This method is a hanging get; it
4239    /// returns an empty vector only when there will be no further events
4240    /// (the run completed).
4241    GetEvents { responder: RunControllerGetEventsResponder },
4242    /// An interaction was received which does not match any known method.
4243    #[non_exhaustive]
4244    _UnknownMethod {
4245        /// Ordinal of the method that was called.
4246        ordinal: u64,
4247        control_handle: RunControllerControlHandle,
4248        method_type: fidl::MethodType,
4249    },
4250}
4251
4252impl RunControllerRequest {
4253    #[allow(irrefutable_let_patterns)]
4254    pub fn into_stop(self) -> Option<(RunControllerControlHandle)> {
4255        if let RunControllerRequest::Stop { control_handle } = self {
4256            Some((control_handle))
4257        } else {
4258            None
4259        }
4260    }
4261
4262    #[allow(irrefutable_let_patterns)]
4263    pub fn into_kill(self) -> Option<(RunControllerControlHandle)> {
4264        if let RunControllerRequest::Kill { control_handle } = self {
4265            Some((control_handle))
4266        } else {
4267            None
4268        }
4269    }
4270
4271    #[allow(irrefutable_let_patterns)]
4272    pub fn into_get_events(self) -> Option<(RunControllerGetEventsResponder)> {
4273        if let RunControllerRequest::GetEvents { responder } = self {
4274            Some((responder))
4275        } else {
4276            None
4277        }
4278    }
4279
4280    /// Name of the method defined in FIDL
4281    pub fn method_name(&self) -> &'static str {
4282        match *self {
4283            RunControllerRequest::Stop { .. } => "stop",
4284            RunControllerRequest::Kill { .. } => "kill",
4285            RunControllerRequest::GetEvents { .. } => "get_events",
4286            RunControllerRequest::_UnknownMethod {
4287                method_type: fidl::MethodType::OneWay, ..
4288            } => "unknown one-way method",
4289            RunControllerRequest::_UnknownMethod {
4290                method_type: fidl::MethodType::TwoWay, ..
4291            } => "unknown two-way method",
4292        }
4293    }
4294}
4295
4296#[derive(Debug, Clone)]
4297pub struct RunControllerControlHandle {
4298    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4299}
4300
4301impl fidl::endpoints::ControlHandle for RunControllerControlHandle {
4302    fn shutdown(&self) {
4303        self.inner.shutdown()
4304    }
4305
4306    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4307        self.inner.shutdown_with_epitaph(status)
4308    }
4309
4310    fn is_closed(&self) -> bool {
4311        self.inner.channel().is_closed()
4312    }
4313    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4314        self.inner.channel().on_closed()
4315    }
4316
4317    #[cfg(target_os = "fuchsia")]
4318    fn signal_peer(
4319        &self,
4320        clear_mask: zx::Signals,
4321        set_mask: zx::Signals,
4322    ) -> Result<(), zx_status::Status> {
4323        use fidl::Peered;
4324        self.inner.channel().signal_peer(clear_mask, set_mask)
4325    }
4326}
4327
4328impl RunControllerControlHandle {}
4329
4330#[must_use = "FIDL methods require a response to be sent"]
4331#[derive(Debug)]
4332pub struct RunControllerGetEventsResponder {
4333    control_handle: std::mem::ManuallyDrop<RunControllerControlHandle>,
4334    tx_id: u32,
4335}
4336
4337/// Set the the channel to be shutdown (see [`RunControllerControlHandle::shutdown`])
4338/// if the responder is dropped without sending a response, so that the client
4339/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4340impl std::ops::Drop for RunControllerGetEventsResponder {
4341    fn drop(&mut self) {
4342        self.control_handle.shutdown();
4343        // Safety: drops once, never accessed again
4344        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4345    }
4346}
4347
4348impl fidl::endpoints::Responder for RunControllerGetEventsResponder {
4349    type ControlHandle = RunControllerControlHandle;
4350
4351    fn control_handle(&self) -> &RunControllerControlHandle {
4352        &self.control_handle
4353    }
4354
4355    fn drop_without_shutdown(mut self) {
4356        // Safety: drops once, never accessed again due to mem::forget
4357        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4358        // Prevent Drop from running (which would shut down the channel)
4359        std::mem::forget(self);
4360    }
4361}
4362
4363impl RunControllerGetEventsResponder {
4364    /// Sends a response to the FIDL transaction.
4365    ///
4366    /// Sets the channel to shutdown if an error occurs.
4367    pub fn send(self, mut events: Vec<RunEvent>) -> Result<(), fidl::Error> {
4368        let _result = self.send_raw(events);
4369        if _result.is_err() {
4370            self.control_handle.shutdown();
4371        }
4372        self.drop_without_shutdown();
4373        _result
4374    }
4375
4376    /// Similar to "send" but does not shutdown the channel if an error occurs.
4377    pub fn send_no_shutdown_on_err(self, mut events: Vec<RunEvent>) -> Result<(), fidl::Error> {
4378        let _result = self.send_raw(events);
4379        self.drop_without_shutdown();
4380        _result
4381    }
4382
4383    fn send_raw(&self, mut events: Vec<RunEvent>) -> Result<(), fidl::Error> {
4384        self.control_handle.inner.send::<RunControllerGetEventsResponse>(
4385            (events.as_mut(),),
4386            self.tx_id,
4387            0x273bbd98cfcea4ba,
4388            fidl::encoding::DynamicFlags::empty(),
4389        )
4390    }
4391}
4392
4393#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4394pub struct SuiteControllerMarker;
4395
4396impl fidl::endpoints::ProtocolMarker for SuiteControllerMarker {
4397    type Proxy = SuiteControllerProxy;
4398    type RequestStream = SuiteControllerRequestStream;
4399    #[cfg(target_os = "fuchsia")]
4400    type SynchronousProxy = SuiteControllerSynchronousProxy;
4401
4402    const DEBUG_NAME: &'static str = "(anonymous) SuiteController";
4403}
4404pub type SuiteControllerWatchEventsResult = Result<Vec<Event>, LaunchError>;
4405pub type SuiteControllerGetEventsResult = Result<Vec<SuiteEvent>, LaunchError>;
4406
4407pub trait SuiteControllerProxyInterface: Send + Sync {
4408    fn r#stop(&self) -> Result<(), fidl::Error>;
4409    fn r#kill(&self) -> Result<(), fidl::Error>;
4410    type WatchEventsResponseFut: std::future::Future<Output = Result<SuiteControllerWatchEventsResult, fidl::Error>>
4411        + Send;
4412    fn r#watch_events(&self) -> Self::WatchEventsResponseFut;
4413    type GetEventsResponseFut: std::future::Future<Output = Result<SuiteControllerGetEventsResult, fidl::Error>>
4414        + Send;
4415    fn r#get_events(&self) -> Self::GetEventsResponseFut;
4416}
4417#[derive(Debug)]
4418#[cfg(target_os = "fuchsia")]
4419pub struct SuiteControllerSynchronousProxy {
4420    client: fidl::client::sync::Client,
4421}
4422
4423#[cfg(target_os = "fuchsia")]
4424impl fidl::endpoints::SynchronousProxy for SuiteControllerSynchronousProxy {
4425    type Proxy = SuiteControllerProxy;
4426    type Protocol = SuiteControllerMarker;
4427
4428    fn from_channel(inner: fidl::Channel) -> Self {
4429        Self::new(inner)
4430    }
4431
4432    fn into_channel(self) -> fidl::Channel {
4433        self.client.into_channel()
4434    }
4435
4436    fn as_channel(&self) -> &fidl::Channel {
4437        self.client.as_channel()
4438    }
4439}
4440
4441#[cfg(target_os = "fuchsia")]
4442impl SuiteControllerSynchronousProxy {
4443    pub fn new(channel: fidl::Channel) -> Self {
4444        Self { client: fidl::client::sync::Client::new(channel) }
4445    }
4446
4447    pub fn into_channel(self) -> fidl::Channel {
4448        self.client.into_channel()
4449    }
4450
4451    /// Waits until an event arrives and returns it. It is safe for other
4452    /// threads to make concurrent requests while waiting for an event.
4453    pub fn wait_for_event(
4454        &self,
4455        deadline: zx::MonotonicInstant,
4456    ) -> Result<SuiteControllerEvent, fidl::Error> {
4457        SuiteControllerEvent::decode(self.client.wait_for_event::<SuiteControllerMarker>(deadline)?)
4458    }
4459
4460    /// Stop the suite run gracefully. SuiteController will disconnect after
4461    /// all resources are released and all the events in this controller are drained.
4462    pub fn r#stop(&self) -> Result<(), fidl::Error> {
4463        self.client.send::<fidl::encoding::EmptyPayload>(
4464            (),
4465            0x4675fc6c8f404fef,
4466            fidl::encoding::DynamicFlags::FLEXIBLE,
4467        )
4468    }
4469
4470    /// Immediately terminate the run. SuiteController will disconnect after
4471    /// all resources are released. This method will terminate tests even if
4472    /// they are in progress.
4473    pub fn r#kill(&self) -> Result<(), fidl::Error> {
4474        self.client.send::<fidl::encoding::EmptyPayload>(
4475            (),
4476            0x5f813fb72887fc17,
4477            fidl::encoding::DynamicFlags::FLEXIBLE,
4478        )
4479    }
4480
4481    /// Returns events when they're available using a hanging get pattern. Returns an empty
4482    /// vector to indicate there will be no further events.
4483    pub fn r#watch_events(
4484        &self,
4485        ___deadline: zx::MonotonicInstant,
4486    ) -> Result<SuiteControllerWatchEventsResult, fidl::Error> {
4487        let _response =
4488            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
4489                SuiteControllerWatchEventsResponse,
4490                LaunchError,
4491            >, SuiteControllerMarker>(
4492                (),
4493                0x5d1a75b1d06839b4,
4494                fidl::encoding::DynamicFlags::empty(),
4495                ___deadline,
4496            )?;
4497        Ok(_response.map(|x| x.events))
4498    }
4499
4500    /// Iterator over events for the run. This method is a hanging get; it
4501    /// returns an empty vector only when there will be no further events
4502    /// (the run completed).
4503    pub fn r#get_events(
4504        &self,
4505        ___deadline: zx::MonotonicInstant,
4506    ) -> Result<SuiteControllerGetEventsResult, fidl::Error> {
4507        let _response = self.client.send_query::<
4508            fidl::encoding::EmptyPayload,
4509            fidl::encoding::FlexibleResultType<SuiteControllerGetEventsResponse, LaunchError>,
4510            SuiteControllerMarker,
4511        >(
4512            (),
4513            0x1f2ec93d2236d1db,
4514            fidl::encoding::DynamicFlags::FLEXIBLE,
4515            ___deadline,
4516        )?
4517        .into_result::<SuiteControllerMarker>("get_events")?;
4518        Ok(_response.map(|x| x.events))
4519    }
4520}
4521
4522#[cfg(target_os = "fuchsia")]
4523impl From<SuiteControllerSynchronousProxy> for zx::NullableHandle {
4524    fn from(value: SuiteControllerSynchronousProxy) -> Self {
4525        value.into_channel().into()
4526    }
4527}
4528
4529#[cfg(target_os = "fuchsia")]
4530impl From<fidl::Channel> for SuiteControllerSynchronousProxy {
4531    fn from(value: fidl::Channel) -> Self {
4532        Self::new(value)
4533    }
4534}
4535
4536#[cfg(target_os = "fuchsia")]
4537impl fidl::endpoints::FromClient for SuiteControllerSynchronousProxy {
4538    type Protocol = SuiteControllerMarker;
4539
4540    fn from_client(value: fidl::endpoints::ClientEnd<SuiteControllerMarker>) -> Self {
4541        Self::new(value.into_channel())
4542    }
4543}
4544
4545#[derive(Debug, Clone)]
4546pub struct SuiteControllerProxy {
4547    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4548}
4549
4550impl fidl::endpoints::Proxy for SuiteControllerProxy {
4551    type Protocol = SuiteControllerMarker;
4552
4553    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4554        Self::new(inner)
4555    }
4556
4557    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4558        self.client.into_channel().map_err(|client| Self { client })
4559    }
4560
4561    fn as_channel(&self) -> &::fidl::AsyncChannel {
4562        self.client.as_channel()
4563    }
4564}
4565
4566impl SuiteControllerProxy {
4567    /// Create a new Proxy for fuchsia.test.manager/SuiteController.
4568    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4569        let protocol_name = <SuiteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4570        Self { client: fidl::client::Client::new(channel, protocol_name) }
4571    }
4572
4573    /// Get a Stream of events from the remote end of the protocol.
4574    ///
4575    /// # Panics
4576    ///
4577    /// Panics if the event stream was already taken.
4578    pub fn take_event_stream(&self) -> SuiteControllerEventStream {
4579        SuiteControllerEventStream { event_receiver: self.client.take_event_receiver() }
4580    }
4581
4582    /// Stop the suite run gracefully. SuiteController will disconnect after
4583    /// all resources are released and all the events in this controller are drained.
4584    pub fn r#stop(&self) -> Result<(), fidl::Error> {
4585        SuiteControllerProxyInterface::r#stop(self)
4586    }
4587
4588    /// Immediately terminate the run. SuiteController will disconnect after
4589    /// all resources are released. This method will terminate tests even if
4590    /// they are in progress.
4591    pub fn r#kill(&self) -> Result<(), fidl::Error> {
4592        SuiteControllerProxyInterface::r#kill(self)
4593    }
4594
4595    /// Returns events when they're available using a hanging get pattern. Returns an empty
4596    /// vector to indicate there will be no further events.
4597    pub fn r#watch_events(
4598        &self,
4599    ) -> fidl::client::QueryResponseFut<
4600        SuiteControllerWatchEventsResult,
4601        fidl::encoding::DefaultFuchsiaResourceDialect,
4602    > {
4603        SuiteControllerProxyInterface::r#watch_events(self)
4604    }
4605
4606    /// Iterator over events for the run. This method is a hanging get; it
4607    /// returns an empty vector only when there will be no further events
4608    /// (the run completed).
4609    pub fn r#get_events(
4610        &self,
4611    ) -> fidl::client::QueryResponseFut<
4612        SuiteControllerGetEventsResult,
4613        fidl::encoding::DefaultFuchsiaResourceDialect,
4614    > {
4615        SuiteControllerProxyInterface::r#get_events(self)
4616    }
4617}
4618
4619impl SuiteControllerProxyInterface for SuiteControllerProxy {
4620    fn r#stop(&self) -> Result<(), fidl::Error> {
4621        self.client.send::<fidl::encoding::EmptyPayload>(
4622            (),
4623            0x4675fc6c8f404fef,
4624            fidl::encoding::DynamicFlags::FLEXIBLE,
4625        )
4626    }
4627
4628    fn r#kill(&self) -> Result<(), fidl::Error> {
4629        self.client.send::<fidl::encoding::EmptyPayload>(
4630            (),
4631            0x5f813fb72887fc17,
4632            fidl::encoding::DynamicFlags::FLEXIBLE,
4633        )
4634    }
4635
4636    type WatchEventsResponseFut = fidl::client::QueryResponseFut<
4637        SuiteControllerWatchEventsResult,
4638        fidl::encoding::DefaultFuchsiaResourceDialect,
4639    >;
4640    fn r#watch_events(&self) -> Self::WatchEventsResponseFut {
4641        fn _decode(
4642            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4643        ) -> Result<SuiteControllerWatchEventsResult, fidl::Error> {
4644            let _response = fidl::client::decode_transaction_body::<
4645                fidl::encoding::ResultType<SuiteControllerWatchEventsResponse, LaunchError>,
4646                fidl::encoding::DefaultFuchsiaResourceDialect,
4647                0x5d1a75b1d06839b4,
4648            >(_buf?)?;
4649            Ok(_response.map(|x| x.events))
4650        }
4651        self.client.send_query_and_decode::<
4652            fidl::encoding::EmptyPayload,
4653            SuiteControllerWatchEventsResult,
4654        >(
4655            (),
4656            0x5d1a75b1d06839b4,
4657            fidl::encoding::DynamicFlags::empty(),
4658            _decode,
4659        )
4660    }
4661
4662    type GetEventsResponseFut = fidl::client::QueryResponseFut<
4663        SuiteControllerGetEventsResult,
4664        fidl::encoding::DefaultFuchsiaResourceDialect,
4665    >;
4666    fn r#get_events(&self) -> Self::GetEventsResponseFut {
4667        fn _decode(
4668            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4669        ) -> Result<SuiteControllerGetEventsResult, fidl::Error> {
4670            let _response = fidl::client::decode_transaction_body::<
4671                fidl::encoding::FlexibleResultType<SuiteControllerGetEventsResponse, LaunchError>,
4672                fidl::encoding::DefaultFuchsiaResourceDialect,
4673                0x1f2ec93d2236d1db,
4674            >(_buf?)?
4675            .into_result::<SuiteControllerMarker>("get_events")?;
4676            Ok(_response.map(|x| x.events))
4677        }
4678        self.client
4679            .send_query_and_decode::<fidl::encoding::EmptyPayload, SuiteControllerGetEventsResult>(
4680                (),
4681                0x1f2ec93d2236d1db,
4682                fidl::encoding::DynamicFlags::FLEXIBLE,
4683                _decode,
4684            )
4685    }
4686}
4687
4688pub struct SuiteControllerEventStream {
4689    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4690}
4691
4692impl std::marker::Unpin for SuiteControllerEventStream {}
4693
4694impl futures::stream::FusedStream for SuiteControllerEventStream {
4695    fn is_terminated(&self) -> bool {
4696        self.event_receiver.is_terminated()
4697    }
4698}
4699
4700impl futures::Stream for SuiteControllerEventStream {
4701    type Item = Result<SuiteControllerEvent, fidl::Error>;
4702
4703    fn poll_next(
4704        mut self: std::pin::Pin<&mut Self>,
4705        cx: &mut std::task::Context<'_>,
4706    ) -> std::task::Poll<Option<Self::Item>> {
4707        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4708            &mut self.event_receiver,
4709            cx
4710        )?) {
4711            Some(buf) => std::task::Poll::Ready(Some(SuiteControllerEvent::decode(buf))),
4712            None => std::task::Poll::Ready(None),
4713        }
4714    }
4715}
4716
4717#[derive(Debug)]
4718pub enum SuiteControllerEvent {
4719    #[non_exhaustive]
4720    _UnknownEvent {
4721        /// Ordinal of the event that was sent.
4722        ordinal: u64,
4723    },
4724}
4725
4726impl SuiteControllerEvent {
4727    /// Decodes a message buffer as a [`SuiteControllerEvent`].
4728    fn decode(
4729        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4730    ) -> Result<SuiteControllerEvent, fidl::Error> {
4731        let (bytes, _handles) = buf.split_mut();
4732        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4733        debug_assert_eq!(tx_header.tx_id, 0);
4734        match tx_header.ordinal {
4735            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4736                Ok(SuiteControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4737            }
4738            _ => Err(fidl::Error::UnknownOrdinal {
4739                ordinal: tx_header.ordinal,
4740                protocol_name:
4741                    <SuiteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4742            }),
4743        }
4744    }
4745}
4746
4747/// A Stream of incoming requests for fuchsia.test.manager/SuiteController.
4748pub struct SuiteControllerRequestStream {
4749    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4750    is_terminated: bool,
4751}
4752
4753impl std::marker::Unpin for SuiteControllerRequestStream {}
4754
4755impl futures::stream::FusedStream for SuiteControllerRequestStream {
4756    fn is_terminated(&self) -> bool {
4757        self.is_terminated
4758    }
4759}
4760
4761impl fidl::endpoints::RequestStream for SuiteControllerRequestStream {
4762    type Protocol = SuiteControllerMarker;
4763    type ControlHandle = SuiteControllerControlHandle;
4764
4765    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4766        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4767    }
4768
4769    fn control_handle(&self) -> Self::ControlHandle {
4770        SuiteControllerControlHandle { inner: self.inner.clone() }
4771    }
4772
4773    fn into_inner(
4774        self,
4775    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4776    {
4777        (self.inner, self.is_terminated)
4778    }
4779
4780    fn from_inner(
4781        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4782        is_terminated: bool,
4783    ) -> Self {
4784        Self { inner, is_terminated }
4785    }
4786}
4787
4788impl futures::Stream for SuiteControllerRequestStream {
4789    type Item = Result<SuiteControllerRequest, fidl::Error>;
4790
4791    fn poll_next(
4792        mut self: std::pin::Pin<&mut Self>,
4793        cx: &mut std::task::Context<'_>,
4794    ) -> std::task::Poll<Option<Self::Item>> {
4795        let this = &mut *self;
4796        if this.inner.check_shutdown(cx) {
4797            this.is_terminated = true;
4798            return std::task::Poll::Ready(None);
4799        }
4800        if this.is_terminated {
4801            panic!("polled SuiteControllerRequestStream after completion");
4802        }
4803        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4804            |bytes, handles| {
4805                match this.inner.channel().read_etc(cx, bytes, handles) {
4806                    std::task::Poll::Ready(Ok(())) => {}
4807                    std::task::Poll::Pending => return std::task::Poll::Pending,
4808                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4809                        this.is_terminated = true;
4810                        return std::task::Poll::Ready(None);
4811                    }
4812                    std::task::Poll::Ready(Err(e)) => {
4813                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4814                            e.into(),
4815                        ))));
4816                    }
4817                }
4818
4819                // A message has been received from the channel
4820                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4821
4822                std::task::Poll::Ready(Some(match header.ordinal {
4823                    0x4675fc6c8f404fef => {
4824                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4825                        let mut req = fidl::new_empty!(
4826                            fidl::encoding::EmptyPayload,
4827                            fidl::encoding::DefaultFuchsiaResourceDialect
4828                        );
4829                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4830                        let control_handle =
4831                            SuiteControllerControlHandle { inner: this.inner.clone() };
4832                        Ok(SuiteControllerRequest::Stop { control_handle })
4833                    }
4834                    0x5f813fb72887fc17 => {
4835                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4836                        let mut req = fidl::new_empty!(
4837                            fidl::encoding::EmptyPayload,
4838                            fidl::encoding::DefaultFuchsiaResourceDialect
4839                        );
4840                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4841                        let control_handle =
4842                            SuiteControllerControlHandle { inner: this.inner.clone() };
4843                        Ok(SuiteControllerRequest::Kill { control_handle })
4844                    }
4845                    0x5d1a75b1d06839b4 => {
4846                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4847                        let mut req = fidl::new_empty!(
4848                            fidl::encoding::EmptyPayload,
4849                            fidl::encoding::DefaultFuchsiaResourceDialect
4850                        );
4851                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4852                        let control_handle =
4853                            SuiteControllerControlHandle { inner: this.inner.clone() };
4854                        Ok(SuiteControllerRequest::WatchEvents {
4855                            responder: SuiteControllerWatchEventsResponder {
4856                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4857                                tx_id: header.tx_id,
4858                            },
4859                        })
4860                    }
4861                    0x1f2ec93d2236d1db => {
4862                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4863                        let mut req = fidl::new_empty!(
4864                            fidl::encoding::EmptyPayload,
4865                            fidl::encoding::DefaultFuchsiaResourceDialect
4866                        );
4867                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4868                        let control_handle =
4869                            SuiteControllerControlHandle { inner: this.inner.clone() };
4870                        Ok(SuiteControllerRequest::GetEvents {
4871                            responder: SuiteControllerGetEventsResponder {
4872                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4873                                tx_id: header.tx_id,
4874                            },
4875                        })
4876                    }
4877                    _ if header.tx_id == 0
4878                        && header
4879                            .dynamic_flags()
4880                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4881                    {
4882                        Ok(SuiteControllerRequest::_UnknownMethod {
4883                            ordinal: header.ordinal,
4884                            control_handle: SuiteControllerControlHandle {
4885                                inner: this.inner.clone(),
4886                            },
4887                            method_type: fidl::MethodType::OneWay,
4888                        })
4889                    }
4890                    _ if header
4891                        .dynamic_flags()
4892                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4893                    {
4894                        this.inner.send_framework_err(
4895                            fidl::encoding::FrameworkErr::UnknownMethod,
4896                            header.tx_id,
4897                            header.ordinal,
4898                            header.dynamic_flags(),
4899                            (bytes, handles),
4900                        )?;
4901                        Ok(SuiteControllerRequest::_UnknownMethod {
4902                            ordinal: header.ordinal,
4903                            control_handle: SuiteControllerControlHandle {
4904                                inner: this.inner.clone(),
4905                            },
4906                            method_type: fidl::MethodType::TwoWay,
4907                        })
4908                    }
4909                    _ => Err(fidl::Error::UnknownOrdinal {
4910                        ordinal: header.ordinal,
4911                        protocol_name:
4912                            <SuiteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4913                    }),
4914                }))
4915            },
4916        )
4917    }
4918}
4919
4920/// Provides for control and monitoring of a running test suite started with `SuiteRunner.RunSuite`.
4921///
4922/// The server closes its end of the channel after the suite run has finished and all events have
4923/// been delivered via `WatchEvents`. If the client disconnects, the suite is terminated immediately
4924/// and all results discarded.
4925#[derive(Debug)]
4926pub enum SuiteControllerRequest {
4927    /// Stop the suite run gracefully. SuiteController will disconnect after
4928    /// all resources are released and all the events in this controller are drained.
4929    Stop { control_handle: SuiteControllerControlHandle },
4930    /// Immediately terminate the run. SuiteController will disconnect after
4931    /// all resources are released. This method will terminate tests even if
4932    /// they are in progress.
4933    Kill { control_handle: SuiteControllerControlHandle },
4934    /// Returns events when they're available using a hanging get pattern. Returns an empty
4935    /// vector to indicate there will be no further events.
4936    WatchEvents { responder: SuiteControllerWatchEventsResponder },
4937    /// Iterator over events for the run. This method is a hanging get; it
4938    /// returns an empty vector only when there will be no further events
4939    /// (the run completed).
4940    GetEvents { responder: SuiteControllerGetEventsResponder },
4941    /// An interaction was received which does not match any known method.
4942    #[non_exhaustive]
4943    _UnknownMethod {
4944        /// Ordinal of the method that was called.
4945        ordinal: u64,
4946        control_handle: SuiteControllerControlHandle,
4947        method_type: fidl::MethodType,
4948    },
4949}
4950
4951impl SuiteControllerRequest {
4952    #[allow(irrefutable_let_patterns)]
4953    pub fn into_stop(self) -> Option<(SuiteControllerControlHandle)> {
4954        if let SuiteControllerRequest::Stop { control_handle } = self {
4955            Some((control_handle))
4956        } else {
4957            None
4958        }
4959    }
4960
4961    #[allow(irrefutable_let_patterns)]
4962    pub fn into_kill(self) -> Option<(SuiteControllerControlHandle)> {
4963        if let SuiteControllerRequest::Kill { control_handle } = self {
4964            Some((control_handle))
4965        } else {
4966            None
4967        }
4968    }
4969
4970    #[allow(irrefutable_let_patterns)]
4971    pub fn into_watch_events(self) -> Option<(SuiteControllerWatchEventsResponder)> {
4972        if let SuiteControllerRequest::WatchEvents { responder } = self {
4973            Some((responder))
4974        } else {
4975            None
4976        }
4977    }
4978
4979    #[allow(irrefutable_let_patterns)]
4980    pub fn into_get_events(self) -> Option<(SuiteControllerGetEventsResponder)> {
4981        if let SuiteControllerRequest::GetEvents { responder } = self {
4982            Some((responder))
4983        } else {
4984            None
4985        }
4986    }
4987
4988    /// Name of the method defined in FIDL
4989    pub fn method_name(&self) -> &'static str {
4990        match *self {
4991            SuiteControllerRequest::Stop { .. } => "stop",
4992            SuiteControllerRequest::Kill { .. } => "kill",
4993            SuiteControllerRequest::WatchEvents { .. } => "watch_events",
4994            SuiteControllerRequest::GetEvents { .. } => "get_events",
4995            SuiteControllerRequest::_UnknownMethod {
4996                method_type: fidl::MethodType::OneWay,
4997                ..
4998            } => "unknown one-way method",
4999            SuiteControllerRequest::_UnknownMethod {
5000                method_type: fidl::MethodType::TwoWay,
5001                ..
5002            } => "unknown two-way method",
5003        }
5004    }
5005}
5006
5007#[derive(Debug, Clone)]
5008pub struct SuiteControllerControlHandle {
5009    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5010}
5011
5012impl fidl::endpoints::ControlHandle for SuiteControllerControlHandle {
5013    fn shutdown(&self) {
5014        self.inner.shutdown()
5015    }
5016
5017    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5018        self.inner.shutdown_with_epitaph(status)
5019    }
5020
5021    fn is_closed(&self) -> bool {
5022        self.inner.channel().is_closed()
5023    }
5024    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5025        self.inner.channel().on_closed()
5026    }
5027
5028    #[cfg(target_os = "fuchsia")]
5029    fn signal_peer(
5030        &self,
5031        clear_mask: zx::Signals,
5032        set_mask: zx::Signals,
5033    ) -> Result<(), zx_status::Status> {
5034        use fidl::Peered;
5035        self.inner.channel().signal_peer(clear_mask, set_mask)
5036    }
5037}
5038
5039impl SuiteControllerControlHandle {}
5040
5041#[must_use = "FIDL methods require a response to be sent"]
5042#[derive(Debug)]
5043pub struct SuiteControllerWatchEventsResponder {
5044    control_handle: std::mem::ManuallyDrop<SuiteControllerControlHandle>,
5045    tx_id: u32,
5046}
5047
5048/// Set the the channel to be shutdown (see [`SuiteControllerControlHandle::shutdown`])
5049/// if the responder is dropped without sending a response, so that the client
5050/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5051impl std::ops::Drop for SuiteControllerWatchEventsResponder {
5052    fn drop(&mut self) {
5053        self.control_handle.shutdown();
5054        // Safety: drops once, never accessed again
5055        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5056    }
5057}
5058
5059impl fidl::endpoints::Responder for SuiteControllerWatchEventsResponder {
5060    type ControlHandle = SuiteControllerControlHandle;
5061
5062    fn control_handle(&self) -> &SuiteControllerControlHandle {
5063        &self.control_handle
5064    }
5065
5066    fn drop_without_shutdown(mut self) {
5067        // Safety: drops once, never accessed again due to mem::forget
5068        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5069        // Prevent Drop from running (which would shut down the channel)
5070        std::mem::forget(self);
5071    }
5072}
5073
5074impl SuiteControllerWatchEventsResponder {
5075    /// Sends a response to the FIDL transaction.
5076    ///
5077    /// Sets the channel to shutdown if an error occurs.
5078    pub fn send(self, mut result: Result<Vec<Event>, LaunchError>) -> Result<(), fidl::Error> {
5079        let _result = self.send_raw(result);
5080        if _result.is_err() {
5081            self.control_handle.shutdown();
5082        }
5083        self.drop_without_shutdown();
5084        _result
5085    }
5086
5087    /// Similar to "send" but does not shutdown the channel if an error occurs.
5088    pub fn send_no_shutdown_on_err(
5089        self,
5090        mut result: Result<Vec<Event>, LaunchError>,
5091    ) -> Result<(), fidl::Error> {
5092        let _result = self.send_raw(result);
5093        self.drop_without_shutdown();
5094        _result
5095    }
5096
5097    fn send_raw(&self, mut result: Result<Vec<Event>, LaunchError>) -> Result<(), fidl::Error> {
5098        self.control_handle.inner.send::<fidl::encoding::ResultType<
5099            SuiteControllerWatchEventsResponse,
5100            LaunchError,
5101        >>(
5102            result.as_mut().map_err(|e| *e).map(|events| (events.as_mut_slice(),)),
5103            self.tx_id,
5104            0x5d1a75b1d06839b4,
5105            fidl::encoding::DynamicFlags::empty(),
5106        )
5107    }
5108}
5109
5110#[must_use = "FIDL methods require a response to be sent"]
5111#[derive(Debug)]
5112pub struct SuiteControllerGetEventsResponder {
5113    control_handle: std::mem::ManuallyDrop<SuiteControllerControlHandle>,
5114    tx_id: u32,
5115}
5116
5117/// Set the the channel to be shutdown (see [`SuiteControllerControlHandle::shutdown`])
5118/// if the responder is dropped without sending a response, so that the client
5119/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5120impl std::ops::Drop for SuiteControllerGetEventsResponder {
5121    fn drop(&mut self) {
5122        self.control_handle.shutdown();
5123        // Safety: drops once, never accessed again
5124        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5125    }
5126}
5127
5128impl fidl::endpoints::Responder for SuiteControllerGetEventsResponder {
5129    type ControlHandle = SuiteControllerControlHandle;
5130
5131    fn control_handle(&self) -> &SuiteControllerControlHandle {
5132        &self.control_handle
5133    }
5134
5135    fn drop_without_shutdown(mut self) {
5136        // Safety: drops once, never accessed again due to mem::forget
5137        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5138        // Prevent Drop from running (which would shut down the channel)
5139        std::mem::forget(self);
5140    }
5141}
5142
5143impl SuiteControllerGetEventsResponder {
5144    /// Sends a response to the FIDL transaction.
5145    ///
5146    /// Sets the channel to shutdown if an error occurs.
5147    pub fn send(self, mut result: Result<Vec<SuiteEvent>, LaunchError>) -> Result<(), fidl::Error> {
5148        let _result = self.send_raw(result);
5149        if _result.is_err() {
5150            self.control_handle.shutdown();
5151        }
5152        self.drop_without_shutdown();
5153        _result
5154    }
5155
5156    /// Similar to "send" but does not shutdown the channel if an error occurs.
5157    pub fn send_no_shutdown_on_err(
5158        self,
5159        mut result: Result<Vec<SuiteEvent>, LaunchError>,
5160    ) -> Result<(), fidl::Error> {
5161        let _result = self.send_raw(result);
5162        self.drop_without_shutdown();
5163        _result
5164    }
5165
5166    fn send_raw(
5167        &self,
5168        mut result: Result<Vec<SuiteEvent>, LaunchError>,
5169    ) -> Result<(), fidl::Error> {
5170        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5171            SuiteControllerGetEventsResponse,
5172            LaunchError,
5173        >>(
5174            fidl::encoding::FlexibleResult::new(
5175                result.as_mut().map_err(|e| *e).map(|events| (events.as_mut_slice(),)),
5176            ),
5177            self.tx_id,
5178            0x1f2ec93d2236d1db,
5179            fidl::encoding::DynamicFlags::FLEXIBLE,
5180        )
5181    }
5182}
5183
5184#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5185pub struct SuiteRunnerMarker;
5186
5187impl fidl::endpoints::ProtocolMarker for SuiteRunnerMarker {
5188    type Proxy = SuiteRunnerProxy;
5189    type RequestStream = SuiteRunnerRequestStream;
5190    #[cfg(target_os = "fuchsia")]
5191    type SynchronousProxy = SuiteRunnerSynchronousProxy;
5192
5193    const DEBUG_NAME: &'static str = "fuchsia.test.manager.SuiteRunner";
5194}
5195impl fidl::endpoints::DiscoverableProtocolMarker for SuiteRunnerMarker {}
5196
5197pub trait SuiteRunnerProxyInterface: Send + Sync {
5198    fn r#run(
5199        &self,
5200        test_suite_url: &str,
5201        options: RunSuiteOptions,
5202        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5203    ) -> Result<(), fidl::Error>;
5204}
5205#[derive(Debug)]
5206#[cfg(target_os = "fuchsia")]
5207pub struct SuiteRunnerSynchronousProxy {
5208    client: fidl::client::sync::Client,
5209}
5210
5211#[cfg(target_os = "fuchsia")]
5212impl fidl::endpoints::SynchronousProxy for SuiteRunnerSynchronousProxy {
5213    type Proxy = SuiteRunnerProxy;
5214    type Protocol = SuiteRunnerMarker;
5215
5216    fn from_channel(inner: fidl::Channel) -> Self {
5217        Self::new(inner)
5218    }
5219
5220    fn into_channel(self) -> fidl::Channel {
5221        self.client.into_channel()
5222    }
5223
5224    fn as_channel(&self) -> &fidl::Channel {
5225        self.client.as_channel()
5226    }
5227}
5228
5229#[cfg(target_os = "fuchsia")]
5230impl SuiteRunnerSynchronousProxy {
5231    pub fn new(channel: fidl::Channel) -> Self {
5232        Self { client: fidl::client::sync::Client::new(channel) }
5233    }
5234
5235    pub fn into_channel(self) -> fidl::Channel {
5236        self.client.into_channel()
5237    }
5238
5239    /// Waits until an event arrives and returns it. It is safe for other
5240    /// threads to make concurrent requests while waiting for an event.
5241    pub fn wait_for_event(
5242        &self,
5243        deadline: zx::MonotonicInstant,
5244    ) -> Result<SuiteRunnerEvent, fidl::Error> {
5245        SuiteRunnerEvent::decode(self.client.wait_for_event::<SuiteRunnerMarker>(deadline)?)
5246    }
5247
5248    /// Run a test suite. A suite is a test component that implements `fuchsia.test.Suite`.
5249    pub fn r#run(
5250        &self,
5251        mut test_suite_url: &str,
5252        mut options: RunSuiteOptions,
5253        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5254    ) -> Result<(), fidl::Error> {
5255        self.client.send::<SuiteRunnerRunRequest>(
5256            (test_suite_url, &mut options, controller),
5257            0x16f5ec6a46c223f0,
5258            fidl::encoding::DynamicFlags::FLEXIBLE,
5259        )
5260    }
5261}
5262
5263#[cfg(target_os = "fuchsia")]
5264impl From<SuiteRunnerSynchronousProxy> for zx::NullableHandle {
5265    fn from(value: SuiteRunnerSynchronousProxy) -> Self {
5266        value.into_channel().into()
5267    }
5268}
5269
5270#[cfg(target_os = "fuchsia")]
5271impl From<fidl::Channel> for SuiteRunnerSynchronousProxy {
5272    fn from(value: fidl::Channel) -> Self {
5273        Self::new(value)
5274    }
5275}
5276
5277#[cfg(target_os = "fuchsia")]
5278impl fidl::endpoints::FromClient for SuiteRunnerSynchronousProxy {
5279    type Protocol = SuiteRunnerMarker;
5280
5281    fn from_client(value: fidl::endpoints::ClientEnd<SuiteRunnerMarker>) -> Self {
5282        Self::new(value.into_channel())
5283    }
5284}
5285
5286#[derive(Debug, Clone)]
5287pub struct SuiteRunnerProxy {
5288    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5289}
5290
5291impl fidl::endpoints::Proxy for SuiteRunnerProxy {
5292    type Protocol = SuiteRunnerMarker;
5293
5294    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5295        Self::new(inner)
5296    }
5297
5298    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5299        self.client.into_channel().map_err(|client| Self { client })
5300    }
5301
5302    fn as_channel(&self) -> &::fidl::AsyncChannel {
5303        self.client.as_channel()
5304    }
5305}
5306
5307impl SuiteRunnerProxy {
5308    /// Create a new Proxy for fuchsia.test.manager/SuiteRunner.
5309    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5310        let protocol_name = <SuiteRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5311        Self { client: fidl::client::Client::new(channel, protocol_name) }
5312    }
5313
5314    /// Get a Stream of events from the remote end of the protocol.
5315    ///
5316    /// # Panics
5317    ///
5318    /// Panics if the event stream was already taken.
5319    pub fn take_event_stream(&self) -> SuiteRunnerEventStream {
5320        SuiteRunnerEventStream { event_receiver: self.client.take_event_receiver() }
5321    }
5322
5323    /// Run a test suite. A suite is a test component that implements `fuchsia.test.Suite`.
5324    pub fn r#run(
5325        &self,
5326        mut test_suite_url: &str,
5327        mut options: RunSuiteOptions,
5328        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5329    ) -> Result<(), fidl::Error> {
5330        SuiteRunnerProxyInterface::r#run(self, test_suite_url, options, controller)
5331    }
5332}
5333
5334impl SuiteRunnerProxyInterface for SuiteRunnerProxy {
5335    fn r#run(
5336        &self,
5337        mut test_suite_url: &str,
5338        mut options: RunSuiteOptions,
5339        mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5340    ) -> Result<(), fidl::Error> {
5341        self.client.send::<SuiteRunnerRunRequest>(
5342            (test_suite_url, &mut options, controller),
5343            0x16f5ec6a46c223f0,
5344            fidl::encoding::DynamicFlags::FLEXIBLE,
5345        )
5346    }
5347}
5348
5349pub struct SuiteRunnerEventStream {
5350    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5351}
5352
5353impl std::marker::Unpin for SuiteRunnerEventStream {}
5354
5355impl futures::stream::FusedStream for SuiteRunnerEventStream {
5356    fn is_terminated(&self) -> bool {
5357        self.event_receiver.is_terminated()
5358    }
5359}
5360
5361impl futures::Stream for SuiteRunnerEventStream {
5362    type Item = Result<SuiteRunnerEvent, fidl::Error>;
5363
5364    fn poll_next(
5365        mut self: std::pin::Pin<&mut Self>,
5366        cx: &mut std::task::Context<'_>,
5367    ) -> std::task::Poll<Option<Self::Item>> {
5368        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5369            &mut self.event_receiver,
5370            cx
5371        )?) {
5372            Some(buf) => std::task::Poll::Ready(Some(SuiteRunnerEvent::decode(buf))),
5373            None => std::task::Poll::Ready(None),
5374        }
5375    }
5376}
5377
5378#[derive(Debug)]
5379pub enum SuiteRunnerEvent {
5380    #[non_exhaustive]
5381    _UnknownEvent {
5382        /// Ordinal of the event that was sent.
5383        ordinal: u64,
5384    },
5385}
5386
5387impl SuiteRunnerEvent {
5388    /// Decodes a message buffer as a [`SuiteRunnerEvent`].
5389    fn decode(
5390        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5391    ) -> Result<SuiteRunnerEvent, fidl::Error> {
5392        let (bytes, _handles) = buf.split_mut();
5393        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5394        debug_assert_eq!(tx_header.tx_id, 0);
5395        match tx_header.ordinal {
5396            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5397                Ok(SuiteRunnerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5398            }
5399            _ => Err(fidl::Error::UnknownOrdinal {
5400                ordinal: tx_header.ordinal,
5401                protocol_name: <SuiteRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5402            }),
5403        }
5404    }
5405}
5406
5407/// A Stream of incoming requests for fuchsia.test.manager/SuiteRunner.
5408pub struct SuiteRunnerRequestStream {
5409    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5410    is_terminated: bool,
5411}
5412
5413impl std::marker::Unpin for SuiteRunnerRequestStream {}
5414
5415impl futures::stream::FusedStream for SuiteRunnerRequestStream {
5416    fn is_terminated(&self) -> bool {
5417        self.is_terminated
5418    }
5419}
5420
5421impl fidl::endpoints::RequestStream for SuiteRunnerRequestStream {
5422    type Protocol = SuiteRunnerMarker;
5423    type ControlHandle = SuiteRunnerControlHandle;
5424
5425    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5426        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5427    }
5428
5429    fn control_handle(&self) -> Self::ControlHandle {
5430        SuiteRunnerControlHandle { inner: self.inner.clone() }
5431    }
5432
5433    fn into_inner(
5434        self,
5435    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5436    {
5437        (self.inner, self.is_terminated)
5438    }
5439
5440    fn from_inner(
5441        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5442        is_terminated: bool,
5443    ) -> Self {
5444        Self { inner, is_terminated }
5445    }
5446}
5447
5448impl futures::Stream for SuiteRunnerRequestStream {
5449    type Item = Result<SuiteRunnerRequest, fidl::Error>;
5450
5451    fn poll_next(
5452        mut self: std::pin::Pin<&mut Self>,
5453        cx: &mut std::task::Context<'_>,
5454    ) -> std::task::Poll<Option<Self::Item>> {
5455        let this = &mut *self;
5456        if this.inner.check_shutdown(cx) {
5457            this.is_terminated = true;
5458            return std::task::Poll::Ready(None);
5459        }
5460        if this.is_terminated {
5461            panic!("polled SuiteRunnerRequestStream after completion");
5462        }
5463        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5464            |bytes, handles| {
5465                match this.inner.channel().read_etc(cx, bytes, handles) {
5466                    std::task::Poll::Ready(Ok(())) => {}
5467                    std::task::Poll::Pending => return std::task::Poll::Pending,
5468                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5469                        this.is_terminated = true;
5470                        return std::task::Poll::Ready(None);
5471                    }
5472                    std::task::Poll::Ready(Err(e)) => {
5473                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5474                            e.into(),
5475                        ))));
5476                    }
5477                }
5478
5479                // A message has been received from the channel
5480                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5481
5482                std::task::Poll::Ready(Some(match header.ordinal {
5483                    0x16f5ec6a46c223f0 => {
5484                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5485                        let mut req = fidl::new_empty!(
5486                            SuiteRunnerRunRequest,
5487                            fidl::encoding::DefaultFuchsiaResourceDialect
5488                        );
5489                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SuiteRunnerRunRequest>(&header, _body_bytes, handles, &mut req)?;
5490                        let control_handle = SuiteRunnerControlHandle { inner: this.inner.clone() };
5491                        Ok(SuiteRunnerRequest::Run {
5492                            test_suite_url: req.test_suite_url,
5493                            options: req.options,
5494                            controller: req.controller,
5495
5496                            control_handle,
5497                        })
5498                    }
5499                    _ if header.tx_id == 0
5500                        && header
5501                            .dynamic_flags()
5502                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5503                    {
5504                        Ok(SuiteRunnerRequest::_UnknownMethod {
5505                            ordinal: header.ordinal,
5506                            control_handle: SuiteRunnerControlHandle { inner: this.inner.clone() },
5507                            method_type: fidl::MethodType::OneWay,
5508                        })
5509                    }
5510                    _ if header
5511                        .dynamic_flags()
5512                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5513                    {
5514                        this.inner.send_framework_err(
5515                            fidl::encoding::FrameworkErr::UnknownMethod,
5516                            header.tx_id,
5517                            header.ordinal,
5518                            header.dynamic_flags(),
5519                            (bytes, handles),
5520                        )?;
5521                        Ok(SuiteRunnerRequest::_UnknownMethod {
5522                            ordinal: header.ordinal,
5523                            control_handle: SuiteRunnerControlHandle { inner: this.inner.clone() },
5524                            method_type: fidl::MethodType::TwoWay,
5525                        })
5526                    }
5527                    _ => Err(fidl::Error::UnknownOrdinal {
5528                        ordinal: header.ordinal,
5529                        protocol_name:
5530                            <SuiteRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5531                    }),
5532                }))
5533            },
5534        )
5535    }
5536}
5537
5538/// Runs test suites.
5539#[derive(Debug)]
5540pub enum SuiteRunnerRequest {
5541    /// Run a test suite. A suite is a test component that implements `fuchsia.test.Suite`.
5542    Run {
5543        test_suite_url: String,
5544        options: RunSuiteOptions,
5545        controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5546        control_handle: SuiteRunnerControlHandle,
5547    },
5548    /// An interaction was received which does not match any known method.
5549    #[non_exhaustive]
5550    _UnknownMethod {
5551        /// Ordinal of the method that was called.
5552        ordinal: u64,
5553        control_handle: SuiteRunnerControlHandle,
5554        method_type: fidl::MethodType,
5555    },
5556}
5557
5558impl SuiteRunnerRequest {
5559    #[allow(irrefutable_let_patterns)]
5560    pub fn into_run(
5561        self,
5562    ) -> Option<(
5563        String,
5564        RunSuiteOptions,
5565        fidl::endpoints::ServerEnd<SuiteControllerMarker>,
5566        SuiteRunnerControlHandle,
5567    )> {
5568        if let SuiteRunnerRequest::Run { test_suite_url, options, controller, control_handle } =
5569            self
5570        {
5571            Some((test_suite_url, options, controller, control_handle))
5572        } else {
5573            None
5574        }
5575    }
5576
5577    /// Name of the method defined in FIDL
5578    pub fn method_name(&self) -> &'static str {
5579        match *self {
5580            SuiteRunnerRequest::Run { .. } => "run",
5581            SuiteRunnerRequest::_UnknownMethod {
5582                method_type: fidl::MethodType::OneWay, ..
5583            } => "unknown one-way method",
5584            SuiteRunnerRequest::_UnknownMethod {
5585                method_type: fidl::MethodType::TwoWay, ..
5586            } => "unknown two-way method",
5587        }
5588    }
5589}
5590
5591#[derive(Debug, Clone)]
5592pub struct SuiteRunnerControlHandle {
5593    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5594}
5595
5596impl fidl::endpoints::ControlHandle for SuiteRunnerControlHandle {
5597    fn shutdown(&self) {
5598        self.inner.shutdown()
5599    }
5600
5601    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5602        self.inner.shutdown_with_epitaph(status)
5603    }
5604
5605    fn is_closed(&self) -> bool {
5606        self.inner.channel().is_closed()
5607    }
5608    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5609        self.inner.channel().on_closed()
5610    }
5611
5612    #[cfg(target_os = "fuchsia")]
5613    fn signal_peer(
5614        &self,
5615        clear_mask: zx::Signals,
5616        set_mask: zx::Signals,
5617    ) -> Result<(), zx_status::Status> {
5618        use fidl::Peered;
5619        self.inner.channel().signal_peer(clear_mask, set_mask)
5620    }
5621}
5622
5623impl SuiteRunnerControlHandle {}
5624
5625#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5626pub struct TestCaseEnumeratorMarker;
5627
5628impl fidl::endpoints::ProtocolMarker for TestCaseEnumeratorMarker {
5629    type Proxy = TestCaseEnumeratorProxy;
5630    type RequestStream = TestCaseEnumeratorRequestStream;
5631    #[cfg(target_os = "fuchsia")]
5632    type SynchronousProxy = TestCaseEnumeratorSynchronousProxy;
5633
5634    const DEBUG_NAME: &'static str = "fuchsia.test.manager.TestCaseEnumerator";
5635}
5636impl fidl::endpoints::DiscoverableProtocolMarker for TestCaseEnumeratorMarker {}
5637pub type TestCaseEnumeratorEnumerateResult = Result<(), LaunchError>;
5638
5639pub trait TestCaseEnumeratorProxyInterface: Send + Sync {
5640    type EnumerateResponseFut: std::future::Future<Output = Result<TestCaseEnumeratorEnumerateResult, fidl::Error>>
5641        + Send;
5642    fn r#enumerate(
5643        &self,
5644        test_suite_url: &str,
5645        options: EnumerateTestCasesOptions,
5646        iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
5647    ) -> Self::EnumerateResponseFut;
5648}
5649#[derive(Debug)]
5650#[cfg(target_os = "fuchsia")]
5651pub struct TestCaseEnumeratorSynchronousProxy {
5652    client: fidl::client::sync::Client,
5653}
5654
5655#[cfg(target_os = "fuchsia")]
5656impl fidl::endpoints::SynchronousProxy for TestCaseEnumeratorSynchronousProxy {
5657    type Proxy = TestCaseEnumeratorProxy;
5658    type Protocol = TestCaseEnumeratorMarker;
5659
5660    fn from_channel(inner: fidl::Channel) -> Self {
5661        Self::new(inner)
5662    }
5663
5664    fn into_channel(self) -> fidl::Channel {
5665        self.client.into_channel()
5666    }
5667
5668    fn as_channel(&self) -> &fidl::Channel {
5669        self.client.as_channel()
5670    }
5671}
5672
5673#[cfg(target_os = "fuchsia")]
5674impl TestCaseEnumeratorSynchronousProxy {
5675    pub fn new(channel: fidl::Channel) -> Self {
5676        Self { client: fidl::client::sync::Client::new(channel) }
5677    }
5678
5679    pub fn into_channel(self) -> fidl::Channel {
5680        self.client.into_channel()
5681    }
5682
5683    /// Waits until an event arrives and returns it. It is safe for other
5684    /// threads to make concurrent requests while waiting for an event.
5685    pub fn wait_for_event(
5686        &self,
5687        deadline: zx::MonotonicInstant,
5688    ) -> Result<TestCaseEnumeratorEvent, fidl::Error> {
5689        TestCaseEnumeratorEvent::decode(
5690            self.client.wait_for_event::<TestCaseEnumeratorMarker>(deadline)?,
5691        )
5692    }
5693
5694    /// Creates an iterator for test cases.
5695    pub fn r#enumerate(
5696        &self,
5697        mut test_suite_url: &str,
5698        mut options: EnumerateTestCasesOptions,
5699        mut iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
5700        ___deadline: zx::MonotonicInstant,
5701    ) -> Result<TestCaseEnumeratorEnumerateResult, fidl::Error> {
5702        let _response = self.client.send_query::<
5703            TestCaseEnumeratorEnumerateRequest,
5704            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, LaunchError>,
5705            TestCaseEnumeratorMarker,
5706        >(
5707            (test_suite_url, &mut options, iterator,),
5708            0x24f8a91d96134492,
5709            fidl::encoding::DynamicFlags::FLEXIBLE,
5710            ___deadline,
5711        )?
5712        .into_result::<TestCaseEnumeratorMarker>("enumerate")?;
5713        Ok(_response.map(|x| x))
5714    }
5715}
5716
5717#[cfg(target_os = "fuchsia")]
5718impl From<TestCaseEnumeratorSynchronousProxy> for zx::NullableHandle {
5719    fn from(value: TestCaseEnumeratorSynchronousProxy) -> Self {
5720        value.into_channel().into()
5721    }
5722}
5723
5724#[cfg(target_os = "fuchsia")]
5725impl From<fidl::Channel> for TestCaseEnumeratorSynchronousProxy {
5726    fn from(value: fidl::Channel) -> Self {
5727        Self::new(value)
5728    }
5729}
5730
5731#[cfg(target_os = "fuchsia")]
5732impl fidl::endpoints::FromClient for TestCaseEnumeratorSynchronousProxy {
5733    type Protocol = TestCaseEnumeratorMarker;
5734
5735    fn from_client(value: fidl::endpoints::ClientEnd<TestCaseEnumeratorMarker>) -> Self {
5736        Self::new(value.into_channel())
5737    }
5738}
5739
5740#[derive(Debug, Clone)]
5741pub struct TestCaseEnumeratorProxy {
5742    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5743}
5744
5745impl fidl::endpoints::Proxy for TestCaseEnumeratorProxy {
5746    type Protocol = TestCaseEnumeratorMarker;
5747
5748    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5749        Self::new(inner)
5750    }
5751
5752    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5753        self.client.into_channel().map_err(|client| Self { client })
5754    }
5755
5756    fn as_channel(&self) -> &::fidl::AsyncChannel {
5757        self.client.as_channel()
5758    }
5759}
5760
5761impl TestCaseEnumeratorProxy {
5762    /// Create a new Proxy for fuchsia.test.manager/TestCaseEnumerator.
5763    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5764        let protocol_name =
5765            <TestCaseEnumeratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5766        Self { client: fidl::client::Client::new(channel, protocol_name) }
5767    }
5768
5769    /// Get a Stream of events from the remote end of the protocol.
5770    ///
5771    /// # Panics
5772    ///
5773    /// Panics if the event stream was already taken.
5774    pub fn take_event_stream(&self) -> TestCaseEnumeratorEventStream {
5775        TestCaseEnumeratorEventStream { event_receiver: self.client.take_event_receiver() }
5776    }
5777
5778    /// Creates an iterator for test cases.
5779    pub fn r#enumerate(
5780        &self,
5781        mut test_suite_url: &str,
5782        mut options: EnumerateTestCasesOptions,
5783        mut iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
5784    ) -> fidl::client::QueryResponseFut<
5785        TestCaseEnumeratorEnumerateResult,
5786        fidl::encoding::DefaultFuchsiaResourceDialect,
5787    > {
5788        TestCaseEnumeratorProxyInterface::r#enumerate(self, test_suite_url, options, iterator)
5789    }
5790}
5791
5792impl TestCaseEnumeratorProxyInterface for TestCaseEnumeratorProxy {
5793    type EnumerateResponseFut = fidl::client::QueryResponseFut<
5794        TestCaseEnumeratorEnumerateResult,
5795        fidl::encoding::DefaultFuchsiaResourceDialect,
5796    >;
5797    fn r#enumerate(
5798        &self,
5799        mut test_suite_url: &str,
5800        mut options: EnumerateTestCasesOptions,
5801        mut iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
5802    ) -> Self::EnumerateResponseFut {
5803        fn _decode(
5804            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5805        ) -> Result<TestCaseEnumeratorEnumerateResult, fidl::Error> {
5806            let _response = fidl::client::decode_transaction_body::<
5807                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, LaunchError>,
5808                fidl::encoding::DefaultFuchsiaResourceDialect,
5809                0x24f8a91d96134492,
5810            >(_buf?)?
5811            .into_result::<TestCaseEnumeratorMarker>("enumerate")?;
5812            Ok(_response.map(|x| x))
5813        }
5814        self.client.send_query_and_decode::<
5815            TestCaseEnumeratorEnumerateRequest,
5816            TestCaseEnumeratorEnumerateResult,
5817        >(
5818            (test_suite_url, &mut options, iterator,),
5819            0x24f8a91d96134492,
5820            fidl::encoding::DynamicFlags::FLEXIBLE,
5821            _decode,
5822        )
5823    }
5824}
5825
5826pub struct TestCaseEnumeratorEventStream {
5827    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5828}
5829
5830impl std::marker::Unpin for TestCaseEnumeratorEventStream {}
5831
5832impl futures::stream::FusedStream for TestCaseEnumeratorEventStream {
5833    fn is_terminated(&self) -> bool {
5834        self.event_receiver.is_terminated()
5835    }
5836}
5837
5838impl futures::Stream for TestCaseEnumeratorEventStream {
5839    type Item = Result<TestCaseEnumeratorEvent, fidl::Error>;
5840
5841    fn poll_next(
5842        mut self: std::pin::Pin<&mut Self>,
5843        cx: &mut std::task::Context<'_>,
5844    ) -> std::task::Poll<Option<Self::Item>> {
5845        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5846            &mut self.event_receiver,
5847            cx
5848        )?) {
5849            Some(buf) => std::task::Poll::Ready(Some(TestCaseEnumeratorEvent::decode(buf))),
5850            None => std::task::Poll::Ready(None),
5851        }
5852    }
5853}
5854
5855#[derive(Debug)]
5856pub enum TestCaseEnumeratorEvent {
5857    #[non_exhaustive]
5858    _UnknownEvent {
5859        /// Ordinal of the event that was sent.
5860        ordinal: u64,
5861    },
5862}
5863
5864impl TestCaseEnumeratorEvent {
5865    /// Decodes a message buffer as a [`TestCaseEnumeratorEvent`].
5866    fn decode(
5867        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5868    ) -> Result<TestCaseEnumeratorEvent, fidl::Error> {
5869        let (bytes, _handles) = buf.split_mut();
5870        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5871        debug_assert_eq!(tx_header.tx_id, 0);
5872        match tx_header.ordinal {
5873            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5874                Ok(TestCaseEnumeratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5875            }
5876            _ => Err(fidl::Error::UnknownOrdinal {
5877                ordinal: tx_header.ordinal,
5878                protocol_name:
5879                    <TestCaseEnumeratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5880            }),
5881        }
5882    }
5883}
5884
5885/// A Stream of incoming requests for fuchsia.test.manager/TestCaseEnumerator.
5886pub struct TestCaseEnumeratorRequestStream {
5887    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5888    is_terminated: bool,
5889}
5890
5891impl std::marker::Unpin for TestCaseEnumeratorRequestStream {}
5892
5893impl futures::stream::FusedStream for TestCaseEnumeratorRequestStream {
5894    fn is_terminated(&self) -> bool {
5895        self.is_terminated
5896    }
5897}
5898
5899impl fidl::endpoints::RequestStream for TestCaseEnumeratorRequestStream {
5900    type Protocol = TestCaseEnumeratorMarker;
5901    type ControlHandle = TestCaseEnumeratorControlHandle;
5902
5903    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5904        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5905    }
5906
5907    fn control_handle(&self) -> Self::ControlHandle {
5908        TestCaseEnumeratorControlHandle { inner: self.inner.clone() }
5909    }
5910
5911    fn into_inner(
5912        self,
5913    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5914    {
5915        (self.inner, self.is_terminated)
5916    }
5917
5918    fn from_inner(
5919        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5920        is_terminated: bool,
5921    ) -> Self {
5922        Self { inner, is_terminated }
5923    }
5924}
5925
5926impl futures::Stream for TestCaseEnumeratorRequestStream {
5927    type Item = Result<TestCaseEnumeratorRequest, fidl::Error>;
5928
5929    fn poll_next(
5930        mut self: std::pin::Pin<&mut Self>,
5931        cx: &mut std::task::Context<'_>,
5932    ) -> std::task::Poll<Option<Self::Item>> {
5933        let this = &mut *self;
5934        if this.inner.check_shutdown(cx) {
5935            this.is_terminated = true;
5936            return std::task::Poll::Ready(None);
5937        }
5938        if this.is_terminated {
5939            panic!("polled TestCaseEnumeratorRequestStream after completion");
5940        }
5941        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5942            |bytes, handles| {
5943                match this.inner.channel().read_etc(cx, bytes, handles) {
5944                    std::task::Poll::Ready(Ok(())) => {}
5945                    std::task::Poll::Pending => return std::task::Poll::Pending,
5946                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5947                        this.is_terminated = true;
5948                        return std::task::Poll::Ready(None);
5949                    }
5950                    std::task::Poll::Ready(Err(e)) => {
5951                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5952                            e.into(),
5953                        ))));
5954                    }
5955                }
5956
5957                // A message has been received from the channel
5958                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5959
5960                std::task::Poll::Ready(Some(match header.ordinal {
5961                0x24f8a91d96134492 => {
5962                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5963                    let mut req = fidl::new_empty!(TestCaseEnumeratorEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
5964                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TestCaseEnumeratorEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
5965                    let control_handle = TestCaseEnumeratorControlHandle {
5966                        inner: this.inner.clone(),
5967                    };
5968                    Ok(TestCaseEnumeratorRequest::Enumerate {test_suite_url: req.test_suite_url,
5969options: req.options,
5970iterator: req.iterator,
5971
5972                        responder: TestCaseEnumeratorEnumerateResponder {
5973                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5974                            tx_id: header.tx_id,
5975                        },
5976                    })
5977                }
5978                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5979                    Ok(TestCaseEnumeratorRequest::_UnknownMethod {
5980                        ordinal: header.ordinal,
5981                        control_handle: TestCaseEnumeratorControlHandle { inner: this.inner.clone() },
5982                        method_type: fidl::MethodType::OneWay,
5983                    })
5984                }
5985                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5986                    this.inner.send_framework_err(
5987                        fidl::encoding::FrameworkErr::UnknownMethod,
5988                        header.tx_id,
5989                        header.ordinal,
5990                        header.dynamic_flags(),
5991                        (bytes, handles),
5992                    )?;
5993                    Ok(TestCaseEnumeratorRequest::_UnknownMethod {
5994                        ordinal: header.ordinal,
5995                        control_handle: TestCaseEnumeratorControlHandle { inner: this.inner.clone() },
5996                        method_type: fidl::MethodType::TwoWay,
5997                    })
5998                }
5999                _ => Err(fidl::Error::UnknownOrdinal {
6000                    ordinal: header.ordinal,
6001                    protocol_name: <TestCaseEnumeratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6002                }),
6003            }))
6004            },
6005        )
6006    }
6007}
6008
6009/// Enumerates cases in test suites, which implement the `fuchsia.test.Suite` protocol.
6010#[derive(Debug)]
6011pub enum TestCaseEnumeratorRequest {
6012    /// Creates an iterator for test cases.
6013    Enumerate {
6014        test_suite_url: String,
6015        options: EnumerateTestCasesOptions,
6016        iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
6017        responder: TestCaseEnumeratorEnumerateResponder,
6018    },
6019    /// An interaction was received which does not match any known method.
6020    #[non_exhaustive]
6021    _UnknownMethod {
6022        /// Ordinal of the method that was called.
6023        ordinal: u64,
6024        control_handle: TestCaseEnumeratorControlHandle,
6025        method_type: fidl::MethodType,
6026    },
6027}
6028
6029impl TestCaseEnumeratorRequest {
6030    #[allow(irrefutable_let_patterns)]
6031    pub fn into_enumerate(
6032        self,
6033    ) -> Option<(
6034        String,
6035        EnumerateTestCasesOptions,
6036        fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
6037        TestCaseEnumeratorEnumerateResponder,
6038    )> {
6039        if let TestCaseEnumeratorRequest::Enumerate {
6040            test_suite_url,
6041            options,
6042            iterator,
6043            responder,
6044        } = self
6045        {
6046            Some((test_suite_url, options, iterator, responder))
6047        } else {
6048            None
6049        }
6050    }
6051
6052    /// Name of the method defined in FIDL
6053    pub fn method_name(&self) -> &'static str {
6054        match *self {
6055            TestCaseEnumeratorRequest::Enumerate { .. } => "enumerate",
6056            TestCaseEnumeratorRequest::_UnknownMethod {
6057                method_type: fidl::MethodType::OneWay,
6058                ..
6059            } => "unknown one-way method",
6060            TestCaseEnumeratorRequest::_UnknownMethod {
6061                method_type: fidl::MethodType::TwoWay,
6062                ..
6063            } => "unknown two-way method",
6064        }
6065    }
6066}
6067
6068#[derive(Debug, Clone)]
6069pub struct TestCaseEnumeratorControlHandle {
6070    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6071}
6072
6073impl fidl::endpoints::ControlHandle for TestCaseEnumeratorControlHandle {
6074    fn shutdown(&self) {
6075        self.inner.shutdown()
6076    }
6077
6078    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6079        self.inner.shutdown_with_epitaph(status)
6080    }
6081
6082    fn is_closed(&self) -> bool {
6083        self.inner.channel().is_closed()
6084    }
6085    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6086        self.inner.channel().on_closed()
6087    }
6088
6089    #[cfg(target_os = "fuchsia")]
6090    fn signal_peer(
6091        &self,
6092        clear_mask: zx::Signals,
6093        set_mask: zx::Signals,
6094    ) -> Result<(), zx_status::Status> {
6095        use fidl::Peered;
6096        self.inner.channel().signal_peer(clear_mask, set_mask)
6097    }
6098}
6099
6100impl TestCaseEnumeratorControlHandle {}
6101
6102#[must_use = "FIDL methods require a response to be sent"]
6103#[derive(Debug)]
6104pub struct TestCaseEnumeratorEnumerateResponder {
6105    control_handle: std::mem::ManuallyDrop<TestCaseEnumeratorControlHandle>,
6106    tx_id: u32,
6107}
6108
6109/// Set the the channel to be shutdown (see [`TestCaseEnumeratorControlHandle::shutdown`])
6110/// if the responder is dropped without sending a response, so that the client
6111/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6112impl std::ops::Drop for TestCaseEnumeratorEnumerateResponder {
6113    fn drop(&mut self) {
6114        self.control_handle.shutdown();
6115        // Safety: drops once, never accessed again
6116        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6117    }
6118}
6119
6120impl fidl::endpoints::Responder for TestCaseEnumeratorEnumerateResponder {
6121    type ControlHandle = TestCaseEnumeratorControlHandle;
6122
6123    fn control_handle(&self) -> &TestCaseEnumeratorControlHandle {
6124        &self.control_handle
6125    }
6126
6127    fn drop_without_shutdown(mut self) {
6128        // Safety: drops once, never accessed again due to mem::forget
6129        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6130        // Prevent Drop from running (which would shut down the channel)
6131        std::mem::forget(self);
6132    }
6133}
6134
6135impl TestCaseEnumeratorEnumerateResponder {
6136    /// Sends a response to the FIDL transaction.
6137    ///
6138    /// Sets the channel to shutdown if an error occurs.
6139    pub fn send(self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
6140        let _result = self.send_raw(result);
6141        if _result.is_err() {
6142            self.control_handle.shutdown();
6143        }
6144        self.drop_without_shutdown();
6145        _result
6146    }
6147
6148    /// Similar to "send" but does not shutdown the channel if an error occurs.
6149    pub fn send_no_shutdown_on_err(
6150        self,
6151        mut result: Result<(), LaunchError>,
6152    ) -> Result<(), fidl::Error> {
6153        let _result = self.send_raw(result);
6154        self.drop_without_shutdown();
6155        _result
6156    }
6157
6158    fn send_raw(&self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
6159        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6160            fidl::encoding::EmptyStruct,
6161            LaunchError,
6162        >>(
6163            fidl::encoding::FlexibleResult::new(result),
6164            self.tx_id,
6165            0x24f8a91d96134492,
6166            fidl::encoding::DynamicFlags::FLEXIBLE,
6167        )
6168    }
6169}
6170
6171#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6172pub struct TestCaseIteratorMarker;
6173
6174impl fidl::endpoints::ProtocolMarker for TestCaseIteratorMarker {
6175    type Proxy = TestCaseIteratorProxy;
6176    type RequestStream = TestCaseIteratorRequestStream;
6177    #[cfg(target_os = "fuchsia")]
6178    type SynchronousProxy = TestCaseIteratorSynchronousProxy;
6179
6180    const DEBUG_NAME: &'static str = "(anonymous) TestCaseIterator";
6181}
6182
6183pub trait TestCaseIteratorProxyInterface: Send + Sync {
6184    type GetNextResponseFut: std::future::Future<Output = Result<Vec<TestCase>, fidl::Error>> + Send;
6185    fn r#get_next(&self) -> Self::GetNextResponseFut;
6186}
6187#[derive(Debug)]
6188#[cfg(target_os = "fuchsia")]
6189pub struct TestCaseIteratorSynchronousProxy {
6190    client: fidl::client::sync::Client,
6191}
6192
6193#[cfg(target_os = "fuchsia")]
6194impl fidl::endpoints::SynchronousProxy for TestCaseIteratorSynchronousProxy {
6195    type Proxy = TestCaseIteratorProxy;
6196    type Protocol = TestCaseIteratorMarker;
6197
6198    fn from_channel(inner: fidl::Channel) -> Self {
6199        Self::new(inner)
6200    }
6201
6202    fn into_channel(self) -> fidl::Channel {
6203        self.client.into_channel()
6204    }
6205
6206    fn as_channel(&self) -> &fidl::Channel {
6207        self.client.as_channel()
6208    }
6209}
6210
6211#[cfg(target_os = "fuchsia")]
6212impl TestCaseIteratorSynchronousProxy {
6213    pub fn new(channel: fidl::Channel) -> Self {
6214        Self { client: fidl::client::sync::Client::new(channel) }
6215    }
6216
6217    pub fn into_channel(self) -> fidl::Channel {
6218        self.client.into_channel()
6219    }
6220
6221    /// Waits until an event arrives and returns it. It is safe for other
6222    /// threads to make concurrent requests while waiting for an event.
6223    pub fn wait_for_event(
6224        &self,
6225        deadline: zx::MonotonicInstant,
6226    ) -> Result<TestCaseIteratorEvent, fidl::Error> {
6227        TestCaseIteratorEvent::decode(
6228            self.client.wait_for_event::<TestCaseIteratorMarker>(deadline)?,
6229        )
6230    }
6231
6232    /// Returns the next batch of test cases. Returns the empty vector to indicate that the
6233    /// iteration is complete.
6234    pub fn r#get_next(
6235        &self,
6236        ___deadline: zx::MonotonicInstant,
6237    ) -> Result<Vec<TestCase>, fidl::Error> {
6238        let _response = self.client.send_query::<
6239            fidl::encoding::EmptyPayload,
6240            TestCaseIteratorGetNextResponse,
6241            TestCaseIteratorMarker,
6242        >(
6243            (),
6244            0x37abec519b2ac1be,
6245            fidl::encoding::DynamicFlags::empty(),
6246            ___deadline,
6247        )?;
6248        Ok(_response.test_cases)
6249    }
6250}
6251
6252#[cfg(target_os = "fuchsia")]
6253impl From<TestCaseIteratorSynchronousProxy> for zx::NullableHandle {
6254    fn from(value: TestCaseIteratorSynchronousProxy) -> Self {
6255        value.into_channel().into()
6256    }
6257}
6258
6259#[cfg(target_os = "fuchsia")]
6260impl From<fidl::Channel> for TestCaseIteratorSynchronousProxy {
6261    fn from(value: fidl::Channel) -> Self {
6262        Self::new(value)
6263    }
6264}
6265
6266#[cfg(target_os = "fuchsia")]
6267impl fidl::endpoints::FromClient for TestCaseIteratorSynchronousProxy {
6268    type Protocol = TestCaseIteratorMarker;
6269
6270    fn from_client(value: fidl::endpoints::ClientEnd<TestCaseIteratorMarker>) -> Self {
6271        Self::new(value.into_channel())
6272    }
6273}
6274
6275#[derive(Debug, Clone)]
6276pub struct TestCaseIteratorProxy {
6277    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6278}
6279
6280impl fidl::endpoints::Proxy for TestCaseIteratorProxy {
6281    type Protocol = TestCaseIteratorMarker;
6282
6283    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6284        Self::new(inner)
6285    }
6286
6287    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6288        self.client.into_channel().map_err(|client| Self { client })
6289    }
6290
6291    fn as_channel(&self) -> &::fidl::AsyncChannel {
6292        self.client.as_channel()
6293    }
6294}
6295
6296impl TestCaseIteratorProxy {
6297    /// Create a new Proxy for fuchsia.test.manager/TestCaseIterator.
6298    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6299        let protocol_name = <TestCaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6300        Self { client: fidl::client::Client::new(channel, protocol_name) }
6301    }
6302
6303    /// Get a Stream of events from the remote end of the protocol.
6304    ///
6305    /// # Panics
6306    ///
6307    /// Panics if the event stream was already taken.
6308    pub fn take_event_stream(&self) -> TestCaseIteratorEventStream {
6309        TestCaseIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6310    }
6311
6312    /// Returns the next batch of test cases. Returns the empty vector to indicate that the
6313    /// iteration is complete.
6314    pub fn r#get_next(
6315        &self,
6316    ) -> fidl::client::QueryResponseFut<Vec<TestCase>, fidl::encoding::DefaultFuchsiaResourceDialect>
6317    {
6318        TestCaseIteratorProxyInterface::r#get_next(self)
6319    }
6320}
6321
6322impl TestCaseIteratorProxyInterface for TestCaseIteratorProxy {
6323    type GetNextResponseFut = fidl::client::QueryResponseFut<
6324        Vec<TestCase>,
6325        fidl::encoding::DefaultFuchsiaResourceDialect,
6326    >;
6327    fn r#get_next(&self) -> Self::GetNextResponseFut {
6328        fn _decode(
6329            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6330        ) -> Result<Vec<TestCase>, fidl::Error> {
6331            let _response = fidl::client::decode_transaction_body::<
6332                TestCaseIteratorGetNextResponse,
6333                fidl::encoding::DefaultFuchsiaResourceDialect,
6334                0x37abec519b2ac1be,
6335            >(_buf?)?;
6336            Ok(_response.test_cases)
6337        }
6338        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<TestCase>>(
6339            (),
6340            0x37abec519b2ac1be,
6341            fidl::encoding::DynamicFlags::empty(),
6342            _decode,
6343        )
6344    }
6345}
6346
6347pub struct TestCaseIteratorEventStream {
6348    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6349}
6350
6351impl std::marker::Unpin for TestCaseIteratorEventStream {}
6352
6353impl futures::stream::FusedStream for TestCaseIteratorEventStream {
6354    fn is_terminated(&self) -> bool {
6355        self.event_receiver.is_terminated()
6356    }
6357}
6358
6359impl futures::Stream for TestCaseIteratorEventStream {
6360    type Item = Result<TestCaseIteratorEvent, fidl::Error>;
6361
6362    fn poll_next(
6363        mut self: std::pin::Pin<&mut Self>,
6364        cx: &mut std::task::Context<'_>,
6365    ) -> std::task::Poll<Option<Self::Item>> {
6366        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6367            &mut self.event_receiver,
6368            cx
6369        )?) {
6370            Some(buf) => std::task::Poll::Ready(Some(TestCaseIteratorEvent::decode(buf))),
6371            None => std::task::Poll::Ready(None),
6372        }
6373    }
6374}
6375
6376#[derive(Debug)]
6377pub enum TestCaseIteratorEvent {}
6378
6379impl TestCaseIteratorEvent {
6380    /// Decodes a message buffer as a [`TestCaseIteratorEvent`].
6381    fn decode(
6382        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6383    ) -> Result<TestCaseIteratorEvent, fidl::Error> {
6384        let (bytes, _handles) = buf.split_mut();
6385        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6386        debug_assert_eq!(tx_header.tx_id, 0);
6387        match tx_header.ordinal {
6388            _ => Err(fidl::Error::UnknownOrdinal {
6389                ordinal: tx_header.ordinal,
6390                protocol_name:
6391                    <TestCaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6392            }),
6393        }
6394    }
6395}
6396
6397/// A Stream of incoming requests for fuchsia.test.manager/TestCaseIterator.
6398pub struct TestCaseIteratorRequestStream {
6399    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6400    is_terminated: bool,
6401}
6402
6403impl std::marker::Unpin for TestCaseIteratorRequestStream {}
6404
6405impl futures::stream::FusedStream for TestCaseIteratorRequestStream {
6406    fn is_terminated(&self) -> bool {
6407        self.is_terminated
6408    }
6409}
6410
6411impl fidl::endpoints::RequestStream for TestCaseIteratorRequestStream {
6412    type Protocol = TestCaseIteratorMarker;
6413    type ControlHandle = TestCaseIteratorControlHandle;
6414
6415    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6416        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6417    }
6418
6419    fn control_handle(&self) -> Self::ControlHandle {
6420        TestCaseIteratorControlHandle { inner: self.inner.clone() }
6421    }
6422
6423    fn into_inner(
6424        self,
6425    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6426    {
6427        (self.inner, self.is_terminated)
6428    }
6429
6430    fn from_inner(
6431        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6432        is_terminated: bool,
6433    ) -> Self {
6434        Self { inner, is_terminated }
6435    }
6436}
6437
6438impl futures::Stream for TestCaseIteratorRequestStream {
6439    type Item = Result<TestCaseIteratorRequest, fidl::Error>;
6440
6441    fn poll_next(
6442        mut self: std::pin::Pin<&mut Self>,
6443        cx: &mut std::task::Context<'_>,
6444    ) -> std::task::Poll<Option<Self::Item>> {
6445        let this = &mut *self;
6446        if this.inner.check_shutdown(cx) {
6447            this.is_terminated = true;
6448            return std::task::Poll::Ready(None);
6449        }
6450        if this.is_terminated {
6451            panic!("polled TestCaseIteratorRequestStream after completion");
6452        }
6453        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6454            |bytes, handles| {
6455                match this.inner.channel().read_etc(cx, bytes, handles) {
6456                    std::task::Poll::Ready(Ok(())) => {}
6457                    std::task::Poll::Pending => return std::task::Poll::Pending,
6458                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6459                        this.is_terminated = true;
6460                        return std::task::Poll::Ready(None);
6461                    }
6462                    std::task::Poll::Ready(Err(e)) => {
6463                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6464                            e.into(),
6465                        ))));
6466                    }
6467                }
6468
6469                // A message has been received from the channel
6470                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6471
6472                std::task::Poll::Ready(Some(match header.ordinal {
6473                    0x37abec519b2ac1be => {
6474                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6475                        let mut req = fidl::new_empty!(
6476                            fidl::encoding::EmptyPayload,
6477                            fidl::encoding::DefaultFuchsiaResourceDialect
6478                        );
6479                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6480                        let control_handle =
6481                            TestCaseIteratorControlHandle { inner: this.inner.clone() };
6482                        Ok(TestCaseIteratorRequest::GetNext {
6483                            responder: TestCaseIteratorGetNextResponder {
6484                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6485                                tx_id: header.tx_id,
6486                            },
6487                        })
6488                    }
6489                    _ => Err(fidl::Error::UnknownOrdinal {
6490                        ordinal: header.ordinal,
6491                        protocol_name:
6492                            <TestCaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6493                    }),
6494                }))
6495            },
6496        )
6497    }
6498}
6499
6500/// Iterator for listing available test cases.
6501#[derive(Debug)]
6502pub enum TestCaseIteratorRequest {
6503    /// Returns the next batch of test cases. Returns the empty vector to indicate that the
6504    /// iteration is complete.
6505    GetNext { responder: TestCaseIteratorGetNextResponder },
6506}
6507
6508impl TestCaseIteratorRequest {
6509    #[allow(irrefutable_let_patterns)]
6510    pub fn into_get_next(self) -> Option<(TestCaseIteratorGetNextResponder)> {
6511        if let TestCaseIteratorRequest::GetNext { responder } = self {
6512            Some((responder))
6513        } else {
6514            None
6515        }
6516    }
6517
6518    /// Name of the method defined in FIDL
6519    pub fn method_name(&self) -> &'static str {
6520        match *self {
6521            TestCaseIteratorRequest::GetNext { .. } => "get_next",
6522        }
6523    }
6524}
6525
6526#[derive(Debug, Clone)]
6527pub struct TestCaseIteratorControlHandle {
6528    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6529}
6530
6531impl fidl::endpoints::ControlHandle for TestCaseIteratorControlHandle {
6532    fn shutdown(&self) {
6533        self.inner.shutdown()
6534    }
6535
6536    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6537        self.inner.shutdown_with_epitaph(status)
6538    }
6539
6540    fn is_closed(&self) -> bool {
6541        self.inner.channel().is_closed()
6542    }
6543    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6544        self.inner.channel().on_closed()
6545    }
6546
6547    #[cfg(target_os = "fuchsia")]
6548    fn signal_peer(
6549        &self,
6550        clear_mask: zx::Signals,
6551        set_mask: zx::Signals,
6552    ) -> Result<(), zx_status::Status> {
6553        use fidl::Peered;
6554        self.inner.channel().signal_peer(clear_mask, set_mask)
6555    }
6556}
6557
6558impl TestCaseIteratorControlHandle {}
6559
6560#[must_use = "FIDL methods require a response to be sent"]
6561#[derive(Debug)]
6562pub struct TestCaseIteratorGetNextResponder {
6563    control_handle: std::mem::ManuallyDrop<TestCaseIteratorControlHandle>,
6564    tx_id: u32,
6565}
6566
6567/// Set the the channel to be shutdown (see [`TestCaseIteratorControlHandle::shutdown`])
6568/// if the responder is dropped without sending a response, so that the client
6569/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6570impl std::ops::Drop for TestCaseIteratorGetNextResponder {
6571    fn drop(&mut self) {
6572        self.control_handle.shutdown();
6573        // Safety: drops once, never accessed again
6574        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6575    }
6576}
6577
6578impl fidl::endpoints::Responder for TestCaseIteratorGetNextResponder {
6579    type ControlHandle = TestCaseIteratorControlHandle;
6580
6581    fn control_handle(&self) -> &TestCaseIteratorControlHandle {
6582        &self.control_handle
6583    }
6584
6585    fn drop_without_shutdown(mut self) {
6586        // Safety: drops once, never accessed again due to mem::forget
6587        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6588        // Prevent Drop from running (which would shut down the channel)
6589        std::mem::forget(self);
6590    }
6591}
6592
6593impl TestCaseIteratorGetNextResponder {
6594    /// Sends a response to the FIDL transaction.
6595    ///
6596    /// Sets the channel to shutdown if an error occurs.
6597    pub fn send(self, mut test_cases: &[TestCase]) -> Result<(), fidl::Error> {
6598        let _result = self.send_raw(test_cases);
6599        if _result.is_err() {
6600            self.control_handle.shutdown();
6601        }
6602        self.drop_without_shutdown();
6603        _result
6604    }
6605
6606    /// Similar to "send" but does not shutdown the channel if an error occurs.
6607    pub fn send_no_shutdown_on_err(self, mut test_cases: &[TestCase]) -> Result<(), fidl::Error> {
6608        let _result = self.send_raw(test_cases);
6609        self.drop_without_shutdown();
6610        _result
6611    }
6612
6613    fn send_raw(&self, mut test_cases: &[TestCase]) -> Result<(), fidl::Error> {
6614        self.control_handle.inner.send::<TestCaseIteratorGetNextResponse>(
6615            (test_cases,),
6616            self.tx_id,
6617            0x37abec519b2ac1be,
6618            fidl::encoding::DynamicFlags::empty(),
6619        )
6620    }
6621}
6622
6623mod internal {
6624    use super::*;
6625
6626    impl fidl::encoding::ResourceTypeMarker for CaseArtifact {
6627        type Borrowed<'a> = &'a mut Self;
6628        fn take_or_borrow<'a>(
6629            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6630        ) -> Self::Borrowed<'a> {
6631            value
6632        }
6633    }
6634
6635    unsafe impl fidl::encoding::TypeMarker for CaseArtifact {
6636        type Owned = Self;
6637
6638        #[inline(always)]
6639        fn inline_align(_context: fidl::encoding::Context) -> usize {
6640            8
6641        }
6642
6643        #[inline(always)]
6644        fn inline_size(_context: fidl::encoding::Context) -> usize {
6645            24
6646        }
6647    }
6648
6649    unsafe impl fidl::encoding::Encode<CaseArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
6650        for &mut CaseArtifact
6651    {
6652        #[inline]
6653        unsafe fn encode(
6654            self,
6655            encoder: &mut fidl::encoding::Encoder<
6656                '_,
6657                fidl::encoding::DefaultFuchsiaResourceDialect,
6658            >,
6659            offset: usize,
6660            _depth: fidl::encoding::Depth,
6661        ) -> fidl::Result<()> {
6662            encoder.debug_check_bounds::<CaseArtifact>(offset);
6663            // Delegate to tuple encoding.
6664            fidl::encoding::Encode::<CaseArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6665                (
6666                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.identifier),
6667                    <Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.artifact),
6668                ),
6669                encoder, offset, _depth
6670            )
6671        }
6672    }
6673    unsafe impl<
6674        T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
6675        T1: fidl::encoding::Encode<Artifact, fidl::encoding::DefaultFuchsiaResourceDialect>,
6676    > fidl::encoding::Encode<CaseArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
6677        for (T0, T1)
6678    {
6679        #[inline]
6680        unsafe fn encode(
6681            self,
6682            encoder: &mut fidl::encoding::Encoder<
6683                '_,
6684                fidl::encoding::DefaultFuchsiaResourceDialect,
6685            >,
6686            offset: usize,
6687            depth: fidl::encoding::Depth,
6688        ) -> fidl::Result<()> {
6689            encoder.debug_check_bounds::<CaseArtifact>(offset);
6690            // Zero out padding regions. There's no need to apply masks
6691            // because the unmasked parts will be overwritten by fields.
6692            unsafe {
6693                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
6694                (ptr as *mut u64).write_unaligned(0);
6695            }
6696            // Write the fields.
6697            self.0.encode(encoder, offset + 0, depth)?;
6698            self.1.encode(encoder, offset + 8, depth)?;
6699            Ok(())
6700        }
6701    }
6702
6703    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for CaseArtifact {
6704        #[inline(always)]
6705        fn new_empty() -> Self {
6706            Self {
6707                identifier: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
6708                artifact: fidl::new_empty!(Artifact, fidl::encoding::DefaultFuchsiaResourceDialect),
6709            }
6710        }
6711
6712        #[inline]
6713        unsafe fn decode(
6714            &mut self,
6715            decoder: &mut fidl::encoding::Decoder<
6716                '_,
6717                fidl::encoding::DefaultFuchsiaResourceDialect,
6718            >,
6719            offset: usize,
6720            _depth: fidl::encoding::Depth,
6721        ) -> fidl::Result<()> {
6722            decoder.debug_check_bounds::<Self>(offset);
6723            // Verify that padding bytes are zero.
6724            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
6725            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6726            let mask = 0xffffffff00000000u64;
6727            let maskedval = padval & mask;
6728            if maskedval != 0 {
6729                return Err(fidl::Error::NonZeroPadding {
6730                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
6731                });
6732            }
6733            fidl::decode!(
6734                u32,
6735                fidl::encoding::DefaultFuchsiaResourceDialect,
6736                &mut self.identifier,
6737                decoder,
6738                offset + 0,
6739                _depth
6740            )?;
6741            fidl::decode!(
6742                Artifact,
6743                fidl::encoding::DefaultFuchsiaResourceDialect,
6744                &mut self.artifact,
6745                decoder,
6746                offset + 8,
6747                _depth
6748            )?;
6749            Ok(())
6750        }
6751    }
6752
6753    impl fidl::encoding::ResourceTypeMarker for DebugDataIteratorGetNextCompressedResponse {
6754        type Borrowed<'a> = &'a mut Self;
6755        fn take_or_borrow<'a>(
6756            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6757        ) -> Self::Borrowed<'a> {
6758            value
6759        }
6760    }
6761
6762    unsafe impl fidl::encoding::TypeMarker for DebugDataIteratorGetNextCompressedResponse {
6763        type Owned = Self;
6764
6765        #[inline(always)]
6766        fn inline_align(_context: fidl::encoding::Context) -> usize {
6767            8
6768        }
6769
6770        #[inline(always)]
6771        fn inline_size(_context: fidl::encoding::Context) -> usize {
6772            16
6773        }
6774    }
6775
6776    unsafe impl
6777        fidl::encoding::Encode<
6778            DebugDataIteratorGetNextCompressedResponse,
6779            fidl::encoding::DefaultFuchsiaResourceDialect,
6780        > for &mut DebugDataIteratorGetNextCompressedResponse
6781    {
6782        #[inline]
6783        unsafe fn encode(
6784            self,
6785            encoder: &mut fidl::encoding::Encoder<
6786                '_,
6787                fidl::encoding::DefaultFuchsiaResourceDialect,
6788            >,
6789            offset: usize,
6790            _depth: fidl::encoding::Depth,
6791        ) -> fidl::Result<()> {
6792            encoder.debug_check_bounds::<DebugDataIteratorGetNextCompressedResponse>(offset);
6793            // Delegate to tuple encoding.
6794            fidl::encoding::Encode::<DebugDataIteratorGetNextCompressedResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6795                (
6796                    <fidl::encoding::UnboundedVector<DebugData> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data),
6797                ),
6798                encoder, offset, _depth
6799            )
6800        }
6801    }
6802    unsafe impl<
6803        T0: fidl::encoding::Encode<
6804                fidl::encoding::UnboundedVector<DebugData>,
6805                fidl::encoding::DefaultFuchsiaResourceDialect,
6806            >,
6807    >
6808        fidl::encoding::Encode<
6809            DebugDataIteratorGetNextCompressedResponse,
6810            fidl::encoding::DefaultFuchsiaResourceDialect,
6811        > for (T0,)
6812    {
6813        #[inline]
6814        unsafe fn encode(
6815            self,
6816            encoder: &mut fidl::encoding::Encoder<
6817                '_,
6818                fidl::encoding::DefaultFuchsiaResourceDialect,
6819            >,
6820            offset: usize,
6821            depth: fidl::encoding::Depth,
6822        ) -> fidl::Result<()> {
6823            encoder.debug_check_bounds::<DebugDataIteratorGetNextCompressedResponse>(offset);
6824            // Zero out padding regions. There's no need to apply masks
6825            // because the unmasked parts will be overwritten by fields.
6826            // Write the fields.
6827            self.0.encode(encoder, offset + 0, depth)?;
6828            Ok(())
6829        }
6830    }
6831
6832    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6833        for DebugDataIteratorGetNextCompressedResponse
6834    {
6835        #[inline(always)]
6836        fn new_empty() -> Self {
6837            Self {
6838                data: fidl::new_empty!(
6839                    fidl::encoding::UnboundedVector<DebugData>,
6840                    fidl::encoding::DefaultFuchsiaResourceDialect
6841                ),
6842            }
6843        }
6844
6845        #[inline]
6846        unsafe fn decode(
6847            &mut self,
6848            decoder: &mut fidl::encoding::Decoder<
6849                '_,
6850                fidl::encoding::DefaultFuchsiaResourceDialect,
6851            >,
6852            offset: usize,
6853            _depth: fidl::encoding::Depth,
6854        ) -> fidl::Result<()> {
6855            decoder.debug_check_bounds::<Self>(offset);
6856            // Verify that padding bytes are zero.
6857            fidl::decode!(
6858                fidl::encoding::UnboundedVector<DebugData>,
6859                fidl::encoding::DefaultFuchsiaResourceDialect,
6860                &mut self.data,
6861                decoder,
6862                offset + 0,
6863                _depth
6864            )?;
6865            Ok(())
6866        }
6867    }
6868
6869    impl fidl::encoding::ResourceTypeMarker for DebugDataIteratorGetNextResponse {
6870        type Borrowed<'a> = &'a mut Self;
6871        fn take_or_borrow<'a>(
6872            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6873        ) -> Self::Borrowed<'a> {
6874            value
6875        }
6876    }
6877
6878    unsafe impl fidl::encoding::TypeMarker for DebugDataIteratorGetNextResponse {
6879        type Owned = Self;
6880
6881        #[inline(always)]
6882        fn inline_align(_context: fidl::encoding::Context) -> usize {
6883            8
6884        }
6885
6886        #[inline(always)]
6887        fn inline_size(_context: fidl::encoding::Context) -> usize {
6888            16
6889        }
6890    }
6891
6892    unsafe impl
6893        fidl::encoding::Encode<
6894            DebugDataIteratorGetNextResponse,
6895            fidl::encoding::DefaultFuchsiaResourceDialect,
6896        > for &mut DebugDataIteratorGetNextResponse
6897    {
6898        #[inline]
6899        unsafe fn encode(
6900            self,
6901            encoder: &mut fidl::encoding::Encoder<
6902                '_,
6903                fidl::encoding::DefaultFuchsiaResourceDialect,
6904            >,
6905            offset: usize,
6906            _depth: fidl::encoding::Depth,
6907        ) -> fidl::Result<()> {
6908            encoder.debug_check_bounds::<DebugDataIteratorGetNextResponse>(offset);
6909            // Delegate to tuple encoding.
6910            fidl::encoding::Encode::<DebugDataIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6911                (
6912                    <fidl::encoding::UnboundedVector<DebugData> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data),
6913                ),
6914                encoder, offset, _depth
6915            )
6916        }
6917    }
6918    unsafe impl<
6919        T0: fidl::encoding::Encode<
6920                fidl::encoding::UnboundedVector<DebugData>,
6921                fidl::encoding::DefaultFuchsiaResourceDialect,
6922            >,
6923    >
6924        fidl::encoding::Encode<
6925            DebugDataIteratorGetNextResponse,
6926            fidl::encoding::DefaultFuchsiaResourceDialect,
6927        > for (T0,)
6928    {
6929        #[inline]
6930        unsafe fn encode(
6931            self,
6932            encoder: &mut fidl::encoding::Encoder<
6933                '_,
6934                fidl::encoding::DefaultFuchsiaResourceDialect,
6935            >,
6936            offset: usize,
6937            depth: fidl::encoding::Depth,
6938        ) -> fidl::Result<()> {
6939            encoder.debug_check_bounds::<DebugDataIteratorGetNextResponse>(offset);
6940            // Zero out padding regions. There's no need to apply masks
6941            // because the unmasked parts will be overwritten by fields.
6942            // Write the fields.
6943            self.0.encode(encoder, offset + 0, depth)?;
6944            Ok(())
6945        }
6946    }
6947
6948    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6949        for DebugDataIteratorGetNextResponse
6950    {
6951        #[inline(always)]
6952        fn new_empty() -> Self {
6953            Self {
6954                data: fidl::new_empty!(
6955                    fidl::encoding::UnboundedVector<DebugData>,
6956                    fidl::encoding::DefaultFuchsiaResourceDialect
6957                ),
6958            }
6959        }
6960
6961        #[inline]
6962        unsafe fn decode(
6963            &mut self,
6964            decoder: &mut fidl::encoding::Decoder<
6965                '_,
6966                fidl::encoding::DefaultFuchsiaResourceDialect,
6967            >,
6968            offset: usize,
6969            _depth: fidl::encoding::Depth,
6970        ) -> fidl::Result<()> {
6971            decoder.debug_check_bounds::<Self>(offset);
6972            // Verify that padding bytes are zero.
6973            fidl::decode!(
6974                fidl::encoding::UnboundedVector<DebugData>,
6975                fidl::encoding::DefaultFuchsiaResourceDialect,
6976                &mut self.data,
6977                decoder,
6978                offset + 0,
6979                _depth
6980            )?;
6981            Ok(())
6982        }
6983    }
6984
6985    impl fidl::encoding::ResourceTypeMarker for DirectoryAndToken {
6986        type Borrowed<'a> = &'a mut Self;
6987        fn take_or_borrow<'a>(
6988            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6989        ) -> Self::Borrowed<'a> {
6990            value
6991        }
6992    }
6993
6994    unsafe impl fidl::encoding::TypeMarker for DirectoryAndToken {
6995        type Owned = Self;
6996
6997        #[inline(always)]
6998        fn inline_align(_context: fidl::encoding::Context) -> usize {
6999            4
7000        }
7001
7002        #[inline(always)]
7003        fn inline_size(_context: fidl::encoding::Context) -> usize {
7004            8
7005        }
7006    }
7007
7008    unsafe impl
7009        fidl::encoding::Encode<DirectoryAndToken, fidl::encoding::DefaultFuchsiaResourceDialect>
7010        for &mut DirectoryAndToken
7011    {
7012        #[inline]
7013        unsafe fn encode(
7014            self,
7015            encoder: &mut fidl::encoding::Encoder<
7016                '_,
7017                fidl::encoding::DefaultFuchsiaResourceDialect,
7018            >,
7019            offset: usize,
7020            _depth: fidl::encoding::Depth,
7021        ) -> fidl::Result<()> {
7022            encoder.debug_check_bounds::<DirectoryAndToken>(offset);
7023            // Delegate to tuple encoding.
7024            fidl::encoding::Encode::<DirectoryAndToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7025                (
7026                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.directory),
7027                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
7028                ),
7029                encoder, offset, _depth
7030            )
7031        }
7032    }
7033    unsafe impl<
7034        T0: fidl::encoding::Encode<
7035                fidl::encoding::Endpoint<
7036                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
7037                >,
7038                fidl::encoding::DefaultFuchsiaResourceDialect,
7039            >,
7040        T1: fidl::encoding::Encode<
7041                fidl::encoding::HandleType<
7042                    fidl::EventPair,
7043                    { fidl::ObjectType::EVENTPAIR.into_raw() },
7044                    2147483648,
7045                >,
7046                fidl::encoding::DefaultFuchsiaResourceDialect,
7047            >,
7048    > fidl::encoding::Encode<DirectoryAndToken, fidl::encoding::DefaultFuchsiaResourceDialect>
7049        for (T0, T1)
7050    {
7051        #[inline]
7052        unsafe fn encode(
7053            self,
7054            encoder: &mut fidl::encoding::Encoder<
7055                '_,
7056                fidl::encoding::DefaultFuchsiaResourceDialect,
7057            >,
7058            offset: usize,
7059            depth: fidl::encoding::Depth,
7060        ) -> fidl::Result<()> {
7061            encoder.debug_check_bounds::<DirectoryAndToken>(offset);
7062            // Zero out padding regions. There's no need to apply masks
7063            // because the unmasked parts will be overwritten by fields.
7064            // Write the fields.
7065            self.0.encode(encoder, offset + 0, depth)?;
7066            self.1.encode(encoder, offset + 4, depth)?;
7067            Ok(())
7068        }
7069    }
7070
7071    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7072        for DirectoryAndToken
7073    {
7074        #[inline(always)]
7075        fn new_empty() -> Self {
7076            Self {
7077                directory: fidl::new_empty!(
7078                    fidl::encoding::Endpoint<
7079                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
7080                    >,
7081                    fidl::encoding::DefaultFuchsiaResourceDialect
7082                ),
7083                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
7084            }
7085        }
7086
7087        #[inline]
7088        unsafe fn decode(
7089            &mut self,
7090            decoder: &mut fidl::encoding::Decoder<
7091                '_,
7092                fidl::encoding::DefaultFuchsiaResourceDialect,
7093            >,
7094            offset: usize,
7095            _depth: fidl::encoding::Depth,
7096        ) -> fidl::Result<()> {
7097            decoder.debug_check_bounds::<Self>(offset);
7098            // Verify that padding bytes are zero.
7099            fidl::decode!(
7100                fidl::encoding::Endpoint<
7101                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
7102                >,
7103                fidl::encoding::DefaultFuchsiaResourceDialect,
7104                &mut self.directory,
7105                decoder,
7106                offset + 0,
7107                _depth
7108            )?;
7109            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 4, _depth)?;
7110            Ok(())
7111        }
7112    }
7113
7114    impl fidl::encoding::ResourceTypeMarker for EarlyBootProfileRegisterWatcherRequest {
7115        type Borrowed<'a> = &'a mut Self;
7116        fn take_or_borrow<'a>(
7117            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7118        ) -> Self::Borrowed<'a> {
7119            value
7120        }
7121    }
7122
7123    unsafe impl fidl::encoding::TypeMarker for EarlyBootProfileRegisterWatcherRequest {
7124        type Owned = Self;
7125
7126        #[inline(always)]
7127        fn inline_align(_context: fidl::encoding::Context) -> usize {
7128            4
7129        }
7130
7131        #[inline(always)]
7132        fn inline_size(_context: fidl::encoding::Context) -> usize {
7133            4
7134        }
7135    }
7136
7137    unsafe impl
7138        fidl::encoding::Encode<
7139            EarlyBootProfileRegisterWatcherRequest,
7140            fidl::encoding::DefaultFuchsiaResourceDialect,
7141        > for &mut EarlyBootProfileRegisterWatcherRequest
7142    {
7143        #[inline]
7144        unsafe fn encode(
7145            self,
7146            encoder: &mut fidl::encoding::Encoder<
7147                '_,
7148                fidl::encoding::DefaultFuchsiaResourceDialect,
7149            >,
7150            offset: usize,
7151            _depth: fidl::encoding::Depth,
7152        ) -> fidl::Result<()> {
7153            encoder.debug_check_bounds::<EarlyBootProfileRegisterWatcherRequest>(offset);
7154            // Delegate to tuple encoding.
7155            fidl::encoding::Encode::<EarlyBootProfileRegisterWatcherRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7156                (
7157                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
7158                ),
7159                encoder, offset, _depth
7160            )
7161        }
7162    }
7163    unsafe impl<
7164        T0: fidl::encoding::Encode<
7165                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>>,
7166                fidl::encoding::DefaultFuchsiaResourceDialect,
7167            >,
7168    >
7169        fidl::encoding::Encode<
7170            EarlyBootProfileRegisterWatcherRequest,
7171            fidl::encoding::DefaultFuchsiaResourceDialect,
7172        > for (T0,)
7173    {
7174        #[inline]
7175        unsafe fn encode(
7176            self,
7177            encoder: &mut fidl::encoding::Encoder<
7178                '_,
7179                fidl::encoding::DefaultFuchsiaResourceDialect,
7180            >,
7181            offset: usize,
7182            depth: fidl::encoding::Depth,
7183        ) -> fidl::Result<()> {
7184            encoder.debug_check_bounds::<EarlyBootProfileRegisterWatcherRequest>(offset);
7185            // Zero out padding regions. There's no need to apply masks
7186            // because the unmasked parts will be overwritten by fields.
7187            // Write the fields.
7188            self.0.encode(encoder, offset + 0, depth)?;
7189            Ok(())
7190        }
7191    }
7192
7193    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7194        for EarlyBootProfileRegisterWatcherRequest
7195    {
7196        #[inline(always)]
7197        fn new_empty() -> Self {
7198            Self {
7199                iterator: fidl::new_empty!(
7200                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>>,
7201                    fidl::encoding::DefaultFuchsiaResourceDialect
7202                ),
7203            }
7204        }
7205
7206        #[inline]
7207        unsafe fn decode(
7208            &mut self,
7209            decoder: &mut fidl::encoding::Decoder<
7210                '_,
7211                fidl::encoding::DefaultFuchsiaResourceDialect,
7212            >,
7213            offset: usize,
7214            _depth: fidl::encoding::Depth,
7215        ) -> fidl::Result<()> {
7216            decoder.debug_check_bounds::<Self>(offset);
7217            // Verify that padding bytes are zero.
7218            fidl::decode!(
7219                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>>,
7220                fidl::encoding::DefaultFuchsiaResourceDialect,
7221                &mut self.iterator,
7222                decoder,
7223                offset + 0,
7224                _depth
7225            )?;
7226            Ok(())
7227        }
7228    }
7229
7230    impl fidl::encoding::ResourceTypeMarker for QueryEnumerateInRealmRequest {
7231        type Borrowed<'a> = &'a mut Self;
7232        fn take_or_borrow<'a>(
7233            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7234        ) -> Self::Borrowed<'a> {
7235            value
7236        }
7237    }
7238
7239    unsafe impl fidl::encoding::TypeMarker for QueryEnumerateInRealmRequest {
7240        type Owned = Self;
7241
7242        #[inline(always)]
7243        fn inline_align(_context: fidl::encoding::Context) -> usize {
7244            8
7245        }
7246
7247        #[inline(always)]
7248        fn inline_size(_context: fidl::encoding::Context) -> usize {
7249            64
7250        }
7251    }
7252
7253    unsafe impl
7254        fidl::encoding::Encode<
7255            QueryEnumerateInRealmRequest,
7256            fidl::encoding::DefaultFuchsiaResourceDialect,
7257        > for &mut QueryEnumerateInRealmRequest
7258    {
7259        #[inline]
7260        unsafe fn encode(
7261            self,
7262            encoder: &mut fidl::encoding::Encoder<
7263                '_,
7264                fidl::encoding::DefaultFuchsiaResourceDialect,
7265            >,
7266            offset: usize,
7267            _depth: fidl::encoding::Depth,
7268        ) -> fidl::Result<()> {
7269            encoder.debug_check_bounds::<QueryEnumerateInRealmRequest>(offset);
7270            // Delegate to tuple encoding.
7271            fidl::encoding::Encode::<QueryEnumerateInRealmRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7272                (
7273                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_url),
7274                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.realm),
7275                    <fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer> as fidl::encoding::ValueTypeMarker>::borrow(&self.offers),
7276                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.test_collection),
7277                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
7278                ),
7279                encoder, offset, _depth
7280            )
7281        }
7282    }
7283    unsafe impl<
7284        T0: fidl::encoding::Encode<
7285                fidl::encoding::BoundedString<4096>,
7286                fidl::encoding::DefaultFuchsiaResourceDialect,
7287            >,
7288        T1: fidl::encoding::Encode<
7289                fidl::encoding::Endpoint<
7290                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7291                >,
7292                fidl::encoding::DefaultFuchsiaResourceDialect,
7293            >,
7294        T2: fidl::encoding::Encode<
7295                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7296                fidl::encoding::DefaultFuchsiaResourceDialect,
7297            >,
7298        T3: fidl::encoding::Encode<
7299                fidl::encoding::UnboundedString,
7300                fidl::encoding::DefaultFuchsiaResourceDialect,
7301            >,
7302        T4: fidl::encoding::Encode<
7303                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7304                fidl::encoding::DefaultFuchsiaResourceDialect,
7305            >,
7306    >
7307        fidl::encoding::Encode<
7308            QueryEnumerateInRealmRequest,
7309            fidl::encoding::DefaultFuchsiaResourceDialect,
7310        > for (T0, T1, T2, T3, T4)
7311    {
7312        #[inline]
7313        unsafe fn encode(
7314            self,
7315            encoder: &mut fidl::encoding::Encoder<
7316                '_,
7317                fidl::encoding::DefaultFuchsiaResourceDialect,
7318            >,
7319            offset: usize,
7320            depth: fidl::encoding::Depth,
7321        ) -> fidl::Result<()> {
7322            encoder.debug_check_bounds::<QueryEnumerateInRealmRequest>(offset);
7323            // Zero out padding regions. There's no need to apply masks
7324            // because the unmasked parts will be overwritten by fields.
7325            unsafe {
7326                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7327                (ptr as *mut u64).write_unaligned(0);
7328            }
7329            unsafe {
7330                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(56);
7331                (ptr as *mut u64).write_unaligned(0);
7332            }
7333            // Write the fields.
7334            self.0.encode(encoder, offset + 0, depth)?;
7335            self.1.encode(encoder, offset + 16, depth)?;
7336            self.2.encode(encoder, offset + 24, depth)?;
7337            self.3.encode(encoder, offset + 40, depth)?;
7338            self.4.encode(encoder, offset + 56, depth)?;
7339            Ok(())
7340        }
7341    }
7342
7343    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7344        for QueryEnumerateInRealmRequest
7345    {
7346        #[inline(always)]
7347        fn new_empty() -> Self {
7348            Self {
7349                test_url: fidl::new_empty!(
7350                    fidl::encoding::BoundedString<4096>,
7351                    fidl::encoding::DefaultFuchsiaResourceDialect
7352                ),
7353                realm: fidl::new_empty!(
7354                    fidl::encoding::Endpoint<
7355                        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7356                    >,
7357                    fidl::encoding::DefaultFuchsiaResourceDialect
7358                ),
7359                offers: fidl::new_empty!(
7360                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7361                    fidl::encoding::DefaultFuchsiaResourceDialect
7362                ),
7363                test_collection: fidl::new_empty!(
7364                    fidl::encoding::UnboundedString,
7365                    fidl::encoding::DefaultFuchsiaResourceDialect
7366                ),
7367                iterator: fidl::new_empty!(
7368                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7369                    fidl::encoding::DefaultFuchsiaResourceDialect
7370                ),
7371            }
7372        }
7373
7374        #[inline]
7375        unsafe fn decode(
7376            &mut self,
7377            decoder: &mut fidl::encoding::Decoder<
7378                '_,
7379                fidl::encoding::DefaultFuchsiaResourceDialect,
7380            >,
7381            offset: usize,
7382            _depth: fidl::encoding::Depth,
7383        ) -> fidl::Result<()> {
7384            decoder.debug_check_bounds::<Self>(offset);
7385            // Verify that padding bytes are zero.
7386            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7387            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7388            let mask = 0xffffffff00000000u64;
7389            let maskedval = padval & mask;
7390            if maskedval != 0 {
7391                return Err(fidl::Error::NonZeroPadding {
7392                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7393                });
7394            }
7395            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(56) };
7396            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7397            let mask = 0xffffffff00000000u64;
7398            let maskedval = padval & mask;
7399            if maskedval != 0 {
7400                return Err(fidl::Error::NonZeroPadding {
7401                    padding_start: offset + 56 + ((mask as u64).trailing_zeros() / 8) as usize,
7402                });
7403            }
7404            fidl::decode!(
7405                fidl::encoding::BoundedString<4096>,
7406                fidl::encoding::DefaultFuchsiaResourceDialect,
7407                &mut self.test_url,
7408                decoder,
7409                offset + 0,
7410                _depth
7411            )?;
7412            fidl::decode!(
7413                fidl::encoding::Endpoint<
7414                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7415                >,
7416                fidl::encoding::DefaultFuchsiaResourceDialect,
7417                &mut self.realm,
7418                decoder,
7419                offset + 16,
7420                _depth
7421            )?;
7422            fidl::decode!(
7423                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7424                fidl::encoding::DefaultFuchsiaResourceDialect,
7425                &mut self.offers,
7426                decoder,
7427                offset + 24,
7428                _depth
7429            )?;
7430            fidl::decode!(
7431                fidl::encoding::UnboundedString,
7432                fidl::encoding::DefaultFuchsiaResourceDialect,
7433                &mut self.test_collection,
7434                decoder,
7435                offset + 40,
7436                _depth
7437            )?;
7438            fidl::decode!(
7439                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7440                fidl::encoding::DefaultFuchsiaResourceDialect,
7441                &mut self.iterator,
7442                decoder,
7443                offset + 56,
7444                _depth
7445            )?;
7446            Ok(())
7447        }
7448    }
7449
7450    impl fidl::encoding::ResourceTypeMarker for QueryEnumerateRequest {
7451        type Borrowed<'a> = &'a mut Self;
7452        fn take_or_borrow<'a>(
7453            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7454        ) -> Self::Borrowed<'a> {
7455            value
7456        }
7457    }
7458
7459    unsafe impl fidl::encoding::TypeMarker for QueryEnumerateRequest {
7460        type Owned = Self;
7461
7462        #[inline(always)]
7463        fn inline_align(_context: fidl::encoding::Context) -> usize {
7464            8
7465        }
7466
7467        #[inline(always)]
7468        fn inline_size(_context: fidl::encoding::Context) -> usize {
7469            24
7470        }
7471    }
7472
7473    unsafe impl
7474        fidl::encoding::Encode<QueryEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
7475        for &mut QueryEnumerateRequest
7476    {
7477        #[inline]
7478        unsafe fn encode(
7479            self,
7480            encoder: &mut fidl::encoding::Encoder<
7481                '_,
7482                fidl::encoding::DefaultFuchsiaResourceDialect,
7483            >,
7484            offset: usize,
7485            _depth: fidl::encoding::Depth,
7486        ) -> fidl::Result<()> {
7487            encoder.debug_check_bounds::<QueryEnumerateRequest>(offset);
7488            // Delegate to tuple encoding.
7489            fidl::encoding::Encode::<QueryEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7490                (
7491                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_url),
7492                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
7493                ),
7494                encoder, offset, _depth
7495            )
7496        }
7497    }
7498    unsafe impl<
7499        T0: fidl::encoding::Encode<
7500                fidl::encoding::BoundedString<4096>,
7501                fidl::encoding::DefaultFuchsiaResourceDialect,
7502            >,
7503        T1: fidl::encoding::Encode<
7504                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7505                fidl::encoding::DefaultFuchsiaResourceDialect,
7506            >,
7507    >
7508        fidl::encoding::Encode<QueryEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
7509        for (T0, T1)
7510    {
7511        #[inline]
7512        unsafe fn encode(
7513            self,
7514            encoder: &mut fidl::encoding::Encoder<
7515                '_,
7516                fidl::encoding::DefaultFuchsiaResourceDialect,
7517            >,
7518            offset: usize,
7519            depth: fidl::encoding::Depth,
7520        ) -> fidl::Result<()> {
7521            encoder.debug_check_bounds::<QueryEnumerateRequest>(offset);
7522            // Zero out padding regions. There's no need to apply masks
7523            // because the unmasked parts will be overwritten by fields.
7524            unsafe {
7525                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7526                (ptr as *mut u64).write_unaligned(0);
7527            }
7528            // Write the fields.
7529            self.0.encode(encoder, offset + 0, depth)?;
7530            self.1.encode(encoder, offset + 16, depth)?;
7531            Ok(())
7532        }
7533    }
7534
7535    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7536        for QueryEnumerateRequest
7537    {
7538        #[inline(always)]
7539        fn new_empty() -> Self {
7540            Self {
7541                test_url: fidl::new_empty!(
7542                    fidl::encoding::BoundedString<4096>,
7543                    fidl::encoding::DefaultFuchsiaResourceDialect
7544                ),
7545                iterator: fidl::new_empty!(
7546                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7547                    fidl::encoding::DefaultFuchsiaResourceDialect
7548                ),
7549            }
7550        }
7551
7552        #[inline]
7553        unsafe fn decode(
7554            &mut self,
7555            decoder: &mut fidl::encoding::Decoder<
7556                '_,
7557                fidl::encoding::DefaultFuchsiaResourceDialect,
7558            >,
7559            offset: usize,
7560            _depth: fidl::encoding::Depth,
7561        ) -> fidl::Result<()> {
7562            decoder.debug_check_bounds::<Self>(offset);
7563            // Verify that padding bytes are zero.
7564            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7565            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7566            let mask = 0xffffffff00000000u64;
7567            let maskedval = padval & mask;
7568            if maskedval != 0 {
7569                return Err(fidl::Error::NonZeroPadding {
7570                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7571                });
7572            }
7573            fidl::decode!(
7574                fidl::encoding::BoundedString<4096>,
7575                fidl::encoding::DefaultFuchsiaResourceDialect,
7576                &mut self.test_url,
7577                decoder,
7578                offset + 0,
7579                _depth
7580            )?;
7581            fidl::decode!(
7582                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CaseIteratorMarker>>,
7583                fidl::encoding::DefaultFuchsiaResourceDialect,
7584                &mut self.iterator,
7585                decoder,
7586                offset + 16,
7587                _depth
7588            )?;
7589            Ok(())
7590        }
7591    }
7592
7593    impl fidl::encoding::ResourceTypeMarker for RunBuilderAddSuiteInRealmRequest {
7594        type Borrowed<'a> = &'a mut Self;
7595        fn take_or_borrow<'a>(
7596            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7597        ) -> Self::Borrowed<'a> {
7598            value
7599        }
7600    }
7601
7602    unsafe impl fidl::encoding::TypeMarker for RunBuilderAddSuiteInRealmRequest {
7603        type Owned = Self;
7604
7605        #[inline(always)]
7606        fn inline_align(_context: fidl::encoding::Context) -> usize {
7607            8
7608        }
7609
7610        #[inline(always)]
7611        fn inline_size(_context: fidl::encoding::Context) -> usize {
7612            80
7613        }
7614    }
7615
7616    unsafe impl
7617        fidl::encoding::Encode<
7618            RunBuilderAddSuiteInRealmRequest,
7619            fidl::encoding::DefaultFuchsiaResourceDialect,
7620        > for &mut RunBuilderAddSuiteInRealmRequest
7621    {
7622        #[inline]
7623        unsafe fn encode(
7624            self,
7625            encoder: &mut fidl::encoding::Encoder<
7626                '_,
7627                fidl::encoding::DefaultFuchsiaResourceDialect,
7628            >,
7629            offset: usize,
7630            _depth: fidl::encoding::Depth,
7631        ) -> fidl::Result<()> {
7632            encoder.debug_check_bounds::<RunBuilderAddSuiteInRealmRequest>(offset);
7633            // Delegate to tuple encoding.
7634            fidl::encoding::Encode::<RunBuilderAddSuiteInRealmRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7635                (
7636                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.realm),
7637                    <fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer> as fidl::encoding::ValueTypeMarker>::borrow(&self.offers),
7638                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.test_collection),
7639                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_url),
7640                    <RunOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
7641                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
7642                ),
7643                encoder, offset, _depth
7644            )
7645        }
7646    }
7647    unsafe impl<
7648        T0: fidl::encoding::Encode<
7649                fidl::encoding::Endpoint<
7650                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7651                >,
7652                fidl::encoding::DefaultFuchsiaResourceDialect,
7653            >,
7654        T1: fidl::encoding::Encode<
7655                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7656                fidl::encoding::DefaultFuchsiaResourceDialect,
7657            >,
7658        T2: fidl::encoding::Encode<
7659                fidl::encoding::UnboundedString,
7660                fidl::encoding::DefaultFuchsiaResourceDialect,
7661            >,
7662        T3: fidl::encoding::Encode<
7663                fidl::encoding::BoundedString<4096>,
7664                fidl::encoding::DefaultFuchsiaResourceDialect,
7665            >,
7666        T4: fidl::encoding::Encode<RunOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
7667        T5: fidl::encoding::Encode<
7668                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7669                fidl::encoding::DefaultFuchsiaResourceDialect,
7670            >,
7671    >
7672        fidl::encoding::Encode<
7673            RunBuilderAddSuiteInRealmRequest,
7674            fidl::encoding::DefaultFuchsiaResourceDialect,
7675        > for (T0, T1, T2, T3, T4, T5)
7676    {
7677        #[inline]
7678        unsafe fn encode(
7679            self,
7680            encoder: &mut fidl::encoding::Encoder<
7681                '_,
7682                fidl::encoding::DefaultFuchsiaResourceDialect,
7683            >,
7684            offset: usize,
7685            depth: fidl::encoding::Depth,
7686        ) -> fidl::Result<()> {
7687            encoder.debug_check_bounds::<RunBuilderAddSuiteInRealmRequest>(offset);
7688            // Zero out padding regions. There's no need to apply masks
7689            // because the unmasked parts will be overwritten by fields.
7690            unsafe {
7691                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7692                (ptr as *mut u64).write_unaligned(0);
7693            }
7694            unsafe {
7695                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(72);
7696                (ptr as *mut u64).write_unaligned(0);
7697            }
7698            // Write the fields.
7699            self.0.encode(encoder, offset + 0, depth)?;
7700            self.1.encode(encoder, offset + 8, depth)?;
7701            self.2.encode(encoder, offset + 24, depth)?;
7702            self.3.encode(encoder, offset + 40, depth)?;
7703            self.4.encode(encoder, offset + 56, depth)?;
7704            self.5.encode(encoder, offset + 72, depth)?;
7705            Ok(())
7706        }
7707    }
7708
7709    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7710        for RunBuilderAddSuiteInRealmRequest
7711    {
7712        #[inline(always)]
7713        fn new_empty() -> Self {
7714            Self {
7715                realm: fidl::new_empty!(
7716                    fidl::encoding::Endpoint<
7717                        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7718                    >,
7719                    fidl::encoding::DefaultFuchsiaResourceDialect
7720                ),
7721                offers: fidl::new_empty!(
7722                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7723                    fidl::encoding::DefaultFuchsiaResourceDialect
7724                ),
7725                test_collection: fidl::new_empty!(
7726                    fidl::encoding::UnboundedString,
7727                    fidl::encoding::DefaultFuchsiaResourceDialect
7728                ),
7729                test_url: fidl::new_empty!(
7730                    fidl::encoding::BoundedString<4096>,
7731                    fidl::encoding::DefaultFuchsiaResourceDialect
7732                ),
7733                options: fidl::new_empty!(
7734                    RunOptions,
7735                    fidl::encoding::DefaultFuchsiaResourceDialect
7736                ),
7737                controller: fidl::new_empty!(
7738                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7739                    fidl::encoding::DefaultFuchsiaResourceDialect
7740                ),
7741            }
7742        }
7743
7744        #[inline]
7745        unsafe fn decode(
7746            &mut self,
7747            decoder: &mut fidl::encoding::Decoder<
7748                '_,
7749                fidl::encoding::DefaultFuchsiaResourceDialect,
7750            >,
7751            offset: usize,
7752            _depth: fidl::encoding::Depth,
7753        ) -> fidl::Result<()> {
7754            decoder.debug_check_bounds::<Self>(offset);
7755            // Verify that padding bytes are zero.
7756            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7757            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7758            let mask = 0xffffffff00000000u64;
7759            let maskedval = padval & mask;
7760            if maskedval != 0 {
7761                return Err(fidl::Error::NonZeroPadding {
7762                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7763                });
7764            }
7765            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(72) };
7766            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7767            let mask = 0xffffffff00000000u64;
7768            let maskedval = padval & mask;
7769            if maskedval != 0 {
7770                return Err(fidl::Error::NonZeroPadding {
7771                    padding_start: offset + 72 + ((mask as u64).trailing_zeros() / 8) as usize,
7772                });
7773            }
7774            fidl::decode!(
7775                fidl::encoding::Endpoint<
7776                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
7777                >,
7778                fidl::encoding::DefaultFuchsiaResourceDialect,
7779                &mut self.realm,
7780                decoder,
7781                offset + 0,
7782                _depth
7783            )?;
7784            fidl::decode!(
7785                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
7786                fidl::encoding::DefaultFuchsiaResourceDialect,
7787                &mut self.offers,
7788                decoder,
7789                offset + 8,
7790                _depth
7791            )?;
7792            fidl::decode!(
7793                fidl::encoding::UnboundedString,
7794                fidl::encoding::DefaultFuchsiaResourceDialect,
7795                &mut self.test_collection,
7796                decoder,
7797                offset + 24,
7798                _depth
7799            )?;
7800            fidl::decode!(
7801                fidl::encoding::BoundedString<4096>,
7802                fidl::encoding::DefaultFuchsiaResourceDialect,
7803                &mut self.test_url,
7804                decoder,
7805                offset + 40,
7806                _depth
7807            )?;
7808            fidl::decode!(
7809                RunOptions,
7810                fidl::encoding::DefaultFuchsiaResourceDialect,
7811                &mut self.options,
7812                decoder,
7813                offset + 56,
7814                _depth
7815            )?;
7816            fidl::decode!(
7817                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7818                fidl::encoding::DefaultFuchsiaResourceDialect,
7819                &mut self.controller,
7820                decoder,
7821                offset + 72,
7822                _depth
7823            )?;
7824            Ok(())
7825        }
7826    }
7827
7828    impl fidl::encoding::ResourceTypeMarker for RunBuilderAddSuiteRequest {
7829        type Borrowed<'a> = &'a mut Self;
7830        fn take_or_borrow<'a>(
7831            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7832        ) -> Self::Borrowed<'a> {
7833            value
7834        }
7835    }
7836
7837    unsafe impl fidl::encoding::TypeMarker for RunBuilderAddSuiteRequest {
7838        type Owned = Self;
7839
7840        #[inline(always)]
7841        fn inline_align(_context: fidl::encoding::Context) -> usize {
7842            8
7843        }
7844
7845        #[inline(always)]
7846        fn inline_size(_context: fidl::encoding::Context) -> usize {
7847            40
7848        }
7849    }
7850
7851    unsafe impl
7852        fidl::encoding::Encode<
7853            RunBuilderAddSuiteRequest,
7854            fidl::encoding::DefaultFuchsiaResourceDialect,
7855        > for &mut RunBuilderAddSuiteRequest
7856    {
7857        #[inline]
7858        unsafe fn encode(
7859            self,
7860            encoder: &mut fidl::encoding::Encoder<
7861                '_,
7862                fidl::encoding::DefaultFuchsiaResourceDialect,
7863            >,
7864            offset: usize,
7865            _depth: fidl::encoding::Depth,
7866        ) -> fidl::Result<()> {
7867            encoder.debug_check_bounds::<RunBuilderAddSuiteRequest>(offset);
7868            // Delegate to tuple encoding.
7869            fidl::encoding::Encode::<RunBuilderAddSuiteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7870                (
7871                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_url),
7872                    <RunOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
7873                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
7874                ),
7875                encoder, offset, _depth
7876            )
7877        }
7878    }
7879    unsafe impl<
7880        T0: fidl::encoding::Encode<
7881                fidl::encoding::BoundedString<4096>,
7882                fidl::encoding::DefaultFuchsiaResourceDialect,
7883            >,
7884        T1: fidl::encoding::Encode<RunOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
7885        T2: fidl::encoding::Encode<
7886                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7887                fidl::encoding::DefaultFuchsiaResourceDialect,
7888            >,
7889    >
7890        fidl::encoding::Encode<
7891            RunBuilderAddSuiteRequest,
7892            fidl::encoding::DefaultFuchsiaResourceDialect,
7893        > for (T0, T1, T2)
7894    {
7895        #[inline]
7896        unsafe fn encode(
7897            self,
7898            encoder: &mut fidl::encoding::Encoder<
7899                '_,
7900                fidl::encoding::DefaultFuchsiaResourceDialect,
7901            >,
7902            offset: usize,
7903            depth: fidl::encoding::Depth,
7904        ) -> fidl::Result<()> {
7905            encoder.debug_check_bounds::<RunBuilderAddSuiteRequest>(offset);
7906            // Zero out padding regions. There's no need to apply masks
7907            // because the unmasked parts will be overwritten by fields.
7908            unsafe {
7909                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
7910                (ptr as *mut u64).write_unaligned(0);
7911            }
7912            // Write the fields.
7913            self.0.encode(encoder, offset + 0, depth)?;
7914            self.1.encode(encoder, offset + 16, depth)?;
7915            self.2.encode(encoder, offset + 32, depth)?;
7916            Ok(())
7917        }
7918    }
7919
7920    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7921        for RunBuilderAddSuiteRequest
7922    {
7923        #[inline(always)]
7924        fn new_empty() -> Self {
7925            Self {
7926                test_url: fidl::new_empty!(
7927                    fidl::encoding::BoundedString<4096>,
7928                    fidl::encoding::DefaultFuchsiaResourceDialect
7929                ),
7930                options: fidl::new_empty!(
7931                    RunOptions,
7932                    fidl::encoding::DefaultFuchsiaResourceDialect
7933                ),
7934                controller: fidl::new_empty!(
7935                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7936                    fidl::encoding::DefaultFuchsiaResourceDialect
7937                ),
7938            }
7939        }
7940
7941        #[inline]
7942        unsafe fn decode(
7943            &mut self,
7944            decoder: &mut fidl::encoding::Decoder<
7945                '_,
7946                fidl::encoding::DefaultFuchsiaResourceDialect,
7947            >,
7948            offset: usize,
7949            _depth: fidl::encoding::Depth,
7950        ) -> fidl::Result<()> {
7951            decoder.debug_check_bounds::<Self>(offset);
7952            // Verify that padding bytes are zero.
7953            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
7954            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7955            let mask = 0xffffffff00000000u64;
7956            let maskedval = padval & mask;
7957            if maskedval != 0 {
7958                return Err(fidl::Error::NonZeroPadding {
7959                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
7960                });
7961            }
7962            fidl::decode!(
7963                fidl::encoding::BoundedString<4096>,
7964                fidl::encoding::DefaultFuchsiaResourceDialect,
7965                &mut self.test_url,
7966                decoder,
7967                offset + 0,
7968                _depth
7969            )?;
7970            fidl::decode!(
7971                RunOptions,
7972                fidl::encoding::DefaultFuchsiaResourceDialect,
7973                &mut self.options,
7974                decoder,
7975                offset + 16,
7976                _depth
7977            )?;
7978            fidl::decode!(
7979                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
7980                fidl::encoding::DefaultFuchsiaResourceDialect,
7981                &mut self.controller,
7982                decoder,
7983                offset + 32,
7984                _depth
7985            )?;
7986            Ok(())
7987        }
7988    }
7989
7990    impl fidl::encoding::ResourceTypeMarker for RunBuilderBuildRequest {
7991        type Borrowed<'a> = &'a mut Self;
7992        fn take_or_borrow<'a>(
7993            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7994        ) -> Self::Borrowed<'a> {
7995            value
7996        }
7997    }
7998
7999    unsafe impl fidl::encoding::TypeMarker for RunBuilderBuildRequest {
8000        type Owned = Self;
8001
8002        #[inline(always)]
8003        fn inline_align(_context: fidl::encoding::Context) -> usize {
8004            4
8005        }
8006
8007        #[inline(always)]
8008        fn inline_size(_context: fidl::encoding::Context) -> usize {
8009            4
8010        }
8011    }
8012
8013    unsafe impl
8014        fidl::encoding::Encode<
8015            RunBuilderBuildRequest,
8016            fidl::encoding::DefaultFuchsiaResourceDialect,
8017        > for &mut RunBuilderBuildRequest
8018    {
8019        #[inline]
8020        unsafe fn encode(
8021            self,
8022            encoder: &mut fidl::encoding::Encoder<
8023                '_,
8024                fidl::encoding::DefaultFuchsiaResourceDialect,
8025            >,
8026            offset: usize,
8027            _depth: fidl::encoding::Depth,
8028        ) -> fidl::Result<()> {
8029            encoder.debug_check_bounds::<RunBuilderBuildRequest>(offset);
8030            // Delegate to tuple encoding.
8031            fidl::encoding::Encode::<RunBuilderBuildRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8032                (
8033                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RunControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
8034                ),
8035                encoder, offset, _depth
8036            )
8037        }
8038    }
8039    unsafe impl<
8040        T0: fidl::encoding::Encode<
8041                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RunControllerMarker>>,
8042                fidl::encoding::DefaultFuchsiaResourceDialect,
8043            >,
8044    >
8045        fidl::encoding::Encode<
8046            RunBuilderBuildRequest,
8047            fidl::encoding::DefaultFuchsiaResourceDialect,
8048        > for (T0,)
8049    {
8050        #[inline]
8051        unsafe fn encode(
8052            self,
8053            encoder: &mut fidl::encoding::Encoder<
8054                '_,
8055                fidl::encoding::DefaultFuchsiaResourceDialect,
8056            >,
8057            offset: usize,
8058            depth: fidl::encoding::Depth,
8059        ) -> fidl::Result<()> {
8060            encoder.debug_check_bounds::<RunBuilderBuildRequest>(offset);
8061            // Zero out padding regions. There's no need to apply masks
8062            // because the unmasked parts will be overwritten by fields.
8063            // Write the fields.
8064            self.0.encode(encoder, offset + 0, depth)?;
8065            Ok(())
8066        }
8067    }
8068
8069    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8070        for RunBuilderBuildRequest
8071    {
8072        #[inline(always)]
8073        fn new_empty() -> Self {
8074            Self {
8075                controller: fidl::new_empty!(
8076                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RunControllerMarker>>,
8077                    fidl::encoding::DefaultFuchsiaResourceDialect
8078                ),
8079            }
8080        }
8081
8082        #[inline]
8083        unsafe fn decode(
8084            &mut self,
8085            decoder: &mut fidl::encoding::Decoder<
8086                '_,
8087                fidl::encoding::DefaultFuchsiaResourceDialect,
8088            >,
8089            offset: usize,
8090            _depth: fidl::encoding::Depth,
8091        ) -> fidl::Result<()> {
8092            decoder.debug_check_bounds::<Self>(offset);
8093            // Verify that padding bytes are zero.
8094            fidl::decode!(
8095                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RunControllerMarker>>,
8096                fidl::encoding::DefaultFuchsiaResourceDialect,
8097                &mut self.controller,
8098                decoder,
8099                offset + 0,
8100                _depth
8101            )?;
8102            Ok(())
8103        }
8104    }
8105
8106    impl fidl::encoding::ResourceTypeMarker for RunControllerGetEventsResponse {
8107        type Borrowed<'a> = &'a mut Self;
8108        fn take_or_borrow<'a>(
8109            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8110        ) -> Self::Borrowed<'a> {
8111            value
8112        }
8113    }
8114
8115    unsafe impl fidl::encoding::TypeMarker for RunControllerGetEventsResponse {
8116        type Owned = Self;
8117
8118        #[inline(always)]
8119        fn inline_align(_context: fidl::encoding::Context) -> usize {
8120            8
8121        }
8122
8123        #[inline(always)]
8124        fn inline_size(_context: fidl::encoding::Context) -> usize {
8125            16
8126        }
8127    }
8128
8129    unsafe impl
8130        fidl::encoding::Encode<
8131            RunControllerGetEventsResponse,
8132            fidl::encoding::DefaultFuchsiaResourceDialect,
8133        > for &mut RunControllerGetEventsResponse
8134    {
8135        #[inline]
8136        unsafe fn encode(
8137            self,
8138            encoder: &mut fidl::encoding::Encoder<
8139                '_,
8140                fidl::encoding::DefaultFuchsiaResourceDialect,
8141            >,
8142            offset: usize,
8143            _depth: fidl::encoding::Depth,
8144        ) -> fidl::Result<()> {
8145            encoder.debug_check_bounds::<RunControllerGetEventsResponse>(offset);
8146            // Delegate to tuple encoding.
8147            fidl::encoding::Encode::<RunControllerGetEventsResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8148                (
8149                    <fidl::encoding::UnboundedVector<RunEvent> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
8150                ),
8151                encoder, offset, _depth
8152            )
8153        }
8154    }
8155    unsafe impl<
8156        T0: fidl::encoding::Encode<
8157                fidl::encoding::UnboundedVector<RunEvent>,
8158                fidl::encoding::DefaultFuchsiaResourceDialect,
8159            >,
8160    >
8161        fidl::encoding::Encode<
8162            RunControllerGetEventsResponse,
8163            fidl::encoding::DefaultFuchsiaResourceDialect,
8164        > for (T0,)
8165    {
8166        #[inline]
8167        unsafe fn encode(
8168            self,
8169            encoder: &mut fidl::encoding::Encoder<
8170                '_,
8171                fidl::encoding::DefaultFuchsiaResourceDialect,
8172            >,
8173            offset: usize,
8174            depth: fidl::encoding::Depth,
8175        ) -> fidl::Result<()> {
8176            encoder.debug_check_bounds::<RunControllerGetEventsResponse>(offset);
8177            // Zero out padding regions. There's no need to apply masks
8178            // because the unmasked parts will be overwritten by fields.
8179            // Write the fields.
8180            self.0.encode(encoder, offset + 0, depth)?;
8181            Ok(())
8182        }
8183    }
8184
8185    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8186        for RunControllerGetEventsResponse
8187    {
8188        #[inline(always)]
8189        fn new_empty() -> Self {
8190            Self {
8191                events: fidl::new_empty!(
8192                    fidl::encoding::UnboundedVector<RunEvent>,
8193                    fidl::encoding::DefaultFuchsiaResourceDialect
8194                ),
8195            }
8196        }
8197
8198        #[inline]
8199        unsafe fn decode(
8200            &mut self,
8201            decoder: &mut fidl::encoding::Decoder<
8202                '_,
8203                fidl::encoding::DefaultFuchsiaResourceDialect,
8204            >,
8205            offset: usize,
8206            _depth: fidl::encoding::Depth,
8207        ) -> fidl::Result<()> {
8208            decoder.debug_check_bounds::<Self>(offset);
8209            // Verify that padding bytes are zero.
8210            fidl::decode!(
8211                fidl::encoding::UnboundedVector<RunEvent>,
8212                fidl::encoding::DefaultFuchsiaResourceDialect,
8213                &mut self.events,
8214                decoder,
8215                offset + 0,
8216                _depth
8217            )?;
8218            Ok(())
8219        }
8220    }
8221
8222    impl fidl::encoding::ResourceTypeMarker for Stderr {
8223        type Borrowed<'a> = &'a mut Self;
8224        fn take_or_borrow<'a>(
8225            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8226        ) -> Self::Borrowed<'a> {
8227            value
8228        }
8229    }
8230
8231    unsafe impl fidl::encoding::TypeMarker for Stderr {
8232        type Owned = Self;
8233
8234        #[inline(always)]
8235        fn inline_align(_context: fidl::encoding::Context) -> usize {
8236            4
8237        }
8238
8239        #[inline(always)]
8240        fn inline_size(_context: fidl::encoding::Context) -> usize {
8241            4
8242        }
8243    }
8244
8245    unsafe impl fidl::encoding::Encode<Stderr, fidl::encoding::DefaultFuchsiaResourceDialect>
8246        for &mut Stderr
8247    {
8248        #[inline]
8249        unsafe fn encode(
8250            self,
8251            encoder: &mut fidl::encoding::Encoder<
8252                '_,
8253                fidl::encoding::DefaultFuchsiaResourceDialect,
8254            >,
8255            offset: usize,
8256            _depth: fidl::encoding::Depth,
8257        ) -> fidl::Result<()> {
8258            encoder.debug_check_bounds::<Stderr>(offset);
8259            // Delegate to tuple encoding.
8260            fidl::encoding::Encode::<Stderr, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8261                (<fidl::encoding::HandleType<
8262                    fidl::Socket,
8263                    { fidl::ObjectType::SOCKET.into_raw() },
8264                    2147483648,
8265                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8266                    &mut self.socket
8267                ),),
8268                encoder,
8269                offset,
8270                _depth,
8271            )
8272        }
8273    }
8274    unsafe impl<
8275        T0: fidl::encoding::Encode<
8276                fidl::encoding::HandleType<
8277                    fidl::Socket,
8278                    { fidl::ObjectType::SOCKET.into_raw() },
8279                    2147483648,
8280                >,
8281                fidl::encoding::DefaultFuchsiaResourceDialect,
8282            >,
8283    > fidl::encoding::Encode<Stderr, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
8284    {
8285        #[inline]
8286        unsafe fn encode(
8287            self,
8288            encoder: &mut fidl::encoding::Encoder<
8289                '_,
8290                fidl::encoding::DefaultFuchsiaResourceDialect,
8291            >,
8292            offset: usize,
8293            depth: fidl::encoding::Depth,
8294        ) -> fidl::Result<()> {
8295            encoder.debug_check_bounds::<Stderr>(offset);
8296            // Zero out padding regions. There's no need to apply masks
8297            // because the unmasked parts will be overwritten by fields.
8298            // Write the fields.
8299            self.0.encode(encoder, offset + 0, depth)?;
8300            Ok(())
8301        }
8302    }
8303
8304    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Stderr {
8305        #[inline(always)]
8306        fn new_empty() -> Self {
8307            Self {
8308                socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8309            }
8310        }
8311
8312        #[inline]
8313        unsafe fn decode(
8314            &mut self,
8315            decoder: &mut fidl::encoding::Decoder<
8316                '_,
8317                fidl::encoding::DefaultFuchsiaResourceDialect,
8318            >,
8319            offset: usize,
8320            _depth: fidl::encoding::Depth,
8321        ) -> fidl::Result<()> {
8322            decoder.debug_check_bounds::<Self>(offset);
8323            // Verify that padding bytes are zero.
8324            fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
8325            Ok(())
8326        }
8327    }
8328
8329    impl fidl::encoding::ResourceTypeMarker for Stdout {
8330        type Borrowed<'a> = &'a mut Self;
8331        fn take_or_borrow<'a>(
8332            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8333        ) -> Self::Borrowed<'a> {
8334            value
8335        }
8336    }
8337
8338    unsafe impl fidl::encoding::TypeMarker for Stdout {
8339        type Owned = Self;
8340
8341        #[inline(always)]
8342        fn inline_align(_context: fidl::encoding::Context) -> usize {
8343            4
8344        }
8345
8346        #[inline(always)]
8347        fn inline_size(_context: fidl::encoding::Context) -> usize {
8348            4
8349        }
8350    }
8351
8352    unsafe impl fidl::encoding::Encode<Stdout, fidl::encoding::DefaultFuchsiaResourceDialect>
8353        for &mut Stdout
8354    {
8355        #[inline]
8356        unsafe fn encode(
8357            self,
8358            encoder: &mut fidl::encoding::Encoder<
8359                '_,
8360                fidl::encoding::DefaultFuchsiaResourceDialect,
8361            >,
8362            offset: usize,
8363            _depth: fidl::encoding::Depth,
8364        ) -> fidl::Result<()> {
8365            encoder.debug_check_bounds::<Stdout>(offset);
8366            // Delegate to tuple encoding.
8367            fidl::encoding::Encode::<Stdout, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8368                (<fidl::encoding::HandleType<
8369                    fidl::Socket,
8370                    { fidl::ObjectType::SOCKET.into_raw() },
8371                    2147483648,
8372                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8373                    &mut self.socket
8374                ),),
8375                encoder,
8376                offset,
8377                _depth,
8378            )
8379        }
8380    }
8381    unsafe impl<
8382        T0: fidl::encoding::Encode<
8383                fidl::encoding::HandleType<
8384                    fidl::Socket,
8385                    { fidl::ObjectType::SOCKET.into_raw() },
8386                    2147483648,
8387                >,
8388                fidl::encoding::DefaultFuchsiaResourceDialect,
8389            >,
8390    > fidl::encoding::Encode<Stdout, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
8391    {
8392        #[inline]
8393        unsafe fn encode(
8394            self,
8395            encoder: &mut fidl::encoding::Encoder<
8396                '_,
8397                fidl::encoding::DefaultFuchsiaResourceDialect,
8398            >,
8399            offset: usize,
8400            depth: fidl::encoding::Depth,
8401        ) -> fidl::Result<()> {
8402            encoder.debug_check_bounds::<Stdout>(offset);
8403            // Zero out padding regions. There's no need to apply masks
8404            // because the unmasked parts will be overwritten by fields.
8405            // Write the fields.
8406            self.0.encode(encoder, offset + 0, depth)?;
8407            Ok(())
8408        }
8409    }
8410
8411    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Stdout {
8412        #[inline(always)]
8413        fn new_empty() -> Self {
8414            Self {
8415                socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8416            }
8417        }
8418
8419        #[inline]
8420        unsafe fn decode(
8421            &mut self,
8422            decoder: &mut fidl::encoding::Decoder<
8423                '_,
8424                fidl::encoding::DefaultFuchsiaResourceDialect,
8425            >,
8426            offset: usize,
8427            _depth: fidl::encoding::Depth,
8428        ) -> fidl::Result<()> {
8429            decoder.debug_check_bounds::<Self>(offset);
8430            // Verify that padding bytes are zero.
8431            fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
8432            Ok(())
8433        }
8434    }
8435
8436    impl fidl::encoding::ResourceTypeMarker for SuiteArtifact {
8437        type Borrowed<'a> = &'a mut Self;
8438        fn take_or_borrow<'a>(
8439            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8440        ) -> Self::Borrowed<'a> {
8441            value
8442        }
8443    }
8444
8445    unsafe impl fidl::encoding::TypeMarker for SuiteArtifact {
8446        type Owned = Self;
8447
8448        #[inline(always)]
8449        fn inline_align(_context: fidl::encoding::Context) -> usize {
8450            8
8451        }
8452
8453        #[inline(always)]
8454        fn inline_size(_context: fidl::encoding::Context) -> usize {
8455            16
8456        }
8457    }
8458
8459    unsafe impl fidl::encoding::Encode<SuiteArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
8460        for &mut SuiteArtifact
8461    {
8462        #[inline]
8463        unsafe fn encode(
8464            self,
8465            encoder: &mut fidl::encoding::Encoder<
8466                '_,
8467                fidl::encoding::DefaultFuchsiaResourceDialect,
8468            >,
8469            offset: usize,
8470            _depth: fidl::encoding::Depth,
8471        ) -> fidl::Result<()> {
8472            encoder.debug_check_bounds::<SuiteArtifact>(offset);
8473            // Delegate to tuple encoding.
8474            fidl::encoding::Encode::<SuiteArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8475                (
8476                    <Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.artifact),
8477                ),
8478                encoder, offset, _depth
8479            )
8480        }
8481    }
8482    unsafe impl<T0: fidl::encoding::Encode<Artifact, fidl::encoding::DefaultFuchsiaResourceDialect>>
8483        fidl::encoding::Encode<SuiteArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
8484        for (T0,)
8485    {
8486        #[inline]
8487        unsafe fn encode(
8488            self,
8489            encoder: &mut fidl::encoding::Encoder<
8490                '_,
8491                fidl::encoding::DefaultFuchsiaResourceDialect,
8492            >,
8493            offset: usize,
8494            depth: fidl::encoding::Depth,
8495        ) -> fidl::Result<()> {
8496            encoder.debug_check_bounds::<SuiteArtifact>(offset);
8497            // Zero out padding regions. There's no need to apply masks
8498            // because the unmasked parts will be overwritten by fields.
8499            // Write the fields.
8500            self.0.encode(encoder, offset + 0, depth)?;
8501            Ok(())
8502        }
8503    }
8504
8505    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for SuiteArtifact {
8506        #[inline(always)]
8507        fn new_empty() -> Self {
8508            Self {
8509                artifact: fidl::new_empty!(Artifact, fidl::encoding::DefaultFuchsiaResourceDialect),
8510            }
8511        }
8512
8513        #[inline]
8514        unsafe fn decode(
8515            &mut self,
8516            decoder: &mut fidl::encoding::Decoder<
8517                '_,
8518                fidl::encoding::DefaultFuchsiaResourceDialect,
8519            >,
8520            offset: usize,
8521            _depth: fidl::encoding::Depth,
8522        ) -> fidl::Result<()> {
8523            decoder.debug_check_bounds::<Self>(offset);
8524            // Verify that padding bytes are zero.
8525            fidl::decode!(
8526                Artifact,
8527                fidl::encoding::DefaultFuchsiaResourceDialect,
8528                &mut self.artifact,
8529                decoder,
8530                offset + 0,
8531                _depth
8532            )?;
8533            Ok(())
8534        }
8535    }
8536
8537    impl fidl::encoding::ResourceTypeMarker for SuiteControllerGetEventsResponse {
8538        type Borrowed<'a> = &'a mut Self;
8539        fn take_or_borrow<'a>(
8540            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8541        ) -> Self::Borrowed<'a> {
8542            value
8543        }
8544    }
8545
8546    unsafe impl fidl::encoding::TypeMarker for SuiteControllerGetEventsResponse {
8547        type Owned = Self;
8548
8549        #[inline(always)]
8550        fn inline_align(_context: fidl::encoding::Context) -> usize {
8551            8
8552        }
8553
8554        #[inline(always)]
8555        fn inline_size(_context: fidl::encoding::Context) -> usize {
8556            16
8557        }
8558    }
8559
8560    unsafe impl
8561        fidl::encoding::Encode<
8562            SuiteControllerGetEventsResponse,
8563            fidl::encoding::DefaultFuchsiaResourceDialect,
8564        > for &mut SuiteControllerGetEventsResponse
8565    {
8566        #[inline]
8567        unsafe fn encode(
8568            self,
8569            encoder: &mut fidl::encoding::Encoder<
8570                '_,
8571                fidl::encoding::DefaultFuchsiaResourceDialect,
8572            >,
8573            offset: usize,
8574            _depth: fidl::encoding::Depth,
8575        ) -> fidl::Result<()> {
8576            encoder.debug_check_bounds::<SuiteControllerGetEventsResponse>(offset);
8577            // Delegate to tuple encoding.
8578            fidl::encoding::Encode::<SuiteControllerGetEventsResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8579                (
8580                    <fidl::encoding::UnboundedVector<SuiteEvent> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
8581                ),
8582                encoder, offset, _depth
8583            )
8584        }
8585    }
8586    unsafe impl<
8587        T0: fidl::encoding::Encode<
8588                fidl::encoding::UnboundedVector<SuiteEvent>,
8589                fidl::encoding::DefaultFuchsiaResourceDialect,
8590            >,
8591    >
8592        fidl::encoding::Encode<
8593            SuiteControllerGetEventsResponse,
8594            fidl::encoding::DefaultFuchsiaResourceDialect,
8595        > for (T0,)
8596    {
8597        #[inline]
8598        unsafe fn encode(
8599            self,
8600            encoder: &mut fidl::encoding::Encoder<
8601                '_,
8602                fidl::encoding::DefaultFuchsiaResourceDialect,
8603            >,
8604            offset: usize,
8605            depth: fidl::encoding::Depth,
8606        ) -> fidl::Result<()> {
8607            encoder.debug_check_bounds::<SuiteControllerGetEventsResponse>(offset);
8608            // Zero out padding regions. There's no need to apply masks
8609            // because the unmasked parts will be overwritten by fields.
8610            // Write the fields.
8611            self.0.encode(encoder, offset + 0, depth)?;
8612            Ok(())
8613        }
8614    }
8615
8616    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8617        for SuiteControllerGetEventsResponse
8618    {
8619        #[inline(always)]
8620        fn new_empty() -> Self {
8621            Self {
8622                events: fidl::new_empty!(
8623                    fidl::encoding::UnboundedVector<SuiteEvent>,
8624                    fidl::encoding::DefaultFuchsiaResourceDialect
8625                ),
8626            }
8627        }
8628
8629        #[inline]
8630        unsafe fn decode(
8631            &mut self,
8632            decoder: &mut fidl::encoding::Decoder<
8633                '_,
8634                fidl::encoding::DefaultFuchsiaResourceDialect,
8635            >,
8636            offset: usize,
8637            _depth: fidl::encoding::Depth,
8638        ) -> fidl::Result<()> {
8639            decoder.debug_check_bounds::<Self>(offset);
8640            // Verify that padding bytes are zero.
8641            fidl::decode!(
8642                fidl::encoding::UnboundedVector<SuiteEvent>,
8643                fidl::encoding::DefaultFuchsiaResourceDialect,
8644                &mut self.events,
8645                decoder,
8646                offset + 0,
8647                _depth
8648            )?;
8649            Ok(())
8650        }
8651    }
8652
8653    impl fidl::encoding::ResourceTypeMarker for SuiteControllerWatchEventsResponse {
8654        type Borrowed<'a> = &'a mut Self;
8655        fn take_or_borrow<'a>(
8656            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8657        ) -> Self::Borrowed<'a> {
8658            value
8659        }
8660    }
8661
8662    unsafe impl fidl::encoding::TypeMarker for SuiteControllerWatchEventsResponse {
8663        type Owned = Self;
8664
8665        #[inline(always)]
8666        fn inline_align(_context: fidl::encoding::Context) -> usize {
8667            8
8668        }
8669
8670        #[inline(always)]
8671        fn inline_size(_context: fidl::encoding::Context) -> usize {
8672            16
8673        }
8674    }
8675
8676    unsafe impl
8677        fidl::encoding::Encode<
8678            SuiteControllerWatchEventsResponse,
8679            fidl::encoding::DefaultFuchsiaResourceDialect,
8680        > for &mut SuiteControllerWatchEventsResponse
8681    {
8682        #[inline]
8683        unsafe fn encode(
8684            self,
8685            encoder: &mut fidl::encoding::Encoder<
8686                '_,
8687                fidl::encoding::DefaultFuchsiaResourceDialect,
8688            >,
8689            offset: usize,
8690            _depth: fidl::encoding::Depth,
8691        ) -> fidl::Result<()> {
8692            encoder.debug_check_bounds::<SuiteControllerWatchEventsResponse>(offset);
8693            // Delegate to tuple encoding.
8694            fidl::encoding::Encode::<SuiteControllerWatchEventsResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8695                (
8696                    <fidl::encoding::Vector<Event, 1024> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
8697                ),
8698                encoder, offset, _depth
8699            )
8700        }
8701    }
8702    unsafe impl<
8703        T0: fidl::encoding::Encode<
8704                fidl::encoding::Vector<Event, 1024>,
8705                fidl::encoding::DefaultFuchsiaResourceDialect,
8706            >,
8707    >
8708        fidl::encoding::Encode<
8709            SuiteControllerWatchEventsResponse,
8710            fidl::encoding::DefaultFuchsiaResourceDialect,
8711        > for (T0,)
8712    {
8713        #[inline]
8714        unsafe fn encode(
8715            self,
8716            encoder: &mut fidl::encoding::Encoder<
8717                '_,
8718                fidl::encoding::DefaultFuchsiaResourceDialect,
8719            >,
8720            offset: usize,
8721            depth: fidl::encoding::Depth,
8722        ) -> fidl::Result<()> {
8723            encoder.debug_check_bounds::<SuiteControllerWatchEventsResponse>(offset);
8724            // Zero out padding regions. There's no need to apply masks
8725            // because the unmasked parts will be overwritten by fields.
8726            // Write the fields.
8727            self.0.encode(encoder, offset + 0, depth)?;
8728            Ok(())
8729        }
8730    }
8731
8732    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8733        for SuiteControllerWatchEventsResponse
8734    {
8735        #[inline(always)]
8736        fn new_empty() -> Self {
8737            Self {
8738                events: fidl::new_empty!(fidl::encoding::Vector<Event, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect),
8739            }
8740        }
8741
8742        #[inline]
8743        unsafe fn decode(
8744            &mut self,
8745            decoder: &mut fidl::encoding::Decoder<
8746                '_,
8747                fidl::encoding::DefaultFuchsiaResourceDialect,
8748            >,
8749            offset: usize,
8750            _depth: fidl::encoding::Depth,
8751        ) -> fidl::Result<()> {
8752            decoder.debug_check_bounds::<Self>(offset);
8753            // Verify that padding bytes are zero.
8754            fidl::decode!(fidl::encoding::Vector<Event, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.events, decoder, offset + 0, _depth)?;
8755            Ok(())
8756        }
8757    }
8758
8759    impl fidl::encoding::ResourceTypeMarker for SuiteRunnerRunRequest {
8760        type Borrowed<'a> = &'a mut Self;
8761        fn take_or_borrow<'a>(
8762            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8763        ) -> Self::Borrowed<'a> {
8764            value
8765        }
8766    }
8767
8768    unsafe impl fidl::encoding::TypeMarker for SuiteRunnerRunRequest {
8769        type Owned = Self;
8770
8771        #[inline(always)]
8772        fn inline_align(_context: fidl::encoding::Context) -> usize {
8773            8
8774        }
8775
8776        #[inline(always)]
8777        fn inline_size(_context: fidl::encoding::Context) -> usize {
8778            40
8779        }
8780    }
8781
8782    unsafe impl
8783        fidl::encoding::Encode<SuiteRunnerRunRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
8784        for &mut SuiteRunnerRunRequest
8785    {
8786        #[inline]
8787        unsafe fn encode(
8788            self,
8789            encoder: &mut fidl::encoding::Encoder<
8790                '_,
8791                fidl::encoding::DefaultFuchsiaResourceDialect,
8792            >,
8793            offset: usize,
8794            _depth: fidl::encoding::Depth,
8795        ) -> fidl::Result<()> {
8796            encoder.debug_check_bounds::<SuiteRunnerRunRequest>(offset);
8797            // Delegate to tuple encoding.
8798            fidl::encoding::Encode::<SuiteRunnerRunRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8799                (
8800                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_suite_url),
8801                    <RunSuiteOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.options),
8802                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
8803                ),
8804                encoder, offset, _depth
8805            )
8806        }
8807    }
8808    unsafe impl<
8809        T0: fidl::encoding::Encode<
8810                fidl::encoding::BoundedString<4096>,
8811                fidl::encoding::DefaultFuchsiaResourceDialect,
8812            >,
8813        T1: fidl::encoding::Encode<RunSuiteOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
8814        T2: fidl::encoding::Encode<
8815                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
8816                fidl::encoding::DefaultFuchsiaResourceDialect,
8817            >,
8818    >
8819        fidl::encoding::Encode<SuiteRunnerRunRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
8820        for (T0, T1, T2)
8821    {
8822        #[inline]
8823        unsafe fn encode(
8824            self,
8825            encoder: &mut fidl::encoding::Encoder<
8826                '_,
8827                fidl::encoding::DefaultFuchsiaResourceDialect,
8828            >,
8829            offset: usize,
8830            depth: fidl::encoding::Depth,
8831        ) -> fidl::Result<()> {
8832            encoder.debug_check_bounds::<SuiteRunnerRunRequest>(offset);
8833            // Zero out padding regions. There's no need to apply masks
8834            // because the unmasked parts will be overwritten by fields.
8835            unsafe {
8836                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
8837                (ptr as *mut u64).write_unaligned(0);
8838            }
8839            // Write the fields.
8840            self.0.encode(encoder, offset + 0, depth)?;
8841            self.1.encode(encoder, offset + 16, depth)?;
8842            self.2.encode(encoder, offset + 32, depth)?;
8843            Ok(())
8844        }
8845    }
8846
8847    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8848        for SuiteRunnerRunRequest
8849    {
8850        #[inline(always)]
8851        fn new_empty() -> Self {
8852            Self {
8853                test_suite_url: fidl::new_empty!(
8854                    fidl::encoding::BoundedString<4096>,
8855                    fidl::encoding::DefaultFuchsiaResourceDialect
8856                ),
8857                options: fidl::new_empty!(
8858                    RunSuiteOptions,
8859                    fidl::encoding::DefaultFuchsiaResourceDialect
8860                ),
8861                controller: fidl::new_empty!(
8862                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
8863                    fidl::encoding::DefaultFuchsiaResourceDialect
8864                ),
8865            }
8866        }
8867
8868        #[inline]
8869        unsafe fn decode(
8870            &mut self,
8871            decoder: &mut fidl::encoding::Decoder<
8872                '_,
8873                fidl::encoding::DefaultFuchsiaResourceDialect,
8874            >,
8875            offset: usize,
8876            _depth: fidl::encoding::Depth,
8877        ) -> fidl::Result<()> {
8878            decoder.debug_check_bounds::<Self>(offset);
8879            // Verify that padding bytes are zero.
8880            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
8881            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8882            let mask = 0xffffffff00000000u64;
8883            let maskedval = padval & mask;
8884            if maskedval != 0 {
8885                return Err(fidl::Error::NonZeroPadding {
8886                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
8887                });
8888            }
8889            fidl::decode!(
8890                fidl::encoding::BoundedString<4096>,
8891                fidl::encoding::DefaultFuchsiaResourceDialect,
8892                &mut self.test_suite_url,
8893                decoder,
8894                offset + 0,
8895                _depth
8896            )?;
8897            fidl::decode!(
8898                RunSuiteOptions,
8899                fidl::encoding::DefaultFuchsiaResourceDialect,
8900                &mut self.options,
8901                decoder,
8902                offset + 16,
8903                _depth
8904            )?;
8905            fidl::decode!(
8906                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
8907                fidl::encoding::DefaultFuchsiaResourceDialect,
8908                &mut self.controller,
8909                decoder,
8910                offset + 32,
8911                _depth
8912            )?;
8913            Ok(())
8914        }
8915    }
8916
8917    impl fidl::encoding::ResourceTypeMarker for TestCaseEnumeratorEnumerateRequest {
8918        type Borrowed<'a> = &'a mut Self;
8919        fn take_or_borrow<'a>(
8920            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8921        ) -> Self::Borrowed<'a> {
8922            value
8923        }
8924    }
8925
8926    unsafe impl fidl::encoding::TypeMarker for TestCaseEnumeratorEnumerateRequest {
8927        type Owned = Self;
8928
8929        #[inline(always)]
8930        fn inline_align(_context: fidl::encoding::Context) -> usize {
8931            8
8932        }
8933
8934        #[inline(always)]
8935        fn inline_size(_context: fidl::encoding::Context) -> usize {
8936            40
8937        }
8938    }
8939
8940    unsafe impl
8941        fidl::encoding::Encode<
8942            TestCaseEnumeratorEnumerateRequest,
8943            fidl::encoding::DefaultFuchsiaResourceDialect,
8944        > for &mut TestCaseEnumeratorEnumerateRequest
8945    {
8946        #[inline]
8947        unsafe fn encode(
8948            self,
8949            encoder: &mut fidl::encoding::Encoder<
8950                '_,
8951                fidl::encoding::DefaultFuchsiaResourceDialect,
8952            >,
8953            offset: usize,
8954            _depth: fidl::encoding::Depth,
8955        ) -> fidl::Result<()> {
8956            encoder.debug_check_bounds::<TestCaseEnumeratorEnumerateRequest>(offset);
8957            // Delegate to tuple encoding.
8958            fidl::encoding::Encode::<TestCaseEnumeratorEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8959                (
8960                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_suite_url),
8961                    <EnumerateTestCasesOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.options),
8962                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
8963                ),
8964                encoder, offset, _depth
8965            )
8966        }
8967    }
8968    unsafe impl<
8969        T0: fidl::encoding::Encode<
8970                fidl::encoding::BoundedString<4096>,
8971                fidl::encoding::DefaultFuchsiaResourceDialect,
8972            >,
8973        T1: fidl::encoding::Encode<
8974                EnumerateTestCasesOptions,
8975                fidl::encoding::DefaultFuchsiaResourceDialect,
8976            >,
8977        T2: fidl::encoding::Encode<
8978                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>>,
8979                fidl::encoding::DefaultFuchsiaResourceDialect,
8980            >,
8981    >
8982        fidl::encoding::Encode<
8983            TestCaseEnumeratorEnumerateRequest,
8984            fidl::encoding::DefaultFuchsiaResourceDialect,
8985        > for (T0, T1, T2)
8986    {
8987        #[inline]
8988        unsafe fn encode(
8989            self,
8990            encoder: &mut fidl::encoding::Encoder<
8991                '_,
8992                fidl::encoding::DefaultFuchsiaResourceDialect,
8993            >,
8994            offset: usize,
8995            depth: fidl::encoding::Depth,
8996        ) -> fidl::Result<()> {
8997            encoder.debug_check_bounds::<TestCaseEnumeratorEnumerateRequest>(offset);
8998            // Zero out padding regions. There's no need to apply masks
8999            // because the unmasked parts will be overwritten by fields.
9000            unsafe {
9001                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
9002                (ptr as *mut u64).write_unaligned(0);
9003            }
9004            // Write the fields.
9005            self.0.encode(encoder, offset + 0, depth)?;
9006            self.1.encode(encoder, offset + 16, depth)?;
9007            self.2.encode(encoder, offset + 32, depth)?;
9008            Ok(())
9009        }
9010    }
9011
9012    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9013        for TestCaseEnumeratorEnumerateRequest
9014    {
9015        #[inline(always)]
9016        fn new_empty() -> Self {
9017            Self {
9018                test_suite_url: fidl::new_empty!(
9019                    fidl::encoding::BoundedString<4096>,
9020                    fidl::encoding::DefaultFuchsiaResourceDialect
9021                ),
9022                options: fidl::new_empty!(
9023                    EnumerateTestCasesOptions,
9024                    fidl::encoding::DefaultFuchsiaResourceDialect
9025                ),
9026                iterator: fidl::new_empty!(
9027                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>>,
9028                    fidl::encoding::DefaultFuchsiaResourceDialect
9029                ),
9030            }
9031        }
9032
9033        #[inline]
9034        unsafe fn decode(
9035            &mut self,
9036            decoder: &mut fidl::encoding::Decoder<
9037                '_,
9038                fidl::encoding::DefaultFuchsiaResourceDialect,
9039            >,
9040            offset: usize,
9041            _depth: fidl::encoding::Depth,
9042        ) -> fidl::Result<()> {
9043            decoder.debug_check_bounds::<Self>(offset);
9044            // Verify that padding bytes are zero.
9045            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
9046            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9047            let mask = 0xffffffff00000000u64;
9048            let maskedval = padval & mask;
9049            if maskedval != 0 {
9050                return Err(fidl::Error::NonZeroPadding {
9051                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
9052                });
9053            }
9054            fidl::decode!(
9055                fidl::encoding::BoundedString<4096>,
9056                fidl::encoding::DefaultFuchsiaResourceDialect,
9057                &mut self.test_suite_url,
9058                decoder,
9059                offset + 0,
9060                _depth
9061            )?;
9062            fidl::decode!(
9063                EnumerateTestCasesOptions,
9064                fidl::encoding::DefaultFuchsiaResourceDialect,
9065                &mut self.options,
9066                decoder,
9067                offset + 16,
9068                _depth
9069            )?;
9070            fidl::decode!(
9071                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>>,
9072                fidl::encoding::DefaultFuchsiaResourceDialect,
9073                &mut self.iterator,
9074                decoder,
9075                offset + 32,
9076                _depth
9077            )?;
9078            Ok(())
9079        }
9080    }
9081
9082    impl CustomArtifact {
9083        #[inline(always)]
9084        fn max_ordinal_present(&self) -> u64 {
9085            if let Some(_) = self.directory_and_token {
9086                return 2;
9087            }
9088            if let Some(_) = self.component_moniker {
9089                return 1;
9090            }
9091            0
9092        }
9093    }
9094
9095    impl fidl::encoding::ResourceTypeMarker for CustomArtifact {
9096        type Borrowed<'a> = &'a mut Self;
9097        fn take_or_borrow<'a>(
9098            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9099        ) -> Self::Borrowed<'a> {
9100            value
9101        }
9102    }
9103
9104    unsafe impl fidl::encoding::TypeMarker for CustomArtifact {
9105        type Owned = Self;
9106
9107        #[inline(always)]
9108        fn inline_align(_context: fidl::encoding::Context) -> usize {
9109            8
9110        }
9111
9112        #[inline(always)]
9113        fn inline_size(_context: fidl::encoding::Context) -> usize {
9114            16
9115        }
9116    }
9117
9118    unsafe impl
9119        fidl::encoding::Encode<CustomArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
9120        for &mut CustomArtifact
9121    {
9122        unsafe fn encode(
9123            self,
9124            encoder: &mut fidl::encoding::Encoder<
9125                '_,
9126                fidl::encoding::DefaultFuchsiaResourceDialect,
9127            >,
9128            offset: usize,
9129            mut depth: fidl::encoding::Depth,
9130        ) -> fidl::Result<()> {
9131            encoder.debug_check_bounds::<CustomArtifact>(offset);
9132            // Vector header
9133            let max_ordinal: u64 = self.max_ordinal_present();
9134            encoder.write_num(max_ordinal, offset);
9135            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9136            // Calling encoder.out_of_line_offset(0) is not allowed.
9137            if max_ordinal == 0 {
9138                return Ok(());
9139            }
9140            depth.increment()?;
9141            let envelope_size = 8;
9142            let bytes_len = max_ordinal as usize * envelope_size;
9143            #[allow(unused_variables)]
9144            let offset = encoder.out_of_line_offset(bytes_len);
9145            let mut _prev_end_offset: usize = 0;
9146            if 1 > max_ordinal {
9147                return Ok(());
9148            }
9149
9150            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9151            // are envelope_size bytes.
9152            let cur_offset: usize = (1 - 1) * envelope_size;
9153
9154            // Zero reserved fields.
9155            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9156
9157            // Safety:
9158            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9159            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9160            //   envelope_size bytes, there is always sufficient room.
9161            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, fidl::encoding::DefaultFuchsiaResourceDialect>(
9162            self.component_moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
9163            encoder, offset + cur_offset, depth
9164        )?;
9165
9166            _prev_end_offset = cur_offset + envelope_size;
9167            if 2 > max_ordinal {
9168                return Ok(());
9169            }
9170
9171            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9172            // are envelope_size bytes.
9173            let cur_offset: usize = (2 - 1) * envelope_size;
9174
9175            // Zero reserved fields.
9176            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9177
9178            // Safety:
9179            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9180            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9181            //   envelope_size bytes, there is always sufficient room.
9182            fidl::encoding::encode_in_envelope_optional::<
9183                DirectoryAndToken,
9184                fidl::encoding::DefaultFuchsiaResourceDialect,
9185            >(
9186                self.directory_and_token
9187                    .as_mut()
9188                    .map(<DirectoryAndToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9189                encoder,
9190                offset + cur_offset,
9191                depth,
9192            )?;
9193
9194            _prev_end_offset = cur_offset + envelope_size;
9195
9196            Ok(())
9197        }
9198    }
9199
9200    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9201        for CustomArtifact
9202    {
9203        #[inline(always)]
9204        fn new_empty() -> Self {
9205            Self::default()
9206        }
9207
9208        unsafe fn decode(
9209            &mut self,
9210            decoder: &mut fidl::encoding::Decoder<
9211                '_,
9212                fidl::encoding::DefaultFuchsiaResourceDialect,
9213            >,
9214            offset: usize,
9215            mut depth: fidl::encoding::Depth,
9216        ) -> fidl::Result<()> {
9217            decoder.debug_check_bounds::<Self>(offset);
9218            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9219                None => return Err(fidl::Error::NotNullable),
9220                Some(len) => len,
9221            };
9222            // Calling decoder.out_of_line_offset(0) is not allowed.
9223            if len == 0 {
9224                return Ok(());
9225            };
9226            depth.increment()?;
9227            let envelope_size = 8;
9228            let bytes_len = len * envelope_size;
9229            let offset = decoder.out_of_line_offset(bytes_len)?;
9230            // Decode the envelope for each type.
9231            let mut _next_ordinal_to_read = 0;
9232            let mut next_offset = offset;
9233            let end_offset = offset + bytes_len;
9234            _next_ordinal_to_read += 1;
9235            if next_offset >= end_offset {
9236                return Ok(());
9237            }
9238
9239            // Decode unknown envelopes for gaps in ordinals.
9240            while _next_ordinal_to_read < 1 {
9241                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9242                _next_ordinal_to_read += 1;
9243                next_offset += envelope_size;
9244            }
9245
9246            let next_out_of_line = decoder.next_out_of_line();
9247            let handles_before = decoder.remaining_handles();
9248            if let Some((inlined, num_bytes, num_handles)) =
9249                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9250            {
9251                let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9252                if inlined != (member_inline_size <= 4) {
9253                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9254                }
9255                let inner_offset;
9256                let mut inner_depth = depth.clone();
9257                if inlined {
9258                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9259                    inner_offset = next_offset;
9260                } else {
9261                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9262                    inner_depth.increment()?;
9263                }
9264                let val_ref = self.component_moniker.get_or_insert_with(|| {
9265                    fidl::new_empty!(
9266                        fidl::encoding::BoundedString<4096>,
9267                        fidl::encoding::DefaultFuchsiaResourceDialect
9268                    )
9269                });
9270                fidl::decode!(
9271                    fidl::encoding::BoundedString<4096>,
9272                    fidl::encoding::DefaultFuchsiaResourceDialect,
9273                    val_ref,
9274                    decoder,
9275                    inner_offset,
9276                    inner_depth
9277                )?;
9278                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9279                {
9280                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9281                }
9282                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9283                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9284                }
9285            }
9286
9287            next_offset += envelope_size;
9288            _next_ordinal_to_read += 1;
9289            if next_offset >= end_offset {
9290                return Ok(());
9291            }
9292
9293            // Decode unknown envelopes for gaps in ordinals.
9294            while _next_ordinal_to_read < 2 {
9295                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9296                _next_ordinal_to_read += 1;
9297                next_offset += envelope_size;
9298            }
9299
9300            let next_out_of_line = decoder.next_out_of_line();
9301            let handles_before = decoder.remaining_handles();
9302            if let Some((inlined, num_bytes, num_handles)) =
9303                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9304            {
9305                let member_inline_size =
9306                    <DirectoryAndToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9307                if inlined != (member_inline_size <= 4) {
9308                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9309                }
9310                let inner_offset;
9311                let mut inner_depth = depth.clone();
9312                if inlined {
9313                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9314                    inner_offset = next_offset;
9315                } else {
9316                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9317                    inner_depth.increment()?;
9318                }
9319                let val_ref = self.directory_and_token.get_or_insert_with(|| {
9320                    fidl::new_empty!(
9321                        DirectoryAndToken,
9322                        fidl::encoding::DefaultFuchsiaResourceDialect
9323                    )
9324                });
9325                fidl::decode!(
9326                    DirectoryAndToken,
9327                    fidl::encoding::DefaultFuchsiaResourceDialect,
9328                    val_ref,
9329                    decoder,
9330                    inner_offset,
9331                    inner_depth
9332                )?;
9333                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9334                {
9335                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9336                }
9337                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9338                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9339                }
9340            }
9341
9342            next_offset += envelope_size;
9343
9344            // Decode the remaining unknown envelopes.
9345            while next_offset < end_offset {
9346                _next_ordinal_to_read += 1;
9347                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9348                next_offset += envelope_size;
9349            }
9350
9351            Ok(())
9352        }
9353    }
9354
9355    impl DebugData {
9356        #[inline(always)]
9357        fn max_ordinal_present(&self) -> u64 {
9358            if let Some(_) = self.socket {
9359                return 2;
9360            }
9361            if let Some(_) = self.name {
9362                return 1;
9363            }
9364            0
9365        }
9366    }
9367
9368    impl fidl::encoding::ResourceTypeMarker for DebugData {
9369        type Borrowed<'a> = &'a mut Self;
9370        fn take_or_borrow<'a>(
9371            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9372        ) -> Self::Borrowed<'a> {
9373            value
9374        }
9375    }
9376
9377    unsafe impl fidl::encoding::TypeMarker for DebugData {
9378        type Owned = Self;
9379
9380        #[inline(always)]
9381        fn inline_align(_context: fidl::encoding::Context) -> usize {
9382            8
9383        }
9384
9385        #[inline(always)]
9386        fn inline_size(_context: fidl::encoding::Context) -> usize {
9387            16
9388        }
9389    }
9390
9391    unsafe impl fidl::encoding::Encode<DebugData, fidl::encoding::DefaultFuchsiaResourceDialect>
9392        for &mut DebugData
9393    {
9394        unsafe fn encode(
9395            self,
9396            encoder: &mut fidl::encoding::Encoder<
9397                '_,
9398                fidl::encoding::DefaultFuchsiaResourceDialect,
9399            >,
9400            offset: usize,
9401            mut depth: fidl::encoding::Depth,
9402        ) -> fidl::Result<()> {
9403            encoder.debug_check_bounds::<DebugData>(offset);
9404            // Vector header
9405            let max_ordinal: u64 = self.max_ordinal_present();
9406            encoder.write_num(max_ordinal, offset);
9407            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9408            // Calling encoder.out_of_line_offset(0) is not allowed.
9409            if max_ordinal == 0 {
9410                return Ok(());
9411            }
9412            depth.increment()?;
9413            let envelope_size = 8;
9414            let bytes_len = max_ordinal as usize * envelope_size;
9415            #[allow(unused_variables)]
9416            let offset = encoder.out_of_line_offset(bytes_len);
9417            let mut _prev_end_offset: usize = 0;
9418            if 1 > max_ordinal {
9419                return Ok(());
9420            }
9421
9422            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9423            // are envelope_size bytes.
9424            let cur_offset: usize = (1 - 1) * envelope_size;
9425
9426            // Zero reserved fields.
9427            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9428
9429            // Safety:
9430            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9431            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9432            //   envelope_size bytes, there is always sufficient room.
9433            fidl::encoding::encode_in_envelope_optional::<
9434                fidl::encoding::BoundedString<512>,
9435                fidl::encoding::DefaultFuchsiaResourceDialect,
9436            >(
9437                self.name.as_ref().map(
9438                    <fidl::encoding::BoundedString<512> as fidl::encoding::ValueTypeMarker>::borrow,
9439                ),
9440                encoder,
9441                offset + cur_offset,
9442                depth,
9443            )?;
9444
9445            _prev_end_offset = cur_offset + envelope_size;
9446            if 2 > max_ordinal {
9447                return Ok(());
9448            }
9449
9450            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9451            // are envelope_size bytes.
9452            let cur_offset: usize = (2 - 1) * envelope_size;
9453
9454            // Zero reserved fields.
9455            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9456
9457            // Safety:
9458            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9459            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9460            //   envelope_size bytes, there is always sufficient room.
9461            fidl::encoding::encode_in_envelope_optional::<
9462                fidl::encoding::HandleType<
9463                    fidl::Socket,
9464                    { fidl::ObjectType::SOCKET.into_raw() },
9465                    2147483648,
9466                >,
9467                fidl::encoding::DefaultFuchsiaResourceDialect,
9468            >(
9469                self.socket.as_mut().map(
9470                    <fidl::encoding::HandleType<
9471                        fidl::Socket,
9472                        { fidl::ObjectType::SOCKET.into_raw() },
9473                        2147483648,
9474                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
9475                ),
9476                encoder,
9477                offset + cur_offset,
9478                depth,
9479            )?;
9480
9481            _prev_end_offset = cur_offset + envelope_size;
9482
9483            Ok(())
9484        }
9485    }
9486
9487    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DebugData {
9488        #[inline(always)]
9489        fn new_empty() -> Self {
9490            Self::default()
9491        }
9492
9493        unsafe fn decode(
9494            &mut self,
9495            decoder: &mut fidl::encoding::Decoder<
9496                '_,
9497                fidl::encoding::DefaultFuchsiaResourceDialect,
9498            >,
9499            offset: usize,
9500            mut depth: fidl::encoding::Depth,
9501        ) -> fidl::Result<()> {
9502            decoder.debug_check_bounds::<Self>(offset);
9503            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9504                None => return Err(fidl::Error::NotNullable),
9505                Some(len) => len,
9506            };
9507            // Calling decoder.out_of_line_offset(0) is not allowed.
9508            if len == 0 {
9509                return Ok(());
9510            };
9511            depth.increment()?;
9512            let envelope_size = 8;
9513            let bytes_len = len * envelope_size;
9514            let offset = decoder.out_of_line_offset(bytes_len)?;
9515            // Decode the envelope for each type.
9516            let mut _next_ordinal_to_read = 0;
9517            let mut next_offset = offset;
9518            let end_offset = offset + bytes_len;
9519            _next_ordinal_to_read += 1;
9520            if next_offset >= end_offset {
9521                return Ok(());
9522            }
9523
9524            // Decode unknown envelopes for gaps in ordinals.
9525            while _next_ordinal_to_read < 1 {
9526                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9527                _next_ordinal_to_read += 1;
9528                next_offset += envelope_size;
9529            }
9530
9531            let next_out_of_line = decoder.next_out_of_line();
9532            let handles_before = decoder.remaining_handles();
9533            if let Some((inlined, num_bytes, num_handles)) =
9534                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9535            {
9536                let member_inline_size =
9537                    <fidl::encoding::BoundedString<512> as fidl::encoding::TypeMarker>::inline_size(
9538                        decoder.context,
9539                    );
9540                if inlined != (member_inline_size <= 4) {
9541                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9542                }
9543                let inner_offset;
9544                let mut inner_depth = depth.clone();
9545                if inlined {
9546                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9547                    inner_offset = next_offset;
9548                } else {
9549                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9550                    inner_depth.increment()?;
9551                }
9552                let val_ref = self.name.get_or_insert_with(|| {
9553                    fidl::new_empty!(
9554                        fidl::encoding::BoundedString<512>,
9555                        fidl::encoding::DefaultFuchsiaResourceDialect
9556                    )
9557                });
9558                fidl::decode!(
9559                    fidl::encoding::BoundedString<512>,
9560                    fidl::encoding::DefaultFuchsiaResourceDialect,
9561                    val_ref,
9562                    decoder,
9563                    inner_offset,
9564                    inner_depth
9565                )?;
9566                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9567                {
9568                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9569                }
9570                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9571                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9572                }
9573            }
9574
9575            next_offset += envelope_size;
9576            _next_ordinal_to_read += 1;
9577            if next_offset >= end_offset {
9578                return Ok(());
9579            }
9580
9581            // Decode unknown envelopes for gaps in ordinals.
9582            while _next_ordinal_to_read < 2 {
9583                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9584                _next_ordinal_to_read += 1;
9585                next_offset += envelope_size;
9586            }
9587
9588            let next_out_of_line = decoder.next_out_of_line();
9589            let handles_before = decoder.remaining_handles();
9590            if let Some((inlined, num_bytes, num_handles)) =
9591                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9592            {
9593                let member_inline_size = <fidl::encoding::HandleType<
9594                    fidl::Socket,
9595                    { fidl::ObjectType::SOCKET.into_raw() },
9596                    2147483648,
9597                > as fidl::encoding::TypeMarker>::inline_size(
9598                    decoder.context
9599                );
9600                if inlined != (member_inline_size <= 4) {
9601                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9602                }
9603                let inner_offset;
9604                let mut inner_depth = depth.clone();
9605                if inlined {
9606                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9607                    inner_offset = next_offset;
9608                } else {
9609                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9610                    inner_depth.increment()?;
9611                }
9612                let val_ref =
9613                self.socket.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
9614                fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
9615                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9616                {
9617                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9618                }
9619                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9620                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9621                }
9622            }
9623
9624            next_offset += envelope_size;
9625
9626            // Decode the remaining unknown envelopes.
9627            while next_offset < end_offset {
9628                _next_ordinal_to_read += 1;
9629                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9630                next_offset += envelope_size;
9631            }
9632
9633            Ok(())
9634        }
9635    }
9636
9637    impl EnumerateTestCasesOptions {
9638        #[inline(always)]
9639        fn max_ordinal_present(&self) -> u64 {
9640            if let Some(_) = self.realm_options {
9641                return 1;
9642            }
9643            0
9644        }
9645    }
9646
9647    impl fidl::encoding::ResourceTypeMarker for EnumerateTestCasesOptions {
9648        type Borrowed<'a> = &'a mut Self;
9649        fn take_or_borrow<'a>(
9650            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9651        ) -> Self::Borrowed<'a> {
9652            value
9653        }
9654    }
9655
9656    unsafe impl fidl::encoding::TypeMarker for EnumerateTestCasesOptions {
9657        type Owned = Self;
9658
9659        #[inline(always)]
9660        fn inline_align(_context: fidl::encoding::Context) -> usize {
9661            8
9662        }
9663
9664        #[inline(always)]
9665        fn inline_size(_context: fidl::encoding::Context) -> usize {
9666            16
9667        }
9668    }
9669
9670    unsafe impl
9671        fidl::encoding::Encode<
9672            EnumerateTestCasesOptions,
9673            fidl::encoding::DefaultFuchsiaResourceDialect,
9674        > for &mut EnumerateTestCasesOptions
9675    {
9676        unsafe fn encode(
9677            self,
9678            encoder: &mut fidl::encoding::Encoder<
9679                '_,
9680                fidl::encoding::DefaultFuchsiaResourceDialect,
9681            >,
9682            offset: usize,
9683            mut depth: fidl::encoding::Depth,
9684        ) -> fidl::Result<()> {
9685            encoder.debug_check_bounds::<EnumerateTestCasesOptions>(offset);
9686            // Vector header
9687            let max_ordinal: u64 = self.max_ordinal_present();
9688            encoder.write_num(max_ordinal, offset);
9689            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9690            // Calling encoder.out_of_line_offset(0) is not allowed.
9691            if max_ordinal == 0 {
9692                return Ok(());
9693            }
9694            depth.increment()?;
9695            let envelope_size = 8;
9696            let bytes_len = max_ordinal as usize * envelope_size;
9697            #[allow(unused_variables)]
9698            let offset = encoder.out_of_line_offset(bytes_len);
9699            let mut _prev_end_offset: usize = 0;
9700            if 1 > max_ordinal {
9701                return Ok(());
9702            }
9703
9704            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9705            // are envelope_size bytes.
9706            let cur_offset: usize = (1 - 1) * envelope_size;
9707
9708            // Zero reserved fields.
9709            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9710
9711            // Safety:
9712            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9713            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9714            //   envelope_size bytes, there is always sufficient room.
9715            fidl::encoding::encode_in_envelope_optional::<
9716                RealmOptions,
9717                fidl::encoding::DefaultFuchsiaResourceDialect,
9718            >(
9719                self.realm_options
9720                    .as_mut()
9721                    .map(<RealmOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9722                encoder,
9723                offset + cur_offset,
9724                depth,
9725            )?;
9726
9727            _prev_end_offset = cur_offset + envelope_size;
9728
9729            Ok(())
9730        }
9731    }
9732
9733    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9734        for EnumerateTestCasesOptions
9735    {
9736        #[inline(always)]
9737        fn new_empty() -> Self {
9738            Self::default()
9739        }
9740
9741        unsafe fn decode(
9742            &mut self,
9743            decoder: &mut fidl::encoding::Decoder<
9744                '_,
9745                fidl::encoding::DefaultFuchsiaResourceDialect,
9746            >,
9747            offset: usize,
9748            mut depth: fidl::encoding::Depth,
9749        ) -> fidl::Result<()> {
9750            decoder.debug_check_bounds::<Self>(offset);
9751            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9752                None => return Err(fidl::Error::NotNullable),
9753                Some(len) => len,
9754            };
9755            // Calling decoder.out_of_line_offset(0) is not allowed.
9756            if len == 0 {
9757                return Ok(());
9758            };
9759            depth.increment()?;
9760            let envelope_size = 8;
9761            let bytes_len = len * envelope_size;
9762            let offset = decoder.out_of_line_offset(bytes_len)?;
9763            // Decode the envelope for each type.
9764            let mut _next_ordinal_to_read = 0;
9765            let mut next_offset = offset;
9766            let end_offset = offset + bytes_len;
9767            _next_ordinal_to_read += 1;
9768            if next_offset >= end_offset {
9769                return Ok(());
9770            }
9771
9772            // Decode unknown envelopes for gaps in ordinals.
9773            while _next_ordinal_to_read < 1 {
9774                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9775                _next_ordinal_to_read += 1;
9776                next_offset += envelope_size;
9777            }
9778
9779            let next_out_of_line = decoder.next_out_of_line();
9780            let handles_before = decoder.remaining_handles();
9781            if let Some((inlined, num_bytes, num_handles)) =
9782                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9783            {
9784                let member_inline_size =
9785                    <RealmOptions as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9786                if inlined != (member_inline_size <= 4) {
9787                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9788                }
9789                let inner_offset;
9790                let mut inner_depth = depth.clone();
9791                if inlined {
9792                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9793                    inner_offset = next_offset;
9794                } else {
9795                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9796                    inner_depth.increment()?;
9797                }
9798                let val_ref = self.realm_options.get_or_insert_with(|| {
9799                    fidl::new_empty!(RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect)
9800                });
9801                fidl::decode!(
9802                    RealmOptions,
9803                    fidl::encoding::DefaultFuchsiaResourceDialect,
9804                    val_ref,
9805                    decoder,
9806                    inner_offset,
9807                    inner_depth
9808                )?;
9809                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9810                {
9811                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9812                }
9813                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9814                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9815                }
9816            }
9817
9818            next_offset += envelope_size;
9819
9820            // Decode the remaining unknown envelopes.
9821            while next_offset < end_offset {
9822                _next_ordinal_to_read += 1;
9823                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9824                next_offset += envelope_size;
9825            }
9826
9827            Ok(())
9828        }
9829    }
9830
9831    impl Event {
9832        #[inline(always)]
9833        fn max_ordinal_present(&self) -> u64 {
9834            if let Some(_) = self.details {
9835                return 2;
9836            }
9837            if let Some(_) = self.timestamp {
9838                return 1;
9839            }
9840            0
9841        }
9842    }
9843
9844    impl fidl::encoding::ResourceTypeMarker for Event {
9845        type Borrowed<'a> = &'a mut Self;
9846        fn take_or_borrow<'a>(
9847            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9848        ) -> Self::Borrowed<'a> {
9849            value
9850        }
9851    }
9852
9853    unsafe impl fidl::encoding::TypeMarker for Event {
9854        type Owned = Self;
9855
9856        #[inline(always)]
9857        fn inline_align(_context: fidl::encoding::Context) -> usize {
9858            8
9859        }
9860
9861        #[inline(always)]
9862        fn inline_size(_context: fidl::encoding::Context) -> usize {
9863            16
9864        }
9865    }
9866
9867    unsafe impl fidl::encoding::Encode<Event, fidl::encoding::DefaultFuchsiaResourceDialect>
9868        for &mut Event
9869    {
9870        unsafe fn encode(
9871            self,
9872            encoder: &mut fidl::encoding::Encoder<
9873                '_,
9874                fidl::encoding::DefaultFuchsiaResourceDialect,
9875            >,
9876            offset: usize,
9877            mut depth: fidl::encoding::Depth,
9878        ) -> fidl::Result<()> {
9879            encoder.debug_check_bounds::<Event>(offset);
9880            // Vector header
9881            let max_ordinal: u64 = self.max_ordinal_present();
9882            encoder.write_num(max_ordinal, offset);
9883            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9884            // Calling encoder.out_of_line_offset(0) is not allowed.
9885            if max_ordinal == 0 {
9886                return Ok(());
9887            }
9888            depth.increment()?;
9889            let envelope_size = 8;
9890            let bytes_len = max_ordinal as usize * envelope_size;
9891            #[allow(unused_variables)]
9892            let offset = encoder.out_of_line_offset(bytes_len);
9893            let mut _prev_end_offset: usize = 0;
9894            if 1 > max_ordinal {
9895                return Ok(());
9896            }
9897
9898            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9899            // are envelope_size bytes.
9900            let cur_offset: usize = (1 - 1) * envelope_size;
9901
9902            // Zero reserved fields.
9903            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9904
9905            // Safety:
9906            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9907            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9908            //   envelope_size bytes, there is always sufficient room.
9909            fidl::encoding::encode_in_envelope_optional::<
9910                i64,
9911                fidl::encoding::DefaultFuchsiaResourceDialect,
9912            >(
9913                self.timestamp.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
9914                encoder,
9915                offset + cur_offset,
9916                depth,
9917            )?;
9918
9919            _prev_end_offset = cur_offset + envelope_size;
9920            if 2 > max_ordinal {
9921                return Ok(());
9922            }
9923
9924            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9925            // are envelope_size bytes.
9926            let cur_offset: usize = (2 - 1) * envelope_size;
9927
9928            // Zero reserved fields.
9929            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9930
9931            // Safety:
9932            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9933            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9934            //   envelope_size bytes, there is always sufficient room.
9935            fidl::encoding::encode_in_envelope_optional::<
9936                EventDetails,
9937                fidl::encoding::DefaultFuchsiaResourceDialect,
9938            >(
9939                self.details
9940                    .as_mut()
9941                    .map(<EventDetails as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9942                encoder,
9943                offset + cur_offset,
9944                depth,
9945            )?;
9946
9947            _prev_end_offset = cur_offset + envelope_size;
9948
9949            Ok(())
9950        }
9951    }
9952
9953    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Event {
9954        #[inline(always)]
9955        fn new_empty() -> Self {
9956            Self::default()
9957        }
9958
9959        unsafe fn decode(
9960            &mut self,
9961            decoder: &mut fidl::encoding::Decoder<
9962                '_,
9963                fidl::encoding::DefaultFuchsiaResourceDialect,
9964            >,
9965            offset: usize,
9966            mut depth: fidl::encoding::Depth,
9967        ) -> fidl::Result<()> {
9968            decoder.debug_check_bounds::<Self>(offset);
9969            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9970                None => return Err(fidl::Error::NotNullable),
9971                Some(len) => len,
9972            };
9973            // Calling decoder.out_of_line_offset(0) is not allowed.
9974            if len == 0 {
9975                return Ok(());
9976            };
9977            depth.increment()?;
9978            let envelope_size = 8;
9979            let bytes_len = len * envelope_size;
9980            let offset = decoder.out_of_line_offset(bytes_len)?;
9981            // Decode the envelope for each type.
9982            let mut _next_ordinal_to_read = 0;
9983            let mut next_offset = offset;
9984            let end_offset = offset + bytes_len;
9985            _next_ordinal_to_read += 1;
9986            if next_offset >= end_offset {
9987                return Ok(());
9988            }
9989
9990            // Decode unknown envelopes for gaps in ordinals.
9991            while _next_ordinal_to_read < 1 {
9992                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9993                _next_ordinal_to_read += 1;
9994                next_offset += envelope_size;
9995            }
9996
9997            let next_out_of_line = decoder.next_out_of_line();
9998            let handles_before = decoder.remaining_handles();
9999            if let Some((inlined, num_bytes, num_handles)) =
10000                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10001            {
10002                let member_inline_size =
10003                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10004                if inlined != (member_inline_size <= 4) {
10005                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10006                }
10007                let inner_offset;
10008                let mut inner_depth = depth.clone();
10009                if inlined {
10010                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10011                    inner_offset = next_offset;
10012                } else {
10013                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10014                    inner_depth.increment()?;
10015                }
10016                let val_ref = self.timestamp.get_or_insert_with(|| {
10017                    fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
10018                });
10019                fidl::decode!(
10020                    i64,
10021                    fidl::encoding::DefaultFuchsiaResourceDialect,
10022                    val_ref,
10023                    decoder,
10024                    inner_offset,
10025                    inner_depth
10026                )?;
10027                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10028                {
10029                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10030                }
10031                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10032                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10033                }
10034            }
10035
10036            next_offset += envelope_size;
10037            _next_ordinal_to_read += 1;
10038            if next_offset >= end_offset {
10039                return Ok(());
10040            }
10041
10042            // Decode unknown envelopes for gaps in ordinals.
10043            while _next_ordinal_to_read < 2 {
10044                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10045                _next_ordinal_to_read += 1;
10046                next_offset += envelope_size;
10047            }
10048
10049            let next_out_of_line = decoder.next_out_of_line();
10050            let handles_before = decoder.remaining_handles();
10051            if let Some((inlined, num_bytes, num_handles)) =
10052                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10053            {
10054                let member_inline_size =
10055                    <EventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10056                if inlined != (member_inline_size <= 4) {
10057                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10058                }
10059                let inner_offset;
10060                let mut inner_depth = depth.clone();
10061                if inlined {
10062                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10063                    inner_offset = next_offset;
10064                } else {
10065                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10066                    inner_depth.increment()?;
10067                }
10068                let val_ref = self.details.get_or_insert_with(|| {
10069                    fidl::new_empty!(EventDetails, fidl::encoding::DefaultFuchsiaResourceDialect)
10070                });
10071                fidl::decode!(
10072                    EventDetails,
10073                    fidl::encoding::DefaultFuchsiaResourceDialect,
10074                    val_ref,
10075                    decoder,
10076                    inner_offset,
10077                    inner_depth
10078                )?;
10079                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10080                {
10081                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10082                }
10083                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10084                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10085                }
10086            }
10087
10088            next_offset += envelope_size;
10089
10090            // Decode the remaining unknown envelopes.
10091            while next_offset < end_offset {
10092                _next_ordinal_to_read += 1;
10093                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10094                next_offset += envelope_size;
10095            }
10096
10097            Ok(())
10098        }
10099    }
10100
10101    impl RealmOptions {
10102        #[inline(always)]
10103        fn max_ordinal_present(&self) -> u64 {
10104            if let Some(_) = self.test_collection {
10105                return 3;
10106            }
10107            if let Some(_) = self.offers {
10108                return 2;
10109            }
10110            if let Some(_) = self.realm {
10111                return 1;
10112            }
10113            0
10114        }
10115    }
10116
10117    impl fidl::encoding::ResourceTypeMarker for RealmOptions {
10118        type Borrowed<'a> = &'a mut Self;
10119        fn take_or_borrow<'a>(
10120            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10121        ) -> Self::Borrowed<'a> {
10122            value
10123        }
10124    }
10125
10126    unsafe impl fidl::encoding::TypeMarker for RealmOptions {
10127        type Owned = Self;
10128
10129        #[inline(always)]
10130        fn inline_align(_context: fidl::encoding::Context) -> usize {
10131            8
10132        }
10133
10134        #[inline(always)]
10135        fn inline_size(_context: fidl::encoding::Context) -> usize {
10136            16
10137        }
10138    }
10139
10140    unsafe impl fidl::encoding::Encode<RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect>
10141        for &mut RealmOptions
10142    {
10143        unsafe fn encode(
10144            self,
10145            encoder: &mut fidl::encoding::Encoder<
10146                '_,
10147                fidl::encoding::DefaultFuchsiaResourceDialect,
10148            >,
10149            offset: usize,
10150            mut depth: fidl::encoding::Depth,
10151        ) -> fidl::Result<()> {
10152            encoder.debug_check_bounds::<RealmOptions>(offset);
10153            // Vector header
10154            let max_ordinal: u64 = self.max_ordinal_present();
10155            encoder.write_num(max_ordinal, offset);
10156            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10157            // Calling encoder.out_of_line_offset(0) is not allowed.
10158            if max_ordinal == 0 {
10159                return Ok(());
10160            }
10161            depth.increment()?;
10162            let envelope_size = 8;
10163            let bytes_len = max_ordinal as usize * envelope_size;
10164            #[allow(unused_variables)]
10165            let offset = encoder.out_of_line_offset(bytes_len);
10166            let mut _prev_end_offset: usize = 0;
10167            if 1 > max_ordinal {
10168                return Ok(());
10169            }
10170
10171            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10172            // are envelope_size bytes.
10173            let cur_offset: usize = (1 - 1) * envelope_size;
10174
10175            // Zero reserved fields.
10176            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10177
10178            // Safety:
10179            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10180            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10181            //   envelope_size bytes, there is always sufficient room.
10182            fidl::encoding::encode_in_envelope_optional::<
10183                fidl::encoding::Endpoint<
10184                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
10185                >,
10186                fidl::encoding::DefaultFuchsiaResourceDialect,
10187            >(
10188                self.realm.as_mut().map(
10189                    <fidl::encoding::Endpoint<
10190                        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
10191                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
10192                ),
10193                encoder,
10194                offset + cur_offset,
10195                depth,
10196            )?;
10197
10198            _prev_end_offset = cur_offset + envelope_size;
10199            if 2 > max_ordinal {
10200                return Ok(());
10201            }
10202
10203            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10204            // are envelope_size bytes.
10205            let cur_offset: usize = (2 - 1) * envelope_size;
10206
10207            // Zero reserved fields.
10208            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10209
10210            // Safety:
10211            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10212            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10213            //   envelope_size bytes, there is always sufficient room.
10214            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect>(
10215            self.offers.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024> as fidl::encoding::ValueTypeMarker>::borrow),
10216            encoder, offset + cur_offset, depth
10217        )?;
10218
10219            _prev_end_offset = cur_offset + envelope_size;
10220            if 3 > max_ordinal {
10221                return Ok(());
10222            }
10223
10224            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10225            // are envelope_size bytes.
10226            let cur_offset: usize = (3 - 1) * envelope_size;
10227
10228            // Zero reserved fields.
10229            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10230
10231            // Safety:
10232            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10233            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10234            //   envelope_size bytes, there is always sufficient room.
10235            fidl::encoding::encode_in_envelope_optional::<
10236                fidl::encoding::BoundedString<255>,
10237                fidl::encoding::DefaultFuchsiaResourceDialect,
10238            >(
10239                self.test_collection.as_ref().map(
10240                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
10241                ),
10242                encoder,
10243                offset + cur_offset,
10244                depth,
10245            )?;
10246
10247            _prev_end_offset = cur_offset + envelope_size;
10248
10249            Ok(())
10250        }
10251    }
10252
10253    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RealmOptions {
10254        #[inline(always)]
10255        fn new_empty() -> Self {
10256            Self::default()
10257        }
10258
10259        unsafe fn decode(
10260            &mut self,
10261            decoder: &mut fidl::encoding::Decoder<
10262                '_,
10263                fidl::encoding::DefaultFuchsiaResourceDialect,
10264            >,
10265            offset: usize,
10266            mut depth: fidl::encoding::Depth,
10267        ) -> fidl::Result<()> {
10268            decoder.debug_check_bounds::<Self>(offset);
10269            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10270                None => return Err(fidl::Error::NotNullable),
10271                Some(len) => len,
10272            };
10273            // Calling decoder.out_of_line_offset(0) is not allowed.
10274            if len == 0 {
10275                return Ok(());
10276            };
10277            depth.increment()?;
10278            let envelope_size = 8;
10279            let bytes_len = len * envelope_size;
10280            let offset = decoder.out_of_line_offset(bytes_len)?;
10281            // Decode the envelope for each type.
10282            let mut _next_ordinal_to_read = 0;
10283            let mut next_offset = offset;
10284            let end_offset = offset + bytes_len;
10285            _next_ordinal_to_read += 1;
10286            if next_offset >= end_offset {
10287                return Ok(());
10288            }
10289
10290            // Decode unknown envelopes for gaps in ordinals.
10291            while _next_ordinal_to_read < 1 {
10292                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10293                _next_ordinal_to_read += 1;
10294                next_offset += envelope_size;
10295            }
10296
10297            let next_out_of_line = decoder.next_out_of_line();
10298            let handles_before = decoder.remaining_handles();
10299            if let Some((inlined, num_bytes, num_handles)) =
10300                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10301            {
10302                let member_inline_size = <fidl::encoding::Endpoint<
10303                    fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
10304                > as fidl::encoding::TypeMarker>::inline_size(
10305                    decoder.context
10306                );
10307                if inlined != (member_inline_size <= 4) {
10308                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10309                }
10310                let inner_offset;
10311                let mut inner_depth = depth.clone();
10312                if inlined {
10313                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10314                    inner_offset = next_offset;
10315                } else {
10316                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10317                    inner_depth.increment()?;
10318                }
10319                let val_ref = self.realm.get_or_insert_with(|| {
10320                    fidl::new_empty!(
10321                        fidl::encoding::Endpoint<
10322                            fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
10323                        >,
10324                        fidl::encoding::DefaultFuchsiaResourceDialect
10325                    )
10326                });
10327                fidl::decode!(
10328                    fidl::encoding::Endpoint<
10329                        fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
10330                    >,
10331                    fidl::encoding::DefaultFuchsiaResourceDialect,
10332                    val_ref,
10333                    decoder,
10334                    inner_offset,
10335                    inner_depth
10336                )?;
10337                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10338                {
10339                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10340                }
10341                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10342                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10343                }
10344            }
10345
10346            next_offset += envelope_size;
10347            _next_ordinal_to_read += 1;
10348            if next_offset >= end_offset {
10349                return Ok(());
10350            }
10351
10352            // Decode unknown envelopes for gaps in ordinals.
10353            while _next_ordinal_to_read < 2 {
10354                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10355                _next_ordinal_to_read += 1;
10356                next_offset += envelope_size;
10357            }
10358
10359            let next_out_of_line = decoder.next_out_of_line();
10360            let handles_before = decoder.remaining_handles();
10361            if let Some((inlined, num_bytes, num_handles)) =
10362                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10363            {
10364                let member_inline_size = <fidl::encoding::Vector<
10365                    fidl_fuchsia_component_decl::Offer,
10366                    1024,
10367                > as fidl::encoding::TypeMarker>::inline_size(
10368                    decoder.context
10369                );
10370                if inlined != (member_inline_size <= 4) {
10371                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10372                }
10373                let inner_offset;
10374                let mut inner_depth = depth.clone();
10375                if inlined {
10376                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10377                    inner_offset = next_offset;
10378                } else {
10379                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10380                    inner_depth.increment()?;
10381                }
10382                let val_ref =
10383                self.offers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect));
10384                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
10385                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10386                {
10387                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10388                }
10389                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10390                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10391                }
10392            }
10393
10394            next_offset += envelope_size;
10395            _next_ordinal_to_read += 1;
10396            if next_offset >= end_offset {
10397                return Ok(());
10398            }
10399
10400            // Decode unknown envelopes for gaps in ordinals.
10401            while _next_ordinal_to_read < 3 {
10402                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10403                _next_ordinal_to_read += 1;
10404                next_offset += envelope_size;
10405            }
10406
10407            let next_out_of_line = decoder.next_out_of_line();
10408            let handles_before = decoder.remaining_handles();
10409            if let Some((inlined, num_bytes, num_handles)) =
10410                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10411            {
10412                let member_inline_size =
10413                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
10414                        decoder.context,
10415                    );
10416                if inlined != (member_inline_size <= 4) {
10417                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10418                }
10419                let inner_offset;
10420                let mut inner_depth = depth.clone();
10421                if inlined {
10422                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10423                    inner_offset = next_offset;
10424                } else {
10425                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10426                    inner_depth.increment()?;
10427                }
10428                let val_ref = self.test_collection.get_or_insert_with(|| {
10429                    fidl::new_empty!(
10430                        fidl::encoding::BoundedString<255>,
10431                        fidl::encoding::DefaultFuchsiaResourceDialect
10432                    )
10433                });
10434                fidl::decode!(
10435                    fidl::encoding::BoundedString<255>,
10436                    fidl::encoding::DefaultFuchsiaResourceDialect,
10437                    val_ref,
10438                    decoder,
10439                    inner_offset,
10440                    inner_depth
10441                )?;
10442                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10443                {
10444                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10445                }
10446                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10447                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10448                }
10449            }
10450
10451            next_offset += envelope_size;
10452
10453            // Decode the remaining unknown envelopes.
10454            while next_offset < end_offset {
10455                _next_ordinal_to_read += 1;
10456                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10457                next_offset += envelope_size;
10458            }
10459
10460            Ok(())
10461        }
10462    }
10463
10464    impl RunEvent {
10465        #[inline(always)]
10466        fn max_ordinal_present(&self) -> u64 {
10467            if let Some(_) = self.payload {
10468                return 2;
10469            }
10470            if let Some(_) = self.timestamp {
10471                return 1;
10472            }
10473            0
10474        }
10475    }
10476
10477    impl fidl::encoding::ResourceTypeMarker for RunEvent {
10478        type Borrowed<'a> = &'a mut Self;
10479        fn take_or_borrow<'a>(
10480            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10481        ) -> Self::Borrowed<'a> {
10482            value
10483        }
10484    }
10485
10486    unsafe impl fidl::encoding::TypeMarker for RunEvent {
10487        type Owned = Self;
10488
10489        #[inline(always)]
10490        fn inline_align(_context: fidl::encoding::Context) -> usize {
10491            8
10492        }
10493
10494        #[inline(always)]
10495        fn inline_size(_context: fidl::encoding::Context) -> usize {
10496            16
10497        }
10498    }
10499
10500    unsafe impl fidl::encoding::Encode<RunEvent, fidl::encoding::DefaultFuchsiaResourceDialect>
10501        for &mut RunEvent
10502    {
10503        unsafe fn encode(
10504            self,
10505            encoder: &mut fidl::encoding::Encoder<
10506                '_,
10507                fidl::encoding::DefaultFuchsiaResourceDialect,
10508            >,
10509            offset: usize,
10510            mut depth: fidl::encoding::Depth,
10511        ) -> fidl::Result<()> {
10512            encoder.debug_check_bounds::<RunEvent>(offset);
10513            // Vector header
10514            let max_ordinal: u64 = self.max_ordinal_present();
10515            encoder.write_num(max_ordinal, offset);
10516            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10517            // Calling encoder.out_of_line_offset(0) is not allowed.
10518            if max_ordinal == 0 {
10519                return Ok(());
10520            }
10521            depth.increment()?;
10522            let envelope_size = 8;
10523            let bytes_len = max_ordinal as usize * envelope_size;
10524            #[allow(unused_variables)]
10525            let offset = encoder.out_of_line_offset(bytes_len);
10526            let mut _prev_end_offset: usize = 0;
10527            if 1 > max_ordinal {
10528                return Ok(());
10529            }
10530
10531            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10532            // are envelope_size bytes.
10533            let cur_offset: usize = (1 - 1) * envelope_size;
10534
10535            // Zero reserved fields.
10536            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10537
10538            // Safety:
10539            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10540            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10541            //   envelope_size bytes, there is always sufficient room.
10542            fidl::encoding::encode_in_envelope_optional::<
10543                i64,
10544                fidl::encoding::DefaultFuchsiaResourceDialect,
10545            >(
10546                self.timestamp.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
10547                encoder,
10548                offset + cur_offset,
10549                depth,
10550            )?;
10551
10552            _prev_end_offset = cur_offset + envelope_size;
10553            if 2 > max_ordinal {
10554                return Ok(());
10555            }
10556
10557            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10558            // are envelope_size bytes.
10559            let cur_offset: usize = (2 - 1) * envelope_size;
10560
10561            // Zero reserved fields.
10562            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10563
10564            // Safety:
10565            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10566            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10567            //   envelope_size bytes, there is always sufficient room.
10568            fidl::encoding::encode_in_envelope_optional::<
10569                RunEventPayload,
10570                fidl::encoding::DefaultFuchsiaResourceDialect,
10571            >(
10572                self.payload
10573                    .as_mut()
10574                    .map(<RunEventPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10575                encoder,
10576                offset + cur_offset,
10577                depth,
10578            )?;
10579
10580            _prev_end_offset = cur_offset + envelope_size;
10581
10582            Ok(())
10583        }
10584    }
10585
10586    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RunEvent {
10587        #[inline(always)]
10588        fn new_empty() -> Self {
10589            Self::default()
10590        }
10591
10592        unsafe fn decode(
10593            &mut self,
10594            decoder: &mut fidl::encoding::Decoder<
10595                '_,
10596                fidl::encoding::DefaultFuchsiaResourceDialect,
10597            >,
10598            offset: usize,
10599            mut depth: fidl::encoding::Depth,
10600        ) -> fidl::Result<()> {
10601            decoder.debug_check_bounds::<Self>(offset);
10602            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10603                None => return Err(fidl::Error::NotNullable),
10604                Some(len) => len,
10605            };
10606            // Calling decoder.out_of_line_offset(0) is not allowed.
10607            if len == 0 {
10608                return Ok(());
10609            };
10610            depth.increment()?;
10611            let envelope_size = 8;
10612            let bytes_len = len * envelope_size;
10613            let offset = decoder.out_of_line_offset(bytes_len)?;
10614            // Decode the envelope for each type.
10615            let mut _next_ordinal_to_read = 0;
10616            let mut next_offset = offset;
10617            let end_offset = offset + bytes_len;
10618            _next_ordinal_to_read += 1;
10619            if next_offset >= end_offset {
10620                return Ok(());
10621            }
10622
10623            // Decode unknown envelopes for gaps in ordinals.
10624            while _next_ordinal_to_read < 1 {
10625                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10626                _next_ordinal_to_read += 1;
10627                next_offset += envelope_size;
10628            }
10629
10630            let next_out_of_line = decoder.next_out_of_line();
10631            let handles_before = decoder.remaining_handles();
10632            if let Some((inlined, num_bytes, num_handles)) =
10633                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10634            {
10635                let member_inline_size =
10636                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10637                if inlined != (member_inline_size <= 4) {
10638                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10639                }
10640                let inner_offset;
10641                let mut inner_depth = depth.clone();
10642                if inlined {
10643                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10644                    inner_offset = next_offset;
10645                } else {
10646                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10647                    inner_depth.increment()?;
10648                }
10649                let val_ref = self.timestamp.get_or_insert_with(|| {
10650                    fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
10651                });
10652                fidl::decode!(
10653                    i64,
10654                    fidl::encoding::DefaultFuchsiaResourceDialect,
10655                    val_ref,
10656                    decoder,
10657                    inner_offset,
10658                    inner_depth
10659                )?;
10660                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10661                {
10662                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10663                }
10664                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10665                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10666                }
10667            }
10668
10669            next_offset += envelope_size;
10670            _next_ordinal_to_read += 1;
10671            if next_offset >= end_offset {
10672                return Ok(());
10673            }
10674
10675            // Decode unknown envelopes for gaps in ordinals.
10676            while _next_ordinal_to_read < 2 {
10677                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10678                _next_ordinal_to_read += 1;
10679                next_offset += envelope_size;
10680            }
10681
10682            let next_out_of_line = decoder.next_out_of_line();
10683            let handles_before = decoder.remaining_handles();
10684            if let Some((inlined, num_bytes, num_handles)) =
10685                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10686            {
10687                let member_inline_size =
10688                    <RunEventPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10689                if inlined != (member_inline_size <= 4) {
10690                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10691                }
10692                let inner_offset;
10693                let mut inner_depth = depth.clone();
10694                if inlined {
10695                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10696                    inner_offset = next_offset;
10697                } else {
10698                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10699                    inner_depth.increment()?;
10700                }
10701                let val_ref = self.payload.get_or_insert_with(|| {
10702                    fidl::new_empty!(RunEventPayload, fidl::encoding::DefaultFuchsiaResourceDialect)
10703                });
10704                fidl::decode!(
10705                    RunEventPayload,
10706                    fidl::encoding::DefaultFuchsiaResourceDialect,
10707                    val_ref,
10708                    decoder,
10709                    inner_offset,
10710                    inner_depth
10711                )?;
10712                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10713                {
10714                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10715                }
10716                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10717                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10718                }
10719            }
10720
10721            next_offset += envelope_size;
10722
10723            // Decode the remaining unknown envelopes.
10724            while next_offset < end_offset {
10725                _next_ordinal_to_read += 1;
10726                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10727                next_offset += envelope_size;
10728            }
10729
10730            Ok(())
10731        }
10732    }
10733
10734    impl RunSuiteOptions {
10735        #[inline(always)]
10736        fn max_ordinal_present(&self) -> u64 {
10737            if let Some(_) = self.break_on_failure {
10738                return 11;
10739            }
10740            if let Some(_) = self.no_exception_channel {
10741                return 10;
10742            }
10743            if let Some(_) = self.accumulate_debug_data {
10744                return 9;
10745            }
10746            if let Some(_) = self.log_interest {
10747                return 8;
10748            }
10749            if let Some(_) = self.logs_iterator_type {
10750                return 7;
10751            }
10752            if let Some(_) = self.test_case_filters {
10753                return 6;
10754            }
10755            if let Some(_) = self.timeout {
10756                return 5;
10757            }
10758            if let Some(_) = self.arguments {
10759                return 4;
10760            }
10761            if let Some(_) = self.max_concurrent_test_case_runs {
10762                return 3;
10763            }
10764            if let Some(_) = self.run_disabled_tests {
10765                return 2;
10766            }
10767            if let Some(_) = self.realm_options {
10768                return 1;
10769            }
10770            0
10771        }
10772    }
10773
10774    impl fidl::encoding::ResourceTypeMarker for RunSuiteOptions {
10775        type Borrowed<'a> = &'a mut Self;
10776        fn take_or_borrow<'a>(
10777            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10778        ) -> Self::Borrowed<'a> {
10779            value
10780        }
10781    }
10782
10783    unsafe impl fidl::encoding::TypeMarker for RunSuiteOptions {
10784        type Owned = Self;
10785
10786        #[inline(always)]
10787        fn inline_align(_context: fidl::encoding::Context) -> usize {
10788            8
10789        }
10790
10791        #[inline(always)]
10792        fn inline_size(_context: fidl::encoding::Context) -> usize {
10793            16
10794        }
10795    }
10796
10797    unsafe impl
10798        fidl::encoding::Encode<RunSuiteOptions, fidl::encoding::DefaultFuchsiaResourceDialect>
10799        for &mut RunSuiteOptions
10800    {
10801        unsafe fn encode(
10802            self,
10803            encoder: &mut fidl::encoding::Encoder<
10804                '_,
10805                fidl::encoding::DefaultFuchsiaResourceDialect,
10806            >,
10807            offset: usize,
10808            mut depth: fidl::encoding::Depth,
10809        ) -> fidl::Result<()> {
10810            encoder.debug_check_bounds::<RunSuiteOptions>(offset);
10811            // Vector header
10812            let max_ordinal: u64 = self.max_ordinal_present();
10813            encoder.write_num(max_ordinal, offset);
10814            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10815            // Calling encoder.out_of_line_offset(0) is not allowed.
10816            if max_ordinal == 0 {
10817                return Ok(());
10818            }
10819            depth.increment()?;
10820            let envelope_size = 8;
10821            let bytes_len = max_ordinal as usize * envelope_size;
10822            #[allow(unused_variables)]
10823            let offset = encoder.out_of_line_offset(bytes_len);
10824            let mut _prev_end_offset: usize = 0;
10825            if 1 > max_ordinal {
10826                return Ok(());
10827            }
10828
10829            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10830            // are envelope_size bytes.
10831            let cur_offset: usize = (1 - 1) * envelope_size;
10832
10833            // Zero reserved fields.
10834            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10835
10836            // Safety:
10837            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10838            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10839            //   envelope_size bytes, there is always sufficient room.
10840            fidl::encoding::encode_in_envelope_optional::<
10841                RealmOptions,
10842                fidl::encoding::DefaultFuchsiaResourceDialect,
10843            >(
10844                self.realm_options
10845                    .as_mut()
10846                    .map(<RealmOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10847                encoder,
10848                offset + cur_offset,
10849                depth,
10850            )?;
10851
10852            _prev_end_offset = cur_offset + envelope_size;
10853            if 2 > max_ordinal {
10854                return Ok(());
10855            }
10856
10857            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10858            // are envelope_size bytes.
10859            let cur_offset: usize = (2 - 1) * envelope_size;
10860
10861            // Zero reserved fields.
10862            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10863
10864            // Safety:
10865            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10866            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10867            //   envelope_size bytes, there is always sufficient room.
10868            fidl::encoding::encode_in_envelope_optional::<
10869                bool,
10870                fidl::encoding::DefaultFuchsiaResourceDialect,
10871            >(
10872                self.run_disabled_tests
10873                    .as_ref()
10874                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10875                encoder,
10876                offset + cur_offset,
10877                depth,
10878            )?;
10879
10880            _prev_end_offset = cur_offset + envelope_size;
10881            if 3 > max_ordinal {
10882                return Ok(());
10883            }
10884
10885            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10886            // are envelope_size bytes.
10887            let cur_offset: usize = (3 - 1) * envelope_size;
10888
10889            // Zero reserved fields.
10890            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10891
10892            // Safety:
10893            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10894            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10895            //   envelope_size bytes, there is always sufficient room.
10896            fidl::encoding::encode_in_envelope_optional::<
10897                u16,
10898                fidl::encoding::DefaultFuchsiaResourceDialect,
10899            >(
10900                self.max_concurrent_test_case_runs
10901                    .as_ref()
10902                    .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
10903                encoder,
10904                offset + cur_offset,
10905                depth,
10906            )?;
10907
10908            _prev_end_offset = cur_offset + envelope_size;
10909            if 4 > max_ordinal {
10910                return Ok(());
10911            }
10912
10913            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10914            // are envelope_size bytes.
10915            let cur_offset: usize = (4 - 1) * envelope_size;
10916
10917            // Zero reserved fields.
10918            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10919
10920            // Safety:
10921            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10922            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10923            //   envelope_size bytes, there is always sufficient room.
10924            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<16384>, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
10925            self.arguments.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<16384>, 4095> as fidl::encoding::ValueTypeMarker>::borrow),
10926            encoder, offset + cur_offset, depth
10927        )?;
10928
10929            _prev_end_offset = cur_offset + envelope_size;
10930            if 5 > max_ordinal {
10931                return Ok(());
10932            }
10933
10934            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10935            // are envelope_size bytes.
10936            let cur_offset: usize = (5 - 1) * envelope_size;
10937
10938            // Zero reserved fields.
10939            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10940
10941            // Safety:
10942            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10943            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10944            //   envelope_size bytes, there is always sufficient room.
10945            fidl::encoding::encode_in_envelope_optional::<
10946                i64,
10947                fidl::encoding::DefaultFuchsiaResourceDialect,
10948            >(
10949                self.timeout.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
10950                encoder,
10951                offset + cur_offset,
10952                depth,
10953            )?;
10954
10955            _prev_end_offset = cur_offset + envelope_size;
10956            if 6 > max_ordinal {
10957                return Ok(());
10958            }
10959
10960            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10961            // are envelope_size bytes.
10962            let cur_offset: usize = (6 - 1) * envelope_size;
10963
10964            // Zero reserved fields.
10965            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10966
10967            // Safety:
10968            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10969            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10970            //   envelope_size bytes, there is always sufficient room.
10971            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect>(
10972            self.test_case_filters.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024> as fidl::encoding::ValueTypeMarker>::borrow),
10973            encoder, offset + cur_offset, depth
10974        )?;
10975
10976            _prev_end_offset = cur_offset + envelope_size;
10977            if 7 > max_ordinal {
10978                return Ok(());
10979            }
10980
10981            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10982            // are envelope_size bytes.
10983            let cur_offset: usize = (7 - 1) * envelope_size;
10984
10985            // Zero reserved fields.
10986            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10987
10988            // Safety:
10989            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10990            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10991            //   envelope_size bytes, there is always sufficient room.
10992            fidl::encoding::encode_in_envelope_optional::<
10993                LogsIteratorType,
10994                fidl::encoding::DefaultFuchsiaResourceDialect,
10995            >(
10996                self.logs_iterator_type
10997                    .as_ref()
10998                    .map(<LogsIteratorType as fidl::encoding::ValueTypeMarker>::borrow),
10999                encoder,
11000                offset + cur_offset,
11001                depth,
11002            )?;
11003
11004            _prev_end_offset = cur_offset + envelope_size;
11005            if 8 > max_ordinal {
11006                return Ok(());
11007            }
11008
11009            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11010            // are envelope_size bytes.
11011            let cur_offset: usize = (8 - 1) * envelope_size;
11012
11013            // Zero reserved fields.
11014            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11015
11016            // Safety:
11017            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11018            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11019            //   envelope_size bytes, there is always sufficient room.
11020            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11021            self.log_interest.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64> as fidl::encoding::ValueTypeMarker>::borrow),
11022            encoder, offset + cur_offset, depth
11023        )?;
11024
11025            _prev_end_offset = cur_offset + envelope_size;
11026            if 9 > max_ordinal {
11027                return Ok(());
11028            }
11029
11030            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11031            // are envelope_size bytes.
11032            let cur_offset: usize = (9 - 1) * envelope_size;
11033
11034            // Zero reserved fields.
11035            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11036
11037            // Safety:
11038            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11039            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11040            //   envelope_size bytes, there is always sufficient room.
11041            fidl::encoding::encode_in_envelope_optional::<
11042                bool,
11043                fidl::encoding::DefaultFuchsiaResourceDialect,
11044            >(
11045                self.accumulate_debug_data
11046                    .as_ref()
11047                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11048                encoder,
11049                offset + cur_offset,
11050                depth,
11051            )?;
11052
11053            _prev_end_offset = cur_offset + envelope_size;
11054            if 10 > max_ordinal {
11055                return Ok(());
11056            }
11057
11058            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11059            // are envelope_size bytes.
11060            let cur_offset: usize = (10 - 1) * envelope_size;
11061
11062            // Zero reserved fields.
11063            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11064
11065            // Safety:
11066            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11067            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11068            //   envelope_size bytes, there is always sufficient room.
11069            fidl::encoding::encode_in_envelope_optional::<
11070                bool,
11071                fidl::encoding::DefaultFuchsiaResourceDialect,
11072            >(
11073                self.no_exception_channel
11074                    .as_ref()
11075                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11076                encoder,
11077                offset + cur_offset,
11078                depth,
11079            )?;
11080
11081            _prev_end_offset = cur_offset + envelope_size;
11082            if 11 > max_ordinal {
11083                return Ok(());
11084            }
11085
11086            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11087            // are envelope_size bytes.
11088            let cur_offset: usize = (11 - 1) * envelope_size;
11089
11090            // Zero reserved fields.
11091            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11092
11093            // Safety:
11094            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11095            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11096            //   envelope_size bytes, there is always sufficient room.
11097            fidl::encoding::encode_in_envelope_optional::<
11098                bool,
11099                fidl::encoding::DefaultFuchsiaResourceDialect,
11100            >(
11101                self.break_on_failure
11102                    .as_ref()
11103                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11104                encoder,
11105                offset + cur_offset,
11106                depth,
11107            )?;
11108
11109            _prev_end_offset = cur_offset + envelope_size;
11110
11111            Ok(())
11112        }
11113    }
11114
11115    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11116        for RunSuiteOptions
11117    {
11118        #[inline(always)]
11119        fn new_empty() -> Self {
11120            Self::default()
11121        }
11122
11123        unsafe fn decode(
11124            &mut self,
11125            decoder: &mut fidl::encoding::Decoder<
11126                '_,
11127                fidl::encoding::DefaultFuchsiaResourceDialect,
11128            >,
11129            offset: usize,
11130            mut depth: fidl::encoding::Depth,
11131        ) -> fidl::Result<()> {
11132            decoder.debug_check_bounds::<Self>(offset);
11133            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11134                None => return Err(fidl::Error::NotNullable),
11135                Some(len) => len,
11136            };
11137            // Calling decoder.out_of_line_offset(0) is not allowed.
11138            if len == 0 {
11139                return Ok(());
11140            };
11141            depth.increment()?;
11142            let envelope_size = 8;
11143            let bytes_len = len * envelope_size;
11144            let offset = decoder.out_of_line_offset(bytes_len)?;
11145            // Decode the envelope for each type.
11146            let mut _next_ordinal_to_read = 0;
11147            let mut next_offset = offset;
11148            let end_offset = offset + bytes_len;
11149            _next_ordinal_to_read += 1;
11150            if next_offset >= end_offset {
11151                return Ok(());
11152            }
11153
11154            // Decode unknown envelopes for gaps in ordinals.
11155            while _next_ordinal_to_read < 1 {
11156                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11157                _next_ordinal_to_read += 1;
11158                next_offset += envelope_size;
11159            }
11160
11161            let next_out_of_line = decoder.next_out_of_line();
11162            let handles_before = decoder.remaining_handles();
11163            if let Some((inlined, num_bytes, num_handles)) =
11164                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11165            {
11166                let member_inline_size =
11167                    <RealmOptions as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11168                if inlined != (member_inline_size <= 4) {
11169                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11170                }
11171                let inner_offset;
11172                let mut inner_depth = depth.clone();
11173                if inlined {
11174                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11175                    inner_offset = next_offset;
11176                } else {
11177                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11178                    inner_depth.increment()?;
11179                }
11180                let val_ref = self.realm_options.get_or_insert_with(|| {
11181                    fidl::new_empty!(RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect)
11182                });
11183                fidl::decode!(
11184                    RealmOptions,
11185                    fidl::encoding::DefaultFuchsiaResourceDialect,
11186                    val_ref,
11187                    decoder,
11188                    inner_offset,
11189                    inner_depth
11190                )?;
11191                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11192                {
11193                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11194                }
11195                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11196                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11197                }
11198            }
11199
11200            next_offset += envelope_size;
11201            _next_ordinal_to_read += 1;
11202            if next_offset >= end_offset {
11203                return Ok(());
11204            }
11205
11206            // Decode unknown envelopes for gaps in ordinals.
11207            while _next_ordinal_to_read < 2 {
11208                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11209                _next_ordinal_to_read += 1;
11210                next_offset += envelope_size;
11211            }
11212
11213            let next_out_of_line = decoder.next_out_of_line();
11214            let handles_before = decoder.remaining_handles();
11215            if let Some((inlined, num_bytes, num_handles)) =
11216                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11217            {
11218                let member_inline_size =
11219                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11220                if inlined != (member_inline_size <= 4) {
11221                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11222                }
11223                let inner_offset;
11224                let mut inner_depth = depth.clone();
11225                if inlined {
11226                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11227                    inner_offset = next_offset;
11228                } else {
11229                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11230                    inner_depth.increment()?;
11231                }
11232                let val_ref = self.run_disabled_tests.get_or_insert_with(|| {
11233                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11234                });
11235                fidl::decode!(
11236                    bool,
11237                    fidl::encoding::DefaultFuchsiaResourceDialect,
11238                    val_ref,
11239                    decoder,
11240                    inner_offset,
11241                    inner_depth
11242                )?;
11243                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11244                {
11245                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11246                }
11247                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11248                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11249                }
11250            }
11251
11252            next_offset += envelope_size;
11253            _next_ordinal_to_read += 1;
11254            if next_offset >= end_offset {
11255                return Ok(());
11256            }
11257
11258            // Decode unknown envelopes for gaps in ordinals.
11259            while _next_ordinal_to_read < 3 {
11260                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11261                _next_ordinal_to_read += 1;
11262                next_offset += envelope_size;
11263            }
11264
11265            let next_out_of_line = decoder.next_out_of_line();
11266            let handles_before = decoder.remaining_handles();
11267            if let Some((inlined, num_bytes, num_handles)) =
11268                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11269            {
11270                let member_inline_size =
11271                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11272                if inlined != (member_inline_size <= 4) {
11273                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11274                }
11275                let inner_offset;
11276                let mut inner_depth = depth.clone();
11277                if inlined {
11278                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11279                    inner_offset = next_offset;
11280                } else {
11281                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11282                    inner_depth.increment()?;
11283                }
11284                let val_ref = self.max_concurrent_test_case_runs.get_or_insert_with(|| {
11285                    fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect)
11286                });
11287                fidl::decode!(
11288                    u16,
11289                    fidl::encoding::DefaultFuchsiaResourceDialect,
11290                    val_ref,
11291                    decoder,
11292                    inner_offset,
11293                    inner_depth
11294                )?;
11295                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11296                {
11297                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11298                }
11299                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11300                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11301                }
11302            }
11303
11304            next_offset += envelope_size;
11305            _next_ordinal_to_read += 1;
11306            if next_offset >= end_offset {
11307                return Ok(());
11308            }
11309
11310            // Decode unknown envelopes for gaps in ordinals.
11311            while _next_ordinal_to_read < 4 {
11312                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11313                _next_ordinal_to_read += 1;
11314                next_offset += envelope_size;
11315            }
11316
11317            let next_out_of_line = decoder.next_out_of_line();
11318            let handles_before = decoder.remaining_handles();
11319            if let Some((inlined, num_bytes, num_handles)) =
11320                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11321            {
11322                let member_inline_size = <fidl::encoding::Vector<
11323                    fidl::encoding::BoundedString<16384>,
11324                    4095,
11325                > as fidl::encoding::TypeMarker>::inline_size(
11326                    decoder.context
11327                );
11328                if inlined != (member_inline_size <= 4) {
11329                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11330                }
11331                let inner_offset;
11332                let mut inner_depth = depth.clone();
11333                if inlined {
11334                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11335                    inner_offset = next_offset;
11336                } else {
11337                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11338                    inner_depth.increment()?;
11339                }
11340                let val_ref = self.arguments.get_or_insert_with(|| {
11341                    fidl::new_empty!(
11342                        fidl::encoding::Vector<fidl::encoding::BoundedString<16384>, 4095>,
11343                        fidl::encoding::DefaultFuchsiaResourceDialect
11344                    )
11345                });
11346                fidl::decode!(
11347                    fidl::encoding::Vector<fidl::encoding::BoundedString<16384>, 4095>,
11348                    fidl::encoding::DefaultFuchsiaResourceDialect,
11349                    val_ref,
11350                    decoder,
11351                    inner_offset,
11352                    inner_depth
11353                )?;
11354                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11355                {
11356                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11357                }
11358                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11359                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11360                }
11361            }
11362
11363            next_offset += envelope_size;
11364            _next_ordinal_to_read += 1;
11365            if next_offset >= end_offset {
11366                return Ok(());
11367            }
11368
11369            // Decode unknown envelopes for gaps in ordinals.
11370            while _next_ordinal_to_read < 5 {
11371                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11372                _next_ordinal_to_read += 1;
11373                next_offset += envelope_size;
11374            }
11375
11376            let next_out_of_line = decoder.next_out_of_line();
11377            let handles_before = decoder.remaining_handles();
11378            if let Some((inlined, num_bytes, num_handles)) =
11379                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11380            {
11381                let member_inline_size =
11382                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11383                if inlined != (member_inline_size <= 4) {
11384                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11385                }
11386                let inner_offset;
11387                let mut inner_depth = depth.clone();
11388                if inlined {
11389                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11390                    inner_offset = next_offset;
11391                } else {
11392                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11393                    inner_depth.increment()?;
11394                }
11395                let val_ref = self.timeout.get_or_insert_with(|| {
11396                    fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
11397                });
11398                fidl::decode!(
11399                    i64,
11400                    fidl::encoding::DefaultFuchsiaResourceDialect,
11401                    val_ref,
11402                    decoder,
11403                    inner_offset,
11404                    inner_depth
11405                )?;
11406                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11407                {
11408                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11409                }
11410                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11411                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11412                }
11413            }
11414
11415            next_offset += envelope_size;
11416            _next_ordinal_to_read += 1;
11417            if next_offset >= end_offset {
11418                return Ok(());
11419            }
11420
11421            // Decode unknown envelopes for gaps in ordinals.
11422            while _next_ordinal_to_read < 6 {
11423                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11424                _next_ordinal_to_read += 1;
11425                next_offset += envelope_size;
11426            }
11427
11428            let next_out_of_line = decoder.next_out_of_line();
11429            let handles_before = decoder.remaining_handles();
11430            if let Some((inlined, num_bytes, num_handles)) =
11431                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11432            {
11433                let member_inline_size = <fidl::encoding::Vector<
11434                    fidl::encoding::BoundedString<4096>,
11435                    1024,
11436                > as fidl::encoding::TypeMarker>::inline_size(
11437                    decoder.context
11438                );
11439                if inlined != (member_inline_size <= 4) {
11440                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11441                }
11442                let inner_offset;
11443                let mut inner_depth = depth.clone();
11444                if inlined {
11445                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11446                    inner_offset = next_offset;
11447                } else {
11448                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11449                    inner_depth.increment()?;
11450                }
11451                let val_ref = self.test_case_filters.get_or_insert_with(|| {
11452                    fidl::new_empty!(
11453                        fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024>,
11454                        fidl::encoding::DefaultFuchsiaResourceDialect
11455                    )
11456                });
11457                fidl::decode!(
11458                    fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024>,
11459                    fidl::encoding::DefaultFuchsiaResourceDialect,
11460                    val_ref,
11461                    decoder,
11462                    inner_offset,
11463                    inner_depth
11464                )?;
11465                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11466                {
11467                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11468                }
11469                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11470                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11471                }
11472            }
11473
11474            next_offset += envelope_size;
11475            _next_ordinal_to_read += 1;
11476            if next_offset >= end_offset {
11477                return Ok(());
11478            }
11479
11480            // Decode unknown envelopes for gaps in ordinals.
11481            while _next_ordinal_to_read < 7 {
11482                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11483                _next_ordinal_to_read += 1;
11484                next_offset += envelope_size;
11485            }
11486
11487            let next_out_of_line = decoder.next_out_of_line();
11488            let handles_before = decoder.remaining_handles();
11489            if let Some((inlined, num_bytes, num_handles)) =
11490                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11491            {
11492                let member_inline_size =
11493                    <LogsIteratorType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11494                if inlined != (member_inline_size <= 4) {
11495                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11496                }
11497                let inner_offset;
11498                let mut inner_depth = depth.clone();
11499                if inlined {
11500                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11501                    inner_offset = next_offset;
11502                } else {
11503                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11504                    inner_depth.increment()?;
11505                }
11506                let val_ref = self.logs_iterator_type.get_or_insert_with(|| {
11507                    fidl::new_empty!(
11508                        LogsIteratorType,
11509                        fidl::encoding::DefaultFuchsiaResourceDialect
11510                    )
11511                });
11512                fidl::decode!(
11513                    LogsIteratorType,
11514                    fidl::encoding::DefaultFuchsiaResourceDialect,
11515                    val_ref,
11516                    decoder,
11517                    inner_offset,
11518                    inner_depth
11519                )?;
11520                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11521                {
11522                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11523                }
11524                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11525                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11526                }
11527            }
11528
11529            next_offset += envelope_size;
11530            _next_ordinal_to_read += 1;
11531            if next_offset >= end_offset {
11532                return Ok(());
11533            }
11534
11535            // Decode unknown envelopes for gaps in ordinals.
11536            while _next_ordinal_to_read < 8 {
11537                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11538                _next_ordinal_to_read += 1;
11539                next_offset += envelope_size;
11540            }
11541
11542            let next_out_of_line = decoder.next_out_of_line();
11543            let handles_before = decoder.remaining_handles();
11544            if let Some((inlined, num_bytes, num_handles)) =
11545                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11546            {
11547                let member_inline_size = <fidl::encoding::Vector<
11548                    fidl_fuchsia_diagnostics::LogInterestSelector,
11549                    64,
11550                > as fidl::encoding::TypeMarker>::inline_size(
11551                    decoder.context
11552                );
11553                if inlined != (member_inline_size <= 4) {
11554                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11555                }
11556                let inner_offset;
11557                let mut inner_depth = depth.clone();
11558                if inlined {
11559                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11560                    inner_offset = next_offset;
11561                } else {
11562                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11563                    inner_depth.increment()?;
11564                }
11565                let val_ref =
11566                self.log_interest.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
11567                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
11568                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11569                {
11570                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11571                }
11572                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11573                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11574                }
11575            }
11576
11577            next_offset += envelope_size;
11578            _next_ordinal_to_read += 1;
11579            if next_offset >= end_offset {
11580                return Ok(());
11581            }
11582
11583            // Decode unknown envelopes for gaps in ordinals.
11584            while _next_ordinal_to_read < 9 {
11585                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11586                _next_ordinal_to_read += 1;
11587                next_offset += envelope_size;
11588            }
11589
11590            let next_out_of_line = decoder.next_out_of_line();
11591            let handles_before = decoder.remaining_handles();
11592            if let Some((inlined, num_bytes, num_handles)) =
11593                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11594            {
11595                let member_inline_size =
11596                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11597                if inlined != (member_inline_size <= 4) {
11598                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11599                }
11600                let inner_offset;
11601                let mut inner_depth = depth.clone();
11602                if inlined {
11603                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11604                    inner_offset = next_offset;
11605                } else {
11606                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11607                    inner_depth.increment()?;
11608                }
11609                let val_ref = self.accumulate_debug_data.get_or_insert_with(|| {
11610                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11611                });
11612                fidl::decode!(
11613                    bool,
11614                    fidl::encoding::DefaultFuchsiaResourceDialect,
11615                    val_ref,
11616                    decoder,
11617                    inner_offset,
11618                    inner_depth
11619                )?;
11620                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11621                {
11622                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11623                }
11624                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11625                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11626                }
11627            }
11628
11629            next_offset += envelope_size;
11630            _next_ordinal_to_read += 1;
11631            if next_offset >= end_offset {
11632                return Ok(());
11633            }
11634
11635            // Decode unknown envelopes for gaps in ordinals.
11636            while _next_ordinal_to_read < 10 {
11637                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11638                _next_ordinal_to_read += 1;
11639                next_offset += envelope_size;
11640            }
11641
11642            let next_out_of_line = decoder.next_out_of_line();
11643            let handles_before = decoder.remaining_handles();
11644            if let Some((inlined, num_bytes, num_handles)) =
11645                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11646            {
11647                let member_inline_size =
11648                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11649                if inlined != (member_inline_size <= 4) {
11650                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11651                }
11652                let inner_offset;
11653                let mut inner_depth = depth.clone();
11654                if inlined {
11655                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11656                    inner_offset = next_offset;
11657                } else {
11658                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11659                    inner_depth.increment()?;
11660                }
11661                let val_ref = self.no_exception_channel.get_or_insert_with(|| {
11662                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11663                });
11664                fidl::decode!(
11665                    bool,
11666                    fidl::encoding::DefaultFuchsiaResourceDialect,
11667                    val_ref,
11668                    decoder,
11669                    inner_offset,
11670                    inner_depth
11671                )?;
11672                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11673                {
11674                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11675                }
11676                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11677                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11678                }
11679            }
11680
11681            next_offset += envelope_size;
11682            _next_ordinal_to_read += 1;
11683            if next_offset >= end_offset {
11684                return Ok(());
11685            }
11686
11687            // Decode unknown envelopes for gaps in ordinals.
11688            while _next_ordinal_to_read < 11 {
11689                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11690                _next_ordinal_to_read += 1;
11691                next_offset += envelope_size;
11692            }
11693
11694            let next_out_of_line = decoder.next_out_of_line();
11695            let handles_before = decoder.remaining_handles();
11696            if let Some((inlined, num_bytes, num_handles)) =
11697                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11698            {
11699                let member_inline_size =
11700                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11701                if inlined != (member_inline_size <= 4) {
11702                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11703                }
11704                let inner_offset;
11705                let mut inner_depth = depth.clone();
11706                if inlined {
11707                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11708                    inner_offset = next_offset;
11709                } else {
11710                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11711                    inner_depth.increment()?;
11712                }
11713                let val_ref = self.break_on_failure.get_or_insert_with(|| {
11714                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11715                });
11716                fidl::decode!(
11717                    bool,
11718                    fidl::encoding::DefaultFuchsiaResourceDialect,
11719                    val_ref,
11720                    decoder,
11721                    inner_offset,
11722                    inner_depth
11723                )?;
11724                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11725                {
11726                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11727                }
11728                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11729                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11730                }
11731            }
11732
11733            next_offset += envelope_size;
11734
11735            // Decode the remaining unknown envelopes.
11736            while next_offset < end_offset {
11737                _next_ordinal_to_read += 1;
11738                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11739                next_offset += envelope_size;
11740            }
11741
11742            Ok(())
11743        }
11744    }
11745
11746    impl SuiteArtifactGeneratedEventDetails {
11747        #[inline(always)]
11748        fn max_ordinal_present(&self) -> u64 {
11749            if let Some(_) = self.artifact {
11750                return 1;
11751            }
11752            0
11753        }
11754    }
11755
11756    impl fidl::encoding::ResourceTypeMarker for SuiteArtifactGeneratedEventDetails {
11757        type Borrowed<'a> = &'a mut Self;
11758        fn take_or_borrow<'a>(
11759            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11760        ) -> Self::Borrowed<'a> {
11761            value
11762        }
11763    }
11764
11765    unsafe impl fidl::encoding::TypeMarker for SuiteArtifactGeneratedEventDetails {
11766        type Owned = Self;
11767
11768        #[inline(always)]
11769        fn inline_align(_context: fidl::encoding::Context) -> usize {
11770            8
11771        }
11772
11773        #[inline(always)]
11774        fn inline_size(_context: fidl::encoding::Context) -> usize {
11775            16
11776        }
11777    }
11778
11779    unsafe impl
11780        fidl::encoding::Encode<
11781            SuiteArtifactGeneratedEventDetails,
11782            fidl::encoding::DefaultFuchsiaResourceDialect,
11783        > for &mut SuiteArtifactGeneratedEventDetails
11784    {
11785        unsafe fn encode(
11786            self,
11787            encoder: &mut fidl::encoding::Encoder<
11788                '_,
11789                fidl::encoding::DefaultFuchsiaResourceDialect,
11790            >,
11791            offset: usize,
11792            mut depth: fidl::encoding::Depth,
11793        ) -> fidl::Result<()> {
11794            encoder.debug_check_bounds::<SuiteArtifactGeneratedEventDetails>(offset);
11795            // Vector header
11796            let max_ordinal: u64 = self.max_ordinal_present();
11797            encoder.write_num(max_ordinal, offset);
11798            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11799            // Calling encoder.out_of_line_offset(0) is not allowed.
11800            if max_ordinal == 0 {
11801                return Ok(());
11802            }
11803            depth.increment()?;
11804            let envelope_size = 8;
11805            let bytes_len = max_ordinal as usize * envelope_size;
11806            #[allow(unused_variables)]
11807            let offset = encoder.out_of_line_offset(bytes_len);
11808            let mut _prev_end_offset: usize = 0;
11809            if 1 > max_ordinal {
11810                return Ok(());
11811            }
11812
11813            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11814            // are envelope_size bytes.
11815            let cur_offset: usize = (1 - 1) * envelope_size;
11816
11817            // Zero reserved fields.
11818            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11819
11820            // Safety:
11821            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11822            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11823            //   envelope_size bytes, there is always sufficient room.
11824            fidl::encoding::encode_in_envelope_optional::<
11825                Artifact,
11826                fidl::encoding::DefaultFuchsiaResourceDialect,
11827            >(
11828                self.artifact
11829                    .as_mut()
11830                    .map(<Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11831                encoder,
11832                offset + cur_offset,
11833                depth,
11834            )?;
11835
11836            _prev_end_offset = cur_offset + envelope_size;
11837
11838            Ok(())
11839        }
11840    }
11841
11842    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11843        for SuiteArtifactGeneratedEventDetails
11844    {
11845        #[inline(always)]
11846        fn new_empty() -> Self {
11847            Self::default()
11848        }
11849
11850        unsafe fn decode(
11851            &mut self,
11852            decoder: &mut fidl::encoding::Decoder<
11853                '_,
11854                fidl::encoding::DefaultFuchsiaResourceDialect,
11855            >,
11856            offset: usize,
11857            mut depth: fidl::encoding::Depth,
11858        ) -> fidl::Result<()> {
11859            decoder.debug_check_bounds::<Self>(offset);
11860            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11861                None => return Err(fidl::Error::NotNullable),
11862                Some(len) => len,
11863            };
11864            // Calling decoder.out_of_line_offset(0) is not allowed.
11865            if len == 0 {
11866                return Ok(());
11867            };
11868            depth.increment()?;
11869            let envelope_size = 8;
11870            let bytes_len = len * envelope_size;
11871            let offset = decoder.out_of_line_offset(bytes_len)?;
11872            // Decode the envelope for each type.
11873            let mut _next_ordinal_to_read = 0;
11874            let mut next_offset = offset;
11875            let end_offset = offset + bytes_len;
11876            _next_ordinal_to_read += 1;
11877            if next_offset >= end_offset {
11878                return Ok(());
11879            }
11880
11881            // Decode unknown envelopes for gaps in ordinals.
11882            while _next_ordinal_to_read < 1 {
11883                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11884                _next_ordinal_to_read += 1;
11885                next_offset += envelope_size;
11886            }
11887
11888            let next_out_of_line = decoder.next_out_of_line();
11889            let handles_before = decoder.remaining_handles();
11890            if let Some((inlined, num_bytes, num_handles)) =
11891                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11892            {
11893                let member_inline_size =
11894                    <Artifact as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11895                if inlined != (member_inline_size <= 4) {
11896                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11897                }
11898                let inner_offset;
11899                let mut inner_depth = depth.clone();
11900                if inlined {
11901                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11902                    inner_offset = next_offset;
11903                } else {
11904                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11905                    inner_depth.increment()?;
11906                }
11907                let val_ref = self.artifact.get_or_insert_with(|| {
11908                    fidl::new_empty!(Artifact, fidl::encoding::DefaultFuchsiaResourceDialect)
11909                });
11910                fidl::decode!(
11911                    Artifact,
11912                    fidl::encoding::DefaultFuchsiaResourceDialect,
11913                    val_ref,
11914                    decoder,
11915                    inner_offset,
11916                    inner_depth
11917                )?;
11918                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11919                {
11920                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11921                }
11922                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11923                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11924                }
11925            }
11926
11927            next_offset += envelope_size;
11928
11929            // Decode the remaining unknown envelopes.
11930            while next_offset < end_offset {
11931                _next_ordinal_to_read += 1;
11932                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11933                next_offset += envelope_size;
11934            }
11935
11936            Ok(())
11937        }
11938    }
11939
11940    impl SuiteEvent {
11941        #[inline(always)]
11942        fn max_ordinal_present(&self) -> u64 {
11943            if let Some(_) = self.payload {
11944                return 2;
11945            }
11946            if let Some(_) = self.timestamp {
11947                return 1;
11948            }
11949            0
11950        }
11951    }
11952
11953    impl fidl::encoding::ResourceTypeMarker for SuiteEvent {
11954        type Borrowed<'a> = &'a mut Self;
11955        fn take_or_borrow<'a>(
11956            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11957        ) -> Self::Borrowed<'a> {
11958            value
11959        }
11960    }
11961
11962    unsafe impl fidl::encoding::TypeMarker for SuiteEvent {
11963        type Owned = Self;
11964
11965        #[inline(always)]
11966        fn inline_align(_context: fidl::encoding::Context) -> usize {
11967            8
11968        }
11969
11970        #[inline(always)]
11971        fn inline_size(_context: fidl::encoding::Context) -> usize {
11972            16
11973        }
11974    }
11975
11976    unsafe impl fidl::encoding::Encode<SuiteEvent, fidl::encoding::DefaultFuchsiaResourceDialect>
11977        for &mut SuiteEvent
11978    {
11979        unsafe fn encode(
11980            self,
11981            encoder: &mut fidl::encoding::Encoder<
11982                '_,
11983                fidl::encoding::DefaultFuchsiaResourceDialect,
11984            >,
11985            offset: usize,
11986            mut depth: fidl::encoding::Depth,
11987        ) -> fidl::Result<()> {
11988            encoder.debug_check_bounds::<SuiteEvent>(offset);
11989            // Vector header
11990            let max_ordinal: u64 = self.max_ordinal_present();
11991            encoder.write_num(max_ordinal, offset);
11992            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11993            // Calling encoder.out_of_line_offset(0) is not allowed.
11994            if max_ordinal == 0 {
11995                return Ok(());
11996            }
11997            depth.increment()?;
11998            let envelope_size = 8;
11999            let bytes_len = max_ordinal as usize * envelope_size;
12000            #[allow(unused_variables)]
12001            let offset = encoder.out_of_line_offset(bytes_len);
12002            let mut _prev_end_offset: usize = 0;
12003            if 1 > max_ordinal {
12004                return Ok(());
12005            }
12006
12007            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12008            // are envelope_size bytes.
12009            let cur_offset: usize = (1 - 1) * envelope_size;
12010
12011            // Zero reserved fields.
12012            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12013
12014            // Safety:
12015            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12016            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12017            //   envelope_size bytes, there is always sufficient room.
12018            fidl::encoding::encode_in_envelope_optional::<
12019                i64,
12020                fidl::encoding::DefaultFuchsiaResourceDialect,
12021            >(
12022                self.timestamp.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
12023                encoder,
12024                offset + cur_offset,
12025                depth,
12026            )?;
12027
12028            _prev_end_offset = cur_offset + envelope_size;
12029            if 2 > max_ordinal {
12030                return Ok(());
12031            }
12032
12033            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12034            // are envelope_size bytes.
12035            let cur_offset: usize = (2 - 1) * envelope_size;
12036
12037            // Zero reserved fields.
12038            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12039
12040            // Safety:
12041            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12042            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12043            //   envelope_size bytes, there is always sufficient room.
12044            fidl::encoding::encode_in_envelope_optional::<
12045                SuiteEventPayload,
12046                fidl::encoding::DefaultFuchsiaResourceDialect,
12047            >(
12048                self.payload
12049                    .as_mut()
12050                    .map(<SuiteEventPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12051                encoder,
12052                offset + cur_offset,
12053                depth,
12054            )?;
12055
12056            _prev_end_offset = cur_offset + envelope_size;
12057
12058            Ok(())
12059        }
12060    }
12061
12062    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for SuiteEvent {
12063        #[inline(always)]
12064        fn new_empty() -> Self {
12065            Self::default()
12066        }
12067
12068        unsafe fn decode(
12069            &mut self,
12070            decoder: &mut fidl::encoding::Decoder<
12071                '_,
12072                fidl::encoding::DefaultFuchsiaResourceDialect,
12073            >,
12074            offset: usize,
12075            mut depth: fidl::encoding::Depth,
12076        ) -> fidl::Result<()> {
12077            decoder.debug_check_bounds::<Self>(offset);
12078            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12079                None => return Err(fidl::Error::NotNullable),
12080                Some(len) => len,
12081            };
12082            // Calling decoder.out_of_line_offset(0) is not allowed.
12083            if len == 0 {
12084                return Ok(());
12085            };
12086            depth.increment()?;
12087            let envelope_size = 8;
12088            let bytes_len = len * envelope_size;
12089            let offset = decoder.out_of_line_offset(bytes_len)?;
12090            // Decode the envelope for each type.
12091            let mut _next_ordinal_to_read = 0;
12092            let mut next_offset = offset;
12093            let end_offset = offset + bytes_len;
12094            _next_ordinal_to_read += 1;
12095            if next_offset >= end_offset {
12096                return Ok(());
12097            }
12098
12099            // Decode unknown envelopes for gaps in ordinals.
12100            while _next_ordinal_to_read < 1 {
12101                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12102                _next_ordinal_to_read += 1;
12103                next_offset += envelope_size;
12104            }
12105
12106            let next_out_of_line = decoder.next_out_of_line();
12107            let handles_before = decoder.remaining_handles();
12108            if let Some((inlined, num_bytes, num_handles)) =
12109                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12110            {
12111                let member_inline_size =
12112                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12113                if inlined != (member_inline_size <= 4) {
12114                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12115                }
12116                let inner_offset;
12117                let mut inner_depth = depth.clone();
12118                if inlined {
12119                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12120                    inner_offset = next_offset;
12121                } else {
12122                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12123                    inner_depth.increment()?;
12124                }
12125                let val_ref = self.timestamp.get_or_insert_with(|| {
12126                    fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
12127                });
12128                fidl::decode!(
12129                    i64,
12130                    fidl::encoding::DefaultFuchsiaResourceDialect,
12131                    val_ref,
12132                    decoder,
12133                    inner_offset,
12134                    inner_depth
12135                )?;
12136                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12137                {
12138                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12139                }
12140                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12141                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12142                }
12143            }
12144
12145            next_offset += envelope_size;
12146            _next_ordinal_to_read += 1;
12147            if next_offset >= end_offset {
12148                return Ok(());
12149            }
12150
12151            // Decode unknown envelopes for gaps in ordinals.
12152            while _next_ordinal_to_read < 2 {
12153                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12154                _next_ordinal_to_read += 1;
12155                next_offset += envelope_size;
12156            }
12157
12158            let next_out_of_line = decoder.next_out_of_line();
12159            let handles_before = decoder.remaining_handles();
12160            if let Some((inlined, num_bytes, num_handles)) =
12161                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12162            {
12163                let member_inline_size =
12164                    <SuiteEventPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12165                if inlined != (member_inline_size <= 4) {
12166                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12167                }
12168                let inner_offset;
12169                let mut inner_depth = depth.clone();
12170                if inlined {
12171                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12172                    inner_offset = next_offset;
12173                } else {
12174                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12175                    inner_depth.increment()?;
12176                }
12177                let val_ref = self.payload.get_or_insert_with(|| {
12178                    fidl::new_empty!(
12179                        SuiteEventPayload,
12180                        fidl::encoding::DefaultFuchsiaResourceDialect
12181                    )
12182                });
12183                fidl::decode!(
12184                    SuiteEventPayload,
12185                    fidl::encoding::DefaultFuchsiaResourceDialect,
12186                    val_ref,
12187                    decoder,
12188                    inner_offset,
12189                    inner_depth
12190                )?;
12191                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12192                {
12193                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12194                }
12195                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12196                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12197                }
12198            }
12199
12200            next_offset += envelope_size;
12201
12202            // Decode the remaining unknown envelopes.
12203            while next_offset < end_offset {
12204                _next_ordinal_to_read += 1;
12205                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12206                next_offset += envelope_size;
12207            }
12208
12209            Ok(())
12210        }
12211    }
12212
12213    impl TestCaseArtifactGeneratedEventDetails {
12214        #[inline(always)]
12215        fn max_ordinal_present(&self) -> u64 {
12216            if let Some(_) = self.artifact {
12217                return 2;
12218            }
12219            if let Some(_) = self.test_case_id {
12220                return 1;
12221            }
12222            0
12223        }
12224    }
12225
12226    impl fidl::encoding::ResourceTypeMarker for TestCaseArtifactGeneratedEventDetails {
12227        type Borrowed<'a> = &'a mut Self;
12228        fn take_or_borrow<'a>(
12229            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12230        ) -> Self::Borrowed<'a> {
12231            value
12232        }
12233    }
12234
12235    unsafe impl fidl::encoding::TypeMarker for TestCaseArtifactGeneratedEventDetails {
12236        type Owned = Self;
12237
12238        #[inline(always)]
12239        fn inline_align(_context: fidl::encoding::Context) -> usize {
12240            8
12241        }
12242
12243        #[inline(always)]
12244        fn inline_size(_context: fidl::encoding::Context) -> usize {
12245            16
12246        }
12247    }
12248
12249    unsafe impl
12250        fidl::encoding::Encode<
12251            TestCaseArtifactGeneratedEventDetails,
12252            fidl::encoding::DefaultFuchsiaResourceDialect,
12253        > for &mut TestCaseArtifactGeneratedEventDetails
12254    {
12255        unsafe fn encode(
12256            self,
12257            encoder: &mut fidl::encoding::Encoder<
12258                '_,
12259                fidl::encoding::DefaultFuchsiaResourceDialect,
12260            >,
12261            offset: usize,
12262            mut depth: fidl::encoding::Depth,
12263        ) -> fidl::Result<()> {
12264            encoder.debug_check_bounds::<TestCaseArtifactGeneratedEventDetails>(offset);
12265            // Vector header
12266            let max_ordinal: u64 = self.max_ordinal_present();
12267            encoder.write_num(max_ordinal, offset);
12268            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12269            // Calling encoder.out_of_line_offset(0) is not allowed.
12270            if max_ordinal == 0 {
12271                return Ok(());
12272            }
12273            depth.increment()?;
12274            let envelope_size = 8;
12275            let bytes_len = max_ordinal as usize * envelope_size;
12276            #[allow(unused_variables)]
12277            let offset = encoder.out_of_line_offset(bytes_len);
12278            let mut _prev_end_offset: usize = 0;
12279            if 1 > max_ordinal {
12280                return Ok(());
12281            }
12282
12283            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12284            // are envelope_size bytes.
12285            let cur_offset: usize = (1 - 1) * envelope_size;
12286
12287            // Zero reserved fields.
12288            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12289
12290            // Safety:
12291            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12292            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12293            //   envelope_size bytes, there is always sufficient room.
12294            fidl::encoding::encode_in_envelope_optional::<
12295                u32,
12296                fidl::encoding::DefaultFuchsiaResourceDialect,
12297            >(
12298                self.test_case_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
12299                encoder,
12300                offset + cur_offset,
12301                depth,
12302            )?;
12303
12304            _prev_end_offset = cur_offset + envelope_size;
12305            if 2 > max_ordinal {
12306                return Ok(());
12307            }
12308
12309            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12310            // are envelope_size bytes.
12311            let cur_offset: usize = (2 - 1) * envelope_size;
12312
12313            // Zero reserved fields.
12314            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12315
12316            // Safety:
12317            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12318            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12319            //   envelope_size bytes, there is always sufficient room.
12320            fidl::encoding::encode_in_envelope_optional::<
12321                Artifact,
12322                fidl::encoding::DefaultFuchsiaResourceDialect,
12323            >(
12324                self.artifact
12325                    .as_mut()
12326                    .map(<Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12327                encoder,
12328                offset + cur_offset,
12329                depth,
12330            )?;
12331
12332            _prev_end_offset = cur_offset + envelope_size;
12333
12334            Ok(())
12335        }
12336    }
12337
12338    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12339        for TestCaseArtifactGeneratedEventDetails
12340    {
12341        #[inline(always)]
12342        fn new_empty() -> Self {
12343            Self::default()
12344        }
12345
12346        unsafe fn decode(
12347            &mut self,
12348            decoder: &mut fidl::encoding::Decoder<
12349                '_,
12350                fidl::encoding::DefaultFuchsiaResourceDialect,
12351            >,
12352            offset: usize,
12353            mut depth: fidl::encoding::Depth,
12354        ) -> fidl::Result<()> {
12355            decoder.debug_check_bounds::<Self>(offset);
12356            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12357                None => return Err(fidl::Error::NotNullable),
12358                Some(len) => len,
12359            };
12360            // Calling decoder.out_of_line_offset(0) is not allowed.
12361            if len == 0 {
12362                return Ok(());
12363            };
12364            depth.increment()?;
12365            let envelope_size = 8;
12366            let bytes_len = len * envelope_size;
12367            let offset = decoder.out_of_line_offset(bytes_len)?;
12368            // Decode the envelope for each type.
12369            let mut _next_ordinal_to_read = 0;
12370            let mut next_offset = offset;
12371            let end_offset = offset + bytes_len;
12372            _next_ordinal_to_read += 1;
12373            if next_offset >= end_offset {
12374                return Ok(());
12375            }
12376
12377            // Decode unknown envelopes for gaps in ordinals.
12378            while _next_ordinal_to_read < 1 {
12379                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12380                _next_ordinal_to_read += 1;
12381                next_offset += envelope_size;
12382            }
12383
12384            let next_out_of_line = decoder.next_out_of_line();
12385            let handles_before = decoder.remaining_handles();
12386            if let Some((inlined, num_bytes, num_handles)) =
12387                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12388            {
12389                let member_inline_size =
12390                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12391                if inlined != (member_inline_size <= 4) {
12392                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12393                }
12394                let inner_offset;
12395                let mut inner_depth = depth.clone();
12396                if inlined {
12397                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12398                    inner_offset = next_offset;
12399                } else {
12400                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12401                    inner_depth.increment()?;
12402                }
12403                let val_ref = self.test_case_id.get_or_insert_with(|| {
12404                    fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
12405                });
12406                fidl::decode!(
12407                    u32,
12408                    fidl::encoding::DefaultFuchsiaResourceDialect,
12409                    val_ref,
12410                    decoder,
12411                    inner_offset,
12412                    inner_depth
12413                )?;
12414                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12415                {
12416                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12417                }
12418                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12419                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12420                }
12421            }
12422
12423            next_offset += envelope_size;
12424            _next_ordinal_to_read += 1;
12425            if next_offset >= end_offset {
12426                return Ok(());
12427            }
12428
12429            // Decode unknown envelopes for gaps in ordinals.
12430            while _next_ordinal_to_read < 2 {
12431                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12432                _next_ordinal_to_read += 1;
12433                next_offset += envelope_size;
12434            }
12435
12436            let next_out_of_line = decoder.next_out_of_line();
12437            let handles_before = decoder.remaining_handles();
12438            if let Some((inlined, num_bytes, num_handles)) =
12439                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12440            {
12441                let member_inline_size =
12442                    <Artifact as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12443                if inlined != (member_inline_size <= 4) {
12444                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12445                }
12446                let inner_offset;
12447                let mut inner_depth = depth.clone();
12448                if inlined {
12449                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12450                    inner_offset = next_offset;
12451                } else {
12452                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12453                    inner_depth.increment()?;
12454                }
12455                let val_ref = self.artifact.get_or_insert_with(|| {
12456                    fidl::new_empty!(Artifact, fidl::encoding::DefaultFuchsiaResourceDialect)
12457                });
12458                fidl::decode!(
12459                    Artifact,
12460                    fidl::encoding::DefaultFuchsiaResourceDialect,
12461                    val_ref,
12462                    decoder,
12463                    inner_offset,
12464                    inner_depth
12465                )?;
12466                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12467                {
12468                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12469                }
12470                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12471                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12472                }
12473            }
12474
12475            next_offset += envelope_size;
12476
12477            // Decode the remaining unknown envelopes.
12478            while next_offset < end_offset {
12479                _next_ordinal_to_read += 1;
12480                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12481                next_offset += envelope_size;
12482            }
12483
12484            Ok(())
12485        }
12486    }
12487
12488    impl fidl::encoding::ResourceTypeMarker for Artifact {
12489        type Borrowed<'a> = &'a mut Self;
12490        fn take_or_borrow<'a>(
12491            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12492        ) -> Self::Borrowed<'a> {
12493            value
12494        }
12495    }
12496
12497    unsafe impl fidl::encoding::TypeMarker for Artifact {
12498        type Owned = Self;
12499
12500        #[inline(always)]
12501        fn inline_align(_context: fidl::encoding::Context) -> usize {
12502            8
12503        }
12504
12505        #[inline(always)]
12506        fn inline_size(_context: fidl::encoding::Context) -> usize {
12507            16
12508        }
12509    }
12510
12511    unsafe impl fidl::encoding::Encode<Artifact, fidl::encoding::DefaultFuchsiaResourceDialect>
12512        for &mut Artifact
12513    {
12514        #[inline]
12515        unsafe fn encode(
12516            self,
12517            encoder: &mut fidl::encoding::Encoder<
12518                '_,
12519                fidl::encoding::DefaultFuchsiaResourceDialect,
12520            >,
12521            offset: usize,
12522            _depth: fidl::encoding::Depth,
12523        ) -> fidl::Result<()> {
12524            encoder.debug_check_bounds::<Artifact>(offset);
12525            encoder.write_num::<u64>(self.ordinal(), offset);
12526            match self {
12527                Artifact::Stdout(ref mut val) => fidl::encoding::encode_in_envelope::<
12528                    fidl::encoding::HandleType<
12529                        fidl::Socket,
12530                        { fidl::ObjectType::SOCKET.into_raw() },
12531                        2147483648,
12532                    >,
12533                    fidl::encoding::DefaultFuchsiaResourceDialect,
12534                >(
12535                    <fidl::encoding::HandleType<
12536                        fidl::Socket,
12537                        { fidl::ObjectType::SOCKET.into_raw() },
12538                        2147483648,
12539                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12540                        val
12541                    ),
12542                    encoder,
12543                    offset + 8,
12544                    _depth,
12545                ),
12546                Artifact::Stderr(ref mut val) => fidl::encoding::encode_in_envelope::<
12547                    fidl::encoding::HandleType<
12548                        fidl::Socket,
12549                        { fidl::ObjectType::SOCKET.into_raw() },
12550                        2147483648,
12551                    >,
12552                    fidl::encoding::DefaultFuchsiaResourceDialect,
12553                >(
12554                    <fidl::encoding::HandleType<
12555                        fidl::Socket,
12556                        { fidl::ObjectType::SOCKET.into_raw() },
12557                        2147483648,
12558                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12559                        val
12560                    ),
12561                    encoder,
12562                    offset + 8,
12563                    _depth,
12564                ),
12565                Artifact::Log(ref mut val) => fidl::encoding::encode_in_envelope::<
12566                    Syslog,
12567                    fidl::encoding::DefaultFuchsiaResourceDialect,
12568                >(
12569                    <Syslog as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12570                    encoder,
12571                    offset + 8,
12572                    _depth,
12573                ),
12574                Artifact::Custom(ref mut val) => fidl::encoding::encode_in_envelope::<
12575                    CustomArtifact,
12576                    fidl::encoding::DefaultFuchsiaResourceDialect,
12577                >(
12578                    <CustomArtifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12579                    encoder,
12580                    offset + 8,
12581                    _depth,
12582                ),
12583                Artifact::DebugData(ref mut val) => {
12584                    fidl::encoding::encode_in_envelope::<
12585                        fidl::encoding::Endpoint<
12586                            fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
12587                        >,
12588                        fidl::encoding::DefaultFuchsiaResourceDialect,
12589                    >(
12590                        <fidl::encoding::Endpoint<
12591                            fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
12592                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12593                            val
12594                        ),
12595                        encoder,
12596                        offset + 8,
12597                        _depth,
12598                    )
12599                }
12600                Artifact::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
12601            }
12602        }
12603    }
12604
12605    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Artifact {
12606        #[inline(always)]
12607        fn new_empty() -> Self {
12608            Self::__SourceBreaking { unknown_ordinal: 0 }
12609        }
12610
12611        #[inline]
12612        unsafe fn decode(
12613            &mut self,
12614            decoder: &mut fidl::encoding::Decoder<
12615                '_,
12616                fidl::encoding::DefaultFuchsiaResourceDialect,
12617            >,
12618            offset: usize,
12619            mut depth: fidl::encoding::Depth,
12620        ) -> fidl::Result<()> {
12621            decoder.debug_check_bounds::<Self>(offset);
12622            #[allow(unused_variables)]
12623            let next_out_of_line = decoder.next_out_of_line();
12624            let handles_before = decoder.remaining_handles();
12625            let (ordinal, inlined, num_bytes, num_handles) =
12626                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12627
12628            let member_inline_size =
12629                match ordinal {
12630                    1 => <fidl::encoding::HandleType<
12631                        fidl::Socket,
12632                        { fidl::ObjectType::SOCKET.into_raw() },
12633                        2147483648,
12634                    > as fidl::encoding::TypeMarker>::inline_size(
12635                        decoder.context
12636                    ),
12637                    2 => <fidl::encoding::HandleType<
12638                        fidl::Socket,
12639                        { fidl::ObjectType::SOCKET.into_raw() },
12640                        2147483648,
12641                    > as fidl::encoding::TypeMarker>::inline_size(
12642                        decoder.context
12643                    ),
12644                    3 => <Syslog as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12645                    4 => {
12646                        <CustomArtifact as fidl::encoding::TypeMarker>::inline_size(decoder.context)
12647                    }
12648                    5 => <fidl::encoding::Endpoint<
12649                        fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
12650                    > as fidl::encoding::TypeMarker>::inline_size(
12651                        decoder.context
12652                    ),
12653                    0 => return Err(fidl::Error::UnknownUnionTag),
12654                    _ => num_bytes as usize,
12655                };
12656
12657            if inlined != (member_inline_size <= 4) {
12658                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12659            }
12660            let _inner_offset;
12661            if inlined {
12662                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12663                _inner_offset = offset + 8;
12664            } else {
12665                depth.increment()?;
12666                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12667            }
12668            match ordinal {
12669                1 => {
12670                    #[allow(irrefutable_let_patterns)]
12671                    if let Artifact::Stdout(_) = self {
12672                        // Do nothing, read the value into the object
12673                    } else {
12674                        // Initialize `self` to the right variant
12675                        *self = Artifact::Stdout(
12676                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12677                        );
12678                    }
12679                    #[allow(irrefutable_let_patterns)]
12680                    if let Artifact::Stdout(ref mut val) = self {
12681                        fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
12682                    } else {
12683                        unreachable!()
12684                    }
12685                }
12686                2 => {
12687                    #[allow(irrefutable_let_patterns)]
12688                    if let Artifact::Stderr(_) = self {
12689                        // Do nothing, read the value into the object
12690                    } else {
12691                        // Initialize `self` to the right variant
12692                        *self = Artifact::Stderr(
12693                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12694                        );
12695                    }
12696                    #[allow(irrefutable_let_patterns)]
12697                    if let Artifact::Stderr(ref mut val) = self {
12698                        fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
12699                    } else {
12700                        unreachable!()
12701                    }
12702                }
12703                3 => {
12704                    #[allow(irrefutable_let_patterns)]
12705                    if let Artifact::Log(_) = self {
12706                        // Do nothing, read the value into the object
12707                    } else {
12708                        // Initialize `self` to the right variant
12709                        *self = Artifact::Log(fidl::new_empty!(
12710                            Syslog,
12711                            fidl::encoding::DefaultFuchsiaResourceDialect
12712                        ));
12713                    }
12714                    #[allow(irrefutable_let_patterns)]
12715                    if let Artifact::Log(ref mut val) = self {
12716                        fidl::decode!(
12717                            Syslog,
12718                            fidl::encoding::DefaultFuchsiaResourceDialect,
12719                            val,
12720                            decoder,
12721                            _inner_offset,
12722                            depth
12723                        )?;
12724                    } else {
12725                        unreachable!()
12726                    }
12727                }
12728                4 => {
12729                    #[allow(irrefutable_let_patterns)]
12730                    if let Artifact::Custom(_) = self {
12731                        // Do nothing, read the value into the object
12732                    } else {
12733                        // Initialize `self` to the right variant
12734                        *self = Artifact::Custom(fidl::new_empty!(
12735                            CustomArtifact,
12736                            fidl::encoding::DefaultFuchsiaResourceDialect
12737                        ));
12738                    }
12739                    #[allow(irrefutable_let_patterns)]
12740                    if let Artifact::Custom(ref mut val) = self {
12741                        fidl::decode!(
12742                            CustomArtifact,
12743                            fidl::encoding::DefaultFuchsiaResourceDialect,
12744                            val,
12745                            decoder,
12746                            _inner_offset,
12747                            depth
12748                        )?;
12749                    } else {
12750                        unreachable!()
12751                    }
12752                }
12753                5 => {
12754                    #[allow(irrefutable_let_patterns)]
12755                    if let Artifact::DebugData(_) = self {
12756                        // Do nothing, read the value into the object
12757                    } else {
12758                        // Initialize `self` to the right variant
12759                        *self = Artifact::DebugData(fidl::new_empty!(
12760                            fidl::encoding::Endpoint<
12761                                fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
12762                            >,
12763                            fidl::encoding::DefaultFuchsiaResourceDialect
12764                        ));
12765                    }
12766                    #[allow(irrefutable_let_patterns)]
12767                    if let Artifact::DebugData(ref mut val) = self {
12768                        fidl::decode!(
12769                            fidl::encoding::Endpoint<
12770                                fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
12771                            >,
12772                            fidl::encoding::DefaultFuchsiaResourceDialect,
12773                            val,
12774                            decoder,
12775                            _inner_offset,
12776                            depth
12777                        )?;
12778                    } else {
12779                        unreachable!()
12780                    }
12781                }
12782                #[allow(deprecated)]
12783                ordinal => {
12784                    for _ in 0..num_handles {
12785                        decoder.drop_next_handle()?;
12786                    }
12787                    *self = Artifact::__SourceBreaking { unknown_ordinal: ordinal };
12788                }
12789            }
12790            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12791                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12792            }
12793            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12794                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12795            }
12796            Ok(())
12797        }
12798    }
12799
12800    impl fidl::encoding::ResourceTypeMarker for EventDetails {
12801        type Borrowed<'a> = &'a mut Self;
12802        fn take_or_borrow<'a>(
12803            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12804        ) -> Self::Borrowed<'a> {
12805            value
12806        }
12807    }
12808
12809    unsafe impl fidl::encoding::TypeMarker for EventDetails {
12810        type Owned = Self;
12811
12812        #[inline(always)]
12813        fn inline_align(_context: fidl::encoding::Context) -> usize {
12814            8
12815        }
12816
12817        #[inline(always)]
12818        fn inline_size(_context: fidl::encoding::Context) -> usize {
12819            16
12820        }
12821    }
12822
12823    unsafe impl fidl::encoding::Encode<EventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>
12824        for &mut EventDetails
12825    {
12826        #[inline]
12827        unsafe fn encode(
12828            self,
12829            encoder: &mut fidl::encoding::Encoder<
12830                '_,
12831                fidl::encoding::DefaultFuchsiaResourceDialect,
12832            >,
12833            offset: usize,
12834            _depth: fidl::encoding::Depth,
12835        ) -> fidl::Result<()> {
12836            encoder.debug_check_bounds::<EventDetails>(offset);
12837            encoder.write_num::<u64>(self.ordinal(), offset);
12838            match self {
12839            EventDetails::SuiteStarted(ref val) => {
12840                fidl::encoding::encode_in_envelope::<SuiteStartedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12841                    <SuiteStartedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12842                    encoder, offset + 8, _depth
12843                )
12844            }
12845            EventDetails::TestCaseFound(ref val) => {
12846                fidl::encoding::encode_in_envelope::<TestCaseFoundEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12847                    <TestCaseFoundEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12848                    encoder, offset + 8, _depth
12849                )
12850            }
12851            EventDetails::TestCaseStarted(ref val) => {
12852                fidl::encoding::encode_in_envelope::<TestCaseStartedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12853                    <TestCaseStartedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12854                    encoder, offset + 8, _depth
12855                )
12856            }
12857            EventDetails::TestCaseArtifactGenerated(ref mut val) => {
12858                fidl::encoding::encode_in_envelope::<TestCaseArtifactGeneratedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12859                    <TestCaseArtifactGeneratedEventDetails as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12860                    encoder, offset + 8, _depth
12861                )
12862            }
12863            EventDetails::TestCaseStopped(ref val) => {
12864                fidl::encoding::encode_in_envelope::<TestCaseStoppedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12865                    <TestCaseStoppedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12866                    encoder, offset + 8, _depth
12867                )
12868            }
12869            EventDetails::TestCaseFinished(ref val) => {
12870                fidl::encoding::encode_in_envelope::<TestCaseFinishedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12871                    <TestCaseFinishedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12872                    encoder, offset + 8, _depth
12873                )
12874            }
12875            EventDetails::SuiteArtifactGenerated(ref mut val) => {
12876                fidl::encoding::encode_in_envelope::<SuiteArtifactGeneratedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12877                    <SuiteArtifactGeneratedEventDetails as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12878                    encoder, offset + 8, _depth
12879                )
12880            }
12881            EventDetails::SuiteStopped(ref val) => {
12882                fidl::encoding::encode_in_envelope::<SuiteStoppedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
12883                    <SuiteStoppedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
12884                    encoder, offset + 8, _depth
12885                )
12886            }
12887            EventDetails::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
12888        }
12889        }
12890    }
12891
12892    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for EventDetails {
12893        #[inline(always)]
12894        fn new_empty() -> Self {
12895            Self::__SourceBreaking { unknown_ordinal: 0 }
12896        }
12897
12898        #[inline]
12899        unsafe fn decode(
12900            &mut self,
12901            decoder: &mut fidl::encoding::Decoder<
12902                '_,
12903                fidl::encoding::DefaultFuchsiaResourceDialect,
12904            >,
12905            offset: usize,
12906            mut depth: fidl::encoding::Depth,
12907        ) -> fidl::Result<()> {
12908            decoder.debug_check_bounds::<Self>(offset);
12909            #[allow(unused_variables)]
12910            let next_out_of_line = decoder.next_out_of_line();
12911            let handles_before = decoder.remaining_handles();
12912            let (ordinal, inlined, num_bytes, num_handles) =
12913                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12914
12915            let member_inline_size = match ordinal {
12916            1 => <SuiteStartedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12917            2 => <TestCaseFoundEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12918            3 => <TestCaseStartedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12919            4 => <TestCaseArtifactGeneratedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12920            5 => <TestCaseStoppedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12921            6 => <TestCaseFinishedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12922            7 => <SuiteArtifactGeneratedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12923            8 => <SuiteStoppedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12924            0 => return Err(fidl::Error::UnknownUnionTag),
12925            _ => num_bytes as usize,
12926        };
12927
12928            if inlined != (member_inline_size <= 4) {
12929                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12930            }
12931            let _inner_offset;
12932            if inlined {
12933                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12934                _inner_offset = offset + 8;
12935            } else {
12936                depth.increment()?;
12937                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12938            }
12939            match ordinal {
12940                1 => {
12941                    #[allow(irrefutable_let_patterns)]
12942                    if let EventDetails::SuiteStarted(_) = self {
12943                        // Do nothing, read the value into the object
12944                    } else {
12945                        // Initialize `self` to the right variant
12946                        *self = EventDetails::SuiteStarted(fidl::new_empty!(
12947                            SuiteStartedEventDetails,
12948                            fidl::encoding::DefaultFuchsiaResourceDialect
12949                        ));
12950                    }
12951                    #[allow(irrefutable_let_patterns)]
12952                    if let EventDetails::SuiteStarted(ref mut val) = self {
12953                        fidl::decode!(
12954                            SuiteStartedEventDetails,
12955                            fidl::encoding::DefaultFuchsiaResourceDialect,
12956                            val,
12957                            decoder,
12958                            _inner_offset,
12959                            depth
12960                        )?;
12961                    } else {
12962                        unreachable!()
12963                    }
12964                }
12965                2 => {
12966                    #[allow(irrefutable_let_patterns)]
12967                    if let EventDetails::TestCaseFound(_) = self {
12968                        // Do nothing, read the value into the object
12969                    } else {
12970                        // Initialize `self` to the right variant
12971                        *self = EventDetails::TestCaseFound(fidl::new_empty!(
12972                            TestCaseFoundEventDetails,
12973                            fidl::encoding::DefaultFuchsiaResourceDialect
12974                        ));
12975                    }
12976                    #[allow(irrefutable_let_patterns)]
12977                    if let EventDetails::TestCaseFound(ref mut val) = self {
12978                        fidl::decode!(
12979                            TestCaseFoundEventDetails,
12980                            fidl::encoding::DefaultFuchsiaResourceDialect,
12981                            val,
12982                            decoder,
12983                            _inner_offset,
12984                            depth
12985                        )?;
12986                    } else {
12987                        unreachable!()
12988                    }
12989                }
12990                3 => {
12991                    #[allow(irrefutable_let_patterns)]
12992                    if let EventDetails::TestCaseStarted(_) = self {
12993                        // Do nothing, read the value into the object
12994                    } else {
12995                        // Initialize `self` to the right variant
12996                        *self = EventDetails::TestCaseStarted(fidl::new_empty!(
12997                            TestCaseStartedEventDetails,
12998                            fidl::encoding::DefaultFuchsiaResourceDialect
12999                        ));
13000                    }
13001                    #[allow(irrefutable_let_patterns)]
13002                    if let EventDetails::TestCaseStarted(ref mut val) = self {
13003                        fidl::decode!(
13004                            TestCaseStartedEventDetails,
13005                            fidl::encoding::DefaultFuchsiaResourceDialect,
13006                            val,
13007                            decoder,
13008                            _inner_offset,
13009                            depth
13010                        )?;
13011                    } else {
13012                        unreachable!()
13013                    }
13014                }
13015                4 => {
13016                    #[allow(irrefutable_let_patterns)]
13017                    if let EventDetails::TestCaseArtifactGenerated(_) = self {
13018                        // Do nothing, read the value into the object
13019                    } else {
13020                        // Initialize `self` to the right variant
13021                        *self = EventDetails::TestCaseArtifactGenerated(fidl::new_empty!(
13022                            TestCaseArtifactGeneratedEventDetails,
13023                            fidl::encoding::DefaultFuchsiaResourceDialect
13024                        ));
13025                    }
13026                    #[allow(irrefutable_let_patterns)]
13027                    if let EventDetails::TestCaseArtifactGenerated(ref mut val) = self {
13028                        fidl::decode!(
13029                            TestCaseArtifactGeneratedEventDetails,
13030                            fidl::encoding::DefaultFuchsiaResourceDialect,
13031                            val,
13032                            decoder,
13033                            _inner_offset,
13034                            depth
13035                        )?;
13036                    } else {
13037                        unreachable!()
13038                    }
13039                }
13040                5 => {
13041                    #[allow(irrefutable_let_patterns)]
13042                    if let EventDetails::TestCaseStopped(_) = self {
13043                        // Do nothing, read the value into the object
13044                    } else {
13045                        // Initialize `self` to the right variant
13046                        *self = EventDetails::TestCaseStopped(fidl::new_empty!(
13047                            TestCaseStoppedEventDetails,
13048                            fidl::encoding::DefaultFuchsiaResourceDialect
13049                        ));
13050                    }
13051                    #[allow(irrefutable_let_patterns)]
13052                    if let EventDetails::TestCaseStopped(ref mut val) = self {
13053                        fidl::decode!(
13054                            TestCaseStoppedEventDetails,
13055                            fidl::encoding::DefaultFuchsiaResourceDialect,
13056                            val,
13057                            decoder,
13058                            _inner_offset,
13059                            depth
13060                        )?;
13061                    } else {
13062                        unreachable!()
13063                    }
13064                }
13065                6 => {
13066                    #[allow(irrefutable_let_patterns)]
13067                    if let EventDetails::TestCaseFinished(_) = self {
13068                        // Do nothing, read the value into the object
13069                    } else {
13070                        // Initialize `self` to the right variant
13071                        *self = EventDetails::TestCaseFinished(fidl::new_empty!(
13072                            TestCaseFinishedEventDetails,
13073                            fidl::encoding::DefaultFuchsiaResourceDialect
13074                        ));
13075                    }
13076                    #[allow(irrefutable_let_patterns)]
13077                    if let EventDetails::TestCaseFinished(ref mut val) = self {
13078                        fidl::decode!(
13079                            TestCaseFinishedEventDetails,
13080                            fidl::encoding::DefaultFuchsiaResourceDialect,
13081                            val,
13082                            decoder,
13083                            _inner_offset,
13084                            depth
13085                        )?;
13086                    } else {
13087                        unreachable!()
13088                    }
13089                }
13090                7 => {
13091                    #[allow(irrefutable_let_patterns)]
13092                    if let EventDetails::SuiteArtifactGenerated(_) = self {
13093                        // Do nothing, read the value into the object
13094                    } else {
13095                        // Initialize `self` to the right variant
13096                        *self = EventDetails::SuiteArtifactGenerated(fidl::new_empty!(
13097                            SuiteArtifactGeneratedEventDetails,
13098                            fidl::encoding::DefaultFuchsiaResourceDialect
13099                        ));
13100                    }
13101                    #[allow(irrefutable_let_patterns)]
13102                    if let EventDetails::SuiteArtifactGenerated(ref mut val) = self {
13103                        fidl::decode!(
13104                            SuiteArtifactGeneratedEventDetails,
13105                            fidl::encoding::DefaultFuchsiaResourceDialect,
13106                            val,
13107                            decoder,
13108                            _inner_offset,
13109                            depth
13110                        )?;
13111                    } else {
13112                        unreachable!()
13113                    }
13114                }
13115                8 => {
13116                    #[allow(irrefutable_let_patterns)]
13117                    if let EventDetails::SuiteStopped(_) = self {
13118                        // Do nothing, read the value into the object
13119                    } else {
13120                        // Initialize `self` to the right variant
13121                        *self = EventDetails::SuiteStopped(fidl::new_empty!(
13122                            SuiteStoppedEventDetails,
13123                            fidl::encoding::DefaultFuchsiaResourceDialect
13124                        ));
13125                    }
13126                    #[allow(irrefutable_let_patterns)]
13127                    if let EventDetails::SuiteStopped(ref mut val) = self {
13128                        fidl::decode!(
13129                            SuiteStoppedEventDetails,
13130                            fidl::encoding::DefaultFuchsiaResourceDialect,
13131                            val,
13132                            decoder,
13133                            _inner_offset,
13134                            depth
13135                        )?;
13136                    } else {
13137                        unreachable!()
13138                    }
13139                }
13140                #[allow(deprecated)]
13141                ordinal => {
13142                    for _ in 0..num_handles {
13143                        decoder.drop_next_handle()?;
13144                    }
13145                    *self = EventDetails::__SourceBreaking { unknown_ordinal: ordinal };
13146                }
13147            }
13148            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13149                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13150            }
13151            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13152                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13153            }
13154            Ok(())
13155        }
13156    }
13157
13158    impl fidl::encoding::ResourceTypeMarker for LogsIterator {
13159        type Borrowed<'a> = &'a mut Self;
13160        fn take_or_borrow<'a>(
13161            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13162        ) -> Self::Borrowed<'a> {
13163            value
13164        }
13165    }
13166
13167    unsafe impl fidl::encoding::TypeMarker for LogsIterator {
13168        type Owned = Self;
13169
13170        #[inline(always)]
13171        fn inline_align(_context: fidl::encoding::Context) -> usize {
13172            8
13173        }
13174
13175        #[inline(always)]
13176        fn inline_size(_context: fidl::encoding::Context) -> usize {
13177            16
13178        }
13179    }
13180
13181    unsafe impl fidl::encoding::Encode<LogsIterator, fidl::encoding::DefaultFuchsiaResourceDialect>
13182        for &mut LogsIterator
13183    {
13184        #[inline]
13185        unsafe fn encode(
13186            self,
13187            encoder: &mut fidl::encoding::Encoder<
13188                '_,
13189                fidl::encoding::DefaultFuchsiaResourceDialect,
13190            >,
13191            offset: usize,
13192            _depth: fidl::encoding::Depth,
13193        ) -> fidl::Result<()> {
13194            encoder.debug_check_bounds::<LogsIterator>(offset);
13195            encoder.write_num::<u64>(self.ordinal(), offset);
13196            match self {
13197                LogsIterator::Batch(ref mut val) => fidl::encoding::encode_in_envelope::<
13198                    fidl::encoding::Endpoint<
13199                        fidl::endpoints::ServerEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13200                    >,
13201                    fidl::encoding::DefaultFuchsiaResourceDialect,
13202                >(
13203                    <fidl::encoding::Endpoint<
13204                        fidl::endpoints::ServerEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13205                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13206                        val
13207                    ),
13208                    encoder,
13209                    offset + 8,
13210                    _depth,
13211                ),
13212                LogsIterator::Stream(ref mut val) => fidl::encoding::encode_in_envelope::<
13213                    fidl::encoding::HandleType<
13214                        fidl::Socket,
13215                        { fidl::ObjectType::SOCKET.into_raw() },
13216                        16392,
13217                    >,
13218                    fidl::encoding::DefaultFuchsiaResourceDialect,
13219                >(
13220                    <fidl::encoding::HandleType<
13221                        fidl::Socket,
13222                        { fidl::ObjectType::SOCKET.into_raw() },
13223                        16392,
13224                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13225                        val
13226                    ),
13227                    encoder,
13228                    offset + 8,
13229                    _depth,
13230                ),
13231                LogsIterator::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
13232            }
13233        }
13234    }
13235
13236    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for LogsIterator {
13237        #[inline(always)]
13238        fn new_empty() -> Self {
13239            Self::__SourceBreaking { unknown_ordinal: 0 }
13240        }
13241
13242        #[inline]
13243        unsafe fn decode(
13244            &mut self,
13245            decoder: &mut fidl::encoding::Decoder<
13246                '_,
13247                fidl::encoding::DefaultFuchsiaResourceDialect,
13248            >,
13249            offset: usize,
13250            mut depth: fidl::encoding::Depth,
13251        ) -> fidl::Result<()> {
13252            decoder.debug_check_bounds::<Self>(offset);
13253            #[allow(unused_variables)]
13254            let next_out_of_line = decoder.next_out_of_line();
13255            let handles_before = decoder.remaining_handles();
13256            let (ordinal, inlined, num_bytes, num_handles) =
13257                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13258
13259            let member_inline_size = match ordinal {
13260                2 => <fidl::encoding::Endpoint<
13261                    fidl::endpoints::ServerEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13262                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13263                3 => <fidl::encoding::HandleType<
13264                    fidl::Socket,
13265                    { fidl::ObjectType::SOCKET.into_raw() },
13266                    16392,
13267                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13268                0 => return Err(fidl::Error::UnknownUnionTag),
13269                _ => num_bytes as usize,
13270            };
13271
13272            if inlined != (member_inline_size <= 4) {
13273                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13274            }
13275            let _inner_offset;
13276            if inlined {
13277                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13278                _inner_offset = offset + 8;
13279            } else {
13280                depth.increment()?;
13281                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13282            }
13283            match ordinal {
13284                2 => {
13285                    #[allow(irrefutable_let_patterns)]
13286                    if let LogsIterator::Batch(_) = self {
13287                        // Do nothing, read the value into the object
13288                    } else {
13289                        // Initialize `self` to the right variant
13290                        *self = LogsIterator::Batch(fidl::new_empty!(
13291                            fidl::encoding::Endpoint<
13292                                fidl::endpoints::ServerEnd<
13293                                    fidl_fuchsia_diagnostics::BatchIteratorMarker,
13294                                >,
13295                            >,
13296                            fidl::encoding::DefaultFuchsiaResourceDialect
13297                        ));
13298                    }
13299                    #[allow(irrefutable_let_patterns)]
13300                    if let LogsIterator::Batch(ref mut val) = self {
13301                        fidl::decode!(
13302                            fidl::encoding::Endpoint<
13303                                fidl::endpoints::ServerEnd<
13304                                    fidl_fuchsia_diagnostics::BatchIteratorMarker,
13305                                >,
13306                            >,
13307                            fidl::encoding::DefaultFuchsiaResourceDialect,
13308                            val,
13309                            decoder,
13310                            _inner_offset,
13311                            depth
13312                        )?;
13313                    } else {
13314                        unreachable!()
13315                    }
13316                }
13317                3 => {
13318                    #[allow(irrefutable_let_patterns)]
13319                    if let LogsIterator::Stream(_) = self {
13320                        // Do nothing, read the value into the object
13321                    } else {
13322                        // Initialize `self` to the right variant
13323                        *self = LogsIterator::Stream(
13324                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 16392>, fidl::encoding::DefaultFuchsiaResourceDialect),
13325                        );
13326                    }
13327                    #[allow(irrefutable_let_patterns)]
13328                    if let LogsIterator::Stream(ref mut val) = self {
13329                        fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 16392>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
13330                    } else {
13331                        unreachable!()
13332                    }
13333                }
13334                #[allow(deprecated)]
13335                ordinal => {
13336                    for _ in 0..num_handles {
13337                        decoder.drop_next_handle()?;
13338                    }
13339                    *self = LogsIterator::__SourceBreaking { unknown_ordinal: ordinal };
13340                }
13341            }
13342            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13343                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13344            }
13345            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13346                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13347            }
13348            Ok(())
13349        }
13350    }
13351
13352    impl fidl::encoding::ResourceTypeMarker for RunEventPayload {
13353        type Borrowed<'a> = &'a mut Self;
13354        fn take_or_borrow<'a>(
13355            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13356        ) -> Self::Borrowed<'a> {
13357            value
13358        }
13359    }
13360
13361    unsafe impl fidl::encoding::TypeMarker for RunEventPayload {
13362        type Owned = Self;
13363
13364        #[inline(always)]
13365        fn inline_align(_context: fidl::encoding::Context) -> usize {
13366            8
13367        }
13368
13369        #[inline(always)]
13370        fn inline_size(_context: fidl::encoding::Context) -> usize {
13371            16
13372        }
13373    }
13374
13375    unsafe impl
13376        fidl::encoding::Encode<RunEventPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13377        for &mut RunEventPayload
13378    {
13379        #[inline]
13380        unsafe fn encode(
13381            self,
13382            encoder: &mut fidl::encoding::Encoder<
13383                '_,
13384                fidl::encoding::DefaultFuchsiaResourceDialect,
13385            >,
13386            offset: usize,
13387            _depth: fidl::encoding::Depth,
13388        ) -> fidl::Result<()> {
13389            encoder.debug_check_bounds::<RunEventPayload>(offset);
13390            encoder.write_num::<u64>(self.ordinal(), offset);
13391            match self {
13392                RunEventPayload::RunStarted(ref val) => fidl::encoding::encode_in_envelope::<
13393                    RunStarted,
13394                    fidl::encoding::DefaultFuchsiaResourceDialect,
13395                >(
13396                    <RunStarted as fidl::encoding::ValueTypeMarker>::borrow(val),
13397                    encoder,
13398                    offset + 8,
13399                    _depth,
13400                ),
13401                RunEventPayload::RunStopped(ref val) => fidl::encoding::encode_in_envelope::<
13402                    RunStopped,
13403                    fidl::encoding::DefaultFuchsiaResourceDialect,
13404                >(
13405                    <RunStopped as fidl::encoding::ValueTypeMarker>::borrow(val),
13406                    encoder,
13407                    offset + 8,
13408                    _depth,
13409                ),
13410                RunEventPayload::Artifact(ref mut val) => fidl::encoding::encode_in_envelope::<
13411                    Artifact,
13412                    fidl::encoding::DefaultFuchsiaResourceDialect,
13413                >(
13414                    <Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13415                    encoder,
13416                    offset + 8,
13417                    _depth,
13418                ),
13419                RunEventPayload::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
13420            }
13421        }
13422    }
13423
13424    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13425        for RunEventPayload
13426    {
13427        #[inline(always)]
13428        fn new_empty() -> Self {
13429            Self::__SourceBreaking { unknown_ordinal: 0 }
13430        }
13431
13432        #[inline]
13433        unsafe fn decode(
13434            &mut self,
13435            decoder: &mut fidl::encoding::Decoder<
13436                '_,
13437                fidl::encoding::DefaultFuchsiaResourceDialect,
13438            >,
13439            offset: usize,
13440            mut depth: fidl::encoding::Depth,
13441        ) -> fidl::Result<()> {
13442            decoder.debug_check_bounds::<Self>(offset);
13443            #[allow(unused_variables)]
13444            let next_out_of_line = decoder.next_out_of_line();
13445            let handles_before = decoder.remaining_handles();
13446            let (ordinal, inlined, num_bytes, num_handles) =
13447                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13448
13449            let member_inline_size = match ordinal {
13450                1 => <RunStarted as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13451                2 => <RunStopped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13452                3 => <Artifact as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13453                0 => return Err(fidl::Error::UnknownUnionTag),
13454                _ => num_bytes as usize,
13455            };
13456
13457            if inlined != (member_inline_size <= 4) {
13458                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13459            }
13460            let _inner_offset;
13461            if inlined {
13462                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13463                _inner_offset = offset + 8;
13464            } else {
13465                depth.increment()?;
13466                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13467            }
13468            match ordinal {
13469                1 => {
13470                    #[allow(irrefutable_let_patterns)]
13471                    if let RunEventPayload::RunStarted(_) = self {
13472                        // Do nothing, read the value into the object
13473                    } else {
13474                        // Initialize `self` to the right variant
13475                        *self = RunEventPayload::RunStarted(fidl::new_empty!(
13476                            RunStarted,
13477                            fidl::encoding::DefaultFuchsiaResourceDialect
13478                        ));
13479                    }
13480                    #[allow(irrefutable_let_patterns)]
13481                    if let RunEventPayload::RunStarted(ref mut val) = self {
13482                        fidl::decode!(
13483                            RunStarted,
13484                            fidl::encoding::DefaultFuchsiaResourceDialect,
13485                            val,
13486                            decoder,
13487                            _inner_offset,
13488                            depth
13489                        )?;
13490                    } else {
13491                        unreachable!()
13492                    }
13493                }
13494                2 => {
13495                    #[allow(irrefutable_let_patterns)]
13496                    if let RunEventPayload::RunStopped(_) = self {
13497                        // Do nothing, read the value into the object
13498                    } else {
13499                        // Initialize `self` to the right variant
13500                        *self = RunEventPayload::RunStopped(fidl::new_empty!(
13501                            RunStopped,
13502                            fidl::encoding::DefaultFuchsiaResourceDialect
13503                        ));
13504                    }
13505                    #[allow(irrefutable_let_patterns)]
13506                    if let RunEventPayload::RunStopped(ref mut val) = self {
13507                        fidl::decode!(
13508                            RunStopped,
13509                            fidl::encoding::DefaultFuchsiaResourceDialect,
13510                            val,
13511                            decoder,
13512                            _inner_offset,
13513                            depth
13514                        )?;
13515                    } else {
13516                        unreachable!()
13517                    }
13518                }
13519                3 => {
13520                    #[allow(irrefutable_let_patterns)]
13521                    if let RunEventPayload::Artifact(_) = self {
13522                        // Do nothing, read the value into the object
13523                    } else {
13524                        // Initialize `self` to the right variant
13525                        *self = RunEventPayload::Artifact(fidl::new_empty!(
13526                            Artifact,
13527                            fidl::encoding::DefaultFuchsiaResourceDialect
13528                        ));
13529                    }
13530                    #[allow(irrefutable_let_patterns)]
13531                    if let RunEventPayload::Artifact(ref mut val) = self {
13532                        fidl::decode!(
13533                            Artifact,
13534                            fidl::encoding::DefaultFuchsiaResourceDialect,
13535                            val,
13536                            decoder,
13537                            _inner_offset,
13538                            depth
13539                        )?;
13540                    } else {
13541                        unreachable!()
13542                    }
13543                }
13544                #[allow(deprecated)]
13545                ordinal => {
13546                    for _ in 0..num_handles {
13547                        decoder.drop_next_handle()?;
13548                    }
13549                    *self = RunEventPayload::__SourceBreaking { unknown_ordinal: ordinal };
13550                }
13551            }
13552            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13553                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13554            }
13555            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13556                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13557            }
13558            Ok(())
13559        }
13560    }
13561
13562    impl fidl::encoding::ResourceTypeMarker for SuiteEventPayload {
13563        type Borrowed<'a> = &'a mut Self;
13564        fn take_or_borrow<'a>(
13565            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13566        ) -> Self::Borrowed<'a> {
13567            value
13568        }
13569    }
13570
13571    unsafe impl fidl::encoding::TypeMarker for SuiteEventPayload {
13572        type Owned = Self;
13573
13574        #[inline(always)]
13575        fn inline_align(_context: fidl::encoding::Context) -> usize {
13576            8
13577        }
13578
13579        #[inline(always)]
13580        fn inline_size(_context: fidl::encoding::Context) -> usize {
13581            16
13582        }
13583    }
13584
13585    unsafe impl
13586        fidl::encoding::Encode<SuiteEventPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13587        for &mut SuiteEventPayload
13588    {
13589        #[inline]
13590        unsafe fn encode(
13591            self,
13592            encoder: &mut fidl::encoding::Encoder<
13593                '_,
13594                fidl::encoding::DefaultFuchsiaResourceDialect,
13595            >,
13596            offset: usize,
13597            _depth: fidl::encoding::Depth,
13598        ) -> fidl::Result<()> {
13599            encoder.debug_check_bounds::<SuiteEventPayload>(offset);
13600            encoder.write_num::<u64>(self.ordinal(), offset);
13601            match self {
13602                SuiteEventPayload::CaseFound(ref val) => fidl::encoding::encode_in_envelope::<
13603                    CaseFound,
13604                    fidl::encoding::DefaultFuchsiaResourceDialect,
13605                >(
13606                    <CaseFound as fidl::encoding::ValueTypeMarker>::borrow(val),
13607                    encoder,
13608                    offset + 8,
13609                    _depth,
13610                ),
13611                SuiteEventPayload::CaseStarted(ref val) => fidl::encoding::encode_in_envelope::<
13612                    CaseStarted,
13613                    fidl::encoding::DefaultFuchsiaResourceDialect,
13614                >(
13615                    <CaseStarted as fidl::encoding::ValueTypeMarker>::borrow(val),
13616                    encoder,
13617                    offset + 8,
13618                    _depth,
13619                ),
13620                SuiteEventPayload::CaseStopped(ref val) => fidl::encoding::encode_in_envelope::<
13621                    CaseStopped,
13622                    fidl::encoding::DefaultFuchsiaResourceDialect,
13623                >(
13624                    <CaseStopped as fidl::encoding::ValueTypeMarker>::borrow(val),
13625                    encoder,
13626                    offset + 8,
13627                    _depth,
13628                ),
13629                SuiteEventPayload::CaseFinished(ref val) => fidl::encoding::encode_in_envelope::<
13630                    CaseFinished,
13631                    fidl::encoding::DefaultFuchsiaResourceDialect,
13632                >(
13633                    <CaseFinished as fidl::encoding::ValueTypeMarker>::borrow(val),
13634                    encoder,
13635                    offset + 8,
13636                    _depth,
13637                ),
13638                SuiteEventPayload::CaseArtifact(ref mut val) => {
13639                    fidl::encoding::encode_in_envelope::<
13640                        CaseArtifact,
13641                        fidl::encoding::DefaultFuchsiaResourceDialect,
13642                    >(
13643                        <CaseArtifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13644                        encoder,
13645                        offset + 8,
13646                        _depth,
13647                    )
13648                }
13649                SuiteEventPayload::SuiteArtifact(ref mut val) => {
13650                    fidl::encoding::encode_in_envelope::<
13651                        SuiteArtifact,
13652                        fidl::encoding::DefaultFuchsiaResourceDialect,
13653                    >(
13654                        <SuiteArtifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13655                        encoder,
13656                        offset + 8,
13657                        _depth,
13658                    )
13659                }
13660                SuiteEventPayload::SuiteStarted(ref val) => fidl::encoding::encode_in_envelope::<
13661                    SuiteStarted,
13662                    fidl::encoding::DefaultFuchsiaResourceDialect,
13663                >(
13664                    <SuiteStarted as fidl::encoding::ValueTypeMarker>::borrow(val),
13665                    encoder,
13666                    offset + 8,
13667                    _depth,
13668                ),
13669                SuiteEventPayload::SuiteStopped(ref val) => fidl::encoding::encode_in_envelope::<
13670                    SuiteStopped,
13671                    fidl::encoding::DefaultFuchsiaResourceDialect,
13672                >(
13673                    <SuiteStopped as fidl::encoding::ValueTypeMarker>::borrow(val),
13674                    encoder,
13675                    offset + 8,
13676                    _depth,
13677                ),
13678                SuiteEventPayload::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
13679            }
13680        }
13681    }
13682
13683    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13684        for SuiteEventPayload
13685    {
13686        #[inline(always)]
13687        fn new_empty() -> Self {
13688            Self::__SourceBreaking { unknown_ordinal: 0 }
13689        }
13690
13691        #[inline]
13692        unsafe fn decode(
13693            &mut self,
13694            decoder: &mut fidl::encoding::Decoder<
13695                '_,
13696                fidl::encoding::DefaultFuchsiaResourceDialect,
13697            >,
13698            offset: usize,
13699            mut depth: fidl::encoding::Depth,
13700        ) -> fidl::Result<()> {
13701            decoder.debug_check_bounds::<Self>(offset);
13702            #[allow(unused_variables)]
13703            let next_out_of_line = decoder.next_out_of_line();
13704            let handles_before = decoder.remaining_handles();
13705            let (ordinal, inlined, num_bytes, num_handles) =
13706                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13707
13708            let member_inline_size = match ordinal {
13709                1 => <CaseFound as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13710                2 => <CaseStarted as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13711                3 => <CaseStopped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13712                4 => <CaseFinished as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13713                5 => <CaseArtifact as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13714                6 => <SuiteArtifact as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13715                7 => <SuiteStarted as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13716                8 => <SuiteStopped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13717                0 => return Err(fidl::Error::UnknownUnionTag),
13718                _ => num_bytes as usize,
13719            };
13720
13721            if inlined != (member_inline_size <= 4) {
13722                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13723            }
13724            let _inner_offset;
13725            if inlined {
13726                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13727                _inner_offset = offset + 8;
13728            } else {
13729                depth.increment()?;
13730                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13731            }
13732            match ordinal {
13733                1 => {
13734                    #[allow(irrefutable_let_patterns)]
13735                    if let SuiteEventPayload::CaseFound(_) = self {
13736                        // Do nothing, read the value into the object
13737                    } else {
13738                        // Initialize `self` to the right variant
13739                        *self = SuiteEventPayload::CaseFound(fidl::new_empty!(
13740                            CaseFound,
13741                            fidl::encoding::DefaultFuchsiaResourceDialect
13742                        ));
13743                    }
13744                    #[allow(irrefutable_let_patterns)]
13745                    if let SuiteEventPayload::CaseFound(ref mut val) = self {
13746                        fidl::decode!(
13747                            CaseFound,
13748                            fidl::encoding::DefaultFuchsiaResourceDialect,
13749                            val,
13750                            decoder,
13751                            _inner_offset,
13752                            depth
13753                        )?;
13754                    } else {
13755                        unreachable!()
13756                    }
13757                }
13758                2 => {
13759                    #[allow(irrefutable_let_patterns)]
13760                    if let SuiteEventPayload::CaseStarted(_) = self {
13761                        // Do nothing, read the value into the object
13762                    } else {
13763                        // Initialize `self` to the right variant
13764                        *self = SuiteEventPayload::CaseStarted(fidl::new_empty!(
13765                            CaseStarted,
13766                            fidl::encoding::DefaultFuchsiaResourceDialect
13767                        ));
13768                    }
13769                    #[allow(irrefutable_let_patterns)]
13770                    if let SuiteEventPayload::CaseStarted(ref mut val) = self {
13771                        fidl::decode!(
13772                            CaseStarted,
13773                            fidl::encoding::DefaultFuchsiaResourceDialect,
13774                            val,
13775                            decoder,
13776                            _inner_offset,
13777                            depth
13778                        )?;
13779                    } else {
13780                        unreachable!()
13781                    }
13782                }
13783                3 => {
13784                    #[allow(irrefutable_let_patterns)]
13785                    if let SuiteEventPayload::CaseStopped(_) = self {
13786                        // Do nothing, read the value into the object
13787                    } else {
13788                        // Initialize `self` to the right variant
13789                        *self = SuiteEventPayload::CaseStopped(fidl::new_empty!(
13790                            CaseStopped,
13791                            fidl::encoding::DefaultFuchsiaResourceDialect
13792                        ));
13793                    }
13794                    #[allow(irrefutable_let_patterns)]
13795                    if let SuiteEventPayload::CaseStopped(ref mut val) = self {
13796                        fidl::decode!(
13797                            CaseStopped,
13798                            fidl::encoding::DefaultFuchsiaResourceDialect,
13799                            val,
13800                            decoder,
13801                            _inner_offset,
13802                            depth
13803                        )?;
13804                    } else {
13805                        unreachable!()
13806                    }
13807                }
13808                4 => {
13809                    #[allow(irrefutable_let_patterns)]
13810                    if let SuiteEventPayload::CaseFinished(_) = self {
13811                        // Do nothing, read the value into the object
13812                    } else {
13813                        // Initialize `self` to the right variant
13814                        *self = SuiteEventPayload::CaseFinished(fidl::new_empty!(
13815                            CaseFinished,
13816                            fidl::encoding::DefaultFuchsiaResourceDialect
13817                        ));
13818                    }
13819                    #[allow(irrefutable_let_patterns)]
13820                    if let SuiteEventPayload::CaseFinished(ref mut val) = self {
13821                        fidl::decode!(
13822                            CaseFinished,
13823                            fidl::encoding::DefaultFuchsiaResourceDialect,
13824                            val,
13825                            decoder,
13826                            _inner_offset,
13827                            depth
13828                        )?;
13829                    } else {
13830                        unreachable!()
13831                    }
13832                }
13833                5 => {
13834                    #[allow(irrefutable_let_patterns)]
13835                    if let SuiteEventPayload::CaseArtifact(_) = self {
13836                        // Do nothing, read the value into the object
13837                    } else {
13838                        // Initialize `self` to the right variant
13839                        *self = SuiteEventPayload::CaseArtifact(fidl::new_empty!(
13840                            CaseArtifact,
13841                            fidl::encoding::DefaultFuchsiaResourceDialect
13842                        ));
13843                    }
13844                    #[allow(irrefutable_let_patterns)]
13845                    if let SuiteEventPayload::CaseArtifact(ref mut val) = self {
13846                        fidl::decode!(
13847                            CaseArtifact,
13848                            fidl::encoding::DefaultFuchsiaResourceDialect,
13849                            val,
13850                            decoder,
13851                            _inner_offset,
13852                            depth
13853                        )?;
13854                    } else {
13855                        unreachable!()
13856                    }
13857                }
13858                6 => {
13859                    #[allow(irrefutable_let_patterns)]
13860                    if let SuiteEventPayload::SuiteArtifact(_) = self {
13861                        // Do nothing, read the value into the object
13862                    } else {
13863                        // Initialize `self` to the right variant
13864                        *self = SuiteEventPayload::SuiteArtifact(fidl::new_empty!(
13865                            SuiteArtifact,
13866                            fidl::encoding::DefaultFuchsiaResourceDialect
13867                        ));
13868                    }
13869                    #[allow(irrefutable_let_patterns)]
13870                    if let SuiteEventPayload::SuiteArtifact(ref mut val) = self {
13871                        fidl::decode!(
13872                            SuiteArtifact,
13873                            fidl::encoding::DefaultFuchsiaResourceDialect,
13874                            val,
13875                            decoder,
13876                            _inner_offset,
13877                            depth
13878                        )?;
13879                    } else {
13880                        unreachable!()
13881                    }
13882                }
13883                7 => {
13884                    #[allow(irrefutable_let_patterns)]
13885                    if let SuiteEventPayload::SuiteStarted(_) = self {
13886                        // Do nothing, read the value into the object
13887                    } else {
13888                        // Initialize `self` to the right variant
13889                        *self = SuiteEventPayload::SuiteStarted(fidl::new_empty!(
13890                            SuiteStarted,
13891                            fidl::encoding::DefaultFuchsiaResourceDialect
13892                        ));
13893                    }
13894                    #[allow(irrefutable_let_patterns)]
13895                    if let SuiteEventPayload::SuiteStarted(ref mut val) = self {
13896                        fidl::decode!(
13897                            SuiteStarted,
13898                            fidl::encoding::DefaultFuchsiaResourceDialect,
13899                            val,
13900                            decoder,
13901                            _inner_offset,
13902                            depth
13903                        )?;
13904                    } else {
13905                        unreachable!()
13906                    }
13907                }
13908                8 => {
13909                    #[allow(irrefutable_let_patterns)]
13910                    if let SuiteEventPayload::SuiteStopped(_) = self {
13911                        // Do nothing, read the value into the object
13912                    } else {
13913                        // Initialize `self` to the right variant
13914                        *self = SuiteEventPayload::SuiteStopped(fidl::new_empty!(
13915                            SuiteStopped,
13916                            fidl::encoding::DefaultFuchsiaResourceDialect
13917                        ));
13918                    }
13919                    #[allow(irrefutable_let_patterns)]
13920                    if let SuiteEventPayload::SuiteStopped(ref mut val) = self {
13921                        fidl::decode!(
13922                            SuiteStopped,
13923                            fidl::encoding::DefaultFuchsiaResourceDialect,
13924                            val,
13925                            decoder,
13926                            _inner_offset,
13927                            depth
13928                        )?;
13929                    } else {
13930                        unreachable!()
13931                    }
13932                }
13933                #[allow(deprecated)]
13934                ordinal => {
13935                    for _ in 0..num_handles {
13936                        decoder.drop_next_handle()?;
13937                    }
13938                    *self = SuiteEventPayload::__SourceBreaking { unknown_ordinal: ordinal };
13939                }
13940            }
13941            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13942                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13943            }
13944            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13945                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13946            }
13947            Ok(())
13948        }
13949    }
13950
13951    impl fidl::encoding::ResourceTypeMarker for Syslog {
13952        type Borrowed<'a> = &'a mut Self;
13953        fn take_or_borrow<'a>(
13954            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13955        ) -> Self::Borrowed<'a> {
13956            value
13957        }
13958    }
13959
13960    unsafe impl fidl::encoding::TypeMarker for Syslog {
13961        type Owned = Self;
13962
13963        #[inline(always)]
13964        fn inline_align(_context: fidl::encoding::Context) -> usize {
13965            8
13966        }
13967
13968        #[inline(always)]
13969        fn inline_size(_context: fidl::encoding::Context) -> usize {
13970            16
13971        }
13972    }
13973
13974    unsafe impl fidl::encoding::Encode<Syslog, fidl::encoding::DefaultFuchsiaResourceDialect>
13975        for &mut Syslog
13976    {
13977        #[inline]
13978        unsafe fn encode(
13979            self,
13980            encoder: &mut fidl::encoding::Encoder<
13981                '_,
13982                fidl::encoding::DefaultFuchsiaResourceDialect,
13983            >,
13984            offset: usize,
13985            _depth: fidl::encoding::Depth,
13986        ) -> fidl::Result<()> {
13987            encoder.debug_check_bounds::<Syslog>(offset);
13988            encoder.write_num::<u64>(self.ordinal(), offset);
13989            match self {
13990                Syslog::Batch(ref mut val) => fidl::encoding::encode_in_envelope::<
13991                    fidl::encoding::Endpoint<
13992                        fidl::endpoints::ClientEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13993                    >,
13994                    fidl::encoding::DefaultFuchsiaResourceDialect,
13995                >(
13996                    <fidl::encoding::Endpoint<
13997                        fidl::endpoints::ClientEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
13998                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13999                        val
14000                    ),
14001                    encoder,
14002                    offset + 8,
14003                    _depth,
14004                ),
14005                Syslog::Stream(ref mut val) => fidl::encoding::encode_in_envelope::<
14006                    fidl::encoding::HandleType<
14007                        fidl::Socket,
14008                        { fidl::ObjectType::SOCKET.into_raw() },
14009                        2147483648,
14010                    >,
14011                    fidl::encoding::DefaultFuchsiaResourceDialect,
14012                >(
14013                    <fidl::encoding::HandleType<
14014                        fidl::Socket,
14015                        { fidl::ObjectType::SOCKET.into_raw() },
14016                        2147483648,
14017                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14018                        val
14019                    ),
14020                    encoder,
14021                    offset + 8,
14022                    _depth,
14023                ),
14024                Syslog::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
14025            }
14026        }
14027    }
14028
14029    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Syslog {
14030        #[inline(always)]
14031        fn new_empty() -> Self {
14032            Self::__SourceBreaking { unknown_ordinal: 0 }
14033        }
14034
14035        #[inline]
14036        unsafe fn decode(
14037            &mut self,
14038            decoder: &mut fidl::encoding::Decoder<
14039                '_,
14040                fidl::encoding::DefaultFuchsiaResourceDialect,
14041            >,
14042            offset: usize,
14043            mut depth: fidl::encoding::Depth,
14044        ) -> fidl::Result<()> {
14045            decoder.debug_check_bounds::<Self>(offset);
14046            #[allow(unused_variables)]
14047            let next_out_of_line = decoder.next_out_of_line();
14048            let handles_before = decoder.remaining_handles();
14049            let (ordinal, inlined, num_bytes, num_handles) =
14050                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14051
14052            let member_inline_size = match ordinal {
14053                2 => <fidl::encoding::Endpoint<
14054                    fidl::endpoints::ClientEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
14055                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14056                3 => <fidl::encoding::HandleType<
14057                    fidl::Socket,
14058                    { fidl::ObjectType::SOCKET.into_raw() },
14059                    2147483648,
14060                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14061                0 => return Err(fidl::Error::UnknownUnionTag),
14062                _ => num_bytes as usize,
14063            };
14064
14065            if inlined != (member_inline_size <= 4) {
14066                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14067            }
14068            let _inner_offset;
14069            if inlined {
14070                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14071                _inner_offset = offset + 8;
14072            } else {
14073                depth.increment()?;
14074                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14075            }
14076            match ordinal {
14077                2 => {
14078                    #[allow(irrefutable_let_patterns)]
14079                    if let Syslog::Batch(_) = self {
14080                        // Do nothing, read the value into the object
14081                    } else {
14082                        // Initialize `self` to the right variant
14083                        *self = Syslog::Batch(fidl::new_empty!(
14084                            fidl::encoding::Endpoint<
14085                                fidl::endpoints::ClientEnd<
14086                                    fidl_fuchsia_diagnostics::BatchIteratorMarker,
14087                                >,
14088                            >,
14089                            fidl::encoding::DefaultFuchsiaResourceDialect
14090                        ));
14091                    }
14092                    #[allow(irrefutable_let_patterns)]
14093                    if let Syslog::Batch(ref mut val) = self {
14094                        fidl::decode!(
14095                            fidl::encoding::Endpoint<
14096                                fidl::endpoints::ClientEnd<
14097                                    fidl_fuchsia_diagnostics::BatchIteratorMarker,
14098                                >,
14099                            >,
14100                            fidl::encoding::DefaultFuchsiaResourceDialect,
14101                            val,
14102                            decoder,
14103                            _inner_offset,
14104                            depth
14105                        )?;
14106                    } else {
14107                        unreachable!()
14108                    }
14109                }
14110                3 => {
14111                    #[allow(irrefutable_let_patterns)]
14112                    if let Syslog::Stream(_) = self {
14113                        // Do nothing, read the value into the object
14114                    } else {
14115                        // Initialize `self` to the right variant
14116                        *self = Syslog::Stream(
14117                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14118                        );
14119                    }
14120                    #[allow(irrefutable_let_patterns)]
14121                    if let Syslog::Stream(ref mut val) = self {
14122                        fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
14123                    } else {
14124                        unreachable!()
14125                    }
14126                }
14127                #[allow(deprecated)]
14128                ordinal => {
14129                    for _ in 0..num_handles {
14130                        decoder.drop_next_handle()?;
14131                    }
14132                    *self = Syslog::__SourceBreaking { unknown_ordinal: ordinal };
14133                }
14134            }
14135            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14136                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14137            }
14138            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14139                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14140            }
14141            Ok(())
14142        }
14143    }
14144}