Skip to main content

fdomain_fuchsia_fuzzer/
fdomain_fuchsia_fuzzer.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 fdomain_client::fidl::{ControlHandle as _, FDomainFlexibleIntoResult as _, Responder as _};
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9pub use fidl_fuchsia_fuzzer__common::*;
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14pub struct ControllerAddMonitorRequest {
15    pub monitor: fdomain_client::fidl::ClientEnd<MonitorMarker>,
16}
17
18impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
19    for ControllerAddMonitorRequest
20{
21}
22
23#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
24pub struct ControllerAddToCorpusRequest {
25    pub corpus: Corpus,
26    pub input: Input,
27}
28
29impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
30    for ControllerAddToCorpusRequest
31{
32}
33
34#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35pub struct ControllerCleanseRequest {
36    pub test_input: Input,
37}
38
39impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for ControllerCleanseRequest {}
40
41#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
42pub struct ControllerMinimizeRequest {
43    pub test_input: Input,
44}
45
46impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for ControllerMinimizeRequest {}
47
48#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
49pub struct ControllerProviderConnectRequest {
50    pub controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
51}
52
53impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
54    for ControllerProviderConnectRequest
55{
56}
57
58#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
59pub struct ControllerReadCorpusRequest {
60    pub corpus: Corpus,
61    pub corpus_reader: fdomain_client::fidl::ClientEnd<CorpusReaderMarker>,
62}
63
64impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
65    for ControllerReadCorpusRequest
66{
67}
68
69#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
70pub struct ControllerReadDictionaryResponse {
71    pub dictionary: Input,
72}
73
74impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
75    for ControllerReadDictionaryResponse
76{
77}
78
79#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
80pub struct ControllerTryOneRequest {
81    pub test_input: Input,
82}
83
84impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for ControllerTryOneRequest {}
85
86#[derive(Debug, PartialEq)]
87pub struct ControllerWatchArtifactResponse {
88    pub artifact: Artifact,
89}
90
91impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
92    for ControllerWatchArtifactResponse
93{
94}
95
96#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
97pub struct ControllerWriteDictionaryRequest {
98    pub dictionary: Input,
99}
100
101impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
102    for ControllerWriteDictionaryRequest
103{
104}
105
106#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
107pub struct CorpusReaderNextRequest {
108    pub test_input: Input,
109}
110
111impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for CorpusReaderNextRequest {}
112
113/// Represents an instrumented target process or the code coverage it is sharing.
114#[derive(Debug, PartialEq)]
115pub struct CoverageData {
116    pub target_id: u64,
117    pub data: Data,
118}
119
120impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for CoverageData {}
121
122#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
123pub struct CoverageDataCollectorAddInline8bitCountersRequest {
124    pub inline_8bit_counters: fdomain_client::Vmo,
125}
126
127impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
128    for CoverageDataCollectorAddInline8bitCountersRequest
129{
130}
131
132#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
133pub struct CoverageDataCollectorInitializeRequest {
134    pub eventpair: fdomain_client::EventPair,
135    pub process: fdomain_client::Process,
136}
137
138impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
139    for CoverageDataCollectorInitializeRequest
140{
141}
142
143#[derive(Debug, PartialEq)]
144pub struct CoverageDataProviderWatchCoverageDataResponse {
145    pub coverage_data: Vec<CoverageData>,
146}
147
148impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
149    for CoverageDataProviderWatchCoverageDataResponse
150{
151}
152
153/// Encapsulation of a fuzzer input transferred over a socket, e.g. between a
154/// host and device via overnet.
155#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
156pub struct Input {
157    /// Socket that can be used to read the data.
158    pub socket: fdomain_client::Socket,
159    /// The total amount of data to be transferred.
160    pub size: u64,
161}
162
163impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for Input {}
164
165/// Represents an instrumented target process under test.
166///
167/// This struct wraps the eventpair and process provided to `CoverageDataCollector.Initialize` and
168/// associates it with a unique per-`CoverageDataCollector`-client target id.
169#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
170pub struct InstrumentedProcess {
171    pub eventpair: fdomain_client::EventPair,
172    pub process: fdomain_client::Process,
173}
174
175impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for InstrumentedProcess {}
176
177#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
178pub struct ManagerConnectRequest {
179    pub fuzzer_url: String,
180    pub controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
181}
182
183impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for ManagerConnectRequest {}
184
185#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
186pub struct ManagerGetOutputRequest {
187    pub fuzzer_url: String,
188    pub output: TestOutput,
189    pub socket: fdomain_client::Socket,
190}
191
192impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for ManagerGetOutputRequest {}
193
194#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
195pub struct RegistrarRegisterRequest {
196    pub fuzzer_url: String,
197    pub provider: fdomain_client::fidl::ClientEnd<ControllerProviderMarker>,
198}
199
200impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RegistrarRegisterRequest {}
201
202#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
203pub struct RegistryConnectRequest {
204    pub fuzzer_url: String,
205    pub controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
206    pub timeout: i64,
207}
208
209impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RegistryConnectRequest {}
210
211#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
212pub struct TargetAdapterConnectRequest {
213    pub eventpair: fdomain_client::EventPair,
214    pub test_input: fdomain_client::Vmo,
215}
216
217impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
218    for TargetAdapterConnectRequest
219{
220}
221
222/// Encapsulates the result of a long-running fuzzing workflow and optionally
223/// the input that caused it, depending on the workflow.
224#[derive(Debug, Default, PartialEq)]
225pub struct Artifact {
226    /// Result of executing the long-running workflow.
227    pub result: Option<Result_>,
228    /// Optional fuzzer input produced by a specific long-running workflow. This
229    /// may be:
230    ///
231    /// * A discovered input in the case of `Fuzz`
232    /// * A constructed input in the cases of `Cleanse` and `Minimize`.
233    /// * Omitted in the cases of `TryOne` and `Merge`.
234    pub input: Option<Input>,
235    /// An error generated during a long-running workflow. These errors are
236    /// distinct from those that result from validating workflow requests and
237    /// are documented for the workflow methods below. These errors result from
238    /// unexpected framework failure. For example, if libFuzzer fails due to an
239    /// internal error, the engine will report it via this field.
240    ///
241    /// The `result` and `input` fields are invalid if this field is present and
242    /// anything other than `ZX_OK`.
243    pub error: Option<i32>,
244    #[doc(hidden)]
245    pub __source_breaking: fidl::marker::SourceBreaking,
246}
247
248impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for Artifact {}
249
250#[derive(Debug)]
251pub enum Data {
252    /// An instrumented target process under test.
253    Instrumented(InstrumentedProcess),
254    /// See https://clang.llvm.org/docs/SanitizerCoverage.html#inline-8bit-counters
255    Inline8bitCounters(fdomain_client::Vmo),
256    #[doc(hidden)]
257    __SourceBreaking { unknown_ordinal: u64 },
258}
259
260/// Pattern that matches an unknown `Data` member.
261#[macro_export]
262macro_rules! DataUnknown {
263    () => {
264        _
265    };
266}
267
268// Custom PartialEq so that unknown variants are not equal to themselves.
269impl PartialEq for Data {
270    fn eq(&self, other: &Self) -> bool {
271        match (self, other) {
272            (Self::Instrumented(x), Self::Instrumented(y)) => *x == *y,
273            (Self::Inline8bitCounters(x), Self::Inline8bitCounters(y)) => *x == *y,
274            _ => false,
275        }
276    }
277}
278
279impl Data {
280    #[inline]
281    pub fn ordinal(&self) -> u64 {
282        match *self {
283            Self::Instrumented(_) => 1,
284            Self::Inline8bitCounters(_) => 2,
285            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
286        }
287    }
288
289    #[inline]
290    pub fn unknown_variant_for_testing() -> Self {
291        Self::__SourceBreaking { unknown_ordinal: 0 }
292    }
293
294    #[inline]
295    pub fn is_unknown(&self) -> bool {
296        match self {
297            Self::__SourceBreaking { .. } => true,
298            _ => false,
299        }
300    }
301}
302
303impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for Data {}
304
305#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
306pub struct ControllerMarker;
307
308impl fdomain_client::fidl::ProtocolMarker for ControllerMarker {
309    type Proxy = ControllerProxy;
310    type RequestStream = ControllerRequestStream;
311
312    const DEBUG_NAME: &'static str = "(anonymous) Controller";
313}
314pub type ControllerConfigureResult = Result<(), i32>;
315pub type ControllerAddToCorpusResult = Result<(), i32>;
316pub type ControllerWriteDictionaryResult = Result<(), i32>;
317pub type ControllerFuzzResult = Result<(), i32>;
318pub type ControllerTryOneResult = Result<(), i32>;
319pub type ControllerMinimizeResult = Result<(), i32>;
320pub type ControllerCleanseResult = Result<(), i32>;
321pub type ControllerMergeResult = Result<(), i32>;
322
323pub trait ControllerProxyInterface: Send + Sync {
324    type ConfigureResponseFut: std::future::Future<Output = Result<ControllerConfigureResult, fidl::Error>>
325        + Send;
326    fn r#configure(&self, options: &Options) -> Self::ConfigureResponseFut;
327    type GetOptionsResponseFut: std::future::Future<Output = Result<Options, fidl::Error>> + Send;
328    fn r#get_options(&self) -> Self::GetOptionsResponseFut;
329    type AddToCorpusResponseFut: std::future::Future<Output = Result<ControllerAddToCorpusResult, fidl::Error>>
330        + Send;
331    fn r#add_to_corpus(&self, corpus: Corpus, input: Input) -> Self::AddToCorpusResponseFut;
332    type ReadCorpusResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
333    fn r#read_corpus(
334        &self,
335        corpus: Corpus,
336        corpus_reader: fdomain_client::fidl::ClientEnd<CorpusReaderMarker>,
337    ) -> Self::ReadCorpusResponseFut;
338    type WriteDictionaryResponseFut: std::future::Future<Output = Result<ControllerWriteDictionaryResult, fidl::Error>>
339        + Send;
340    fn r#write_dictionary(&self, dictionary: Input) -> Self::WriteDictionaryResponseFut;
341    type ReadDictionaryResponseFut: std::future::Future<Output = Result<Input, fidl::Error>> + Send;
342    fn r#read_dictionary(&self) -> Self::ReadDictionaryResponseFut;
343    type AddMonitorResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
344    fn r#add_monitor(
345        &self,
346        monitor: fdomain_client::fidl::ClientEnd<MonitorMarker>,
347    ) -> Self::AddMonitorResponseFut;
348    type FuzzResponseFut: std::future::Future<Output = Result<ControllerFuzzResult, fidl::Error>>
349        + Send;
350    fn r#fuzz(&self) -> Self::FuzzResponseFut;
351    type TryOneResponseFut: std::future::Future<Output = Result<ControllerTryOneResult, fidl::Error>>
352        + Send;
353    fn r#try_one(&self, test_input: Input) -> Self::TryOneResponseFut;
354    type MinimizeResponseFut: std::future::Future<Output = Result<ControllerMinimizeResult, fidl::Error>>
355        + Send;
356    fn r#minimize(&self, test_input: Input) -> Self::MinimizeResponseFut;
357    type CleanseResponseFut: std::future::Future<Output = Result<ControllerCleanseResult, fidl::Error>>
358        + Send;
359    fn r#cleanse(&self, test_input: Input) -> Self::CleanseResponseFut;
360    type MergeResponseFut: std::future::Future<Output = Result<ControllerMergeResult, fidl::Error>>
361        + Send;
362    fn r#merge(&self) -> Self::MergeResponseFut;
363    type GetStatusResponseFut: std::future::Future<Output = Result<Status, fidl::Error>> + Send;
364    fn r#get_status(&self) -> Self::GetStatusResponseFut;
365    type WatchArtifactResponseFut: std::future::Future<Output = Result<Artifact, fidl::Error>>
366        + Send;
367    fn r#watch_artifact(&self) -> Self::WatchArtifactResponseFut;
368}
369
370#[derive(Debug, Clone)]
371pub struct ControllerProxy {
372    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
373}
374
375impl fdomain_client::fidl::Proxy for ControllerProxy {
376    type Protocol = ControllerMarker;
377
378    fn from_channel(inner: fdomain_client::Channel) -> Self {
379        Self::new(inner)
380    }
381
382    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
383        self.client.into_channel().map_err(|client| Self { client })
384    }
385
386    fn as_channel(&self) -> &fdomain_client::Channel {
387        self.client.as_channel()
388    }
389}
390
391impl ControllerProxy {
392    /// Create a new Proxy for fuchsia.fuzzer/Controller.
393    pub fn new(channel: fdomain_client::Channel) -> Self {
394        let protocol_name = <ControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
395        Self { client: fidl::client::Client::new(channel, protocol_name) }
396    }
397
398    /// Get a Stream of events from the remote end of the protocol.
399    ///
400    /// # Panics
401    ///
402    /// Panics if the event stream was already taken.
403    pub fn take_event_stream(&self) -> ControllerEventStream {
404        ControllerEventStream { event_receiver: self.client.take_event_receiver() }
405    }
406
407    /// Sets various execution and error detection parameters. This may be
408    /// called multiple times; only the most recently received options are used.
409    /// If the `Options` parameter omits one or more fields, those parameters
410    /// are unchanged in the fuzzer. Until the initial call to this method, the
411    /// fuzzer should assume the default values for `Options`.
412    ///
413    /// + request `options` the execution and error detection parameters.
414    /// * error one of the following:
415    /// * error
416    ///     * `ZX_ERR_BAD_STATE` if a long-running call such as `Execute`,
417    ///       `Cleanse`, `Minimize`, `Fuzz`, or `Merge` is in progress.
418    ///     * `ZX_ERR_NOT_SUPPORTED` if a value provided for an option is not
419    ///       supported by the engine. Check the logs for additional details.
420    pub fn r#configure(
421        &self,
422        mut options: &Options,
423    ) -> fidl::client::QueryResponseFut<
424        ControllerConfigureResult,
425        fdomain_client::fidl::FDomainResourceDialect,
426    > {
427        ControllerProxyInterface::r#configure(self, options)
428    }
429
430    /// Gets the current values for the various execution and error detection
431    /// parameters.
432    ///
433    /// - response `options` the execution and error detection parameters.
434    pub fn r#get_options(
435        &self,
436    ) -> fidl::client::QueryResponseFut<Options, fdomain_client::fidl::FDomainResourceDialect> {
437        ControllerProxyInterface::r#get_options(self)
438    }
439
440    /// Writes the provided `input` to either the "seed" or "live" `corpus`.
441    /// Returns an error if transferring the input fails; see `Input` for
442    /// details.
443    ///
444    /// + request `corpus` the type of corpus to add to.
445    /// + request `input` the sequence of bytes to add as a test input.
446    /// * error one of the following:
447    ///     * `ZX_ERR_INVALID_ARGS` if corpus type is invalid.
448    ///     * A socket error if transferring the input fails.
449    pub fn r#add_to_corpus(
450        &self,
451        mut corpus: Corpus,
452        mut input: Input,
453    ) -> fidl::client::QueryResponseFut<
454        ControllerAddToCorpusResult,
455        fdomain_client::fidl::FDomainResourceDialect,
456    > {
457        ControllerProxyInterface::r#add_to_corpus(self, corpus, input)
458    }
459
460    /// Connects a `corpus_reader` for either the "seed" or "live" corpus.
461    ///
462    /// + request `corpus` the type of corpus to read from.
463    /// + request `corpus_reader` the client used to send test inputs.
464    pub fn r#read_corpus(
465        &self,
466        mut corpus: Corpus,
467        mut corpus_reader: fdomain_client::fidl::ClientEnd<CorpusReaderMarker>,
468    ) -> fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect> {
469        ControllerProxyInterface::r#read_corpus(self, corpus, corpus_reader)
470    }
471
472    /// Parses and loads an AFL-style dictionary. Invalid entries are logged and
473    /// skipped.
474    ///
475    /// See also:
476    ///
477    /// * https://github.com/mirrorer/afl/blob/master/dictionaries/README.dictionaries
478    ///
479    /// + request `dictionary` the AFL-style dictionary
480    /// * error one of the following:
481    ///     * A socket error if transferring the input fails.
482    ///     *`ZX_ERR_INVALID_ARGS` if parsing the dictionary fails.
483    pub fn r#write_dictionary(
484        &self,
485        mut dictionary: Input,
486    ) -> fidl::client::QueryResponseFut<
487        ControllerWriteDictionaryResult,
488        fdomain_client::fidl::FDomainResourceDialect,
489    > {
490        ControllerProxyInterface::r#write_dictionary(self, dictionary)
491    }
492
493    /// Returns the current dictionary as an Input, which may be empty.
494    ///
495    /// - response `dictionary` the current AFL-style dictionary.
496    pub fn r#read_dictionary(
497        &self,
498    ) -> fidl::client::QueryResponseFut<Input, fdomain_client::fidl::FDomainResourceDialect> {
499        ControllerProxyInterface::r#read_dictionary(self)
500    }
501
502    /// Installs a `Monitor` to push status. To pull status instead, use
503    /// `GetStatus`.
504    ///
505    /// + request `monitor` the client used to send status updates.
506    pub fn r#add_monitor(
507        &self,
508        mut monitor: fdomain_client::fidl::ClientEnd<MonitorMarker>,
509    ) -> fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect> {
510        ControllerProxyInterface::r#add_monitor(self, monitor)
511    }
512
513    /// Runs the normal fuzzing feedback loop:
514    ///
515    /// 1. Selects an input from the corpus.
516    /// 2. Mutates the input.
517    /// 3. Uses the `TargetAdapter` to execute the input.
518    /// 4. Checks feedback from the `InstrumentedProcesses`.
519    /// 5. If the input produced useful feedback, adds it to the corpus.
520    ///
521    /// This call returns quickly, but the loop continues until one of three
522    /// conditions is met:
523    ///
524    /// 1. The configured, non-zero number of `runs` has been reached.
525    /// 2. The configured, non-zero `duration` elapses.
526    /// 3. An error is detected, and returned.
527    ///
528    /// See `Result` for more details on long running workflows such as this
529    /// one.
530    ///
531    /// * error `ZX_ERR_BAD_STATE` if another long-running workflow is in
532    ///   progress.
533    pub fn r#fuzz(
534        &self,
535    ) -> fidl::client::QueryResponseFut<
536        ControllerFuzzResult,
537        fdomain_client::fidl::FDomainResourceDialect,
538    > {
539        ControllerProxyInterface::r#fuzz(self)
540    }
541
542    /// Executes the target code with a single `test_input`.
543    ///
544    /// See `Result` for more details on long running workflows such as this
545    /// one.
546    ///
547    /// + request `input` the sequence of bytes to use with the fuzz target.
548    /// * error one of the following:
549    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
550    ///       progress.
551    ///     *  A socket error if transferring the input fails.
552    pub fn r#try_one(
553        &self,
554        mut test_input: Input,
555    ) -> fidl::client::QueryResponseFut<
556        ControllerTryOneResult,
557        fdomain_client::fidl::FDomainResourceDialect,
558    > {
559        ControllerProxyInterface::r#try_one(self, test_input)
560    }
561
562    /// Attempts to find the smallest input that produces the same error as the
563    /// given `test_input`,
564    /// constrained by the configured `total_time` and/or `runs` options.
565    ///
566    /// See `Result` for more details on long running workflows such as this
567    /// one.
568    ///
569    /// + request `input` the sequence of bytes to minimize.
570    /// * error one of the following:
571    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
572    ///       progress.
573    ///     * A socket error if transferring the input fails.
574    ///     * `ZX_ERR_INVALID_ARGS` if the provided `test_input` does not cause
575    ///       an error.
576    pub fn r#minimize(
577        &self,
578        mut test_input: Input,
579    ) -> fidl::client::QueryResponseFut<
580        ControllerMinimizeResult,
581        fdomain_client::fidl::FDomainResourceDialect,
582    > {
583        ControllerProxyInterface::r#minimize(self, test_input)
584    }
585
586    /// Attempts to replace bytes of the given `test_input` with "filler" bytes,
587    /// e.g. \x00, \xFF, without changing the error produced.
588    ///
589    /// See `Result` for more details on long running workflows such as this
590    /// one.
591    ///
592    /// To preserve backwards compatibility with libFuzzer and ClusterFuzz, an
593    /// input that produces no result is *not* considered an error, and is
594    /// returned as-is.
595    ///
596    /// + request `input` the sequence of bytes to cleanse.
597    /// * error one of the following:
598    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
599    ///       progress.
600    ///     * A socket error if transferring the input fails.
601    pub fn r#cleanse(
602        &self,
603        mut test_input: Input,
604    ) -> fidl::client::QueryResponseFut<
605        ControllerCleanseResult,
606        fdomain_client::fidl::FDomainResourceDialect,
607    > {
608        ControllerProxyInterface::r#cleanse(self, test_input)
609    }
610
611    /// Attempts to shrink the corpora. Inputs from the seed corpus will be
612    /// preserved. All other inputs will be sorted by amount of feedback
613    /// produced and input size, and only those inputs that add new feedback not
614    /// seen earlier in the sequence will be kept.
615    ///
616    /// See `Result` for more details on long running workflows such as this
617    /// one.
618    ///
619    /// * error one of the following:
620    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
621    ///       progress.
622    ///     * `ZX_ERR_INVALID_ARGS` if an input in the seed corpus causes an
623    ///       error. Inputs in the live corpus that cause errors are skipped.
624    pub fn r#merge(
625        &self,
626    ) -> fidl::client::QueryResponseFut<
627        ControllerMergeResult,
628        fdomain_client::fidl::FDomainResourceDialect,
629    > {
630        ControllerProxyInterface::r#merge(self)
631    }
632
633    /// Returns various fuzzing metrics, e.g. total coverage, speed, etc.
634    ///
635    /// - response `status` the current value of fuzzing metrics.
636    pub fn r#get_status(
637        &self,
638    ) -> fidl::client::QueryResponseFut<Status, fdomain_client::fidl::FDomainResourceDialect> {
639        ControllerProxyInterface::r#get_status(self)
640    }
641
642    /// Returns the results of a long-running workflow.
643    ///
644    /// This method uses the
645    /// ["hanging get" pattern](https://fuchsia.dev/fuchsia-src/development/api/fidl#hanging-get).
646    /// Upon the first call for a given connection, it will immediately return
647    /// the controller's current artifact. Upon subsequent calls, it will block
648    /// until the controller's artifact changes before returning. Clients should
649    /// use `GetStatus` to ensure the fuzzer is not idle before making a
650    /// blocking call to `WatchArtifact`.
651    ///
652    /// Combined with the `Status.running` value obtained from `GetStatus`, this
653    /// allows a (re-)connecting client to infer the state of the fuzzer:
654    ///
655    /// * If the fuzzer is idle and has an empty artifact, then it is
656    ///   unchanged since the last connection, if any.
657    /// * If the fuzzer is running and has an empty artifact, then it is
658    ///   performing a long-running workflow started by a previous connection.
659    ///   The client may call `WatchArtifact` again to wait for the workflow
660    ///   to complete.
661    /// * If the fuzzer is idle and has a non-empty artifact, then it has
662    ///   completed a long-running workflow since the last connection.
663    ///
664    /// It is not an error for clients to disconnect while waiting for a
665    /// response from this method. This method is intended to allow clients to
666    /// resume waiting for a long-running workflow to complete after
667    /// intentionally or inadvertently being disconnected for an indefinite
668    /// amount of time.
669    ///
670    /// - response `artifact` the most recent result and/or error-causing input.
671    pub fn r#watch_artifact(
672        &self,
673    ) -> fidl::client::QueryResponseFut<Artifact, fdomain_client::fidl::FDomainResourceDialect>
674    {
675        ControllerProxyInterface::r#watch_artifact(self)
676    }
677}
678
679impl ControllerProxyInterface for ControllerProxy {
680    type ConfigureResponseFut = fidl::client::QueryResponseFut<
681        ControllerConfigureResult,
682        fdomain_client::fidl::FDomainResourceDialect,
683    >;
684    fn r#configure(&self, mut options: &Options) -> Self::ConfigureResponseFut {
685        fn _decode(
686            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
687        ) -> Result<ControllerConfigureResult, fidl::Error> {
688            let _response = fidl::client::decode_transaction_body::<
689                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
690                fdomain_client::fidl::FDomainResourceDialect,
691                0x35c8cba7fa3d32e4,
692            >(_buf?)?;
693            Ok(_response.map(|x| x))
694        }
695        self.client.send_query_and_decode::<ControllerConfigureRequest, ControllerConfigureResult>(
696            (options,),
697            0x35c8cba7fa3d32e4,
698            fidl::encoding::DynamicFlags::empty(),
699            _decode,
700        )
701    }
702
703    type GetOptionsResponseFut =
704        fidl::client::QueryResponseFut<Options, fdomain_client::fidl::FDomainResourceDialect>;
705    fn r#get_options(&self) -> Self::GetOptionsResponseFut {
706        fn _decode(
707            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
708        ) -> Result<Options, fidl::Error> {
709            let _response = fidl::client::decode_transaction_body::<
710                ControllerGetOptionsResponse,
711                fdomain_client::fidl::FDomainResourceDialect,
712                0x683d93332504b9cd,
713            >(_buf?)?;
714            Ok(_response.options)
715        }
716        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Options>(
717            (),
718            0x683d93332504b9cd,
719            fidl::encoding::DynamicFlags::empty(),
720            _decode,
721        )
722    }
723
724    type AddToCorpusResponseFut = fidl::client::QueryResponseFut<
725        ControllerAddToCorpusResult,
726        fdomain_client::fidl::FDomainResourceDialect,
727    >;
728    fn r#add_to_corpus(
729        &self,
730        mut corpus: Corpus,
731        mut input: Input,
732    ) -> Self::AddToCorpusResponseFut {
733        fn _decode(
734            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
735        ) -> Result<ControllerAddToCorpusResult, fidl::Error> {
736            let _response = fidl::client::decode_transaction_body::<
737                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
738                fdomain_client::fidl::FDomainResourceDialect,
739                0x7bdf8336ab534cee,
740            >(_buf?)?;
741            Ok(_response.map(|x| x))
742        }
743        self.client
744            .send_query_and_decode::<ControllerAddToCorpusRequest, ControllerAddToCorpusResult>(
745                (corpus, &mut input),
746                0x7bdf8336ab534cee,
747                fidl::encoding::DynamicFlags::empty(),
748                _decode,
749            )
750    }
751
752    type ReadCorpusResponseFut =
753        fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect>;
754    fn r#read_corpus(
755        &self,
756        mut corpus: Corpus,
757        mut corpus_reader: fdomain_client::fidl::ClientEnd<CorpusReaderMarker>,
758    ) -> Self::ReadCorpusResponseFut {
759        fn _decode(
760            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
761        ) -> Result<(), fidl::Error> {
762            let _response = fidl::client::decode_transaction_body::<
763                fidl::encoding::EmptyPayload,
764                fdomain_client::fidl::FDomainResourceDialect,
765                0x501279b430b34514,
766            >(_buf?)?;
767            Ok(_response)
768        }
769        self.client.send_query_and_decode::<ControllerReadCorpusRequest, ()>(
770            (corpus, corpus_reader),
771            0x501279b430b34514,
772            fidl::encoding::DynamicFlags::empty(),
773            _decode,
774        )
775    }
776
777    type WriteDictionaryResponseFut = fidl::client::QueryResponseFut<
778        ControllerWriteDictionaryResult,
779        fdomain_client::fidl::FDomainResourceDialect,
780    >;
781    fn r#write_dictionary(&self, mut dictionary: Input) -> Self::WriteDictionaryResponseFut {
782        fn _decode(
783            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
784        ) -> Result<ControllerWriteDictionaryResult, fidl::Error> {
785            let _response = fidl::client::decode_transaction_body::<
786                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
787                fdomain_client::fidl::FDomainResourceDialect,
788                0x4ecfc1274fe4a70b,
789            >(_buf?)?;
790            Ok(_response.map(|x| x))
791        }
792        self.client.send_query_and_decode::<
793            ControllerWriteDictionaryRequest,
794            ControllerWriteDictionaryResult,
795        >(
796            (&mut dictionary,),
797            0x4ecfc1274fe4a70b,
798            fidl::encoding::DynamicFlags::empty(),
799            _decode,
800        )
801    }
802
803    type ReadDictionaryResponseFut =
804        fidl::client::QueryResponseFut<Input, fdomain_client::fidl::FDomainResourceDialect>;
805    fn r#read_dictionary(&self) -> Self::ReadDictionaryResponseFut {
806        fn _decode(
807            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
808        ) -> Result<Input, fidl::Error> {
809            let _response = fidl::client::decode_transaction_body::<
810                ControllerReadDictionaryResponse,
811                fdomain_client::fidl::FDomainResourceDialect,
812                0x1be6724c87b51c37,
813            >(_buf?)?;
814            Ok(_response.dictionary)
815        }
816        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Input>(
817            (),
818            0x1be6724c87b51c37,
819            fidl::encoding::DynamicFlags::empty(),
820            _decode,
821        )
822    }
823
824    type AddMonitorResponseFut =
825        fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect>;
826    fn r#add_monitor(
827        &self,
828        mut monitor: fdomain_client::fidl::ClientEnd<MonitorMarker>,
829    ) -> Self::AddMonitorResponseFut {
830        fn _decode(
831            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
832        ) -> Result<(), fidl::Error> {
833            let _response = fidl::client::decode_transaction_body::<
834                fidl::encoding::EmptyPayload,
835                fdomain_client::fidl::FDomainResourceDialect,
836                0x2efbf7d3dc21438e,
837            >(_buf?)?;
838            Ok(_response)
839        }
840        self.client.send_query_and_decode::<ControllerAddMonitorRequest, ()>(
841            (monitor,),
842            0x2efbf7d3dc21438e,
843            fidl::encoding::DynamicFlags::empty(),
844            _decode,
845        )
846    }
847
848    type FuzzResponseFut = fidl::client::QueryResponseFut<
849        ControllerFuzzResult,
850        fdomain_client::fidl::FDomainResourceDialect,
851    >;
852    fn r#fuzz(&self) -> Self::FuzzResponseFut {
853        fn _decode(
854            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
855        ) -> Result<ControllerFuzzResult, fidl::Error> {
856            let _response = fidl::client::decode_transaction_body::<
857                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
858                fdomain_client::fidl::FDomainResourceDialect,
859                0x62fe3684ea23af62,
860            >(_buf?)?;
861            Ok(_response.map(|x| x))
862        }
863        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerFuzzResult>(
864            (),
865            0x62fe3684ea23af62,
866            fidl::encoding::DynamicFlags::empty(),
867            _decode,
868        )
869    }
870
871    type TryOneResponseFut = fidl::client::QueryResponseFut<
872        ControllerTryOneResult,
873        fdomain_client::fidl::FDomainResourceDialect,
874    >;
875    fn r#try_one(&self, mut test_input: Input) -> Self::TryOneResponseFut {
876        fn _decode(
877            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
878        ) -> Result<ControllerTryOneResult, fidl::Error> {
879            let _response = fidl::client::decode_transaction_body::<
880                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
881                fdomain_client::fidl::FDomainResourceDialect,
882                0x368dc762d8e16d46,
883            >(_buf?)?;
884            Ok(_response.map(|x| x))
885        }
886        self.client.send_query_and_decode::<ControllerTryOneRequest, ControllerTryOneResult>(
887            (&mut test_input,),
888            0x368dc762d8e16d46,
889            fidl::encoding::DynamicFlags::empty(),
890            _decode,
891        )
892    }
893
894    type MinimizeResponseFut = fidl::client::QueryResponseFut<
895        ControllerMinimizeResult,
896        fdomain_client::fidl::FDomainResourceDialect,
897    >;
898    fn r#minimize(&self, mut test_input: Input) -> Self::MinimizeResponseFut {
899        fn _decode(
900            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
901        ) -> Result<ControllerMinimizeResult, fidl::Error> {
902            let _response = fidl::client::decode_transaction_body::<
903                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
904                fdomain_client::fidl::FDomainResourceDialect,
905                0x105a242ee0552794,
906            >(_buf?)?;
907            Ok(_response.map(|x| x))
908        }
909        self.client.send_query_and_decode::<ControllerMinimizeRequest, ControllerMinimizeResult>(
910            (&mut test_input,),
911            0x105a242ee0552794,
912            fidl::encoding::DynamicFlags::empty(),
913            _decode,
914        )
915    }
916
917    type CleanseResponseFut = fidl::client::QueryResponseFut<
918        ControllerCleanseResult,
919        fdomain_client::fidl::FDomainResourceDialect,
920    >;
921    fn r#cleanse(&self, mut test_input: Input) -> Self::CleanseResponseFut {
922        fn _decode(
923            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
924        ) -> Result<ControllerCleanseResult, fidl::Error> {
925            let _response = fidl::client::decode_transaction_body::<
926                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
927                fdomain_client::fidl::FDomainResourceDialect,
928                0x6d7892f62735f3e0,
929            >(_buf?)?;
930            Ok(_response.map(|x| x))
931        }
932        self.client.send_query_and_decode::<ControllerCleanseRequest, ControllerCleanseResult>(
933            (&mut test_input,),
934            0x6d7892f62735f3e0,
935            fidl::encoding::DynamicFlags::empty(),
936            _decode,
937        )
938    }
939
940    type MergeResponseFut = fidl::client::QueryResponseFut<
941        ControllerMergeResult,
942        fdomain_client::fidl::FDomainResourceDialect,
943    >;
944    fn r#merge(&self) -> Self::MergeResponseFut {
945        fn _decode(
946            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
947        ) -> Result<ControllerMergeResult, fidl::Error> {
948            let _response = fidl::client::decode_transaction_body::<
949                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
950                fdomain_client::fidl::FDomainResourceDialect,
951                0x3614e5c39413b5eb,
952            >(_buf?)?;
953            Ok(_response.map(|x| x))
954        }
955        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerMergeResult>(
956            (),
957            0x3614e5c39413b5eb,
958            fidl::encoding::DynamicFlags::empty(),
959            _decode,
960        )
961    }
962
963    type GetStatusResponseFut =
964        fidl::client::QueryResponseFut<Status, fdomain_client::fidl::FDomainResourceDialect>;
965    fn r#get_status(&self) -> Self::GetStatusResponseFut {
966        fn _decode(
967            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
968        ) -> Result<Status, fidl::Error> {
969            let _response = fidl::client::decode_transaction_body::<
970                ControllerGetStatusResponse,
971                fdomain_client::fidl::FDomainResourceDialect,
972                0x51db4975d93ce768,
973            >(_buf?)?;
974            Ok(_response.status)
975        }
976        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Status>(
977            (),
978            0x51db4975d93ce768,
979            fidl::encoding::DynamicFlags::empty(),
980            _decode,
981        )
982    }
983
984    type WatchArtifactResponseFut =
985        fidl::client::QueryResponseFut<Artifact, fdomain_client::fidl::FDomainResourceDialect>;
986    fn r#watch_artifact(&self) -> Self::WatchArtifactResponseFut {
987        fn _decode(
988            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
989        ) -> Result<Artifact, fidl::Error> {
990            let _response = fidl::client::decode_transaction_body::<
991                ControllerWatchArtifactResponse,
992                fdomain_client::fidl::FDomainResourceDialect,
993                0x6cfca3730944a414,
994            >(_buf?)?;
995            Ok(_response.artifact)
996        }
997        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Artifact>(
998            (),
999            0x6cfca3730944a414,
1000            fidl::encoding::DynamicFlags::empty(),
1001            _decode,
1002        )
1003    }
1004}
1005
1006pub struct ControllerEventStream {
1007    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
1008}
1009
1010impl std::marker::Unpin for ControllerEventStream {}
1011
1012impl futures::stream::FusedStream for ControllerEventStream {
1013    fn is_terminated(&self) -> bool {
1014        self.event_receiver.is_terminated()
1015    }
1016}
1017
1018impl futures::Stream for ControllerEventStream {
1019    type Item = Result<ControllerEvent, fidl::Error>;
1020
1021    fn poll_next(
1022        mut self: std::pin::Pin<&mut Self>,
1023        cx: &mut std::task::Context<'_>,
1024    ) -> std::task::Poll<Option<Self::Item>> {
1025        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1026            &mut self.event_receiver,
1027            cx
1028        )?) {
1029            Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
1030            None => std::task::Poll::Ready(None),
1031        }
1032    }
1033}
1034
1035#[derive(Debug)]
1036pub enum ControllerEvent {}
1037
1038impl ControllerEvent {
1039    /// Decodes a message buffer as a [`ControllerEvent`].
1040    fn decode(
1041        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1042    ) -> Result<ControllerEvent, fidl::Error> {
1043        let (bytes, _handles) = buf.split_mut();
1044        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1045        debug_assert_eq!(tx_header.tx_id, 0);
1046        match tx_header.ordinal {
1047            _ => Err(fidl::Error::UnknownOrdinal {
1048                ordinal: tx_header.ordinal,
1049                protocol_name:
1050                    <ControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1051            }),
1052        }
1053    }
1054}
1055
1056/// A Stream of incoming requests for fuchsia.fuzzer/Controller.
1057pub struct ControllerRequestStream {
1058    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1059    is_terminated: bool,
1060}
1061
1062impl std::marker::Unpin for ControllerRequestStream {}
1063
1064impl futures::stream::FusedStream for ControllerRequestStream {
1065    fn is_terminated(&self) -> bool {
1066        self.is_terminated
1067    }
1068}
1069
1070impl fdomain_client::fidl::RequestStream for ControllerRequestStream {
1071    type Protocol = ControllerMarker;
1072    type ControlHandle = ControllerControlHandle;
1073
1074    fn from_channel(channel: fdomain_client::Channel) -> Self {
1075        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1076    }
1077
1078    fn control_handle(&self) -> Self::ControlHandle {
1079        ControllerControlHandle { inner: self.inner.clone() }
1080    }
1081
1082    fn into_inner(
1083        self,
1084    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
1085    {
1086        (self.inner, self.is_terminated)
1087    }
1088
1089    fn from_inner(
1090        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1091        is_terminated: bool,
1092    ) -> Self {
1093        Self { inner, is_terminated }
1094    }
1095}
1096
1097impl futures::Stream for ControllerRequestStream {
1098    type Item = Result<ControllerRequest, fidl::Error>;
1099
1100    fn poll_next(
1101        mut self: std::pin::Pin<&mut Self>,
1102        cx: &mut std::task::Context<'_>,
1103    ) -> std::task::Poll<Option<Self::Item>> {
1104        let this = &mut *self;
1105        if this.inner.check_shutdown(cx) {
1106            this.is_terminated = true;
1107            return std::task::Poll::Ready(None);
1108        }
1109        if this.is_terminated {
1110            panic!("polled ControllerRequestStream after completion");
1111        }
1112        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
1113            |bytes, handles| {
1114                match this.inner.channel().read_etc(cx, bytes, handles) {
1115                    std::task::Poll::Ready(Ok(())) => {}
1116                    std::task::Poll::Pending => return std::task::Poll::Pending,
1117                    std::task::Poll::Ready(Err(None)) => {
1118                        this.is_terminated = true;
1119                        return std::task::Poll::Ready(None);
1120                    }
1121                    std::task::Poll::Ready(Err(Some(e))) => {
1122                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1123                            e.into(),
1124                        ))));
1125                    }
1126                }
1127
1128                // A message has been received from the channel
1129                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1130
1131                std::task::Poll::Ready(Some(match header.ordinal {
1132                    0x35c8cba7fa3d32e4 => {
1133                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1134                        let mut req = fidl::new_empty!(
1135                            ControllerConfigureRequest,
1136                            fdomain_client::fidl::FDomainResourceDialect
1137                        );
1138                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ControllerConfigureRequest>(&header, _body_bytes, handles, &mut req)?;
1139                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1140                        Ok(ControllerRequest::Configure {
1141                            options: req.options,
1142
1143                            responder: ControllerConfigureResponder {
1144                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1145                                tx_id: header.tx_id,
1146                            },
1147                        })
1148                    }
1149                    0x683d93332504b9cd => {
1150                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1151                        let mut req = fidl::new_empty!(
1152                            fidl::encoding::EmptyPayload,
1153                            fdomain_client::fidl::FDomainResourceDialect
1154                        );
1155                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1156                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1157                        Ok(ControllerRequest::GetOptions {
1158                            responder: ControllerGetOptionsResponder {
1159                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1160                                tx_id: header.tx_id,
1161                            },
1162                        })
1163                    }
1164                    0x7bdf8336ab534cee => {
1165                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1166                        let mut req = fidl::new_empty!(
1167                            ControllerAddToCorpusRequest,
1168                            fdomain_client::fidl::FDomainResourceDialect
1169                        );
1170                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ControllerAddToCorpusRequest>(&header, _body_bytes, handles, &mut req)?;
1171                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1172                        Ok(ControllerRequest::AddToCorpus {
1173                            corpus: req.corpus,
1174                            input: req.input,
1175
1176                            responder: ControllerAddToCorpusResponder {
1177                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1178                                tx_id: header.tx_id,
1179                            },
1180                        })
1181                    }
1182                    0x501279b430b34514 => {
1183                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1184                        let mut req = fidl::new_empty!(
1185                            ControllerReadCorpusRequest,
1186                            fdomain_client::fidl::FDomainResourceDialect
1187                        );
1188                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ControllerReadCorpusRequest>(&header, _body_bytes, handles, &mut req)?;
1189                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1190                        Ok(ControllerRequest::ReadCorpus {
1191                            corpus: req.corpus,
1192                            corpus_reader: req.corpus_reader,
1193
1194                            responder: ControllerReadCorpusResponder {
1195                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1196                                tx_id: header.tx_id,
1197                            },
1198                        })
1199                    }
1200                    0x4ecfc1274fe4a70b => {
1201                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1202                        let mut req = fidl::new_empty!(
1203                            ControllerWriteDictionaryRequest,
1204                            fdomain_client::fidl::FDomainResourceDialect
1205                        );
1206                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ControllerWriteDictionaryRequest>(&header, _body_bytes, handles, &mut req)?;
1207                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1208                        Ok(ControllerRequest::WriteDictionary {
1209                            dictionary: req.dictionary,
1210
1211                            responder: ControllerWriteDictionaryResponder {
1212                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1213                                tx_id: header.tx_id,
1214                            },
1215                        })
1216                    }
1217                    0x1be6724c87b51c37 => {
1218                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1219                        let mut req = fidl::new_empty!(
1220                            fidl::encoding::EmptyPayload,
1221                            fdomain_client::fidl::FDomainResourceDialect
1222                        );
1223                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1224                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1225                        Ok(ControllerRequest::ReadDictionary {
1226                            responder: ControllerReadDictionaryResponder {
1227                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1228                                tx_id: header.tx_id,
1229                            },
1230                        })
1231                    }
1232                    0x2efbf7d3dc21438e => {
1233                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1234                        let mut req = fidl::new_empty!(
1235                            ControllerAddMonitorRequest,
1236                            fdomain_client::fidl::FDomainResourceDialect
1237                        );
1238                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ControllerAddMonitorRequest>(&header, _body_bytes, handles, &mut req)?;
1239                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1240                        Ok(ControllerRequest::AddMonitor {
1241                            monitor: req.monitor,
1242
1243                            responder: ControllerAddMonitorResponder {
1244                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1245                                tx_id: header.tx_id,
1246                            },
1247                        })
1248                    }
1249                    0x62fe3684ea23af62 => {
1250                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1251                        let mut req = fidl::new_empty!(
1252                            fidl::encoding::EmptyPayload,
1253                            fdomain_client::fidl::FDomainResourceDialect
1254                        );
1255                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1256                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1257                        Ok(ControllerRequest::Fuzz {
1258                            responder: ControllerFuzzResponder {
1259                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1260                                tx_id: header.tx_id,
1261                            },
1262                        })
1263                    }
1264                    0x368dc762d8e16d46 => {
1265                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1266                        let mut req = fidl::new_empty!(
1267                            ControllerTryOneRequest,
1268                            fdomain_client::fidl::FDomainResourceDialect
1269                        );
1270                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ControllerTryOneRequest>(&header, _body_bytes, handles, &mut req)?;
1271                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1272                        Ok(ControllerRequest::TryOne {
1273                            test_input: req.test_input,
1274
1275                            responder: ControllerTryOneResponder {
1276                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1277                                tx_id: header.tx_id,
1278                            },
1279                        })
1280                    }
1281                    0x105a242ee0552794 => {
1282                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1283                        let mut req = fidl::new_empty!(
1284                            ControllerMinimizeRequest,
1285                            fdomain_client::fidl::FDomainResourceDialect
1286                        );
1287                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ControllerMinimizeRequest>(&header, _body_bytes, handles, &mut req)?;
1288                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1289                        Ok(ControllerRequest::Minimize {
1290                            test_input: req.test_input,
1291
1292                            responder: ControllerMinimizeResponder {
1293                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1294                                tx_id: header.tx_id,
1295                            },
1296                        })
1297                    }
1298                    0x6d7892f62735f3e0 => {
1299                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1300                        let mut req = fidl::new_empty!(
1301                            ControllerCleanseRequest,
1302                            fdomain_client::fidl::FDomainResourceDialect
1303                        );
1304                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ControllerCleanseRequest>(&header, _body_bytes, handles, &mut req)?;
1305                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1306                        Ok(ControllerRequest::Cleanse {
1307                            test_input: req.test_input,
1308
1309                            responder: ControllerCleanseResponder {
1310                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1311                                tx_id: header.tx_id,
1312                            },
1313                        })
1314                    }
1315                    0x3614e5c39413b5eb => {
1316                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1317                        let mut req = fidl::new_empty!(
1318                            fidl::encoding::EmptyPayload,
1319                            fdomain_client::fidl::FDomainResourceDialect
1320                        );
1321                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1322                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1323                        Ok(ControllerRequest::Merge {
1324                            responder: ControllerMergeResponder {
1325                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1326                                tx_id: header.tx_id,
1327                            },
1328                        })
1329                    }
1330                    0x51db4975d93ce768 => {
1331                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1332                        let mut req = fidl::new_empty!(
1333                            fidl::encoding::EmptyPayload,
1334                            fdomain_client::fidl::FDomainResourceDialect
1335                        );
1336                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1337                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1338                        Ok(ControllerRequest::GetStatus {
1339                            responder: ControllerGetStatusResponder {
1340                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1341                                tx_id: header.tx_id,
1342                            },
1343                        })
1344                    }
1345                    0x6cfca3730944a414 => {
1346                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1347                        let mut req = fidl::new_empty!(
1348                            fidl::encoding::EmptyPayload,
1349                            fdomain_client::fidl::FDomainResourceDialect
1350                        );
1351                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1352                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1353                        Ok(ControllerRequest::WatchArtifact {
1354                            responder: ControllerWatchArtifactResponder {
1355                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1356                                tx_id: header.tx_id,
1357                            },
1358                        })
1359                    }
1360                    _ => Err(fidl::Error::UnknownOrdinal {
1361                        ordinal: header.ordinal,
1362                        protocol_name:
1363                            <ControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1364                    }),
1365                }))
1366            },
1367        )
1368    }
1369}
1370
1371/// Provides the management interface for fuzzing.
1372///
1373/// This protocol is implemented by the fuzzing engine. Clients for this
1374/// protocol are provided by `fuchsia.fuzzer/ControllerProvider.Connect`.
1375///
1376/// The channel is closed when the fuzzer is no longer needed, and on error.
1377/// Clients should exit and not attempt to reconnect.
1378#[derive(Debug)]
1379pub enum ControllerRequest {
1380    /// Sets various execution and error detection parameters. This may be
1381    /// called multiple times; only the most recently received options are used.
1382    /// If the `Options` parameter omits one or more fields, those parameters
1383    /// are unchanged in the fuzzer. Until the initial call to this method, the
1384    /// fuzzer should assume the default values for `Options`.
1385    ///
1386    /// + request `options` the execution and error detection parameters.
1387    /// * error one of the following:
1388    /// * error
1389    ///     * `ZX_ERR_BAD_STATE` if a long-running call such as `Execute`,
1390    ///       `Cleanse`, `Minimize`, `Fuzz`, or `Merge` is in progress.
1391    ///     * `ZX_ERR_NOT_SUPPORTED` if a value provided for an option is not
1392    ///       supported by the engine. Check the logs for additional details.
1393    Configure { options: Options, responder: ControllerConfigureResponder },
1394    /// Gets the current values for the various execution and error detection
1395    /// parameters.
1396    ///
1397    /// - response `options` the execution and error detection parameters.
1398    GetOptions { responder: ControllerGetOptionsResponder },
1399    /// Writes the provided `input` to either the "seed" or "live" `corpus`.
1400    /// Returns an error if transferring the input fails; see `Input` for
1401    /// details.
1402    ///
1403    /// + request `corpus` the type of corpus to add to.
1404    /// + request `input` the sequence of bytes to add as a test input.
1405    /// * error one of the following:
1406    ///     * `ZX_ERR_INVALID_ARGS` if corpus type is invalid.
1407    ///     * A socket error if transferring the input fails.
1408    AddToCorpus { corpus: Corpus, input: Input, responder: ControllerAddToCorpusResponder },
1409    /// Connects a `corpus_reader` for either the "seed" or "live" corpus.
1410    ///
1411    /// + request `corpus` the type of corpus to read from.
1412    /// + request `corpus_reader` the client used to send test inputs.
1413    ReadCorpus {
1414        corpus: Corpus,
1415        corpus_reader: fdomain_client::fidl::ClientEnd<CorpusReaderMarker>,
1416        responder: ControllerReadCorpusResponder,
1417    },
1418    /// Parses and loads an AFL-style dictionary. Invalid entries are logged and
1419    /// skipped.
1420    ///
1421    /// See also:
1422    ///
1423    /// * https://github.com/mirrorer/afl/blob/master/dictionaries/README.dictionaries
1424    ///
1425    /// + request `dictionary` the AFL-style dictionary
1426    /// * error one of the following:
1427    ///     * A socket error if transferring the input fails.
1428    ///     *`ZX_ERR_INVALID_ARGS` if parsing the dictionary fails.
1429    WriteDictionary { dictionary: Input, responder: ControllerWriteDictionaryResponder },
1430    /// Returns the current dictionary as an Input, which may be empty.
1431    ///
1432    /// - response `dictionary` the current AFL-style dictionary.
1433    ReadDictionary { responder: ControllerReadDictionaryResponder },
1434    /// Installs a `Monitor` to push status. To pull status instead, use
1435    /// `GetStatus`.
1436    ///
1437    /// + request `monitor` the client used to send status updates.
1438    AddMonitor {
1439        monitor: fdomain_client::fidl::ClientEnd<MonitorMarker>,
1440        responder: ControllerAddMonitorResponder,
1441    },
1442    /// Runs the normal fuzzing feedback loop:
1443    ///
1444    /// 1. Selects an input from the corpus.
1445    /// 2. Mutates the input.
1446    /// 3. Uses the `TargetAdapter` to execute the input.
1447    /// 4. Checks feedback from the `InstrumentedProcesses`.
1448    /// 5. If the input produced useful feedback, adds it to the corpus.
1449    ///
1450    /// This call returns quickly, but the loop continues until one of three
1451    /// conditions is met:
1452    ///
1453    /// 1. The configured, non-zero number of `runs` has been reached.
1454    /// 2. The configured, non-zero `duration` elapses.
1455    /// 3. An error is detected, and returned.
1456    ///
1457    /// See `Result` for more details on long running workflows such as this
1458    /// one.
1459    ///
1460    /// * error `ZX_ERR_BAD_STATE` if another long-running workflow is in
1461    ///   progress.
1462    Fuzz { responder: ControllerFuzzResponder },
1463    /// Executes the target code with a single `test_input`.
1464    ///
1465    /// See `Result` for more details on long running workflows such as this
1466    /// one.
1467    ///
1468    /// + request `input` the sequence of bytes to use with the fuzz target.
1469    /// * error one of the following:
1470    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
1471    ///       progress.
1472    ///     *  A socket error if transferring the input fails.
1473    TryOne { test_input: Input, responder: ControllerTryOneResponder },
1474    /// Attempts to find the smallest input that produces the same error as the
1475    /// given `test_input`,
1476    /// constrained by the configured `total_time` and/or `runs` options.
1477    ///
1478    /// See `Result` for more details on long running workflows such as this
1479    /// one.
1480    ///
1481    /// + request `input` the sequence of bytes to minimize.
1482    /// * error one of the following:
1483    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
1484    ///       progress.
1485    ///     * A socket error if transferring the input fails.
1486    ///     * `ZX_ERR_INVALID_ARGS` if the provided `test_input` does not cause
1487    ///       an error.
1488    Minimize { test_input: Input, responder: ControllerMinimizeResponder },
1489    /// Attempts to replace bytes of the given `test_input` with "filler" bytes,
1490    /// e.g. \x00, \xFF, without changing the error produced.
1491    ///
1492    /// See `Result` for more details on long running workflows such as this
1493    /// one.
1494    ///
1495    /// To preserve backwards compatibility with libFuzzer and ClusterFuzz, an
1496    /// input that produces no result is *not* considered an error, and is
1497    /// returned as-is.
1498    ///
1499    /// + request `input` the sequence of bytes to cleanse.
1500    /// * error one of the following:
1501    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
1502    ///       progress.
1503    ///     * A socket error if transferring the input fails.
1504    Cleanse { test_input: Input, responder: ControllerCleanseResponder },
1505    /// Attempts to shrink the corpora. Inputs from the seed corpus will be
1506    /// preserved. All other inputs will be sorted by amount of feedback
1507    /// produced and input size, and only those inputs that add new feedback not
1508    /// seen earlier in the sequence will be kept.
1509    ///
1510    /// See `Result` for more details on long running workflows such as this
1511    /// one.
1512    ///
1513    /// * error one of the following:
1514    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
1515    ///       progress.
1516    ///     * `ZX_ERR_INVALID_ARGS` if an input in the seed corpus causes an
1517    ///       error. Inputs in the live corpus that cause errors are skipped.
1518    Merge { responder: ControllerMergeResponder },
1519    /// Returns various fuzzing metrics, e.g. total coverage, speed, etc.
1520    ///
1521    /// - response `status` the current value of fuzzing metrics.
1522    GetStatus { responder: ControllerGetStatusResponder },
1523    /// Returns the results of a long-running workflow.
1524    ///
1525    /// This method uses the
1526    /// ["hanging get" pattern](https://fuchsia.dev/fuchsia-src/development/api/fidl#hanging-get).
1527    /// Upon the first call for a given connection, it will immediately return
1528    /// the controller's current artifact. Upon subsequent calls, it will block
1529    /// until the controller's artifact changes before returning. Clients should
1530    /// use `GetStatus` to ensure the fuzzer is not idle before making a
1531    /// blocking call to `WatchArtifact`.
1532    ///
1533    /// Combined with the `Status.running` value obtained from `GetStatus`, this
1534    /// allows a (re-)connecting client to infer the state of the fuzzer:
1535    ///
1536    /// * If the fuzzer is idle and has an empty artifact, then it is
1537    ///   unchanged since the last connection, if any.
1538    /// * If the fuzzer is running and has an empty artifact, then it is
1539    ///   performing a long-running workflow started by a previous connection.
1540    ///   The client may call `WatchArtifact` again to wait for the workflow
1541    ///   to complete.
1542    /// * If the fuzzer is idle and has a non-empty artifact, then it has
1543    ///   completed a long-running workflow since the last connection.
1544    ///
1545    /// It is not an error for clients to disconnect while waiting for a
1546    /// response from this method. This method is intended to allow clients to
1547    /// resume waiting for a long-running workflow to complete after
1548    /// intentionally or inadvertently being disconnected for an indefinite
1549    /// amount of time.
1550    ///
1551    /// - response `artifact` the most recent result and/or error-causing input.
1552    WatchArtifact { responder: ControllerWatchArtifactResponder },
1553}
1554
1555impl ControllerRequest {
1556    #[allow(irrefutable_let_patterns)]
1557    pub fn into_configure(self) -> Option<(Options, ControllerConfigureResponder)> {
1558        if let ControllerRequest::Configure { options, responder } = self {
1559            Some((options, responder))
1560        } else {
1561            None
1562        }
1563    }
1564
1565    #[allow(irrefutable_let_patterns)]
1566    pub fn into_get_options(self) -> Option<(ControllerGetOptionsResponder)> {
1567        if let ControllerRequest::GetOptions { responder } = self {
1568            Some((responder))
1569        } else {
1570            None
1571        }
1572    }
1573
1574    #[allow(irrefutable_let_patterns)]
1575    pub fn into_add_to_corpus(self) -> Option<(Corpus, Input, ControllerAddToCorpusResponder)> {
1576        if let ControllerRequest::AddToCorpus { corpus, input, responder } = self {
1577            Some((corpus, input, responder))
1578        } else {
1579            None
1580        }
1581    }
1582
1583    #[allow(irrefutable_let_patterns)]
1584    pub fn into_read_corpus(
1585        self,
1586    ) -> Option<(
1587        Corpus,
1588        fdomain_client::fidl::ClientEnd<CorpusReaderMarker>,
1589        ControllerReadCorpusResponder,
1590    )> {
1591        if let ControllerRequest::ReadCorpus { corpus, corpus_reader, responder } = self {
1592            Some((corpus, corpus_reader, responder))
1593        } else {
1594            None
1595        }
1596    }
1597
1598    #[allow(irrefutable_let_patterns)]
1599    pub fn into_write_dictionary(self) -> Option<(Input, ControllerWriteDictionaryResponder)> {
1600        if let ControllerRequest::WriteDictionary { dictionary, responder } = self {
1601            Some((dictionary, responder))
1602        } else {
1603            None
1604        }
1605    }
1606
1607    #[allow(irrefutable_let_patterns)]
1608    pub fn into_read_dictionary(self) -> Option<(ControllerReadDictionaryResponder)> {
1609        if let ControllerRequest::ReadDictionary { responder } = self {
1610            Some((responder))
1611        } else {
1612            None
1613        }
1614    }
1615
1616    #[allow(irrefutable_let_patterns)]
1617    pub fn into_add_monitor(
1618        self,
1619    ) -> Option<(fdomain_client::fidl::ClientEnd<MonitorMarker>, ControllerAddMonitorResponder)>
1620    {
1621        if let ControllerRequest::AddMonitor { monitor, responder } = self {
1622            Some((monitor, responder))
1623        } else {
1624            None
1625        }
1626    }
1627
1628    #[allow(irrefutable_let_patterns)]
1629    pub fn into_fuzz(self) -> Option<(ControllerFuzzResponder)> {
1630        if let ControllerRequest::Fuzz { responder } = self { Some((responder)) } else { None }
1631    }
1632
1633    #[allow(irrefutable_let_patterns)]
1634    pub fn into_try_one(self) -> Option<(Input, ControllerTryOneResponder)> {
1635        if let ControllerRequest::TryOne { test_input, responder } = self {
1636            Some((test_input, responder))
1637        } else {
1638            None
1639        }
1640    }
1641
1642    #[allow(irrefutable_let_patterns)]
1643    pub fn into_minimize(self) -> Option<(Input, ControllerMinimizeResponder)> {
1644        if let ControllerRequest::Minimize { test_input, responder } = self {
1645            Some((test_input, responder))
1646        } else {
1647            None
1648        }
1649    }
1650
1651    #[allow(irrefutable_let_patterns)]
1652    pub fn into_cleanse(self) -> Option<(Input, ControllerCleanseResponder)> {
1653        if let ControllerRequest::Cleanse { test_input, responder } = self {
1654            Some((test_input, responder))
1655        } else {
1656            None
1657        }
1658    }
1659
1660    #[allow(irrefutable_let_patterns)]
1661    pub fn into_merge(self) -> Option<(ControllerMergeResponder)> {
1662        if let ControllerRequest::Merge { responder } = self { Some((responder)) } else { None }
1663    }
1664
1665    #[allow(irrefutable_let_patterns)]
1666    pub fn into_get_status(self) -> Option<(ControllerGetStatusResponder)> {
1667        if let ControllerRequest::GetStatus { responder } = self { Some((responder)) } else { None }
1668    }
1669
1670    #[allow(irrefutable_let_patterns)]
1671    pub fn into_watch_artifact(self) -> Option<(ControllerWatchArtifactResponder)> {
1672        if let ControllerRequest::WatchArtifact { responder } = self {
1673            Some((responder))
1674        } else {
1675            None
1676        }
1677    }
1678
1679    /// Name of the method defined in FIDL
1680    pub fn method_name(&self) -> &'static str {
1681        match *self {
1682            ControllerRequest::Configure { .. } => "configure",
1683            ControllerRequest::GetOptions { .. } => "get_options",
1684            ControllerRequest::AddToCorpus { .. } => "add_to_corpus",
1685            ControllerRequest::ReadCorpus { .. } => "read_corpus",
1686            ControllerRequest::WriteDictionary { .. } => "write_dictionary",
1687            ControllerRequest::ReadDictionary { .. } => "read_dictionary",
1688            ControllerRequest::AddMonitor { .. } => "add_monitor",
1689            ControllerRequest::Fuzz { .. } => "fuzz",
1690            ControllerRequest::TryOne { .. } => "try_one",
1691            ControllerRequest::Minimize { .. } => "minimize",
1692            ControllerRequest::Cleanse { .. } => "cleanse",
1693            ControllerRequest::Merge { .. } => "merge",
1694            ControllerRequest::GetStatus { .. } => "get_status",
1695            ControllerRequest::WatchArtifact { .. } => "watch_artifact",
1696        }
1697    }
1698}
1699
1700#[derive(Debug, Clone)]
1701pub struct ControllerControlHandle {
1702    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1703}
1704
1705impl fdomain_client::fidl::ControlHandle for ControllerControlHandle {
1706    fn shutdown(&self) {
1707        self.inner.shutdown()
1708    }
1709
1710    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1711        self.inner.shutdown_with_epitaph(status)
1712    }
1713
1714    fn is_closed(&self) -> bool {
1715        self.inner.channel().is_closed()
1716    }
1717    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
1718        self.inner.channel().on_closed()
1719    }
1720}
1721
1722impl ControllerControlHandle {}
1723
1724#[must_use = "FIDL methods require a response to be sent"]
1725#[derive(Debug)]
1726pub struct ControllerConfigureResponder {
1727    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1728    tx_id: u32,
1729}
1730
1731/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
1732/// if the responder is dropped without sending a response, so that the client
1733/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1734impl std::ops::Drop for ControllerConfigureResponder {
1735    fn drop(&mut self) {
1736        self.control_handle.shutdown();
1737        // Safety: drops once, never accessed again
1738        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1739    }
1740}
1741
1742impl fdomain_client::fidl::Responder for ControllerConfigureResponder {
1743    type ControlHandle = ControllerControlHandle;
1744
1745    fn control_handle(&self) -> &ControllerControlHandle {
1746        &self.control_handle
1747    }
1748
1749    fn drop_without_shutdown(mut self) {
1750        // Safety: drops once, never accessed again due to mem::forget
1751        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1752        // Prevent Drop from running (which would shut down the channel)
1753        std::mem::forget(self);
1754    }
1755}
1756
1757impl ControllerConfigureResponder {
1758    /// Sends a response to the FIDL transaction.
1759    ///
1760    /// Sets the channel to shutdown if an error occurs.
1761    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1762        let _result = self.send_raw(result);
1763        if _result.is_err() {
1764            self.control_handle.shutdown();
1765        }
1766        self.drop_without_shutdown();
1767        _result
1768    }
1769
1770    /// Similar to "send" but does not shutdown the channel if an error occurs.
1771    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1772        let _result = self.send_raw(result);
1773        self.drop_without_shutdown();
1774        _result
1775    }
1776
1777    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1778        self.control_handle
1779            .inner
1780            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1781                result,
1782                self.tx_id,
1783                0x35c8cba7fa3d32e4,
1784                fidl::encoding::DynamicFlags::empty(),
1785            )
1786    }
1787}
1788
1789#[must_use = "FIDL methods require a response to be sent"]
1790#[derive(Debug)]
1791pub struct ControllerGetOptionsResponder {
1792    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1793    tx_id: u32,
1794}
1795
1796/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
1797/// if the responder is dropped without sending a response, so that the client
1798/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1799impl std::ops::Drop for ControllerGetOptionsResponder {
1800    fn drop(&mut self) {
1801        self.control_handle.shutdown();
1802        // Safety: drops once, never accessed again
1803        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1804    }
1805}
1806
1807impl fdomain_client::fidl::Responder for ControllerGetOptionsResponder {
1808    type ControlHandle = ControllerControlHandle;
1809
1810    fn control_handle(&self) -> &ControllerControlHandle {
1811        &self.control_handle
1812    }
1813
1814    fn drop_without_shutdown(mut self) {
1815        // Safety: drops once, never accessed again due to mem::forget
1816        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1817        // Prevent Drop from running (which would shut down the channel)
1818        std::mem::forget(self);
1819    }
1820}
1821
1822impl ControllerGetOptionsResponder {
1823    /// Sends a response to the FIDL transaction.
1824    ///
1825    /// Sets the channel to shutdown if an error occurs.
1826    pub fn send(self, mut options: &Options) -> Result<(), fidl::Error> {
1827        let _result = self.send_raw(options);
1828        if _result.is_err() {
1829            self.control_handle.shutdown();
1830        }
1831        self.drop_without_shutdown();
1832        _result
1833    }
1834
1835    /// Similar to "send" but does not shutdown the channel if an error occurs.
1836    pub fn send_no_shutdown_on_err(self, mut options: &Options) -> Result<(), fidl::Error> {
1837        let _result = self.send_raw(options);
1838        self.drop_without_shutdown();
1839        _result
1840    }
1841
1842    fn send_raw(&self, mut options: &Options) -> Result<(), fidl::Error> {
1843        self.control_handle.inner.send::<ControllerGetOptionsResponse>(
1844            (options,),
1845            self.tx_id,
1846            0x683d93332504b9cd,
1847            fidl::encoding::DynamicFlags::empty(),
1848        )
1849    }
1850}
1851
1852#[must_use = "FIDL methods require a response to be sent"]
1853#[derive(Debug)]
1854pub struct ControllerAddToCorpusResponder {
1855    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1856    tx_id: u32,
1857}
1858
1859/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
1860/// if the responder is dropped without sending a response, so that the client
1861/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1862impl std::ops::Drop for ControllerAddToCorpusResponder {
1863    fn drop(&mut self) {
1864        self.control_handle.shutdown();
1865        // Safety: drops once, never accessed again
1866        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1867    }
1868}
1869
1870impl fdomain_client::fidl::Responder for ControllerAddToCorpusResponder {
1871    type ControlHandle = ControllerControlHandle;
1872
1873    fn control_handle(&self) -> &ControllerControlHandle {
1874        &self.control_handle
1875    }
1876
1877    fn drop_without_shutdown(mut self) {
1878        // Safety: drops once, never accessed again due to mem::forget
1879        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1880        // Prevent Drop from running (which would shut down the channel)
1881        std::mem::forget(self);
1882    }
1883}
1884
1885impl ControllerAddToCorpusResponder {
1886    /// Sends a response to the FIDL transaction.
1887    ///
1888    /// Sets the channel to shutdown if an error occurs.
1889    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1890        let _result = self.send_raw(result);
1891        if _result.is_err() {
1892            self.control_handle.shutdown();
1893        }
1894        self.drop_without_shutdown();
1895        _result
1896    }
1897
1898    /// Similar to "send" but does not shutdown the channel if an error occurs.
1899    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1900        let _result = self.send_raw(result);
1901        self.drop_without_shutdown();
1902        _result
1903    }
1904
1905    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1906        self.control_handle
1907            .inner
1908            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1909                result,
1910                self.tx_id,
1911                0x7bdf8336ab534cee,
1912                fidl::encoding::DynamicFlags::empty(),
1913            )
1914    }
1915}
1916
1917#[must_use = "FIDL methods require a response to be sent"]
1918#[derive(Debug)]
1919pub struct ControllerReadCorpusResponder {
1920    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1921    tx_id: u32,
1922}
1923
1924/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
1925/// if the responder is dropped without sending a response, so that the client
1926/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1927impl std::ops::Drop for ControllerReadCorpusResponder {
1928    fn drop(&mut self) {
1929        self.control_handle.shutdown();
1930        // Safety: drops once, never accessed again
1931        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1932    }
1933}
1934
1935impl fdomain_client::fidl::Responder for ControllerReadCorpusResponder {
1936    type ControlHandle = ControllerControlHandle;
1937
1938    fn control_handle(&self) -> &ControllerControlHandle {
1939        &self.control_handle
1940    }
1941
1942    fn drop_without_shutdown(mut self) {
1943        // Safety: drops once, never accessed again due to mem::forget
1944        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1945        // Prevent Drop from running (which would shut down the channel)
1946        std::mem::forget(self);
1947    }
1948}
1949
1950impl ControllerReadCorpusResponder {
1951    /// Sends a response to the FIDL transaction.
1952    ///
1953    /// Sets the channel to shutdown if an error occurs.
1954    pub fn send(self) -> Result<(), fidl::Error> {
1955        let _result = self.send_raw();
1956        if _result.is_err() {
1957            self.control_handle.shutdown();
1958        }
1959        self.drop_without_shutdown();
1960        _result
1961    }
1962
1963    /// Similar to "send" but does not shutdown the channel if an error occurs.
1964    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1965        let _result = self.send_raw();
1966        self.drop_without_shutdown();
1967        _result
1968    }
1969
1970    fn send_raw(&self) -> Result<(), fidl::Error> {
1971        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1972            (),
1973            self.tx_id,
1974            0x501279b430b34514,
1975            fidl::encoding::DynamicFlags::empty(),
1976        )
1977    }
1978}
1979
1980#[must_use = "FIDL methods require a response to be sent"]
1981#[derive(Debug)]
1982pub struct ControllerWriteDictionaryResponder {
1983    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1984    tx_id: u32,
1985}
1986
1987/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
1988/// if the responder is dropped without sending a response, so that the client
1989/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1990impl std::ops::Drop for ControllerWriteDictionaryResponder {
1991    fn drop(&mut self) {
1992        self.control_handle.shutdown();
1993        // Safety: drops once, never accessed again
1994        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1995    }
1996}
1997
1998impl fdomain_client::fidl::Responder for ControllerWriteDictionaryResponder {
1999    type ControlHandle = ControllerControlHandle;
2000
2001    fn control_handle(&self) -> &ControllerControlHandle {
2002        &self.control_handle
2003    }
2004
2005    fn drop_without_shutdown(mut self) {
2006        // Safety: drops once, never accessed again due to mem::forget
2007        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2008        // Prevent Drop from running (which would shut down the channel)
2009        std::mem::forget(self);
2010    }
2011}
2012
2013impl ControllerWriteDictionaryResponder {
2014    /// Sends a response to the FIDL transaction.
2015    ///
2016    /// Sets the channel to shutdown if an error occurs.
2017    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2018        let _result = self.send_raw(result);
2019        if _result.is_err() {
2020            self.control_handle.shutdown();
2021        }
2022        self.drop_without_shutdown();
2023        _result
2024    }
2025
2026    /// Similar to "send" but does not shutdown the channel if an error occurs.
2027    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2028        let _result = self.send_raw(result);
2029        self.drop_without_shutdown();
2030        _result
2031    }
2032
2033    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2034        self.control_handle
2035            .inner
2036            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2037                result,
2038                self.tx_id,
2039                0x4ecfc1274fe4a70b,
2040                fidl::encoding::DynamicFlags::empty(),
2041            )
2042    }
2043}
2044
2045#[must_use = "FIDL methods require a response to be sent"]
2046#[derive(Debug)]
2047pub struct ControllerReadDictionaryResponder {
2048    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2049    tx_id: u32,
2050}
2051
2052/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2053/// if the responder is dropped without sending a response, so that the client
2054/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2055impl std::ops::Drop for ControllerReadDictionaryResponder {
2056    fn drop(&mut self) {
2057        self.control_handle.shutdown();
2058        // Safety: drops once, never accessed again
2059        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2060    }
2061}
2062
2063impl fdomain_client::fidl::Responder for ControllerReadDictionaryResponder {
2064    type ControlHandle = ControllerControlHandle;
2065
2066    fn control_handle(&self) -> &ControllerControlHandle {
2067        &self.control_handle
2068    }
2069
2070    fn drop_without_shutdown(mut self) {
2071        // Safety: drops once, never accessed again due to mem::forget
2072        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2073        // Prevent Drop from running (which would shut down the channel)
2074        std::mem::forget(self);
2075    }
2076}
2077
2078impl ControllerReadDictionaryResponder {
2079    /// Sends a response to the FIDL transaction.
2080    ///
2081    /// Sets the channel to shutdown if an error occurs.
2082    pub fn send(self, mut dictionary: Input) -> Result<(), fidl::Error> {
2083        let _result = self.send_raw(dictionary);
2084        if _result.is_err() {
2085            self.control_handle.shutdown();
2086        }
2087        self.drop_without_shutdown();
2088        _result
2089    }
2090
2091    /// Similar to "send" but does not shutdown the channel if an error occurs.
2092    pub fn send_no_shutdown_on_err(self, mut dictionary: Input) -> Result<(), fidl::Error> {
2093        let _result = self.send_raw(dictionary);
2094        self.drop_without_shutdown();
2095        _result
2096    }
2097
2098    fn send_raw(&self, mut dictionary: Input) -> Result<(), fidl::Error> {
2099        self.control_handle.inner.send::<ControllerReadDictionaryResponse>(
2100            (&mut dictionary,),
2101            self.tx_id,
2102            0x1be6724c87b51c37,
2103            fidl::encoding::DynamicFlags::empty(),
2104        )
2105    }
2106}
2107
2108#[must_use = "FIDL methods require a response to be sent"]
2109#[derive(Debug)]
2110pub struct ControllerAddMonitorResponder {
2111    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2112    tx_id: u32,
2113}
2114
2115/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2116/// if the responder is dropped without sending a response, so that the client
2117/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2118impl std::ops::Drop for ControllerAddMonitorResponder {
2119    fn drop(&mut self) {
2120        self.control_handle.shutdown();
2121        // Safety: drops once, never accessed again
2122        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2123    }
2124}
2125
2126impl fdomain_client::fidl::Responder for ControllerAddMonitorResponder {
2127    type ControlHandle = ControllerControlHandle;
2128
2129    fn control_handle(&self) -> &ControllerControlHandle {
2130        &self.control_handle
2131    }
2132
2133    fn drop_without_shutdown(mut self) {
2134        // Safety: drops once, never accessed again due to mem::forget
2135        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2136        // Prevent Drop from running (which would shut down the channel)
2137        std::mem::forget(self);
2138    }
2139}
2140
2141impl ControllerAddMonitorResponder {
2142    /// Sends a response to the FIDL transaction.
2143    ///
2144    /// Sets the channel to shutdown if an error occurs.
2145    pub fn send(self) -> Result<(), fidl::Error> {
2146        let _result = self.send_raw();
2147        if _result.is_err() {
2148            self.control_handle.shutdown();
2149        }
2150        self.drop_without_shutdown();
2151        _result
2152    }
2153
2154    /// Similar to "send" but does not shutdown the channel if an error occurs.
2155    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2156        let _result = self.send_raw();
2157        self.drop_without_shutdown();
2158        _result
2159    }
2160
2161    fn send_raw(&self) -> Result<(), fidl::Error> {
2162        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2163            (),
2164            self.tx_id,
2165            0x2efbf7d3dc21438e,
2166            fidl::encoding::DynamicFlags::empty(),
2167        )
2168    }
2169}
2170
2171#[must_use = "FIDL methods require a response to be sent"]
2172#[derive(Debug)]
2173pub struct ControllerFuzzResponder {
2174    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2175    tx_id: u32,
2176}
2177
2178/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2179/// if the responder is dropped without sending a response, so that the client
2180/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2181impl std::ops::Drop for ControllerFuzzResponder {
2182    fn drop(&mut self) {
2183        self.control_handle.shutdown();
2184        // Safety: drops once, never accessed again
2185        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2186    }
2187}
2188
2189impl fdomain_client::fidl::Responder for ControllerFuzzResponder {
2190    type ControlHandle = ControllerControlHandle;
2191
2192    fn control_handle(&self) -> &ControllerControlHandle {
2193        &self.control_handle
2194    }
2195
2196    fn drop_without_shutdown(mut self) {
2197        // Safety: drops once, never accessed again due to mem::forget
2198        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2199        // Prevent Drop from running (which would shut down the channel)
2200        std::mem::forget(self);
2201    }
2202}
2203
2204impl ControllerFuzzResponder {
2205    /// Sends a response to the FIDL transaction.
2206    ///
2207    /// Sets the channel to shutdown if an error occurs.
2208    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2209        let _result = self.send_raw(result);
2210        if _result.is_err() {
2211            self.control_handle.shutdown();
2212        }
2213        self.drop_without_shutdown();
2214        _result
2215    }
2216
2217    /// Similar to "send" but does not shutdown the channel if an error occurs.
2218    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2219        let _result = self.send_raw(result);
2220        self.drop_without_shutdown();
2221        _result
2222    }
2223
2224    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2225        self.control_handle
2226            .inner
2227            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2228                result,
2229                self.tx_id,
2230                0x62fe3684ea23af62,
2231                fidl::encoding::DynamicFlags::empty(),
2232            )
2233    }
2234}
2235
2236#[must_use = "FIDL methods require a response to be sent"]
2237#[derive(Debug)]
2238pub struct ControllerTryOneResponder {
2239    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2240    tx_id: u32,
2241}
2242
2243/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2244/// if the responder is dropped without sending a response, so that the client
2245/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2246impl std::ops::Drop for ControllerTryOneResponder {
2247    fn drop(&mut self) {
2248        self.control_handle.shutdown();
2249        // Safety: drops once, never accessed again
2250        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2251    }
2252}
2253
2254impl fdomain_client::fidl::Responder for ControllerTryOneResponder {
2255    type ControlHandle = ControllerControlHandle;
2256
2257    fn control_handle(&self) -> &ControllerControlHandle {
2258        &self.control_handle
2259    }
2260
2261    fn drop_without_shutdown(mut self) {
2262        // Safety: drops once, never accessed again due to mem::forget
2263        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2264        // Prevent Drop from running (which would shut down the channel)
2265        std::mem::forget(self);
2266    }
2267}
2268
2269impl ControllerTryOneResponder {
2270    /// Sends a response to the FIDL transaction.
2271    ///
2272    /// Sets the channel to shutdown if an error occurs.
2273    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2274        let _result = self.send_raw(result);
2275        if _result.is_err() {
2276            self.control_handle.shutdown();
2277        }
2278        self.drop_without_shutdown();
2279        _result
2280    }
2281
2282    /// Similar to "send" but does not shutdown the channel if an error occurs.
2283    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2284        let _result = self.send_raw(result);
2285        self.drop_without_shutdown();
2286        _result
2287    }
2288
2289    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2290        self.control_handle
2291            .inner
2292            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2293                result,
2294                self.tx_id,
2295                0x368dc762d8e16d46,
2296                fidl::encoding::DynamicFlags::empty(),
2297            )
2298    }
2299}
2300
2301#[must_use = "FIDL methods require a response to be sent"]
2302#[derive(Debug)]
2303pub struct ControllerMinimizeResponder {
2304    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2305    tx_id: u32,
2306}
2307
2308/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2309/// if the responder is dropped without sending a response, so that the client
2310/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2311impl std::ops::Drop for ControllerMinimizeResponder {
2312    fn drop(&mut self) {
2313        self.control_handle.shutdown();
2314        // Safety: drops once, never accessed again
2315        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2316    }
2317}
2318
2319impl fdomain_client::fidl::Responder for ControllerMinimizeResponder {
2320    type ControlHandle = ControllerControlHandle;
2321
2322    fn control_handle(&self) -> &ControllerControlHandle {
2323        &self.control_handle
2324    }
2325
2326    fn drop_without_shutdown(mut self) {
2327        // Safety: drops once, never accessed again due to mem::forget
2328        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2329        // Prevent Drop from running (which would shut down the channel)
2330        std::mem::forget(self);
2331    }
2332}
2333
2334impl ControllerMinimizeResponder {
2335    /// Sends a response to the FIDL transaction.
2336    ///
2337    /// Sets the channel to shutdown if an error occurs.
2338    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2339        let _result = self.send_raw(result);
2340        if _result.is_err() {
2341            self.control_handle.shutdown();
2342        }
2343        self.drop_without_shutdown();
2344        _result
2345    }
2346
2347    /// Similar to "send" but does not shutdown the channel if an error occurs.
2348    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2349        let _result = self.send_raw(result);
2350        self.drop_without_shutdown();
2351        _result
2352    }
2353
2354    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2355        self.control_handle
2356            .inner
2357            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2358                result,
2359                self.tx_id,
2360                0x105a242ee0552794,
2361                fidl::encoding::DynamicFlags::empty(),
2362            )
2363    }
2364}
2365
2366#[must_use = "FIDL methods require a response to be sent"]
2367#[derive(Debug)]
2368pub struct ControllerCleanseResponder {
2369    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2370    tx_id: u32,
2371}
2372
2373/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2374/// if the responder is dropped without sending a response, so that the client
2375/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2376impl std::ops::Drop for ControllerCleanseResponder {
2377    fn drop(&mut self) {
2378        self.control_handle.shutdown();
2379        // Safety: drops once, never accessed again
2380        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2381    }
2382}
2383
2384impl fdomain_client::fidl::Responder for ControllerCleanseResponder {
2385    type ControlHandle = ControllerControlHandle;
2386
2387    fn control_handle(&self) -> &ControllerControlHandle {
2388        &self.control_handle
2389    }
2390
2391    fn drop_without_shutdown(mut self) {
2392        // Safety: drops once, never accessed again due to mem::forget
2393        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2394        // Prevent Drop from running (which would shut down the channel)
2395        std::mem::forget(self);
2396    }
2397}
2398
2399impl ControllerCleanseResponder {
2400    /// Sends a response to the FIDL transaction.
2401    ///
2402    /// Sets the channel to shutdown if an error occurs.
2403    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2404        let _result = self.send_raw(result);
2405        if _result.is_err() {
2406            self.control_handle.shutdown();
2407        }
2408        self.drop_without_shutdown();
2409        _result
2410    }
2411
2412    /// Similar to "send" but does not shutdown the channel if an error occurs.
2413    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2414        let _result = self.send_raw(result);
2415        self.drop_without_shutdown();
2416        _result
2417    }
2418
2419    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2420        self.control_handle
2421            .inner
2422            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2423                result,
2424                self.tx_id,
2425                0x6d7892f62735f3e0,
2426                fidl::encoding::DynamicFlags::empty(),
2427            )
2428    }
2429}
2430
2431#[must_use = "FIDL methods require a response to be sent"]
2432#[derive(Debug)]
2433pub struct ControllerMergeResponder {
2434    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2435    tx_id: u32,
2436}
2437
2438/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2439/// if the responder is dropped without sending a response, so that the client
2440/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2441impl std::ops::Drop for ControllerMergeResponder {
2442    fn drop(&mut self) {
2443        self.control_handle.shutdown();
2444        // Safety: drops once, never accessed again
2445        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2446    }
2447}
2448
2449impl fdomain_client::fidl::Responder for ControllerMergeResponder {
2450    type ControlHandle = ControllerControlHandle;
2451
2452    fn control_handle(&self) -> &ControllerControlHandle {
2453        &self.control_handle
2454    }
2455
2456    fn drop_without_shutdown(mut self) {
2457        // Safety: drops once, never accessed again due to mem::forget
2458        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2459        // Prevent Drop from running (which would shut down the channel)
2460        std::mem::forget(self);
2461    }
2462}
2463
2464impl ControllerMergeResponder {
2465    /// Sends a response to the FIDL transaction.
2466    ///
2467    /// Sets the channel to shutdown if an error occurs.
2468    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2469        let _result = self.send_raw(result);
2470        if _result.is_err() {
2471            self.control_handle.shutdown();
2472        }
2473        self.drop_without_shutdown();
2474        _result
2475    }
2476
2477    /// Similar to "send" but does not shutdown the channel if an error occurs.
2478    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2479        let _result = self.send_raw(result);
2480        self.drop_without_shutdown();
2481        _result
2482    }
2483
2484    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2485        self.control_handle
2486            .inner
2487            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2488                result,
2489                self.tx_id,
2490                0x3614e5c39413b5eb,
2491                fidl::encoding::DynamicFlags::empty(),
2492            )
2493    }
2494}
2495
2496#[must_use = "FIDL methods require a response to be sent"]
2497#[derive(Debug)]
2498pub struct ControllerGetStatusResponder {
2499    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2500    tx_id: u32,
2501}
2502
2503/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2504/// if the responder is dropped without sending a response, so that the client
2505/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2506impl std::ops::Drop for ControllerGetStatusResponder {
2507    fn drop(&mut self) {
2508        self.control_handle.shutdown();
2509        // Safety: drops once, never accessed again
2510        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2511    }
2512}
2513
2514impl fdomain_client::fidl::Responder for ControllerGetStatusResponder {
2515    type ControlHandle = ControllerControlHandle;
2516
2517    fn control_handle(&self) -> &ControllerControlHandle {
2518        &self.control_handle
2519    }
2520
2521    fn drop_without_shutdown(mut self) {
2522        // Safety: drops once, never accessed again due to mem::forget
2523        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2524        // Prevent Drop from running (which would shut down the channel)
2525        std::mem::forget(self);
2526    }
2527}
2528
2529impl ControllerGetStatusResponder {
2530    /// Sends a response to the FIDL transaction.
2531    ///
2532    /// Sets the channel to shutdown if an error occurs.
2533    pub fn send(self, mut status: &Status) -> Result<(), fidl::Error> {
2534        let _result = self.send_raw(status);
2535        if _result.is_err() {
2536            self.control_handle.shutdown();
2537        }
2538        self.drop_without_shutdown();
2539        _result
2540    }
2541
2542    /// Similar to "send" but does not shutdown the channel if an error occurs.
2543    pub fn send_no_shutdown_on_err(self, mut status: &Status) -> Result<(), fidl::Error> {
2544        let _result = self.send_raw(status);
2545        self.drop_without_shutdown();
2546        _result
2547    }
2548
2549    fn send_raw(&self, mut status: &Status) -> Result<(), fidl::Error> {
2550        self.control_handle.inner.send::<ControllerGetStatusResponse>(
2551            (status,),
2552            self.tx_id,
2553            0x51db4975d93ce768,
2554            fidl::encoding::DynamicFlags::empty(),
2555        )
2556    }
2557}
2558
2559#[must_use = "FIDL methods require a response to be sent"]
2560#[derive(Debug)]
2561pub struct ControllerWatchArtifactResponder {
2562    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2563    tx_id: u32,
2564}
2565
2566/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2567/// if the responder is dropped without sending a response, so that the client
2568/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2569impl std::ops::Drop for ControllerWatchArtifactResponder {
2570    fn drop(&mut self) {
2571        self.control_handle.shutdown();
2572        // Safety: drops once, never accessed again
2573        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2574    }
2575}
2576
2577impl fdomain_client::fidl::Responder for ControllerWatchArtifactResponder {
2578    type ControlHandle = ControllerControlHandle;
2579
2580    fn control_handle(&self) -> &ControllerControlHandle {
2581        &self.control_handle
2582    }
2583
2584    fn drop_without_shutdown(mut self) {
2585        // Safety: drops once, never accessed again due to mem::forget
2586        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2587        // Prevent Drop from running (which would shut down the channel)
2588        std::mem::forget(self);
2589    }
2590}
2591
2592impl ControllerWatchArtifactResponder {
2593    /// Sends a response to the FIDL transaction.
2594    ///
2595    /// Sets the channel to shutdown if an error occurs.
2596    pub fn send(self, mut artifact: Artifact) -> Result<(), fidl::Error> {
2597        let _result = self.send_raw(artifact);
2598        if _result.is_err() {
2599            self.control_handle.shutdown();
2600        }
2601        self.drop_without_shutdown();
2602        _result
2603    }
2604
2605    /// Similar to "send" but does not shutdown the channel if an error occurs.
2606    pub fn send_no_shutdown_on_err(self, mut artifact: Artifact) -> Result<(), fidl::Error> {
2607        let _result = self.send_raw(artifact);
2608        self.drop_without_shutdown();
2609        _result
2610    }
2611
2612    fn send_raw(&self, mut artifact: Artifact) -> Result<(), fidl::Error> {
2613        self.control_handle.inner.send::<ControllerWatchArtifactResponse>(
2614            (&mut artifact,),
2615            self.tx_id,
2616            0x6cfca3730944a414,
2617            fidl::encoding::DynamicFlags::empty(),
2618        )
2619    }
2620}
2621
2622#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2623pub struct ControllerProviderMarker;
2624
2625impl fdomain_client::fidl::ProtocolMarker for ControllerProviderMarker {
2626    type Proxy = ControllerProviderProxy;
2627    type RequestStream = ControllerProviderRequestStream;
2628
2629    const DEBUG_NAME: &'static str = "(anonymous) ControllerProvider";
2630}
2631
2632pub trait ControllerProviderProxyInterface: Send + Sync {
2633    type ConnectResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2634    fn r#connect(
2635        &self,
2636        controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
2637    ) -> Self::ConnectResponseFut;
2638    fn r#stop(&self) -> Result<(), fidl::Error>;
2639}
2640
2641#[derive(Debug, Clone)]
2642pub struct ControllerProviderProxy {
2643    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
2644}
2645
2646impl fdomain_client::fidl::Proxy for ControllerProviderProxy {
2647    type Protocol = ControllerProviderMarker;
2648
2649    fn from_channel(inner: fdomain_client::Channel) -> Self {
2650        Self::new(inner)
2651    }
2652
2653    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
2654        self.client.into_channel().map_err(|client| Self { client })
2655    }
2656
2657    fn as_channel(&self) -> &fdomain_client::Channel {
2658        self.client.as_channel()
2659    }
2660}
2661
2662impl ControllerProviderProxy {
2663    /// Create a new Proxy for fuchsia.fuzzer/ControllerProvider.
2664    pub fn new(channel: fdomain_client::Channel) -> Self {
2665        let protocol_name =
2666            <ControllerProviderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
2667        Self { client: fidl::client::Client::new(channel, protocol_name) }
2668    }
2669
2670    /// Get a Stream of events from the remote end of the protocol.
2671    ///
2672    /// # Panics
2673    ///
2674    /// Panics if the event stream was already taken.
2675    pub fn take_event_stream(&self) -> ControllerProviderEventStream {
2676        ControllerProviderEventStream { event_receiver: self.client.take_event_receiver() }
2677    }
2678
2679    /// Connects a client to the fuzzer.
2680    ///
2681    /// Within the component fuzzing framework, the fuzz-manager forwards
2682    /// `Controller` connection requests to the fuzz-registry, which uses
2683    /// clients of this interface provided by the fuzzers themselves to perform
2684    /// the connection.
2685    ///
2686    /// At most one client can be connected to a controller at any given time.
2687    /// A subsequent call to `Connect` will preempt and replace the existing
2688    /// connection.
2689    ///
2690    /// + request `controller` the connection from the client.
2691    pub fn r#connect(
2692        &self,
2693        mut controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
2694    ) -> fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect> {
2695        ControllerProviderProxyInterface::r#connect(self, controller)
2696    }
2697
2698    /// Interrupt any current workflow, closes the channel, and exits the
2699    /// fuzzing engine.
2700    pub fn r#stop(&self) -> Result<(), fidl::Error> {
2701        ControllerProviderProxyInterface::r#stop(self)
2702    }
2703}
2704
2705impl ControllerProviderProxyInterface for ControllerProviderProxy {
2706    type ConnectResponseFut =
2707        fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect>;
2708    fn r#connect(
2709        &self,
2710        mut controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
2711    ) -> Self::ConnectResponseFut {
2712        fn _decode(
2713            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2714        ) -> Result<(), fidl::Error> {
2715            let _response = fidl::client::decode_transaction_body::<
2716                fidl::encoding::EmptyPayload,
2717                fdomain_client::fidl::FDomainResourceDialect,
2718                0xc0325f0732defcb,
2719            >(_buf?)?;
2720            Ok(_response)
2721        }
2722        self.client.send_query_and_decode::<ControllerProviderConnectRequest, ()>(
2723            (controller,),
2724            0xc0325f0732defcb,
2725            fidl::encoding::DynamicFlags::empty(),
2726            _decode,
2727        )
2728    }
2729
2730    fn r#stop(&self) -> Result<(), fidl::Error> {
2731        self.client.send::<fidl::encoding::EmptyPayload>(
2732            (),
2733            0x6cd6a98fc38bcbf2,
2734            fidl::encoding::DynamicFlags::empty(),
2735        )
2736    }
2737}
2738
2739pub struct ControllerProviderEventStream {
2740    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
2741}
2742
2743impl std::marker::Unpin for ControllerProviderEventStream {}
2744
2745impl futures::stream::FusedStream for ControllerProviderEventStream {
2746    fn is_terminated(&self) -> bool {
2747        self.event_receiver.is_terminated()
2748    }
2749}
2750
2751impl futures::Stream for ControllerProviderEventStream {
2752    type Item = Result<ControllerProviderEvent, fidl::Error>;
2753
2754    fn poll_next(
2755        mut self: std::pin::Pin<&mut Self>,
2756        cx: &mut std::task::Context<'_>,
2757    ) -> std::task::Poll<Option<Self::Item>> {
2758        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2759            &mut self.event_receiver,
2760            cx
2761        )?) {
2762            Some(buf) => std::task::Poll::Ready(Some(ControllerProviderEvent::decode(buf))),
2763            None => std::task::Poll::Ready(None),
2764        }
2765    }
2766}
2767
2768#[derive(Debug)]
2769pub enum ControllerProviderEvent {}
2770
2771impl ControllerProviderEvent {
2772    /// Decodes a message buffer as a [`ControllerProviderEvent`].
2773    fn decode(
2774        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2775    ) -> Result<ControllerProviderEvent, fidl::Error> {
2776        let (bytes, _handles) = buf.split_mut();
2777        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2778        debug_assert_eq!(tx_header.tx_id, 0);
2779        match tx_header.ordinal {
2780            _ => Err(fidl::Error::UnknownOrdinal {
2781                ordinal: tx_header.ordinal,
2782                protocol_name:
2783                    <ControllerProviderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2784            }),
2785        }
2786    }
2787}
2788
2789/// A Stream of incoming requests for fuchsia.fuzzer/ControllerProvider.
2790pub struct ControllerProviderRequestStream {
2791    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2792    is_terminated: bool,
2793}
2794
2795impl std::marker::Unpin for ControllerProviderRequestStream {}
2796
2797impl futures::stream::FusedStream for ControllerProviderRequestStream {
2798    fn is_terminated(&self) -> bool {
2799        self.is_terminated
2800    }
2801}
2802
2803impl fdomain_client::fidl::RequestStream for ControllerProviderRequestStream {
2804    type Protocol = ControllerProviderMarker;
2805    type ControlHandle = ControllerProviderControlHandle;
2806
2807    fn from_channel(channel: fdomain_client::Channel) -> Self {
2808        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2809    }
2810
2811    fn control_handle(&self) -> Self::ControlHandle {
2812        ControllerProviderControlHandle { inner: self.inner.clone() }
2813    }
2814
2815    fn into_inner(
2816        self,
2817    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2818    {
2819        (self.inner, self.is_terminated)
2820    }
2821
2822    fn from_inner(
2823        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2824        is_terminated: bool,
2825    ) -> Self {
2826        Self { inner, is_terminated }
2827    }
2828}
2829
2830impl futures::Stream for ControllerProviderRequestStream {
2831    type Item = Result<ControllerProviderRequest, fidl::Error>;
2832
2833    fn poll_next(
2834        mut self: std::pin::Pin<&mut Self>,
2835        cx: &mut std::task::Context<'_>,
2836    ) -> std::task::Poll<Option<Self::Item>> {
2837        let this = &mut *self;
2838        if this.inner.check_shutdown(cx) {
2839            this.is_terminated = true;
2840            return std::task::Poll::Ready(None);
2841        }
2842        if this.is_terminated {
2843            panic!("polled ControllerProviderRequestStream after completion");
2844        }
2845        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2846            |bytes, handles| {
2847                match this.inner.channel().read_etc(cx, bytes, handles) {
2848                    std::task::Poll::Ready(Ok(())) => {}
2849                    std::task::Poll::Pending => return std::task::Poll::Pending,
2850                    std::task::Poll::Ready(Err(None)) => {
2851                        this.is_terminated = true;
2852                        return std::task::Poll::Ready(None);
2853                    }
2854                    std::task::Poll::Ready(Err(Some(e))) => {
2855                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2856                            e.into(),
2857                        ))));
2858                    }
2859                }
2860
2861                // A message has been received from the channel
2862                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2863
2864                std::task::Poll::Ready(Some(match header.ordinal {
2865                0xc0325f0732defcb => {
2866                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2867                    let mut req = fidl::new_empty!(ControllerProviderConnectRequest, fdomain_client::fidl::FDomainResourceDialect);
2868                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ControllerProviderConnectRequest>(&header, _body_bytes, handles, &mut req)?;
2869                    let control_handle = ControllerProviderControlHandle {
2870                        inner: this.inner.clone(),
2871                    };
2872                    Ok(ControllerProviderRequest::Connect {controller: req.controller,
2873
2874                        responder: ControllerProviderConnectResponder {
2875                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2876                            tx_id: header.tx_id,
2877                        },
2878                    })
2879                }
2880                0x6cd6a98fc38bcbf2 => {
2881                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2882                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
2883                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2884                    let control_handle = ControllerProviderControlHandle {
2885                        inner: this.inner.clone(),
2886                    };
2887                    Ok(ControllerProviderRequest::Stop {
2888                        control_handle,
2889                    })
2890                }
2891                _ => Err(fidl::Error::UnknownOrdinal {
2892                    ordinal: header.ordinal,
2893                    protocol_name: <ControllerProviderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2894                }),
2895            }))
2896            },
2897        )
2898    }
2899}
2900
2901/// Provides a `Controller` implementation.
2902///
2903/// This protocol is implemented by the fuzzing engine. This capability is *not*
2904/// routed. Instead, the engine uses the `fuchsia.fuzzer/Registry` channel
2905/// provided by the fuzz-test-runner to send the client end of this interface to
2906/// the fuzz-registry.
2907///
2908/// The fuzz-registry will close the channel upon error, or upon its own exit.
2909/// The fuzzer should exit and not attempt to reconnect when on channel close.
2910#[derive(Debug)]
2911pub enum ControllerProviderRequest {
2912    /// Connects a client to the fuzzer.
2913    ///
2914    /// Within the component fuzzing framework, the fuzz-manager forwards
2915    /// `Controller` connection requests to the fuzz-registry, which uses
2916    /// clients of this interface provided by the fuzzers themselves to perform
2917    /// the connection.
2918    ///
2919    /// At most one client can be connected to a controller at any given time.
2920    /// A subsequent call to `Connect` will preempt and replace the existing
2921    /// connection.
2922    ///
2923    /// + request `controller` the connection from the client.
2924    Connect {
2925        controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
2926        responder: ControllerProviderConnectResponder,
2927    },
2928    /// Interrupt any current workflow, closes the channel, and exits the
2929    /// fuzzing engine.
2930    Stop { control_handle: ControllerProviderControlHandle },
2931}
2932
2933impl ControllerProviderRequest {
2934    #[allow(irrefutable_let_patterns)]
2935    pub fn into_connect(
2936        self,
2937    ) -> Option<(
2938        fdomain_client::fidl::ServerEnd<ControllerMarker>,
2939        ControllerProviderConnectResponder,
2940    )> {
2941        if let ControllerProviderRequest::Connect { controller, responder } = self {
2942            Some((controller, responder))
2943        } else {
2944            None
2945        }
2946    }
2947
2948    #[allow(irrefutable_let_patterns)]
2949    pub fn into_stop(self) -> Option<(ControllerProviderControlHandle)> {
2950        if let ControllerProviderRequest::Stop { control_handle } = self {
2951            Some((control_handle))
2952        } else {
2953            None
2954        }
2955    }
2956
2957    /// Name of the method defined in FIDL
2958    pub fn method_name(&self) -> &'static str {
2959        match *self {
2960            ControllerProviderRequest::Connect { .. } => "connect",
2961            ControllerProviderRequest::Stop { .. } => "stop",
2962        }
2963    }
2964}
2965
2966#[derive(Debug, Clone)]
2967pub struct ControllerProviderControlHandle {
2968    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2969}
2970
2971impl fdomain_client::fidl::ControlHandle for ControllerProviderControlHandle {
2972    fn shutdown(&self) {
2973        self.inner.shutdown()
2974    }
2975
2976    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2977        self.inner.shutdown_with_epitaph(status)
2978    }
2979
2980    fn is_closed(&self) -> bool {
2981        self.inner.channel().is_closed()
2982    }
2983    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
2984        self.inner.channel().on_closed()
2985    }
2986}
2987
2988impl ControllerProviderControlHandle {}
2989
2990#[must_use = "FIDL methods require a response to be sent"]
2991#[derive(Debug)]
2992pub struct ControllerProviderConnectResponder {
2993    control_handle: std::mem::ManuallyDrop<ControllerProviderControlHandle>,
2994    tx_id: u32,
2995}
2996
2997/// Set the the channel to be shutdown (see [`ControllerProviderControlHandle::shutdown`])
2998/// if the responder is dropped without sending a response, so that the client
2999/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3000impl std::ops::Drop for ControllerProviderConnectResponder {
3001    fn drop(&mut self) {
3002        self.control_handle.shutdown();
3003        // Safety: drops once, never accessed again
3004        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3005    }
3006}
3007
3008impl fdomain_client::fidl::Responder for ControllerProviderConnectResponder {
3009    type ControlHandle = ControllerProviderControlHandle;
3010
3011    fn control_handle(&self) -> &ControllerProviderControlHandle {
3012        &self.control_handle
3013    }
3014
3015    fn drop_without_shutdown(mut self) {
3016        // Safety: drops once, never accessed again due to mem::forget
3017        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3018        // Prevent Drop from running (which would shut down the channel)
3019        std::mem::forget(self);
3020    }
3021}
3022
3023impl ControllerProviderConnectResponder {
3024    /// Sends a response to the FIDL transaction.
3025    ///
3026    /// Sets the channel to shutdown if an error occurs.
3027    pub fn send(self) -> Result<(), fidl::Error> {
3028        let _result = self.send_raw();
3029        if _result.is_err() {
3030            self.control_handle.shutdown();
3031        }
3032        self.drop_without_shutdown();
3033        _result
3034    }
3035
3036    /// Similar to "send" but does not shutdown the channel if an error occurs.
3037    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3038        let _result = self.send_raw();
3039        self.drop_without_shutdown();
3040        _result
3041    }
3042
3043    fn send_raw(&self) -> Result<(), fidl::Error> {
3044        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3045            (),
3046            self.tx_id,
3047            0xc0325f0732defcb,
3048            fidl::encoding::DynamicFlags::empty(),
3049        )
3050    }
3051}
3052
3053#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3054pub struct CorpusReaderMarker;
3055
3056impl fdomain_client::fidl::ProtocolMarker for CorpusReaderMarker {
3057    type Proxy = CorpusReaderProxy;
3058    type RequestStream = CorpusReaderRequestStream;
3059
3060    const DEBUG_NAME: &'static str = "(anonymous) CorpusReader";
3061}
3062
3063pub trait CorpusReaderProxyInterface: Send + Sync {
3064    type NextResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
3065    fn r#next(&self, test_input: Input) -> Self::NextResponseFut;
3066}
3067
3068#[derive(Debug, Clone)]
3069pub struct CorpusReaderProxy {
3070    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
3071}
3072
3073impl fdomain_client::fidl::Proxy for CorpusReaderProxy {
3074    type Protocol = CorpusReaderMarker;
3075
3076    fn from_channel(inner: fdomain_client::Channel) -> Self {
3077        Self::new(inner)
3078    }
3079
3080    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
3081        self.client.into_channel().map_err(|client| Self { client })
3082    }
3083
3084    fn as_channel(&self) -> &fdomain_client::Channel {
3085        self.client.as_channel()
3086    }
3087}
3088
3089impl CorpusReaderProxy {
3090    /// Create a new Proxy for fuchsia.fuzzer/CorpusReader.
3091    pub fn new(channel: fdomain_client::Channel) -> Self {
3092        let protocol_name =
3093            <CorpusReaderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
3094        Self { client: fidl::client::Client::new(channel, protocol_name) }
3095    }
3096
3097    /// Get a Stream of events from the remote end of the protocol.
3098    ///
3099    /// # Panics
3100    ///
3101    /// Panics if the event stream was already taken.
3102    pub fn take_event_stream(&self) -> CorpusReaderEventStream {
3103        CorpusReaderEventStream { event_receiver: self.client.take_event_receiver() }
3104    }
3105
3106    /// Sends the next test input from the corpus.
3107    ///
3108    /// + request `test_input` the byte sequence representing the next test
3109    ///   input in a corpus.
3110    /// - response `result` one of the following:
3111    ///     - `ZX_OK` if the test input was sent.
3112    ///     - A socket error if transferring the input failed.
3113    pub fn r#next(
3114        &self,
3115        mut test_input: Input,
3116    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
3117        CorpusReaderProxyInterface::r#next(self, test_input)
3118    }
3119}
3120
3121impl CorpusReaderProxyInterface for CorpusReaderProxy {
3122    type NextResponseFut =
3123        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
3124    fn r#next(&self, mut test_input: Input) -> Self::NextResponseFut {
3125        fn _decode(
3126            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3127        ) -> Result<i32, fidl::Error> {
3128            let _response = fidl::client::decode_transaction_body::<
3129                CorpusReaderNextResponse,
3130                fdomain_client::fidl::FDomainResourceDialect,
3131                0x68d19e55ea635356,
3132            >(_buf?)?;
3133            Ok(_response.result)
3134        }
3135        self.client.send_query_and_decode::<CorpusReaderNextRequest, i32>(
3136            (&mut test_input,),
3137            0x68d19e55ea635356,
3138            fidl::encoding::DynamicFlags::empty(),
3139            _decode,
3140        )
3141    }
3142}
3143
3144pub struct CorpusReaderEventStream {
3145    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
3146}
3147
3148impl std::marker::Unpin for CorpusReaderEventStream {}
3149
3150impl futures::stream::FusedStream for CorpusReaderEventStream {
3151    fn is_terminated(&self) -> bool {
3152        self.event_receiver.is_terminated()
3153    }
3154}
3155
3156impl futures::Stream for CorpusReaderEventStream {
3157    type Item = Result<CorpusReaderEvent, fidl::Error>;
3158
3159    fn poll_next(
3160        mut self: std::pin::Pin<&mut Self>,
3161        cx: &mut std::task::Context<'_>,
3162    ) -> std::task::Poll<Option<Self::Item>> {
3163        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3164            &mut self.event_receiver,
3165            cx
3166        )?) {
3167            Some(buf) => std::task::Poll::Ready(Some(CorpusReaderEvent::decode(buf))),
3168            None => std::task::Poll::Ready(None),
3169        }
3170    }
3171}
3172
3173#[derive(Debug)]
3174pub enum CorpusReaderEvent {}
3175
3176impl CorpusReaderEvent {
3177    /// Decodes a message buffer as a [`CorpusReaderEvent`].
3178    fn decode(
3179        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3180    ) -> Result<CorpusReaderEvent, fidl::Error> {
3181        let (bytes, _handles) = buf.split_mut();
3182        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3183        debug_assert_eq!(tx_header.tx_id, 0);
3184        match tx_header.ordinal {
3185            _ => Err(fidl::Error::UnknownOrdinal {
3186                ordinal: tx_header.ordinal,
3187                protocol_name:
3188                    <CorpusReaderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3189            }),
3190        }
3191    }
3192}
3193
3194/// A Stream of incoming requests for fuchsia.fuzzer/CorpusReader.
3195pub struct CorpusReaderRequestStream {
3196    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3197    is_terminated: bool,
3198}
3199
3200impl std::marker::Unpin for CorpusReaderRequestStream {}
3201
3202impl futures::stream::FusedStream for CorpusReaderRequestStream {
3203    fn is_terminated(&self) -> bool {
3204        self.is_terminated
3205    }
3206}
3207
3208impl fdomain_client::fidl::RequestStream for CorpusReaderRequestStream {
3209    type Protocol = CorpusReaderMarker;
3210    type ControlHandle = CorpusReaderControlHandle;
3211
3212    fn from_channel(channel: fdomain_client::Channel) -> Self {
3213        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3214    }
3215
3216    fn control_handle(&self) -> Self::ControlHandle {
3217        CorpusReaderControlHandle { inner: self.inner.clone() }
3218    }
3219
3220    fn into_inner(
3221        self,
3222    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
3223    {
3224        (self.inner, self.is_terminated)
3225    }
3226
3227    fn from_inner(
3228        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3229        is_terminated: bool,
3230    ) -> Self {
3231        Self { inner, is_terminated }
3232    }
3233}
3234
3235impl futures::Stream for CorpusReaderRequestStream {
3236    type Item = Result<CorpusReaderRequest, fidl::Error>;
3237
3238    fn poll_next(
3239        mut self: std::pin::Pin<&mut Self>,
3240        cx: &mut std::task::Context<'_>,
3241    ) -> std::task::Poll<Option<Self::Item>> {
3242        let this = &mut *self;
3243        if this.inner.check_shutdown(cx) {
3244            this.is_terminated = true;
3245            return std::task::Poll::Ready(None);
3246        }
3247        if this.is_terminated {
3248            panic!("polled CorpusReaderRequestStream after completion");
3249        }
3250        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
3251            |bytes, handles| {
3252                match this.inner.channel().read_etc(cx, bytes, handles) {
3253                    std::task::Poll::Ready(Ok(())) => {}
3254                    std::task::Poll::Pending => return std::task::Poll::Pending,
3255                    std::task::Poll::Ready(Err(None)) => {
3256                        this.is_terminated = true;
3257                        return std::task::Poll::Ready(None);
3258                    }
3259                    std::task::Poll::Ready(Err(Some(e))) => {
3260                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3261                            e.into(),
3262                        ))));
3263                    }
3264                }
3265
3266                // A message has been received from the channel
3267                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3268
3269                std::task::Poll::Ready(Some(match header.ordinal {
3270                    0x68d19e55ea635356 => {
3271                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3272                        let mut req = fidl::new_empty!(
3273                            CorpusReaderNextRequest,
3274                            fdomain_client::fidl::FDomainResourceDialect
3275                        );
3276                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CorpusReaderNextRequest>(&header, _body_bytes, handles, &mut req)?;
3277                        let control_handle =
3278                            CorpusReaderControlHandle { inner: this.inner.clone() };
3279                        Ok(CorpusReaderRequest::Next {
3280                            test_input: req.test_input,
3281
3282                            responder: CorpusReaderNextResponder {
3283                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3284                                tx_id: header.tx_id,
3285                            },
3286                        })
3287                    }
3288                    _ => Err(fidl::Error::UnknownOrdinal {
3289                        ordinal: header.ordinal,
3290                        protocol_name:
3291                            <CorpusReaderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3292                    }),
3293                }))
3294            },
3295        )
3296    }
3297}
3298
3299/// Sends a sequence of test inputs belonging to a fuzzer's corpus.
3300#[derive(Debug)]
3301pub enum CorpusReaderRequest {
3302    /// Sends the next test input from the corpus.
3303    ///
3304    /// + request `test_input` the byte sequence representing the next test
3305    ///   input in a corpus.
3306    /// - response `result` one of the following:
3307    ///     - `ZX_OK` if the test input was sent.
3308    ///     - A socket error if transferring the input failed.
3309    Next { test_input: Input, responder: CorpusReaderNextResponder },
3310}
3311
3312impl CorpusReaderRequest {
3313    #[allow(irrefutable_let_patterns)]
3314    pub fn into_next(self) -> Option<(Input, CorpusReaderNextResponder)> {
3315        if let CorpusReaderRequest::Next { test_input, responder } = self {
3316            Some((test_input, responder))
3317        } else {
3318            None
3319        }
3320    }
3321
3322    /// Name of the method defined in FIDL
3323    pub fn method_name(&self) -> &'static str {
3324        match *self {
3325            CorpusReaderRequest::Next { .. } => "next",
3326        }
3327    }
3328}
3329
3330#[derive(Debug, Clone)]
3331pub struct CorpusReaderControlHandle {
3332    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3333}
3334
3335impl fdomain_client::fidl::ControlHandle for CorpusReaderControlHandle {
3336    fn shutdown(&self) {
3337        self.inner.shutdown()
3338    }
3339
3340    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3341        self.inner.shutdown_with_epitaph(status)
3342    }
3343
3344    fn is_closed(&self) -> bool {
3345        self.inner.channel().is_closed()
3346    }
3347    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3348        self.inner.channel().on_closed()
3349    }
3350}
3351
3352impl CorpusReaderControlHandle {}
3353
3354#[must_use = "FIDL methods require a response to be sent"]
3355#[derive(Debug)]
3356pub struct CorpusReaderNextResponder {
3357    control_handle: std::mem::ManuallyDrop<CorpusReaderControlHandle>,
3358    tx_id: u32,
3359}
3360
3361/// Set the the channel to be shutdown (see [`CorpusReaderControlHandle::shutdown`])
3362/// if the responder is dropped without sending a response, so that the client
3363/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3364impl std::ops::Drop for CorpusReaderNextResponder {
3365    fn drop(&mut self) {
3366        self.control_handle.shutdown();
3367        // Safety: drops once, never accessed again
3368        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3369    }
3370}
3371
3372impl fdomain_client::fidl::Responder for CorpusReaderNextResponder {
3373    type ControlHandle = CorpusReaderControlHandle;
3374
3375    fn control_handle(&self) -> &CorpusReaderControlHandle {
3376        &self.control_handle
3377    }
3378
3379    fn drop_without_shutdown(mut self) {
3380        // Safety: drops once, never accessed again due to mem::forget
3381        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3382        // Prevent Drop from running (which would shut down the channel)
3383        std::mem::forget(self);
3384    }
3385}
3386
3387impl CorpusReaderNextResponder {
3388    /// Sends a response to the FIDL transaction.
3389    ///
3390    /// Sets the channel to shutdown if an error occurs.
3391    pub fn send(self, mut result: i32) -> Result<(), fidl::Error> {
3392        let _result = self.send_raw(result);
3393        if _result.is_err() {
3394            self.control_handle.shutdown();
3395        }
3396        self.drop_without_shutdown();
3397        _result
3398    }
3399
3400    /// Similar to "send" but does not shutdown the channel if an error occurs.
3401    pub fn send_no_shutdown_on_err(self, mut result: i32) -> Result<(), fidl::Error> {
3402        let _result = self.send_raw(result);
3403        self.drop_without_shutdown();
3404        _result
3405    }
3406
3407    fn send_raw(&self, mut result: i32) -> Result<(), fidl::Error> {
3408        self.control_handle.inner.send::<CorpusReaderNextResponse>(
3409            (result,),
3410            self.tx_id,
3411            0x68d19e55ea635356,
3412            fidl::encoding::DynamicFlags::empty(),
3413        )
3414    }
3415}
3416
3417#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3418pub struct CoverageDataCollectorMarker;
3419
3420impl fdomain_client::fidl::ProtocolMarker for CoverageDataCollectorMarker {
3421    type Proxy = CoverageDataCollectorProxy;
3422    type RequestStream = CoverageDataCollectorRequestStream;
3423
3424    const DEBUG_NAME: &'static str = "fuchsia.fuzzer.CoverageDataCollector";
3425}
3426impl fdomain_client::fidl::DiscoverableProtocolMarker for CoverageDataCollectorMarker {}
3427
3428pub trait CoverageDataCollectorProxyInterface: Send + Sync {
3429    type InitializeResponseFut: std::future::Future<Output = Result<Options, fidl::Error>> + Send;
3430    fn r#initialize(
3431        &self,
3432        eventpair: fdomain_client::EventPair,
3433        process: fdomain_client::Process,
3434    ) -> Self::InitializeResponseFut;
3435    type AddInline8bitCountersResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
3436        + Send;
3437    fn r#add_inline8bit_counters(
3438        &self,
3439        inline_8bit_counters: fdomain_client::Vmo,
3440    ) -> Self::AddInline8bitCountersResponseFut;
3441}
3442
3443#[derive(Debug, Clone)]
3444pub struct CoverageDataCollectorProxy {
3445    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
3446}
3447
3448impl fdomain_client::fidl::Proxy for CoverageDataCollectorProxy {
3449    type Protocol = CoverageDataCollectorMarker;
3450
3451    fn from_channel(inner: fdomain_client::Channel) -> Self {
3452        Self::new(inner)
3453    }
3454
3455    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
3456        self.client.into_channel().map_err(|client| Self { client })
3457    }
3458
3459    fn as_channel(&self) -> &fdomain_client::Channel {
3460        self.client.as_channel()
3461    }
3462}
3463
3464impl CoverageDataCollectorProxy {
3465    /// Create a new Proxy for fuchsia.fuzzer/CoverageDataCollector.
3466    pub fn new(channel: fdomain_client::Channel) -> Self {
3467        let protocol_name =
3468            <CoverageDataCollectorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
3469        Self { client: fidl::client::Client::new(channel, protocol_name) }
3470    }
3471
3472    /// Get a Stream of events from the remote end of the protocol.
3473    ///
3474    /// # Panics
3475    ///
3476    /// Panics if the event stream was already taken.
3477    pub fn take_event_stream(&self) -> CoverageDataCollectorEventStream {
3478        CoverageDataCollectorEventStream { event_receiver: self.client.take_event_receiver() }
3479    }
3480
3481    /// Registers the instrumented target process.
3482    ///
3483    /// This method is called once per connection to set up:
3484    ///    * The eventpair used to synchronize the start and end of code coverage collection.
3485    ///    * The process Handle used to monitor the target process for errors.
3486    ///
3487    /// This method must be called before the target process can call `AddLlvmModule`.
3488    ///
3489    /// It returns the currently set options; see `fuchsia.fuzzer.Controller/Configure`.
3490    ///
3491    /// Certain options determine sanitizer behaviors before `main` is called, and cannot
3492    /// subsequently be changed while the target process is running. This is the root cause of the
3493    /// constraint in `Controller` against modifying options during "long-running workflows", i.e
3494    /// those that spawn target processes.
3495    ///
3496    /// The channel is closed on FIDL error. Clients should not attempt to reconnect.
3497    pub fn r#initialize(
3498        &self,
3499        mut eventpair: fdomain_client::EventPair,
3500        mut process: fdomain_client::Process,
3501    ) -> fidl::client::QueryResponseFut<Options, fdomain_client::fidl::FDomainResourceDialect> {
3502        CoverageDataCollectorProxyInterface::r#initialize(self, eventpair, process)
3503    }
3504
3505    /// Adds a VMO with the code coverage of an LLVM module.
3506    ///
3507    /// The VMO used to share inline 8-bit code-coverage edge counters for a single LLVM module in
3508    /// an instrumented target process.
3509    ///
3510    /// Its ZX_PROP_NAME property must be set, and client and server implementations must agree on
3511    /// how to use it to uniquely identify the module. If the same module is added more than once by
3512    /// different processes, the module identifiers must match so that the code counters can be
3513    /// combined.
3514    ///
3515    /// Its ZX_PROP_VMO_CONTENT_SIZE property must be set to the actual number of counters present.
3516    ///
3517    /// It is an error to call this method without first calling |Initialize|.
3518    ///
3519    /// The channel is closed on FIDL error. Clients should not attempt to reconnect.
3520    ///
3521    /// See also:
3522    ///     https://clang.llvm.org/docs/SanitizerCoverage.html#inline-8bit-counters
3523    pub fn r#add_inline8bit_counters(
3524        &self,
3525        mut inline_8bit_counters: fdomain_client::Vmo,
3526    ) -> fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect> {
3527        CoverageDataCollectorProxyInterface::r#add_inline8bit_counters(self, inline_8bit_counters)
3528    }
3529}
3530
3531impl CoverageDataCollectorProxyInterface for CoverageDataCollectorProxy {
3532    type InitializeResponseFut =
3533        fidl::client::QueryResponseFut<Options, fdomain_client::fidl::FDomainResourceDialect>;
3534    fn r#initialize(
3535        &self,
3536        mut eventpair: fdomain_client::EventPair,
3537        mut process: fdomain_client::Process,
3538    ) -> Self::InitializeResponseFut {
3539        fn _decode(
3540            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3541        ) -> Result<Options, fidl::Error> {
3542            let _response = fidl::client::decode_transaction_body::<
3543                CoverageDataCollectorInitializeResponse,
3544                fdomain_client::fidl::FDomainResourceDialect,
3545                0x51d6f91d6f02d9d6,
3546            >(_buf?)?;
3547            Ok(_response.options)
3548        }
3549        self.client.send_query_and_decode::<CoverageDataCollectorInitializeRequest, Options>(
3550            (eventpair, process),
3551            0x51d6f91d6f02d9d6,
3552            fidl::encoding::DynamicFlags::empty(),
3553            _decode,
3554        )
3555    }
3556
3557    type AddInline8bitCountersResponseFut =
3558        fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect>;
3559    fn r#add_inline8bit_counters(
3560        &self,
3561        mut inline_8bit_counters: fdomain_client::Vmo,
3562    ) -> Self::AddInline8bitCountersResponseFut {
3563        fn _decode(
3564            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3565        ) -> Result<(), fidl::Error> {
3566            let _response = fidl::client::decode_transaction_body::<
3567                fidl::encoding::EmptyPayload,
3568                fdomain_client::fidl::FDomainResourceDialect,
3569                0x75f87cadfc94d1be,
3570            >(_buf?)?;
3571            Ok(_response)
3572        }
3573        self.client.send_query_and_decode::<CoverageDataCollectorAddInline8bitCountersRequest, ()>(
3574            (inline_8bit_counters,),
3575            0x75f87cadfc94d1be,
3576            fidl::encoding::DynamicFlags::empty(),
3577            _decode,
3578        )
3579    }
3580}
3581
3582pub struct CoverageDataCollectorEventStream {
3583    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
3584}
3585
3586impl std::marker::Unpin for CoverageDataCollectorEventStream {}
3587
3588impl futures::stream::FusedStream for CoverageDataCollectorEventStream {
3589    fn is_terminated(&self) -> bool {
3590        self.event_receiver.is_terminated()
3591    }
3592}
3593
3594impl futures::Stream for CoverageDataCollectorEventStream {
3595    type Item = Result<CoverageDataCollectorEvent, fidl::Error>;
3596
3597    fn poll_next(
3598        mut self: std::pin::Pin<&mut Self>,
3599        cx: &mut std::task::Context<'_>,
3600    ) -> std::task::Poll<Option<Self::Item>> {
3601        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3602            &mut self.event_receiver,
3603            cx
3604        )?) {
3605            Some(buf) => std::task::Poll::Ready(Some(CoverageDataCollectorEvent::decode(buf))),
3606            None => std::task::Poll::Ready(None),
3607        }
3608    }
3609}
3610
3611#[derive(Debug)]
3612pub enum CoverageDataCollectorEvent {}
3613
3614impl CoverageDataCollectorEvent {
3615    /// Decodes a message buffer as a [`CoverageDataCollectorEvent`].
3616    fn decode(
3617        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3618    ) -> Result<CoverageDataCollectorEvent, fidl::Error> {
3619        let (bytes, _handles) = buf.split_mut();
3620        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3621        debug_assert_eq!(tx_header.tx_id, 0);
3622        match tx_header.ordinal {
3623            _ => Err(fidl::Error::UnknownOrdinal {
3624                ordinal: tx_header.ordinal,
3625                protocol_name: <CoverageDataCollectorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3626            })
3627        }
3628    }
3629}
3630
3631/// A Stream of incoming requests for fuchsia.fuzzer/CoverageDataCollector.
3632pub struct CoverageDataCollectorRequestStream {
3633    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3634    is_terminated: bool,
3635}
3636
3637impl std::marker::Unpin for CoverageDataCollectorRequestStream {}
3638
3639impl futures::stream::FusedStream for CoverageDataCollectorRequestStream {
3640    fn is_terminated(&self) -> bool {
3641        self.is_terminated
3642    }
3643}
3644
3645impl fdomain_client::fidl::RequestStream for CoverageDataCollectorRequestStream {
3646    type Protocol = CoverageDataCollectorMarker;
3647    type ControlHandle = CoverageDataCollectorControlHandle;
3648
3649    fn from_channel(channel: fdomain_client::Channel) -> Self {
3650        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3651    }
3652
3653    fn control_handle(&self) -> Self::ControlHandle {
3654        CoverageDataCollectorControlHandle { inner: self.inner.clone() }
3655    }
3656
3657    fn into_inner(
3658        self,
3659    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
3660    {
3661        (self.inner, self.is_terminated)
3662    }
3663
3664    fn from_inner(
3665        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3666        is_terminated: bool,
3667    ) -> Self {
3668        Self { inner, is_terminated }
3669    }
3670}
3671
3672impl futures::Stream for CoverageDataCollectorRequestStream {
3673    type Item = Result<CoverageDataCollectorRequest, fidl::Error>;
3674
3675    fn poll_next(
3676        mut self: std::pin::Pin<&mut Self>,
3677        cx: &mut std::task::Context<'_>,
3678    ) -> std::task::Poll<Option<Self::Item>> {
3679        let this = &mut *self;
3680        if this.inner.check_shutdown(cx) {
3681            this.is_terminated = true;
3682            return std::task::Poll::Ready(None);
3683        }
3684        if this.is_terminated {
3685            panic!("polled CoverageDataCollectorRequestStream after completion");
3686        }
3687        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
3688            |bytes, handles| {
3689                match this.inner.channel().read_etc(cx, bytes, handles) {
3690                    std::task::Poll::Ready(Ok(())) => {}
3691                    std::task::Poll::Pending => return std::task::Poll::Pending,
3692                    std::task::Poll::Ready(Err(None)) => {
3693                        this.is_terminated = true;
3694                        return std::task::Poll::Ready(None);
3695                    }
3696                    std::task::Poll::Ready(Err(Some(e))) => {
3697                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3698                            e.into(),
3699                        ))));
3700                    }
3701                }
3702
3703                // A message has been received from the channel
3704                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3705
3706                std::task::Poll::Ready(Some(match header.ordinal {
3707                0x51d6f91d6f02d9d6 => {
3708                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3709                    let mut req = fidl::new_empty!(CoverageDataCollectorInitializeRequest, fdomain_client::fidl::FDomainResourceDialect);
3710                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CoverageDataCollectorInitializeRequest>(&header, _body_bytes, handles, &mut req)?;
3711                    let control_handle = CoverageDataCollectorControlHandle {
3712                        inner: this.inner.clone(),
3713                    };
3714                    Ok(CoverageDataCollectorRequest::Initialize {eventpair: req.eventpair,
3715process: req.process,
3716
3717                        responder: CoverageDataCollectorInitializeResponder {
3718                            control_handle: std::mem::ManuallyDrop::new(control_handle),
3719                            tx_id: header.tx_id,
3720                        },
3721                    })
3722                }
3723                0x75f87cadfc94d1be => {
3724                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3725                    let mut req = fidl::new_empty!(CoverageDataCollectorAddInline8bitCountersRequest, fdomain_client::fidl::FDomainResourceDialect);
3726                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CoverageDataCollectorAddInline8bitCountersRequest>(&header, _body_bytes, handles, &mut req)?;
3727                    let control_handle = CoverageDataCollectorControlHandle {
3728                        inner: this.inner.clone(),
3729                    };
3730                    Ok(CoverageDataCollectorRequest::AddInline8bitCounters {inline_8bit_counters: req.inline_8bit_counters,
3731
3732                        responder: CoverageDataCollectorAddInline8bitCountersResponder {
3733                            control_handle: std::mem::ManuallyDrop::new(control_handle),
3734                            tx_id: header.tx_id,
3735                        },
3736                    })
3737                }
3738                _ => Err(fidl::Error::UnknownOrdinal {
3739                    ordinal: header.ordinal,
3740                    protocol_name: <CoverageDataCollectorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3741                }),
3742            }))
3743            },
3744        )
3745    }
3746}
3747
3748/// Collects VMOs used to share code coverage from instrumented target processes.
3749///
3750/// The instrumented target processes act as clients to this protocol, which is implemented by
3751/// test_manager's fuzz_coverage component. The protocol coordinates feedback collection and other
3752/// diagnostics with target processes under test. The connection should be established very early in
3753/// a target process's lifecycle, i.e. before `main` begins.
3754#[derive(Debug)]
3755pub enum CoverageDataCollectorRequest {
3756    /// Registers the instrumented target process.
3757    ///
3758    /// This method is called once per connection to set up:
3759    ///    * The eventpair used to synchronize the start and end of code coverage collection.
3760    ///    * The process Handle used to monitor the target process for errors.
3761    ///
3762    /// This method must be called before the target process can call `AddLlvmModule`.
3763    ///
3764    /// It returns the currently set options; see `fuchsia.fuzzer.Controller/Configure`.
3765    ///
3766    /// Certain options determine sanitizer behaviors before `main` is called, and cannot
3767    /// subsequently be changed while the target process is running. This is the root cause of the
3768    /// constraint in `Controller` against modifying options during "long-running workflows", i.e
3769    /// those that spawn target processes.
3770    ///
3771    /// The channel is closed on FIDL error. Clients should not attempt to reconnect.
3772    Initialize {
3773        eventpair: fdomain_client::EventPair,
3774        process: fdomain_client::Process,
3775        responder: CoverageDataCollectorInitializeResponder,
3776    },
3777    /// Adds a VMO with the code coverage of an LLVM module.
3778    ///
3779    /// The VMO used to share inline 8-bit code-coverage edge counters for a single LLVM module in
3780    /// an instrumented target process.
3781    ///
3782    /// Its ZX_PROP_NAME property must be set, and client and server implementations must agree on
3783    /// how to use it to uniquely identify the module. If the same module is added more than once by
3784    /// different processes, the module identifiers must match so that the code counters can be
3785    /// combined.
3786    ///
3787    /// Its ZX_PROP_VMO_CONTENT_SIZE property must be set to the actual number of counters present.
3788    ///
3789    /// It is an error to call this method without first calling |Initialize|.
3790    ///
3791    /// The channel is closed on FIDL error. Clients should not attempt to reconnect.
3792    ///
3793    /// See also:
3794    ///     https://clang.llvm.org/docs/SanitizerCoverage.html#inline-8bit-counters
3795    AddInline8bitCounters {
3796        inline_8bit_counters: fdomain_client::Vmo,
3797        responder: CoverageDataCollectorAddInline8bitCountersResponder,
3798    },
3799}
3800
3801impl CoverageDataCollectorRequest {
3802    #[allow(irrefutable_let_patterns)]
3803    pub fn into_initialize(
3804        self,
3805    ) -> Option<(
3806        fdomain_client::EventPair,
3807        fdomain_client::Process,
3808        CoverageDataCollectorInitializeResponder,
3809    )> {
3810        if let CoverageDataCollectorRequest::Initialize { eventpair, process, responder } = self {
3811            Some((eventpair, process, responder))
3812        } else {
3813            None
3814        }
3815    }
3816
3817    #[allow(irrefutable_let_patterns)]
3818    pub fn into_add_inline8bit_counters(
3819        self,
3820    ) -> Option<(fdomain_client::Vmo, CoverageDataCollectorAddInline8bitCountersResponder)> {
3821        if let CoverageDataCollectorRequest::AddInline8bitCounters {
3822            inline_8bit_counters,
3823            responder,
3824        } = self
3825        {
3826            Some((inline_8bit_counters, responder))
3827        } else {
3828            None
3829        }
3830    }
3831
3832    /// Name of the method defined in FIDL
3833    pub fn method_name(&self) -> &'static str {
3834        match *self {
3835            CoverageDataCollectorRequest::Initialize { .. } => "initialize",
3836            CoverageDataCollectorRequest::AddInline8bitCounters { .. } => "add_inline8bit_counters",
3837        }
3838    }
3839}
3840
3841#[derive(Debug, Clone)]
3842pub struct CoverageDataCollectorControlHandle {
3843    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3844}
3845
3846impl fdomain_client::fidl::ControlHandle for CoverageDataCollectorControlHandle {
3847    fn shutdown(&self) {
3848        self.inner.shutdown()
3849    }
3850
3851    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3852        self.inner.shutdown_with_epitaph(status)
3853    }
3854
3855    fn is_closed(&self) -> bool {
3856        self.inner.channel().is_closed()
3857    }
3858    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3859        self.inner.channel().on_closed()
3860    }
3861}
3862
3863impl CoverageDataCollectorControlHandle {}
3864
3865#[must_use = "FIDL methods require a response to be sent"]
3866#[derive(Debug)]
3867pub struct CoverageDataCollectorInitializeResponder {
3868    control_handle: std::mem::ManuallyDrop<CoverageDataCollectorControlHandle>,
3869    tx_id: u32,
3870}
3871
3872/// Set the the channel to be shutdown (see [`CoverageDataCollectorControlHandle::shutdown`])
3873/// if the responder is dropped without sending a response, so that the client
3874/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3875impl std::ops::Drop for CoverageDataCollectorInitializeResponder {
3876    fn drop(&mut self) {
3877        self.control_handle.shutdown();
3878        // Safety: drops once, never accessed again
3879        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3880    }
3881}
3882
3883impl fdomain_client::fidl::Responder for CoverageDataCollectorInitializeResponder {
3884    type ControlHandle = CoverageDataCollectorControlHandle;
3885
3886    fn control_handle(&self) -> &CoverageDataCollectorControlHandle {
3887        &self.control_handle
3888    }
3889
3890    fn drop_without_shutdown(mut self) {
3891        // Safety: drops once, never accessed again due to mem::forget
3892        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3893        // Prevent Drop from running (which would shut down the channel)
3894        std::mem::forget(self);
3895    }
3896}
3897
3898impl CoverageDataCollectorInitializeResponder {
3899    /// Sends a response to the FIDL transaction.
3900    ///
3901    /// Sets the channel to shutdown if an error occurs.
3902    pub fn send(self, mut options: &Options) -> Result<(), fidl::Error> {
3903        let _result = self.send_raw(options);
3904        if _result.is_err() {
3905            self.control_handle.shutdown();
3906        }
3907        self.drop_without_shutdown();
3908        _result
3909    }
3910
3911    /// Similar to "send" but does not shutdown the channel if an error occurs.
3912    pub fn send_no_shutdown_on_err(self, mut options: &Options) -> Result<(), fidl::Error> {
3913        let _result = self.send_raw(options);
3914        self.drop_without_shutdown();
3915        _result
3916    }
3917
3918    fn send_raw(&self, mut options: &Options) -> Result<(), fidl::Error> {
3919        self.control_handle.inner.send::<CoverageDataCollectorInitializeResponse>(
3920            (options,),
3921            self.tx_id,
3922            0x51d6f91d6f02d9d6,
3923            fidl::encoding::DynamicFlags::empty(),
3924        )
3925    }
3926}
3927
3928#[must_use = "FIDL methods require a response to be sent"]
3929#[derive(Debug)]
3930pub struct CoverageDataCollectorAddInline8bitCountersResponder {
3931    control_handle: std::mem::ManuallyDrop<CoverageDataCollectorControlHandle>,
3932    tx_id: u32,
3933}
3934
3935/// Set the the channel to be shutdown (see [`CoverageDataCollectorControlHandle::shutdown`])
3936/// if the responder is dropped without sending a response, so that the client
3937/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3938impl std::ops::Drop for CoverageDataCollectorAddInline8bitCountersResponder {
3939    fn drop(&mut self) {
3940        self.control_handle.shutdown();
3941        // Safety: drops once, never accessed again
3942        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3943    }
3944}
3945
3946impl fdomain_client::fidl::Responder for CoverageDataCollectorAddInline8bitCountersResponder {
3947    type ControlHandle = CoverageDataCollectorControlHandle;
3948
3949    fn control_handle(&self) -> &CoverageDataCollectorControlHandle {
3950        &self.control_handle
3951    }
3952
3953    fn drop_without_shutdown(mut self) {
3954        // Safety: drops once, never accessed again due to mem::forget
3955        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3956        // Prevent Drop from running (which would shut down the channel)
3957        std::mem::forget(self);
3958    }
3959}
3960
3961impl CoverageDataCollectorAddInline8bitCountersResponder {
3962    /// Sends a response to the FIDL transaction.
3963    ///
3964    /// Sets the channel to shutdown if an error occurs.
3965    pub fn send(self) -> Result<(), fidl::Error> {
3966        let _result = self.send_raw();
3967        if _result.is_err() {
3968            self.control_handle.shutdown();
3969        }
3970        self.drop_without_shutdown();
3971        _result
3972    }
3973
3974    /// Similar to "send" but does not shutdown the channel if an error occurs.
3975    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3976        let _result = self.send_raw();
3977        self.drop_without_shutdown();
3978        _result
3979    }
3980
3981    fn send_raw(&self) -> Result<(), fidl::Error> {
3982        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3983            (),
3984            self.tx_id,
3985            0x75f87cadfc94d1be,
3986            fidl::encoding::DynamicFlags::empty(),
3987        )
3988    }
3989}
3990
3991#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3992pub struct CoverageDataProviderMarker;
3993
3994impl fdomain_client::fidl::ProtocolMarker for CoverageDataProviderMarker {
3995    type Proxy = CoverageDataProviderProxy;
3996    type RequestStream = CoverageDataProviderRequestStream;
3997
3998    const DEBUG_NAME: &'static str = "fuchsia.fuzzer.CoverageDataProvider";
3999}
4000impl fdomain_client::fidl::DiscoverableProtocolMarker for CoverageDataProviderMarker {}
4001
4002pub trait CoverageDataProviderProxyInterface: Send + Sync {
4003    fn r#set_options(&self, options: &Options) -> Result<(), fidl::Error>;
4004    type WatchCoverageDataResponseFut: std::future::Future<Output = Result<Vec<CoverageData>, fidl::Error>>
4005        + Send;
4006    fn r#watch_coverage_data(&self) -> Self::WatchCoverageDataResponseFut;
4007}
4008
4009#[derive(Debug, Clone)]
4010pub struct CoverageDataProviderProxy {
4011    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
4012}
4013
4014impl fdomain_client::fidl::Proxy for CoverageDataProviderProxy {
4015    type Protocol = CoverageDataProviderMarker;
4016
4017    fn from_channel(inner: fdomain_client::Channel) -> Self {
4018        Self::new(inner)
4019    }
4020
4021    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
4022        self.client.into_channel().map_err(|client| Self { client })
4023    }
4024
4025    fn as_channel(&self) -> &fdomain_client::Channel {
4026        self.client.as_channel()
4027    }
4028}
4029
4030impl CoverageDataProviderProxy {
4031    /// Create a new Proxy for fuchsia.fuzzer/CoverageDataProvider.
4032    pub fn new(channel: fdomain_client::Channel) -> Self {
4033        let protocol_name =
4034            <CoverageDataProviderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
4035        Self { client: fidl::client::Client::new(channel, protocol_name) }
4036    }
4037
4038    /// Get a Stream of events from the remote end of the protocol.
4039    ///
4040    /// # Panics
4041    ///
4042    /// Panics if the event stream was already taken.
4043    pub fn take_event_stream(&self) -> CoverageDataProviderEventStream {
4044        CoverageDataProviderEventStream { event_receiver: self.client.take_event_receiver() }
4045    }
4046
4047    /// Sets the options to be returned by `fuchsia.fuzzer.CoverageDataCollector/Initialize`.
4048    pub fn r#set_options(&self, mut options: &Options) -> Result<(), fidl::Error> {
4049        CoverageDataProviderProxyInterface::r#set_options(self, options)
4050    }
4051
4052    /// Provides coverage data collected from multiple processes.
4053    ///
4054    /// Returns a vector of `CoverageData` structs containing the information provided by clients of
4055    /// `fuchsia.fuzzer.CoverageDataCollector`. This method uses the "hanging get" pattern: The
4056    /// initial call will immediately return whatever data is available, up to `MAX_COVERAGE_DATA`.
4057    /// If no fuzzed components have been started yet, this be an empty vector. If there are more
4058    /// than `MAX_COVERAGE_DATA` elements available, the remainder are retained for subsequent
4059    /// calls. If there is no more data available, subsequent calls will block until new coverage
4060    /// data is available.
4061    ///
4062    /// The channel is closed on FIDL error. Clients should exit and not attempt to reconnect.
4063    pub fn r#watch_coverage_data(
4064        &self,
4065    ) -> fidl::client::QueryResponseFut<
4066        Vec<CoverageData>,
4067        fdomain_client::fidl::FDomainResourceDialect,
4068    > {
4069        CoverageDataProviderProxyInterface::r#watch_coverage_data(self)
4070    }
4071}
4072
4073impl CoverageDataProviderProxyInterface for CoverageDataProviderProxy {
4074    fn r#set_options(&self, mut options: &Options) -> Result<(), fidl::Error> {
4075        self.client.send::<CoverageDataProviderSetOptionsRequest>(
4076            (options,),
4077            0x4873c4a5c7683384,
4078            fidl::encoding::DynamicFlags::empty(),
4079        )
4080    }
4081
4082    type WatchCoverageDataResponseFut = fidl::client::QueryResponseFut<
4083        Vec<CoverageData>,
4084        fdomain_client::fidl::FDomainResourceDialect,
4085    >;
4086    fn r#watch_coverage_data(&self) -> Self::WatchCoverageDataResponseFut {
4087        fn _decode(
4088            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4089        ) -> Result<Vec<CoverageData>, fidl::Error> {
4090            let _response = fidl::client::decode_transaction_body::<
4091                CoverageDataProviderWatchCoverageDataResponse,
4092                fdomain_client::fidl::FDomainResourceDialect,
4093                0x34a92fc9c73bea5a,
4094            >(_buf?)?;
4095            Ok(_response.coverage_data)
4096        }
4097        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<CoverageData>>(
4098            (),
4099            0x34a92fc9c73bea5a,
4100            fidl::encoding::DynamicFlags::empty(),
4101            _decode,
4102        )
4103    }
4104}
4105
4106pub struct CoverageDataProviderEventStream {
4107    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
4108}
4109
4110impl std::marker::Unpin for CoverageDataProviderEventStream {}
4111
4112impl futures::stream::FusedStream for CoverageDataProviderEventStream {
4113    fn is_terminated(&self) -> bool {
4114        self.event_receiver.is_terminated()
4115    }
4116}
4117
4118impl futures::Stream for CoverageDataProviderEventStream {
4119    type Item = Result<CoverageDataProviderEvent, fidl::Error>;
4120
4121    fn poll_next(
4122        mut self: std::pin::Pin<&mut Self>,
4123        cx: &mut std::task::Context<'_>,
4124    ) -> std::task::Poll<Option<Self::Item>> {
4125        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4126            &mut self.event_receiver,
4127            cx
4128        )?) {
4129            Some(buf) => std::task::Poll::Ready(Some(CoverageDataProviderEvent::decode(buf))),
4130            None => std::task::Poll::Ready(None),
4131        }
4132    }
4133}
4134
4135#[derive(Debug)]
4136pub enum CoverageDataProviderEvent {}
4137
4138impl CoverageDataProviderEvent {
4139    /// Decodes a message buffer as a [`CoverageDataProviderEvent`].
4140    fn decode(
4141        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4142    ) -> Result<CoverageDataProviderEvent, fidl::Error> {
4143        let (bytes, _handles) = buf.split_mut();
4144        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4145        debug_assert_eq!(tx_header.tx_id, 0);
4146        match tx_header.ordinal {
4147            _ => Err(fidl::Error::UnknownOrdinal {
4148                ordinal: tx_header.ordinal,
4149                protocol_name:
4150                    <CoverageDataProviderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4151            }),
4152        }
4153    }
4154}
4155
4156/// A Stream of incoming requests for fuchsia.fuzzer/CoverageDataProvider.
4157pub struct CoverageDataProviderRequestStream {
4158    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4159    is_terminated: bool,
4160}
4161
4162impl std::marker::Unpin for CoverageDataProviderRequestStream {}
4163
4164impl futures::stream::FusedStream for CoverageDataProviderRequestStream {
4165    fn is_terminated(&self) -> bool {
4166        self.is_terminated
4167    }
4168}
4169
4170impl fdomain_client::fidl::RequestStream for CoverageDataProviderRequestStream {
4171    type Protocol = CoverageDataProviderMarker;
4172    type ControlHandle = CoverageDataProviderControlHandle;
4173
4174    fn from_channel(channel: fdomain_client::Channel) -> Self {
4175        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4176    }
4177
4178    fn control_handle(&self) -> Self::ControlHandle {
4179        CoverageDataProviderControlHandle { inner: self.inner.clone() }
4180    }
4181
4182    fn into_inner(
4183        self,
4184    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
4185    {
4186        (self.inner, self.is_terminated)
4187    }
4188
4189    fn from_inner(
4190        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4191        is_terminated: bool,
4192    ) -> Self {
4193        Self { inner, is_terminated }
4194    }
4195}
4196
4197impl futures::Stream for CoverageDataProviderRequestStream {
4198    type Item = Result<CoverageDataProviderRequest, fidl::Error>;
4199
4200    fn poll_next(
4201        mut self: std::pin::Pin<&mut Self>,
4202        cx: &mut std::task::Context<'_>,
4203    ) -> std::task::Poll<Option<Self::Item>> {
4204        let this = &mut *self;
4205        if this.inner.check_shutdown(cx) {
4206            this.is_terminated = true;
4207            return std::task::Poll::Ready(None);
4208        }
4209        if this.is_terminated {
4210            panic!("polled CoverageDataProviderRequestStream after completion");
4211        }
4212        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
4213            |bytes, handles| {
4214                match this.inner.channel().read_etc(cx, bytes, handles) {
4215                    std::task::Poll::Ready(Ok(())) => {}
4216                    std::task::Poll::Pending => return std::task::Poll::Pending,
4217                    std::task::Poll::Ready(Err(None)) => {
4218                        this.is_terminated = true;
4219                        return std::task::Poll::Ready(None);
4220                    }
4221                    std::task::Poll::Ready(Err(Some(e))) => {
4222                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4223                            e.into(),
4224                        ))));
4225                    }
4226                }
4227
4228                // A message has been received from the channel
4229                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4230
4231                std::task::Poll::Ready(Some(match header.ordinal {
4232                0x4873c4a5c7683384 => {
4233                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4234                    let mut req = fidl::new_empty!(CoverageDataProviderSetOptionsRequest, fdomain_client::fidl::FDomainResourceDialect);
4235                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CoverageDataProviderSetOptionsRequest>(&header, _body_bytes, handles, &mut req)?;
4236                    let control_handle = CoverageDataProviderControlHandle {
4237                        inner: this.inner.clone(),
4238                    };
4239                    Ok(CoverageDataProviderRequest::SetOptions {options: req.options,
4240
4241                        control_handle,
4242                    })
4243                }
4244                0x34a92fc9c73bea5a => {
4245                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4246                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
4247                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4248                    let control_handle = CoverageDataProviderControlHandle {
4249                        inner: this.inner.clone(),
4250                    };
4251                    Ok(CoverageDataProviderRequest::WatchCoverageData {
4252                        responder: CoverageDataProviderWatchCoverageDataResponder {
4253                            control_handle: std::mem::ManuallyDrop::new(control_handle),
4254                            tx_id: header.tx_id,
4255                        },
4256                    })
4257                }
4258                _ => Err(fidl::Error::UnknownOrdinal {
4259                    ordinal: header.ordinal,
4260                    protocol_name: <CoverageDataProviderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4261                }),
4262            }))
4263            },
4264        )
4265    }
4266}
4267
4268/// Provides the process Handles and VMOs used to share code coverage to the fuzzing engine.
4269///
4270/// This protocol is implemented by `test_manager`'s `fuzz_coverage` component. The fuzzing engine
4271/// acts as a client, although it does not connect directly. Instead the `fuzz_test_runner` makes
4272/// the connection and passes it off to fuzzing engine on process start. It allows the engine to
4273/// retrieve the coverage-related Handles published by instrumented target processes.
4274///
4275/// The channel is closed on FIDL error. Clients should exit and not attempt to reconnect.
4276#[derive(Debug)]
4277pub enum CoverageDataProviderRequest {
4278    /// Sets the options to be returned by `fuchsia.fuzzer.CoverageDataCollector/Initialize`.
4279    SetOptions { options: Options, control_handle: CoverageDataProviderControlHandle },
4280    /// Provides coverage data collected from multiple processes.
4281    ///
4282    /// Returns a vector of `CoverageData` structs containing the information provided by clients of
4283    /// `fuchsia.fuzzer.CoverageDataCollector`. This method uses the "hanging get" pattern: The
4284    /// initial call will immediately return whatever data is available, up to `MAX_COVERAGE_DATA`.
4285    /// If no fuzzed components have been started yet, this be an empty vector. If there are more
4286    /// than `MAX_COVERAGE_DATA` elements available, the remainder are retained for subsequent
4287    /// calls. If there is no more data available, subsequent calls will block until new coverage
4288    /// data is available.
4289    ///
4290    /// The channel is closed on FIDL error. Clients should exit and not attempt to reconnect.
4291    WatchCoverageData { responder: CoverageDataProviderWatchCoverageDataResponder },
4292}
4293
4294impl CoverageDataProviderRequest {
4295    #[allow(irrefutable_let_patterns)]
4296    pub fn into_set_options(self) -> Option<(Options, CoverageDataProviderControlHandle)> {
4297        if let CoverageDataProviderRequest::SetOptions { options, control_handle } = self {
4298            Some((options, control_handle))
4299        } else {
4300            None
4301        }
4302    }
4303
4304    #[allow(irrefutable_let_patterns)]
4305    pub fn into_watch_coverage_data(
4306        self,
4307    ) -> Option<(CoverageDataProviderWatchCoverageDataResponder)> {
4308        if let CoverageDataProviderRequest::WatchCoverageData { responder } = self {
4309            Some((responder))
4310        } else {
4311            None
4312        }
4313    }
4314
4315    /// Name of the method defined in FIDL
4316    pub fn method_name(&self) -> &'static str {
4317        match *self {
4318            CoverageDataProviderRequest::SetOptions { .. } => "set_options",
4319            CoverageDataProviderRequest::WatchCoverageData { .. } => "watch_coverage_data",
4320        }
4321    }
4322}
4323
4324#[derive(Debug, Clone)]
4325pub struct CoverageDataProviderControlHandle {
4326    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4327}
4328
4329impl fdomain_client::fidl::ControlHandle for CoverageDataProviderControlHandle {
4330    fn shutdown(&self) {
4331        self.inner.shutdown()
4332    }
4333
4334    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4335        self.inner.shutdown_with_epitaph(status)
4336    }
4337
4338    fn is_closed(&self) -> bool {
4339        self.inner.channel().is_closed()
4340    }
4341    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
4342        self.inner.channel().on_closed()
4343    }
4344}
4345
4346impl CoverageDataProviderControlHandle {}
4347
4348#[must_use = "FIDL methods require a response to be sent"]
4349#[derive(Debug)]
4350pub struct CoverageDataProviderWatchCoverageDataResponder {
4351    control_handle: std::mem::ManuallyDrop<CoverageDataProviderControlHandle>,
4352    tx_id: u32,
4353}
4354
4355/// Set the the channel to be shutdown (see [`CoverageDataProviderControlHandle::shutdown`])
4356/// if the responder is dropped without sending a response, so that the client
4357/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4358impl std::ops::Drop for CoverageDataProviderWatchCoverageDataResponder {
4359    fn drop(&mut self) {
4360        self.control_handle.shutdown();
4361        // Safety: drops once, never accessed again
4362        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4363    }
4364}
4365
4366impl fdomain_client::fidl::Responder for CoverageDataProviderWatchCoverageDataResponder {
4367    type ControlHandle = CoverageDataProviderControlHandle;
4368
4369    fn control_handle(&self) -> &CoverageDataProviderControlHandle {
4370        &self.control_handle
4371    }
4372
4373    fn drop_without_shutdown(mut self) {
4374        // Safety: drops once, never accessed again due to mem::forget
4375        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4376        // Prevent Drop from running (which would shut down the channel)
4377        std::mem::forget(self);
4378    }
4379}
4380
4381impl CoverageDataProviderWatchCoverageDataResponder {
4382    /// Sends a response to the FIDL transaction.
4383    ///
4384    /// Sets the channel to shutdown if an error occurs.
4385    pub fn send(self, mut coverage_data: Vec<CoverageData>) -> Result<(), fidl::Error> {
4386        let _result = self.send_raw(coverage_data);
4387        if _result.is_err() {
4388            self.control_handle.shutdown();
4389        }
4390        self.drop_without_shutdown();
4391        _result
4392    }
4393
4394    /// Similar to "send" but does not shutdown the channel if an error occurs.
4395    pub fn send_no_shutdown_on_err(
4396        self,
4397        mut coverage_data: Vec<CoverageData>,
4398    ) -> Result<(), fidl::Error> {
4399        let _result = self.send_raw(coverage_data);
4400        self.drop_without_shutdown();
4401        _result
4402    }
4403
4404    fn send_raw(&self, mut coverage_data: Vec<CoverageData>) -> Result<(), fidl::Error> {
4405        self.control_handle.inner.send::<CoverageDataProviderWatchCoverageDataResponse>(
4406            (coverage_data.as_mut(),),
4407            self.tx_id,
4408            0x34a92fc9c73bea5a,
4409            fidl::encoding::DynamicFlags::empty(),
4410        )
4411    }
4412}
4413
4414#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4415pub struct ManagerMarker;
4416
4417impl fdomain_client::fidl::ProtocolMarker for ManagerMarker {
4418    type Proxy = ManagerProxy;
4419    type RequestStream = ManagerRequestStream;
4420
4421    const DEBUG_NAME: &'static str = "fuchsia.fuzzer.Manager";
4422}
4423impl fdomain_client::fidl::DiscoverableProtocolMarker for ManagerMarker {}
4424pub type ManagerConnectResult = Result<(), i32>;
4425pub type ManagerGetOutputResult = Result<(), i32>;
4426pub type ManagerStopResult = Result<(), i32>;
4427
4428pub trait ManagerProxyInterface: Send + Sync {
4429    type ConnectResponseFut: std::future::Future<Output = Result<ManagerConnectResult, fidl::Error>>
4430        + Send;
4431    fn r#connect(
4432        &self,
4433        fuzzer_url: &str,
4434        controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
4435    ) -> Self::ConnectResponseFut;
4436    type GetOutputResponseFut: std::future::Future<Output = Result<ManagerGetOutputResult, fidl::Error>>
4437        + Send;
4438    fn r#get_output(
4439        &self,
4440        fuzzer_url: &str,
4441        output: TestOutput,
4442        socket: fdomain_client::Socket,
4443    ) -> Self::GetOutputResponseFut;
4444    type StopResponseFut: std::future::Future<Output = Result<ManagerStopResult, fidl::Error>>
4445        + Send;
4446    fn r#stop(&self, fuzzer_url: &str) -> Self::StopResponseFut;
4447}
4448
4449#[derive(Debug, Clone)]
4450pub struct ManagerProxy {
4451    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
4452}
4453
4454impl fdomain_client::fidl::Proxy for ManagerProxy {
4455    type Protocol = ManagerMarker;
4456
4457    fn from_channel(inner: fdomain_client::Channel) -> Self {
4458        Self::new(inner)
4459    }
4460
4461    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
4462        self.client.into_channel().map_err(|client| Self { client })
4463    }
4464
4465    fn as_channel(&self) -> &fdomain_client::Channel {
4466        self.client.as_channel()
4467    }
4468}
4469
4470impl ManagerProxy {
4471    /// Create a new Proxy for fuchsia.fuzzer/Manager.
4472    pub fn new(channel: fdomain_client::Channel) -> Self {
4473        let protocol_name = <ManagerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
4474        Self { client: fidl::client::Client::new(channel, protocol_name) }
4475    }
4476
4477    /// Get a Stream of events from the remote end of the protocol.
4478    ///
4479    /// # Panics
4480    ///
4481    /// Panics if the event stream was already taken.
4482    pub fn take_event_stream(&self) -> ManagerEventStream {
4483        ManagerEventStream { event_receiver: self.client.take_event_receiver() }
4484    }
4485
4486    /// Connects to a fuzzer that implements the `fuchsia.fuzzer/Controller`
4487    /// protocol.
4488    ///
4489    /// If the fuzzer is not currently running, the `fuzz_manager` will first
4490    /// start it (via the test_manager) before proceeding. The `fuzz_manager`
4491    /// sends the `controller` on to the fuzz-registry, which contains the
4492    /// `ControllerProviders` that can fulfill the connection request.
4493    ///
4494    /// See `fuchsia.test.manager/LaunchError` for details on ways
4495    /// `test_manager` can fail.
4496    ///
4497    /// + request `fuzzer_url` the package URL for the fuzzer.
4498    /// + request `controller` the connection from the client.
4499    /// * error one of the following:
4500    ///     * `ZX_ERR_NO_RESOURCES` if `test_manager` needs resources that are
4501    ///       unavailable.
4502    ///     * `ZX_ERR_NOT_FOUND` if the fuzzer URL is not recognized by
4503    ///       `test_manager`.
4504    ///     * `ZX_ERR_INVALID_ARGS` if `test_manager` reports invalid arguments.
4505    ///     * `ZX_ERR_NOT_SUPPORTED` if `test_manager` cannot connect to the
4506    ///       test suite.
4507    ///     * `ZX_ERR_INTERNAL` if `test_manager` encountered some other,
4508    ///       unspecified failure.
4509    ///     * `ZX_ERR_TIMED_OUT` if the fuzzer is not present or added to
4510    ///       fuzz-registry after starting.
4511    ///     * `ZX_ERR_SHOULD_WAIT` if another fuzzer is still starting.
4512    pub fn r#connect(
4513        &self,
4514        mut fuzzer_url: &str,
4515        mut controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
4516    ) -> fidl::client::QueryResponseFut<
4517        ManagerConnectResult,
4518        fdomain_client::fidl::FDomainResourceDialect,
4519    > {
4520        ManagerProxyInterface::r#connect(self, fuzzer_url, controller)
4521    }
4522
4523    /// Forwards the fuzzer's output of the given type to the provided socket.
4524    ///
4525    /// If this method is called multiple times for the same output type, the
4526    /// socket from the subsequent call replaces the socket from the earlier
4527    /// call, which is closed.
4528    ///
4529    /// + request `fuzzer_url` the package URL for the fuzzer.
4530    /// + request `output` the type of the output stream to forward.
4531    /// + request `socket` a socket to forward the output stream to.
4532    /// * error one of the following:
4533    ///     * `ZX_ERR_INVALID_ARGS` if the URL cannot be parsed.
4534    ///     * `ZX_ERR_NOT_FOUND` if the fuzzer URL was not recognized by
4535    ///       `test_manager`.
4536    ///     * `ZX_ERR_BAD_STATE` if the fuzzer is not connected.
4537    pub fn r#get_output(
4538        &self,
4539        mut fuzzer_url: &str,
4540        mut output: TestOutput,
4541        mut socket: fdomain_client::Socket,
4542    ) -> fidl::client::QueryResponseFut<
4543        ManagerGetOutputResult,
4544        fdomain_client::fidl::FDomainResourceDialect,
4545    > {
4546        ManagerProxyInterface::r#get_output(self, fuzzer_url, output, socket)
4547    }
4548
4549    /// Stops the associated fuzzer immediately, ending any workflows in
4550    /// progress.
4551    ///
4552    /// + request `fuzzer_url` the package URL for the fuzzer.
4553    /// * error `ZX_ERR_NOT_FOUND` if no fuzzer was active with the given URL.
4554    pub fn r#stop(
4555        &self,
4556        mut fuzzer_url: &str,
4557    ) -> fidl::client::QueryResponseFut<
4558        ManagerStopResult,
4559        fdomain_client::fidl::FDomainResourceDialect,
4560    > {
4561        ManagerProxyInterface::r#stop(self, fuzzer_url)
4562    }
4563}
4564
4565impl ManagerProxyInterface for ManagerProxy {
4566    type ConnectResponseFut = fidl::client::QueryResponseFut<
4567        ManagerConnectResult,
4568        fdomain_client::fidl::FDomainResourceDialect,
4569    >;
4570    fn r#connect(
4571        &self,
4572        mut fuzzer_url: &str,
4573        mut controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
4574    ) -> Self::ConnectResponseFut {
4575        fn _decode(
4576            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4577        ) -> Result<ManagerConnectResult, fidl::Error> {
4578            let _response = fidl::client::decode_transaction_body::<
4579                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4580                fdomain_client::fidl::FDomainResourceDialect,
4581                0x1620cd742a89f064,
4582            >(_buf?)?;
4583            Ok(_response.map(|x| x))
4584        }
4585        self.client.send_query_and_decode::<ManagerConnectRequest, ManagerConnectResult>(
4586            (fuzzer_url, controller),
4587            0x1620cd742a89f064,
4588            fidl::encoding::DynamicFlags::empty(),
4589            _decode,
4590        )
4591    }
4592
4593    type GetOutputResponseFut = fidl::client::QueryResponseFut<
4594        ManagerGetOutputResult,
4595        fdomain_client::fidl::FDomainResourceDialect,
4596    >;
4597    fn r#get_output(
4598        &self,
4599        mut fuzzer_url: &str,
4600        mut output: TestOutput,
4601        mut socket: fdomain_client::Socket,
4602    ) -> Self::GetOutputResponseFut {
4603        fn _decode(
4604            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4605        ) -> Result<ManagerGetOutputResult, fidl::Error> {
4606            let _response = fidl::client::decode_transaction_body::<
4607                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4608                fdomain_client::fidl::FDomainResourceDialect,
4609                0x755c28eecf20a88d,
4610            >(_buf?)?;
4611            Ok(_response.map(|x| x))
4612        }
4613        self.client.send_query_and_decode::<ManagerGetOutputRequest, ManagerGetOutputResult>(
4614            (fuzzer_url, output, socket),
4615            0x755c28eecf20a88d,
4616            fidl::encoding::DynamicFlags::empty(),
4617            _decode,
4618        )
4619    }
4620
4621    type StopResponseFut = fidl::client::QueryResponseFut<
4622        ManagerStopResult,
4623        fdomain_client::fidl::FDomainResourceDialect,
4624    >;
4625    fn r#stop(&self, mut fuzzer_url: &str) -> Self::StopResponseFut {
4626        fn _decode(
4627            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4628        ) -> Result<ManagerStopResult, fidl::Error> {
4629            let _response = fidl::client::decode_transaction_body::<
4630                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4631                fdomain_client::fidl::FDomainResourceDialect,
4632                0x27e53d86badd21f3,
4633            >(_buf?)?;
4634            Ok(_response.map(|x| x))
4635        }
4636        self.client.send_query_and_decode::<ManagerStopRequest, ManagerStopResult>(
4637            (fuzzer_url,),
4638            0x27e53d86badd21f3,
4639            fidl::encoding::DynamicFlags::empty(),
4640            _decode,
4641        )
4642    }
4643}
4644
4645pub struct ManagerEventStream {
4646    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
4647}
4648
4649impl std::marker::Unpin for ManagerEventStream {}
4650
4651impl futures::stream::FusedStream for ManagerEventStream {
4652    fn is_terminated(&self) -> bool {
4653        self.event_receiver.is_terminated()
4654    }
4655}
4656
4657impl futures::Stream for ManagerEventStream {
4658    type Item = Result<ManagerEvent, fidl::Error>;
4659
4660    fn poll_next(
4661        mut self: std::pin::Pin<&mut Self>,
4662        cx: &mut std::task::Context<'_>,
4663    ) -> std::task::Poll<Option<Self::Item>> {
4664        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4665            &mut self.event_receiver,
4666            cx
4667        )?) {
4668            Some(buf) => std::task::Poll::Ready(Some(ManagerEvent::decode(buf))),
4669            None => std::task::Poll::Ready(None),
4670        }
4671    }
4672}
4673
4674#[derive(Debug)]
4675pub enum ManagerEvent {}
4676
4677impl ManagerEvent {
4678    /// Decodes a message buffer as a [`ManagerEvent`].
4679    fn decode(
4680        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4681    ) -> Result<ManagerEvent, fidl::Error> {
4682        let (bytes, _handles) = buf.split_mut();
4683        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4684        debug_assert_eq!(tx_header.tx_id, 0);
4685        match tx_header.ordinal {
4686            _ => Err(fidl::Error::UnknownOrdinal {
4687                ordinal: tx_header.ordinal,
4688                protocol_name: <ManagerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4689            }),
4690        }
4691    }
4692}
4693
4694/// A Stream of incoming requests for fuchsia.fuzzer/Manager.
4695pub struct ManagerRequestStream {
4696    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4697    is_terminated: bool,
4698}
4699
4700impl std::marker::Unpin for ManagerRequestStream {}
4701
4702impl futures::stream::FusedStream for ManagerRequestStream {
4703    fn is_terminated(&self) -> bool {
4704        self.is_terminated
4705    }
4706}
4707
4708impl fdomain_client::fidl::RequestStream for ManagerRequestStream {
4709    type Protocol = ManagerMarker;
4710    type ControlHandle = ManagerControlHandle;
4711
4712    fn from_channel(channel: fdomain_client::Channel) -> Self {
4713        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4714    }
4715
4716    fn control_handle(&self) -> Self::ControlHandle {
4717        ManagerControlHandle { inner: self.inner.clone() }
4718    }
4719
4720    fn into_inner(
4721        self,
4722    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
4723    {
4724        (self.inner, self.is_terminated)
4725    }
4726
4727    fn from_inner(
4728        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4729        is_terminated: bool,
4730    ) -> Self {
4731        Self { inner, is_terminated }
4732    }
4733}
4734
4735impl futures::Stream for ManagerRequestStream {
4736    type Item = Result<ManagerRequest, fidl::Error>;
4737
4738    fn poll_next(
4739        mut self: std::pin::Pin<&mut Self>,
4740        cx: &mut std::task::Context<'_>,
4741    ) -> std::task::Poll<Option<Self::Item>> {
4742        let this = &mut *self;
4743        if this.inner.check_shutdown(cx) {
4744            this.is_terminated = true;
4745            return std::task::Poll::Ready(None);
4746        }
4747        if this.is_terminated {
4748            panic!("polled ManagerRequestStream after completion");
4749        }
4750        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
4751            |bytes, handles| {
4752                match this.inner.channel().read_etc(cx, bytes, handles) {
4753                    std::task::Poll::Ready(Ok(())) => {}
4754                    std::task::Poll::Pending => return std::task::Poll::Pending,
4755                    std::task::Poll::Ready(Err(None)) => {
4756                        this.is_terminated = true;
4757                        return std::task::Poll::Ready(None);
4758                    }
4759                    std::task::Poll::Ready(Err(Some(e))) => {
4760                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4761                            e.into(),
4762                        ))));
4763                    }
4764                }
4765
4766                // A message has been received from the channel
4767                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4768
4769                std::task::Poll::Ready(Some(match header.ordinal {
4770                    0x1620cd742a89f064 => {
4771                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4772                        let mut req = fidl::new_empty!(
4773                            ManagerConnectRequest,
4774                            fdomain_client::fidl::FDomainResourceDialect
4775                        );
4776                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ManagerConnectRequest>(&header, _body_bytes, handles, &mut req)?;
4777                        let control_handle = ManagerControlHandle { inner: this.inner.clone() };
4778                        Ok(ManagerRequest::Connect {
4779                            fuzzer_url: req.fuzzer_url,
4780                            controller: req.controller,
4781
4782                            responder: ManagerConnectResponder {
4783                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4784                                tx_id: header.tx_id,
4785                            },
4786                        })
4787                    }
4788                    0x755c28eecf20a88d => {
4789                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4790                        let mut req = fidl::new_empty!(
4791                            ManagerGetOutputRequest,
4792                            fdomain_client::fidl::FDomainResourceDialect
4793                        );
4794                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ManagerGetOutputRequest>(&header, _body_bytes, handles, &mut req)?;
4795                        let control_handle = ManagerControlHandle { inner: this.inner.clone() };
4796                        Ok(ManagerRequest::GetOutput {
4797                            fuzzer_url: req.fuzzer_url,
4798                            output: req.output,
4799                            socket: req.socket,
4800
4801                            responder: ManagerGetOutputResponder {
4802                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4803                                tx_id: header.tx_id,
4804                            },
4805                        })
4806                    }
4807                    0x27e53d86badd21f3 => {
4808                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4809                        let mut req = fidl::new_empty!(
4810                            ManagerStopRequest,
4811                            fdomain_client::fidl::FDomainResourceDialect
4812                        );
4813                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ManagerStopRequest>(&header, _body_bytes, handles, &mut req)?;
4814                        let control_handle = ManagerControlHandle { inner: this.inner.clone() };
4815                        Ok(ManagerRequest::Stop {
4816                            fuzzer_url: req.fuzzer_url,
4817
4818                            responder: ManagerStopResponder {
4819                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4820                                tx_id: header.tx_id,
4821                            },
4822                        })
4823                    }
4824                    _ => Err(fidl::Error::UnknownOrdinal {
4825                        ordinal: header.ordinal,
4826                        protocol_name:
4827                            <ManagerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4828                    }),
4829                }))
4830            },
4831        )
4832    }
4833}
4834
4835/// Entry point for users, e.g. `ffx fuzz`, used to start and stop fuzzers. A
4836/// fuzzer will be started on the first call to `Connect` with a given URL.
4837/// Closing the given `Controller` channel does *not* stop the associated
4838/// fuzzer. Instead, since fuzzing is meant to be long-running, clients
4839/// may drop the connection and re-`Connect` some time later.
4840#[derive(Debug)]
4841pub enum ManagerRequest {
4842    /// Connects to a fuzzer that implements the `fuchsia.fuzzer/Controller`
4843    /// protocol.
4844    ///
4845    /// If the fuzzer is not currently running, the `fuzz_manager` will first
4846    /// start it (via the test_manager) before proceeding. The `fuzz_manager`
4847    /// sends the `controller` on to the fuzz-registry, which contains the
4848    /// `ControllerProviders` that can fulfill the connection request.
4849    ///
4850    /// See `fuchsia.test.manager/LaunchError` for details on ways
4851    /// `test_manager` can fail.
4852    ///
4853    /// + request `fuzzer_url` the package URL for the fuzzer.
4854    /// + request `controller` the connection from the client.
4855    /// * error one of the following:
4856    ///     * `ZX_ERR_NO_RESOURCES` if `test_manager` needs resources that are
4857    ///       unavailable.
4858    ///     * `ZX_ERR_NOT_FOUND` if the fuzzer URL is not recognized by
4859    ///       `test_manager`.
4860    ///     * `ZX_ERR_INVALID_ARGS` if `test_manager` reports invalid arguments.
4861    ///     * `ZX_ERR_NOT_SUPPORTED` if `test_manager` cannot connect to the
4862    ///       test suite.
4863    ///     * `ZX_ERR_INTERNAL` if `test_manager` encountered some other,
4864    ///       unspecified failure.
4865    ///     * `ZX_ERR_TIMED_OUT` if the fuzzer is not present or added to
4866    ///       fuzz-registry after starting.
4867    ///     * `ZX_ERR_SHOULD_WAIT` if another fuzzer is still starting.
4868    Connect {
4869        fuzzer_url: String,
4870        controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
4871        responder: ManagerConnectResponder,
4872    },
4873    /// Forwards the fuzzer's output of the given type to the provided socket.
4874    ///
4875    /// If this method is called multiple times for the same output type, the
4876    /// socket from the subsequent call replaces the socket from the earlier
4877    /// call, which is closed.
4878    ///
4879    /// + request `fuzzer_url` the package URL for the fuzzer.
4880    /// + request `output` the type of the output stream to forward.
4881    /// + request `socket` a socket to forward the output stream to.
4882    /// * error one of the following:
4883    ///     * `ZX_ERR_INVALID_ARGS` if the URL cannot be parsed.
4884    ///     * `ZX_ERR_NOT_FOUND` if the fuzzer URL was not recognized by
4885    ///       `test_manager`.
4886    ///     * `ZX_ERR_BAD_STATE` if the fuzzer is not connected.
4887    GetOutput {
4888        fuzzer_url: String,
4889        output: TestOutput,
4890        socket: fdomain_client::Socket,
4891        responder: ManagerGetOutputResponder,
4892    },
4893    /// Stops the associated fuzzer immediately, ending any workflows in
4894    /// progress.
4895    ///
4896    /// + request `fuzzer_url` the package URL for the fuzzer.
4897    /// * error `ZX_ERR_NOT_FOUND` if no fuzzer was active with the given URL.
4898    Stop { fuzzer_url: String, responder: ManagerStopResponder },
4899}
4900
4901impl ManagerRequest {
4902    #[allow(irrefutable_let_patterns)]
4903    pub fn into_connect(
4904        self,
4905    ) -> Option<(String, fdomain_client::fidl::ServerEnd<ControllerMarker>, ManagerConnectResponder)>
4906    {
4907        if let ManagerRequest::Connect { fuzzer_url, controller, responder } = self {
4908            Some((fuzzer_url, controller, responder))
4909        } else {
4910            None
4911        }
4912    }
4913
4914    #[allow(irrefutable_let_patterns)]
4915    pub fn into_get_output(
4916        self,
4917    ) -> Option<(String, TestOutput, fdomain_client::Socket, ManagerGetOutputResponder)> {
4918        if let ManagerRequest::GetOutput { fuzzer_url, output, socket, responder } = self {
4919            Some((fuzzer_url, output, socket, responder))
4920        } else {
4921            None
4922        }
4923    }
4924
4925    #[allow(irrefutable_let_patterns)]
4926    pub fn into_stop(self) -> Option<(String, ManagerStopResponder)> {
4927        if let ManagerRequest::Stop { fuzzer_url, responder } = self {
4928            Some((fuzzer_url, responder))
4929        } else {
4930            None
4931        }
4932    }
4933
4934    /// Name of the method defined in FIDL
4935    pub fn method_name(&self) -> &'static str {
4936        match *self {
4937            ManagerRequest::Connect { .. } => "connect",
4938            ManagerRequest::GetOutput { .. } => "get_output",
4939            ManagerRequest::Stop { .. } => "stop",
4940        }
4941    }
4942}
4943
4944#[derive(Debug, Clone)]
4945pub struct ManagerControlHandle {
4946    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4947}
4948
4949impl fdomain_client::fidl::ControlHandle for ManagerControlHandle {
4950    fn shutdown(&self) {
4951        self.inner.shutdown()
4952    }
4953
4954    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4955        self.inner.shutdown_with_epitaph(status)
4956    }
4957
4958    fn is_closed(&self) -> bool {
4959        self.inner.channel().is_closed()
4960    }
4961    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
4962        self.inner.channel().on_closed()
4963    }
4964}
4965
4966impl ManagerControlHandle {}
4967
4968#[must_use = "FIDL methods require a response to be sent"]
4969#[derive(Debug)]
4970pub struct ManagerConnectResponder {
4971    control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
4972    tx_id: u32,
4973}
4974
4975/// Set the the channel to be shutdown (see [`ManagerControlHandle::shutdown`])
4976/// if the responder is dropped without sending a response, so that the client
4977/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4978impl std::ops::Drop for ManagerConnectResponder {
4979    fn drop(&mut self) {
4980        self.control_handle.shutdown();
4981        // Safety: drops once, never accessed again
4982        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4983    }
4984}
4985
4986impl fdomain_client::fidl::Responder for ManagerConnectResponder {
4987    type ControlHandle = ManagerControlHandle;
4988
4989    fn control_handle(&self) -> &ManagerControlHandle {
4990        &self.control_handle
4991    }
4992
4993    fn drop_without_shutdown(mut self) {
4994        // Safety: drops once, never accessed again due to mem::forget
4995        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4996        // Prevent Drop from running (which would shut down the channel)
4997        std::mem::forget(self);
4998    }
4999}
5000
5001impl ManagerConnectResponder {
5002    /// Sends a response to the FIDL transaction.
5003    ///
5004    /// Sets the channel to shutdown if an error occurs.
5005    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5006        let _result = self.send_raw(result);
5007        if _result.is_err() {
5008            self.control_handle.shutdown();
5009        }
5010        self.drop_without_shutdown();
5011        _result
5012    }
5013
5014    /// Similar to "send" but does not shutdown the channel if an error occurs.
5015    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5016        let _result = self.send_raw(result);
5017        self.drop_without_shutdown();
5018        _result
5019    }
5020
5021    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5022        self.control_handle
5023            .inner
5024            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5025                result,
5026                self.tx_id,
5027                0x1620cd742a89f064,
5028                fidl::encoding::DynamicFlags::empty(),
5029            )
5030    }
5031}
5032
5033#[must_use = "FIDL methods require a response to be sent"]
5034#[derive(Debug)]
5035pub struct ManagerGetOutputResponder {
5036    control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
5037    tx_id: u32,
5038}
5039
5040/// Set the the channel to be shutdown (see [`ManagerControlHandle::shutdown`])
5041/// if the responder is dropped without sending a response, so that the client
5042/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5043impl std::ops::Drop for ManagerGetOutputResponder {
5044    fn drop(&mut self) {
5045        self.control_handle.shutdown();
5046        // Safety: drops once, never accessed again
5047        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5048    }
5049}
5050
5051impl fdomain_client::fidl::Responder for ManagerGetOutputResponder {
5052    type ControlHandle = ManagerControlHandle;
5053
5054    fn control_handle(&self) -> &ManagerControlHandle {
5055        &self.control_handle
5056    }
5057
5058    fn drop_without_shutdown(mut self) {
5059        // Safety: drops once, never accessed again due to mem::forget
5060        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5061        // Prevent Drop from running (which would shut down the channel)
5062        std::mem::forget(self);
5063    }
5064}
5065
5066impl ManagerGetOutputResponder {
5067    /// Sends a response to the FIDL transaction.
5068    ///
5069    /// Sets the channel to shutdown if an error occurs.
5070    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5071        let _result = self.send_raw(result);
5072        if _result.is_err() {
5073            self.control_handle.shutdown();
5074        }
5075        self.drop_without_shutdown();
5076        _result
5077    }
5078
5079    /// Similar to "send" but does not shutdown the channel if an error occurs.
5080    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5081        let _result = self.send_raw(result);
5082        self.drop_without_shutdown();
5083        _result
5084    }
5085
5086    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5087        self.control_handle
5088            .inner
5089            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5090                result,
5091                self.tx_id,
5092                0x755c28eecf20a88d,
5093                fidl::encoding::DynamicFlags::empty(),
5094            )
5095    }
5096}
5097
5098#[must_use = "FIDL methods require a response to be sent"]
5099#[derive(Debug)]
5100pub struct ManagerStopResponder {
5101    control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
5102    tx_id: u32,
5103}
5104
5105/// Set the the channel to be shutdown (see [`ManagerControlHandle::shutdown`])
5106/// if the responder is dropped without sending a response, so that the client
5107/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5108impl std::ops::Drop for ManagerStopResponder {
5109    fn drop(&mut self) {
5110        self.control_handle.shutdown();
5111        // Safety: drops once, never accessed again
5112        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5113    }
5114}
5115
5116impl fdomain_client::fidl::Responder for ManagerStopResponder {
5117    type ControlHandle = ManagerControlHandle;
5118
5119    fn control_handle(&self) -> &ManagerControlHandle {
5120        &self.control_handle
5121    }
5122
5123    fn drop_without_shutdown(mut self) {
5124        // Safety: drops once, never accessed again due to mem::forget
5125        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5126        // Prevent Drop from running (which would shut down the channel)
5127        std::mem::forget(self);
5128    }
5129}
5130
5131impl ManagerStopResponder {
5132    /// Sends a response to the FIDL transaction.
5133    ///
5134    /// Sets the channel to shutdown if an error occurs.
5135    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5136        let _result = self.send_raw(result);
5137        if _result.is_err() {
5138            self.control_handle.shutdown();
5139        }
5140        self.drop_without_shutdown();
5141        _result
5142    }
5143
5144    /// Similar to "send" but does not shutdown the channel if an error occurs.
5145    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5146        let _result = self.send_raw(result);
5147        self.drop_without_shutdown();
5148        _result
5149    }
5150
5151    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5152        self.control_handle
5153            .inner
5154            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5155                result,
5156                self.tx_id,
5157                0x27e53d86badd21f3,
5158                fidl::encoding::DynamicFlags::empty(),
5159            )
5160    }
5161}
5162
5163#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5164pub struct MonitorMarker;
5165
5166impl fdomain_client::fidl::ProtocolMarker for MonitorMarker {
5167    type Proxy = MonitorProxy;
5168    type RequestStream = MonitorRequestStream;
5169
5170    const DEBUG_NAME: &'static str = "(anonymous) Monitor";
5171}
5172
5173pub trait MonitorProxyInterface: Send + Sync {
5174    type UpdateResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
5175    fn r#update(&self, reason: UpdateReason, status: &Status) -> Self::UpdateResponseFut;
5176}
5177
5178#[derive(Debug, Clone)]
5179pub struct MonitorProxy {
5180    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5181}
5182
5183impl fdomain_client::fidl::Proxy for MonitorProxy {
5184    type Protocol = MonitorMarker;
5185
5186    fn from_channel(inner: fdomain_client::Channel) -> Self {
5187        Self::new(inner)
5188    }
5189
5190    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5191        self.client.into_channel().map_err(|client| Self { client })
5192    }
5193
5194    fn as_channel(&self) -> &fdomain_client::Channel {
5195        self.client.as_channel()
5196    }
5197}
5198
5199impl MonitorProxy {
5200    /// Create a new Proxy for fuchsia.fuzzer/Monitor.
5201    pub fn new(channel: fdomain_client::Channel) -> Self {
5202        let protocol_name = <MonitorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5203        Self { client: fidl::client::Client::new(channel, protocol_name) }
5204    }
5205
5206    /// Get a Stream of events from the remote end of the protocol.
5207    ///
5208    /// # Panics
5209    ///
5210    /// Panics if the event stream was already taken.
5211    pub fn take_event_stream(&self) -> MonitorEventStream {
5212        MonitorEventStream { event_receiver: self.client.take_event_receiver() }
5213    }
5214
5215    /// Sends the current status.
5216    ///
5217    /// + request `reason` the cause of a status change.
5218    /// + status `status` the reported fuzzing metrics.
5219    pub fn r#update(
5220        &self,
5221        mut reason: UpdateReason,
5222        mut status: &Status,
5223    ) -> fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect> {
5224        MonitorProxyInterface::r#update(self, reason, status)
5225    }
5226}
5227
5228impl MonitorProxyInterface for MonitorProxy {
5229    type UpdateResponseFut =
5230        fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect>;
5231    fn r#update(&self, mut reason: UpdateReason, mut status: &Status) -> Self::UpdateResponseFut {
5232        fn _decode(
5233            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5234        ) -> Result<(), fidl::Error> {
5235            let _response = fidl::client::decode_transaction_body::<
5236                fidl::encoding::EmptyPayload,
5237                fdomain_client::fidl::FDomainResourceDialect,
5238                0x7c773b93c1e6080f,
5239            >(_buf?)?;
5240            Ok(_response)
5241        }
5242        self.client.send_query_and_decode::<MonitorUpdateRequest, ()>(
5243            (reason, status),
5244            0x7c773b93c1e6080f,
5245            fidl::encoding::DynamicFlags::empty(),
5246            _decode,
5247        )
5248    }
5249}
5250
5251pub struct MonitorEventStream {
5252    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5253}
5254
5255impl std::marker::Unpin for MonitorEventStream {}
5256
5257impl futures::stream::FusedStream for MonitorEventStream {
5258    fn is_terminated(&self) -> bool {
5259        self.event_receiver.is_terminated()
5260    }
5261}
5262
5263impl futures::Stream for MonitorEventStream {
5264    type Item = Result<MonitorEvent, fidl::Error>;
5265
5266    fn poll_next(
5267        mut self: std::pin::Pin<&mut Self>,
5268        cx: &mut std::task::Context<'_>,
5269    ) -> std::task::Poll<Option<Self::Item>> {
5270        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5271            &mut self.event_receiver,
5272            cx
5273        )?) {
5274            Some(buf) => std::task::Poll::Ready(Some(MonitorEvent::decode(buf))),
5275            None => std::task::Poll::Ready(None),
5276        }
5277    }
5278}
5279
5280#[derive(Debug)]
5281pub enum MonitorEvent {}
5282
5283impl MonitorEvent {
5284    /// Decodes a message buffer as a [`MonitorEvent`].
5285    fn decode(
5286        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5287    ) -> Result<MonitorEvent, fidl::Error> {
5288        let (bytes, _handles) = buf.split_mut();
5289        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5290        debug_assert_eq!(tx_header.tx_id, 0);
5291        match tx_header.ordinal {
5292            _ => Err(fidl::Error::UnknownOrdinal {
5293                ordinal: tx_header.ordinal,
5294                protocol_name: <MonitorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5295            }),
5296        }
5297    }
5298}
5299
5300/// A Stream of incoming requests for fuchsia.fuzzer/Monitor.
5301pub struct MonitorRequestStream {
5302    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5303    is_terminated: bool,
5304}
5305
5306impl std::marker::Unpin for MonitorRequestStream {}
5307
5308impl futures::stream::FusedStream for MonitorRequestStream {
5309    fn is_terminated(&self) -> bool {
5310        self.is_terminated
5311    }
5312}
5313
5314impl fdomain_client::fidl::RequestStream for MonitorRequestStream {
5315    type Protocol = MonitorMarker;
5316    type ControlHandle = MonitorControlHandle;
5317
5318    fn from_channel(channel: fdomain_client::Channel) -> Self {
5319        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5320    }
5321
5322    fn control_handle(&self) -> Self::ControlHandle {
5323        MonitorControlHandle { inner: self.inner.clone() }
5324    }
5325
5326    fn into_inner(
5327        self,
5328    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5329    {
5330        (self.inner, self.is_terminated)
5331    }
5332
5333    fn from_inner(
5334        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5335        is_terminated: bool,
5336    ) -> Self {
5337        Self { inner, is_terminated }
5338    }
5339}
5340
5341impl futures::Stream for MonitorRequestStream {
5342    type Item = Result<MonitorRequest, fidl::Error>;
5343
5344    fn poll_next(
5345        mut self: std::pin::Pin<&mut Self>,
5346        cx: &mut std::task::Context<'_>,
5347    ) -> std::task::Poll<Option<Self::Item>> {
5348        let this = &mut *self;
5349        if this.inner.check_shutdown(cx) {
5350            this.is_terminated = true;
5351            return std::task::Poll::Ready(None);
5352        }
5353        if this.is_terminated {
5354            panic!("polled MonitorRequestStream after completion");
5355        }
5356        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5357            |bytes, handles| {
5358                match this.inner.channel().read_etc(cx, bytes, handles) {
5359                    std::task::Poll::Ready(Ok(())) => {}
5360                    std::task::Poll::Pending => return std::task::Poll::Pending,
5361                    std::task::Poll::Ready(Err(None)) => {
5362                        this.is_terminated = true;
5363                        return std::task::Poll::Ready(None);
5364                    }
5365                    std::task::Poll::Ready(Err(Some(e))) => {
5366                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5367                            e.into(),
5368                        ))));
5369                    }
5370                }
5371
5372                // A message has been received from the channel
5373                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5374
5375                std::task::Poll::Ready(Some(match header.ordinal {
5376                    0x7c773b93c1e6080f => {
5377                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5378                        let mut req = fidl::new_empty!(
5379                            MonitorUpdateRequest,
5380                            fdomain_client::fidl::FDomainResourceDialect
5381                        );
5382                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MonitorUpdateRequest>(&header, _body_bytes, handles, &mut req)?;
5383                        let control_handle = MonitorControlHandle { inner: this.inner.clone() };
5384                        Ok(MonitorRequest::Update {
5385                            reason: req.reason,
5386                            status: req.status,
5387
5388                            responder: MonitorUpdateResponder {
5389                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5390                                tx_id: header.tx_id,
5391                            },
5392                        })
5393                    }
5394                    _ => Err(fidl::Error::UnknownOrdinal {
5395                        ordinal: header.ordinal,
5396                        protocol_name:
5397                            <MonitorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5398                    }),
5399                }))
5400            },
5401        )
5402    }
5403}
5404
5405/// See `Status`. This protocol is used to push status from the `Controller` to
5406/// callers.
5407#[derive(Debug)]
5408pub enum MonitorRequest {
5409    /// Sends the current status.
5410    ///
5411    /// + request `reason` the cause of a status change.
5412    /// + status `status` the reported fuzzing metrics.
5413    Update { reason: UpdateReason, status: Status, responder: MonitorUpdateResponder },
5414}
5415
5416impl MonitorRequest {
5417    #[allow(irrefutable_let_patterns)]
5418    pub fn into_update(self) -> Option<(UpdateReason, Status, MonitorUpdateResponder)> {
5419        if let MonitorRequest::Update { reason, status, responder } = self {
5420            Some((reason, status, responder))
5421        } else {
5422            None
5423        }
5424    }
5425
5426    /// Name of the method defined in FIDL
5427    pub fn method_name(&self) -> &'static str {
5428        match *self {
5429            MonitorRequest::Update { .. } => "update",
5430        }
5431    }
5432}
5433
5434#[derive(Debug, Clone)]
5435pub struct MonitorControlHandle {
5436    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5437}
5438
5439impl fdomain_client::fidl::ControlHandle for MonitorControlHandle {
5440    fn shutdown(&self) {
5441        self.inner.shutdown()
5442    }
5443
5444    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5445        self.inner.shutdown_with_epitaph(status)
5446    }
5447
5448    fn is_closed(&self) -> bool {
5449        self.inner.channel().is_closed()
5450    }
5451    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5452        self.inner.channel().on_closed()
5453    }
5454}
5455
5456impl MonitorControlHandle {}
5457
5458#[must_use = "FIDL methods require a response to be sent"]
5459#[derive(Debug)]
5460pub struct MonitorUpdateResponder {
5461    control_handle: std::mem::ManuallyDrop<MonitorControlHandle>,
5462    tx_id: u32,
5463}
5464
5465/// Set the the channel to be shutdown (see [`MonitorControlHandle::shutdown`])
5466/// if the responder is dropped without sending a response, so that the client
5467/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5468impl std::ops::Drop for MonitorUpdateResponder {
5469    fn drop(&mut self) {
5470        self.control_handle.shutdown();
5471        // Safety: drops once, never accessed again
5472        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5473    }
5474}
5475
5476impl fdomain_client::fidl::Responder for MonitorUpdateResponder {
5477    type ControlHandle = MonitorControlHandle;
5478
5479    fn control_handle(&self) -> &MonitorControlHandle {
5480        &self.control_handle
5481    }
5482
5483    fn drop_without_shutdown(mut self) {
5484        // Safety: drops once, never accessed again due to mem::forget
5485        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5486        // Prevent Drop from running (which would shut down the channel)
5487        std::mem::forget(self);
5488    }
5489}
5490
5491impl MonitorUpdateResponder {
5492    /// Sends a response to the FIDL transaction.
5493    ///
5494    /// Sets the channel to shutdown if an error occurs.
5495    pub fn send(self) -> Result<(), fidl::Error> {
5496        let _result = self.send_raw();
5497        if _result.is_err() {
5498            self.control_handle.shutdown();
5499        }
5500        self.drop_without_shutdown();
5501        _result
5502    }
5503
5504    /// Similar to "send" but does not shutdown the channel if an error occurs.
5505    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
5506        let _result = self.send_raw();
5507        self.drop_without_shutdown();
5508        _result
5509    }
5510
5511    fn send_raw(&self) -> Result<(), fidl::Error> {
5512        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
5513            (),
5514            self.tx_id,
5515            0x7c773b93c1e6080f,
5516            fidl::encoding::DynamicFlags::empty(),
5517        )
5518    }
5519}
5520
5521#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5522pub struct RegistrarMarker;
5523
5524impl fdomain_client::fidl::ProtocolMarker for RegistrarMarker {
5525    type Proxy = RegistrarProxy;
5526    type RequestStream = RegistrarRequestStream;
5527
5528    const DEBUG_NAME: &'static str = "fuchsia.fuzzer.Registrar";
5529}
5530impl fdomain_client::fidl::DiscoverableProtocolMarker for RegistrarMarker {}
5531
5532pub trait RegistrarProxyInterface: Send + Sync {
5533    type RegisterResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
5534    fn r#register(
5535        &self,
5536        fuzzer_url: &str,
5537        provider: fdomain_client::fidl::ClientEnd<ControllerProviderMarker>,
5538    ) -> Self::RegisterResponseFut;
5539}
5540
5541#[derive(Debug, Clone)]
5542pub struct RegistrarProxy {
5543    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5544}
5545
5546impl fdomain_client::fidl::Proxy for RegistrarProxy {
5547    type Protocol = RegistrarMarker;
5548
5549    fn from_channel(inner: fdomain_client::Channel) -> Self {
5550        Self::new(inner)
5551    }
5552
5553    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5554        self.client.into_channel().map_err(|client| Self { client })
5555    }
5556
5557    fn as_channel(&self) -> &fdomain_client::Channel {
5558        self.client.as_channel()
5559    }
5560}
5561
5562impl RegistrarProxy {
5563    /// Create a new Proxy for fuchsia.fuzzer/Registrar.
5564    pub fn new(channel: fdomain_client::Channel) -> Self {
5565        let protocol_name = <RegistrarMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5566        Self { client: fidl::client::Client::new(channel, protocol_name) }
5567    }
5568
5569    /// Get a Stream of events from the remote end of the protocol.
5570    ///
5571    /// # Panics
5572    ///
5573    /// Panics if the event stream was already taken.
5574    pub fn take_event_stream(&self) -> RegistrarEventStream {
5575        RegistrarEventStream { event_receiver: self.client.take_event_receiver() }
5576    }
5577
5578    /// Adds a `ControllerProvider`. This should be called by the fuzzer itself,
5579    /// using the channel provided by the `fuzz_test_runner`, and in response to
5580    /// being started by the `fuzz_manager`.
5581    ///
5582    /// The registry will close the channel to the fuzzer on error, on a
5583    ///  corresponding call to `Registry.Disconnect`, or on exit. The fuzzer
5584    /// should exit when the channel closes.
5585    ///
5586    /// + request `fuzzer_url` the package URL for the fuzzer.
5587    /// + request `provider` the connection to a `ControllerProvider`.
5588    pub fn r#register(
5589        &self,
5590        mut fuzzer_url: &str,
5591        mut provider: fdomain_client::fidl::ClientEnd<ControllerProviderMarker>,
5592    ) -> fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect> {
5593        RegistrarProxyInterface::r#register(self, fuzzer_url, provider)
5594    }
5595}
5596
5597impl RegistrarProxyInterface for RegistrarProxy {
5598    type RegisterResponseFut =
5599        fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect>;
5600    fn r#register(
5601        &self,
5602        mut fuzzer_url: &str,
5603        mut provider: fdomain_client::fidl::ClientEnd<ControllerProviderMarker>,
5604    ) -> Self::RegisterResponseFut {
5605        fn _decode(
5606            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5607        ) -> Result<(), fidl::Error> {
5608            let _response = fidl::client::decode_transaction_body::<
5609                fidl::encoding::EmptyPayload,
5610                fdomain_client::fidl::FDomainResourceDialect,
5611                0x1716ac38e74b2840,
5612            >(_buf?)?;
5613            Ok(_response)
5614        }
5615        self.client.send_query_and_decode::<RegistrarRegisterRequest, ()>(
5616            (fuzzer_url, provider),
5617            0x1716ac38e74b2840,
5618            fidl::encoding::DynamicFlags::empty(),
5619            _decode,
5620        )
5621    }
5622}
5623
5624pub struct RegistrarEventStream {
5625    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5626}
5627
5628impl std::marker::Unpin for RegistrarEventStream {}
5629
5630impl futures::stream::FusedStream for RegistrarEventStream {
5631    fn is_terminated(&self) -> bool {
5632        self.event_receiver.is_terminated()
5633    }
5634}
5635
5636impl futures::Stream for RegistrarEventStream {
5637    type Item = Result<RegistrarEvent, fidl::Error>;
5638
5639    fn poll_next(
5640        mut self: std::pin::Pin<&mut Self>,
5641        cx: &mut std::task::Context<'_>,
5642    ) -> std::task::Poll<Option<Self::Item>> {
5643        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5644            &mut self.event_receiver,
5645            cx
5646        )?) {
5647            Some(buf) => std::task::Poll::Ready(Some(RegistrarEvent::decode(buf))),
5648            None => std::task::Poll::Ready(None),
5649        }
5650    }
5651}
5652
5653#[derive(Debug)]
5654pub enum RegistrarEvent {}
5655
5656impl RegistrarEvent {
5657    /// Decodes a message buffer as a [`RegistrarEvent`].
5658    fn decode(
5659        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5660    ) -> Result<RegistrarEvent, fidl::Error> {
5661        let (bytes, _handles) = buf.split_mut();
5662        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5663        debug_assert_eq!(tx_header.tx_id, 0);
5664        match tx_header.ordinal {
5665            _ => Err(fidl::Error::UnknownOrdinal {
5666                ordinal: tx_header.ordinal,
5667                protocol_name:
5668                    <RegistrarMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5669            }),
5670        }
5671    }
5672}
5673
5674/// A Stream of incoming requests for fuchsia.fuzzer/Registrar.
5675pub struct RegistrarRequestStream {
5676    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5677    is_terminated: bool,
5678}
5679
5680impl std::marker::Unpin for RegistrarRequestStream {}
5681
5682impl futures::stream::FusedStream for RegistrarRequestStream {
5683    fn is_terminated(&self) -> bool {
5684        self.is_terminated
5685    }
5686}
5687
5688impl fdomain_client::fidl::RequestStream for RegistrarRequestStream {
5689    type Protocol = RegistrarMarker;
5690    type ControlHandle = RegistrarControlHandle;
5691
5692    fn from_channel(channel: fdomain_client::Channel) -> Self {
5693        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5694    }
5695
5696    fn control_handle(&self) -> Self::ControlHandle {
5697        RegistrarControlHandle { inner: self.inner.clone() }
5698    }
5699
5700    fn into_inner(
5701        self,
5702    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5703    {
5704        (self.inner, self.is_terminated)
5705    }
5706
5707    fn from_inner(
5708        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5709        is_terminated: bool,
5710    ) -> Self {
5711        Self { inner, is_terminated }
5712    }
5713}
5714
5715impl futures::Stream for RegistrarRequestStream {
5716    type Item = Result<RegistrarRequest, fidl::Error>;
5717
5718    fn poll_next(
5719        mut self: std::pin::Pin<&mut Self>,
5720        cx: &mut std::task::Context<'_>,
5721    ) -> std::task::Poll<Option<Self::Item>> {
5722        let this = &mut *self;
5723        if this.inner.check_shutdown(cx) {
5724            this.is_terminated = true;
5725            return std::task::Poll::Ready(None);
5726        }
5727        if this.is_terminated {
5728            panic!("polled RegistrarRequestStream after completion");
5729        }
5730        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5731            |bytes, handles| {
5732                match this.inner.channel().read_etc(cx, bytes, handles) {
5733                    std::task::Poll::Ready(Ok(())) => {}
5734                    std::task::Poll::Pending => return std::task::Poll::Pending,
5735                    std::task::Poll::Ready(Err(None)) => {
5736                        this.is_terminated = true;
5737                        return std::task::Poll::Ready(None);
5738                    }
5739                    std::task::Poll::Ready(Err(Some(e))) => {
5740                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5741                            e.into(),
5742                        ))));
5743                    }
5744                }
5745
5746                // A message has been received from the channel
5747                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5748
5749                std::task::Poll::Ready(Some(match header.ordinal {
5750                    0x1716ac38e74b2840 => {
5751                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5752                        let mut req = fidl::new_empty!(
5753                            RegistrarRegisterRequest,
5754                            fdomain_client::fidl::FDomainResourceDialect
5755                        );
5756                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RegistrarRegisterRequest>(&header, _body_bytes, handles, &mut req)?;
5757                        let control_handle = RegistrarControlHandle { inner: this.inner.clone() };
5758                        Ok(RegistrarRequest::Register {
5759                            fuzzer_url: req.fuzzer_url,
5760                            provider: req.provider,
5761
5762                            responder: RegistrarRegisterResponder {
5763                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5764                                tx_id: header.tx_id,
5765                            },
5766                        })
5767                    }
5768                    _ => Err(fidl::Error::UnknownOrdinal {
5769                        ordinal: header.ordinal,
5770                        protocol_name:
5771                            <RegistrarMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5772                    }),
5773                }))
5774            },
5775        )
5776    }
5777}
5778
5779/// Entry point for the `fuzz_test_runner`. It uses this protocol to transfer
5780/// one end of a channel it creates to the `fuzz_manager`. The other end is
5781/// passed as a startup handle to the fuzzer component itself, which is used to
5782/// provide `Controller`s on request.
5783#[derive(Debug)]
5784pub enum RegistrarRequest {
5785    /// Adds a `ControllerProvider`. This should be called by the fuzzer itself,
5786    /// using the channel provided by the `fuzz_test_runner`, and in response to
5787    /// being started by the `fuzz_manager`.
5788    ///
5789    /// The registry will close the channel to the fuzzer on error, on a
5790    ///  corresponding call to `Registry.Disconnect`, or on exit. The fuzzer
5791    /// should exit when the channel closes.
5792    ///
5793    /// + request `fuzzer_url` the package URL for the fuzzer.
5794    /// + request `provider` the connection to a `ControllerProvider`.
5795    Register {
5796        fuzzer_url: String,
5797        provider: fdomain_client::fidl::ClientEnd<ControllerProviderMarker>,
5798        responder: RegistrarRegisterResponder,
5799    },
5800}
5801
5802impl RegistrarRequest {
5803    #[allow(irrefutable_let_patterns)]
5804    pub fn into_register(
5805        self,
5806    ) -> Option<(
5807        String,
5808        fdomain_client::fidl::ClientEnd<ControllerProviderMarker>,
5809        RegistrarRegisterResponder,
5810    )> {
5811        if let RegistrarRequest::Register { fuzzer_url, provider, responder } = self {
5812            Some((fuzzer_url, provider, responder))
5813        } else {
5814            None
5815        }
5816    }
5817
5818    /// Name of the method defined in FIDL
5819    pub fn method_name(&self) -> &'static str {
5820        match *self {
5821            RegistrarRequest::Register { .. } => "register",
5822        }
5823    }
5824}
5825
5826#[derive(Debug, Clone)]
5827pub struct RegistrarControlHandle {
5828    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5829}
5830
5831impl fdomain_client::fidl::ControlHandle for RegistrarControlHandle {
5832    fn shutdown(&self) {
5833        self.inner.shutdown()
5834    }
5835
5836    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5837        self.inner.shutdown_with_epitaph(status)
5838    }
5839
5840    fn is_closed(&self) -> bool {
5841        self.inner.channel().is_closed()
5842    }
5843    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5844        self.inner.channel().on_closed()
5845    }
5846}
5847
5848impl RegistrarControlHandle {}
5849
5850#[must_use = "FIDL methods require a response to be sent"]
5851#[derive(Debug)]
5852pub struct RegistrarRegisterResponder {
5853    control_handle: std::mem::ManuallyDrop<RegistrarControlHandle>,
5854    tx_id: u32,
5855}
5856
5857/// Set the the channel to be shutdown (see [`RegistrarControlHandle::shutdown`])
5858/// if the responder is dropped without sending a response, so that the client
5859/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5860impl std::ops::Drop for RegistrarRegisterResponder {
5861    fn drop(&mut self) {
5862        self.control_handle.shutdown();
5863        // Safety: drops once, never accessed again
5864        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5865    }
5866}
5867
5868impl fdomain_client::fidl::Responder for RegistrarRegisterResponder {
5869    type ControlHandle = RegistrarControlHandle;
5870
5871    fn control_handle(&self) -> &RegistrarControlHandle {
5872        &self.control_handle
5873    }
5874
5875    fn drop_without_shutdown(mut self) {
5876        // Safety: drops once, never accessed again due to mem::forget
5877        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5878        // Prevent Drop from running (which would shut down the channel)
5879        std::mem::forget(self);
5880    }
5881}
5882
5883impl RegistrarRegisterResponder {
5884    /// Sends a response to the FIDL transaction.
5885    ///
5886    /// Sets the channel to shutdown if an error occurs.
5887    pub fn send(self) -> Result<(), fidl::Error> {
5888        let _result = self.send_raw();
5889        if _result.is_err() {
5890            self.control_handle.shutdown();
5891        }
5892        self.drop_without_shutdown();
5893        _result
5894    }
5895
5896    /// Similar to "send" but does not shutdown the channel if an error occurs.
5897    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
5898        let _result = self.send_raw();
5899        self.drop_without_shutdown();
5900        _result
5901    }
5902
5903    fn send_raw(&self) -> Result<(), fidl::Error> {
5904        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
5905            (),
5906            self.tx_id,
5907            0x1716ac38e74b2840,
5908            fidl::encoding::DynamicFlags::empty(),
5909        )
5910    }
5911}
5912
5913#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5914pub struct RegistryMarker;
5915
5916impl fdomain_client::fidl::ProtocolMarker for RegistryMarker {
5917    type Proxy = RegistryProxy;
5918    type RequestStream = RegistryRequestStream;
5919
5920    const DEBUG_NAME: &'static str = "fuchsia.fuzzer.Registry";
5921}
5922impl fdomain_client::fidl::DiscoverableProtocolMarker for RegistryMarker {}
5923pub type RegistryConnectResult = Result<(), i32>;
5924pub type RegistryDisconnectResult = Result<(), i32>;
5925
5926pub trait RegistryProxyInterface: Send + Sync {
5927    type ConnectResponseFut: std::future::Future<Output = Result<RegistryConnectResult, fidl::Error>>
5928        + Send;
5929    fn r#connect(
5930        &self,
5931        fuzzer_url: &str,
5932        controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
5933        timeout: i64,
5934    ) -> Self::ConnectResponseFut;
5935    type DisconnectResponseFut: std::future::Future<Output = Result<RegistryDisconnectResult, fidl::Error>>
5936        + Send;
5937    fn r#disconnect(&self, fuzzer_url: &str) -> Self::DisconnectResponseFut;
5938}
5939
5940#[derive(Debug, Clone)]
5941pub struct RegistryProxy {
5942    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5943}
5944
5945impl fdomain_client::fidl::Proxy for RegistryProxy {
5946    type Protocol = RegistryMarker;
5947
5948    fn from_channel(inner: fdomain_client::Channel) -> Self {
5949        Self::new(inner)
5950    }
5951
5952    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5953        self.client.into_channel().map_err(|client| Self { client })
5954    }
5955
5956    fn as_channel(&self) -> &fdomain_client::Channel {
5957        self.client.as_channel()
5958    }
5959}
5960
5961impl RegistryProxy {
5962    /// Create a new Proxy for fuchsia.fuzzer/Registry.
5963    pub fn new(channel: fdomain_client::Channel) -> Self {
5964        let protocol_name = <RegistryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5965        Self { client: fidl::client::Client::new(channel, protocol_name) }
5966    }
5967
5968    /// Get a Stream of events from the remote end of the protocol.
5969    ///
5970    /// # Panics
5971    ///
5972    /// Panics if the event stream was already taken.
5973    pub fn take_event_stream(&self) -> RegistryEventStream {
5974        RegistryEventStream { event_receiver: self.client.take_event_receiver() }
5975    }
5976
5977    /// Connects the `Controller` to a registered fuzzer.
5978    ///
5979    /// Uses a `ControllerProvider` that has been `Register`ed with the given
5980    /// URL to connect. If the associated provider is not available, it assumes
5981    /// it is starting and blocks until the fuzzer calls `Registrar.Register`,
5982    /// or the given `timeout` elapses. At most one call to `Connect` will block
5983    /// in this manner at a time.
5984    ///
5985    /// + request `fuzzer_url` the package URL for the fuzzer.
5986    /// + request `provider` the connection to a `Controller` client.
5987    /// + request `tiemout` maximum duration to wait for a connection.
5988    /// * error one of the following:
5989    ///     * `ZX_ERR_TIMED_OUT` if the `timeout` elapses without the provider
5990    ///       becoming available.
5991    ///     * `ZX_ERR_SHOULD_WAIT` if already waiting for a fuzzer to start.
5992    pub fn r#connect(
5993        &self,
5994        mut fuzzer_url: &str,
5995        mut controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
5996        mut timeout: i64,
5997    ) -> fidl::client::QueryResponseFut<
5998        RegistryConnectResult,
5999        fdomain_client::fidl::FDomainResourceDialect,
6000    > {
6001        RegistryProxyInterface::r#connect(self, fuzzer_url, controller, timeout)
6002    }
6003
6004    /// Removes the provider associated with the given URL from the registry and
6005    /// closes its channel. The associated fuzzer should exit upon channel
6006    /// closure.
6007    ///
6008    /// + request `fuzzer_url` the package URL for the fuzzer.
6009    /// * error `ZX_ERR_NOT_FOUND` if no such provider exists in the registry.
6010    pub fn r#disconnect(
6011        &self,
6012        mut fuzzer_url: &str,
6013    ) -> fidl::client::QueryResponseFut<
6014        RegistryDisconnectResult,
6015        fdomain_client::fidl::FDomainResourceDialect,
6016    > {
6017        RegistryProxyInterface::r#disconnect(self, fuzzer_url)
6018    }
6019}
6020
6021impl RegistryProxyInterface for RegistryProxy {
6022    type ConnectResponseFut = fidl::client::QueryResponseFut<
6023        RegistryConnectResult,
6024        fdomain_client::fidl::FDomainResourceDialect,
6025    >;
6026    fn r#connect(
6027        &self,
6028        mut fuzzer_url: &str,
6029        mut controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
6030        mut timeout: i64,
6031    ) -> Self::ConnectResponseFut {
6032        fn _decode(
6033            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6034        ) -> Result<RegistryConnectResult, fidl::Error> {
6035            let _response = fidl::client::decode_transaction_body::<
6036                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6037                fdomain_client::fidl::FDomainResourceDialect,
6038                0x5128cb31967a446f,
6039            >(_buf?)?;
6040            Ok(_response.map(|x| x))
6041        }
6042        self.client.send_query_and_decode::<RegistryConnectRequest, RegistryConnectResult>(
6043            (fuzzer_url, controller, timeout),
6044            0x5128cb31967a446f,
6045            fidl::encoding::DynamicFlags::empty(),
6046            _decode,
6047        )
6048    }
6049
6050    type DisconnectResponseFut = fidl::client::QueryResponseFut<
6051        RegistryDisconnectResult,
6052        fdomain_client::fidl::FDomainResourceDialect,
6053    >;
6054    fn r#disconnect(&self, mut fuzzer_url: &str) -> Self::DisconnectResponseFut {
6055        fn _decode(
6056            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6057        ) -> Result<RegistryDisconnectResult, fidl::Error> {
6058            let _response = fidl::client::decode_transaction_body::<
6059                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6060                fdomain_client::fidl::FDomainResourceDialect,
6061                0x7bb4b7591146d4cb,
6062            >(_buf?)?;
6063            Ok(_response.map(|x| x))
6064        }
6065        self.client.send_query_and_decode::<RegistryDisconnectRequest, RegistryDisconnectResult>(
6066            (fuzzer_url,),
6067            0x7bb4b7591146d4cb,
6068            fidl::encoding::DynamicFlags::empty(),
6069            _decode,
6070        )
6071    }
6072}
6073
6074pub struct RegistryEventStream {
6075    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
6076}
6077
6078impl std::marker::Unpin for RegistryEventStream {}
6079
6080impl futures::stream::FusedStream for RegistryEventStream {
6081    fn is_terminated(&self) -> bool {
6082        self.event_receiver.is_terminated()
6083    }
6084}
6085
6086impl futures::Stream for RegistryEventStream {
6087    type Item = Result<RegistryEvent, fidl::Error>;
6088
6089    fn poll_next(
6090        mut self: std::pin::Pin<&mut Self>,
6091        cx: &mut std::task::Context<'_>,
6092    ) -> std::task::Poll<Option<Self::Item>> {
6093        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6094            &mut self.event_receiver,
6095            cx
6096        )?) {
6097            Some(buf) => std::task::Poll::Ready(Some(RegistryEvent::decode(buf))),
6098            None => std::task::Poll::Ready(None),
6099        }
6100    }
6101}
6102
6103#[derive(Debug)]
6104pub enum RegistryEvent {}
6105
6106impl RegistryEvent {
6107    /// Decodes a message buffer as a [`RegistryEvent`].
6108    fn decode(
6109        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6110    ) -> Result<RegistryEvent, fidl::Error> {
6111        let (bytes, _handles) = buf.split_mut();
6112        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6113        debug_assert_eq!(tx_header.tx_id, 0);
6114        match tx_header.ordinal {
6115            _ => Err(fidl::Error::UnknownOrdinal {
6116                ordinal: tx_header.ordinal,
6117                protocol_name: <RegistryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6118            }),
6119        }
6120    }
6121}
6122
6123/// A Stream of incoming requests for fuchsia.fuzzer/Registry.
6124pub struct RegistryRequestStream {
6125    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6126    is_terminated: bool,
6127}
6128
6129impl std::marker::Unpin for RegistryRequestStream {}
6130
6131impl futures::stream::FusedStream for RegistryRequestStream {
6132    fn is_terminated(&self) -> bool {
6133        self.is_terminated
6134    }
6135}
6136
6137impl fdomain_client::fidl::RequestStream for RegistryRequestStream {
6138    type Protocol = RegistryMarker;
6139    type ControlHandle = RegistryControlHandle;
6140
6141    fn from_channel(channel: fdomain_client::Channel) -> Self {
6142        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6143    }
6144
6145    fn control_handle(&self) -> Self::ControlHandle {
6146        RegistryControlHandle { inner: self.inner.clone() }
6147    }
6148
6149    fn into_inner(
6150        self,
6151    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
6152    {
6153        (self.inner, self.is_terminated)
6154    }
6155
6156    fn from_inner(
6157        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6158        is_terminated: bool,
6159    ) -> Self {
6160        Self { inner, is_terminated }
6161    }
6162}
6163
6164impl futures::Stream for RegistryRequestStream {
6165    type Item = Result<RegistryRequest, fidl::Error>;
6166
6167    fn poll_next(
6168        mut self: std::pin::Pin<&mut Self>,
6169        cx: &mut std::task::Context<'_>,
6170    ) -> std::task::Poll<Option<Self::Item>> {
6171        let this = &mut *self;
6172        if this.inner.check_shutdown(cx) {
6173            this.is_terminated = true;
6174            return std::task::Poll::Ready(None);
6175        }
6176        if this.is_terminated {
6177            panic!("polled RegistryRequestStream after completion");
6178        }
6179        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
6180            |bytes, handles| {
6181                match this.inner.channel().read_etc(cx, bytes, handles) {
6182                    std::task::Poll::Ready(Ok(())) => {}
6183                    std::task::Poll::Pending => return std::task::Poll::Pending,
6184                    std::task::Poll::Ready(Err(None)) => {
6185                        this.is_terminated = true;
6186                        return std::task::Poll::Ready(None);
6187                    }
6188                    std::task::Poll::Ready(Err(Some(e))) => {
6189                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6190                            e.into(),
6191                        ))));
6192                    }
6193                }
6194
6195                // A message has been received from the channel
6196                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6197
6198                std::task::Poll::Ready(Some(match header.ordinal {
6199                    0x5128cb31967a446f => {
6200                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6201                        let mut req = fidl::new_empty!(
6202                            RegistryConnectRequest,
6203                            fdomain_client::fidl::FDomainResourceDialect
6204                        );
6205                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RegistryConnectRequest>(&header, _body_bytes, handles, &mut req)?;
6206                        let control_handle = RegistryControlHandle { inner: this.inner.clone() };
6207                        Ok(RegistryRequest::Connect {
6208                            fuzzer_url: req.fuzzer_url,
6209                            controller: req.controller,
6210                            timeout: req.timeout,
6211
6212                            responder: RegistryConnectResponder {
6213                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6214                                tx_id: header.tx_id,
6215                            },
6216                        })
6217                    }
6218                    0x7bb4b7591146d4cb => {
6219                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6220                        let mut req = fidl::new_empty!(
6221                            RegistryDisconnectRequest,
6222                            fdomain_client::fidl::FDomainResourceDialect
6223                        );
6224                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RegistryDisconnectRequest>(&header, _body_bytes, handles, &mut req)?;
6225                        let control_handle = RegistryControlHandle { inner: this.inner.clone() };
6226                        Ok(RegistryRequest::Disconnect {
6227                            fuzzer_url: req.fuzzer_url,
6228
6229                            responder: RegistryDisconnectResponder {
6230                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6231                                tx_id: header.tx_id,
6232                            },
6233                        })
6234                    }
6235                    _ => Err(fidl::Error::UnknownOrdinal {
6236                        ordinal: header.ordinal,
6237                        protocol_name:
6238                            <RegistryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6239                    }),
6240                }))
6241            },
6242        )
6243    }
6244}
6245
6246/// Entry point for the `fuzz_manager`. It uses this protocol to wait for fuzz
6247/// tests started within the test runner framework to register a
6248/// `ControllerProvider`, and to stop those fuzzers upon request.
6249#[derive(Debug)]
6250pub enum RegistryRequest {
6251    /// Connects the `Controller` to a registered fuzzer.
6252    ///
6253    /// Uses a `ControllerProvider` that has been `Register`ed with the given
6254    /// URL to connect. If the associated provider is not available, it assumes
6255    /// it is starting and blocks until the fuzzer calls `Registrar.Register`,
6256    /// or the given `timeout` elapses. At most one call to `Connect` will block
6257    /// in this manner at a time.
6258    ///
6259    /// + request `fuzzer_url` the package URL for the fuzzer.
6260    /// + request `provider` the connection to a `Controller` client.
6261    /// + request `tiemout` maximum duration to wait for a connection.
6262    /// * error one of the following:
6263    ///     * `ZX_ERR_TIMED_OUT` if the `timeout` elapses without the provider
6264    ///       becoming available.
6265    ///     * `ZX_ERR_SHOULD_WAIT` if already waiting for a fuzzer to start.
6266    Connect {
6267        fuzzer_url: String,
6268        controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
6269        timeout: i64,
6270        responder: RegistryConnectResponder,
6271    },
6272    /// Removes the provider associated with the given URL from the registry and
6273    /// closes its channel. The associated fuzzer should exit upon channel
6274    /// closure.
6275    ///
6276    /// + request `fuzzer_url` the package URL for the fuzzer.
6277    /// * error `ZX_ERR_NOT_FOUND` if no such provider exists in the registry.
6278    Disconnect { fuzzer_url: String, responder: RegistryDisconnectResponder },
6279}
6280
6281impl RegistryRequest {
6282    #[allow(irrefutable_let_patterns)]
6283    pub fn into_connect(
6284        self,
6285    ) -> Option<(
6286        String,
6287        fdomain_client::fidl::ServerEnd<ControllerMarker>,
6288        i64,
6289        RegistryConnectResponder,
6290    )> {
6291        if let RegistryRequest::Connect { fuzzer_url, controller, timeout, responder } = self {
6292            Some((fuzzer_url, controller, timeout, responder))
6293        } else {
6294            None
6295        }
6296    }
6297
6298    #[allow(irrefutable_let_patterns)]
6299    pub fn into_disconnect(self) -> Option<(String, RegistryDisconnectResponder)> {
6300        if let RegistryRequest::Disconnect { fuzzer_url, responder } = self {
6301            Some((fuzzer_url, responder))
6302        } else {
6303            None
6304        }
6305    }
6306
6307    /// Name of the method defined in FIDL
6308    pub fn method_name(&self) -> &'static str {
6309        match *self {
6310            RegistryRequest::Connect { .. } => "connect",
6311            RegistryRequest::Disconnect { .. } => "disconnect",
6312        }
6313    }
6314}
6315
6316#[derive(Debug, Clone)]
6317pub struct RegistryControlHandle {
6318    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6319}
6320
6321impl fdomain_client::fidl::ControlHandle for RegistryControlHandle {
6322    fn shutdown(&self) {
6323        self.inner.shutdown()
6324    }
6325
6326    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6327        self.inner.shutdown_with_epitaph(status)
6328    }
6329
6330    fn is_closed(&self) -> bool {
6331        self.inner.channel().is_closed()
6332    }
6333    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
6334        self.inner.channel().on_closed()
6335    }
6336}
6337
6338impl RegistryControlHandle {}
6339
6340#[must_use = "FIDL methods require a response to be sent"]
6341#[derive(Debug)]
6342pub struct RegistryConnectResponder {
6343    control_handle: std::mem::ManuallyDrop<RegistryControlHandle>,
6344    tx_id: u32,
6345}
6346
6347/// Set the the channel to be shutdown (see [`RegistryControlHandle::shutdown`])
6348/// if the responder is dropped without sending a response, so that the client
6349/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6350impl std::ops::Drop for RegistryConnectResponder {
6351    fn drop(&mut self) {
6352        self.control_handle.shutdown();
6353        // Safety: drops once, never accessed again
6354        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6355    }
6356}
6357
6358impl fdomain_client::fidl::Responder for RegistryConnectResponder {
6359    type ControlHandle = RegistryControlHandle;
6360
6361    fn control_handle(&self) -> &RegistryControlHandle {
6362        &self.control_handle
6363    }
6364
6365    fn drop_without_shutdown(mut self) {
6366        // Safety: drops once, never accessed again due to mem::forget
6367        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6368        // Prevent Drop from running (which would shut down the channel)
6369        std::mem::forget(self);
6370    }
6371}
6372
6373impl RegistryConnectResponder {
6374    /// Sends a response to the FIDL transaction.
6375    ///
6376    /// Sets the channel to shutdown if an error occurs.
6377    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6378        let _result = self.send_raw(result);
6379        if _result.is_err() {
6380            self.control_handle.shutdown();
6381        }
6382        self.drop_without_shutdown();
6383        _result
6384    }
6385
6386    /// Similar to "send" but does not shutdown the channel if an error occurs.
6387    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6388        let _result = self.send_raw(result);
6389        self.drop_without_shutdown();
6390        _result
6391    }
6392
6393    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6394        self.control_handle
6395            .inner
6396            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6397                result,
6398                self.tx_id,
6399                0x5128cb31967a446f,
6400                fidl::encoding::DynamicFlags::empty(),
6401            )
6402    }
6403}
6404
6405#[must_use = "FIDL methods require a response to be sent"]
6406#[derive(Debug)]
6407pub struct RegistryDisconnectResponder {
6408    control_handle: std::mem::ManuallyDrop<RegistryControlHandle>,
6409    tx_id: u32,
6410}
6411
6412/// Set the the channel to be shutdown (see [`RegistryControlHandle::shutdown`])
6413/// if the responder is dropped without sending a response, so that the client
6414/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6415impl std::ops::Drop for RegistryDisconnectResponder {
6416    fn drop(&mut self) {
6417        self.control_handle.shutdown();
6418        // Safety: drops once, never accessed again
6419        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6420    }
6421}
6422
6423impl fdomain_client::fidl::Responder for RegistryDisconnectResponder {
6424    type ControlHandle = RegistryControlHandle;
6425
6426    fn control_handle(&self) -> &RegistryControlHandle {
6427        &self.control_handle
6428    }
6429
6430    fn drop_without_shutdown(mut self) {
6431        // Safety: drops once, never accessed again due to mem::forget
6432        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6433        // Prevent Drop from running (which would shut down the channel)
6434        std::mem::forget(self);
6435    }
6436}
6437
6438impl RegistryDisconnectResponder {
6439    /// Sends a response to the FIDL transaction.
6440    ///
6441    /// Sets the channel to shutdown if an error occurs.
6442    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6443        let _result = self.send_raw(result);
6444        if _result.is_err() {
6445            self.control_handle.shutdown();
6446        }
6447        self.drop_without_shutdown();
6448        _result
6449    }
6450
6451    /// Similar to "send" but does not shutdown the channel if an error occurs.
6452    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6453        let _result = self.send_raw(result);
6454        self.drop_without_shutdown();
6455        _result
6456    }
6457
6458    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6459        self.control_handle
6460            .inner
6461            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6462                result,
6463                self.tx_id,
6464                0x7bb4b7591146d4cb,
6465                fidl::encoding::DynamicFlags::empty(),
6466            )
6467    }
6468}
6469
6470#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6471pub struct TargetAdapterMarker;
6472
6473impl fdomain_client::fidl::ProtocolMarker for TargetAdapterMarker {
6474    type Proxy = TargetAdapterProxy;
6475    type RequestStream = TargetAdapterRequestStream;
6476
6477    const DEBUG_NAME: &'static str = "fuchsia.fuzzer.TargetAdapter";
6478}
6479impl fdomain_client::fidl::DiscoverableProtocolMarker for TargetAdapterMarker {}
6480
6481pub trait TargetAdapterProxyInterface: Send + Sync {
6482    type GetParametersResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>>
6483        + Send;
6484    fn r#get_parameters(&self) -> Self::GetParametersResponseFut;
6485    type ConnectResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
6486    fn r#connect(
6487        &self,
6488        eventpair: fdomain_client::EventPair,
6489        test_input: fdomain_client::Vmo,
6490    ) -> Self::ConnectResponseFut;
6491}
6492
6493#[derive(Debug, Clone)]
6494pub struct TargetAdapterProxy {
6495    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
6496}
6497
6498impl fdomain_client::fidl::Proxy for TargetAdapterProxy {
6499    type Protocol = TargetAdapterMarker;
6500
6501    fn from_channel(inner: fdomain_client::Channel) -> Self {
6502        Self::new(inner)
6503    }
6504
6505    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
6506        self.client.into_channel().map_err(|client| Self { client })
6507    }
6508
6509    fn as_channel(&self) -> &fdomain_client::Channel {
6510        self.client.as_channel()
6511    }
6512}
6513
6514impl TargetAdapterProxy {
6515    /// Create a new Proxy for fuchsia.fuzzer/TargetAdapter.
6516    pub fn new(channel: fdomain_client::Channel) -> Self {
6517        let protocol_name =
6518            <TargetAdapterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
6519        Self { client: fidl::client::Client::new(channel, protocol_name) }
6520    }
6521
6522    /// Get a Stream of events from the remote end of the protocol.
6523    ///
6524    /// # Panics
6525    ///
6526    /// Panics if the event stream was already taken.
6527    pub fn take_event_stream(&self) -> TargetAdapterEventStream {
6528        TargetAdapterEventStream { event_receiver: self.client.take_event_receiver() }
6529    }
6530
6531    /// Retrieves the target-specific fuzzer parameters, e.g. the package-
6532    /// relative location of seed corpora. These parameters are specific to
6533    /// individual fuzzers, and are used by both the fuzzing engine and the
6534    /// "test-engine" used to create fuzzer unit tests. For these reasons, it is
6535    /// most convenient for fuzzer authors to specify them as part of the
6536    /// (fuzzer-specific) target adapter's component manifest file, and have the
6537    /// engine and test-engine retrieve them via this method.
6538    ///
6539    /// - response `parameters` the command line parameters from a specific
6540    ///   fuzzer's component manifest.
6541    pub fn r#get_parameters(
6542        &self,
6543    ) -> fidl::client::QueryResponseFut<Vec<String>, fdomain_client::fidl::FDomainResourceDialect>
6544    {
6545        TargetAdapterProxyInterface::r#get_parameters(self)
6546    }
6547
6548    /// Provides the eventpair used by driver and adapter to signal each other,
6549    /// and the shared VMO used to provide test inputs to the adapter. The VMO
6550    /// must have the `ZX_PROP_VMO_CONTENT_SIZE` property set.
6551    ///
6552    /// + request `eventpair` the eventpair used to signal when fuzzing runs
6553    ///   start and stop.
6554    /// + request `test_input` the shared VMO used by the engine to provide byte
6555    ///   sequences to test.
6556    pub fn r#connect(
6557        &self,
6558        mut eventpair: fdomain_client::EventPair,
6559        mut test_input: fdomain_client::Vmo,
6560    ) -> fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect> {
6561        TargetAdapterProxyInterface::r#connect(self, eventpair, test_input)
6562    }
6563}
6564
6565impl TargetAdapterProxyInterface for TargetAdapterProxy {
6566    type GetParametersResponseFut =
6567        fidl::client::QueryResponseFut<Vec<String>, fdomain_client::fidl::FDomainResourceDialect>;
6568    fn r#get_parameters(&self) -> Self::GetParametersResponseFut {
6569        fn _decode(
6570            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6571        ) -> Result<Vec<String>, fidl::Error> {
6572            let _response = fidl::client::decode_transaction_body::<
6573                TargetAdapterGetParametersResponse,
6574                fdomain_client::fidl::FDomainResourceDialect,
6575                0x5c7e40a47f753e3e,
6576            >(_buf?)?;
6577            Ok(_response.parameters)
6578        }
6579        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
6580            (),
6581            0x5c7e40a47f753e3e,
6582            fidl::encoding::DynamicFlags::empty(),
6583            _decode,
6584        )
6585    }
6586
6587    type ConnectResponseFut =
6588        fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect>;
6589    fn r#connect(
6590        &self,
6591        mut eventpair: fdomain_client::EventPair,
6592        mut test_input: fdomain_client::Vmo,
6593    ) -> Self::ConnectResponseFut {
6594        fn _decode(
6595            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6596        ) -> Result<(), fidl::Error> {
6597            let _response = fidl::client::decode_transaction_body::<
6598                fidl::encoding::EmptyPayload,
6599                fdomain_client::fidl::FDomainResourceDialect,
6600                0x7ea603a119866618,
6601            >(_buf?)?;
6602            Ok(_response)
6603        }
6604        self.client.send_query_and_decode::<TargetAdapterConnectRequest, ()>(
6605            (eventpair, test_input),
6606            0x7ea603a119866618,
6607            fidl::encoding::DynamicFlags::empty(),
6608            _decode,
6609        )
6610    }
6611}
6612
6613pub struct TargetAdapterEventStream {
6614    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
6615}
6616
6617impl std::marker::Unpin for TargetAdapterEventStream {}
6618
6619impl futures::stream::FusedStream for TargetAdapterEventStream {
6620    fn is_terminated(&self) -> bool {
6621        self.event_receiver.is_terminated()
6622    }
6623}
6624
6625impl futures::Stream for TargetAdapterEventStream {
6626    type Item = Result<TargetAdapterEvent, fidl::Error>;
6627
6628    fn poll_next(
6629        mut self: std::pin::Pin<&mut Self>,
6630        cx: &mut std::task::Context<'_>,
6631    ) -> std::task::Poll<Option<Self::Item>> {
6632        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6633            &mut self.event_receiver,
6634            cx
6635        )?) {
6636            Some(buf) => std::task::Poll::Ready(Some(TargetAdapterEvent::decode(buf))),
6637            None => std::task::Poll::Ready(None),
6638        }
6639    }
6640}
6641
6642#[derive(Debug)]
6643pub enum TargetAdapterEvent {}
6644
6645impl TargetAdapterEvent {
6646    /// Decodes a message buffer as a [`TargetAdapterEvent`].
6647    fn decode(
6648        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6649    ) -> Result<TargetAdapterEvent, fidl::Error> {
6650        let (bytes, _handles) = buf.split_mut();
6651        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6652        debug_assert_eq!(tx_header.tx_id, 0);
6653        match tx_header.ordinal {
6654            _ => Err(fidl::Error::UnknownOrdinal {
6655                ordinal: tx_header.ordinal,
6656                protocol_name:
6657                    <TargetAdapterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6658            }),
6659        }
6660    }
6661}
6662
6663/// A Stream of incoming requests for fuchsia.fuzzer/TargetAdapter.
6664pub struct TargetAdapterRequestStream {
6665    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6666    is_terminated: bool,
6667}
6668
6669impl std::marker::Unpin for TargetAdapterRequestStream {}
6670
6671impl futures::stream::FusedStream for TargetAdapterRequestStream {
6672    fn is_terminated(&self) -> bool {
6673        self.is_terminated
6674    }
6675}
6676
6677impl fdomain_client::fidl::RequestStream for TargetAdapterRequestStream {
6678    type Protocol = TargetAdapterMarker;
6679    type ControlHandle = TargetAdapterControlHandle;
6680
6681    fn from_channel(channel: fdomain_client::Channel) -> Self {
6682        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6683    }
6684
6685    fn control_handle(&self) -> Self::ControlHandle {
6686        TargetAdapterControlHandle { inner: self.inner.clone() }
6687    }
6688
6689    fn into_inner(
6690        self,
6691    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
6692    {
6693        (self.inner, self.is_terminated)
6694    }
6695
6696    fn from_inner(
6697        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6698        is_terminated: bool,
6699    ) -> Self {
6700        Self { inner, is_terminated }
6701    }
6702}
6703
6704impl futures::Stream for TargetAdapterRequestStream {
6705    type Item = Result<TargetAdapterRequest, fidl::Error>;
6706
6707    fn poll_next(
6708        mut self: std::pin::Pin<&mut Self>,
6709        cx: &mut std::task::Context<'_>,
6710    ) -> std::task::Poll<Option<Self::Item>> {
6711        let this = &mut *self;
6712        if this.inner.check_shutdown(cx) {
6713            this.is_terminated = true;
6714            return std::task::Poll::Ready(None);
6715        }
6716        if this.is_terminated {
6717            panic!("polled TargetAdapterRequestStream after completion");
6718        }
6719        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
6720            |bytes, handles| {
6721                match this.inner.channel().read_etc(cx, bytes, handles) {
6722                    std::task::Poll::Ready(Ok(())) => {}
6723                    std::task::Poll::Pending => return std::task::Poll::Pending,
6724                    std::task::Poll::Ready(Err(None)) => {
6725                        this.is_terminated = true;
6726                        return std::task::Poll::Ready(None);
6727                    }
6728                    std::task::Poll::Ready(Err(Some(e))) => {
6729                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6730                            e.into(),
6731                        ))));
6732                    }
6733                }
6734
6735                // A message has been received from the channel
6736                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6737
6738                std::task::Poll::Ready(Some(match header.ordinal {
6739                0x5c7e40a47f753e3e => {
6740                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6741                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
6742                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6743                    let control_handle = TargetAdapterControlHandle {
6744                        inner: this.inner.clone(),
6745                    };
6746                    Ok(TargetAdapterRequest::GetParameters {
6747                        responder: TargetAdapterGetParametersResponder {
6748                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6749                            tx_id: header.tx_id,
6750                        },
6751                    })
6752                }
6753                0x7ea603a119866618 => {
6754                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6755                    let mut req = fidl::new_empty!(TargetAdapterConnectRequest, fdomain_client::fidl::FDomainResourceDialect);
6756                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<TargetAdapterConnectRequest>(&header, _body_bytes, handles, &mut req)?;
6757                    let control_handle = TargetAdapterControlHandle {
6758                        inner: this.inner.clone(),
6759                    };
6760                    Ok(TargetAdapterRequest::Connect {eventpair: req.eventpair,
6761test_input: req.test_input,
6762
6763                        responder: TargetAdapterConnectResponder {
6764                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6765                            tx_id: header.tx_id,
6766                        },
6767                    })
6768                }
6769                _ => Err(fidl::Error::UnknownOrdinal {
6770                    ordinal: header.ordinal,
6771                    protocol_name: <TargetAdapterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6772                }),
6773            }))
6774            },
6775        )
6776    }
6777}
6778
6779/// Maps test inputs to specific behaviors in the target code, e.g. by invoking
6780/// APIs, making FIDL calls. etc. The adapter includes the target-specific code
6781/// often referred to as the "fuzz target function".
6782///
6783/// See also:
6784///
6785/// * https://llvm.org/docs/LibFuzzer.html#fuzz-target
6786#[derive(Debug)]
6787pub enum TargetAdapterRequest {
6788    /// Retrieves the target-specific fuzzer parameters, e.g. the package-
6789    /// relative location of seed corpora. These parameters are specific to
6790    /// individual fuzzers, and are used by both the fuzzing engine and the
6791    /// "test-engine" used to create fuzzer unit tests. For these reasons, it is
6792    /// most convenient for fuzzer authors to specify them as part of the
6793    /// (fuzzer-specific) target adapter's component manifest file, and have the
6794    /// engine and test-engine retrieve them via this method.
6795    ///
6796    /// - response `parameters` the command line parameters from a specific
6797    ///   fuzzer's component manifest.
6798    GetParameters { responder: TargetAdapterGetParametersResponder },
6799    /// Provides the eventpair used by driver and adapter to signal each other,
6800    /// and the shared VMO used to provide test inputs to the adapter. The VMO
6801    /// must have the `ZX_PROP_VMO_CONTENT_SIZE` property set.
6802    ///
6803    /// + request `eventpair` the eventpair used to signal when fuzzing runs
6804    ///   start and stop.
6805    /// + request `test_input` the shared VMO used by the engine to provide byte
6806    ///   sequences to test.
6807    Connect {
6808        eventpair: fdomain_client::EventPair,
6809        test_input: fdomain_client::Vmo,
6810        responder: TargetAdapterConnectResponder,
6811    },
6812}
6813
6814impl TargetAdapterRequest {
6815    #[allow(irrefutable_let_patterns)]
6816    pub fn into_get_parameters(self) -> Option<(TargetAdapterGetParametersResponder)> {
6817        if let TargetAdapterRequest::GetParameters { responder } = self {
6818            Some((responder))
6819        } else {
6820            None
6821        }
6822    }
6823
6824    #[allow(irrefutable_let_patterns)]
6825    pub fn into_connect(
6826        self,
6827    ) -> Option<(fdomain_client::EventPair, fdomain_client::Vmo, TargetAdapterConnectResponder)>
6828    {
6829        if let TargetAdapterRequest::Connect { eventpair, test_input, responder } = self {
6830            Some((eventpair, test_input, responder))
6831        } else {
6832            None
6833        }
6834    }
6835
6836    /// Name of the method defined in FIDL
6837    pub fn method_name(&self) -> &'static str {
6838        match *self {
6839            TargetAdapterRequest::GetParameters { .. } => "get_parameters",
6840            TargetAdapterRequest::Connect { .. } => "connect",
6841        }
6842    }
6843}
6844
6845#[derive(Debug, Clone)]
6846pub struct TargetAdapterControlHandle {
6847    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6848}
6849
6850impl fdomain_client::fidl::ControlHandle for TargetAdapterControlHandle {
6851    fn shutdown(&self) {
6852        self.inner.shutdown()
6853    }
6854
6855    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6856        self.inner.shutdown_with_epitaph(status)
6857    }
6858
6859    fn is_closed(&self) -> bool {
6860        self.inner.channel().is_closed()
6861    }
6862    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
6863        self.inner.channel().on_closed()
6864    }
6865}
6866
6867impl TargetAdapterControlHandle {}
6868
6869#[must_use = "FIDL methods require a response to be sent"]
6870#[derive(Debug)]
6871pub struct TargetAdapterGetParametersResponder {
6872    control_handle: std::mem::ManuallyDrop<TargetAdapterControlHandle>,
6873    tx_id: u32,
6874}
6875
6876/// Set the the channel to be shutdown (see [`TargetAdapterControlHandle::shutdown`])
6877/// if the responder is dropped without sending a response, so that the client
6878/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6879impl std::ops::Drop for TargetAdapterGetParametersResponder {
6880    fn drop(&mut self) {
6881        self.control_handle.shutdown();
6882        // Safety: drops once, never accessed again
6883        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6884    }
6885}
6886
6887impl fdomain_client::fidl::Responder for TargetAdapterGetParametersResponder {
6888    type ControlHandle = TargetAdapterControlHandle;
6889
6890    fn control_handle(&self) -> &TargetAdapterControlHandle {
6891        &self.control_handle
6892    }
6893
6894    fn drop_without_shutdown(mut self) {
6895        // Safety: drops once, never accessed again due to mem::forget
6896        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6897        // Prevent Drop from running (which would shut down the channel)
6898        std::mem::forget(self);
6899    }
6900}
6901
6902impl TargetAdapterGetParametersResponder {
6903    /// Sends a response to the FIDL transaction.
6904    ///
6905    /// Sets the channel to shutdown if an error occurs.
6906    pub fn send(self, mut parameters: &[String]) -> Result<(), fidl::Error> {
6907        let _result = self.send_raw(parameters);
6908        if _result.is_err() {
6909            self.control_handle.shutdown();
6910        }
6911        self.drop_without_shutdown();
6912        _result
6913    }
6914
6915    /// Similar to "send" but does not shutdown the channel if an error occurs.
6916    pub fn send_no_shutdown_on_err(self, mut parameters: &[String]) -> Result<(), fidl::Error> {
6917        let _result = self.send_raw(parameters);
6918        self.drop_without_shutdown();
6919        _result
6920    }
6921
6922    fn send_raw(&self, mut parameters: &[String]) -> Result<(), fidl::Error> {
6923        self.control_handle.inner.send::<TargetAdapterGetParametersResponse>(
6924            (parameters,),
6925            self.tx_id,
6926            0x5c7e40a47f753e3e,
6927            fidl::encoding::DynamicFlags::empty(),
6928        )
6929    }
6930}
6931
6932#[must_use = "FIDL methods require a response to be sent"]
6933#[derive(Debug)]
6934pub struct TargetAdapterConnectResponder {
6935    control_handle: std::mem::ManuallyDrop<TargetAdapterControlHandle>,
6936    tx_id: u32,
6937}
6938
6939/// Set the the channel to be shutdown (see [`TargetAdapterControlHandle::shutdown`])
6940/// if the responder is dropped without sending a response, so that the client
6941/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6942impl std::ops::Drop for TargetAdapterConnectResponder {
6943    fn drop(&mut self) {
6944        self.control_handle.shutdown();
6945        // Safety: drops once, never accessed again
6946        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6947    }
6948}
6949
6950impl fdomain_client::fidl::Responder for TargetAdapterConnectResponder {
6951    type ControlHandle = TargetAdapterControlHandle;
6952
6953    fn control_handle(&self) -> &TargetAdapterControlHandle {
6954        &self.control_handle
6955    }
6956
6957    fn drop_without_shutdown(mut self) {
6958        // Safety: drops once, never accessed again due to mem::forget
6959        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6960        // Prevent Drop from running (which would shut down the channel)
6961        std::mem::forget(self);
6962    }
6963}
6964
6965impl TargetAdapterConnectResponder {
6966    /// Sends a response to the FIDL transaction.
6967    ///
6968    /// Sets the channel to shutdown if an error occurs.
6969    pub fn send(self) -> Result<(), fidl::Error> {
6970        let _result = self.send_raw();
6971        if _result.is_err() {
6972            self.control_handle.shutdown();
6973        }
6974        self.drop_without_shutdown();
6975        _result
6976    }
6977
6978    /// Similar to "send" but does not shutdown the channel if an error occurs.
6979    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
6980        let _result = self.send_raw();
6981        self.drop_without_shutdown();
6982        _result
6983    }
6984
6985    fn send_raw(&self) -> Result<(), fidl::Error> {
6986        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
6987            (),
6988            self.tx_id,
6989            0x7ea603a119866618,
6990            fidl::encoding::DynamicFlags::empty(),
6991        )
6992    }
6993}
6994
6995mod internal {
6996    use super::*;
6997
6998    impl fidl::encoding::ResourceTypeMarker for ControllerAddMonitorRequest {
6999        type Borrowed<'a> = &'a mut Self;
7000        fn take_or_borrow<'a>(
7001            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7002        ) -> Self::Borrowed<'a> {
7003            value
7004        }
7005    }
7006
7007    unsafe impl fidl::encoding::TypeMarker for ControllerAddMonitorRequest {
7008        type Owned = Self;
7009
7010        #[inline(always)]
7011        fn inline_align(_context: fidl::encoding::Context) -> usize {
7012            4
7013        }
7014
7015        #[inline(always)]
7016        fn inline_size(_context: fidl::encoding::Context) -> usize {
7017            4
7018        }
7019    }
7020
7021    unsafe impl
7022        fidl::encoding::Encode<
7023            ControllerAddMonitorRequest,
7024            fdomain_client::fidl::FDomainResourceDialect,
7025        > for &mut ControllerAddMonitorRequest
7026    {
7027        #[inline]
7028        unsafe fn encode(
7029            self,
7030            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7031            offset: usize,
7032            _depth: fidl::encoding::Depth,
7033        ) -> fidl::Result<()> {
7034            encoder.debug_check_bounds::<ControllerAddMonitorRequest>(offset);
7035            // Delegate to tuple encoding.
7036            fidl::encoding::Encode::<ControllerAddMonitorRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
7037                (
7038                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<MonitorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.monitor),
7039                ),
7040                encoder, offset, _depth
7041            )
7042        }
7043    }
7044    unsafe impl<
7045        T0: fidl::encoding::Encode<
7046                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<MonitorMarker>>,
7047                fdomain_client::fidl::FDomainResourceDialect,
7048            >,
7049    >
7050        fidl::encoding::Encode<
7051            ControllerAddMonitorRequest,
7052            fdomain_client::fidl::FDomainResourceDialect,
7053        > for (T0,)
7054    {
7055        #[inline]
7056        unsafe fn encode(
7057            self,
7058            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7059            offset: usize,
7060            depth: fidl::encoding::Depth,
7061        ) -> fidl::Result<()> {
7062            encoder.debug_check_bounds::<ControllerAddMonitorRequest>(offset);
7063            // Zero out padding regions. There's no need to apply masks
7064            // because the unmasked parts will be overwritten by fields.
7065            // Write the fields.
7066            self.0.encode(encoder, offset + 0, depth)?;
7067            Ok(())
7068        }
7069    }
7070
7071    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7072        for ControllerAddMonitorRequest
7073    {
7074        #[inline(always)]
7075        fn new_empty() -> Self {
7076            Self {
7077                monitor: fidl::new_empty!(
7078                    fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<MonitorMarker>>,
7079                    fdomain_client::fidl::FDomainResourceDialect
7080                ),
7081            }
7082        }
7083
7084        #[inline]
7085        unsafe fn decode(
7086            &mut self,
7087            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7088            offset: usize,
7089            _depth: fidl::encoding::Depth,
7090        ) -> fidl::Result<()> {
7091            decoder.debug_check_bounds::<Self>(offset);
7092            // Verify that padding bytes are zero.
7093            fidl::decode!(
7094                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<MonitorMarker>>,
7095                fdomain_client::fidl::FDomainResourceDialect,
7096                &mut self.monitor,
7097                decoder,
7098                offset + 0,
7099                _depth
7100            )?;
7101            Ok(())
7102        }
7103    }
7104
7105    impl fidl::encoding::ResourceTypeMarker for ControllerAddToCorpusRequest {
7106        type Borrowed<'a> = &'a mut Self;
7107        fn take_or_borrow<'a>(
7108            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7109        ) -> Self::Borrowed<'a> {
7110            value
7111        }
7112    }
7113
7114    unsafe impl fidl::encoding::TypeMarker for ControllerAddToCorpusRequest {
7115        type Owned = Self;
7116
7117        #[inline(always)]
7118        fn inline_align(_context: fidl::encoding::Context) -> usize {
7119            8
7120        }
7121
7122        #[inline(always)]
7123        fn inline_size(_context: fidl::encoding::Context) -> usize {
7124            24
7125        }
7126    }
7127
7128    unsafe impl
7129        fidl::encoding::Encode<
7130            ControllerAddToCorpusRequest,
7131            fdomain_client::fidl::FDomainResourceDialect,
7132        > for &mut ControllerAddToCorpusRequest
7133    {
7134        #[inline]
7135        unsafe fn encode(
7136            self,
7137            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7138            offset: usize,
7139            _depth: fidl::encoding::Depth,
7140        ) -> fidl::Result<()> {
7141            encoder.debug_check_bounds::<ControllerAddToCorpusRequest>(offset);
7142            // Delegate to tuple encoding.
7143            fidl::encoding::Encode::<
7144                ControllerAddToCorpusRequest,
7145                fdomain_client::fidl::FDomainResourceDialect,
7146            >::encode(
7147                (
7148                    <Corpus as fidl::encoding::ValueTypeMarker>::borrow(&self.corpus),
7149                    <Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.input),
7150                ),
7151                encoder,
7152                offset,
7153                _depth,
7154            )
7155        }
7156    }
7157    unsafe impl<
7158        T0: fidl::encoding::Encode<Corpus, fdomain_client::fidl::FDomainResourceDialect>,
7159        T1: fidl::encoding::Encode<Input, fdomain_client::fidl::FDomainResourceDialect>,
7160    >
7161        fidl::encoding::Encode<
7162            ControllerAddToCorpusRequest,
7163            fdomain_client::fidl::FDomainResourceDialect,
7164        > for (T0, T1)
7165    {
7166        #[inline]
7167        unsafe fn encode(
7168            self,
7169            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7170            offset: usize,
7171            depth: fidl::encoding::Depth,
7172        ) -> fidl::Result<()> {
7173            encoder.debug_check_bounds::<ControllerAddToCorpusRequest>(offset);
7174            // Zero out padding regions. There's no need to apply masks
7175            // because the unmasked parts will be overwritten by fields.
7176            unsafe {
7177                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7178                (ptr as *mut u64).write_unaligned(0);
7179            }
7180            // Write the fields.
7181            self.0.encode(encoder, offset + 0, depth)?;
7182            self.1.encode(encoder, offset + 8, depth)?;
7183            Ok(())
7184        }
7185    }
7186
7187    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7188        for ControllerAddToCorpusRequest
7189    {
7190        #[inline(always)]
7191        fn new_empty() -> Self {
7192            Self {
7193                corpus: fidl::new_empty!(Corpus, fdomain_client::fidl::FDomainResourceDialect),
7194                input: fidl::new_empty!(Input, fdomain_client::fidl::FDomainResourceDialect),
7195            }
7196        }
7197
7198        #[inline]
7199        unsafe fn decode(
7200            &mut self,
7201            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7202            offset: usize,
7203            _depth: fidl::encoding::Depth,
7204        ) -> fidl::Result<()> {
7205            decoder.debug_check_bounds::<Self>(offset);
7206            // Verify that padding bytes are zero.
7207            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7208            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7209            let mask = 0xffffffffffffff00u64;
7210            let maskedval = padval & mask;
7211            if maskedval != 0 {
7212                return Err(fidl::Error::NonZeroPadding {
7213                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7214                });
7215            }
7216            fidl::decode!(
7217                Corpus,
7218                fdomain_client::fidl::FDomainResourceDialect,
7219                &mut self.corpus,
7220                decoder,
7221                offset + 0,
7222                _depth
7223            )?;
7224            fidl::decode!(
7225                Input,
7226                fdomain_client::fidl::FDomainResourceDialect,
7227                &mut self.input,
7228                decoder,
7229                offset + 8,
7230                _depth
7231            )?;
7232            Ok(())
7233        }
7234    }
7235
7236    impl fidl::encoding::ResourceTypeMarker for ControllerCleanseRequest {
7237        type Borrowed<'a> = &'a mut Self;
7238        fn take_or_borrow<'a>(
7239            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7240        ) -> Self::Borrowed<'a> {
7241            value
7242        }
7243    }
7244
7245    unsafe impl fidl::encoding::TypeMarker for ControllerCleanseRequest {
7246        type Owned = Self;
7247
7248        #[inline(always)]
7249        fn inline_align(_context: fidl::encoding::Context) -> usize {
7250            8
7251        }
7252
7253        #[inline(always)]
7254        fn inline_size(_context: fidl::encoding::Context) -> usize {
7255            16
7256        }
7257    }
7258
7259    unsafe impl
7260        fidl::encoding::Encode<
7261            ControllerCleanseRequest,
7262            fdomain_client::fidl::FDomainResourceDialect,
7263        > for &mut ControllerCleanseRequest
7264    {
7265        #[inline]
7266        unsafe fn encode(
7267            self,
7268            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7269            offset: usize,
7270            _depth: fidl::encoding::Depth,
7271        ) -> fidl::Result<()> {
7272            encoder.debug_check_bounds::<ControllerCleanseRequest>(offset);
7273            // Delegate to tuple encoding.
7274            fidl::encoding::Encode::<
7275                ControllerCleanseRequest,
7276                fdomain_client::fidl::FDomainResourceDialect,
7277            >::encode(
7278                (<Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7279                    &mut self.test_input,
7280                ),),
7281                encoder,
7282                offset,
7283                _depth,
7284            )
7285        }
7286    }
7287    unsafe impl<T0: fidl::encoding::Encode<Input, fdomain_client::fidl::FDomainResourceDialect>>
7288        fidl::encoding::Encode<
7289            ControllerCleanseRequest,
7290            fdomain_client::fidl::FDomainResourceDialect,
7291        > for (T0,)
7292    {
7293        #[inline]
7294        unsafe fn encode(
7295            self,
7296            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7297            offset: usize,
7298            depth: fidl::encoding::Depth,
7299        ) -> fidl::Result<()> {
7300            encoder.debug_check_bounds::<ControllerCleanseRequest>(offset);
7301            // Zero out padding regions. There's no need to apply masks
7302            // because the unmasked parts will be overwritten by fields.
7303            // Write the fields.
7304            self.0.encode(encoder, offset + 0, depth)?;
7305            Ok(())
7306        }
7307    }
7308
7309    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7310        for ControllerCleanseRequest
7311    {
7312        #[inline(always)]
7313        fn new_empty() -> Self {
7314            Self {
7315                test_input: fidl::new_empty!(Input, fdomain_client::fidl::FDomainResourceDialect),
7316            }
7317        }
7318
7319        #[inline]
7320        unsafe fn decode(
7321            &mut self,
7322            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7323            offset: usize,
7324            _depth: fidl::encoding::Depth,
7325        ) -> fidl::Result<()> {
7326            decoder.debug_check_bounds::<Self>(offset);
7327            // Verify that padding bytes are zero.
7328            fidl::decode!(
7329                Input,
7330                fdomain_client::fidl::FDomainResourceDialect,
7331                &mut self.test_input,
7332                decoder,
7333                offset + 0,
7334                _depth
7335            )?;
7336            Ok(())
7337        }
7338    }
7339
7340    impl fidl::encoding::ResourceTypeMarker for ControllerMinimizeRequest {
7341        type Borrowed<'a> = &'a mut Self;
7342        fn take_or_borrow<'a>(
7343            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7344        ) -> Self::Borrowed<'a> {
7345            value
7346        }
7347    }
7348
7349    unsafe impl fidl::encoding::TypeMarker for ControllerMinimizeRequest {
7350        type Owned = Self;
7351
7352        #[inline(always)]
7353        fn inline_align(_context: fidl::encoding::Context) -> usize {
7354            8
7355        }
7356
7357        #[inline(always)]
7358        fn inline_size(_context: fidl::encoding::Context) -> usize {
7359            16
7360        }
7361    }
7362
7363    unsafe impl
7364        fidl::encoding::Encode<
7365            ControllerMinimizeRequest,
7366            fdomain_client::fidl::FDomainResourceDialect,
7367        > for &mut ControllerMinimizeRequest
7368    {
7369        #[inline]
7370        unsafe fn encode(
7371            self,
7372            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7373            offset: usize,
7374            _depth: fidl::encoding::Depth,
7375        ) -> fidl::Result<()> {
7376            encoder.debug_check_bounds::<ControllerMinimizeRequest>(offset);
7377            // Delegate to tuple encoding.
7378            fidl::encoding::Encode::<
7379                ControllerMinimizeRequest,
7380                fdomain_client::fidl::FDomainResourceDialect,
7381            >::encode(
7382                (<Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7383                    &mut self.test_input,
7384                ),),
7385                encoder,
7386                offset,
7387                _depth,
7388            )
7389        }
7390    }
7391    unsafe impl<T0: fidl::encoding::Encode<Input, fdomain_client::fidl::FDomainResourceDialect>>
7392        fidl::encoding::Encode<
7393            ControllerMinimizeRequest,
7394            fdomain_client::fidl::FDomainResourceDialect,
7395        > for (T0,)
7396    {
7397        #[inline]
7398        unsafe fn encode(
7399            self,
7400            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7401            offset: usize,
7402            depth: fidl::encoding::Depth,
7403        ) -> fidl::Result<()> {
7404            encoder.debug_check_bounds::<ControllerMinimizeRequest>(offset);
7405            // Zero out padding regions. There's no need to apply masks
7406            // because the unmasked parts will be overwritten by fields.
7407            // Write the fields.
7408            self.0.encode(encoder, offset + 0, depth)?;
7409            Ok(())
7410        }
7411    }
7412
7413    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7414        for ControllerMinimizeRequest
7415    {
7416        #[inline(always)]
7417        fn new_empty() -> Self {
7418            Self {
7419                test_input: fidl::new_empty!(Input, fdomain_client::fidl::FDomainResourceDialect),
7420            }
7421        }
7422
7423        #[inline]
7424        unsafe fn decode(
7425            &mut self,
7426            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7427            offset: usize,
7428            _depth: fidl::encoding::Depth,
7429        ) -> fidl::Result<()> {
7430            decoder.debug_check_bounds::<Self>(offset);
7431            // Verify that padding bytes are zero.
7432            fidl::decode!(
7433                Input,
7434                fdomain_client::fidl::FDomainResourceDialect,
7435                &mut self.test_input,
7436                decoder,
7437                offset + 0,
7438                _depth
7439            )?;
7440            Ok(())
7441        }
7442    }
7443
7444    impl fidl::encoding::ResourceTypeMarker for ControllerProviderConnectRequest {
7445        type Borrowed<'a> = &'a mut Self;
7446        fn take_or_borrow<'a>(
7447            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7448        ) -> Self::Borrowed<'a> {
7449            value
7450        }
7451    }
7452
7453    unsafe impl fidl::encoding::TypeMarker for ControllerProviderConnectRequest {
7454        type Owned = Self;
7455
7456        #[inline(always)]
7457        fn inline_align(_context: fidl::encoding::Context) -> usize {
7458            4
7459        }
7460
7461        #[inline(always)]
7462        fn inline_size(_context: fidl::encoding::Context) -> usize {
7463            4
7464        }
7465    }
7466
7467    unsafe impl
7468        fidl::encoding::Encode<
7469            ControllerProviderConnectRequest,
7470            fdomain_client::fidl::FDomainResourceDialect,
7471        > for &mut ControllerProviderConnectRequest
7472    {
7473        #[inline]
7474        unsafe fn encode(
7475            self,
7476            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7477            offset: usize,
7478            _depth: fidl::encoding::Depth,
7479        ) -> fidl::Result<()> {
7480            encoder.debug_check_bounds::<ControllerProviderConnectRequest>(offset);
7481            // Delegate to tuple encoding.
7482            fidl::encoding::Encode::<ControllerProviderConnectRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
7483                (
7484                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
7485                ),
7486                encoder, offset, _depth
7487            )
7488        }
7489    }
7490    unsafe impl<
7491        T0: fidl::encoding::Encode<
7492                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
7493                fdomain_client::fidl::FDomainResourceDialect,
7494            >,
7495    >
7496        fidl::encoding::Encode<
7497            ControllerProviderConnectRequest,
7498            fdomain_client::fidl::FDomainResourceDialect,
7499        > for (T0,)
7500    {
7501        #[inline]
7502        unsafe fn encode(
7503            self,
7504            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7505            offset: usize,
7506            depth: fidl::encoding::Depth,
7507        ) -> fidl::Result<()> {
7508            encoder.debug_check_bounds::<ControllerProviderConnectRequest>(offset);
7509            // Zero out padding regions. There's no need to apply masks
7510            // because the unmasked parts will be overwritten by fields.
7511            // Write the fields.
7512            self.0.encode(encoder, offset + 0, depth)?;
7513            Ok(())
7514        }
7515    }
7516
7517    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7518        for ControllerProviderConnectRequest
7519    {
7520        #[inline(always)]
7521        fn new_empty() -> Self {
7522            Self {
7523                controller: fidl::new_empty!(
7524                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
7525                    fdomain_client::fidl::FDomainResourceDialect
7526                ),
7527            }
7528        }
7529
7530        #[inline]
7531        unsafe fn decode(
7532            &mut self,
7533            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7534            offset: usize,
7535            _depth: fidl::encoding::Depth,
7536        ) -> fidl::Result<()> {
7537            decoder.debug_check_bounds::<Self>(offset);
7538            // Verify that padding bytes are zero.
7539            fidl::decode!(
7540                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
7541                fdomain_client::fidl::FDomainResourceDialect,
7542                &mut self.controller,
7543                decoder,
7544                offset + 0,
7545                _depth
7546            )?;
7547            Ok(())
7548        }
7549    }
7550
7551    impl fidl::encoding::ResourceTypeMarker for ControllerReadCorpusRequest {
7552        type Borrowed<'a> = &'a mut Self;
7553        fn take_or_borrow<'a>(
7554            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7555        ) -> Self::Borrowed<'a> {
7556            value
7557        }
7558    }
7559
7560    unsafe impl fidl::encoding::TypeMarker for ControllerReadCorpusRequest {
7561        type Owned = Self;
7562
7563        #[inline(always)]
7564        fn inline_align(_context: fidl::encoding::Context) -> usize {
7565            4
7566        }
7567
7568        #[inline(always)]
7569        fn inline_size(_context: fidl::encoding::Context) -> usize {
7570            8
7571        }
7572    }
7573
7574    unsafe impl
7575        fidl::encoding::Encode<
7576            ControllerReadCorpusRequest,
7577            fdomain_client::fidl::FDomainResourceDialect,
7578        > for &mut ControllerReadCorpusRequest
7579    {
7580        #[inline]
7581        unsafe fn encode(
7582            self,
7583            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7584            offset: usize,
7585            _depth: fidl::encoding::Depth,
7586        ) -> fidl::Result<()> {
7587            encoder.debug_check_bounds::<ControllerReadCorpusRequest>(offset);
7588            // Delegate to tuple encoding.
7589            fidl::encoding::Encode::<ControllerReadCorpusRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
7590                (
7591                    <Corpus as fidl::encoding::ValueTypeMarker>::borrow(&self.corpus),
7592                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<CorpusReaderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.corpus_reader),
7593                ),
7594                encoder, offset, _depth
7595            )
7596        }
7597    }
7598    unsafe impl<
7599        T0: fidl::encoding::Encode<Corpus, fdomain_client::fidl::FDomainResourceDialect>,
7600        T1: fidl::encoding::Encode<
7601                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<CorpusReaderMarker>>,
7602                fdomain_client::fidl::FDomainResourceDialect,
7603            >,
7604    >
7605        fidl::encoding::Encode<
7606            ControllerReadCorpusRequest,
7607            fdomain_client::fidl::FDomainResourceDialect,
7608        > for (T0, T1)
7609    {
7610        #[inline]
7611        unsafe fn encode(
7612            self,
7613            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7614            offset: usize,
7615            depth: fidl::encoding::Depth,
7616        ) -> fidl::Result<()> {
7617            encoder.debug_check_bounds::<ControllerReadCorpusRequest>(offset);
7618            // Zero out padding regions. There's no need to apply masks
7619            // because the unmasked parts will be overwritten by fields.
7620            unsafe {
7621                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7622                (ptr as *mut u32).write_unaligned(0);
7623            }
7624            // Write the fields.
7625            self.0.encode(encoder, offset + 0, depth)?;
7626            self.1.encode(encoder, offset + 4, depth)?;
7627            Ok(())
7628        }
7629    }
7630
7631    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7632        for ControllerReadCorpusRequest
7633    {
7634        #[inline(always)]
7635        fn new_empty() -> Self {
7636            Self {
7637                corpus: fidl::new_empty!(Corpus, fdomain_client::fidl::FDomainResourceDialect),
7638                corpus_reader: fidl::new_empty!(
7639                    fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<CorpusReaderMarker>>,
7640                    fdomain_client::fidl::FDomainResourceDialect
7641                ),
7642            }
7643        }
7644
7645        #[inline]
7646        unsafe fn decode(
7647            &mut self,
7648            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7649            offset: usize,
7650            _depth: fidl::encoding::Depth,
7651        ) -> fidl::Result<()> {
7652            decoder.debug_check_bounds::<Self>(offset);
7653            // Verify that padding bytes are zero.
7654            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7655            let padval = unsafe { (ptr as *const u32).read_unaligned() };
7656            let mask = 0xffffff00u32;
7657            let maskedval = padval & mask;
7658            if maskedval != 0 {
7659                return Err(fidl::Error::NonZeroPadding {
7660                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7661                });
7662            }
7663            fidl::decode!(
7664                Corpus,
7665                fdomain_client::fidl::FDomainResourceDialect,
7666                &mut self.corpus,
7667                decoder,
7668                offset + 0,
7669                _depth
7670            )?;
7671            fidl::decode!(
7672                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<CorpusReaderMarker>>,
7673                fdomain_client::fidl::FDomainResourceDialect,
7674                &mut self.corpus_reader,
7675                decoder,
7676                offset + 4,
7677                _depth
7678            )?;
7679            Ok(())
7680        }
7681    }
7682
7683    impl fidl::encoding::ResourceTypeMarker for ControllerReadDictionaryResponse {
7684        type Borrowed<'a> = &'a mut Self;
7685        fn take_or_borrow<'a>(
7686            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7687        ) -> Self::Borrowed<'a> {
7688            value
7689        }
7690    }
7691
7692    unsafe impl fidl::encoding::TypeMarker for ControllerReadDictionaryResponse {
7693        type Owned = Self;
7694
7695        #[inline(always)]
7696        fn inline_align(_context: fidl::encoding::Context) -> usize {
7697            8
7698        }
7699
7700        #[inline(always)]
7701        fn inline_size(_context: fidl::encoding::Context) -> usize {
7702            16
7703        }
7704    }
7705
7706    unsafe impl
7707        fidl::encoding::Encode<
7708            ControllerReadDictionaryResponse,
7709            fdomain_client::fidl::FDomainResourceDialect,
7710        > for &mut ControllerReadDictionaryResponse
7711    {
7712        #[inline]
7713        unsafe fn encode(
7714            self,
7715            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7716            offset: usize,
7717            _depth: fidl::encoding::Depth,
7718        ) -> fidl::Result<()> {
7719            encoder.debug_check_bounds::<ControllerReadDictionaryResponse>(offset);
7720            // Delegate to tuple encoding.
7721            fidl::encoding::Encode::<
7722                ControllerReadDictionaryResponse,
7723                fdomain_client::fidl::FDomainResourceDialect,
7724            >::encode(
7725                (<Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7726                    &mut self.dictionary,
7727                ),),
7728                encoder,
7729                offset,
7730                _depth,
7731            )
7732        }
7733    }
7734    unsafe impl<T0: fidl::encoding::Encode<Input, fdomain_client::fidl::FDomainResourceDialect>>
7735        fidl::encoding::Encode<
7736            ControllerReadDictionaryResponse,
7737            fdomain_client::fidl::FDomainResourceDialect,
7738        > for (T0,)
7739    {
7740        #[inline]
7741        unsafe fn encode(
7742            self,
7743            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7744            offset: usize,
7745            depth: fidl::encoding::Depth,
7746        ) -> fidl::Result<()> {
7747            encoder.debug_check_bounds::<ControllerReadDictionaryResponse>(offset);
7748            // Zero out padding regions. There's no need to apply masks
7749            // because the unmasked parts will be overwritten by fields.
7750            // Write the fields.
7751            self.0.encode(encoder, offset + 0, depth)?;
7752            Ok(())
7753        }
7754    }
7755
7756    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7757        for ControllerReadDictionaryResponse
7758    {
7759        #[inline(always)]
7760        fn new_empty() -> Self {
7761            Self {
7762                dictionary: fidl::new_empty!(Input, fdomain_client::fidl::FDomainResourceDialect),
7763            }
7764        }
7765
7766        #[inline]
7767        unsafe fn decode(
7768            &mut self,
7769            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7770            offset: usize,
7771            _depth: fidl::encoding::Depth,
7772        ) -> fidl::Result<()> {
7773            decoder.debug_check_bounds::<Self>(offset);
7774            // Verify that padding bytes are zero.
7775            fidl::decode!(
7776                Input,
7777                fdomain_client::fidl::FDomainResourceDialect,
7778                &mut self.dictionary,
7779                decoder,
7780                offset + 0,
7781                _depth
7782            )?;
7783            Ok(())
7784        }
7785    }
7786
7787    impl fidl::encoding::ResourceTypeMarker for ControllerTryOneRequest {
7788        type Borrowed<'a> = &'a mut Self;
7789        fn take_or_borrow<'a>(
7790            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7791        ) -> Self::Borrowed<'a> {
7792            value
7793        }
7794    }
7795
7796    unsafe impl fidl::encoding::TypeMarker for ControllerTryOneRequest {
7797        type Owned = Self;
7798
7799        #[inline(always)]
7800        fn inline_align(_context: fidl::encoding::Context) -> usize {
7801            8
7802        }
7803
7804        #[inline(always)]
7805        fn inline_size(_context: fidl::encoding::Context) -> usize {
7806            16
7807        }
7808    }
7809
7810    unsafe impl
7811        fidl::encoding::Encode<
7812            ControllerTryOneRequest,
7813            fdomain_client::fidl::FDomainResourceDialect,
7814        > for &mut ControllerTryOneRequest
7815    {
7816        #[inline]
7817        unsafe fn encode(
7818            self,
7819            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7820            offset: usize,
7821            _depth: fidl::encoding::Depth,
7822        ) -> fidl::Result<()> {
7823            encoder.debug_check_bounds::<ControllerTryOneRequest>(offset);
7824            // Delegate to tuple encoding.
7825            fidl::encoding::Encode::<
7826                ControllerTryOneRequest,
7827                fdomain_client::fidl::FDomainResourceDialect,
7828            >::encode(
7829                (<Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7830                    &mut self.test_input,
7831                ),),
7832                encoder,
7833                offset,
7834                _depth,
7835            )
7836        }
7837    }
7838    unsafe impl<T0: fidl::encoding::Encode<Input, fdomain_client::fidl::FDomainResourceDialect>>
7839        fidl::encoding::Encode<
7840            ControllerTryOneRequest,
7841            fdomain_client::fidl::FDomainResourceDialect,
7842        > for (T0,)
7843    {
7844        #[inline]
7845        unsafe fn encode(
7846            self,
7847            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7848            offset: usize,
7849            depth: fidl::encoding::Depth,
7850        ) -> fidl::Result<()> {
7851            encoder.debug_check_bounds::<ControllerTryOneRequest>(offset);
7852            // Zero out padding regions. There's no need to apply masks
7853            // because the unmasked parts will be overwritten by fields.
7854            // Write the fields.
7855            self.0.encode(encoder, offset + 0, depth)?;
7856            Ok(())
7857        }
7858    }
7859
7860    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7861        for ControllerTryOneRequest
7862    {
7863        #[inline(always)]
7864        fn new_empty() -> Self {
7865            Self {
7866                test_input: fidl::new_empty!(Input, fdomain_client::fidl::FDomainResourceDialect),
7867            }
7868        }
7869
7870        #[inline]
7871        unsafe fn decode(
7872            &mut self,
7873            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7874            offset: usize,
7875            _depth: fidl::encoding::Depth,
7876        ) -> fidl::Result<()> {
7877            decoder.debug_check_bounds::<Self>(offset);
7878            // Verify that padding bytes are zero.
7879            fidl::decode!(
7880                Input,
7881                fdomain_client::fidl::FDomainResourceDialect,
7882                &mut self.test_input,
7883                decoder,
7884                offset + 0,
7885                _depth
7886            )?;
7887            Ok(())
7888        }
7889    }
7890
7891    impl fidl::encoding::ResourceTypeMarker for ControllerWatchArtifactResponse {
7892        type Borrowed<'a> = &'a mut Self;
7893        fn take_or_borrow<'a>(
7894            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7895        ) -> Self::Borrowed<'a> {
7896            value
7897        }
7898    }
7899
7900    unsafe impl fidl::encoding::TypeMarker for ControllerWatchArtifactResponse {
7901        type Owned = Self;
7902
7903        #[inline(always)]
7904        fn inline_align(_context: fidl::encoding::Context) -> usize {
7905            8
7906        }
7907
7908        #[inline(always)]
7909        fn inline_size(_context: fidl::encoding::Context) -> usize {
7910            16
7911        }
7912    }
7913
7914    unsafe impl
7915        fidl::encoding::Encode<
7916            ControllerWatchArtifactResponse,
7917            fdomain_client::fidl::FDomainResourceDialect,
7918        > for &mut ControllerWatchArtifactResponse
7919    {
7920        #[inline]
7921        unsafe fn encode(
7922            self,
7923            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7924            offset: usize,
7925            _depth: fidl::encoding::Depth,
7926        ) -> fidl::Result<()> {
7927            encoder.debug_check_bounds::<ControllerWatchArtifactResponse>(offset);
7928            // Delegate to tuple encoding.
7929            fidl::encoding::Encode::<
7930                ControllerWatchArtifactResponse,
7931                fdomain_client::fidl::FDomainResourceDialect,
7932            >::encode(
7933                (<Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7934                    &mut self.artifact,
7935                ),),
7936                encoder,
7937                offset,
7938                _depth,
7939            )
7940        }
7941    }
7942    unsafe impl<T0: fidl::encoding::Encode<Artifact, fdomain_client::fidl::FDomainResourceDialect>>
7943        fidl::encoding::Encode<
7944            ControllerWatchArtifactResponse,
7945            fdomain_client::fidl::FDomainResourceDialect,
7946        > for (T0,)
7947    {
7948        #[inline]
7949        unsafe fn encode(
7950            self,
7951            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7952            offset: usize,
7953            depth: fidl::encoding::Depth,
7954        ) -> fidl::Result<()> {
7955            encoder.debug_check_bounds::<ControllerWatchArtifactResponse>(offset);
7956            // Zero out padding regions. There's no need to apply masks
7957            // because the unmasked parts will be overwritten by fields.
7958            // Write the fields.
7959            self.0.encode(encoder, offset + 0, depth)?;
7960            Ok(())
7961        }
7962    }
7963
7964    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7965        for ControllerWatchArtifactResponse
7966    {
7967        #[inline(always)]
7968        fn new_empty() -> Self {
7969            Self {
7970                artifact: fidl::new_empty!(Artifact, fdomain_client::fidl::FDomainResourceDialect),
7971            }
7972        }
7973
7974        #[inline]
7975        unsafe fn decode(
7976            &mut self,
7977            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7978            offset: usize,
7979            _depth: fidl::encoding::Depth,
7980        ) -> fidl::Result<()> {
7981            decoder.debug_check_bounds::<Self>(offset);
7982            // Verify that padding bytes are zero.
7983            fidl::decode!(
7984                Artifact,
7985                fdomain_client::fidl::FDomainResourceDialect,
7986                &mut self.artifact,
7987                decoder,
7988                offset + 0,
7989                _depth
7990            )?;
7991            Ok(())
7992        }
7993    }
7994
7995    impl fidl::encoding::ResourceTypeMarker for ControllerWriteDictionaryRequest {
7996        type Borrowed<'a> = &'a mut Self;
7997        fn take_or_borrow<'a>(
7998            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7999        ) -> Self::Borrowed<'a> {
8000            value
8001        }
8002    }
8003
8004    unsafe impl fidl::encoding::TypeMarker for ControllerWriteDictionaryRequest {
8005        type Owned = Self;
8006
8007        #[inline(always)]
8008        fn inline_align(_context: fidl::encoding::Context) -> usize {
8009            8
8010        }
8011
8012        #[inline(always)]
8013        fn inline_size(_context: fidl::encoding::Context) -> usize {
8014            16
8015        }
8016    }
8017
8018    unsafe impl
8019        fidl::encoding::Encode<
8020            ControllerWriteDictionaryRequest,
8021            fdomain_client::fidl::FDomainResourceDialect,
8022        > for &mut ControllerWriteDictionaryRequest
8023    {
8024        #[inline]
8025        unsafe fn encode(
8026            self,
8027            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8028            offset: usize,
8029            _depth: fidl::encoding::Depth,
8030        ) -> fidl::Result<()> {
8031            encoder.debug_check_bounds::<ControllerWriteDictionaryRequest>(offset);
8032            // Delegate to tuple encoding.
8033            fidl::encoding::Encode::<
8034                ControllerWriteDictionaryRequest,
8035                fdomain_client::fidl::FDomainResourceDialect,
8036            >::encode(
8037                (<Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8038                    &mut self.dictionary,
8039                ),),
8040                encoder,
8041                offset,
8042                _depth,
8043            )
8044        }
8045    }
8046    unsafe impl<T0: fidl::encoding::Encode<Input, fdomain_client::fidl::FDomainResourceDialect>>
8047        fidl::encoding::Encode<
8048            ControllerWriteDictionaryRequest,
8049            fdomain_client::fidl::FDomainResourceDialect,
8050        > for (T0,)
8051    {
8052        #[inline]
8053        unsafe fn encode(
8054            self,
8055            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8056            offset: usize,
8057            depth: fidl::encoding::Depth,
8058        ) -> fidl::Result<()> {
8059            encoder.debug_check_bounds::<ControllerWriteDictionaryRequest>(offset);
8060            // Zero out padding regions. There's no need to apply masks
8061            // because the unmasked parts will be overwritten by fields.
8062            // Write the fields.
8063            self.0.encode(encoder, offset + 0, depth)?;
8064            Ok(())
8065        }
8066    }
8067
8068    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8069        for ControllerWriteDictionaryRequest
8070    {
8071        #[inline(always)]
8072        fn new_empty() -> Self {
8073            Self {
8074                dictionary: fidl::new_empty!(Input, fdomain_client::fidl::FDomainResourceDialect),
8075            }
8076        }
8077
8078        #[inline]
8079        unsafe fn decode(
8080            &mut self,
8081            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8082            offset: usize,
8083            _depth: fidl::encoding::Depth,
8084        ) -> fidl::Result<()> {
8085            decoder.debug_check_bounds::<Self>(offset);
8086            // Verify that padding bytes are zero.
8087            fidl::decode!(
8088                Input,
8089                fdomain_client::fidl::FDomainResourceDialect,
8090                &mut self.dictionary,
8091                decoder,
8092                offset + 0,
8093                _depth
8094            )?;
8095            Ok(())
8096        }
8097    }
8098
8099    impl fidl::encoding::ResourceTypeMarker for CorpusReaderNextRequest {
8100        type Borrowed<'a> = &'a mut Self;
8101        fn take_or_borrow<'a>(
8102            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8103        ) -> Self::Borrowed<'a> {
8104            value
8105        }
8106    }
8107
8108    unsafe impl fidl::encoding::TypeMarker for CorpusReaderNextRequest {
8109        type Owned = Self;
8110
8111        #[inline(always)]
8112        fn inline_align(_context: fidl::encoding::Context) -> usize {
8113            8
8114        }
8115
8116        #[inline(always)]
8117        fn inline_size(_context: fidl::encoding::Context) -> usize {
8118            16
8119        }
8120    }
8121
8122    unsafe impl
8123        fidl::encoding::Encode<
8124            CorpusReaderNextRequest,
8125            fdomain_client::fidl::FDomainResourceDialect,
8126        > for &mut CorpusReaderNextRequest
8127    {
8128        #[inline]
8129        unsafe fn encode(
8130            self,
8131            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8132            offset: usize,
8133            _depth: fidl::encoding::Depth,
8134        ) -> fidl::Result<()> {
8135            encoder.debug_check_bounds::<CorpusReaderNextRequest>(offset);
8136            // Delegate to tuple encoding.
8137            fidl::encoding::Encode::<
8138                CorpusReaderNextRequest,
8139                fdomain_client::fidl::FDomainResourceDialect,
8140            >::encode(
8141                (<Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8142                    &mut self.test_input,
8143                ),),
8144                encoder,
8145                offset,
8146                _depth,
8147            )
8148        }
8149    }
8150    unsafe impl<T0: fidl::encoding::Encode<Input, fdomain_client::fidl::FDomainResourceDialect>>
8151        fidl::encoding::Encode<
8152            CorpusReaderNextRequest,
8153            fdomain_client::fidl::FDomainResourceDialect,
8154        > for (T0,)
8155    {
8156        #[inline]
8157        unsafe fn encode(
8158            self,
8159            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8160            offset: usize,
8161            depth: fidl::encoding::Depth,
8162        ) -> fidl::Result<()> {
8163            encoder.debug_check_bounds::<CorpusReaderNextRequest>(offset);
8164            // Zero out padding regions. There's no need to apply masks
8165            // because the unmasked parts will be overwritten by fields.
8166            // Write the fields.
8167            self.0.encode(encoder, offset + 0, depth)?;
8168            Ok(())
8169        }
8170    }
8171
8172    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8173        for CorpusReaderNextRequest
8174    {
8175        #[inline(always)]
8176        fn new_empty() -> Self {
8177            Self {
8178                test_input: fidl::new_empty!(Input, fdomain_client::fidl::FDomainResourceDialect),
8179            }
8180        }
8181
8182        #[inline]
8183        unsafe fn decode(
8184            &mut self,
8185            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8186            offset: usize,
8187            _depth: fidl::encoding::Depth,
8188        ) -> fidl::Result<()> {
8189            decoder.debug_check_bounds::<Self>(offset);
8190            // Verify that padding bytes are zero.
8191            fidl::decode!(
8192                Input,
8193                fdomain_client::fidl::FDomainResourceDialect,
8194                &mut self.test_input,
8195                decoder,
8196                offset + 0,
8197                _depth
8198            )?;
8199            Ok(())
8200        }
8201    }
8202
8203    impl fidl::encoding::ResourceTypeMarker for CoverageData {
8204        type Borrowed<'a> = &'a mut Self;
8205        fn take_or_borrow<'a>(
8206            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8207        ) -> Self::Borrowed<'a> {
8208            value
8209        }
8210    }
8211
8212    unsafe impl fidl::encoding::TypeMarker for CoverageData {
8213        type Owned = Self;
8214
8215        #[inline(always)]
8216        fn inline_align(_context: fidl::encoding::Context) -> usize {
8217            8
8218        }
8219
8220        #[inline(always)]
8221        fn inline_size(_context: fidl::encoding::Context) -> usize {
8222            24
8223        }
8224    }
8225
8226    unsafe impl fidl::encoding::Encode<CoverageData, fdomain_client::fidl::FDomainResourceDialect>
8227        for &mut CoverageData
8228    {
8229        #[inline]
8230        unsafe fn encode(
8231            self,
8232            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8233            offset: usize,
8234            _depth: fidl::encoding::Depth,
8235        ) -> fidl::Result<()> {
8236            encoder.debug_check_bounds::<CoverageData>(offset);
8237            // Delegate to tuple encoding.
8238            fidl::encoding::Encode::<CoverageData, fdomain_client::fidl::FDomainResourceDialect>::encode(
8239                (
8240                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.target_id),
8241                    <Data as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data),
8242                ),
8243                encoder, offset, _depth
8244            )
8245        }
8246    }
8247    unsafe impl<
8248        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
8249        T1: fidl::encoding::Encode<Data, fdomain_client::fidl::FDomainResourceDialect>,
8250    > fidl::encoding::Encode<CoverageData, fdomain_client::fidl::FDomainResourceDialect>
8251        for (T0, T1)
8252    {
8253        #[inline]
8254        unsafe fn encode(
8255            self,
8256            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8257            offset: usize,
8258            depth: fidl::encoding::Depth,
8259        ) -> fidl::Result<()> {
8260            encoder.debug_check_bounds::<CoverageData>(offset);
8261            // Zero out padding regions. There's no need to apply masks
8262            // because the unmasked parts will be overwritten by fields.
8263            // Write the fields.
8264            self.0.encode(encoder, offset + 0, depth)?;
8265            self.1.encode(encoder, offset + 8, depth)?;
8266            Ok(())
8267        }
8268    }
8269
8270    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for CoverageData {
8271        #[inline(always)]
8272        fn new_empty() -> Self {
8273            Self {
8274                target_id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
8275                data: fidl::new_empty!(Data, fdomain_client::fidl::FDomainResourceDialect),
8276            }
8277        }
8278
8279        #[inline]
8280        unsafe fn decode(
8281            &mut self,
8282            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8283            offset: usize,
8284            _depth: fidl::encoding::Depth,
8285        ) -> fidl::Result<()> {
8286            decoder.debug_check_bounds::<Self>(offset);
8287            // Verify that padding bytes are zero.
8288            fidl::decode!(
8289                u64,
8290                fdomain_client::fidl::FDomainResourceDialect,
8291                &mut self.target_id,
8292                decoder,
8293                offset + 0,
8294                _depth
8295            )?;
8296            fidl::decode!(
8297                Data,
8298                fdomain_client::fidl::FDomainResourceDialect,
8299                &mut self.data,
8300                decoder,
8301                offset + 8,
8302                _depth
8303            )?;
8304            Ok(())
8305        }
8306    }
8307
8308    impl fidl::encoding::ResourceTypeMarker for CoverageDataCollectorAddInline8bitCountersRequest {
8309        type Borrowed<'a> = &'a mut Self;
8310        fn take_or_borrow<'a>(
8311            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8312        ) -> Self::Borrowed<'a> {
8313            value
8314        }
8315    }
8316
8317    unsafe impl fidl::encoding::TypeMarker for CoverageDataCollectorAddInline8bitCountersRequest {
8318        type Owned = Self;
8319
8320        #[inline(always)]
8321        fn inline_align(_context: fidl::encoding::Context) -> usize {
8322            4
8323        }
8324
8325        #[inline(always)]
8326        fn inline_size(_context: fidl::encoding::Context) -> usize {
8327            4
8328        }
8329    }
8330
8331    unsafe impl
8332        fidl::encoding::Encode<
8333            CoverageDataCollectorAddInline8bitCountersRequest,
8334            fdomain_client::fidl::FDomainResourceDialect,
8335        > for &mut CoverageDataCollectorAddInline8bitCountersRequest
8336    {
8337        #[inline]
8338        unsafe fn encode(
8339            self,
8340            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8341            offset: usize,
8342            _depth: fidl::encoding::Depth,
8343        ) -> fidl::Result<()> {
8344            encoder.debug_check_bounds::<CoverageDataCollectorAddInline8bitCountersRequest>(offset);
8345            // Delegate to tuple encoding.
8346            fidl::encoding::Encode::<
8347                CoverageDataCollectorAddInline8bitCountersRequest,
8348                fdomain_client::fidl::FDomainResourceDialect,
8349            >::encode(
8350                (<fidl::encoding::HandleType<
8351                    fdomain_client::Vmo,
8352                    { fidl::ObjectType::VMO.into_raw() },
8353                    2147483648,
8354                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8355                    &mut self.inline_8bit_counters,
8356                ),),
8357                encoder,
8358                offset,
8359                _depth,
8360            )
8361        }
8362    }
8363    unsafe impl<
8364        T0: fidl::encoding::Encode<
8365                fidl::encoding::HandleType<
8366                    fdomain_client::Vmo,
8367                    { fidl::ObjectType::VMO.into_raw() },
8368                    2147483648,
8369                >,
8370                fdomain_client::fidl::FDomainResourceDialect,
8371            >,
8372    >
8373        fidl::encoding::Encode<
8374            CoverageDataCollectorAddInline8bitCountersRequest,
8375            fdomain_client::fidl::FDomainResourceDialect,
8376        > for (T0,)
8377    {
8378        #[inline]
8379        unsafe fn encode(
8380            self,
8381            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8382            offset: usize,
8383            depth: fidl::encoding::Depth,
8384        ) -> fidl::Result<()> {
8385            encoder.debug_check_bounds::<CoverageDataCollectorAddInline8bitCountersRequest>(offset);
8386            // Zero out padding regions. There's no need to apply masks
8387            // because the unmasked parts will be overwritten by fields.
8388            // Write the fields.
8389            self.0.encode(encoder, offset + 0, depth)?;
8390            Ok(())
8391        }
8392    }
8393
8394    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8395        for CoverageDataCollectorAddInline8bitCountersRequest
8396    {
8397        #[inline(always)]
8398        fn new_empty() -> Self {
8399            Self {
8400                inline_8bit_counters: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
8401            }
8402        }
8403
8404        #[inline]
8405        unsafe fn decode(
8406            &mut self,
8407            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8408            offset: usize,
8409            _depth: fidl::encoding::Depth,
8410        ) -> fidl::Result<()> {
8411            decoder.debug_check_bounds::<Self>(offset);
8412            // Verify that padding bytes are zero.
8413            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.inline_8bit_counters, decoder, offset + 0, _depth)?;
8414            Ok(())
8415        }
8416    }
8417
8418    impl fidl::encoding::ResourceTypeMarker for CoverageDataCollectorInitializeRequest {
8419        type Borrowed<'a> = &'a mut Self;
8420        fn take_or_borrow<'a>(
8421            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8422        ) -> Self::Borrowed<'a> {
8423            value
8424        }
8425    }
8426
8427    unsafe impl fidl::encoding::TypeMarker for CoverageDataCollectorInitializeRequest {
8428        type Owned = Self;
8429
8430        #[inline(always)]
8431        fn inline_align(_context: fidl::encoding::Context) -> usize {
8432            4
8433        }
8434
8435        #[inline(always)]
8436        fn inline_size(_context: fidl::encoding::Context) -> usize {
8437            8
8438        }
8439    }
8440
8441    unsafe impl
8442        fidl::encoding::Encode<
8443            CoverageDataCollectorInitializeRequest,
8444            fdomain_client::fidl::FDomainResourceDialect,
8445        > for &mut CoverageDataCollectorInitializeRequest
8446    {
8447        #[inline]
8448        unsafe fn encode(
8449            self,
8450            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8451            offset: usize,
8452            _depth: fidl::encoding::Depth,
8453        ) -> fidl::Result<()> {
8454            encoder.debug_check_bounds::<CoverageDataCollectorInitializeRequest>(offset);
8455            // Delegate to tuple encoding.
8456            fidl::encoding::Encode::<
8457                CoverageDataCollectorInitializeRequest,
8458                fdomain_client::fidl::FDomainResourceDialect,
8459            >::encode(
8460                (
8461                    <fidl::encoding::HandleType<
8462                        fdomain_client::EventPair,
8463                        { fidl::ObjectType::EVENTPAIR.into_raw() },
8464                        2147483648,
8465                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8466                        &mut self.eventpair
8467                    ),
8468                    <fidl::encoding::HandleType<
8469                        fdomain_client::Process,
8470                        { fidl::ObjectType::PROCESS.into_raw() },
8471                        2147483648,
8472                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8473                        &mut self.process
8474                    ),
8475                ),
8476                encoder,
8477                offset,
8478                _depth,
8479            )
8480        }
8481    }
8482    unsafe impl<
8483        T0: fidl::encoding::Encode<
8484                fidl::encoding::HandleType<
8485                    fdomain_client::EventPair,
8486                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8487                    2147483648,
8488                >,
8489                fdomain_client::fidl::FDomainResourceDialect,
8490            >,
8491        T1: fidl::encoding::Encode<
8492                fidl::encoding::HandleType<
8493                    fdomain_client::Process,
8494                    { fidl::ObjectType::PROCESS.into_raw() },
8495                    2147483648,
8496                >,
8497                fdomain_client::fidl::FDomainResourceDialect,
8498            >,
8499    >
8500        fidl::encoding::Encode<
8501            CoverageDataCollectorInitializeRequest,
8502            fdomain_client::fidl::FDomainResourceDialect,
8503        > for (T0, T1)
8504    {
8505        #[inline]
8506        unsafe fn encode(
8507            self,
8508            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8509            offset: usize,
8510            depth: fidl::encoding::Depth,
8511        ) -> fidl::Result<()> {
8512            encoder.debug_check_bounds::<CoverageDataCollectorInitializeRequest>(offset);
8513            // Zero out padding regions. There's no need to apply masks
8514            // because the unmasked parts will be overwritten by fields.
8515            // Write the fields.
8516            self.0.encode(encoder, offset + 0, depth)?;
8517            self.1.encode(encoder, offset + 4, depth)?;
8518            Ok(())
8519        }
8520    }
8521
8522    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8523        for CoverageDataCollectorInitializeRequest
8524    {
8525        #[inline(always)]
8526        fn new_empty() -> Self {
8527            Self {
8528                eventpair: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
8529                process: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
8530            }
8531        }
8532
8533        #[inline]
8534        unsafe fn decode(
8535            &mut self,
8536            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8537            offset: usize,
8538            _depth: fidl::encoding::Depth,
8539        ) -> fidl::Result<()> {
8540            decoder.debug_check_bounds::<Self>(offset);
8541            // Verify that padding bytes are zero.
8542            fidl::decode!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.eventpair, decoder, offset + 0, _depth)?;
8543            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.process, decoder, offset + 4, _depth)?;
8544            Ok(())
8545        }
8546    }
8547
8548    impl fidl::encoding::ResourceTypeMarker for CoverageDataProviderWatchCoverageDataResponse {
8549        type Borrowed<'a> = &'a mut Self;
8550        fn take_or_borrow<'a>(
8551            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8552        ) -> Self::Borrowed<'a> {
8553            value
8554        }
8555    }
8556
8557    unsafe impl fidl::encoding::TypeMarker for CoverageDataProviderWatchCoverageDataResponse {
8558        type Owned = Self;
8559
8560        #[inline(always)]
8561        fn inline_align(_context: fidl::encoding::Context) -> usize {
8562            8
8563        }
8564
8565        #[inline(always)]
8566        fn inline_size(_context: fidl::encoding::Context) -> usize {
8567            16
8568        }
8569    }
8570
8571    unsafe impl
8572        fidl::encoding::Encode<
8573            CoverageDataProviderWatchCoverageDataResponse,
8574            fdomain_client::fidl::FDomainResourceDialect,
8575        > for &mut CoverageDataProviderWatchCoverageDataResponse
8576    {
8577        #[inline]
8578        unsafe fn encode(
8579            self,
8580            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8581            offset: usize,
8582            _depth: fidl::encoding::Depth,
8583        ) -> fidl::Result<()> {
8584            encoder.debug_check_bounds::<CoverageDataProviderWatchCoverageDataResponse>(offset);
8585            // Delegate to tuple encoding.
8586            fidl::encoding::Encode::<CoverageDataProviderWatchCoverageDataResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
8587                (
8588                    <fidl::encoding::Vector<CoverageData, 4096> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.coverage_data),
8589                ),
8590                encoder, offset, _depth
8591            )
8592        }
8593    }
8594    unsafe impl<
8595        T0: fidl::encoding::Encode<
8596                fidl::encoding::Vector<CoverageData, 4096>,
8597                fdomain_client::fidl::FDomainResourceDialect,
8598            >,
8599    >
8600        fidl::encoding::Encode<
8601            CoverageDataProviderWatchCoverageDataResponse,
8602            fdomain_client::fidl::FDomainResourceDialect,
8603        > for (T0,)
8604    {
8605        #[inline]
8606        unsafe fn encode(
8607            self,
8608            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8609            offset: usize,
8610            depth: fidl::encoding::Depth,
8611        ) -> fidl::Result<()> {
8612            encoder.debug_check_bounds::<CoverageDataProviderWatchCoverageDataResponse>(offset);
8613            // Zero out padding regions. There's no need to apply masks
8614            // because the unmasked parts will be overwritten by fields.
8615            // Write the fields.
8616            self.0.encode(encoder, offset + 0, depth)?;
8617            Ok(())
8618        }
8619    }
8620
8621    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8622        for CoverageDataProviderWatchCoverageDataResponse
8623    {
8624        #[inline(always)]
8625        fn new_empty() -> Self {
8626            Self {
8627                coverage_data: fidl::new_empty!(fidl::encoding::Vector<CoverageData, 4096>, fdomain_client::fidl::FDomainResourceDialect),
8628            }
8629        }
8630
8631        #[inline]
8632        unsafe fn decode(
8633            &mut self,
8634            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8635            offset: usize,
8636            _depth: fidl::encoding::Depth,
8637        ) -> fidl::Result<()> {
8638            decoder.debug_check_bounds::<Self>(offset);
8639            // Verify that padding bytes are zero.
8640            fidl::decode!(fidl::encoding::Vector<CoverageData, 4096>, fdomain_client::fidl::FDomainResourceDialect, &mut self.coverage_data, decoder, offset + 0, _depth)?;
8641            Ok(())
8642        }
8643    }
8644
8645    impl fidl::encoding::ResourceTypeMarker for Input {
8646        type Borrowed<'a> = &'a mut Self;
8647        fn take_or_borrow<'a>(
8648            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8649        ) -> Self::Borrowed<'a> {
8650            value
8651        }
8652    }
8653
8654    unsafe impl fidl::encoding::TypeMarker for Input {
8655        type Owned = Self;
8656
8657        #[inline(always)]
8658        fn inline_align(_context: fidl::encoding::Context) -> usize {
8659            8
8660        }
8661
8662        #[inline(always)]
8663        fn inline_size(_context: fidl::encoding::Context) -> usize {
8664            16
8665        }
8666    }
8667
8668    unsafe impl fidl::encoding::Encode<Input, fdomain_client::fidl::FDomainResourceDialect>
8669        for &mut Input
8670    {
8671        #[inline]
8672        unsafe fn encode(
8673            self,
8674            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8675            offset: usize,
8676            _depth: fidl::encoding::Depth,
8677        ) -> fidl::Result<()> {
8678            encoder.debug_check_bounds::<Input>(offset);
8679            // Delegate to tuple encoding.
8680            fidl::encoding::Encode::<Input, fdomain_client::fidl::FDomainResourceDialect>::encode(
8681                (
8682                    <fidl::encoding::HandleType<
8683                        fdomain_client::Socket,
8684                        { fidl::ObjectType::SOCKET.into_raw() },
8685                        2147483648,
8686                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8687                        &mut self.socket
8688                    ),
8689                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.size),
8690                ),
8691                encoder,
8692                offset,
8693                _depth,
8694            )
8695        }
8696    }
8697    unsafe impl<
8698        T0: fidl::encoding::Encode<
8699                fidl::encoding::HandleType<
8700                    fdomain_client::Socket,
8701                    { fidl::ObjectType::SOCKET.into_raw() },
8702                    2147483648,
8703                >,
8704                fdomain_client::fidl::FDomainResourceDialect,
8705            >,
8706        T1: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
8707    > fidl::encoding::Encode<Input, fdomain_client::fidl::FDomainResourceDialect> for (T0, T1)
8708    {
8709        #[inline]
8710        unsafe fn encode(
8711            self,
8712            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8713            offset: usize,
8714            depth: fidl::encoding::Depth,
8715        ) -> fidl::Result<()> {
8716            encoder.debug_check_bounds::<Input>(offset);
8717            // Zero out padding regions. There's no need to apply masks
8718            // because the unmasked parts will be overwritten by fields.
8719            unsafe {
8720                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
8721                (ptr as *mut u64).write_unaligned(0);
8722            }
8723            // Write the fields.
8724            self.0.encode(encoder, offset + 0, depth)?;
8725            self.1.encode(encoder, offset + 8, depth)?;
8726            Ok(())
8727        }
8728    }
8729
8730    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Input {
8731        #[inline(always)]
8732        fn new_empty() -> Self {
8733            Self {
8734                socket: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
8735                size: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
8736            }
8737        }
8738
8739        #[inline]
8740        unsafe fn decode(
8741            &mut self,
8742            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8743            offset: usize,
8744            _depth: fidl::encoding::Depth,
8745        ) -> fidl::Result<()> {
8746            decoder.debug_check_bounds::<Self>(offset);
8747            // Verify that padding bytes are zero.
8748            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
8749            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8750            let mask = 0xffffffff00000000u64;
8751            let maskedval = padval & mask;
8752            if maskedval != 0 {
8753                return Err(fidl::Error::NonZeroPadding {
8754                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
8755                });
8756            }
8757            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
8758            fidl::decode!(
8759                u64,
8760                fdomain_client::fidl::FDomainResourceDialect,
8761                &mut self.size,
8762                decoder,
8763                offset + 8,
8764                _depth
8765            )?;
8766            Ok(())
8767        }
8768    }
8769
8770    impl fidl::encoding::ResourceTypeMarker for InstrumentedProcess {
8771        type Borrowed<'a> = &'a mut Self;
8772        fn take_or_borrow<'a>(
8773            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8774        ) -> Self::Borrowed<'a> {
8775            value
8776        }
8777    }
8778
8779    unsafe impl fidl::encoding::TypeMarker for InstrumentedProcess {
8780        type Owned = Self;
8781
8782        #[inline(always)]
8783        fn inline_align(_context: fidl::encoding::Context) -> usize {
8784            4
8785        }
8786
8787        #[inline(always)]
8788        fn inline_size(_context: fidl::encoding::Context) -> usize {
8789            8
8790        }
8791    }
8792
8793    unsafe impl
8794        fidl::encoding::Encode<InstrumentedProcess, fdomain_client::fidl::FDomainResourceDialect>
8795        for &mut InstrumentedProcess
8796    {
8797        #[inline]
8798        unsafe fn encode(
8799            self,
8800            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8801            offset: usize,
8802            _depth: fidl::encoding::Depth,
8803        ) -> fidl::Result<()> {
8804            encoder.debug_check_bounds::<InstrumentedProcess>(offset);
8805            // Delegate to tuple encoding.
8806            fidl::encoding::Encode::<
8807                InstrumentedProcess,
8808                fdomain_client::fidl::FDomainResourceDialect,
8809            >::encode(
8810                (
8811                    <fidl::encoding::HandleType<
8812                        fdomain_client::EventPair,
8813                        { fidl::ObjectType::EVENTPAIR.into_raw() },
8814                        2147483648,
8815                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8816                        &mut self.eventpair
8817                    ),
8818                    <fidl::encoding::HandleType<
8819                        fdomain_client::Process,
8820                        { fidl::ObjectType::PROCESS.into_raw() },
8821                        2147483648,
8822                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8823                        &mut self.process
8824                    ),
8825                ),
8826                encoder,
8827                offset,
8828                _depth,
8829            )
8830        }
8831    }
8832    unsafe impl<
8833        T0: fidl::encoding::Encode<
8834                fidl::encoding::HandleType<
8835                    fdomain_client::EventPair,
8836                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8837                    2147483648,
8838                >,
8839                fdomain_client::fidl::FDomainResourceDialect,
8840            >,
8841        T1: fidl::encoding::Encode<
8842                fidl::encoding::HandleType<
8843                    fdomain_client::Process,
8844                    { fidl::ObjectType::PROCESS.into_raw() },
8845                    2147483648,
8846                >,
8847                fdomain_client::fidl::FDomainResourceDialect,
8848            >,
8849    > fidl::encoding::Encode<InstrumentedProcess, fdomain_client::fidl::FDomainResourceDialect>
8850        for (T0, T1)
8851    {
8852        #[inline]
8853        unsafe fn encode(
8854            self,
8855            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8856            offset: usize,
8857            depth: fidl::encoding::Depth,
8858        ) -> fidl::Result<()> {
8859            encoder.debug_check_bounds::<InstrumentedProcess>(offset);
8860            // Zero out padding regions. There's no need to apply masks
8861            // because the unmasked parts will be overwritten by fields.
8862            // Write the fields.
8863            self.0.encode(encoder, offset + 0, depth)?;
8864            self.1.encode(encoder, offset + 4, depth)?;
8865            Ok(())
8866        }
8867    }
8868
8869    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8870        for InstrumentedProcess
8871    {
8872        #[inline(always)]
8873        fn new_empty() -> Self {
8874            Self {
8875                eventpair: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
8876                process: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
8877            }
8878        }
8879
8880        #[inline]
8881        unsafe fn decode(
8882            &mut self,
8883            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8884            offset: usize,
8885            _depth: fidl::encoding::Depth,
8886        ) -> fidl::Result<()> {
8887            decoder.debug_check_bounds::<Self>(offset);
8888            // Verify that padding bytes are zero.
8889            fidl::decode!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.eventpair, decoder, offset + 0, _depth)?;
8890            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.process, decoder, offset + 4, _depth)?;
8891            Ok(())
8892        }
8893    }
8894
8895    impl fidl::encoding::ResourceTypeMarker for ManagerConnectRequest {
8896        type Borrowed<'a> = &'a mut Self;
8897        fn take_or_borrow<'a>(
8898            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8899        ) -> Self::Borrowed<'a> {
8900            value
8901        }
8902    }
8903
8904    unsafe impl fidl::encoding::TypeMarker for ManagerConnectRequest {
8905        type Owned = Self;
8906
8907        #[inline(always)]
8908        fn inline_align(_context: fidl::encoding::Context) -> usize {
8909            8
8910        }
8911
8912        #[inline(always)]
8913        fn inline_size(_context: fidl::encoding::Context) -> usize {
8914            24
8915        }
8916    }
8917
8918    unsafe impl
8919        fidl::encoding::Encode<ManagerConnectRequest, fdomain_client::fidl::FDomainResourceDialect>
8920        for &mut ManagerConnectRequest
8921    {
8922        #[inline]
8923        unsafe fn encode(
8924            self,
8925            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8926            offset: usize,
8927            _depth: fidl::encoding::Depth,
8928        ) -> fidl::Result<()> {
8929            encoder.debug_check_bounds::<ManagerConnectRequest>(offset);
8930            // Delegate to tuple encoding.
8931            fidl::encoding::Encode::<ManagerConnectRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8932                (
8933                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.fuzzer_url),
8934                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
8935                ),
8936                encoder, offset, _depth
8937            )
8938        }
8939    }
8940    unsafe impl<
8941        T0: fidl::encoding::Encode<
8942                fidl::encoding::BoundedString<4096>,
8943                fdomain_client::fidl::FDomainResourceDialect,
8944            >,
8945        T1: fidl::encoding::Encode<
8946                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
8947                fdomain_client::fidl::FDomainResourceDialect,
8948            >,
8949    >
8950        fidl::encoding::Encode<ManagerConnectRequest, fdomain_client::fidl::FDomainResourceDialect>
8951        for (T0, T1)
8952    {
8953        #[inline]
8954        unsafe fn encode(
8955            self,
8956            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8957            offset: usize,
8958            depth: fidl::encoding::Depth,
8959        ) -> fidl::Result<()> {
8960            encoder.debug_check_bounds::<ManagerConnectRequest>(offset);
8961            // Zero out padding regions. There's no need to apply masks
8962            // because the unmasked parts will be overwritten by fields.
8963            unsafe {
8964                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8965                (ptr as *mut u64).write_unaligned(0);
8966            }
8967            // Write the fields.
8968            self.0.encode(encoder, offset + 0, depth)?;
8969            self.1.encode(encoder, offset + 16, depth)?;
8970            Ok(())
8971        }
8972    }
8973
8974    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8975        for ManagerConnectRequest
8976    {
8977        #[inline(always)]
8978        fn new_empty() -> Self {
8979            Self {
8980                fuzzer_url: fidl::new_empty!(
8981                    fidl::encoding::BoundedString<4096>,
8982                    fdomain_client::fidl::FDomainResourceDialect
8983                ),
8984                controller: fidl::new_empty!(
8985                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
8986                    fdomain_client::fidl::FDomainResourceDialect
8987                ),
8988            }
8989        }
8990
8991        #[inline]
8992        unsafe fn decode(
8993            &mut self,
8994            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8995            offset: usize,
8996            _depth: fidl::encoding::Depth,
8997        ) -> fidl::Result<()> {
8998            decoder.debug_check_bounds::<Self>(offset);
8999            // Verify that padding bytes are zero.
9000            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9001            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9002            let mask = 0xffffffff00000000u64;
9003            let maskedval = padval & mask;
9004            if maskedval != 0 {
9005                return Err(fidl::Error::NonZeroPadding {
9006                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9007                });
9008            }
9009            fidl::decode!(
9010                fidl::encoding::BoundedString<4096>,
9011                fdomain_client::fidl::FDomainResourceDialect,
9012                &mut self.fuzzer_url,
9013                decoder,
9014                offset + 0,
9015                _depth
9016            )?;
9017            fidl::decode!(
9018                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
9019                fdomain_client::fidl::FDomainResourceDialect,
9020                &mut self.controller,
9021                decoder,
9022                offset + 16,
9023                _depth
9024            )?;
9025            Ok(())
9026        }
9027    }
9028
9029    impl fidl::encoding::ResourceTypeMarker for ManagerGetOutputRequest {
9030        type Borrowed<'a> = &'a mut Self;
9031        fn take_or_borrow<'a>(
9032            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9033        ) -> Self::Borrowed<'a> {
9034            value
9035        }
9036    }
9037
9038    unsafe impl fidl::encoding::TypeMarker for ManagerGetOutputRequest {
9039        type Owned = Self;
9040
9041        #[inline(always)]
9042        fn inline_align(_context: fidl::encoding::Context) -> usize {
9043            8
9044        }
9045
9046        #[inline(always)]
9047        fn inline_size(_context: fidl::encoding::Context) -> usize {
9048            24
9049        }
9050    }
9051
9052    unsafe impl
9053        fidl::encoding::Encode<
9054            ManagerGetOutputRequest,
9055            fdomain_client::fidl::FDomainResourceDialect,
9056        > for &mut ManagerGetOutputRequest
9057    {
9058        #[inline]
9059        unsafe fn encode(
9060            self,
9061            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9062            offset: usize,
9063            _depth: fidl::encoding::Depth,
9064        ) -> fidl::Result<()> {
9065            encoder.debug_check_bounds::<ManagerGetOutputRequest>(offset);
9066            // Delegate to tuple encoding.
9067            fidl::encoding::Encode::<ManagerGetOutputRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
9068                (
9069                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.fuzzer_url),
9070                    <TestOutput as fidl::encoding::ValueTypeMarker>::borrow(&self.output),
9071                    <fidl::encoding::HandleType<fdomain_client::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.socket),
9072                ),
9073                encoder, offset, _depth
9074            )
9075        }
9076    }
9077    unsafe impl<
9078        T0: fidl::encoding::Encode<
9079                fidl::encoding::BoundedString<4096>,
9080                fdomain_client::fidl::FDomainResourceDialect,
9081            >,
9082        T1: fidl::encoding::Encode<TestOutput, fdomain_client::fidl::FDomainResourceDialect>,
9083        T2: fidl::encoding::Encode<
9084                fidl::encoding::HandleType<
9085                    fdomain_client::Socket,
9086                    { fidl::ObjectType::SOCKET.into_raw() },
9087                    2147483648,
9088                >,
9089                fdomain_client::fidl::FDomainResourceDialect,
9090            >,
9091    >
9092        fidl::encoding::Encode<
9093            ManagerGetOutputRequest,
9094            fdomain_client::fidl::FDomainResourceDialect,
9095        > for (T0, T1, T2)
9096    {
9097        #[inline]
9098        unsafe fn encode(
9099            self,
9100            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9101            offset: usize,
9102            depth: fidl::encoding::Depth,
9103        ) -> fidl::Result<()> {
9104            encoder.debug_check_bounds::<ManagerGetOutputRequest>(offset);
9105            // Zero out padding regions. There's no need to apply masks
9106            // because the unmasked parts will be overwritten by fields.
9107            // Write the fields.
9108            self.0.encode(encoder, offset + 0, depth)?;
9109            self.1.encode(encoder, offset + 16, depth)?;
9110            self.2.encode(encoder, offset + 20, depth)?;
9111            Ok(())
9112        }
9113    }
9114
9115    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9116        for ManagerGetOutputRequest
9117    {
9118        #[inline(always)]
9119        fn new_empty() -> Self {
9120            Self {
9121                fuzzer_url: fidl::new_empty!(
9122                    fidl::encoding::BoundedString<4096>,
9123                    fdomain_client::fidl::FDomainResourceDialect
9124                ),
9125                output: fidl::new_empty!(TestOutput, fdomain_client::fidl::FDomainResourceDialect),
9126                socket: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
9127            }
9128        }
9129
9130        #[inline]
9131        unsafe fn decode(
9132            &mut self,
9133            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9134            offset: usize,
9135            _depth: fidl::encoding::Depth,
9136        ) -> fidl::Result<()> {
9137            decoder.debug_check_bounds::<Self>(offset);
9138            // Verify that padding bytes are zero.
9139            fidl::decode!(
9140                fidl::encoding::BoundedString<4096>,
9141                fdomain_client::fidl::FDomainResourceDialect,
9142                &mut self.fuzzer_url,
9143                decoder,
9144                offset + 0,
9145                _depth
9146            )?;
9147            fidl::decode!(
9148                TestOutput,
9149                fdomain_client::fidl::FDomainResourceDialect,
9150                &mut self.output,
9151                decoder,
9152                offset + 16,
9153                _depth
9154            )?;
9155            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.socket, decoder, offset + 20, _depth)?;
9156            Ok(())
9157        }
9158    }
9159
9160    impl fidl::encoding::ResourceTypeMarker for RegistrarRegisterRequest {
9161        type Borrowed<'a> = &'a mut Self;
9162        fn take_or_borrow<'a>(
9163            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9164        ) -> Self::Borrowed<'a> {
9165            value
9166        }
9167    }
9168
9169    unsafe impl fidl::encoding::TypeMarker for RegistrarRegisterRequest {
9170        type Owned = Self;
9171
9172        #[inline(always)]
9173        fn inline_align(_context: fidl::encoding::Context) -> usize {
9174            8
9175        }
9176
9177        #[inline(always)]
9178        fn inline_size(_context: fidl::encoding::Context) -> usize {
9179            24
9180        }
9181    }
9182
9183    unsafe impl
9184        fidl::encoding::Encode<
9185            RegistrarRegisterRequest,
9186            fdomain_client::fidl::FDomainResourceDialect,
9187        > for &mut RegistrarRegisterRequest
9188    {
9189        #[inline]
9190        unsafe fn encode(
9191            self,
9192            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9193            offset: usize,
9194            _depth: fidl::encoding::Depth,
9195        ) -> fidl::Result<()> {
9196            encoder.debug_check_bounds::<RegistrarRegisterRequest>(offset);
9197            // Delegate to tuple encoding.
9198            fidl::encoding::Encode::<RegistrarRegisterRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
9199                (
9200                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.fuzzer_url),
9201                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ControllerProviderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.provider),
9202                ),
9203                encoder, offset, _depth
9204            )
9205        }
9206    }
9207    unsafe impl<
9208        T0: fidl::encoding::Encode<
9209                fidl::encoding::BoundedString<4096>,
9210                fdomain_client::fidl::FDomainResourceDialect,
9211            >,
9212        T1: fidl::encoding::Encode<
9213                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ControllerProviderMarker>>,
9214                fdomain_client::fidl::FDomainResourceDialect,
9215            >,
9216    >
9217        fidl::encoding::Encode<
9218            RegistrarRegisterRequest,
9219            fdomain_client::fidl::FDomainResourceDialect,
9220        > for (T0, T1)
9221    {
9222        #[inline]
9223        unsafe fn encode(
9224            self,
9225            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9226            offset: usize,
9227            depth: fidl::encoding::Depth,
9228        ) -> fidl::Result<()> {
9229            encoder.debug_check_bounds::<RegistrarRegisterRequest>(offset);
9230            // Zero out padding regions. There's no need to apply masks
9231            // because the unmasked parts will be overwritten by fields.
9232            unsafe {
9233                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9234                (ptr as *mut u64).write_unaligned(0);
9235            }
9236            // Write the fields.
9237            self.0.encode(encoder, offset + 0, depth)?;
9238            self.1.encode(encoder, offset + 16, depth)?;
9239            Ok(())
9240        }
9241    }
9242
9243    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9244        for RegistrarRegisterRequest
9245    {
9246        #[inline(always)]
9247        fn new_empty() -> Self {
9248            Self {
9249                fuzzer_url: fidl::new_empty!(
9250                    fidl::encoding::BoundedString<4096>,
9251                    fdomain_client::fidl::FDomainResourceDialect
9252                ),
9253                provider: fidl::new_empty!(
9254                    fidl::encoding::Endpoint<
9255                        fdomain_client::fidl::ClientEnd<ControllerProviderMarker>,
9256                    >,
9257                    fdomain_client::fidl::FDomainResourceDialect
9258                ),
9259            }
9260        }
9261
9262        #[inline]
9263        unsafe fn decode(
9264            &mut self,
9265            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9266            offset: usize,
9267            _depth: fidl::encoding::Depth,
9268        ) -> fidl::Result<()> {
9269            decoder.debug_check_bounds::<Self>(offset);
9270            // Verify that padding bytes are zero.
9271            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9272            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9273            let mask = 0xffffffff00000000u64;
9274            let maskedval = padval & mask;
9275            if maskedval != 0 {
9276                return Err(fidl::Error::NonZeroPadding {
9277                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9278                });
9279            }
9280            fidl::decode!(
9281                fidl::encoding::BoundedString<4096>,
9282                fdomain_client::fidl::FDomainResourceDialect,
9283                &mut self.fuzzer_url,
9284                decoder,
9285                offset + 0,
9286                _depth
9287            )?;
9288            fidl::decode!(
9289                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ControllerProviderMarker>>,
9290                fdomain_client::fidl::FDomainResourceDialect,
9291                &mut self.provider,
9292                decoder,
9293                offset + 16,
9294                _depth
9295            )?;
9296            Ok(())
9297        }
9298    }
9299
9300    impl fidl::encoding::ResourceTypeMarker for RegistryConnectRequest {
9301        type Borrowed<'a> = &'a mut Self;
9302        fn take_or_borrow<'a>(
9303            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9304        ) -> Self::Borrowed<'a> {
9305            value
9306        }
9307    }
9308
9309    unsafe impl fidl::encoding::TypeMarker for RegistryConnectRequest {
9310        type Owned = Self;
9311
9312        #[inline(always)]
9313        fn inline_align(_context: fidl::encoding::Context) -> usize {
9314            8
9315        }
9316
9317        #[inline(always)]
9318        fn inline_size(_context: fidl::encoding::Context) -> usize {
9319            32
9320        }
9321    }
9322
9323    unsafe impl
9324        fidl::encoding::Encode<RegistryConnectRequest, fdomain_client::fidl::FDomainResourceDialect>
9325        for &mut RegistryConnectRequest
9326    {
9327        #[inline]
9328        unsafe fn encode(
9329            self,
9330            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9331            offset: usize,
9332            _depth: fidl::encoding::Depth,
9333        ) -> fidl::Result<()> {
9334            encoder.debug_check_bounds::<RegistryConnectRequest>(offset);
9335            // Delegate to tuple encoding.
9336            fidl::encoding::Encode::<RegistryConnectRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
9337                (
9338                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.fuzzer_url),
9339                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
9340                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timeout),
9341                ),
9342                encoder, offset, _depth
9343            )
9344        }
9345    }
9346    unsafe impl<
9347        T0: fidl::encoding::Encode<
9348                fidl::encoding::BoundedString<4096>,
9349                fdomain_client::fidl::FDomainResourceDialect,
9350            >,
9351        T1: fidl::encoding::Encode<
9352                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
9353                fdomain_client::fidl::FDomainResourceDialect,
9354            >,
9355        T2: fidl::encoding::Encode<i64, fdomain_client::fidl::FDomainResourceDialect>,
9356    >
9357        fidl::encoding::Encode<RegistryConnectRequest, fdomain_client::fidl::FDomainResourceDialect>
9358        for (T0, T1, T2)
9359    {
9360        #[inline]
9361        unsafe fn encode(
9362            self,
9363            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9364            offset: usize,
9365            depth: fidl::encoding::Depth,
9366        ) -> fidl::Result<()> {
9367            encoder.debug_check_bounds::<RegistryConnectRequest>(offset);
9368            // Zero out padding regions. There's no need to apply masks
9369            // because the unmasked parts will be overwritten by fields.
9370            unsafe {
9371                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9372                (ptr as *mut u64).write_unaligned(0);
9373            }
9374            // Write the fields.
9375            self.0.encode(encoder, offset + 0, depth)?;
9376            self.1.encode(encoder, offset + 16, depth)?;
9377            self.2.encode(encoder, offset + 24, depth)?;
9378            Ok(())
9379        }
9380    }
9381
9382    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9383        for RegistryConnectRequest
9384    {
9385        #[inline(always)]
9386        fn new_empty() -> Self {
9387            Self {
9388                fuzzer_url: fidl::new_empty!(
9389                    fidl::encoding::BoundedString<4096>,
9390                    fdomain_client::fidl::FDomainResourceDialect
9391                ),
9392                controller: fidl::new_empty!(
9393                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
9394                    fdomain_client::fidl::FDomainResourceDialect
9395                ),
9396                timeout: fidl::new_empty!(i64, fdomain_client::fidl::FDomainResourceDialect),
9397            }
9398        }
9399
9400        #[inline]
9401        unsafe fn decode(
9402            &mut self,
9403            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9404            offset: usize,
9405            _depth: fidl::encoding::Depth,
9406        ) -> fidl::Result<()> {
9407            decoder.debug_check_bounds::<Self>(offset);
9408            // Verify that padding bytes are zero.
9409            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9410            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9411            let mask = 0xffffffff00000000u64;
9412            let maskedval = padval & mask;
9413            if maskedval != 0 {
9414                return Err(fidl::Error::NonZeroPadding {
9415                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9416                });
9417            }
9418            fidl::decode!(
9419                fidl::encoding::BoundedString<4096>,
9420                fdomain_client::fidl::FDomainResourceDialect,
9421                &mut self.fuzzer_url,
9422                decoder,
9423                offset + 0,
9424                _depth
9425            )?;
9426            fidl::decode!(
9427                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
9428                fdomain_client::fidl::FDomainResourceDialect,
9429                &mut self.controller,
9430                decoder,
9431                offset + 16,
9432                _depth
9433            )?;
9434            fidl::decode!(
9435                i64,
9436                fdomain_client::fidl::FDomainResourceDialect,
9437                &mut self.timeout,
9438                decoder,
9439                offset + 24,
9440                _depth
9441            )?;
9442            Ok(())
9443        }
9444    }
9445
9446    impl fidl::encoding::ResourceTypeMarker for TargetAdapterConnectRequest {
9447        type Borrowed<'a> = &'a mut Self;
9448        fn take_or_borrow<'a>(
9449            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9450        ) -> Self::Borrowed<'a> {
9451            value
9452        }
9453    }
9454
9455    unsafe impl fidl::encoding::TypeMarker for TargetAdapterConnectRequest {
9456        type Owned = Self;
9457
9458        #[inline(always)]
9459        fn inline_align(_context: fidl::encoding::Context) -> usize {
9460            4
9461        }
9462
9463        #[inline(always)]
9464        fn inline_size(_context: fidl::encoding::Context) -> usize {
9465            8
9466        }
9467    }
9468
9469    unsafe impl
9470        fidl::encoding::Encode<
9471            TargetAdapterConnectRequest,
9472            fdomain_client::fidl::FDomainResourceDialect,
9473        > for &mut TargetAdapterConnectRequest
9474    {
9475        #[inline]
9476        unsafe fn encode(
9477            self,
9478            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9479            offset: usize,
9480            _depth: fidl::encoding::Depth,
9481        ) -> fidl::Result<()> {
9482            encoder.debug_check_bounds::<TargetAdapterConnectRequest>(offset);
9483            // Delegate to tuple encoding.
9484            fidl::encoding::Encode::<
9485                TargetAdapterConnectRequest,
9486                fdomain_client::fidl::FDomainResourceDialect,
9487            >::encode(
9488                (
9489                    <fidl::encoding::HandleType<
9490                        fdomain_client::EventPair,
9491                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9492                        2147483648,
9493                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9494                        &mut self.eventpair
9495                    ),
9496                    <fidl::encoding::HandleType<
9497                        fdomain_client::Vmo,
9498                        { fidl::ObjectType::VMO.into_raw() },
9499                        2147483648,
9500                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9501                        &mut self.test_input
9502                    ),
9503                ),
9504                encoder,
9505                offset,
9506                _depth,
9507            )
9508        }
9509    }
9510    unsafe impl<
9511        T0: fidl::encoding::Encode<
9512                fidl::encoding::HandleType<
9513                    fdomain_client::EventPair,
9514                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9515                    2147483648,
9516                >,
9517                fdomain_client::fidl::FDomainResourceDialect,
9518            >,
9519        T1: fidl::encoding::Encode<
9520                fidl::encoding::HandleType<
9521                    fdomain_client::Vmo,
9522                    { fidl::ObjectType::VMO.into_raw() },
9523                    2147483648,
9524                >,
9525                fdomain_client::fidl::FDomainResourceDialect,
9526            >,
9527    >
9528        fidl::encoding::Encode<
9529            TargetAdapterConnectRequest,
9530            fdomain_client::fidl::FDomainResourceDialect,
9531        > for (T0, T1)
9532    {
9533        #[inline]
9534        unsafe fn encode(
9535            self,
9536            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9537            offset: usize,
9538            depth: fidl::encoding::Depth,
9539        ) -> fidl::Result<()> {
9540            encoder.debug_check_bounds::<TargetAdapterConnectRequest>(offset);
9541            // Zero out padding regions. There's no need to apply masks
9542            // because the unmasked parts will be overwritten by fields.
9543            // Write the fields.
9544            self.0.encode(encoder, offset + 0, depth)?;
9545            self.1.encode(encoder, offset + 4, depth)?;
9546            Ok(())
9547        }
9548    }
9549
9550    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9551        for TargetAdapterConnectRequest
9552    {
9553        #[inline(always)]
9554        fn new_empty() -> Self {
9555            Self {
9556                eventpair: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
9557                test_input: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
9558            }
9559        }
9560
9561        #[inline]
9562        unsafe fn decode(
9563            &mut self,
9564            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9565            offset: usize,
9566            _depth: fidl::encoding::Depth,
9567        ) -> fidl::Result<()> {
9568            decoder.debug_check_bounds::<Self>(offset);
9569            // Verify that padding bytes are zero.
9570            fidl::decode!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.eventpair, decoder, offset + 0, _depth)?;
9571            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.test_input, decoder, offset + 4, _depth)?;
9572            Ok(())
9573        }
9574    }
9575
9576    impl Artifact {
9577        #[inline(always)]
9578        fn max_ordinal_present(&self) -> u64 {
9579            if let Some(_) = self.error {
9580                return 3;
9581            }
9582            if let Some(_) = self.input {
9583                return 2;
9584            }
9585            if let Some(_) = self.result {
9586                return 1;
9587            }
9588            0
9589        }
9590    }
9591
9592    impl fidl::encoding::ResourceTypeMarker for Artifact {
9593        type Borrowed<'a> = &'a mut Self;
9594        fn take_or_borrow<'a>(
9595            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9596        ) -> Self::Borrowed<'a> {
9597            value
9598        }
9599    }
9600
9601    unsafe impl fidl::encoding::TypeMarker for Artifact {
9602        type Owned = Self;
9603
9604        #[inline(always)]
9605        fn inline_align(_context: fidl::encoding::Context) -> usize {
9606            8
9607        }
9608
9609        #[inline(always)]
9610        fn inline_size(_context: fidl::encoding::Context) -> usize {
9611            16
9612        }
9613    }
9614
9615    unsafe impl fidl::encoding::Encode<Artifact, fdomain_client::fidl::FDomainResourceDialect>
9616        for &mut Artifact
9617    {
9618        unsafe fn encode(
9619            self,
9620            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9621            offset: usize,
9622            mut depth: fidl::encoding::Depth,
9623        ) -> fidl::Result<()> {
9624            encoder.debug_check_bounds::<Artifact>(offset);
9625            // Vector header
9626            let max_ordinal: u64 = self.max_ordinal_present();
9627            encoder.write_num(max_ordinal, offset);
9628            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9629            // Calling encoder.out_of_line_offset(0) is not allowed.
9630            if max_ordinal == 0 {
9631                return Ok(());
9632            }
9633            depth.increment()?;
9634            let envelope_size = 8;
9635            let bytes_len = max_ordinal as usize * envelope_size;
9636            #[allow(unused_variables)]
9637            let offset = encoder.out_of_line_offset(bytes_len);
9638            let mut _prev_end_offset: usize = 0;
9639            if 1 > max_ordinal {
9640                return Ok(());
9641            }
9642
9643            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9644            // are envelope_size bytes.
9645            let cur_offset: usize = (1 - 1) * envelope_size;
9646
9647            // Zero reserved fields.
9648            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9649
9650            // Safety:
9651            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9652            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9653            //   envelope_size bytes, there is always sufficient room.
9654            fidl::encoding::encode_in_envelope_optional::<
9655                Result_,
9656                fdomain_client::fidl::FDomainResourceDialect,
9657            >(
9658                self.result.as_ref().map(<Result_ as fidl::encoding::ValueTypeMarker>::borrow),
9659                encoder,
9660                offset + cur_offset,
9661                depth,
9662            )?;
9663
9664            _prev_end_offset = cur_offset + envelope_size;
9665            if 2 > max_ordinal {
9666                return Ok(());
9667            }
9668
9669            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9670            // are envelope_size bytes.
9671            let cur_offset: usize = (2 - 1) * envelope_size;
9672
9673            // Zero reserved fields.
9674            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9675
9676            // Safety:
9677            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9678            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9679            //   envelope_size bytes, there is always sufficient room.
9680            fidl::encoding::encode_in_envelope_optional::<
9681                Input,
9682                fdomain_client::fidl::FDomainResourceDialect,
9683            >(
9684                self.input
9685                    .as_mut()
9686                    .map(<Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9687                encoder,
9688                offset + cur_offset,
9689                depth,
9690            )?;
9691
9692            _prev_end_offset = cur_offset + envelope_size;
9693            if 3 > max_ordinal {
9694                return Ok(());
9695            }
9696
9697            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9698            // are envelope_size bytes.
9699            let cur_offset: usize = (3 - 1) * envelope_size;
9700
9701            // Zero reserved fields.
9702            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9703
9704            // Safety:
9705            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9706            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9707            //   envelope_size bytes, there is always sufficient room.
9708            fidl::encoding::encode_in_envelope_optional::<
9709                i32,
9710                fdomain_client::fidl::FDomainResourceDialect,
9711            >(
9712                self.error.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
9713                encoder,
9714                offset + cur_offset,
9715                depth,
9716            )?;
9717
9718            _prev_end_offset = cur_offset + envelope_size;
9719
9720            Ok(())
9721        }
9722    }
9723
9724    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Artifact {
9725        #[inline(always)]
9726        fn new_empty() -> Self {
9727            Self::default()
9728        }
9729
9730        unsafe fn decode(
9731            &mut self,
9732            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9733            offset: usize,
9734            mut depth: fidl::encoding::Depth,
9735        ) -> fidl::Result<()> {
9736            decoder.debug_check_bounds::<Self>(offset);
9737            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9738                None => return Err(fidl::Error::NotNullable),
9739                Some(len) => len,
9740            };
9741            // Calling decoder.out_of_line_offset(0) is not allowed.
9742            if len == 0 {
9743                return Ok(());
9744            };
9745            depth.increment()?;
9746            let envelope_size = 8;
9747            let bytes_len = len * envelope_size;
9748            let offset = decoder.out_of_line_offset(bytes_len)?;
9749            // Decode the envelope for each type.
9750            let mut _next_ordinal_to_read = 0;
9751            let mut next_offset = offset;
9752            let end_offset = offset + bytes_len;
9753            _next_ordinal_to_read += 1;
9754            if next_offset >= end_offset {
9755                return Ok(());
9756            }
9757
9758            // Decode unknown envelopes for gaps in ordinals.
9759            while _next_ordinal_to_read < 1 {
9760                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9761                _next_ordinal_to_read += 1;
9762                next_offset += envelope_size;
9763            }
9764
9765            let next_out_of_line = decoder.next_out_of_line();
9766            let handles_before = decoder.remaining_handles();
9767            if let Some((inlined, num_bytes, num_handles)) =
9768                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9769            {
9770                let member_inline_size =
9771                    <Result_ as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9772                if inlined != (member_inline_size <= 4) {
9773                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9774                }
9775                let inner_offset;
9776                let mut inner_depth = depth.clone();
9777                if inlined {
9778                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9779                    inner_offset = next_offset;
9780                } else {
9781                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9782                    inner_depth.increment()?;
9783                }
9784                let val_ref = self.result.get_or_insert_with(|| {
9785                    fidl::new_empty!(Result_, fdomain_client::fidl::FDomainResourceDialect)
9786                });
9787                fidl::decode!(
9788                    Result_,
9789                    fdomain_client::fidl::FDomainResourceDialect,
9790                    val_ref,
9791                    decoder,
9792                    inner_offset,
9793                    inner_depth
9794                )?;
9795                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9796                {
9797                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9798                }
9799                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9800                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9801                }
9802            }
9803
9804            next_offset += envelope_size;
9805            _next_ordinal_to_read += 1;
9806            if next_offset >= end_offset {
9807                return Ok(());
9808            }
9809
9810            // Decode unknown envelopes for gaps in ordinals.
9811            while _next_ordinal_to_read < 2 {
9812                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9813                _next_ordinal_to_read += 1;
9814                next_offset += envelope_size;
9815            }
9816
9817            let next_out_of_line = decoder.next_out_of_line();
9818            let handles_before = decoder.remaining_handles();
9819            if let Some((inlined, num_bytes, num_handles)) =
9820                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9821            {
9822                let member_inline_size =
9823                    <Input as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9824                if inlined != (member_inline_size <= 4) {
9825                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9826                }
9827                let inner_offset;
9828                let mut inner_depth = depth.clone();
9829                if inlined {
9830                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9831                    inner_offset = next_offset;
9832                } else {
9833                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9834                    inner_depth.increment()?;
9835                }
9836                let val_ref = self.input.get_or_insert_with(|| {
9837                    fidl::new_empty!(Input, fdomain_client::fidl::FDomainResourceDialect)
9838                });
9839                fidl::decode!(
9840                    Input,
9841                    fdomain_client::fidl::FDomainResourceDialect,
9842                    val_ref,
9843                    decoder,
9844                    inner_offset,
9845                    inner_depth
9846                )?;
9847                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9848                {
9849                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9850                }
9851                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9852                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9853                }
9854            }
9855
9856            next_offset += envelope_size;
9857            _next_ordinal_to_read += 1;
9858            if next_offset >= end_offset {
9859                return Ok(());
9860            }
9861
9862            // Decode unknown envelopes for gaps in ordinals.
9863            while _next_ordinal_to_read < 3 {
9864                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9865                _next_ordinal_to_read += 1;
9866                next_offset += envelope_size;
9867            }
9868
9869            let next_out_of_line = decoder.next_out_of_line();
9870            let handles_before = decoder.remaining_handles();
9871            if let Some((inlined, num_bytes, num_handles)) =
9872                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9873            {
9874                let member_inline_size =
9875                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9876                if inlined != (member_inline_size <= 4) {
9877                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9878                }
9879                let inner_offset;
9880                let mut inner_depth = depth.clone();
9881                if inlined {
9882                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9883                    inner_offset = next_offset;
9884                } else {
9885                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9886                    inner_depth.increment()?;
9887                }
9888                let val_ref = self.error.get_or_insert_with(|| {
9889                    fidl::new_empty!(i32, fdomain_client::fidl::FDomainResourceDialect)
9890                });
9891                fidl::decode!(
9892                    i32,
9893                    fdomain_client::fidl::FDomainResourceDialect,
9894                    val_ref,
9895                    decoder,
9896                    inner_offset,
9897                    inner_depth
9898                )?;
9899                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9900                {
9901                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9902                }
9903                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9904                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9905                }
9906            }
9907
9908            next_offset += envelope_size;
9909
9910            // Decode the remaining unknown envelopes.
9911            while next_offset < end_offset {
9912                _next_ordinal_to_read += 1;
9913                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9914                next_offset += envelope_size;
9915            }
9916
9917            Ok(())
9918        }
9919    }
9920
9921    impl fidl::encoding::ResourceTypeMarker for Data {
9922        type Borrowed<'a> = &'a mut Self;
9923        fn take_or_borrow<'a>(
9924            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9925        ) -> Self::Borrowed<'a> {
9926            value
9927        }
9928    }
9929
9930    unsafe impl fidl::encoding::TypeMarker for Data {
9931        type Owned = Self;
9932
9933        #[inline(always)]
9934        fn inline_align(_context: fidl::encoding::Context) -> usize {
9935            8
9936        }
9937
9938        #[inline(always)]
9939        fn inline_size(_context: fidl::encoding::Context) -> usize {
9940            16
9941        }
9942    }
9943
9944    unsafe impl fidl::encoding::Encode<Data, fdomain_client::fidl::FDomainResourceDialect>
9945        for &mut Data
9946    {
9947        #[inline]
9948        unsafe fn encode(
9949            self,
9950            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9951            offset: usize,
9952            _depth: fidl::encoding::Depth,
9953        ) -> fidl::Result<()> {
9954            encoder.debug_check_bounds::<Data>(offset);
9955            encoder.write_num::<u64>(self.ordinal(), offset);
9956            match self {
9957                Data::Instrumented(ref mut val) => fidl::encoding::encode_in_envelope::<
9958                    InstrumentedProcess,
9959                    fdomain_client::fidl::FDomainResourceDialect,
9960                >(
9961                    <InstrumentedProcess as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9962                        val,
9963                    ),
9964                    encoder,
9965                    offset + 8,
9966                    _depth,
9967                ),
9968                Data::Inline8bitCounters(ref mut val) => fidl::encoding::encode_in_envelope::<
9969                    fidl::encoding::HandleType<
9970                        fdomain_client::Vmo,
9971                        { fidl::ObjectType::VMO.into_raw() },
9972                        2147483648,
9973                    >,
9974                    fdomain_client::fidl::FDomainResourceDialect,
9975                >(
9976                    <fidl::encoding::HandleType<
9977                        fdomain_client::Vmo,
9978                        { fidl::ObjectType::VMO.into_raw() },
9979                        2147483648,
9980                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9981                        val
9982                    ),
9983                    encoder,
9984                    offset + 8,
9985                    _depth,
9986                ),
9987                Data::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
9988            }
9989        }
9990    }
9991
9992    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Data {
9993        #[inline(always)]
9994        fn new_empty() -> Self {
9995            Self::__SourceBreaking { unknown_ordinal: 0 }
9996        }
9997
9998        #[inline]
9999        unsafe fn decode(
10000            &mut self,
10001            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10002            offset: usize,
10003            mut depth: fidl::encoding::Depth,
10004        ) -> fidl::Result<()> {
10005            decoder.debug_check_bounds::<Self>(offset);
10006            #[allow(unused_variables)]
10007            let next_out_of_line = decoder.next_out_of_line();
10008            let handles_before = decoder.remaining_handles();
10009            let (ordinal, inlined, num_bytes, num_handles) =
10010                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
10011
10012            let member_inline_size = match ordinal {
10013                1 => <InstrumentedProcess as fidl::encoding::TypeMarker>::inline_size(
10014                    decoder.context,
10015                ),
10016                2 => <fidl::encoding::HandleType<
10017                    fdomain_client::Vmo,
10018                    { fidl::ObjectType::VMO.into_raw() },
10019                    2147483648,
10020                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10021                0 => return Err(fidl::Error::UnknownUnionTag),
10022                _ => num_bytes as usize,
10023            };
10024
10025            if inlined != (member_inline_size <= 4) {
10026                return Err(fidl::Error::InvalidInlineBitInEnvelope);
10027            }
10028            let _inner_offset;
10029            if inlined {
10030                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
10031                _inner_offset = offset + 8;
10032            } else {
10033                depth.increment()?;
10034                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10035            }
10036            match ordinal {
10037                1 => {
10038                    #[allow(irrefutable_let_patterns)]
10039                    if let Data::Instrumented(_) = self {
10040                        // Do nothing, read the value into the object
10041                    } else {
10042                        // Initialize `self` to the right variant
10043                        *self = Data::Instrumented(fidl::new_empty!(
10044                            InstrumentedProcess,
10045                            fdomain_client::fidl::FDomainResourceDialect
10046                        ));
10047                    }
10048                    #[allow(irrefutable_let_patterns)]
10049                    if let Data::Instrumented(ref mut val) = self {
10050                        fidl::decode!(
10051                            InstrumentedProcess,
10052                            fdomain_client::fidl::FDomainResourceDialect,
10053                            val,
10054                            decoder,
10055                            _inner_offset,
10056                            depth
10057                        )?;
10058                    } else {
10059                        unreachable!()
10060                    }
10061                }
10062                2 => {
10063                    #[allow(irrefutable_let_patterns)]
10064                    if let Data::Inline8bitCounters(_) = self {
10065                        // Do nothing, read the value into the object
10066                    } else {
10067                        // Initialize `self` to the right variant
10068                        *self = Data::Inline8bitCounters(
10069                            fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
10070                        );
10071                    }
10072                    #[allow(irrefutable_let_patterns)]
10073                    if let Data::Inline8bitCounters(ref mut val) = self {
10074                        fidl::decode!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val, decoder, _inner_offset, depth)?;
10075                    } else {
10076                        unreachable!()
10077                    }
10078                }
10079                #[allow(deprecated)]
10080                ordinal => {
10081                    for _ in 0..num_handles {
10082                        decoder.drop_next_handle()?;
10083                    }
10084                    *self = Data::__SourceBreaking { unknown_ordinal: ordinal };
10085                }
10086            }
10087            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
10088                return Err(fidl::Error::InvalidNumBytesInEnvelope);
10089            }
10090            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10091                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10092            }
10093            Ok(())
10094        }
10095    }
10096}