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