Skip to main content

fidl_fuchsia_fuzzer/
fidl_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 fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_fuzzer_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct ControllerAddMonitorRequest {
16    pub monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20    for ControllerAddMonitorRequest
21{
22}
23
24#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
25pub struct ControllerAddToCorpusRequest {
26    pub corpus: Corpus,
27    pub input: Input,
28}
29
30impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
31    for ControllerAddToCorpusRequest
32{
33}
34
35#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36pub struct ControllerCleanseRequest {
37    pub test_input: Input,
38}
39
40impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ControllerCleanseRequest {}
41
42#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
43pub struct ControllerMinimizeRequest {
44    pub test_input: Input,
45}
46
47impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ControllerMinimizeRequest {}
48
49#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
50pub struct ControllerProviderConnectRequest {
51    pub controller: fidl::endpoints::ServerEnd<ControllerMarker>,
52}
53
54impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
55    for ControllerProviderConnectRequest
56{
57}
58
59#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
60pub struct ControllerReadCorpusRequest {
61    pub corpus: Corpus,
62    pub corpus_reader: fidl::endpoints::ClientEnd<CorpusReaderMarker>,
63}
64
65impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
66    for ControllerReadCorpusRequest
67{
68}
69
70#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
71pub struct ControllerReadDictionaryResponse {
72    pub dictionary: Input,
73}
74
75impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
76    for ControllerReadDictionaryResponse
77{
78}
79
80#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
81pub struct ControllerTryOneRequest {
82    pub test_input: Input,
83}
84
85impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ControllerTryOneRequest {}
86
87#[derive(Debug, PartialEq)]
88pub struct ControllerWatchArtifactResponse {
89    pub artifact: Artifact,
90}
91
92impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
93    for ControllerWatchArtifactResponse
94{
95}
96
97#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
98pub struct ControllerWriteDictionaryRequest {
99    pub dictionary: Input,
100}
101
102impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
103    for ControllerWriteDictionaryRequest
104{
105}
106
107#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
108pub struct CorpusReaderNextRequest {
109    pub test_input: Input,
110}
111
112impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CorpusReaderNextRequest {}
113
114/// Represents an instrumented target process or the code coverage it is sharing.
115#[derive(Debug, PartialEq)]
116pub struct CoverageData {
117    pub target_id: u64,
118    pub data: Data,
119}
120
121impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CoverageData {}
122
123#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
124pub struct CoverageDataCollectorAddInline8bitCountersRequest {
125    pub inline_8bit_counters: fidl::Vmo,
126}
127
128impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
129    for CoverageDataCollectorAddInline8bitCountersRequest
130{
131}
132
133#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
134pub struct CoverageDataCollectorInitializeRequest {
135    pub eventpair: fidl::EventPair,
136    pub process: fidl::Process,
137}
138
139impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
140    for CoverageDataCollectorInitializeRequest
141{
142}
143
144#[derive(Debug, PartialEq)]
145pub struct CoverageDataProviderWatchCoverageDataResponse {
146    pub coverage_data: Vec<CoverageData>,
147}
148
149impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
150    for CoverageDataProviderWatchCoverageDataResponse
151{
152}
153
154/// Encapsulation of a fuzzer input transferred over a socket, e.g. between a
155/// host and device via overnet.
156#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
157pub struct Input {
158    /// Socket that can be used to read the data.
159    pub socket: fidl::Socket,
160    /// The total amount of data to be transferred.
161    pub size: u64,
162}
163
164impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Input {}
165
166/// Represents an instrumented target process under test.
167///
168/// This struct wraps the eventpair and process provided to `CoverageDataCollector.Initialize` and
169/// associates it with a unique per-`CoverageDataCollector`-client target id.
170#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
171pub struct InstrumentedProcess {
172    pub eventpair: fidl::EventPair,
173    pub process: fidl::Process,
174}
175
176impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for InstrumentedProcess {}
177
178#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
179pub struct ManagerConnectRequest {
180    pub fuzzer_url: String,
181    pub controller: fidl::endpoints::ServerEnd<ControllerMarker>,
182}
183
184impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ManagerConnectRequest {}
185
186#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
187pub struct ManagerGetOutputRequest {
188    pub fuzzer_url: String,
189    pub output: TestOutput,
190    pub socket: fidl::Socket,
191}
192
193impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ManagerGetOutputRequest {}
194
195#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
196pub struct RegistrarRegisterRequest {
197    pub fuzzer_url: String,
198    pub provider: fidl::endpoints::ClientEnd<ControllerProviderMarker>,
199}
200
201impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RegistrarRegisterRequest {}
202
203#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
204pub struct RegistryConnectRequest {
205    pub fuzzer_url: String,
206    pub controller: fidl::endpoints::ServerEnd<ControllerMarker>,
207    pub timeout: i64,
208}
209
210impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RegistryConnectRequest {}
211
212#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
213pub struct TargetAdapterConnectRequest {
214    pub eventpair: fidl::EventPair,
215    pub test_input: fidl::Vmo,
216}
217
218impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
219    for TargetAdapterConnectRequest
220{
221}
222
223/// Encapsulates the result of a long-running fuzzing workflow and optionally
224/// the input that caused it, depending on the workflow.
225#[derive(Debug, Default, PartialEq)]
226pub struct Artifact {
227    /// Result of executing the long-running workflow.
228    pub result: Option<Result_>,
229    /// Optional fuzzer input produced by a specific long-running workflow. This
230    /// may be:
231    ///
232    /// * A discovered input in the case of `Fuzz`
233    /// * A constructed input in the cases of `Cleanse` and `Minimize`.
234    /// * Omitted in the cases of `TryOne` and `Merge`.
235    pub input: Option<Input>,
236    /// An error generated during a long-running workflow. These errors are
237    /// distinct from those that result from validating workflow requests and
238    /// are documented for the workflow methods below. These errors result from
239    /// unexpected framework failure. For example, if libFuzzer fails due to an
240    /// internal error, the engine will report it via this field.
241    ///
242    /// The `result` and `input` fields are invalid if this field is present and
243    /// anything other than `ZX_OK`.
244    pub error: Option<i32>,
245    #[doc(hidden)]
246    pub __source_breaking: fidl::marker::SourceBreaking,
247}
248
249impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Artifact {}
250
251#[derive(Debug)]
252pub enum Data {
253    /// An instrumented target process under test.
254    Instrumented(InstrumentedProcess),
255    /// See https://clang.llvm.org/docs/SanitizerCoverage.html#inline-8bit-counters
256    Inline8bitCounters(fidl::Vmo),
257    #[doc(hidden)]
258    __SourceBreaking { unknown_ordinal: u64 },
259}
260
261/// Pattern that matches an unknown `Data` member.
262#[macro_export]
263macro_rules! DataUnknown {
264    () => {
265        _
266    };
267}
268
269// Custom PartialEq so that unknown variants are not equal to themselves.
270impl PartialEq for Data {
271    fn eq(&self, other: &Self) -> bool {
272        match (self, other) {
273            (Self::Instrumented(x), Self::Instrumented(y)) => *x == *y,
274            (Self::Inline8bitCounters(x), Self::Inline8bitCounters(y)) => *x == *y,
275            _ => false,
276        }
277    }
278}
279
280impl Data {
281    #[inline]
282    pub fn ordinal(&self) -> u64 {
283        match *self {
284            Self::Instrumented(_) => 1,
285            Self::Inline8bitCounters(_) => 2,
286            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
287        }
288    }
289
290    #[inline]
291    pub fn unknown_variant_for_testing() -> Self {
292        Self::__SourceBreaking { unknown_ordinal: 0 }
293    }
294
295    #[inline]
296    pub fn is_unknown(&self) -> bool {
297        match self {
298            Self::__SourceBreaking { .. } => true,
299            _ => false,
300        }
301    }
302}
303
304impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Data {}
305
306#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
307pub struct ControllerMarker;
308
309impl fidl::endpoints::ProtocolMarker for ControllerMarker {
310    type Proxy = ControllerProxy;
311    type RequestStream = ControllerRequestStream;
312    #[cfg(target_os = "fuchsia")]
313    type SynchronousProxy = ControllerSynchronousProxy;
314
315    const DEBUG_NAME: &'static str = "(anonymous) Controller";
316}
317pub type ControllerConfigureResult = Result<(), i32>;
318pub type ControllerAddToCorpusResult = Result<(), i32>;
319pub type ControllerWriteDictionaryResult = Result<(), i32>;
320pub type ControllerFuzzResult = Result<(), i32>;
321pub type ControllerTryOneResult = Result<(), i32>;
322pub type ControllerMinimizeResult = Result<(), i32>;
323pub type ControllerCleanseResult = Result<(), i32>;
324pub type ControllerMergeResult = Result<(), i32>;
325
326pub trait ControllerProxyInterface: Send + Sync {
327    type ConfigureResponseFut: std::future::Future<Output = Result<ControllerConfigureResult, fidl::Error>>
328        + Send;
329    fn r#configure(&self, options: &Options) -> Self::ConfigureResponseFut;
330    type GetOptionsResponseFut: std::future::Future<Output = Result<Options, fidl::Error>> + Send;
331    fn r#get_options(&self) -> Self::GetOptionsResponseFut;
332    type AddToCorpusResponseFut: std::future::Future<Output = Result<ControllerAddToCorpusResult, fidl::Error>>
333        + Send;
334    fn r#add_to_corpus(&self, corpus: Corpus, input: Input) -> Self::AddToCorpusResponseFut;
335    type ReadCorpusResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
336    fn r#read_corpus(
337        &self,
338        corpus: Corpus,
339        corpus_reader: fidl::endpoints::ClientEnd<CorpusReaderMarker>,
340    ) -> Self::ReadCorpusResponseFut;
341    type WriteDictionaryResponseFut: std::future::Future<Output = Result<ControllerWriteDictionaryResult, fidl::Error>>
342        + Send;
343    fn r#write_dictionary(&self, dictionary: Input) -> Self::WriteDictionaryResponseFut;
344    type ReadDictionaryResponseFut: std::future::Future<Output = Result<Input, fidl::Error>> + Send;
345    fn r#read_dictionary(&self) -> Self::ReadDictionaryResponseFut;
346    type AddMonitorResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
347    fn r#add_monitor(
348        &self,
349        monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
350    ) -> Self::AddMonitorResponseFut;
351    type FuzzResponseFut: std::future::Future<Output = Result<ControllerFuzzResult, fidl::Error>>
352        + Send;
353    fn r#fuzz(&self) -> Self::FuzzResponseFut;
354    type TryOneResponseFut: std::future::Future<Output = Result<ControllerTryOneResult, fidl::Error>>
355        + Send;
356    fn r#try_one(&self, test_input: Input) -> Self::TryOneResponseFut;
357    type MinimizeResponseFut: std::future::Future<Output = Result<ControllerMinimizeResult, fidl::Error>>
358        + Send;
359    fn r#minimize(&self, test_input: Input) -> Self::MinimizeResponseFut;
360    type CleanseResponseFut: std::future::Future<Output = Result<ControllerCleanseResult, fidl::Error>>
361        + Send;
362    fn r#cleanse(&self, test_input: Input) -> Self::CleanseResponseFut;
363    type MergeResponseFut: std::future::Future<Output = Result<ControllerMergeResult, fidl::Error>>
364        + Send;
365    fn r#merge(&self) -> Self::MergeResponseFut;
366    type GetStatusResponseFut: std::future::Future<Output = Result<Status, fidl::Error>> + Send;
367    fn r#get_status(&self) -> Self::GetStatusResponseFut;
368    type WatchArtifactResponseFut: std::future::Future<Output = Result<Artifact, fidl::Error>>
369        + Send;
370    fn r#watch_artifact(&self) -> Self::WatchArtifactResponseFut;
371}
372#[derive(Debug)]
373#[cfg(target_os = "fuchsia")]
374pub struct ControllerSynchronousProxy {
375    client: fidl::client::sync::Client,
376}
377
378#[cfg(target_os = "fuchsia")]
379impl fidl::endpoints::SynchronousProxy for ControllerSynchronousProxy {
380    type Proxy = ControllerProxy;
381    type Protocol = ControllerMarker;
382
383    fn from_channel(inner: fidl::Channel) -> Self {
384        Self::new(inner)
385    }
386
387    fn into_channel(self) -> fidl::Channel {
388        self.client.into_channel()
389    }
390
391    fn as_channel(&self) -> &fidl::Channel {
392        self.client.as_channel()
393    }
394}
395
396#[cfg(target_os = "fuchsia")]
397impl ControllerSynchronousProxy {
398    pub fn new(channel: fidl::Channel) -> Self {
399        Self { client: fidl::client::sync::Client::new(channel) }
400    }
401
402    pub fn into_channel(self) -> fidl::Channel {
403        self.client.into_channel()
404    }
405
406    /// Waits until an event arrives and returns it. It is safe for other
407    /// threads to make concurrent requests while waiting for an event.
408    pub fn wait_for_event(
409        &self,
410        deadline: zx::MonotonicInstant,
411    ) -> Result<ControllerEvent, fidl::Error> {
412        ControllerEvent::decode(self.client.wait_for_event::<ControllerMarker>(deadline)?)
413    }
414
415    /// Sets various execution and error detection parameters. This may be
416    /// called multiple times; only the most recently received options are used.
417    /// If the `Options` parameter omits one or more fields, those parameters
418    /// are unchanged in the fuzzer. Until the initial call to this method, the
419    /// fuzzer should assume the default values for `Options`.
420    ///
421    /// + request `options` the execution and error detection parameters.
422    /// * error one of the following:
423    /// * error
424    ///     * `ZX_ERR_BAD_STATE` if a long-running call such as `Execute`,
425    ///       `Cleanse`, `Minimize`, `Fuzz`, or `Merge` is in progress.
426    ///     * `ZX_ERR_NOT_SUPPORTED` if a value provided for an option is not
427    ///       supported by the engine. Check the logs for additional details.
428    pub fn r#configure(
429        &self,
430        mut options: &Options,
431        ___deadline: zx::MonotonicInstant,
432    ) -> Result<ControllerConfigureResult, fidl::Error> {
433        let _response = self.client.send_query::<
434            ControllerConfigureRequest,
435            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
436            ControllerMarker,
437        >(
438            (options,),
439            0x35c8cba7fa3d32e4,
440            fidl::encoding::DynamicFlags::empty(),
441            ___deadline,
442        )?;
443        Ok(_response.map(|x| x))
444    }
445
446    /// Gets the current values for the various execution and error detection
447    /// parameters.
448    ///
449    /// - response `options` the execution and error detection parameters.
450    pub fn r#get_options(&self, ___deadline: zx::MonotonicInstant) -> Result<Options, fidl::Error> {
451        let _response = self.client.send_query::<
452            fidl::encoding::EmptyPayload,
453            ControllerGetOptionsResponse,
454            ControllerMarker,
455        >(
456            (),
457            0x683d93332504b9cd,
458            fidl::encoding::DynamicFlags::empty(),
459            ___deadline,
460        )?;
461        Ok(_response.options)
462    }
463
464    /// Writes the provided `input` to either the "seed" or "live" `corpus`.
465    /// Returns an error if transferring the input fails; see `Input` for
466    /// details.
467    ///
468    /// + request `corpus` the type of corpus to add to.
469    /// + request `input` the sequence of bytes to add as a test input.
470    /// * error one of the following:
471    ///     * `ZX_ERR_INVALID_ARGS` if corpus type is invalid.
472    ///     * A socket error if transferring the input fails.
473    pub fn r#add_to_corpus(
474        &self,
475        mut corpus: Corpus,
476        mut input: Input,
477        ___deadline: zx::MonotonicInstant,
478    ) -> Result<ControllerAddToCorpusResult, fidl::Error> {
479        let _response = self.client.send_query::<
480            ControllerAddToCorpusRequest,
481            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
482            ControllerMarker,
483        >(
484            (corpus, &mut input,),
485            0x7bdf8336ab534cee,
486            fidl::encoding::DynamicFlags::empty(),
487            ___deadline,
488        )?;
489        Ok(_response.map(|x| x))
490    }
491
492    /// Connects a `corpus_reader` for either the "seed" or "live" corpus.
493    ///
494    /// + request `corpus` the type of corpus to read from.
495    /// + request `corpus_reader` the client used to send test inputs.
496    pub fn r#read_corpus(
497        &self,
498        mut corpus: Corpus,
499        mut corpus_reader: fidl::endpoints::ClientEnd<CorpusReaderMarker>,
500        ___deadline: zx::MonotonicInstant,
501    ) -> Result<(), fidl::Error> {
502        let _response = self.client.send_query::<
503            ControllerReadCorpusRequest,
504            fidl::encoding::EmptyPayload,
505            ControllerMarker,
506        >(
507            (corpus, corpus_reader,),
508            0x501279b430b34514,
509            fidl::encoding::DynamicFlags::empty(),
510            ___deadline,
511        )?;
512        Ok(_response)
513    }
514
515    /// Parses and loads an AFL-style dictionary. Invalid entries are logged and
516    /// skipped.
517    ///
518    /// See also:
519    ///
520    /// * https://github.com/mirrorer/afl/blob/master/dictionaries/README.dictionaries
521    ///
522    /// + request `dictionary` the AFL-style dictionary
523    /// * error one of the following:
524    ///     * A socket error if transferring the input fails.
525    ///     *`ZX_ERR_INVALID_ARGS` if parsing the dictionary fails.
526    pub fn r#write_dictionary(
527        &self,
528        mut dictionary: Input,
529        ___deadline: zx::MonotonicInstant,
530    ) -> Result<ControllerWriteDictionaryResult, fidl::Error> {
531        let _response = self.client.send_query::<
532            ControllerWriteDictionaryRequest,
533            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
534            ControllerMarker,
535        >(
536            (&mut dictionary,),
537            0x4ecfc1274fe4a70b,
538            fidl::encoding::DynamicFlags::empty(),
539            ___deadline,
540        )?;
541        Ok(_response.map(|x| x))
542    }
543
544    /// Returns the current dictionary as an Input, which may be empty.
545    ///
546    /// - response `dictionary` the current AFL-style dictionary.
547    pub fn r#read_dictionary(
548        &self,
549        ___deadline: zx::MonotonicInstant,
550    ) -> Result<Input, fidl::Error> {
551        let _response = self.client.send_query::<
552            fidl::encoding::EmptyPayload,
553            ControllerReadDictionaryResponse,
554            ControllerMarker,
555        >(
556            (),
557            0x1be6724c87b51c37,
558            fidl::encoding::DynamicFlags::empty(),
559            ___deadline,
560        )?;
561        Ok(_response.dictionary)
562    }
563
564    /// Installs a `Monitor` to push status. To pull status instead, use
565    /// `GetStatus`.
566    ///
567    /// + request `monitor` the client used to send status updates.
568    pub fn r#add_monitor(
569        &self,
570        mut monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
571        ___deadline: zx::MonotonicInstant,
572    ) -> Result<(), fidl::Error> {
573        let _response = self.client.send_query::<
574            ControllerAddMonitorRequest,
575            fidl::encoding::EmptyPayload,
576            ControllerMarker,
577        >(
578            (monitor,),
579            0x2efbf7d3dc21438e,
580            fidl::encoding::DynamicFlags::empty(),
581            ___deadline,
582        )?;
583        Ok(_response)
584    }
585
586    /// Runs the normal fuzzing feedback loop:
587    ///
588    /// 1. Selects an input from the corpus.
589    /// 2. Mutates the input.
590    /// 3. Uses the `TargetAdapter` to execute the input.
591    /// 4. Checks feedback from the `InstrumentedProcesses`.
592    /// 5. If the input produced useful feedback, adds it to the corpus.
593    ///
594    /// This call returns quickly, but the loop continues until one of three
595    /// conditions is met:
596    ///
597    /// 1. The configured, non-zero number of `runs` has been reached.
598    /// 2. The configured, non-zero `duration` elapses.
599    /// 3. An error is detected, and returned.
600    ///
601    /// See `Result` for more details on long running workflows such as this
602    /// one.
603    ///
604    /// * error `ZX_ERR_BAD_STATE` if another long-running workflow is in
605    ///   progress.
606    pub fn r#fuzz(
607        &self,
608        ___deadline: zx::MonotonicInstant,
609    ) -> Result<ControllerFuzzResult, fidl::Error> {
610        let _response = self.client.send_query::<
611            fidl::encoding::EmptyPayload,
612            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
613            ControllerMarker,
614        >(
615            (),
616            0x62fe3684ea23af62,
617            fidl::encoding::DynamicFlags::empty(),
618            ___deadline,
619        )?;
620        Ok(_response.map(|x| x))
621    }
622
623    /// Executes the target code with a single `test_input`.
624    ///
625    /// See `Result` for more details on long running workflows such as this
626    /// one.
627    ///
628    /// + request `input` the sequence of bytes to use with the fuzz target.
629    /// * error one of the following:
630    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
631    ///       progress.
632    ///     *  A socket error if transferring the input fails.
633    pub fn r#try_one(
634        &self,
635        mut test_input: Input,
636        ___deadline: zx::MonotonicInstant,
637    ) -> Result<ControllerTryOneResult, fidl::Error> {
638        let _response = self.client.send_query::<
639            ControllerTryOneRequest,
640            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
641            ControllerMarker,
642        >(
643            (&mut test_input,),
644            0x368dc762d8e16d46,
645            fidl::encoding::DynamicFlags::empty(),
646            ___deadline,
647        )?;
648        Ok(_response.map(|x| x))
649    }
650
651    /// Attempts to find the smallest input that produces the same error as the
652    /// given `test_input`,
653    /// constrained by the configured `total_time` and/or `runs` options.
654    ///
655    /// See `Result` for more details on long running workflows such as this
656    /// one.
657    ///
658    /// + request `input` the sequence of bytes to minimize.
659    /// * error one of the following:
660    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
661    ///       progress.
662    ///     * A socket error if transferring the input fails.
663    ///     * `ZX_ERR_INVALID_ARGS` if the provided `test_input` does not cause
664    ///       an error.
665    pub fn r#minimize(
666        &self,
667        mut test_input: Input,
668        ___deadline: zx::MonotonicInstant,
669    ) -> Result<ControllerMinimizeResult, fidl::Error> {
670        let _response = self.client.send_query::<
671            ControllerMinimizeRequest,
672            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
673            ControllerMarker,
674        >(
675            (&mut test_input,),
676            0x105a242ee0552794,
677            fidl::encoding::DynamicFlags::empty(),
678            ___deadline,
679        )?;
680        Ok(_response.map(|x| x))
681    }
682
683    /// Attempts to replace bytes of the given `test_input` with "filler" bytes,
684    /// e.g. \x00, \xFF, without changing the error produced.
685    ///
686    /// See `Result` for more details on long running workflows such as this
687    /// one.
688    ///
689    /// To preserve backwards compatibility with libFuzzer and ClusterFuzz, an
690    /// input that produces no result is *not* considered an error, and is
691    /// returned as-is.
692    ///
693    /// + request `input` the sequence of bytes to cleanse.
694    /// * error one of the following:
695    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
696    ///       progress.
697    ///     * A socket error if transferring the input fails.
698    pub fn r#cleanse(
699        &self,
700        mut test_input: Input,
701        ___deadline: zx::MonotonicInstant,
702    ) -> Result<ControllerCleanseResult, fidl::Error> {
703        let _response = self.client.send_query::<
704            ControllerCleanseRequest,
705            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
706            ControllerMarker,
707        >(
708            (&mut test_input,),
709            0x6d7892f62735f3e0,
710            fidl::encoding::DynamicFlags::empty(),
711            ___deadline,
712        )?;
713        Ok(_response.map(|x| x))
714    }
715
716    /// Attempts to shrink the corpora. Inputs from the seed corpus will be
717    /// preserved. All other inputs will be sorted by amount of feedback
718    /// produced and input size, and only those inputs that add new feedback not
719    /// seen earlier in the sequence will be kept.
720    ///
721    /// See `Result` for more details on long running workflows such as this
722    /// one.
723    ///
724    /// * error one of the following:
725    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
726    ///       progress.
727    ///     * `ZX_ERR_INVALID_ARGS` if an input in the seed corpus causes an
728    ///       error. Inputs in the live corpus that cause errors are skipped.
729    pub fn r#merge(
730        &self,
731        ___deadline: zx::MonotonicInstant,
732    ) -> Result<ControllerMergeResult, fidl::Error> {
733        let _response = self.client.send_query::<
734            fidl::encoding::EmptyPayload,
735            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
736            ControllerMarker,
737        >(
738            (),
739            0x3614e5c39413b5eb,
740            fidl::encoding::DynamicFlags::empty(),
741            ___deadline,
742        )?;
743        Ok(_response.map(|x| x))
744    }
745
746    /// Returns various fuzzing metrics, e.g. total coverage, speed, etc.
747    ///
748    /// - response `status` the current value of fuzzing metrics.
749    pub fn r#get_status(&self, ___deadline: zx::MonotonicInstant) -> Result<Status, fidl::Error> {
750        let _response = self.client.send_query::<
751            fidl::encoding::EmptyPayload,
752            ControllerGetStatusResponse,
753            ControllerMarker,
754        >(
755            (),
756            0x51db4975d93ce768,
757            fidl::encoding::DynamicFlags::empty(),
758            ___deadline,
759        )?;
760        Ok(_response.status)
761    }
762
763    /// Returns the results of a long-running workflow.
764    ///
765    /// This method uses the
766    /// ["hanging get" pattern](https://fuchsia.dev/fuchsia-src/development/api/fidl#hanging-get).
767    /// Upon the first call for a given connection, it will immediately return
768    /// the controller's current artifact. Upon subsequent calls, it will block
769    /// until the controller's artifact changes before returning. Clients should
770    /// use `GetStatus` to ensure the fuzzer is not idle before making a
771    /// blocking call to `WatchArtifact`.
772    ///
773    /// Combined with the `Status.running` value obtained from `GetStatus`, this
774    /// allows a (re-)connecting client to infer the state of the fuzzer:
775    ///
776    /// * If the fuzzer is idle and has an empty artifact, then it is
777    ///   unchanged since the last connection, if any.
778    /// * If the fuzzer is running and has an empty artifact, then it is
779    ///   performing a long-running workflow started by a previous connection.
780    ///   The client may call `WatchArtifact` again to wait for the workflow
781    ///   to complete.
782    /// * If the fuzzer is idle and has a non-empty artifact, then it has
783    ///   completed a long-running workflow since the last connection.
784    ///
785    /// It is not an error for clients to disconnect while waiting for a
786    /// response from this method. This method is intended to allow clients to
787    /// resume waiting for a long-running workflow to complete after
788    /// intentionally or inadvertently being disconnected for an indefinite
789    /// amount of time.
790    ///
791    /// - response `artifact` the most recent result and/or error-causing input.
792    pub fn r#watch_artifact(
793        &self,
794        ___deadline: zx::MonotonicInstant,
795    ) -> Result<Artifact, fidl::Error> {
796        let _response = self.client.send_query::<
797            fidl::encoding::EmptyPayload,
798            ControllerWatchArtifactResponse,
799            ControllerMarker,
800        >(
801            (),
802            0x6cfca3730944a414,
803            fidl::encoding::DynamicFlags::empty(),
804            ___deadline,
805        )?;
806        Ok(_response.artifact)
807    }
808}
809
810#[cfg(target_os = "fuchsia")]
811impl From<ControllerSynchronousProxy> for zx::NullableHandle {
812    fn from(value: ControllerSynchronousProxy) -> Self {
813        value.into_channel().into()
814    }
815}
816
817#[cfg(target_os = "fuchsia")]
818impl From<fidl::Channel> for ControllerSynchronousProxy {
819    fn from(value: fidl::Channel) -> Self {
820        Self::new(value)
821    }
822}
823
824#[cfg(target_os = "fuchsia")]
825impl fidl::endpoints::FromClient for ControllerSynchronousProxy {
826    type Protocol = ControllerMarker;
827
828    fn from_client(value: fidl::endpoints::ClientEnd<ControllerMarker>) -> Self {
829        Self::new(value.into_channel())
830    }
831}
832
833#[derive(Debug, Clone)]
834pub struct ControllerProxy {
835    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
836}
837
838impl fidl::endpoints::Proxy for ControllerProxy {
839    type Protocol = ControllerMarker;
840
841    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
842        Self::new(inner)
843    }
844
845    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
846        self.client.into_channel().map_err(|client| Self { client })
847    }
848
849    fn as_channel(&self) -> &::fidl::AsyncChannel {
850        self.client.as_channel()
851    }
852}
853
854impl ControllerProxy {
855    /// Create a new Proxy for fuchsia.fuzzer/Controller.
856    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
857        let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
858        Self { client: fidl::client::Client::new(channel, protocol_name) }
859    }
860
861    /// Get a Stream of events from the remote end of the protocol.
862    ///
863    /// # Panics
864    ///
865    /// Panics if the event stream was already taken.
866    pub fn take_event_stream(&self) -> ControllerEventStream {
867        ControllerEventStream { event_receiver: self.client.take_event_receiver() }
868    }
869
870    /// Sets various execution and error detection parameters. This may be
871    /// called multiple times; only the most recently received options are used.
872    /// If the `Options` parameter omits one or more fields, those parameters
873    /// are unchanged in the fuzzer. Until the initial call to this method, the
874    /// fuzzer should assume the default values for `Options`.
875    ///
876    /// + request `options` the execution and error detection parameters.
877    /// * error one of the following:
878    /// * error
879    ///     * `ZX_ERR_BAD_STATE` if a long-running call such as `Execute`,
880    ///       `Cleanse`, `Minimize`, `Fuzz`, or `Merge` is in progress.
881    ///     * `ZX_ERR_NOT_SUPPORTED` if a value provided for an option is not
882    ///       supported by the engine. Check the logs for additional details.
883    pub fn r#configure(
884        &self,
885        mut options: &Options,
886    ) -> fidl::client::QueryResponseFut<
887        ControllerConfigureResult,
888        fidl::encoding::DefaultFuchsiaResourceDialect,
889    > {
890        ControllerProxyInterface::r#configure(self, options)
891    }
892
893    /// Gets the current values for the various execution and error detection
894    /// parameters.
895    ///
896    /// - response `options` the execution and error detection parameters.
897    pub fn r#get_options(
898        &self,
899    ) -> fidl::client::QueryResponseFut<Options, fidl::encoding::DefaultFuchsiaResourceDialect>
900    {
901        ControllerProxyInterface::r#get_options(self)
902    }
903
904    /// Writes the provided `input` to either the "seed" or "live" `corpus`.
905    /// Returns an error if transferring the input fails; see `Input` for
906    /// details.
907    ///
908    /// + request `corpus` the type of corpus to add to.
909    /// + request `input` the sequence of bytes to add as a test input.
910    /// * error one of the following:
911    ///     * `ZX_ERR_INVALID_ARGS` if corpus type is invalid.
912    ///     * A socket error if transferring the input fails.
913    pub fn r#add_to_corpus(
914        &self,
915        mut corpus: Corpus,
916        mut input: Input,
917    ) -> fidl::client::QueryResponseFut<
918        ControllerAddToCorpusResult,
919        fidl::encoding::DefaultFuchsiaResourceDialect,
920    > {
921        ControllerProxyInterface::r#add_to_corpus(self, corpus, input)
922    }
923
924    /// Connects a `corpus_reader` for either the "seed" or "live" corpus.
925    ///
926    /// + request `corpus` the type of corpus to read from.
927    /// + request `corpus_reader` the client used to send test inputs.
928    pub fn r#read_corpus(
929        &self,
930        mut corpus: Corpus,
931        mut corpus_reader: fidl::endpoints::ClientEnd<CorpusReaderMarker>,
932    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
933        ControllerProxyInterface::r#read_corpus(self, corpus, corpus_reader)
934    }
935
936    /// Parses and loads an AFL-style dictionary. Invalid entries are logged and
937    /// skipped.
938    ///
939    /// See also:
940    ///
941    /// * https://github.com/mirrorer/afl/blob/master/dictionaries/README.dictionaries
942    ///
943    /// + request `dictionary` the AFL-style dictionary
944    /// * error one of the following:
945    ///     * A socket error if transferring the input fails.
946    ///     *`ZX_ERR_INVALID_ARGS` if parsing the dictionary fails.
947    pub fn r#write_dictionary(
948        &self,
949        mut dictionary: Input,
950    ) -> fidl::client::QueryResponseFut<
951        ControllerWriteDictionaryResult,
952        fidl::encoding::DefaultFuchsiaResourceDialect,
953    > {
954        ControllerProxyInterface::r#write_dictionary(self, dictionary)
955    }
956
957    /// Returns the current dictionary as an Input, which may be empty.
958    ///
959    /// - response `dictionary` the current AFL-style dictionary.
960    pub fn r#read_dictionary(
961        &self,
962    ) -> fidl::client::QueryResponseFut<Input, fidl::encoding::DefaultFuchsiaResourceDialect> {
963        ControllerProxyInterface::r#read_dictionary(self)
964    }
965
966    /// Installs a `Monitor` to push status. To pull status instead, use
967    /// `GetStatus`.
968    ///
969    /// + request `monitor` the client used to send status updates.
970    pub fn r#add_monitor(
971        &self,
972        mut monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
973    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
974        ControllerProxyInterface::r#add_monitor(self, monitor)
975    }
976
977    /// Runs the normal fuzzing feedback loop:
978    ///
979    /// 1. Selects an input from the corpus.
980    /// 2. Mutates the input.
981    /// 3. Uses the `TargetAdapter` to execute the input.
982    /// 4. Checks feedback from the `InstrumentedProcesses`.
983    /// 5. If the input produced useful feedback, adds it to the corpus.
984    ///
985    /// This call returns quickly, but the loop continues until one of three
986    /// conditions is met:
987    ///
988    /// 1. The configured, non-zero number of `runs` has been reached.
989    /// 2. The configured, non-zero `duration` elapses.
990    /// 3. An error is detected, and returned.
991    ///
992    /// See `Result` for more details on long running workflows such as this
993    /// one.
994    ///
995    /// * error `ZX_ERR_BAD_STATE` if another long-running workflow is in
996    ///   progress.
997    pub fn r#fuzz(
998        &self,
999    ) -> fidl::client::QueryResponseFut<
1000        ControllerFuzzResult,
1001        fidl::encoding::DefaultFuchsiaResourceDialect,
1002    > {
1003        ControllerProxyInterface::r#fuzz(self)
1004    }
1005
1006    /// Executes the target code with a single `test_input`.
1007    ///
1008    /// See `Result` for more details on long running workflows such as this
1009    /// one.
1010    ///
1011    /// + request `input` the sequence of bytes to use with the fuzz target.
1012    /// * error one of the following:
1013    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
1014    ///       progress.
1015    ///     *  A socket error if transferring the input fails.
1016    pub fn r#try_one(
1017        &self,
1018        mut test_input: Input,
1019    ) -> fidl::client::QueryResponseFut<
1020        ControllerTryOneResult,
1021        fidl::encoding::DefaultFuchsiaResourceDialect,
1022    > {
1023        ControllerProxyInterface::r#try_one(self, test_input)
1024    }
1025
1026    /// Attempts to find the smallest input that produces the same error as the
1027    /// given `test_input`,
1028    /// constrained by the configured `total_time` and/or `runs` options.
1029    ///
1030    /// See `Result` for more details on long running workflows such as this
1031    /// one.
1032    ///
1033    /// + request `input` the sequence of bytes to minimize.
1034    /// * error one of the following:
1035    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
1036    ///       progress.
1037    ///     * A socket error if transferring the input fails.
1038    ///     * `ZX_ERR_INVALID_ARGS` if the provided `test_input` does not cause
1039    ///       an error.
1040    pub fn r#minimize(
1041        &self,
1042        mut test_input: Input,
1043    ) -> fidl::client::QueryResponseFut<
1044        ControllerMinimizeResult,
1045        fidl::encoding::DefaultFuchsiaResourceDialect,
1046    > {
1047        ControllerProxyInterface::r#minimize(self, test_input)
1048    }
1049
1050    /// Attempts to replace bytes of the given `test_input` with "filler" bytes,
1051    /// e.g. \x00, \xFF, without changing the error produced.
1052    ///
1053    /// See `Result` for more details on long running workflows such as this
1054    /// one.
1055    ///
1056    /// To preserve backwards compatibility with libFuzzer and ClusterFuzz, an
1057    /// input that produces no result is *not* considered an error, and is
1058    /// returned as-is.
1059    ///
1060    /// + request `input` the sequence of bytes to cleanse.
1061    /// * error one of the following:
1062    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
1063    ///       progress.
1064    ///     * A socket error if transferring the input fails.
1065    pub fn r#cleanse(
1066        &self,
1067        mut test_input: Input,
1068    ) -> fidl::client::QueryResponseFut<
1069        ControllerCleanseResult,
1070        fidl::encoding::DefaultFuchsiaResourceDialect,
1071    > {
1072        ControllerProxyInterface::r#cleanse(self, test_input)
1073    }
1074
1075    /// Attempts to shrink the corpora. Inputs from the seed corpus will be
1076    /// preserved. All other inputs will be sorted by amount of feedback
1077    /// produced and input size, and only those inputs that add new feedback not
1078    /// seen earlier in the sequence will be kept.
1079    ///
1080    /// See `Result` for more details on long running workflows such as this
1081    /// one.
1082    ///
1083    /// * error one of the following:
1084    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
1085    ///       progress.
1086    ///     * `ZX_ERR_INVALID_ARGS` if an input in the seed corpus causes an
1087    ///       error. Inputs in the live corpus that cause errors are skipped.
1088    pub fn r#merge(
1089        &self,
1090    ) -> fidl::client::QueryResponseFut<
1091        ControllerMergeResult,
1092        fidl::encoding::DefaultFuchsiaResourceDialect,
1093    > {
1094        ControllerProxyInterface::r#merge(self)
1095    }
1096
1097    /// Returns various fuzzing metrics, e.g. total coverage, speed, etc.
1098    ///
1099    /// - response `status` the current value of fuzzing metrics.
1100    pub fn r#get_status(
1101        &self,
1102    ) -> fidl::client::QueryResponseFut<Status, fidl::encoding::DefaultFuchsiaResourceDialect> {
1103        ControllerProxyInterface::r#get_status(self)
1104    }
1105
1106    /// Returns the results of a long-running workflow.
1107    ///
1108    /// This method uses the
1109    /// ["hanging get" pattern](https://fuchsia.dev/fuchsia-src/development/api/fidl#hanging-get).
1110    /// Upon the first call for a given connection, it will immediately return
1111    /// the controller's current artifact. Upon subsequent calls, it will block
1112    /// until the controller's artifact changes before returning. Clients should
1113    /// use `GetStatus` to ensure the fuzzer is not idle before making a
1114    /// blocking call to `WatchArtifact`.
1115    ///
1116    /// Combined with the `Status.running` value obtained from `GetStatus`, this
1117    /// allows a (re-)connecting client to infer the state of the fuzzer:
1118    ///
1119    /// * If the fuzzer is idle and has an empty artifact, then it is
1120    ///   unchanged since the last connection, if any.
1121    /// * If the fuzzer is running and has an empty artifact, then it is
1122    ///   performing a long-running workflow started by a previous connection.
1123    ///   The client may call `WatchArtifact` again to wait for the workflow
1124    ///   to complete.
1125    /// * If the fuzzer is idle and has a non-empty artifact, then it has
1126    ///   completed a long-running workflow since the last connection.
1127    ///
1128    /// It is not an error for clients to disconnect while waiting for a
1129    /// response from this method. This method is intended to allow clients to
1130    /// resume waiting for a long-running workflow to complete after
1131    /// intentionally or inadvertently being disconnected for an indefinite
1132    /// amount of time.
1133    ///
1134    /// - response `artifact` the most recent result and/or error-causing input.
1135    pub fn r#watch_artifact(
1136        &self,
1137    ) -> fidl::client::QueryResponseFut<Artifact, fidl::encoding::DefaultFuchsiaResourceDialect>
1138    {
1139        ControllerProxyInterface::r#watch_artifact(self)
1140    }
1141}
1142
1143impl ControllerProxyInterface for ControllerProxy {
1144    type ConfigureResponseFut = fidl::client::QueryResponseFut<
1145        ControllerConfigureResult,
1146        fidl::encoding::DefaultFuchsiaResourceDialect,
1147    >;
1148    fn r#configure(&self, mut options: &Options) -> Self::ConfigureResponseFut {
1149        fn _decode(
1150            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1151        ) -> Result<ControllerConfigureResult, fidl::Error> {
1152            let _response = fidl::client::decode_transaction_body::<
1153                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1154                fidl::encoding::DefaultFuchsiaResourceDialect,
1155                0x35c8cba7fa3d32e4,
1156            >(_buf?)?;
1157            Ok(_response.map(|x| x))
1158        }
1159        self.client.send_query_and_decode::<ControllerConfigureRequest, ControllerConfigureResult>(
1160            (options,),
1161            0x35c8cba7fa3d32e4,
1162            fidl::encoding::DynamicFlags::empty(),
1163            _decode,
1164        )
1165    }
1166
1167    type GetOptionsResponseFut =
1168        fidl::client::QueryResponseFut<Options, fidl::encoding::DefaultFuchsiaResourceDialect>;
1169    fn r#get_options(&self) -> Self::GetOptionsResponseFut {
1170        fn _decode(
1171            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1172        ) -> Result<Options, fidl::Error> {
1173            let _response = fidl::client::decode_transaction_body::<
1174                ControllerGetOptionsResponse,
1175                fidl::encoding::DefaultFuchsiaResourceDialect,
1176                0x683d93332504b9cd,
1177            >(_buf?)?;
1178            Ok(_response.options)
1179        }
1180        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Options>(
1181            (),
1182            0x683d93332504b9cd,
1183            fidl::encoding::DynamicFlags::empty(),
1184            _decode,
1185        )
1186    }
1187
1188    type AddToCorpusResponseFut = fidl::client::QueryResponseFut<
1189        ControllerAddToCorpusResult,
1190        fidl::encoding::DefaultFuchsiaResourceDialect,
1191    >;
1192    fn r#add_to_corpus(
1193        &self,
1194        mut corpus: Corpus,
1195        mut input: Input,
1196    ) -> Self::AddToCorpusResponseFut {
1197        fn _decode(
1198            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1199        ) -> Result<ControllerAddToCorpusResult, fidl::Error> {
1200            let _response = fidl::client::decode_transaction_body::<
1201                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1202                fidl::encoding::DefaultFuchsiaResourceDialect,
1203                0x7bdf8336ab534cee,
1204            >(_buf?)?;
1205            Ok(_response.map(|x| x))
1206        }
1207        self.client
1208            .send_query_and_decode::<ControllerAddToCorpusRequest, ControllerAddToCorpusResult>(
1209                (corpus, &mut input),
1210                0x7bdf8336ab534cee,
1211                fidl::encoding::DynamicFlags::empty(),
1212                _decode,
1213            )
1214    }
1215
1216    type ReadCorpusResponseFut =
1217        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1218    fn r#read_corpus(
1219        &self,
1220        mut corpus: Corpus,
1221        mut corpus_reader: fidl::endpoints::ClientEnd<CorpusReaderMarker>,
1222    ) -> Self::ReadCorpusResponseFut {
1223        fn _decode(
1224            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1225        ) -> Result<(), fidl::Error> {
1226            let _response = fidl::client::decode_transaction_body::<
1227                fidl::encoding::EmptyPayload,
1228                fidl::encoding::DefaultFuchsiaResourceDialect,
1229                0x501279b430b34514,
1230            >(_buf?)?;
1231            Ok(_response)
1232        }
1233        self.client.send_query_and_decode::<ControllerReadCorpusRequest, ()>(
1234            (corpus, corpus_reader),
1235            0x501279b430b34514,
1236            fidl::encoding::DynamicFlags::empty(),
1237            _decode,
1238        )
1239    }
1240
1241    type WriteDictionaryResponseFut = fidl::client::QueryResponseFut<
1242        ControllerWriteDictionaryResult,
1243        fidl::encoding::DefaultFuchsiaResourceDialect,
1244    >;
1245    fn r#write_dictionary(&self, mut dictionary: Input) -> Self::WriteDictionaryResponseFut {
1246        fn _decode(
1247            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1248        ) -> Result<ControllerWriteDictionaryResult, fidl::Error> {
1249            let _response = fidl::client::decode_transaction_body::<
1250                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1251                fidl::encoding::DefaultFuchsiaResourceDialect,
1252                0x4ecfc1274fe4a70b,
1253            >(_buf?)?;
1254            Ok(_response.map(|x| x))
1255        }
1256        self.client.send_query_and_decode::<
1257            ControllerWriteDictionaryRequest,
1258            ControllerWriteDictionaryResult,
1259        >(
1260            (&mut dictionary,),
1261            0x4ecfc1274fe4a70b,
1262            fidl::encoding::DynamicFlags::empty(),
1263            _decode,
1264        )
1265    }
1266
1267    type ReadDictionaryResponseFut =
1268        fidl::client::QueryResponseFut<Input, fidl::encoding::DefaultFuchsiaResourceDialect>;
1269    fn r#read_dictionary(&self) -> Self::ReadDictionaryResponseFut {
1270        fn _decode(
1271            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1272        ) -> Result<Input, fidl::Error> {
1273            let _response = fidl::client::decode_transaction_body::<
1274                ControllerReadDictionaryResponse,
1275                fidl::encoding::DefaultFuchsiaResourceDialect,
1276                0x1be6724c87b51c37,
1277            >(_buf?)?;
1278            Ok(_response.dictionary)
1279        }
1280        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Input>(
1281            (),
1282            0x1be6724c87b51c37,
1283            fidl::encoding::DynamicFlags::empty(),
1284            _decode,
1285        )
1286    }
1287
1288    type AddMonitorResponseFut =
1289        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1290    fn r#add_monitor(
1291        &self,
1292        mut monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
1293    ) -> Self::AddMonitorResponseFut {
1294        fn _decode(
1295            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1296        ) -> Result<(), fidl::Error> {
1297            let _response = fidl::client::decode_transaction_body::<
1298                fidl::encoding::EmptyPayload,
1299                fidl::encoding::DefaultFuchsiaResourceDialect,
1300                0x2efbf7d3dc21438e,
1301            >(_buf?)?;
1302            Ok(_response)
1303        }
1304        self.client.send_query_and_decode::<ControllerAddMonitorRequest, ()>(
1305            (monitor,),
1306            0x2efbf7d3dc21438e,
1307            fidl::encoding::DynamicFlags::empty(),
1308            _decode,
1309        )
1310    }
1311
1312    type FuzzResponseFut = fidl::client::QueryResponseFut<
1313        ControllerFuzzResult,
1314        fidl::encoding::DefaultFuchsiaResourceDialect,
1315    >;
1316    fn r#fuzz(&self) -> Self::FuzzResponseFut {
1317        fn _decode(
1318            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1319        ) -> Result<ControllerFuzzResult, fidl::Error> {
1320            let _response = fidl::client::decode_transaction_body::<
1321                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1322                fidl::encoding::DefaultFuchsiaResourceDialect,
1323                0x62fe3684ea23af62,
1324            >(_buf?)?;
1325            Ok(_response.map(|x| x))
1326        }
1327        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerFuzzResult>(
1328            (),
1329            0x62fe3684ea23af62,
1330            fidl::encoding::DynamicFlags::empty(),
1331            _decode,
1332        )
1333    }
1334
1335    type TryOneResponseFut = fidl::client::QueryResponseFut<
1336        ControllerTryOneResult,
1337        fidl::encoding::DefaultFuchsiaResourceDialect,
1338    >;
1339    fn r#try_one(&self, mut test_input: Input) -> Self::TryOneResponseFut {
1340        fn _decode(
1341            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1342        ) -> Result<ControllerTryOneResult, fidl::Error> {
1343            let _response = fidl::client::decode_transaction_body::<
1344                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1345                fidl::encoding::DefaultFuchsiaResourceDialect,
1346                0x368dc762d8e16d46,
1347            >(_buf?)?;
1348            Ok(_response.map(|x| x))
1349        }
1350        self.client.send_query_and_decode::<ControllerTryOneRequest, ControllerTryOneResult>(
1351            (&mut test_input,),
1352            0x368dc762d8e16d46,
1353            fidl::encoding::DynamicFlags::empty(),
1354            _decode,
1355        )
1356    }
1357
1358    type MinimizeResponseFut = fidl::client::QueryResponseFut<
1359        ControllerMinimizeResult,
1360        fidl::encoding::DefaultFuchsiaResourceDialect,
1361    >;
1362    fn r#minimize(&self, mut test_input: Input) -> Self::MinimizeResponseFut {
1363        fn _decode(
1364            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1365        ) -> Result<ControllerMinimizeResult, fidl::Error> {
1366            let _response = fidl::client::decode_transaction_body::<
1367                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1368                fidl::encoding::DefaultFuchsiaResourceDialect,
1369                0x105a242ee0552794,
1370            >(_buf?)?;
1371            Ok(_response.map(|x| x))
1372        }
1373        self.client.send_query_and_decode::<ControllerMinimizeRequest, ControllerMinimizeResult>(
1374            (&mut test_input,),
1375            0x105a242ee0552794,
1376            fidl::encoding::DynamicFlags::empty(),
1377            _decode,
1378        )
1379    }
1380
1381    type CleanseResponseFut = fidl::client::QueryResponseFut<
1382        ControllerCleanseResult,
1383        fidl::encoding::DefaultFuchsiaResourceDialect,
1384    >;
1385    fn r#cleanse(&self, mut test_input: Input) -> Self::CleanseResponseFut {
1386        fn _decode(
1387            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1388        ) -> Result<ControllerCleanseResult, fidl::Error> {
1389            let _response = fidl::client::decode_transaction_body::<
1390                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1391                fidl::encoding::DefaultFuchsiaResourceDialect,
1392                0x6d7892f62735f3e0,
1393            >(_buf?)?;
1394            Ok(_response.map(|x| x))
1395        }
1396        self.client.send_query_and_decode::<ControllerCleanseRequest, ControllerCleanseResult>(
1397            (&mut test_input,),
1398            0x6d7892f62735f3e0,
1399            fidl::encoding::DynamicFlags::empty(),
1400            _decode,
1401        )
1402    }
1403
1404    type MergeResponseFut = fidl::client::QueryResponseFut<
1405        ControllerMergeResult,
1406        fidl::encoding::DefaultFuchsiaResourceDialect,
1407    >;
1408    fn r#merge(&self) -> Self::MergeResponseFut {
1409        fn _decode(
1410            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1411        ) -> Result<ControllerMergeResult, fidl::Error> {
1412            let _response = fidl::client::decode_transaction_body::<
1413                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1414                fidl::encoding::DefaultFuchsiaResourceDialect,
1415                0x3614e5c39413b5eb,
1416            >(_buf?)?;
1417            Ok(_response.map(|x| x))
1418        }
1419        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerMergeResult>(
1420            (),
1421            0x3614e5c39413b5eb,
1422            fidl::encoding::DynamicFlags::empty(),
1423            _decode,
1424        )
1425    }
1426
1427    type GetStatusResponseFut =
1428        fidl::client::QueryResponseFut<Status, fidl::encoding::DefaultFuchsiaResourceDialect>;
1429    fn r#get_status(&self) -> Self::GetStatusResponseFut {
1430        fn _decode(
1431            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1432        ) -> Result<Status, fidl::Error> {
1433            let _response = fidl::client::decode_transaction_body::<
1434                ControllerGetStatusResponse,
1435                fidl::encoding::DefaultFuchsiaResourceDialect,
1436                0x51db4975d93ce768,
1437            >(_buf?)?;
1438            Ok(_response.status)
1439        }
1440        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Status>(
1441            (),
1442            0x51db4975d93ce768,
1443            fidl::encoding::DynamicFlags::empty(),
1444            _decode,
1445        )
1446    }
1447
1448    type WatchArtifactResponseFut =
1449        fidl::client::QueryResponseFut<Artifact, fidl::encoding::DefaultFuchsiaResourceDialect>;
1450    fn r#watch_artifact(&self) -> Self::WatchArtifactResponseFut {
1451        fn _decode(
1452            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1453        ) -> Result<Artifact, fidl::Error> {
1454            let _response = fidl::client::decode_transaction_body::<
1455                ControllerWatchArtifactResponse,
1456                fidl::encoding::DefaultFuchsiaResourceDialect,
1457                0x6cfca3730944a414,
1458            >(_buf?)?;
1459            Ok(_response.artifact)
1460        }
1461        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Artifact>(
1462            (),
1463            0x6cfca3730944a414,
1464            fidl::encoding::DynamicFlags::empty(),
1465            _decode,
1466        )
1467    }
1468}
1469
1470pub struct ControllerEventStream {
1471    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1472}
1473
1474impl std::marker::Unpin for ControllerEventStream {}
1475
1476impl futures::stream::FusedStream for ControllerEventStream {
1477    fn is_terminated(&self) -> bool {
1478        self.event_receiver.is_terminated()
1479    }
1480}
1481
1482impl futures::Stream for ControllerEventStream {
1483    type Item = Result<ControllerEvent, fidl::Error>;
1484
1485    fn poll_next(
1486        mut self: std::pin::Pin<&mut Self>,
1487        cx: &mut std::task::Context<'_>,
1488    ) -> std::task::Poll<Option<Self::Item>> {
1489        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1490            &mut self.event_receiver,
1491            cx
1492        )?) {
1493            Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
1494            None => std::task::Poll::Ready(None),
1495        }
1496    }
1497}
1498
1499#[derive(Debug)]
1500pub enum ControllerEvent {}
1501
1502impl ControllerEvent {
1503    /// Decodes a message buffer as a [`ControllerEvent`].
1504    fn decode(
1505        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1506    ) -> Result<ControllerEvent, fidl::Error> {
1507        let (bytes, _handles) = buf.split_mut();
1508        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1509        debug_assert_eq!(tx_header.tx_id, 0);
1510        match tx_header.ordinal {
1511            _ => Err(fidl::Error::UnknownOrdinal {
1512                ordinal: tx_header.ordinal,
1513                protocol_name: <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1514            }),
1515        }
1516    }
1517}
1518
1519/// A Stream of incoming requests for fuchsia.fuzzer/Controller.
1520pub struct ControllerRequestStream {
1521    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1522    is_terminated: bool,
1523}
1524
1525impl std::marker::Unpin for ControllerRequestStream {}
1526
1527impl futures::stream::FusedStream for ControllerRequestStream {
1528    fn is_terminated(&self) -> bool {
1529        self.is_terminated
1530    }
1531}
1532
1533impl fidl::endpoints::RequestStream for ControllerRequestStream {
1534    type Protocol = ControllerMarker;
1535    type ControlHandle = ControllerControlHandle;
1536
1537    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1538        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1539    }
1540
1541    fn control_handle(&self) -> Self::ControlHandle {
1542        ControllerControlHandle { inner: self.inner.clone() }
1543    }
1544
1545    fn into_inner(
1546        self,
1547    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1548    {
1549        (self.inner, self.is_terminated)
1550    }
1551
1552    fn from_inner(
1553        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1554        is_terminated: bool,
1555    ) -> Self {
1556        Self { inner, is_terminated }
1557    }
1558}
1559
1560impl futures::Stream for ControllerRequestStream {
1561    type Item = Result<ControllerRequest, fidl::Error>;
1562
1563    fn poll_next(
1564        mut self: std::pin::Pin<&mut Self>,
1565        cx: &mut std::task::Context<'_>,
1566    ) -> std::task::Poll<Option<Self::Item>> {
1567        let this = &mut *self;
1568        if this.inner.check_shutdown(cx) {
1569            this.is_terminated = true;
1570            return std::task::Poll::Ready(None);
1571        }
1572        if this.is_terminated {
1573            panic!("polled ControllerRequestStream after completion");
1574        }
1575        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1576            |bytes, handles| {
1577                match this.inner.channel().read_etc(cx, bytes, handles) {
1578                    std::task::Poll::Ready(Ok(())) => {}
1579                    std::task::Poll::Pending => return std::task::Poll::Pending,
1580                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1581                        this.is_terminated = true;
1582                        return std::task::Poll::Ready(None);
1583                    }
1584                    std::task::Poll::Ready(Err(e)) => {
1585                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1586                            e.into(),
1587                        ))));
1588                    }
1589                }
1590
1591                // A message has been received from the channel
1592                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1593
1594                std::task::Poll::Ready(Some(match header.ordinal {
1595                    0x35c8cba7fa3d32e4 => {
1596                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1597                        let mut req = fidl::new_empty!(
1598                            ControllerConfigureRequest,
1599                            fidl::encoding::DefaultFuchsiaResourceDialect
1600                        );
1601                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerConfigureRequest>(&header, _body_bytes, handles, &mut req)?;
1602                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1603                        Ok(ControllerRequest::Configure {
1604                            options: req.options,
1605
1606                            responder: ControllerConfigureResponder {
1607                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1608                                tx_id: header.tx_id,
1609                            },
1610                        })
1611                    }
1612                    0x683d93332504b9cd => {
1613                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1614                        let mut req = fidl::new_empty!(
1615                            fidl::encoding::EmptyPayload,
1616                            fidl::encoding::DefaultFuchsiaResourceDialect
1617                        );
1618                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1619                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1620                        Ok(ControllerRequest::GetOptions {
1621                            responder: ControllerGetOptionsResponder {
1622                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1623                                tx_id: header.tx_id,
1624                            },
1625                        })
1626                    }
1627                    0x7bdf8336ab534cee => {
1628                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1629                        let mut req = fidl::new_empty!(
1630                            ControllerAddToCorpusRequest,
1631                            fidl::encoding::DefaultFuchsiaResourceDialect
1632                        );
1633                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerAddToCorpusRequest>(&header, _body_bytes, handles, &mut req)?;
1634                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1635                        Ok(ControllerRequest::AddToCorpus {
1636                            corpus: req.corpus,
1637                            input: req.input,
1638
1639                            responder: ControllerAddToCorpusResponder {
1640                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1641                                tx_id: header.tx_id,
1642                            },
1643                        })
1644                    }
1645                    0x501279b430b34514 => {
1646                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1647                        let mut req = fidl::new_empty!(
1648                            ControllerReadCorpusRequest,
1649                            fidl::encoding::DefaultFuchsiaResourceDialect
1650                        );
1651                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerReadCorpusRequest>(&header, _body_bytes, handles, &mut req)?;
1652                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1653                        Ok(ControllerRequest::ReadCorpus {
1654                            corpus: req.corpus,
1655                            corpus_reader: req.corpus_reader,
1656
1657                            responder: ControllerReadCorpusResponder {
1658                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1659                                tx_id: header.tx_id,
1660                            },
1661                        })
1662                    }
1663                    0x4ecfc1274fe4a70b => {
1664                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1665                        let mut req = fidl::new_empty!(
1666                            ControllerWriteDictionaryRequest,
1667                            fidl::encoding::DefaultFuchsiaResourceDialect
1668                        );
1669                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerWriteDictionaryRequest>(&header, _body_bytes, handles, &mut req)?;
1670                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1671                        Ok(ControllerRequest::WriteDictionary {
1672                            dictionary: req.dictionary,
1673
1674                            responder: ControllerWriteDictionaryResponder {
1675                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1676                                tx_id: header.tx_id,
1677                            },
1678                        })
1679                    }
1680                    0x1be6724c87b51c37 => {
1681                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1682                        let mut req = fidl::new_empty!(
1683                            fidl::encoding::EmptyPayload,
1684                            fidl::encoding::DefaultFuchsiaResourceDialect
1685                        );
1686                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1687                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1688                        Ok(ControllerRequest::ReadDictionary {
1689                            responder: ControllerReadDictionaryResponder {
1690                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1691                                tx_id: header.tx_id,
1692                            },
1693                        })
1694                    }
1695                    0x2efbf7d3dc21438e => {
1696                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1697                        let mut req = fidl::new_empty!(
1698                            ControllerAddMonitorRequest,
1699                            fidl::encoding::DefaultFuchsiaResourceDialect
1700                        );
1701                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerAddMonitorRequest>(&header, _body_bytes, handles, &mut req)?;
1702                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1703                        Ok(ControllerRequest::AddMonitor {
1704                            monitor: req.monitor,
1705
1706                            responder: ControllerAddMonitorResponder {
1707                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1708                                tx_id: header.tx_id,
1709                            },
1710                        })
1711                    }
1712                    0x62fe3684ea23af62 => {
1713                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1714                        let mut req = fidl::new_empty!(
1715                            fidl::encoding::EmptyPayload,
1716                            fidl::encoding::DefaultFuchsiaResourceDialect
1717                        );
1718                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1719                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1720                        Ok(ControllerRequest::Fuzz {
1721                            responder: ControllerFuzzResponder {
1722                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1723                                tx_id: header.tx_id,
1724                            },
1725                        })
1726                    }
1727                    0x368dc762d8e16d46 => {
1728                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1729                        let mut req = fidl::new_empty!(
1730                            ControllerTryOneRequest,
1731                            fidl::encoding::DefaultFuchsiaResourceDialect
1732                        );
1733                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerTryOneRequest>(&header, _body_bytes, handles, &mut req)?;
1734                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1735                        Ok(ControllerRequest::TryOne {
1736                            test_input: req.test_input,
1737
1738                            responder: ControllerTryOneResponder {
1739                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1740                                tx_id: header.tx_id,
1741                            },
1742                        })
1743                    }
1744                    0x105a242ee0552794 => {
1745                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1746                        let mut req = fidl::new_empty!(
1747                            ControllerMinimizeRequest,
1748                            fidl::encoding::DefaultFuchsiaResourceDialect
1749                        );
1750                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerMinimizeRequest>(&header, _body_bytes, handles, &mut req)?;
1751                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1752                        Ok(ControllerRequest::Minimize {
1753                            test_input: req.test_input,
1754
1755                            responder: ControllerMinimizeResponder {
1756                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1757                                tx_id: header.tx_id,
1758                            },
1759                        })
1760                    }
1761                    0x6d7892f62735f3e0 => {
1762                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1763                        let mut req = fidl::new_empty!(
1764                            ControllerCleanseRequest,
1765                            fidl::encoding::DefaultFuchsiaResourceDialect
1766                        );
1767                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerCleanseRequest>(&header, _body_bytes, handles, &mut req)?;
1768                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1769                        Ok(ControllerRequest::Cleanse {
1770                            test_input: req.test_input,
1771
1772                            responder: ControllerCleanseResponder {
1773                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1774                                tx_id: header.tx_id,
1775                            },
1776                        })
1777                    }
1778                    0x3614e5c39413b5eb => {
1779                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1780                        let mut req = fidl::new_empty!(
1781                            fidl::encoding::EmptyPayload,
1782                            fidl::encoding::DefaultFuchsiaResourceDialect
1783                        );
1784                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1785                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1786                        Ok(ControllerRequest::Merge {
1787                            responder: ControllerMergeResponder {
1788                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1789                                tx_id: header.tx_id,
1790                            },
1791                        })
1792                    }
1793                    0x51db4975d93ce768 => {
1794                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1795                        let mut req = fidl::new_empty!(
1796                            fidl::encoding::EmptyPayload,
1797                            fidl::encoding::DefaultFuchsiaResourceDialect
1798                        );
1799                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1800                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1801                        Ok(ControllerRequest::GetStatus {
1802                            responder: ControllerGetStatusResponder {
1803                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1804                                tx_id: header.tx_id,
1805                            },
1806                        })
1807                    }
1808                    0x6cfca3730944a414 => {
1809                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1810                        let mut req = fidl::new_empty!(
1811                            fidl::encoding::EmptyPayload,
1812                            fidl::encoding::DefaultFuchsiaResourceDialect
1813                        );
1814                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1815                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1816                        Ok(ControllerRequest::WatchArtifact {
1817                            responder: ControllerWatchArtifactResponder {
1818                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1819                                tx_id: header.tx_id,
1820                            },
1821                        })
1822                    }
1823                    _ => Err(fidl::Error::UnknownOrdinal {
1824                        ordinal: header.ordinal,
1825                        protocol_name:
1826                            <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1827                    }),
1828                }))
1829            },
1830        )
1831    }
1832}
1833
1834/// Provides the management interface for fuzzing.
1835///
1836/// This protocol is implemented by the fuzzing engine. Clients for this
1837/// protocol are provided by `fuchsia.fuzzer/ControllerProvider.Connect`.
1838///
1839/// The channel is closed when the fuzzer is no longer needed, and on error.
1840/// Clients should exit and not attempt to reconnect.
1841#[derive(Debug)]
1842pub enum ControllerRequest {
1843    /// Sets various execution and error detection parameters. This may be
1844    /// called multiple times; only the most recently received options are used.
1845    /// If the `Options` parameter omits one or more fields, those parameters
1846    /// are unchanged in the fuzzer. Until the initial call to this method, the
1847    /// fuzzer should assume the default values for `Options`.
1848    ///
1849    /// + request `options` the execution and error detection parameters.
1850    /// * error one of the following:
1851    /// * error
1852    ///     * `ZX_ERR_BAD_STATE` if a long-running call such as `Execute`,
1853    ///       `Cleanse`, `Minimize`, `Fuzz`, or `Merge` is in progress.
1854    ///     * `ZX_ERR_NOT_SUPPORTED` if a value provided for an option is not
1855    ///       supported by the engine. Check the logs for additional details.
1856    Configure { options: Options, responder: ControllerConfigureResponder },
1857    /// Gets the current values for the various execution and error detection
1858    /// parameters.
1859    ///
1860    /// - response `options` the execution and error detection parameters.
1861    GetOptions { responder: ControllerGetOptionsResponder },
1862    /// Writes the provided `input` to either the "seed" or "live" `corpus`.
1863    /// Returns an error if transferring the input fails; see `Input` for
1864    /// details.
1865    ///
1866    /// + request `corpus` the type of corpus to add to.
1867    /// + request `input` the sequence of bytes to add as a test input.
1868    /// * error one of the following:
1869    ///     * `ZX_ERR_INVALID_ARGS` if corpus type is invalid.
1870    ///     * A socket error if transferring the input fails.
1871    AddToCorpus { corpus: Corpus, input: Input, responder: ControllerAddToCorpusResponder },
1872    /// Connects a `corpus_reader` for either the "seed" or "live" corpus.
1873    ///
1874    /// + request `corpus` the type of corpus to read from.
1875    /// + request `corpus_reader` the client used to send test inputs.
1876    ReadCorpus {
1877        corpus: Corpus,
1878        corpus_reader: fidl::endpoints::ClientEnd<CorpusReaderMarker>,
1879        responder: ControllerReadCorpusResponder,
1880    },
1881    /// Parses and loads an AFL-style dictionary. Invalid entries are logged and
1882    /// skipped.
1883    ///
1884    /// See also:
1885    ///
1886    /// * https://github.com/mirrorer/afl/blob/master/dictionaries/README.dictionaries
1887    ///
1888    /// + request `dictionary` the AFL-style dictionary
1889    /// * error one of the following:
1890    ///     * A socket error if transferring the input fails.
1891    ///     *`ZX_ERR_INVALID_ARGS` if parsing the dictionary fails.
1892    WriteDictionary { dictionary: Input, responder: ControllerWriteDictionaryResponder },
1893    /// Returns the current dictionary as an Input, which may be empty.
1894    ///
1895    /// - response `dictionary` the current AFL-style dictionary.
1896    ReadDictionary { responder: ControllerReadDictionaryResponder },
1897    /// Installs a `Monitor` to push status. To pull status instead, use
1898    /// `GetStatus`.
1899    ///
1900    /// + request `monitor` the client used to send status updates.
1901    AddMonitor {
1902        monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
1903        responder: ControllerAddMonitorResponder,
1904    },
1905    /// Runs the normal fuzzing feedback loop:
1906    ///
1907    /// 1. Selects an input from the corpus.
1908    /// 2. Mutates the input.
1909    /// 3. Uses the `TargetAdapter` to execute the input.
1910    /// 4. Checks feedback from the `InstrumentedProcesses`.
1911    /// 5. If the input produced useful feedback, adds it to the corpus.
1912    ///
1913    /// This call returns quickly, but the loop continues until one of three
1914    /// conditions is met:
1915    ///
1916    /// 1. The configured, non-zero number of `runs` has been reached.
1917    /// 2. The configured, non-zero `duration` elapses.
1918    /// 3. An error is detected, and returned.
1919    ///
1920    /// See `Result` for more details on long running workflows such as this
1921    /// one.
1922    ///
1923    /// * error `ZX_ERR_BAD_STATE` if another long-running workflow is in
1924    ///   progress.
1925    Fuzz { responder: ControllerFuzzResponder },
1926    /// Executes the target code with a single `test_input`.
1927    ///
1928    /// See `Result` for more details on long running workflows such as this
1929    /// one.
1930    ///
1931    /// + request `input` the sequence of bytes to use with the fuzz target.
1932    /// * error one of the following:
1933    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
1934    ///       progress.
1935    ///     *  A socket error if transferring the input fails.
1936    TryOne { test_input: Input, responder: ControllerTryOneResponder },
1937    /// Attempts to find the smallest input that produces the same error as the
1938    /// given `test_input`,
1939    /// constrained by the configured `total_time` and/or `runs` options.
1940    ///
1941    /// See `Result` for more details on long running workflows such as this
1942    /// one.
1943    ///
1944    /// + request `input` the sequence of bytes to minimize.
1945    /// * error one of the following:
1946    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
1947    ///       progress.
1948    ///     * A socket error if transferring the input fails.
1949    ///     * `ZX_ERR_INVALID_ARGS` if the provided `test_input` does not cause
1950    ///       an error.
1951    Minimize { test_input: Input, responder: ControllerMinimizeResponder },
1952    /// Attempts to replace bytes of the given `test_input` with "filler" bytes,
1953    /// e.g. \x00, \xFF, without changing the error produced.
1954    ///
1955    /// See `Result` for more details on long running workflows such as this
1956    /// one.
1957    ///
1958    /// To preserve backwards compatibility with libFuzzer and ClusterFuzz, an
1959    /// input that produces no result is *not* considered an error, and is
1960    /// returned as-is.
1961    ///
1962    /// + request `input` the sequence of bytes to cleanse.
1963    /// * error one of the following:
1964    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
1965    ///       progress.
1966    ///     * A socket error if transferring the input fails.
1967    Cleanse { test_input: Input, responder: ControllerCleanseResponder },
1968    /// Attempts to shrink the corpora. Inputs from the seed corpus will be
1969    /// preserved. All other inputs will be sorted by amount of feedback
1970    /// produced and input size, and only those inputs that add new feedback not
1971    /// seen earlier in the sequence will be kept.
1972    ///
1973    /// See `Result` for more details on long running workflows such as this
1974    /// one.
1975    ///
1976    /// * error one of the following:
1977    ///     * `ZX_ERR_BAD_STATE` if another long-running workflow is in
1978    ///       progress.
1979    ///     * `ZX_ERR_INVALID_ARGS` if an input in the seed corpus causes an
1980    ///       error. Inputs in the live corpus that cause errors are skipped.
1981    Merge { responder: ControllerMergeResponder },
1982    /// Returns various fuzzing metrics, e.g. total coverage, speed, etc.
1983    ///
1984    /// - response `status` the current value of fuzzing metrics.
1985    GetStatus { responder: ControllerGetStatusResponder },
1986    /// Returns the results of a long-running workflow.
1987    ///
1988    /// This method uses the
1989    /// ["hanging get" pattern](https://fuchsia.dev/fuchsia-src/development/api/fidl#hanging-get).
1990    /// Upon the first call for a given connection, it will immediately return
1991    /// the controller's current artifact. Upon subsequent calls, it will block
1992    /// until the controller's artifact changes before returning. Clients should
1993    /// use `GetStatus` to ensure the fuzzer is not idle before making a
1994    /// blocking call to `WatchArtifact`.
1995    ///
1996    /// Combined with the `Status.running` value obtained from `GetStatus`, this
1997    /// allows a (re-)connecting client to infer the state of the fuzzer:
1998    ///
1999    /// * If the fuzzer is idle and has an empty artifact, then it is
2000    ///   unchanged since the last connection, if any.
2001    /// * If the fuzzer is running and has an empty artifact, then it is
2002    ///   performing a long-running workflow started by a previous connection.
2003    ///   The client may call `WatchArtifact` again to wait for the workflow
2004    ///   to complete.
2005    /// * If the fuzzer is idle and has a non-empty artifact, then it has
2006    ///   completed a long-running workflow since the last connection.
2007    ///
2008    /// It is not an error for clients to disconnect while waiting for a
2009    /// response from this method. This method is intended to allow clients to
2010    /// resume waiting for a long-running workflow to complete after
2011    /// intentionally or inadvertently being disconnected for an indefinite
2012    /// amount of time.
2013    ///
2014    /// - response `artifact` the most recent result and/or error-causing input.
2015    WatchArtifact { responder: ControllerWatchArtifactResponder },
2016}
2017
2018impl ControllerRequest {
2019    #[allow(irrefutable_let_patterns)]
2020    pub fn into_configure(self) -> Option<(Options, ControllerConfigureResponder)> {
2021        if let ControllerRequest::Configure { options, responder } = self {
2022            Some((options, responder))
2023        } else {
2024            None
2025        }
2026    }
2027
2028    #[allow(irrefutable_let_patterns)]
2029    pub fn into_get_options(self) -> Option<(ControllerGetOptionsResponder)> {
2030        if let ControllerRequest::GetOptions { responder } = self {
2031            Some((responder))
2032        } else {
2033            None
2034        }
2035    }
2036
2037    #[allow(irrefutable_let_patterns)]
2038    pub fn into_add_to_corpus(self) -> Option<(Corpus, Input, ControllerAddToCorpusResponder)> {
2039        if let ControllerRequest::AddToCorpus { corpus, input, responder } = self {
2040            Some((corpus, input, responder))
2041        } else {
2042            None
2043        }
2044    }
2045
2046    #[allow(irrefutable_let_patterns)]
2047    pub fn into_read_corpus(
2048        self,
2049    ) -> Option<(
2050        Corpus,
2051        fidl::endpoints::ClientEnd<CorpusReaderMarker>,
2052        ControllerReadCorpusResponder,
2053    )> {
2054        if let ControllerRequest::ReadCorpus { corpus, corpus_reader, responder } = self {
2055            Some((corpus, corpus_reader, responder))
2056        } else {
2057            None
2058        }
2059    }
2060
2061    #[allow(irrefutable_let_patterns)]
2062    pub fn into_write_dictionary(self) -> Option<(Input, ControllerWriteDictionaryResponder)> {
2063        if let ControllerRequest::WriteDictionary { dictionary, responder } = self {
2064            Some((dictionary, responder))
2065        } else {
2066            None
2067        }
2068    }
2069
2070    #[allow(irrefutable_let_patterns)]
2071    pub fn into_read_dictionary(self) -> Option<(ControllerReadDictionaryResponder)> {
2072        if let ControllerRequest::ReadDictionary { responder } = self {
2073            Some((responder))
2074        } else {
2075            None
2076        }
2077    }
2078
2079    #[allow(irrefutable_let_patterns)]
2080    pub fn into_add_monitor(
2081        self,
2082    ) -> Option<(fidl::endpoints::ClientEnd<MonitorMarker>, ControllerAddMonitorResponder)> {
2083        if let ControllerRequest::AddMonitor { monitor, responder } = self {
2084            Some((monitor, responder))
2085        } else {
2086            None
2087        }
2088    }
2089
2090    #[allow(irrefutable_let_patterns)]
2091    pub fn into_fuzz(self) -> Option<(ControllerFuzzResponder)> {
2092        if let ControllerRequest::Fuzz { responder } = self { Some((responder)) } else { None }
2093    }
2094
2095    #[allow(irrefutable_let_patterns)]
2096    pub fn into_try_one(self) -> Option<(Input, ControllerTryOneResponder)> {
2097        if let ControllerRequest::TryOne { test_input, responder } = self {
2098            Some((test_input, responder))
2099        } else {
2100            None
2101        }
2102    }
2103
2104    #[allow(irrefutable_let_patterns)]
2105    pub fn into_minimize(self) -> Option<(Input, ControllerMinimizeResponder)> {
2106        if let ControllerRequest::Minimize { test_input, responder } = self {
2107            Some((test_input, responder))
2108        } else {
2109            None
2110        }
2111    }
2112
2113    #[allow(irrefutable_let_patterns)]
2114    pub fn into_cleanse(self) -> Option<(Input, ControllerCleanseResponder)> {
2115        if let ControllerRequest::Cleanse { test_input, responder } = self {
2116            Some((test_input, responder))
2117        } else {
2118            None
2119        }
2120    }
2121
2122    #[allow(irrefutable_let_patterns)]
2123    pub fn into_merge(self) -> Option<(ControllerMergeResponder)> {
2124        if let ControllerRequest::Merge { responder } = self { Some((responder)) } else { None }
2125    }
2126
2127    #[allow(irrefutable_let_patterns)]
2128    pub fn into_get_status(self) -> Option<(ControllerGetStatusResponder)> {
2129        if let ControllerRequest::GetStatus { responder } = self { Some((responder)) } else { None }
2130    }
2131
2132    #[allow(irrefutable_let_patterns)]
2133    pub fn into_watch_artifact(self) -> Option<(ControllerWatchArtifactResponder)> {
2134        if let ControllerRequest::WatchArtifact { responder } = self {
2135            Some((responder))
2136        } else {
2137            None
2138        }
2139    }
2140
2141    /// Name of the method defined in FIDL
2142    pub fn method_name(&self) -> &'static str {
2143        match *self {
2144            ControllerRequest::Configure { .. } => "configure",
2145            ControllerRequest::GetOptions { .. } => "get_options",
2146            ControllerRequest::AddToCorpus { .. } => "add_to_corpus",
2147            ControllerRequest::ReadCorpus { .. } => "read_corpus",
2148            ControllerRequest::WriteDictionary { .. } => "write_dictionary",
2149            ControllerRequest::ReadDictionary { .. } => "read_dictionary",
2150            ControllerRequest::AddMonitor { .. } => "add_monitor",
2151            ControllerRequest::Fuzz { .. } => "fuzz",
2152            ControllerRequest::TryOne { .. } => "try_one",
2153            ControllerRequest::Minimize { .. } => "minimize",
2154            ControllerRequest::Cleanse { .. } => "cleanse",
2155            ControllerRequest::Merge { .. } => "merge",
2156            ControllerRequest::GetStatus { .. } => "get_status",
2157            ControllerRequest::WatchArtifact { .. } => "watch_artifact",
2158        }
2159    }
2160}
2161
2162#[derive(Debug, Clone)]
2163pub struct ControllerControlHandle {
2164    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2165}
2166
2167impl ControllerControlHandle {
2168    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
2169        self.inner.shutdown_with_epitaph(status.into())
2170    }
2171}
2172
2173impl fidl::endpoints::ControlHandle for ControllerControlHandle {
2174    fn shutdown(&self) {
2175        self.inner.shutdown()
2176    }
2177
2178    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
2179        self.inner.shutdown_with_epitaph(status)
2180    }
2181
2182    fn is_closed(&self) -> bool {
2183        self.inner.channel().is_closed()
2184    }
2185    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2186        self.inner.channel().on_closed()
2187    }
2188
2189    #[cfg(target_os = "fuchsia")]
2190    fn signal_peer(
2191        &self,
2192        clear_mask: zx::Signals,
2193        set_mask: zx::Signals,
2194    ) -> Result<(), zx_status::Status> {
2195        use fidl::Peered;
2196        self.inner.channel().signal_peer(clear_mask, set_mask)
2197    }
2198}
2199
2200impl ControllerControlHandle {}
2201
2202#[must_use = "FIDL methods require a response to be sent"]
2203#[derive(Debug)]
2204pub struct ControllerConfigureResponder {
2205    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2206    tx_id: u32,
2207}
2208
2209/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2210/// if the responder is dropped without sending a response, so that the client
2211/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2212impl std::ops::Drop for ControllerConfigureResponder {
2213    fn drop(&mut self) {
2214        self.control_handle.shutdown();
2215        // Safety: drops once, never accessed again
2216        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2217    }
2218}
2219
2220impl fidl::endpoints::Responder for ControllerConfigureResponder {
2221    type ControlHandle = ControllerControlHandle;
2222
2223    fn control_handle(&self) -> &ControllerControlHandle {
2224        &self.control_handle
2225    }
2226
2227    fn drop_without_shutdown(mut self) {
2228        // Safety: drops once, never accessed again due to mem::forget
2229        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2230        // Prevent Drop from running (which would shut down the channel)
2231        std::mem::forget(self);
2232    }
2233}
2234
2235impl ControllerConfigureResponder {
2236    /// Sends a response to the FIDL transaction.
2237    ///
2238    /// Sets the channel to shutdown if an error occurs.
2239    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2240        let _result = self.send_raw(result);
2241        if _result.is_err() {
2242            self.control_handle.shutdown();
2243        }
2244        self.drop_without_shutdown();
2245        _result
2246    }
2247
2248    /// Similar to "send" but does not shutdown the channel if an error occurs.
2249    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2250        let _result = self.send_raw(result);
2251        self.drop_without_shutdown();
2252        _result
2253    }
2254
2255    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2256        self.control_handle
2257            .inner
2258            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2259                result,
2260                self.tx_id,
2261                0x35c8cba7fa3d32e4,
2262                fidl::encoding::DynamicFlags::empty(),
2263            )
2264    }
2265}
2266
2267#[must_use = "FIDL methods require a response to be sent"]
2268#[derive(Debug)]
2269pub struct ControllerGetOptionsResponder {
2270    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2271    tx_id: u32,
2272}
2273
2274/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2275/// if the responder is dropped without sending a response, so that the client
2276/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2277impl std::ops::Drop for ControllerGetOptionsResponder {
2278    fn drop(&mut self) {
2279        self.control_handle.shutdown();
2280        // Safety: drops once, never accessed again
2281        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2282    }
2283}
2284
2285impl fidl::endpoints::Responder for ControllerGetOptionsResponder {
2286    type ControlHandle = ControllerControlHandle;
2287
2288    fn control_handle(&self) -> &ControllerControlHandle {
2289        &self.control_handle
2290    }
2291
2292    fn drop_without_shutdown(mut self) {
2293        // Safety: drops once, never accessed again due to mem::forget
2294        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2295        // Prevent Drop from running (which would shut down the channel)
2296        std::mem::forget(self);
2297    }
2298}
2299
2300impl ControllerGetOptionsResponder {
2301    /// Sends a response to the FIDL transaction.
2302    ///
2303    /// Sets the channel to shutdown if an error occurs.
2304    pub fn send(self, mut options: &Options) -> Result<(), fidl::Error> {
2305        let _result = self.send_raw(options);
2306        if _result.is_err() {
2307            self.control_handle.shutdown();
2308        }
2309        self.drop_without_shutdown();
2310        _result
2311    }
2312
2313    /// Similar to "send" but does not shutdown the channel if an error occurs.
2314    pub fn send_no_shutdown_on_err(self, mut options: &Options) -> Result<(), fidl::Error> {
2315        let _result = self.send_raw(options);
2316        self.drop_without_shutdown();
2317        _result
2318    }
2319
2320    fn send_raw(&self, mut options: &Options) -> Result<(), fidl::Error> {
2321        self.control_handle.inner.send::<ControllerGetOptionsResponse>(
2322            (options,),
2323            self.tx_id,
2324            0x683d93332504b9cd,
2325            fidl::encoding::DynamicFlags::empty(),
2326        )
2327    }
2328}
2329
2330#[must_use = "FIDL methods require a response to be sent"]
2331#[derive(Debug)]
2332pub struct ControllerAddToCorpusResponder {
2333    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2334    tx_id: u32,
2335}
2336
2337/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2338/// if the responder is dropped without sending a response, so that the client
2339/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2340impl std::ops::Drop for ControllerAddToCorpusResponder {
2341    fn drop(&mut self) {
2342        self.control_handle.shutdown();
2343        // Safety: drops once, never accessed again
2344        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2345    }
2346}
2347
2348impl fidl::endpoints::Responder for ControllerAddToCorpusResponder {
2349    type ControlHandle = ControllerControlHandle;
2350
2351    fn control_handle(&self) -> &ControllerControlHandle {
2352        &self.control_handle
2353    }
2354
2355    fn drop_without_shutdown(mut self) {
2356        // Safety: drops once, never accessed again due to mem::forget
2357        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2358        // Prevent Drop from running (which would shut down the channel)
2359        std::mem::forget(self);
2360    }
2361}
2362
2363impl ControllerAddToCorpusResponder {
2364    /// Sends a response to the FIDL transaction.
2365    ///
2366    /// Sets the channel to shutdown if an error occurs.
2367    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2368        let _result = self.send_raw(result);
2369        if _result.is_err() {
2370            self.control_handle.shutdown();
2371        }
2372        self.drop_without_shutdown();
2373        _result
2374    }
2375
2376    /// Similar to "send" but does not shutdown the channel if an error occurs.
2377    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2378        let _result = self.send_raw(result);
2379        self.drop_without_shutdown();
2380        _result
2381    }
2382
2383    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2384        self.control_handle
2385            .inner
2386            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2387                result,
2388                self.tx_id,
2389                0x7bdf8336ab534cee,
2390                fidl::encoding::DynamicFlags::empty(),
2391            )
2392    }
2393}
2394
2395#[must_use = "FIDL methods require a response to be sent"]
2396#[derive(Debug)]
2397pub struct ControllerReadCorpusResponder {
2398    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2399    tx_id: u32,
2400}
2401
2402/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2403/// if the responder is dropped without sending a response, so that the client
2404/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2405impl std::ops::Drop for ControllerReadCorpusResponder {
2406    fn drop(&mut self) {
2407        self.control_handle.shutdown();
2408        // Safety: drops once, never accessed again
2409        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2410    }
2411}
2412
2413impl fidl::endpoints::Responder for ControllerReadCorpusResponder {
2414    type ControlHandle = ControllerControlHandle;
2415
2416    fn control_handle(&self) -> &ControllerControlHandle {
2417        &self.control_handle
2418    }
2419
2420    fn drop_without_shutdown(mut self) {
2421        // Safety: drops once, never accessed again due to mem::forget
2422        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2423        // Prevent Drop from running (which would shut down the channel)
2424        std::mem::forget(self);
2425    }
2426}
2427
2428impl ControllerReadCorpusResponder {
2429    /// Sends a response to the FIDL transaction.
2430    ///
2431    /// Sets the channel to shutdown if an error occurs.
2432    pub fn send(self) -> Result<(), fidl::Error> {
2433        let _result = self.send_raw();
2434        if _result.is_err() {
2435            self.control_handle.shutdown();
2436        }
2437        self.drop_without_shutdown();
2438        _result
2439    }
2440
2441    /// Similar to "send" but does not shutdown the channel if an error occurs.
2442    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2443        let _result = self.send_raw();
2444        self.drop_without_shutdown();
2445        _result
2446    }
2447
2448    fn send_raw(&self) -> Result<(), fidl::Error> {
2449        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2450            (),
2451            self.tx_id,
2452            0x501279b430b34514,
2453            fidl::encoding::DynamicFlags::empty(),
2454        )
2455    }
2456}
2457
2458#[must_use = "FIDL methods require a response to be sent"]
2459#[derive(Debug)]
2460pub struct ControllerWriteDictionaryResponder {
2461    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2462    tx_id: u32,
2463}
2464
2465/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2466/// if the responder is dropped without sending a response, so that the client
2467/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2468impl std::ops::Drop for ControllerWriteDictionaryResponder {
2469    fn drop(&mut self) {
2470        self.control_handle.shutdown();
2471        // Safety: drops once, never accessed again
2472        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2473    }
2474}
2475
2476impl fidl::endpoints::Responder for ControllerWriteDictionaryResponder {
2477    type ControlHandle = ControllerControlHandle;
2478
2479    fn control_handle(&self) -> &ControllerControlHandle {
2480        &self.control_handle
2481    }
2482
2483    fn drop_without_shutdown(mut self) {
2484        // Safety: drops once, never accessed again due to mem::forget
2485        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2486        // Prevent Drop from running (which would shut down the channel)
2487        std::mem::forget(self);
2488    }
2489}
2490
2491impl ControllerWriteDictionaryResponder {
2492    /// Sends a response to the FIDL transaction.
2493    ///
2494    /// Sets the channel to shutdown if an error occurs.
2495    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2496        let _result = self.send_raw(result);
2497        if _result.is_err() {
2498            self.control_handle.shutdown();
2499        }
2500        self.drop_without_shutdown();
2501        _result
2502    }
2503
2504    /// Similar to "send" but does not shutdown the channel if an error occurs.
2505    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2506        let _result = self.send_raw(result);
2507        self.drop_without_shutdown();
2508        _result
2509    }
2510
2511    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2512        self.control_handle
2513            .inner
2514            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2515                result,
2516                self.tx_id,
2517                0x4ecfc1274fe4a70b,
2518                fidl::encoding::DynamicFlags::empty(),
2519            )
2520    }
2521}
2522
2523#[must_use = "FIDL methods require a response to be sent"]
2524#[derive(Debug)]
2525pub struct ControllerReadDictionaryResponder {
2526    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2527    tx_id: u32,
2528}
2529
2530/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2531/// if the responder is dropped without sending a response, so that the client
2532/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2533impl std::ops::Drop for ControllerReadDictionaryResponder {
2534    fn drop(&mut self) {
2535        self.control_handle.shutdown();
2536        // Safety: drops once, never accessed again
2537        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2538    }
2539}
2540
2541impl fidl::endpoints::Responder for ControllerReadDictionaryResponder {
2542    type ControlHandle = ControllerControlHandle;
2543
2544    fn control_handle(&self) -> &ControllerControlHandle {
2545        &self.control_handle
2546    }
2547
2548    fn drop_without_shutdown(mut self) {
2549        // Safety: drops once, never accessed again due to mem::forget
2550        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2551        // Prevent Drop from running (which would shut down the channel)
2552        std::mem::forget(self);
2553    }
2554}
2555
2556impl ControllerReadDictionaryResponder {
2557    /// Sends a response to the FIDL transaction.
2558    ///
2559    /// Sets the channel to shutdown if an error occurs.
2560    pub fn send(self, mut dictionary: Input) -> Result<(), fidl::Error> {
2561        let _result = self.send_raw(dictionary);
2562        if _result.is_err() {
2563            self.control_handle.shutdown();
2564        }
2565        self.drop_without_shutdown();
2566        _result
2567    }
2568
2569    /// Similar to "send" but does not shutdown the channel if an error occurs.
2570    pub fn send_no_shutdown_on_err(self, mut dictionary: Input) -> Result<(), fidl::Error> {
2571        let _result = self.send_raw(dictionary);
2572        self.drop_without_shutdown();
2573        _result
2574    }
2575
2576    fn send_raw(&self, mut dictionary: Input) -> Result<(), fidl::Error> {
2577        self.control_handle.inner.send::<ControllerReadDictionaryResponse>(
2578            (&mut dictionary,),
2579            self.tx_id,
2580            0x1be6724c87b51c37,
2581            fidl::encoding::DynamicFlags::empty(),
2582        )
2583    }
2584}
2585
2586#[must_use = "FIDL methods require a response to be sent"]
2587#[derive(Debug)]
2588pub struct ControllerAddMonitorResponder {
2589    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2590    tx_id: u32,
2591}
2592
2593/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2594/// if the responder is dropped without sending a response, so that the client
2595/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2596impl std::ops::Drop for ControllerAddMonitorResponder {
2597    fn drop(&mut self) {
2598        self.control_handle.shutdown();
2599        // Safety: drops once, never accessed again
2600        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2601    }
2602}
2603
2604impl fidl::endpoints::Responder for ControllerAddMonitorResponder {
2605    type ControlHandle = ControllerControlHandle;
2606
2607    fn control_handle(&self) -> &ControllerControlHandle {
2608        &self.control_handle
2609    }
2610
2611    fn drop_without_shutdown(mut self) {
2612        // Safety: drops once, never accessed again due to mem::forget
2613        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2614        // Prevent Drop from running (which would shut down the channel)
2615        std::mem::forget(self);
2616    }
2617}
2618
2619impl ControllerAddMonitorResponder {
2620    /// Sends a response to the FIDL transaction.
2621    ///
2622    /// Sets the channel to shutdown if an error occurs.
2623    pub fn send(self) -> Result<(), fidl::Error> {
2624        let _result = self.send_raw();
2625        if _result.is_err() {
2626            self.control_handle.shutdown();
2627        }
2628        self.drop_without_shutdown();
2629        _result
2630    }
2631
2632    /// Similar to "send" but does not shutdown the channel if an error occurs.
2633    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2634        let _result = self.send_raw();
2635        self.drop_without_shutdown();
2636        _result
2637    }
2638
2639    fn send_raw(&self) -> Result<(), fidl::Error> {
2640        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2641            (),
2642            self.tx_id,
2643            0x2efbf7d3dc21438e,
2644            fidl::encoding::DynamicFlags::empty(),
2645        )
2646    }
2647}
2648
2649#[must_use = "FIDL methods require a response to be sent"]
2650#[derive(Debug)]
2651pub struct ControllerFuzzResponder {
2652    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2653    tx_id: u32,
2654}
2655
2656/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2657/// if the responder is dropped without sending a response, so that the client
2658/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2659impl std::ops::Drop for ControllerFuzzResponder {
2660    fn drop(&mut self) {
2661        self.control_handle.shutdown();
2662        // Safety: drops once, never accessed again
2663        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2664    }
2665}
2666
2667impl fidl::endpoints::Responder for ControllerFuzzResponder {
2668    type ControlHandle = ControllerControlHandle;
2669
2670    fn control_handle(&self) -> &ControllerControlHandle {
2671        &self.control_handle
2672    }
2673
2674    fn drop_without_shutdown(mut self) {
2675        // Safety: drops once, never accessed again due to mem::forget
2676        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2677        // Prevent Drop from running (which would shut down the channel)
2678        std::mem::forget(self);
2679    }
2680}
2681
2682impl ControllerFuzzResponder {
2683    /// Sends a response to the FIDL transaction.
2684    ///
2685    /// Sets the channel to shutdown if an error occurs.
2686    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2687        let _result = self.send_raw(result);
2688        if _result.is_err() {
2689            self.control_handle.shutdown();
2690        }
2691        self.drop_without_shutdown();
2692        _result
2693    }
2694
2695    /// Similar to "send" but does not shutdown the channel if an error occurs.
2696    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2697        let _result = self.send_raw(result);
2698        self.drop_without_shutdown();
2699        _result
2700    }
2701
2702    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2703        self.control_handle
2704            .inner
2705            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2706                result,
2707                self.tx_id,
2708                0x62fe3684ea23af62,
2709                fidl::encoding::DynamicFlags::empty(),
2710            )
2711    }
2712}
2713
2714#[must_use = "FIDL methods require a response to be sent"]
2715#[derive(Debug)]
2716pub struct ControllerTryOneResponder {
2717    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2718    tx_id: u32,
2719}
2720
2721/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2722/// if the responder is dropped without sending a response, so that the client
2723/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2724impl std::ops::Drop for ControllerTryOneResponder {
2725    fn drop(&mut self) {
2726        self.control_handle.shutdown();
2727        // Safety: drops once, never accessed again
2728        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2729    }
2730}
2731
2732impl fidl::endpoints::Responder for ControllerTryOneResponder {
2733    type ControlHandle = ControllerControlHandle;
2734
2735    fn control_handle(&self) -> &ControllerControlHandle {
2736        &self.control_handle
2737    }
2738
2739    fn drop_without_shutdown(mut self) {
2740        // Safety: drops once, never accessed again due to mem::forget
2741        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2742        // Prevent Drop from running (which would shut down the channel)
2743        std::mem::forget(self);
2744    }
2745}
2746
2747impl ControllerTryOneResponder {
2748    /// Sends a response to the FIDL transaction.
2749    ///
2750    /// Sets the channel to shutdown if an error occurs.
2751    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2752        let _result = self.send_raw(result);
2753        if _result.is_err() {
2754            self.control_handle.shutdown();
2755        }
2756        self.drop_without_shutdown();
2757        _result
2758    }
2759
2760    /// Similar to "send" but does not shutdown the channel if an error occurs.
2761    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2762        let _result = self.send_raw(result);
2763        self.drop_without_shutdown();
2764        _result
2765    }
2766
2767    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2768        self.control_handle
2769            .inner
2770            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2771                result,
2772                self.tx_id,
2773                0x368dc762d8e16d46,
2774                fidl::encoding::DynamicFlags::empty(),
2775            )
2776    }
2777}
2778
2779#[must_use = "FIDL methods require a response to be sent"]
2780#[derive(Debug)]
2781pub struct ControllerMinimizeResponder {
2782    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2783    tx_id: u32,
2784}
2785
2786/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2787/// if the responder is dropped without sending a response, so that the client
2788/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2789impl std::ops::Drop for ControllerMinimizeResponder {
2790    fn drop(&mut self) {
2791        self.control_handle.shutdown();
2792        // Safety: drops once, never accessed again
2793        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2794    }
2795}
2796
2797impl fidl::endpoints::Responder for ControllerMinimizeResponder {
2798    type ControlHandle = ControllerControlHandle;
2799
2800    fn control_handle(&self) -> &ControllerControlHandle {
2801        &self.control_handle
2802    }
2803
2804    fn drop_without_shutdown(mut self) {
2805        // Safety: drops once, never accessed again due to mem::forget
2806        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2807        // Prevent Drop from running (which would shut down the channel)
2808        std::mem::forget(self);
2809    }
2810}
2811
2812impl ControllerMinimizeResponder {
2813    /// Sends a response to the FIDL transaction.
2814    ///
2815    /// Sets the channel to shutdown if an error occurs.
2816    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2817        let _result = self.send_raw(result);
2818        if _result.is_err() {
2819            self.control_handle.shutdown();
2820        }
2821        self.drop_without_shutdown();
2822        _result
2823    }
2824
2825    /// Similar to "send" but does not shutdown the channel if an error occurs.
2826    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2827        let _result = self.send_raw(result);
2828        self.drop_without_shutdown();
2829        _result
2830    }
2831
2832    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2833        self.control_handle
2834            .inner
2835            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2836                result,
2837                self.tx_id,
2838                0x105a242ee0552794,
2839                fidl::encoding::DynamicFlags::empty(),
2840            )
2841    }
2842}
2843
2844#[must_use = "FIDL methods require a response to be sent"]
2845#[derive(Debug)]
2846pub struct ControllerCleanseResponder {
2847    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2848    tx_id: u32,
2849}
2850
2851/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2852/// if the responder is dropped without sending a response, so that the client
2853/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2854impl std::ops::Drop for ControllerCleanseResponder {
2855    fn drop(&mut self) {
2856        self.control_handle.shutdown();
2857        // Safety: drops once, never accessed again
2858        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2859    }
2860}
2861
2862impl fidl::endpoints::Responder for ControllerCleanseResponder {
2863    type ControlHandle = ControllerControlHandle;
2864
2865    fn control_handle(&self) -> &ControllerControlHandle {
2866        &self.control_handle
2867    }
2868
2869    fn drop_without_shutdown(mut self) {
2870        // Safety: drops once, never accessed again due to mem::forget
2871        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2872        // Prevent Drop from running (which would shut down the channel)
2873        std::mem::forget(self);
2874    }
2875}
2876
2877impl ControllerCleanseResponder {
2878    /// Sends a response to the FIDL transaction.
2879    ///
2880    /// Sets the channel to shutdown if an error occurs.
2881    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2882        let _result = self.send_raw(result);
2883        if _result.is_err() {
2884            self.control_handle.shutdown();
2885        }
2886        self.drop_without_shutdown();
2887        _result
2888    }
2889
2890    /// Similar to "send" but does not shutdown the channel if an error occurs.
2891    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2892        let _result = self.send_raw(result);
2893        self.drop_without_shutdown();
2894        _result
2895    }
2896
2897    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2898        self.control_handle
2899            .inner
2900            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2901                result,
2902                self.tx_id,
2903                0x6d7892f62735f3e0,
2904                fidl::encoding::DynamicFlags::empty(),
2905            )
2906    }
2907}
2908
2909#[must_use = "FIDL methods require a response to be sent"]
2910#[derive(Debug)]
2911pub struct ControllerMergeResponder {
2912    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2913    tx_id: u32,
2914}
2915
2916/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2917/// if the responder is dropped without sending a response, so that the client
2918/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2919impl std::ops::Drop for ControllerMergeResponder {
2920    fn drop(&mut self) {
2921        self.control_handle.shutdown();
2922        // Safety: drops once, never accessed again
2923        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2924    }
2925}
2926
2927impl fidl::endpoints::Responder for ControllerMergeResponder {
2928    type ControlHandle = ControllerControlHandle;
2929
2930    fn control_handle(&self) -> &ControllerControlHandle {
2931        &self.control_handle
2932    }
2933
2934    fn drop_without_shutdown(mut self) {
2935        // Safety: drops once, never accessed again due to mem::forget
2936        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2937        // Prevent Drop from running (which would shut down the channel)
2938        std::mem::forget(self);
2939    }
2940}
2941
2942impl ControllerMergeResponder {
2943    /// Sends a response to the FIDL transaction.
2944    ///
2945    /// Sets the channel to shutdown if an error occurs.
2946    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2947        let _result = self.send_raw(result);
2948        if _result.is_err() {
2949            self.control_handle.shutdown();
2950        }
2951        self.drop_without_shutdown();
2952        _result
2953    }
2954
2955    /// Similar to "send" but does not shutdown the channel if an error occurs.
2956    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2957        let _result = self.send_raw(result);
2958        self.drop_without_shutdown();
2959        _result
2960    }
2961
2962    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2963        self.control_handle
2964            .inner
2965            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2966                result,
2967                self.tx_id,
2968                0x3614e5c39413b5eb,
2969                fidl::encoding::DynamicFlags::empty(),
2970            )
2971    }
2972}
2973
2974#[must_use = "FIDL methods require a response to be sent"]
2975#[derive(Debug)]
2976pub struct ControllerGetStatusResponder {
2977    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2978    tx_id: u32,
2979}
2980
2981/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2982/// if the responder is dropped without sending a response, so that the client
2983/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2984impl std::ops::Drop for ControllerGetStatusResponder {
2985    fn drop(&mut self) {
2986        self.control_handle.shutdown();
2987        // Safety: drops once, never accessed again
2988        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2989    }
2990}
2991
2992impl fidl::endpoints::Responder for ControllerGetStatusResponder {
2993    type ControlHandle = ControllerControlHandle;
2994
2995    fn control_handle(&self) -> &ControllerControlHandle {
2996        &self.control_handle
2997    }
2998
2999    fn drop_without_shutdown(mut self) {
3000        // Safety: drops once, never accessed again due to mem::forget
3001        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3002        // Prevent Drop from running (which would shut down the channel)
3003        std::mem::forget(self);
3004    }
3005}
3006
3007impl ControllerGetStatusResponder {
3008    /// Sends a response to the FIDL transaction.
3009    ///
3010    /// Sets the channel to shutdown if an error occurs.
3011    pub fn send(self, mut status: &Status) -> Result<(), fidl::Error> {
3012        let _result = self.send_raw(status);
3013        if _result.is_err() {
3014            self.control_handle.shutdown();
3015        }
3016        self.drop_without_shutdown();
3017        _result
3018    }
3019
3020    /// Similar to "send" but does not shutdown the channel if an error occurs.
3021    pub fn send_no_shutdown_on_err(self, mut status: &Status) -> Result<(), fidl::Error> {
3022        let _result = self.send_raw(status);
3023        self.drop_without_shutdown();
3024        _result
3025    }
3026
3027    fn send_raw(&self, mut status: &Status) -> Result<(), fidl::Error> {
3028        self.control_handle.inner.send::<ControllerGetStatusResponse>(
3029            (status,),
3030            self.tx_id,
3031            0x51db4975d93ce768,
3032            fidl::encoding::DynamicFlags::empty(),
3033        )
3034    }
3035}
3036
3037#[must_use = "FIDL methods require a response to be sent"]
3038#[derive(Debug)]
3039pub struct ControllerWatchArtifactResponder {
3040    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
3041    tx_id: u32,
3042}
3043
3044/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
3045/// if the responder is dropped without sending a response, so that the client
3046/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3047impl std::ops::Drop for ControllerWatchArtifactResponder {
3048    fn drop(&mut self) {
3049        self.control_handle.shutdown();
3050        // Safety: drops once, never accessed again
3051        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3052    }
3053}
3054
3055impl fidl::endpoints::Responder for ControllerWatchArtifactResponder {
3056    type ControlHandle = ControllerControlHandle;
3057
3058    fn control_handle(&self) -> &ControllerControlHandle {
3059        &self.control_handle
3060    }
3061
3062    fn drop_without_shutdown(mut self) {
3063        // Safety: drops once, never accessed again due to mem::forget
3064        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3065        // Prevent Drop from running (which would shut down the channel)
3066        std::mem::forget(self);
3067    }
3068}
3069
3070impl ControllerWatchArtifactResponder {
3071    /// Sends a response to the FIDL transaction.
3072    ///
3073    /// Sets the channel to shutdown if an error occurs.
3074    pub fn send(self, mut artifact: Artifact) -> Result<(), fidl::Error> {
3075        let _result = self.send_raw(artifact);
3076        if _result.is_err() {
3077            self.control_handle.shutdown();
3078        }
3079        self.drop_without_shutdown();
3080        _result
3081    }
3082
3083    /// Similar to "send" but does not shutdown the channel if an error occurs.
3084    pub fn send_no_shutdown_on_err(self, mut artifact: Artifact) -> Result<(), fidl::Error> {
3085        let _result = self.send_raw(artifact);
3086        self.drop_without_shutdown();
3087        _result
3088    }
3089
3090    fn send_raw(&self, mut artifact: Artifact) -> Result<(), fidl::Error> {
3091        self.control_handle.inner.send::<ControllerWatchArtifactResponse>(
3092            (&mut artifact,),
3093            self.tx_id,
3094            0x6cfca3730944a414,
3095            fidl::encoding::DynamicFlags::empty(),
3096        )
3097    }
3098}
3099
3100#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3101pub struct ControllerProviderMarker;
3102
3103impl fidl::endpoints::ProtocolMarker for ControllerProviderMarker {
3104    type Proxy = ControllerProviderProxy;
3105    type RequestStream = ControllerProviderRequestStream;
3106    #[cfg(target_os = "fuchsia")]
3107    type SynchronousProxy = ControllerProviderSynchronousProxy;
3108
3109    const DEBUG_NAME: &'static str = "(anonymous) ControllerProvider";
3110}
3111
3112pub trait ControllerProviderProxyInterface: Send + Sync {
3113    type ConnectResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
3114    fn r#connect(
3115        &self,
3116        controller: fidl::endpoints::ServerEnd<ControllerMarker>,
3117    ) -> Self::ConnectResponseFut;
3118    fn r#stop(&self) -> Result<(), fidl::Error>;
3119}
3120#[derive(Debug)]
3121#[cfg(target_os = "fuchsia")]
3122pub struct ControllerProviderSynchronousProxy {
3123    client: fidl::client::sync::Client,
3124}
3125
3126#[cfg(target_os = "fuchsia")]
3127impl fidl::endpoints::SynchronousProxy for ControllerProviderSynchronousProxy {
3128    type Proxy = ControllerProviderProxy;
3129    type Protocol = ControllerProviderMarker;
3130
3131    fn from_channel(inner: fidl::Channel) -> Self {
3132        Self::new(inner)
3133    }
3134
3135    fn into_channel(self) -> fidl::Channel {
3136        self.client.into_channel()
3137    }
3138
3139    fn as_channel(&self) -> &fidl::Channel {
3140        self.client.as_channel()
3141    }
3142}
3143
3144#[cfg(target_os = "fuchsia")]
3145impl ControllerProviderSynchronousProxy {
3146    pub fn new(channel: fidl::Channel) -> Self {
3147        Self { client: fidl::client::sync::Client::new(channel) }
3148    }
3149
3150    pub fn into_channel(self) -> fidl::Channel {
3151        self.client.into_channel()
3152    }
3153
3154    /// Waits until an event arrives and returns it. It is safe for other
3155    /// threads to make concurrent requests while waiting for an event.
3156    pub fn wait_for_event(
3157        &self,
3158        deadline: zx::MonotonicInstant,
3159    ) -> Result<ControllerProviderEvent, fidl::Error> {
3160        ControllerProviderEvent::decode(
3161            self.client.wait_for_event::<ControllerProviderMarker>(deadline)?,
3162        )
3163    }
3164
3165    /// Connects a client to the fuzzer.
3166    ///
3167    /// Within the component fuzzing framework, the fuzz-manager forwards
3168    /// `Controller` connection requests to the fuzz-registry, which uses
3169    /// clients of this interface provided by the fuzzers themselves to perform
3170    /// the connection.
3171    ///
3172    /// At most one client can be connected to a controller at any given time.
3173    /// A subsequent call to `Connect` will preempt and replace the existing
3174    /// connection.
3175    ///
3176    /// + request `controller` the connection from the client.
3177    pub fn r#connect(
3178        &self,
3179        mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
3180        ___deadline: zx::MonotonicInstant,
3181    ) -> Result<(), fidl::Error> {
3182        let _response = self.client.send_query::<
3183            ControllerProviderConnectRequest,
3184            fidl::encoding::EmptyPayload,
3185            ControllerProviderMarker,
3186        >(
3187            (controller,),
3188            0xc0325f0732defcb,
3189            fidl::encoding::DynamicFlags::empty(),
3190            ___deadline,
3191        )?;
3192        Ok(_response)
3193    }
3194
3195    /// Interrupt any current workflow, closes the channel, and exits the
3196    /// fuzzing engine.
3197    pub fn r#stop(&self) -> Result<(), fidl::Error> {
3198        self.client.send::<fidl::encoding::EmptyPayload>(
3199            (),
3200            0x6cd6a98fc38bcbf2,
3201            fidl::encoding::DynamicFlags::empty(),
3202        )
3203    }
3204}
3205
3206#[cfg(target_os = "fuchsia")]
3207impl From<ControllerProviderSynchronousProxy> for zx::NullableHandle {
3208    fn from(value: ControllerProviderSynchronousProxy) -> Self {
3209        value.into_channel().into()
3210    }
3211}
3212
3213#[cfg(target_os = "fuchsia")]
3214impl From<fidl::Channel> for ControllerProviderSynchronousProxy {
3215    fn from(value: fidl::Channel) -> Self {
3216        Self::new(value)
3217    }
3218}
3219
3220#[cfg(target_os = "fuchsia")]
3221impl fidl::endpoints::FromClient for ControllerProviderSynchronousProxy {
3222    type Protocol = ControllerProviderMarker;
3223
3224    fn from_client(value: fidl::endpoints::ClientEnd<ControllerProviderMarker>) -> Self {
3225        Self::new(value.into_channel())
3226    }
3227}
3228
3229#[derive(Debug, Clone)]
3230pub struct ControllerProviderProxy {
3231    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3232}
3233
3234impl fidl::endpoints::Proxy for ControllerProviderProxy {
3235    type Protocol = ControllerProviderMarker;
3236
3237    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3238        Self::new(inner)
3239    }
3240
3241    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3242        self.client.into_channel().map_err(|client| Self { client })
3243    }
3244
3245    fn as_channel(&self) -> &::fidl::AsyncChannel {
3246        self.client.as_channel()
3247    }
3248}
3249
3250impl ControllerProviderProxy {
3251    /// Create a new Proxy for fuchsia.fuzzer/ControllerProvider.
3252    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3253        let protocol_name =
3254            <ControllerProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3255        Self { client: fidl::client::Client::new(channel, protocol_name) }
3256    }
3257
3258    /// Get a Stream of events from the remote end of the protocol.
3259    ///
3260    /// # Panics
3261    ///
3262    /// Panics if the event stream was already taken.
3263    pub fn take_event_stream(&self) -> ControllerProviderEventStream {
3264        ControllerProviderEventStream { event_receiver: self.client.take_event_receiver() }
3265    }
3266
3267    /// Connects a client to the fuzzer.
3268    ///
3269    /// Within the component fuzzing framework, the fuzz-manager forwards
3270    /// `Controller` connection requests to the fuzz-registry, which uses
3271    /// clients of this interface provided by the fuzzers themselves to perform
3272    /// the connection.
3273    ///
3274    /// At most one client can be connected to a controller at any given time.
3275    /// A subsequent call to `Connect` will preempt and replace the existing
3276    /// connection.
3277    ///
3278    /// + request `controller` the connection from the client.
3279    pub fn r#connect(
3280        &self,
3281        mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
3282    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
3283        ControllerProviderProxyInterface::r#connect(self, controller)
3284    }
3285
3286    /// Interrupt any current workflow, closes the channel, and exits the
3287    /// fuzzing engine.
3288    pub fn r#stop(&self) -> Result<(), fidl::Error> {
3289        ControllerProviderProxyInterface::r#stop(self)
3290    }
3291}
3292
3293impl ControllerProviderProxyInterface for ControllerProviderProxy {
3294    type ConnectResponseFut =
3295        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
3296    fn r#connect(
3297        &self,
3298        mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
3299    ) -> Self::ConnectResponseFut {
3300        fn _decode(
3301            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3302        ) -> Result<(), fidl::Error> {
3303            let _response = fidl::client::decode_transaction_body::<
3304                fidl::encoding::EmptyPayload,
3305                fidl::encoding::DefaultFuchsiaResourceDialect,
3306                0xc0325f0732defcb,
3307            >(_buf?)?;
3308            Ok(_response)
3309        }
3310        self.client.send_query_and_decode::<ControllerProviderConnectRequest, ()>(
3311            (controller,),
3312            0xc0325f0732defcb,
3313            fidl::encoding::DynamicFlags::empty(),
3314            _decode,
3315        )
3316    }
3317
3318    fn r#stop(&self) -> Result<(), fidl::Error> {
3319        self.client.send::<fidl::encoding::EmptyPayload>(
3320            (),
3321            0x6cd6a98fc38bcbf2,
3322            fidl::encoding::DynamicFlags::empty(),
3323        )
3324    }
3325}
3326
3327pub struct ControllerProviderEventStream {
3328    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3329}
3330
3331impl std::marker::Unpin for ControllerProviderEventStream {}
3332
3333impl futures::stream::FusedStream for ControllerProviderEventStream {
3334    fn is_terminated(&self) -> bool {
3335        self.event_receiver.is_terminated()
3336    }
3337}
3338
3339impl futures::Stream for ControllerProviderEventStream {
3340    type Item = Result<ControllerProviderEvent, fidl::Error>;
3341
3342    fn poll_next(
3343        mut self: std::pin::Pin<&mut Self>,
3344        cx: &mut std::task::Context<'_>,
3345    ) -> std::task::Poll<Option<Self::Item>> {
3346        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3347            &mut self.event_receiver,
3348            cx
3349        )?) {
3350            Some(buf) => std::task::Poll::Ready(Some(ControllerProviderEvent::decode(buf))),
3351            None => std::task::Poll::Ready(None),
3352        }
3353    }
3354}
3355
3356#[derive(Debug)]
3357pub enum ControllerProviderEvent {}
3358
3359impl ControllerProviderEvent {
3360    /// Decodes a message buffer as a [`ControllerProviderEvent`].
3361    fn decode(
3362        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3363    ) -> Result<ControllerProviderEvent, fidl::Error> {
3364        let (bytes, _handles) = buf.split_mut();
3365        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3366        debug_assert_eq!(tx_header.tx_id, 0);
3367        match tx_header.ordinal {
3368            _ => Err(fidl::Error::UnknownOrdinal {
3369                ordinal: tx_header.ordinal,
3370                protocol_name:
3371                    <ControllerProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3372            }),
3373        }
3374    }
3375}
3376
3377/// A Stream of incoming requests for fuchsia.fuzzer/ControllerProvider.
3378pub struct ControllerProviderRequestStream {
3379    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3380    is_terminated: bool,
3381}
3382
3383impl std::marker::Unpin for ControllerProviderRequestStream {}
3384
3385impl futures::stream::FusedStream for ControllerProviderRequestStream {
3386    fn is_terminated(&self) -> bool {
3387        self.is_terminated
3388    }
3389}
3390
3391impl fidl::endpoints::RequestStream for ControllerProviderRequestStream {
3392    type Protocol = ControllerProviderMarker;
3393    type ControlHandle = ControllerProviderControlHandle;
3394
3395    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3396        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3397    }
3398
3399    fn control_handle(&self) -> Self::ControlHandle {
3400        ControllerProviderControlHandle { inner: self.inner.clone() }
3401    }
3402
3403    fn into_inner(
3404        self,
3405    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3406    {
3407        (self.inner, self.is_terminated)
3408    }
3409
3410    fn from_inner(
3411        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3412        is_terminated: bool,
3413    ) -> Self {
3414        Self { inner, is_terminated }
3415    }
3416}
3417
3418impl futures::Stream for ControllerProviderRequestStream {
3419    type Item = Result<ControllerProviderRequest, fidl::Error>;
3420
3421    fn poll_next(
3422        mut self: std::pin::Pin<&mut Self>,
3423        cx: &mut std::task::Context<'_>,
3424    ) -> std::task::Poll<Option<Self::Item>> {
3425        let this = &mut *self;
3426        if this.inner.check_shutdown(cx) {
3427            this.is_terminated = true;
3428            return std::task::Poll::Ready(None);
3429        }
3430        if this.is_terminated {
3431            panic!("polled ControllerProviderRequestStream after completion");
3432        }
3433        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3434            |bytes, handles| {
3435                match this.inner.channel().read_etc(cx, bytes, handles) {
3436                    std::task::Poll::Ready(Ok(())) => {}
3437                    std::task::Poll::Pending => return std::task::Poll::Pending,
3438                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3439                        this.is_terminated = true;
3440                        return std::task::Poll::Ready(None);
3441                    }
3442                    std::task::Poll::Ready(Err(e)) => {
3443                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3444                            e.into(),
3445                        ))));
3446                    }
3447                }
3448
3449                // A message has been received from the channel
3450                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3451
3452                std::task::Poll::Ready(Some(match header.ordinal {
3453                0xc0325f0732defcb => {
3454                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3455                    let mut req = fidl::new_empty!(ControllerProviderConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3456                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerProviderConnectRequest>(&header, _body_bytes, handles, &mut req)?;
3457                    let control_handle = ControllerProviderControlHandle {
3458                        inner: this.inner.clone(),
3459                    };
3460                    Ok(ControllerProviderRequest::Connect {controller: req.controller,
3461
3462                        responder: ControllerProviderConnectResponder {
3463                            control_handle: std::mem::ManuallyDrop::new(control_handle),
3464                            tx_id: header.tx_id,
3465                        },
3466                    })
3467                }
3468                0x6cd6a98fc38bcbf2 => {
3469                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3470                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
3471                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3472                    let control_handle = ControllerProviderControlHandle {
3473                        inner: this.inner.clone(),
3474                    };
3475                    Ok(ControllerProviderRequest::Stop {
3476                        control_handle,
3477                    })
3478                }
3479                _ => Err(fidl::Error::UnknownOrdinal {
3480                    ordinal: header.ordinal,
3481                    protocol_name: <ControllerProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3482                }),
3483            }))
3484            },
3485        )
3486    }
3487}
3488
3489/// Provides a `Controller` implementation.
3490///
3491/// This protocol is implemented by the fuzzing engine. This capability is *not*
3492/// routed. Instead, the engine uses the `fuchsia.fuzzer/Registry` channel
3493/// provided by the fuzz-test-runner to send the client end of this interface to
3494/// the fuzz-registry.
3495///
3496/// The fuzz-registry will close the channel upon error, or upon its own exit.
3497/// The fuzzer should exit and not attempt to reconnect when on channel close.
3498#[derive(Debug)]
3499pub enum ControllerProviderRequest {
3500    /// Connects a client to the fuzzer.
3501    ///
3502    /// Within the component fuzzing framework, the fuzz-manager forwards
3503    /// `Controller` connection requests to the fuzz-registry, which uses
3504    /// clients of this interface provided by the fuzzers themselves to perform
3505    /// the connection.
3506    ///
3507    /// At most one client can be connected to a controller at any given time.
3508    /// A subsequent call to `Connect` will preempt and replace the existing
3509    /// connection.
3510    ///
3511    /// + request `controller` the connection from the client.
3512    Connect {
3513        controller: fidl::endpoints::ServerEnd<ControllerMarker>,
3514        responder: ControllerProviderConnectResponder,
3515    },
3516    /// Interrupt any current workflow, closes the channel, and exits the
3517    /// fuzzing engine.
3518    Stop { control_handle: ControllerProviderControlHandle },
3519}
3520
3521impl ControllerProviderRequest {
3522    #[allow(irrefutable_let_patterns)]
3523    pub fn into_connect(
3524        self,
3525    ) -> Option<(fidl::endpoints::ServerEnd<ControllerMarker>, ControllerProviderConnectResponder)>
3526    {
3527        if let ControllerProviderRequest::Connect { controller, responder } = self {
3528            Some((controller, responder))
3529        } else {
3530            None
3531        }
3532    }
3533
3534    #[allow(irrefutable_let_patterns)]
3535    pub fn into_stop(self) -> Option<(ControllerProviderControlHandle)> {
3536        if let ControllerProviderRequest::Stop { control_handle } = self {
3537            Some((control_handle))
3538        } else {
3539            None
3540        }
3541    }
3542
3543    /// Name of the method defined in FIDL
3544    pub fn method_name(&self) -> &'static str {
3545        match *self {
3546            ControllerProviderRequest::Connect { .. } => "connect",
3547            ControllerProviderRequest::Stop { .. } => "stop",
3548        }
3549    }
3550}
3551
3552#[derive(Debug, Clone)]
3553pub struct ControllerProviderControlHandle {
3554    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3555}
3556
3557impl ControllerProviderControlHandle {
3558    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3559        self.inner.shutdown_with_epitaph(status.into())
3560    }
3561}
3562
3563impl fidl::endpoints::ControlHandle for ControllerProviderControlHandle {
3564    fn shutdown(&self) {
3565        self.inner.shutdown()
3566    }
3567
3568    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3569        self.inner.shutdown_with_epitaph(status)
3570    }
3571
3572    fn is_closed(&self) -> bool {
3573        self.inner.channel().is_closed()
3574    }
3575    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3576        self.inner.channel().on_closed()
3577    }
3578
3579    #[cfg(target_os = "fuchsia")]
3580    fn signal_peer(
3581        &self,
3582        clear_mask: zx::Signals,
3583        set_mask: zx::Signals,
3584    ) -> Result<(), zx_status::Status> {
3585        use fidl::Peered;
3586        self.inner.channel().signal_peer(clear_mask, set_mask)
3587    }
3588}
3589
3590impl ControllerProviderControlHandle {}
3591
3592#[must_use = "FIDL methods require a response to be sent"]
3593#[derive(Debug)]
3594pub struct ControllerProviderConnectResponder {
3595    control_handle: std::mem::ManuallyDrop<ControllerProviderControlHandle>,
3596    tx_id: u32,
3597}
3598
3599/// Set the the channel to be shutdown (see [`ControllerProviderControlHandle::shutdown`])
3600/// if the responder is dropped without sending a response, so that the client
3601/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3602impl std::ops::Drop for ControllerProviderConnectResponder {
3603    fn drop(&mut self) {
3604        self.control_handle.shutdown();
3605        // Safety: drops once, never accessed again
3606        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3607    }
3608}
3609
3610impl fidl::endpoints::Responder for ControllerProviderConnectResponder {
3611    type ControlHandle = ControllerProviderControlHandle;
3612
3613    fn control_handle(&self) -> &ControllerProviderControlHandle {
3614        &self.control_handle
3615    }
3616
3617    fn drop_without_shutdown(mut self) {
3618        // Safety: drops once, never accessed again due to mem::forget
3619        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3620        // Prevent Drop from running (which would shut down the channel)
3621        std::mem::forget(self);
3622    }
3623}
3624
3625impl ControllerProviderConnectResponder {
3626    /// Sends a response to the FIDL transaction.
3627    ///
3628    /// Sets the channel to shutdown if an error occurs.
3629    pub fn send(self) -> Result<(), fidl::Error> {
3630        let _result = self.send_raw();
3631        if _result.is_err() {
3632            self.control_handle.shutdown();
3633        }
3634        self.drop_without_shutdown();
3635        _result
3636    }
3637
3638    /// Similar to "send" but does not shutdown the channel if an error occurs.
3639    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3640        let _result = self.send_raw();
3641        self.drop_without_shutdown();
3642        _result
3643    }
3644
3645    fn send_raw(&self) -> Result<(), fidl::Error> {
3646        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3647            (),
3648            self.tx_id,
3649            0xc0325f0732defcb,
3650            fidl::encoding::DynamicFlags::empty(),
3651        )
3652    }
3653}
3654
3655#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3656pub struct CorpusReaderMarker;
3657
3658impl fidl::endpoints::ProtocolMarker for CorpusReaderMarker {
3659    type Proxy = CorpusReaderProxy;
3660    type RequestStream = CorpusReaderRequestStream;
3661    #[cfg(target_os = "fuchsia")]
3662    type SynchronousProxy = CorpusReaderSynchronousProxy;
3663
3664    const DEBUG_NAME: &'static str = "(anonymous) CorpusReader";
3665}
3666
3667pub trait CorpusReaderProxyInterface: Send + Sync {
3668    type NextResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
3669    fn r#next(&self, test_input: Input) -> Self::NextResponseFut;
3670}
3671#[derive(Debug)]
3672#[cfg(target_os = "fuchsia")]
3673pub struct CorpusReaderSynchronousProxy {
3674    client: fidl::client::sync::Client,
3675}
3676
3677#[cfg(target_os = "fuchsia")]
3678impl fidl::endpoints::SynchronousProxy for CorpusReaderSynchronousProxy {
3679    type Proxy = CorpusReaderProxy;
3680    type Protocol = CorpusReaderMarker;
3681
3682    fn from_channel(inner: fidl::Channel) -> Self {
3683        Self::new(inner)
3684    }
3685
3686    fn into_channel(self) -> fidl::Channel {
3687        self.client.into_channel()
3688    }
3689
3690    fn as_channel(&self) -> &fidl::Channel {
3691        self.client.as_channel()
3692    }
3693}
3694
3695#[cfg(target_os = "fuchsia")]
3696impl CorpusReaderSynchronousProxy {
3697    pub fn new(channel: fidl::Channel) -> Self {
3698        Self { client: fidl::client::sync::Client::new(channel) }
3699    }
3700
3701    pub fn into_channel(self) -> fidl::Channel {
3702        self.client.into_channel()
3703    }
3704
3705    /// Waits until an event arrives and returns it. It is safe for other
3706    /// threads to make concurrent requests while waiting for an event.
3707    pub fn wait_for_event(
3708        &self,
3709        deadline: zx::MonotonicInstant,
3710    ) -> Result<CorpusReaderEvent, fidl::Error> {
3711        CorpusReaderEvent::decode(self.client.wait_for_event::<CorpusReaderMarker>(deadline)?)
3712    }
3713
3714    /// Sends the next test input from the corpus.
3715    ///
3716    /// + request `test_input` the byte sequence representing the next test
3717    ///   input in a corpus.
3718    /// - response `result` one of the following:
3719    ///     - `ZX_OK` if the test input was sent.
3720    ///     - A socket error if transferring the input failed.
3721    pub fn r#next(
3722        &self,
3723        mut test_input: Input,
3724        ___deadline: zx::MonotonicInstant,
3725    ) -> Result<i32, fidl::Error> {
3726        let _response = self
3727            .client
3728            .send_query::<CorpusReaderNextRequest, CorpusReaderNextResponse, CorpusReaderMarker>(
3729                (&mut test_input,),
3730                0x68d19e55ea635356,
3731                fidl::encoding::DynamicFlags::empty(),
3732                ___deadline,
3733            )?;
3734        Ok(_response.result)
3735    }
3736}
3737
3738#[cfg(target_os = "fuchsia")]
3739impl From<CorpusReaderSynchronousProxy> for zx::NullableHandle {
3740    fn from(value: CorpusReaderSynchronousProxy) -> Self {
3741        value.into_channel().into()
3742    }
3743}
3744
3745#[cfg(target_os = "fuchsia")]
3746impl From<fidl::Channel> for CorpusReaderSynchronousProxy {
3747    fn from(value: fidl::Channel) -> Self {
3748        Self::new(value)
3749    }
3750}
3751
3752#[cfg(target_os = "fuchsia")]
3753impl fidl::endpoints::FromClient for CorpusReaderSynchronousProxy {
3754    type Protocol = CorpusReaderMarker;
3755
3756    fn from_client(value: fidl::endpoints::ClientEnd<CorpusReaderMarker>) -> Self {
3757        Self::new(value.into_channel())
3758    }
3759}
3760
3761#[derive(Debug, Clone)]
3762pub struct CorpusReaderProxy {
3763    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3764}
3765
3766impl fidl::endpoints::Proxy for CorpusReaderProxy {
3767    type Protocol = CorpusReaderMarker;
3768
3769    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3770        Self::new(inner)
3771    }
3772
3773    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3774        self.client.into_channel().map_err(|client| Self { client })
3775    }
3776
3777    fn as_channel(&self) -> &::fidl::AsyncChannel {
3778        self.client.as_channel()
3779    }
3780}
3781
3782impl CorpusReaderProxy {
3783    /// Create a new Proxy for fuchsia.fuzzer/CorpusReader.
3784    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3785        let protocol_name = <CorpusReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3786        Self { client: fidl::client::Client::new(channel, protocol_name) }
3787    }
3788
3789    /// Get a Stream of events from the remote end of the protocol.
3790    ///
3791    /// # Panics
3792    ///
3793    /// Panics if the event stream was already taken.
3794    pub fn take_event_stream(&self) -> CorpusReaderEventStream {
3795        CorpusReaderEventStream { event_receiver: self.client.take_event_receiver() }
3796    }
3797
3798    /// Sends the next test input from the corpus.
3799    ///
3800    /// + request `test_input` the byte sequence representing the next test
3801    ///   input in a corpus.
3802    /// - response `result` one of the following:
3803    ///     - `ZX_OK` if the test input was sent.
3804    ///     - A socket error if transferring the input failed.
3805    pub fn r#next(
3806        &self,
3807        mut test_input: Input,
3808    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
3809        CorpusReaderProxyInterface::r#next(self, test_input)
3810    }
3811}
3812
3813impl CorpusReaderProxyInterface for CorpusReaderProxy {
3814    type NextResponseFut =
3815        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
3816    fn r#next(&self, mut test_input: Input) -> Self::NextResponseFut {
3817        fn _decode(
3818            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3819        ) -> Result<i32, fidl::Error> {
3820            let _response = fidl::client::decode_transaction_body::<
3821                CorpusReaderNextResponse,
3822                fidl::encoding::DefaultFuchsiaResourceDialect,
3823                0x68d19e55ea635356,
3824            >(_buf?)?;
3825            Ok(_response.result)
3826        }
3827        self.client.send_query_and_decode::<CorpusReaderNextRequest, i32>(
3828            (&mut test_input,),
3829            0x68d19e55ea635356,
3830            fidl::encoding::DynamicFlags::empty(),
3831            _decode,
3832        )
3833    }
3834}
3835
3836pub struct CorpusReaderEventStream {
3837    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3838}
3839
3840impl std::marker::Unpin for CorpusReaderEventStream {}
3841
3842impl futures::stream::FusedStream for CorpusReaderEventStream {
3843    fn is_terminated(&self) -> bool {
3844        self.event_receiver.is_terminated()
3845    }
3846}
3847
3848impl futures::Stream for CorpusReaderEventStream {
3849    type Item = Result<CorpusReaderEvent, fidl::Error>;
3850
3851    fn poll_next(
3852        mut self: std::pin::Pin<&mut Self>,
3853        cx: &mut std::task::Context<'_>,
3854    ) -> std::task::Poll<Option<Self::Item>> {
3855        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3856            &mut self.event_receiver,
3857            cx
3858        )?) {
3859            Some(buf) => std::task::Poll::Ready(Some(CorpusReaderEvent::decode(buf))),
3860            None => std::task::Poll::Ready(None),
3861        }
3862    }
3863}
3864
3865#[derive(Debug)]
3866pub enum CorpusReaderEvent {}
3867
3868impl CorpusReaderEvent {
3869    /// Decodes a message buffer as a [`CorpusReaderEvent`].
3870    fn decode(
3871        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3872    ) -> Result<CorpusReaderEvent, fidl::Error> {
3873        let (bytes, _handles) = buf.split_mut();
3874        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3875        debug_assert_eq!(tx_header.tx_id, 0);
3876        match tx_header.ordinal {
3877            _ => Err(fidl::Error::UnknownOrdinal {
3878                ordinal: tx_header.ordinal,
3879                protocol_name: <CorpusReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3880            }),
3881        }
3882    }
3883}
3884
3885/// A Stream of incoming requests for fuchsia.fuzzer/CorpusReader.
3886pub struct CorpusReaderRequestStream {
3887    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3888    is_terminated: bool,
3889}
3890
3891impl std::marker::Unpin for CorpusReaderRequestStream {}
3892
3893impl futures::stream::FusedStream for CorpusReaderRequestStream {
3894    fn is_terminated(&self) -> bool {
3895        self.is_terminated
3896    }
3897}
3898
3899impl fidl::endpoints::RequestStream for CorpusReaderRequestStream {
3900    type Protocol = CorpusReaderMarker;
3901    type ControlHandle = CorpusReaderControlHandle;
3902
3903    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3904        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3905    }
3906
3907    fn control_handle(&self) -> Self::ControlHandle {
3908        CorpusReaderControlHandle { inner: self.inner.clone() }
3909    }
3910
3911    fn into_inner(
3912        self,
3913    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3914    {
3915        (self.inner, self.is_terminated)
3916    }
3917
3918    fn from_inner(
3919        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3920        is_terminated: bool,
3921    ) -> Self {
3922        Self { inner, is_terminated }
3923    }
3924}
3925
3926impl futures::Stream for CorpusReaderRequestStream {
3927    type Item = Result<CorpusReaderRequest, fidl::Error>;
3928
3929    fn poll_next(
3930        mut self: std::pin::Pin<&mut Self>,
3931        cx: &mut std::task::Context<'_>,
3932    ) -> std::task::Poll<Option<Self::Item>> {
3933        let this = &mut *self;
3934        if this.inner.check_shutdown(cx) {
3935            this.is_terminated = true;
3936            return std::task::Poll::Ready(None);
3937        }
3938        if this.is_terminated {
3939            panic!("polled CorpusReaderRequestStream after completion");
3940        }
3941        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3942            |bytes, handles| {
3943                match this.inner.channel().read_etc(cx, bytes, handles) {
3944                    std::task::Poll::Ready(Ok(())) => {}
3945                    std::task::Poll::Pending => return std::task::Poll::Pending,
3946                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3947                        this.is_terminated = true;
3948                        return std::task::Poll::Ready(None);
3949                    }
3950                    std::task::Poll::Ready(Err(e)) => {
3951                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3952                            e.into(),
3953                        ))));
3954                    }
3955                }
3956
3957                // A message has been received from the channel
3958                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3959
3960                std::task::Poll::Ready(Some(match header.ordinal {
3961                    0x68d19e55ea635356 => {
3962                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3963                        let mut req = fidl::new_empty!(
3964                            CorpusReaderNextRequest,
3965                            fidl::encoding::DefaultFuchsiaResourceDialect
3966                        );
3967                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CorpusReaderNextRequest>(&header, _body_bytes, handles, &mut req)?;
3968                        let control_handle =
3969                            CorpusReaderControlHandle { inner: this.inner.clone() };
3970                        Ok(CorpusReaderRequest::Next {
3971                            test_input: req.test_input,
3972
3973                            responder: CorpusReaderNextResponder {
3974                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3975                                tx_id: header.tx_id,
3976                            },
3977                        })
3978                    }
3979                    _ => Err(fidl::Error::UnknownOrdinal {
3980                        ordinal: header.ordinal,
3981                        protocol_name:
3982                            <CorpusReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3983                    }),
3984                }))
3985            },
3986        )
3987    }
3988}
3989
3990/// Sends a sequence of test inputs belonging to a fuzzer's corpus.
3991#[derive(Debug)]
3992pub enum CorpusReaderRequest {
3993    /// Sends the next test input from the corpus.
3994    ///
3995    /// + request `test_input` the byte sequence representing the next test
3996    ///   input in a corpus.
3997    /// - response `result` one of the following:
3998    ///     - `ZX_OK` if the test input was sent.
3999    ///     - A socket error if transferring the input failed.
4000    Next { test_input: Input, responder: CorpusReaderNextResponder },
4001}
4002
4003impl CorpusReaderRequest {
4004    #[allow(irrefutable_let_patterns)]
4005    pub fn into_next(self) -> Option<(Input, CorpusReaderNextResponder)> {
4006        if let CorpusReaderRequest::Next { test_input, responder } = self {
4007            Some((test_input, responder))
4008        } else {
4009            None
4010        }
4011    }
4012
4013    /// Name of the method defined in FIDL
4014    pub fn method_name(&self) -> &'static str {
4015        match *self {
4016            CorpusReaderRequest::Next { .. } => "next",
4017        }
4018    }
4019}
4020
4021#[derive(Debug, Clone)]
4022pub struct CorpusReaderControlHandle {
4023    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4024}
4025
4026impl CorpusReaderControlHandle {
4027    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
4028        self.inner.shutdown_with_epitaph(status.into())
4029    }
4030}
4031
4032impl fidl::endpoints::ControlHandle for CorpusReaderControlHandle {
4033    fn shutdown(&self) {
4034        self.inner.shutdown()
4035    }
4036
4037    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
4038        self.inner.shutdown_with_epitaph(status)
4039    }
4040
4041    fn is_closed(&self) -> bool {
4042        self.inner.channel().is_closed()
4043    }
4044    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4045        self.inner.channel().on_closed()
4046    }
4047
4048    #[cfg(target_os = "fuchsia")]
4049    fn signal_peer(
4050        &self,
4051        clear_mask: zx::Signals,
4052        set_mask: zx::Signals,
4053    ) -> Result<(), zx_status::Status> {
4054        use fidl::Peered;
4055        self.inner.channel().signal_peer(clear_mask, set_mask)
4056    }
4057}
4058
4059impl CorpusReaderControlHandle {}
4060
4061#[must_use = "FIDL methods require a response to be sent"]
4062#[derive(Debug)]
4063pub struct CorpusReaderNextResponder {
4064    control_handle: std::mem::ManuallyDrop<CorpusReaderControlHandle>,
4065    tx_id: u32,
4066}
4067
4068/// Set the the channel to be shutdown (see [`CorpusReaderControlHandle::shutdown`])
4069/// if the responder is dropped without sending a response, so that the client
4070/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4071impl std::ops::Drop for CorpusReaderNextResponder {
4072    fn drop(&mut self) {
4073        self.control_handle.shutdown();
4074        // Safety: drops once, never accessed again
4075        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4076    }
4077}
4078
4079impl fidl::endpoints::Responder for CorpusReaderNextResponder {
4080    type ControlHandle = CorpusReaderControlHandle;
4081
4082    fn control_handle(&self) -> &CorpusReaderControlHandle {
4083        &self.control_handle
4084    }
4085
4086    fn drop_without_shutdown(mut self) {
4087        // Safety: drops once, never accessed again due to mem::forget
4088        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4089        // Prevent Drop from running (which would shut down the channel)
4090        std::mem::forget(self);
4091    }
4092}
4093
4094impl CorpusReaderNextResponder {
4095    /// Sends a response to the FIDL transaction.
4096    ///
4097    /// Sets the channel to shutdown if an error occurs.
4098    pub fn send(self, mut result: i32) -> Result<(), fidl::Error> {
4099        let _result = self.send_raw(result);
4100        if _result.is_err() {
4101            self.control_handle.shutdown();
4102        }
4103        self.drop_without_shutdown();
4104        _result
4105    }
4106
4107    /// Similar to "send" but does not shutdown the channel if an error occurs.
4108    pub fn send_no_shutdown_on_err(self, mut result: i32) -> Result<(), fidl::Error> {
4109        let _result = self.send_raw(result);
4110        self.drop_without_shutdown();
4111        _result
4112    }
4113
4114    fn send_raw(&self, mut result: i32) -> Result<(), fidl::Error> {
4115        self.control_handle.inner.send::<CorpusReaderNextResponse>(
4116            (result,),
4117            self.tx_id,
4118            0x68d19e55ea635356,
4119            fidl::encoding::DynamicFlags::empty(),
4120        )
4121    }
4122}
4123
4124#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4125pub struct CoverageDataCollectorMarker;
4126
4127impl fidl::endpoints::ProtocolMarker for CoverageDataCollectorMarker {
4128    type Proxy = CoverageDataCollectorProxy;
4129    type RequestStream = CoverageDataCollectorRequestStream;
4130    #[cfg(target_os = "fuchsia")]
4131    type SynchronousProxy = CoverageDataCollectorSynchronousProxy;
4132
4133    const DEBUG_NAME: &'static str = "fuchsia.fuzzer.CoverageDataCollector";
4134}
4135impl fidl::endpoints::DiscoverableProtocolMarker for CoverageDataCollectorMarker {}
4136
4137pub trait CoverageDataCollectorProxyInterface: Send + Sync {
4138    type InitializeResponseFut: std::future::Future<Output = Result<Options, fidl::Error>> + Send;
4139    fn r#initialize(
4140        &self,
4141        eventpair: fidl::EventPair,
4142        process: fidl::Process,
4143    ) -> Self::InitializeResponseFut;
4144    type AddInline8bitCountersResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
4145        + Send;
4146    fn r#add_inline8bit_counters(
4147        &self,
4148        inline_8bit_counters: fidl::Vmo,
4149    ) -> Self::AddInline8bitCountersResponseFut;
4150}
4151#[derive(Debug)]
4152#[cfg(target_os = "fuchsia")]
4153pub struct CoverageDataCollectorSynchronousProxy {
4154    client: fidl::client::sync::Client,
4155}
4156
4157#[cfg(target_os = "fuchsia")]
4158impl fidl::endpoints::SynchronousProxy for CoverageDataCollectorSynchronousProxy {
4159    type Proxy = CoverageDataCollectorProxy;
4160    type Protocol = CoverageDataCollectorMarker;
4161
4162    fn from_channel(inner: fidl::Channel) -> Self {
4163        Self::new(inner)
4164    }
4165
4166    fn into_channel(self) -> fidl::Channel {
4167        self.client.into_channel()
4168    }
4169
4170    fn as_channel(&self) -> &fidl::Channel {
4171        self.client.as_channel()
4172    }
4173}
4174
4175#[cfg(target_os = "fuchsia")]
4176impl CoverageDataCollectorSynchronousProxy {
4177    pub fn new(channel: fidl::Channel) -> Self {
4178        Self { client: fidl::client::sync::Client::new(channel) }
4179    }
4180
4181    pub fn into_channel(self) -> fidl::Channel {
4182        self.client.into_channel()
4183    }
4184
4185    /// Waits until an event arrives and returns it. It is safe for other
4186    /// threads to make concurrent requests while waiting for an event.
4187    pub fn wait_for_event(
4188        &self,
4189        deadline: zx::MonotonicInstant,
4190    ) -> Result<CoverageDataCollectorEvent, fidl::Error> {
4191        CoverageDataCollectorEvent::decode(
4192            self.client.wait_for_event::<CoverageDataCollectorMarker>(deadline)?,
4193        )
4194    }
4195
4196    /// Registers the instrumented target process.
4197    ///
4198    /// This method is called once per connection to set up:
4199    ///    * The eventpair used to synchronize the start and end of code coverage collection.
4200    ///    * The process Handle used to monitor the target process for errors.
4201    ///
4202    /// This method must be called before the target process can call `AddLlvmModule`.
4203    ///
4204    /// It returns the currently set options; see `fuchsia.fuzzer.Controller/Configure`.
4205    ///
4206    /// Certain options determine sanitizer behaviors before `main` is called, and cannot
4207    /// subsequently be changed while the target process is running. This is the root cause of the
4208    /// constraint in `Controller` against modifying options during "long-running workflows", i.e
4209    /// those that spawn target processes.
4210    ///
4211    /// The channel is closed on FIDL error. Clients should not attempt to reconnect.
4212    pub fn r#initialize(
4213        &self,
4214        mut eventpair: fidl::EventPair,
4215        mut process: fidl::Process,
4216        ___deadline: zx::MonotonicInstant,
4217    ) -> Result<Options, fidl::Error> {
4218        let _response = self.client.send_query::<
4219            CoverageDataCollectorInitializeRequest,
4220            CoverageDataCollectorInitializeResponse,
4221            CoverageDataCollectorMarker,
4222        >(
4223            (eventpair, process,),
4224            0x51d6f91d6f02d9d6,
4225            fidl::encoding::DynamicFlags::empty(),
4226            ___deadline,
4227        )?;
4228        Ok(_response.options)
4229    }
4230
4231    /// Adds a VMO with the code coverage of an LLVM module.
4232    ///
4233    /// The VMO used to share inline 8-bit code-coverage edge counters for a single LLVM module in
4234    /// an instrumented target process.
4235    ///
4236    /// Its ZX_PROP_NAME property must be set, and client and server implementations must agree on
4237    /// how to use it to uniquely identify the module. If the same module is added more than once by
4238    /// different processes, the module identifiers must match so that the code counters can be
4239    /// combined.
4240    ///
4241    /// Its ZX_PROP_VMO_CONTENT_SIZE property must be set to the actual number of counters present.
4242    ///
4243    /// It is an error to call this method without first calling |Initialize|.
4244    ///
4245    /// The channel is closed on FIDL error. Clients should not attempt to reconnect.
4246    ///
4247    /// See also:
4248    ///     https://clang.llvm.org/docs/SanitizerCoverage.html#inline-8bit-counters
4249    pub fn r#add_inline8bit_counters(
4250        &self,
4251        mut inline_8bit_counters: fidl::Vmo,
4252        ___deadline: zx::MonotonicInstant,
4253    ) -> Result<(), fidl::Error> {
4254        let _response = self.client.send_query::<
4255            CoverageDataCollectorAddInline8bitCountersRequest,
4256            fidl::encoding::EmptyPayload,
4257            CoverageDataCollectorMarker,
4258        >(
4259            (inline_8bit_counters,),
4260            0x75f87cadfc94d1be,
4261            fidl::encoding::DynamicFlags::empty(),
4262            ___deadline,
4263        )?;
4264        Ok(_response)
4265    }
4266}
4267
4268#[cfg(target_os = "fuchsia")]
4269impl From<CoverageDataCollectorSynchronousProxy> for zx::NullableHandle {
4270    fn from(value: CoverageDataCollectorSynchronousProxy) -> Self {
4271        value.into_channel().into()
4272    }
4273}
4274
4275#[cfg(target_os = "fuchsia")]
4276impl From<fidl::Channel> for CoverageDataCollectorSynchronousProxy {
4277    fn from(value: fidl::Channel) -> Self {
4278        Self::new(value)
4279    }
4280}
4281
4282#[cfg(target_os = "fuchsia")]
4283impl fidl::endpoints::FromClient for CoverageDataCollectorSynchronousProxy {
4284    type Protocol = CoverageDataCollectorMarker;
4285
4286    fn from_client(value: fidl::endpoints::ClientEnd<CoverageDataCollectorMarker>) -> Self {
4287        Self::new(value.into_channel())
4288    }
4289}
4290
4291#[derive(Debug, Clone)]
4292pub struct CoverageDataCollectorProxy {
4293    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4294}
4295
4296impl fidl::endpoints::Proxy for CoverageDataCollectorProxy {
4297    type Protocol = CoverageDataCollectorMarker;
4298
4299    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4300        Self::new(inner)
4301    }
4302
4303    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4304        self.client.into_channel().map_err(|client| Self { client })
4305    }
4306
4307    fn as_channel(&self) -> &::fidl::AsyncChannel {
4308        self.client.as_channel()
4309    }
4310}
4311
4312impl CoverageDataCollectorProxy {
4313    /// Create a new Proxy for fuchsia.fuzzer/CoverageDataCollector.
4314    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4315        let protocol_name =
4316            <CoverageDataCollectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4317        Self { client: fidl::client::Client::new(channel, protocol_name) }
4318    }
4319
4320    /// Get a Stream of events from the remote end of the protocol.
4321    ///
4322    /// # Panics
4323    ///
4324    /// Panics if the event stream was already taken.
4325    pub fn take_event_stream(&self) -> CoverageDataCollectorEventStream {
4326        CoverageDataCollectorEventStream { event_receiver: self.client.take_event_receiver() }
4327    }
4328
4329    /// Registers the instrumented target process.
4330    ///
4331    /// This method is called once per connection to set up:
4332    ///    * The eventpair used to synchronize the start and end of code coverage collection.
4333    ///    * The process Handle used to monitor the target process for errors.
4334    ///
4335    /// This method must be called before the target process can call `AddLlvmModule`.
4336    ///
4337    /// It returns the currently set options; see `fuchsia.fuzzer.Controller/Configure`.
4338    ///
4339    /// Certain options determine sanitizer behaviors before `main` is called, and cannot
4340    /// subsequently be changed while the target process is running. This is the root cause of the
4341    /// constraint in `Controller` against modifying options during "long-running workflows", i.e
4342    /// those that spawn target processes.
4343    ///
4344    /// The channel is closed on FIDL error. Clients should not attempt to reconnect.
4345    pub fn r#initialize(
4346        &self,
4347        mut eventpair: fidl::EventPair,
4348        mut process: fidl::Process,
4349    ) -> fidl::client::QueryResponseFut<Options, fidl::encoding::DefaultFuchsiaResourceDialect>
4350    {
4351        CoverageDataCollectorProxyInterface::r#initialize(self, eventpair, process)
4352    }
4353
4354    /// Adds a VMO with the code coverage of an LLVM module.
4355    ///
4356    /// The VMO used to share inline 8-bit code-coverage edge counters for a single LLVM module in
4357    /// an instrumented target process.
4358    ///
4359    /// Its ZX_PROP_NAME property must be set, and client and server implementations must agree on
4360    /// how to use it to uniquely identify the module. If the same module is added more than once by
4361    /// different processes, the module identifiers must match so that the code counters can be
4362    /// combined.
4363    ///
4364    /// Its ZX_PROP_VMO_CONTENT_SIZE property must be set to the actual number of counters present.
4365    ///
4366    /// It is an error to call this method without first calling |Initialize|.
4367    ///
4368    /// The channel is closed on FIDL error. Clients should not attempt to reconnect.
4369    ///
4370    /// See also:
4371    ///     https://clang.llvm.org/docs/SanitizerCoverage.html#inline-8bit-counters
4372    pub fn r#add_inline8bit_counters(
4373        &self,
4374        mut inline_8bit_counters: fidl::Vmo,
4375    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
4376        CoverageDataCollectorProxyInterface::r#add_inline8bit_counters(self, inline_8bit_counters)
4377    }
4378}
4379
4380impl CoverageDataCollectorProxyInterface for CoverageDataCollectorProxy {
4381    type InitializeResponseFut =
4382        fidl::client::QueryResponseFut<Options, fidl::encoding::DefaultFuchsiaResourceDialect>;
4383    fn r#initialize(
4384        &self,
4385        mut eventpair: fidl::EventPair,
4386        mut process: fidl::Process,
4387    ) -> Self::InitializeResponseFut {
4388        fn _decode(
4389            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4390        ) -> Result<Options, fidl::Error> {
4391            let _response = fidl::client::decode_transaction_body::<
4392                CoverageDataCollectorInitializeResponse,
4393                fidl::encoding::DefaultFuchsiaResourceDialect,
4394                0x51d6f91d6f02d9d6,
4395            >(_buf?)?;
4396            Ok(_response.options)
4397        }
4398        self.client.send_query_and_decode::<CoverageDataCollectorInitializeRequest, Options>(
4399            (eventpair, process),
4400            0x51d6f91d6f02d9d6,
4401            fidl::encoding::DynamicFlags::empty(),
4402            _decode,
4403        )
4404    }
4405
4406    type AddInline8bitCountersResponseFut =
4407        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
4408    fn r#add_inline8bit_counters(
4409        &self,
4410        mut inline_8bit_counters: fidl::Vmo,
4411    ) -> Self::AddInline8bitCountersResponseFut {
4412        fn _decode(
4413            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4414        ) -> Result<(), fidl::Error> {
4415            let _response = fidl::client::decode_transaction_body::<
4416                fidl::encoding::EmptyPayload,
4417                fidl::encoding::DefaultFuchsiaResourceDialect,
4418                0x75f87cadfc94d1be,
4419            >(_buf?)?;
4420            Ok(_response)
4421        }
4422        self.client.send_query_and_decode::<CoverageDataCollectorAddInline8bitCountersRequest, ()>(
4423            (inline_8bit_counters,),
4424            0x75f87cadfc94d1be,
4425            fidl::encoding::DynamicFlags::empty(),
4426            _decode,
4427        )
4428    }
4429}
4430
4431pub struct CoverageDataCollectorEventStream {
4432    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4433}
4434
4435impl std::marker::Unpin for CoverageDataCollectorEventStream {}
4436
4437impl futures::stream::FusedStream for CoverageDataCollectorEventStream {
4438    fn is_terminated(&self) -> bool {
4439        self.event_receiver.is_terminated()
4440    }
4441}
4442
4443impl futures::Stream for CoverageDataCollectorEventStream {
4444    type Item = Result<CoverageDataCollectorEvent, fidl::Error>;
4445
4446    fn poll_next(
4447        mut self: std::pin::Pin<&mut Self>,
4448        cx: &mut std::task::Context<'_>,
4449    ) -> std::task::Poll<Option<Self::Item>> {
4450        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4451            &mut self.event_receiver,
4452            cx
4453        )?) {
4454            Some(buf) => std::task::Poll::Ready(Some(CoverageDataCollectorEvent::decode(buf))),
4455            None => std::task::Poll::Ready(None),
4456        }
4457    }
4458}
4459
4460#[derive(Debug)]
4461pub enum CoverageDataCollectorEvent {}
4462
4463impl CoverageDataCollectorEvent {
4464    /// Decodes a message buffer as a [`CoverageDataCollectorEvent`].
4465    fn decode(
4466        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4467    ) -> Result<CoverageDataCollectorEvent, fidl::Error> {
4468        let (bytes, _handles) = buf.split_mut();
4469        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4470        debug_assert_eq!(tx_header.tx_id, 0);
4471        match tx_header.ordinal {
4472            _ => Err(fidl::Error::UnknownOrdinal {
4473                ordinal: tx_header.ordinal,
4474                protocol_name:
4475                    <CoverageDataCollectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4476            }),
4477        }
4478    }
4479}
4480
4481/// A Stream of incoming requests for fuchsia.fuzzer/CoverageDataCollector.
4482pub struct CoverageDataCollectorRequestStream {
4483    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4484    is_terminated: bool,
4485}
4486
4487impl std::marker::Unpin for CoverageDataCollectorRequestStream {}
4488
4489impl futures::stream::FusedStream for CoverageDataCollectorRequestStream {
4490    fn is_terminated(&self) -> bool {
4491        self.is_terminated
4492    }
4493}
4494
4495impl fidl::endpoints::RequestStream for CoverageDataCollectorRequestStream {
4496    type Protocol = CoverageDataCollectorMarker;
4497    type ControlHandle = CoverageDataCollectorControlHandle;
4498
4499    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4500        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4501    }
4502
4503    fn control_handle(&self) -> Self::ControlHandle {
4504        CoverageDataCollectorControlHandle { inner: self.inner.clone() }
4505    }
4506
4507    fn into_inner(
4508        self,
4509    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4510    {
4511        (self.inner, self.is_terminated)
4512    }
4513
4514    fn from_inner(
4515        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4516        is_terminated: bool,
4517    ) -> Self {
4518        Self { inner, is_terminated }
4519    }
4520}
4521
4522impl futures::Stream for CoverageDataCollectorRequestStream {
4523    type Item = Result<CoverageDataCollectorRequest, fidl::Error>;
4524
4525    fn poll_next(
4526        mut self: std::pin::Pin<&mut Self>,
4527        cx: &mut std::task::Context<'_>,
4528    ) -> std::task::Poll<Option<Self::Item>> {
4529        let this = &mut *self;
4530        if this.inner.check_shutdown(cx) {
4531            this.is_terminated = true;
4532            return std::task::Poll::Ready(None);
4533        }
4534        if this.is_terminated {
4535            panic!("polled CoverageDataCollectorRequestStream after completion");
4536        }
4537        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4538            |bytes, handles| {
4539                match this.inner.channel().read_etc(cx, bytes, handles) {
4540                    std::task::Poll::Ready(Ok(())) => {}
4541                    std::task::Poll::Pending => return std::task::Poll::Pending,
4542                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4543                        this.is_terminated = true;
4544                        return std::task::Poll::Ready(None);
4545                    }
4546                    std::task::Poll::Ready(Err(e)) => {
4547                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4548                            e.into(),
4549                        ))));
4550                    }
4551                }
4552
4553                // A message has been received from the channel
4554                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4555
4556                std::task::Poll::Ready(Some(match header.ordinal {
4557                0x51d6f91d6f02d9d6 => {
4558                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4559                    let mut req = fidl::new_empty!(CoverageDataCollectorInitializeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4560                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoverageDataCollectorInitializeRequest>(&header, _body_bytes, handles, &mut req)?;
4561                    let control_handle = CoverageDataCollectorControlHandle {
4562                        inner: this.inner.clone(),
4563                    };
4564                    Ok(CoverageDataCollectorRequest::Initialize {eventpair: req.eventpair,
4565process: req.process,
4566
4567                        responder: CoverageDataCollectorInitializeResponder {
4568                            control_handle: std::mem::ManuallyDrop::new(control_handle),
4569                            tx_id: header.tx_id,
4570                        },
4571                    })
4572                }
4573                0x75f87cadfc94d1be => {
4574                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4575                    let mut req = fidl::new_empty!(CoverageDataCollectorAddInline8bitCountersRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4576                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoverageDataCollectorAddInline8bitCountersRequest>(&header, _body_bytes, handles, &mut req)?;
4577                    let control_handle = CoverageDataCollectorControlHandle {
4578                        inner: this.inner.clone(),
4579                    };
4580                    Ok(CoverageDataCollectorRequest::AddInline8bitCounters {inline_8bit_counters: req.inline_8bit_counters,
4581
4582                        responder: CoverageDataCollectorAddInline8bitCountersResponder {
4583                            control_handle: std::mem::ManuallyDrop::new(control_handle),
4584                            tx_id: header.tx_id,
4585                        },
4586                    })
4587                }
4588                _ => Err(fidl::Error::UnknownOrdinal {
4589                    ordinal: header.ordinal,
4590                    protocol_name: <CoverageDataCollectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4591                }),
4592            }))
4593            },
4594        )
4595    }
4596}
4597
4598/// Collects VMOs used to share code coverage from instrumented target processes.
4599///
4600/// The instrumented target processes act as clients to this protocol, which is implemented by
4601/// test_manager's fuzz_coverage component. The protocol coordinates feedback collection and other
4602/// diagnostics with target processes under test. The connection should be established very early in
4603/// a target process's lifecycle, i.e. before `main` begins.
4604#[derive(Debug)]
4605pub enum CoverageDataCollectorRequest {
4606    /// Registers the instrumented target process.
4607    ///
4608    /// This method is called once per connection to set up:
4609    ///    * The eventpair used to synchronize the start and end of code coverage collection.
4610    ///    * The process Handle used to monitor the target process for errors.
4611    ///
4612    /// This method must be called before the target process can call `AddLlvmModule`.
4613    ///
4614    /// It returns the currently set options; see `fuchsia.fuzzer.Controller/Configure`.
4615    ///
4616    /// Certain options determine sanitizer behaviors before `main` is called, and cannot
4617    /// subsequently be changed while the target process is running. This is the root cause of the
4618    /// constraint in `Controller` against modifying options during "long-running workflows", i.e
4619    /// those that spawn target processes.
4620    ///
4621    /// The channel is closed on FIDL error. Clients should not attempt to reconnect.
4622    Initialize {
4623        eventpair: fidl::EventPair,
4624        process: fidl::Process,
4625        responder: CoverageDataCollectorInitializeResponder,
4626    },
4627    /// Adds a VMO with the code coverage of an LLVM module.
4628    ///
4629    /// The VMO used to share inline 8-bit code-coverage edge counters for a single LLVM module in
4630    /// an instrumented target process.
4631    ///
4632    /// Its ZX_PROP_NAME property must be set, and client and server implementations must agree on
4633    /// how to use it to uniquely identify the module. If the same module is added more than once by
4634    /// different processes, the module identifiers must match so that the code counters can be
4635    /// combined.
4636    ///
4637    /// Its ZX_PROP_VMO_CONTENT_SIZE property must be set to the actual number of counters present.
4638    ///
4639    /// It is an error to call this method without first calling |Initialize|.
4640    ///
4641    /// The channel is closed on FIDL error. Clients should not attempt to reconnect.
4642    ///
4643    /// See also:
4644    ///     https://clang.llvm.org/docs/SanitizerCoverage.html#inline-8bit-counters
4645    AddInline8bitCounters {
4646        inline_8bit_counters: fidl::Vmo,
4647        responder: CoverageDataCollectorAddInline8bitCountersResponder,
4648    },
4649}
4650
4651impl CoverageDataCollectorRequest {
4652    #[allow(irrefutable_let_patterns)]
4653    pub fn into_initialize(
4654        self,
4655    ) -> Option<(fidl::EventPair, fidl::Process, CoverageDataCollectorInitializeResponder)> {
4656        if let CoverageDataCollectorRequest::Initialize { eventpair, process, responder } = self {
4657            Some((eventpair, process, responder))
4658        } else {
4659            None
4660        }
4661    }
4662
4663    #[allow(irrefutable_let_patterns)]
4664    pub fn into_add_inline8bit_counters(
4665        self,
4666    ) -> Option<(fidl::Vmo, CoverageDataCollectorAddInline8bitCountersResponder)> {
4667        if let CoverageDataCollectorRequest::AddInline8bitCounters {
4668            inline_8bit_counters,
4669            responder,
4670        } = self
4671        {
4672            Some((inline_8bit_counters, responder))
4673        } else {
4674            None
4675        }
4676    }
4677
4678    /// Name of the method defined in FIDL
4679    pub fn method_name(&self) -> &'static str {
4680        match *self {
4681            CoverageDataCollectorRequest::Initialize { .. } => "initialize",
4682            CoverageDataCollectorRequest::AddInline8bitCounters { .. } => "add_inline8bit_counters",
4683        }
4684    }
4685}
4686
4687#[derive(Debug, Clone)]
4688pub struct CoverageDataCollectorControlHandle {
4689    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4690}
4691
4692impl CoverageDataCollectorControlHandle {
4693    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
4694        self.inner.shutdown_with_epitaph(status.into())
4695    }
4696}
4697
4698impl fidl::endpoints::ControlHandle for CoverageDataCollectorControlHandle {
4699    fn shutdown(&self) {
4700        self.inner.shutdown()
4701    }
4702
4703    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
4704        self.inner.shutdown_with_epitaph(status)
4705    }
4706
4707    fn is_closed(&self) -> bool {
4708        self.inner.channel().is_closed()
4709    }
4710    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4711        self.inner.channel().on_closed()
4712    }
4713
4714    #[cfg(target_os = "fuchsia")]
4715    fn signal_peer(
4716        &self,
4717        clear_mask: zx::Signals,
4718        set_mask: zx::Signals,
4719    ) -> Result<(), zx_status::Status> {
4720        use fidl::Peered;
4721        self.inner.channel().signal_peer(clear_mask, set_mask)
4722    }
4723}
4724
4725impl CoverageDataCollectorControlHandle {}
4726
4727#[must_use = "FIDL methods require a response to be sent"]
4728#[derive(Debug)]
4729pub struct CoverageDataCollectorInitializeResponder {
4730    control_handle: std::mem::ManuallyDrop<CoverageDataCollectorControlHandle>,
4731    tx_id: u32,
4732}
4733
4734/// Set the the channel to be shutdown (see [`CoverageDataCollectorControlHandle::shutdown`])
4735/// if the responder is dropped without sending a response, so that the client
4736/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4737impl std::ops::Drop for CoverageDataCollectorInitializeResponder {
4738    fn drop(&mut self) {
4739        self.control_handle.shutdown();
4740        // Safety: drops once, never accessed again
4741        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4742    }
4743}
4744
4745impl fidl::endpoints::Responder for CoverageDataCollectorInitializeResponder {
4746    type ControlHandle = CoverageDataCollectorControlHandle;
4747
4748    fn control_handle(&self) -> &CoverageDataCollectorControlHandle {
4749        &self.control_handle
4750    }
4751
4752    fn drop_without_shutdown(mut self) {
4753        // Safety: drops once, never accessed again due to mem::forget
4754        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4755        // Prevent Drop from running (which would shut down the channel)
4756        std::mem::forget(self);
4757    }
4758}
4759
4760impl CoverageDataCollectorInitializeResponder {
4761    /// Sends a response to the FIDL transaction.
4762    ///
4763    /// Sets the channel to shutdown if an error occurs.
4764    pub fn send(self, mut options: &Options) -> Result<(), fidl::Error> {
4765        let _result = self.send_raw(options);
4766        if _result.is_err() {
4767            self.control_handle.shutdown();
4768        }
4769        self.drop_without_shutdown();
4770        _result
4771    }
4772
4773    /// Similar to "send" but does not shutdown the channel if an error occurs.
4774    pub fn send_no_shutdown_on_err(self, mut options: &Options) -> Result<(), fidl::Error> {
4775        let _result = self.send_raw(options);
4776        self.drop_without_shutdown();
4777        _result
4778    }
4779
4780    fn send_raw(&self, mut options: &Options) -> Result<(), fidl::Error> {
4781        self.control_handle.inner.send::<CoverageDataCollectorInitializeResponse>(
4782            (options,),
4783            self.tx_id,
4784            0x51d6f91d6f02d9d6,
4785            fidl::encoding::DynamicFlags::empty(),
4786        )
4787    }
4788}
4789
4790#[must_use = "FIDL methods require a response to be sent"]
4791#[derive(Debug)]
4792pub struct CoverageDataCollectorAddInline8bitCountersResponder {
4793    control_handle: std::mem::ManuallyDrop<CoverageDataCollectorControlHandle>,
4794    tx_id: u32,
4795}
4796
4797/// Set the the channel to be shutdown (see [`CoverageDataCollectorControlHandle::shutdown`])
4798/// if the responder is dropped without sending a response, so that the client
4799/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4800impl std::ops::Drop for CoverageDataCollectorAddInline8bitCountersResponder {
4801    fn drop(&mut self) {
4802        self.control_handle.shutdown();
4803        // Safety: drops once, never accessed again
4804        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4805    }
4806}
4807
4808impl fidl::endpoints::Responder for CoverageDataCollectorAddInline8bitCountersResponder {
4809    type ControlHandle = CoverageDataCollectorControlHandle;
4810
4811    fn control_handle(&self) -> &CoverageDataCollectorControlHandle {
4812        &self.control_handle
4813    }
4814
4815    fn drop_without_shutdown(mut self) {
4816        // Safety: drops once, never accessed again due to mem::forget
4817        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4818        // Prevent Drop from running (which would shut down the channel)
4819        std::mem::forget(self);
4820    }
4821}
4822
4823impl CoverageDataCollectorAddInline8bitCountersResponder {
4824    /// Sends a response to the FIDL transaction.
4825    ///
4826    /// Sets the channel to shutdown if an error occurs.
4827    pub fn send(self) -> Result<(), fidl::Error> {
4828        let _result = self.send_raw();
4829        if _result.is_err() {
4830            self.control_handle.shutdown();
4831        }
4832        self.drop_without_shutdown();
4833        _result
4834    }
4835
4836    /// Similar to "send" but does not shutdown the channel if an error occurs.
4837    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
4838        let _result = self.send_raw();
4839        self.drop_without_shutdown();
4840        _result
4841    }
4842
4843    fn send_raw(&self) -> Result<(), fidl::Error> {
4844        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
4845            (),
4846            self.tx_id,
4847            0x75f87cadfc94d1be,
4848            fidl::encoding::DynamicFlags::empty(),
4849        )
4850    }
4851}
4852
4853#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4854pub struct CoverageDataProviderMarker;
4855
4856impl fidl::endpoints::ProtocolMarker for CoverageDataProviderMarker {
4857    type Proxy = CoverageDataProviderProxy;
4858    type RequestStream = CoverageDataProviderRequestStream;
4859    #[cfg(target_os = "fuchsia")]
4860    type SynchronousProxy = CoverageDataProviderSynchronousProxy;
4861
4862    const DEBUG_NAME: &'static str = "fuchsia.fuzzer.CoverageDataProvider";
4863}
4864impl fidl::endpoints::DiscoverableProtocolMarker for CoverageDataProviderMarker {}
4865
4866pub trait CoverageDataProviderProxyInterface: Send + Sync {
4867    fn r#set_options(&self, options: &Options) -> Result<(), fidl::Error>;
4868    type WatchCoverageDataResponseFut: std::future::Future<Output = Result<Vec<CoverageData>, fidl::Error>>
4869        + Send;
4870    fn r#watch_coverage_data(&self) -> Self::WatchCoverageDataResponseFut;
4871}
4872#[derive(Debug)]
4873#[cfg(target_os = "fuchsia")]
4874pub struct CoverageDataProviderSynchronousProxy {
4875    client: fidl::client::sync::Client,
4876}
4877
4878#[cfg(target_os = "fuchsia")]
4879impl fidl::endpoints::SynchronousProxy for CoverageDataProviderSynchronousProxy {
4880    type Proxy = CoverageDataProviderProxy;
4881    type Protocol = CoverageDataProviderMarker;
4882
4883    fn from_channel(inner: fidl::Channel) -> Self {
4884        Self::new(inner)
4885    }
4886
4887    fn into_channel(self) -> fidl::Channel {
4888        self.client.into_channel()
4889    }
4890
4891    fn as_channel(&self) -> &fidl::Channel {
4892        self.client.as_channel()
4893    }
4894}
4895
4896#[cfg(target_os = "fuchsia")]
4897impl CoverageDataProviderSynchronousProxy {
4898    pub fn new(channel: fidl::Channel) -> Self {
4899        Self { client: fidl::client::sync::Client::new(channel) }
4900    }
4901
4902    pub fn into_channel(self) -> fidl::Channel {
4903        self.client.into_channel()
4904    }
4905
4906    /// Waits until an event arrives and returns it. It is safe for other
4907    /// threads to make concurrent requests while waiting for an event.
4908    pub fn wait_for_event(
4909        &self,
4910        deadline: zx::MonotonicInstant,
4911    ) -> Result<CoverageDataProviderEvent, fidl::Error> {
4912        CoverageDataProviderEvent::decode(
4913            self.client.wait_for_event::<CoverageDataProviderMarker>(deadline)?,
4914        )
4915    }
4916
4917    /// Sets the options to be returned by `fuchsia.fuzzer.CoverageDataCollector/Initialize`.
4918    pub fn r#set_options(&self, mut options: &Options) -> Result<(), fidl::Error> {
4919        self.client.send::<CoverageDataProviderSetOptionsRequest>(
4920            (options,),
4921            0x4873c4a5c7683384,
4922            fidl::encoding::DynamicFlags::empty(),
4923        )
4924    }
4925
4926    /// Provides coverage data collected from multiple processes.
4927    ///
4928    /// Returns a vector of `CoverageData` structs containing the information provided by clients of
4929    /// `fuchsia.fuzzer.CoverageDataCollector`. This method uses the "hanging get" pattern: The
4930    /// initial call will immediately return whatever data is available, up to `MAX_COVERAGE_DATA`.
4931    /// If no fuzzed components have been started yet, this be an empty vector. If there are more
4932    /// than `MAX_COVERAGE_DATA` elements available, the remainder are retained for subsequent
4933    /// calls. If there is no more data available, subsequent calls will block until new coverage
4934    /// data is available.
4935    ///
4936    /// The channel is closed on FIDL error. Clients should exit and not attempt to reconnect.
4937    pub fn r#watch_coverage_data(
4938        &self,
4939        ___deadline: zx::MonotonicInstant,
4940    ) -> Result<Vec<CoverageData>, fidl::Error> {
4941        let _response = self.client.send_query::<
4942            fidl::encoding::EmptyPayload,
4943            CoverageDataProviderWatchCoverageDataResponse,
4944            CoverageDataProviderMarker,
4945        >(
4946            (),
4947            0x34a92fc9c73bea5a,
4948            fidl::encoding::DynamicFlags::empty(),
4949            ___deadline,
4950        )?;
4951        Ok(_response.coverage_data)
4952    }
4953}
4954
4955#[cfg(target_os = "fuchsia")]
4956impl From<CoverageDataProviderSynchronousProxy> for zx::NullableHandle {
4957    fn from(value: CoverageDataProviderSynchronousProxy) -> Self {
4958        value.into_channel().into()
4959    }
4960}
4961
4962#[cfg(target_os = "fuchsia")]
4963impl From<fidl::Channel> for CoverageDataProviderSynchronousProxy {
4964    fn from(value: fidl::Channel) -> Self {
4965        Self::new(value)
4966    }
4967}
4968
4969#[cfg(target_os = "fuchsia")]
4970impl fidl::endpoints::FromClient for CoverageDataProviderSynchronousProxy {
4971    type Protocol = CoverageDataProviderMarker;
4972
4973    fn from_client(value: fidl::endpoints::ClientEnd<CoverageDataProviderMarker>) -> Self {
4974        Self::new(value.into_channel())
4975    }
4976}
4977
4978#[derive(Debug, Clone)]
4979pub struct CoverageDataProviderProxy {
4980    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4981}
4982
4983impl fidl::endpoints::Proxy for CoverageDataProviderProxy {
4984    type Protocol = CoverageDataProviderMarker;
4985
4986    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4987        Self::new(inner)
4988    }
4989
4990    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4991        self.client.into_channel().map_err(|client| Self { client })
4992    }
4993
4994    fn as_channel(&self) -> &::fidl::AsyncChannel {
4995        self.client.as_channel()
4996    }
4997}
4998
4999impl CoverageDataProviderProxy {
5000    /// Create a new Proxy for fuchsia.fuzzer/CoverageDataProvider.
5001    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5002        let protocol_name =
5003            <CoverageDataProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5004        Self { client: fidl::client::Client::new(channel, protocol_name) }
5005    }
5006
5007    /// Get a Stream of events from the remote end of the protocol.
5008    ///
5009    /// # Panics
5010    ///
5011    /// Panics if the event stream was already taken.
5012    pub fn take_event_stream(&self) -> CoverageDataProviderEventStream {
5013        CoverageDataProviderEventStream { event_receiver: self.client.take_event_receiver() }
5014    }
5015
5016    /// Sets the options to be returned by `fuchsia.fuzzer.CoverageDataCollector/Initialize`.
5017    pub fn r#set_options(&self, mut options: &Options) -> Result<(), fidl::Error> {
5018        CoverageDataProviderProxyInterface::r#set_options(self, options)
5019    }
5020
5021    /// Provides coverage data collected from multiple processes.
5022    ///
5023    /// Returns a vector of `CoverageData` structs containing the information provided by clients of
5024    /// `fuchsia.fuzzer.CoverageDataCollector`. This method uses the "hanging get" pattern: The
5025    /// initial call will immediately return whatever data is available, up to `MAX_COVERAGE_DATA`.
5026    /// If no fuzzed components have been started yet, this be an empty vector. If there are more
5027    /// than `MAX_COVERAGE_DATA` elements available, the remainder are retained for subsequent
5028    /// calls. If there is no more data available, subsequent calls will block until new coverage
5029    /// data is available.
5030    ///
5031    /// The channel is closed on FIDL error. Clients should exit and not attempt to reconnect.
5032    pub fn r#watch_coverage_data(
5033        &self,
5034    ) -> fidl::client::QueryResponseFut<
5035        Vec<CoverageData>,
5036        fidl::encoding::DefaultFuchsiaResourceDialect,
5037    > {
5038        CoverageDataProviderProxyInterface::r#watch_coverage_data(self)
5039    }
5040}
5041
5042impl CoverageDataProviderProxyInterface for CoverageDataProviderProxy {
5043    fn r#set_options(&self, mut options: &Options) -> Result<(), fidl::Error> {
5044        self.client.send::<CoverageDataProviderSetOptionsRequest>(
5045            (options,),
5046            0x4873c4a5c7683384,
5047            fidl::encoding::DynamicFlags::empty(),
5048        )
5049    }
5050
5051    type WatchCoverageDataResponseFut = fidl::client::QueryResponseFut<
5052        Vec<CoverageData>,
5053        fidl::encoding::DefaultFuchsiaResourceDialect,
5054    >;
5055    fn r#watch_coverage_data(&self) -> Self::WatchCoverageDataResponseFut {
5056        fn _decode(
5057            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5058        ) -> Result<Vec<CoverageData>, fidl::Error> {
5059            let _response = fidl::client::decode_transaction_body::<
5060                CoverageDataProviderWatchCoverageDataResponse,
5061                fidl::encoding::DefaultFuchsiaResourceDialect,
5062                0x34a92fc9c73bea5a,
5063            >(_buf?)?;
5064            Ok(_response.coverage_data)
5065        }
5066        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<CoverageData>>(
5067            (),
5068            0x34a92fc9c73bea5a,
5069            fidl::encoding::DynamicFlags::empty(),
5070            _decode,
5071        )
5072    }
5073}
5074
5075pub struct CoverageDataProviderEventStream {
5076    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5077}
5078
5079impl std::marker::Unpin for CoverageDataProviderEventStream {}
5080
5081impl futures::stream::FusedStream for CoverageDataProviderEventStream {
5082    fn is_terminated(&self) -> bool {
5083        self.event_receiver.is_terminated()
5084    }
5085}
5086
5087impl futures::Stream for CoverageDataProviderEventStream {
5088    type Item = Result<CoverageDataProviderEvent, fidl::Error>;
5089
5090    fn poll_next(
5091        mut self: std::pin::Pin<&mut Self>,
5092        cx: &mut std::task::Context<'_>,
5093    ) -> std::task::Poll<Option<Self::Item>> {
5094        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5095            &mut self.event_receiver,
5096            cx
5097        )?) {
5098            Some(buf) => std::task::Poll::Ready(Some(CoverageDataProviderEvent::decode(buf))),
5099            None => std::task::Poll::Ready(None),
5100        }
5101    }
5102}
5103
5104#[derive(Debug)]
5105pub enum CoverageDataProviderEvent {}
5106
5107impl CoverageDataProviderEvent {
5108    /// Decodes a message buffer as a [`CoverageDataProviderEvent`].
5109    fn decode(
5110        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5111    ) -> Result<CoverageDataProviderEvent, fidl::Error> {
5112        let (bytes, _handles) = buf.split_mut();
5113        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5114        debug_assert_eq!(tx_header.tx_id, 0);
5115        match tx_header.ordinal {
5116            _ => Err(fidl::Error::UnknownOrdinal {
5117                ordinal: tx_header.ordinal,
5118                protocol_name:
5119                    <CoverageDataProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5120            }),
5121        }
5122    }
5123}
5124
5125/// A Stream of incoming requests for fuchsia.fuzzer/CoverageDataProvider.
5126pub struct CoverageDataProviderRequestStream {
5127    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5128    is_terminated: bool,
5129}
5130
5131impl std::marker::Unpin for CoverageDataProviderRequestStream {}
5132
5133impl futures::stream::FusedStream for CoverageDataProviderRequestStream {
5134    fn is_terminated(&self) -> bool {
5135        self.is_terminated
5136    }
5137}
5138
5139impl fidl::endpoints::RequestStream for CoverageDataProviderRequestStream {
5140    type Protocol = CoverageDataProviderMarker;
5141    type ControlHandle = CoverageDataProviderControlHandle;
5142
5143    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5144        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5145    }
5146
5147    fn control_handle(&self) -> Self::ControlHandle {
5148        CoverageDataProviderControlHandle { inner: self.inner.clone() }
5149    }
5150
5151    fn into_inner(
5152        self,
5153    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5154    {
5155        (self.inner, self.is_terminated)
5156    }
5157
5158    fn from_inner(
5159        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5160        is_terminated: bool,
5161    ) -> Self {
5162        Self { inner, is_terminated }
5163    }
5164}
5165
5166impl futures::Stream for CoverageDataProviderRequestStream {
5167    type Item = Result<CoverageDataProviderRequest, fidl::Error>;
5168
5169    fn poll_next(
5170        mut self: std::pin::Pin<&mut Self>,
5171        cx: &mut std::task::Context<'_>,
5172    ) -> std::task::Poll<Option<Self::Item>> {
5173        let this = &mut *self;
5174        if this.inner.check_shutdown(cx) {
5175            this.is_terminated = true;
5176            return std::task::Poll::Ready(None);
5177        }
5178        if this.is_terminated {
5179            panic!("polled CoverageDataProviderRequestStream after completion");
5180        }
5181        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5182            |bytes, handles| {
5183                match this.inner.channel().read_etc(cx, bytes, handles) {
5184                    std::task::Poll::Ready(Ok(())) => {}
5185                    std::task::Poll::Pending => return std::task::Poll::Pending,
5186                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5187                        this.is_terminated = true;
5188                        return std::task::Poll::Ready(None);
5189                    }
5190                    std::task::Poll::Ready(Err(e)) => {
5191                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5192                            e.into(),
5193                        ))));
5194                    }
5195                }
5196
5197                // A message has been received from the channel
5198                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5199
5200                std::task::Poll::Ready(Some(match header.ordinal {
5201                0x4873c4a5c7683384 => {
5202                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5203                    let mut req = fidl::new_empty!(CoverageDataProviderSetOptionsRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
5204                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoverageDataProviderSetOptionsRequest>(&header, _body_bytes, handles, &mut req)?;
5205                    let control_handle = CoverageDataProviderControlHandle {
5206                        inner: this.inner.clone(),
5207                    };
5208                    Ok(CoverageDataProviderRequest::SetOptions {options: req.options,
5209
5210                        control_handle,
5211                    })
5212                }
5213                0x34a92fc9c73bea5a => {
5214                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5215                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
5216                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5217                    let control_handle = CoverageDataProviderControlHandle {
5218                        inner: this.inner.clone(),
5219                    };
5220                    Ok(CoverageDataProviderRequest::WatchCoverageData {
5221                        responder: CoverageDataProviderWatchCoverageDataResponder {
5222                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5223                            tx_id: header.tx_id,
5224                        },
5225                    })
5226                }
5227                _ => Err(fidl::Error::UnknownOrdinal {
5228                    ordinal: header.ordinal,
5229                    protocol_name: <CoverageDataProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5230                }),
5231            }))
5232            },
5233        )
5234    }
5235}
5236
5237/// Provides the process Handles and VMOs used to share code coverage to the fuzzing engine.
5238///
5239/// This protocol is implemented by `test_manager`'s `fuzz_coverage` component. The fuzzing engine
5240/// acts as a client, although it does not connect directly. Instead the `fuzz_test_runner` makes
5241/// the connection and passes it off to fuzzing engine on process start. It allows the engine to
5242/// retrieve the coverage-related Handles published by instrumented target processes.
5243///
5244/// The channel is closed on FIDL error. Clients should exit and not attempt to reconnect.
5245#[derive(Debug)]
5246pub enum CoverageDataProviderRequest {
5247    /// Sets the options to be returned by `fuchsia.fuzzer.CoverageDataCollector/Initialize`.
5248    SetOptions { options: Options, control_handle: CoverageDataProviderControlHandle },
5249    /// Provides coverage data collected from multiple processes.
5250    ///
5251    /// Returns a vector of `CoverageData` structs containing the information provided by clients of
5252    /// `fuchsia.fuzzer.CoverageDataCollector`. This method uses the "hanging get" pattern: The
5253    /// initial call will immediately return whatever data is available, up to `MAX_COVERAGE_DATA`.
5254    /// If no fuzzed components have been started yet, this be an empty vector. If there are more
5255    /// than `MAX_COVERAGE_DATA` elements available, the remainder are retained for subsequent
5256    /// calls. If there is no more data available, subsequent calls will block until new coverage
5257    /// data is available.
5258    ///
5259    /// The channel is closed on FIDL error. Clients should exit and not attempt to reconnect.
5260    WatchCoverageData { responder: CoverageDataProviderWatchCoverageDataResponder },
5261}
5262
5263impl CoverageDataProviderRequest {
5264    #[allow(irrefutable_let_patterns)]
5265    pub fn into_set_options(self) -> Option<(Options, CoverageDataProviderControlHandle)> {
5266        if let CoverageDataProviderRequest::SetOptions { options, control_handle } = self {
5267            Some((options, control_handle))
5268        } else {
5269            None
5270        }
5271    }
5272
5273    #[allow(irrefutable_let_patterns)]
5274    pub fn into_watch_coverage_data(
5275        self,
5276    ) -> Option<(CoverageDataProviderWatchCoverageDataResponder)> {
5277        if let CoverageDataProviderRequest::WatchCoverageData { responder } = self {
5278            Some((responder))
5279        } else {
5280            None
5281        }
5282    }
5283
5284    /// Name of the method defined in FIDL
5285    pub fn method_name(&self) -> &'static str {
5286        match *self {
5287            CoverageDataProviderRequest::SetOptions { .. } => "set_options",
5288            CoverageDataProviderRequest::WatchCoverageData { .. } => "watch_coverage_data",
5289        }
5290    }
5291}
5292
5293#[derive(Debug, Clone)]
5294pub struct CoverageDataProviderControlHandle {
5295    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5296}
5297
5298impl CoverageDataProviderControlHandle {
5299    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5300        self.inner.shutdown_with_epitaph(status.into())
5301    }
5302}
5303
5304impl fidl::endpoints::ControlHandle for CoverageDataProviderControlHandle {
5305    fn shutdown(&self) {
5306        self.inner.shutdown()
5307    }
5308
5309    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5310        self.inner.shutdown_with_epitaph(status)
5311    }
5312
5313    fn is_closed(&self) -> bool {
5314        self.inner.channel().is_closed()
5315    }
5316    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5317        self.inner.channel().on_closed()
5318    }
5319
5320    #[cfg(target_os = "fuchsia")]
5321    fn signal_peer(
5322        &self,
5323        clear_mask: zx::Signals,
5324        set_mask: zx::Signals,
5325    ) -> Result<(), zx_status::Status> {
5326        use fidl::Peered;
5327        self.inner.channel().signal_peer(clear_mask, set_mask)
5328    }
5329}
5330
5331impl CoverageDataProviderControlHandle {}
5332
5333#[must_use = "FIDL methods require a response to be sent"]
5334#[derive(Debug)]
5335pub struct CoverageDataProviderWatchCoverageDataResponder {
5336    control_handle: std::mem::ManuallyDrop<CoverageDataProviderControlHandle>,
5337    tx_id: u32,
5338}
5339
5340/// Set the the channel to be shutdown (see [`CoverageDataProviderControlHandle::shutdown`])
5341/// if the responder is dropped without sending a response, so that the client
5342/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5343impl std::ops::Drop for CoverageDataProviderWatchCoverageDataResponder {
5344    fn drop(&mut self) {
5345        self.control_handle.shutdown();
5346        // Safety: drops once, never accessed again
5347        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5348    }
5349}
5350
5351impl fidl::endpoints::Responder for CoverageDataProviderWatchCoverageDataResponder {
5352    type ControlHandle = CoverageDataProviderControlHandle;
5353
5354    fn control_handle(&self) -> &CoverageDataProviderControlHandle {
5355        &self.control_handle
5356    }
5357
5358    fn drop_without_shutdown(mut self) {
5359        // Safety: drops once, never accessed again due to mem::forget
5360        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5361        // Prevent Drop from running (which would shut down the channel)
5362        std::mem::forget(self);
5363    }
5364}
5365
5366impl CoverageDataProviderWatchCoverageDataResponder {
5367    /// Sends a response to the FIDL transaction.
5368    ///
5369    /// Sets the channel to shutdown if an error occurs.
5370    pub fn send(self, mut coverage_data: Vec<CoverageData>) -> Result<(), fidl::Error> {
5371        let _result = self.send_raw(coverage_data);
5372        if _result.is_err() {
5373            self.control_handle.shutdown();
5374        }
5375        self.drop_without_shutdown();
5376        _result
5377    }
5378
5379    /// Similar to "send" but does not shutdown the channel if an error occurs.
5380    pub fn send_no_shutdown_on_err(
5381        self,
5382        mut coverage_data: Vec<CoverageData>,
5383    ) -> Result<(), fidl::Error> {
5384        let _result = self.send_raw(coverage_data);
5385        self.drop_without_shutdown();
5386        _result
5387    }
5388
5389    fn send_raw(&self, mut coverage_data: Vec<CoverageData>) -> Result<(), fidl::Error> {
5390        self.control_handle.inner.send::<CoverageDataProviderWatchCoverageDataResponse>(
5391            (coverage_data.as_mut(),),
5392            self.tx_id,
5393            0x34a92fc9c73bea5a,
5394            fidl::encoding::DynamicFlags::empty(),
5395        )
5396    }
5397}
5398
5399#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5400pub struct ManagerMarker;
5401
5402impl fidl::endpoints::ProtocolMarker for ManagerMarker {
5403    type Proxy = ManagerProxy;
5404    type RequestStream = ManagerRequestStream;
5405    #[cfg(target_os = "fuchsia")]
5406    type SynchronousProxy = ManagerSynchronousProxy;
5407
5408    const DEBUG_NAME: &'static str = "fuchsia.fuzzer.Manager";
5409}
5410impl fidl::endpoints::DiscoverableProtocolMarker for ManagerMarker {}
5411pub type ManagerConnectResult = Result<(), i32>;
5412pub type ManagerGetOutputResult = Result<(), i32>;
5413pub type ManagerStopResult = Result<(), i32>;
5414
5415pub trait ManagerProxyInterface: Send + Sync {
5416    type ConnectResponseFut: std::future::Future<Output = Result<ManagerConnectResult, fidl::Error>>
5417        + Send;
5418    fn r#connect(
5419        &self,
5420        fuzzer_url: &str,
5421        controller: fidl::endpoints::ServerEnd<ControllerMarker>,
5422    ) -> Self::ConnectResponseFut;
5423    type GetOutputResponseFut: std::future::Future<Output = Result<ManagerGetOutputResult, fidl::Error>>
5424        + Send;
5425    fn r#get_output(
5426        &self,
5427        fuzzer_url: &str,
5428        output: TestOutput,
5429        socket: fidl::Socket,
5430    ) -> Self::GetOutputResponseFut;
5431    type StopResponseFut: std::future::Future<Output = Result<ManagerStopResult, fidl::Error>>
5432        + Send;
5433    fn r#stop(&self, fuzzer_url: &str) -> Self::StopResponseFut;
5434}
5435#[derive(Debug)]
5436#[cfg(target_os = "fuchsia")]
5437pub struct ManagerSynchronousProxy {
5438    client: fidl::client::sync::Client,
5439}
5440
5441#[cfg(target_os = "fuchsia")]
5442impl fidl::endpoints::SynchronousProxy for ManagerSynchronousProxy {
5443    type Proxy = ManagerProxy;
5444    type Protocol = ManagerMarker;
5445
5446    fn from_channel(inner: fidl::Channel) -> Self {
5447        Self::new(inner)
5448    }
5449
5450    fn into_channel(self) -> fidl::Channel {
5451        self.client.into_channel()
5452    }
5453
5454    fn as_channel(&self) -> &fidl::Channel {
5455        self.client.as_channel()
5456    }
5457}
5458
5459#[cfg(target_os = "fuchsia")]
5460impl ManagerSynchronousProxy {
5461    pub fn new(channel: fidl::Channel) -> Self {
5462        Self { client: fidl::client::sync::Client::new(channel) }
5463    }
5464
5465    pub fn into_channel(self) -> fidl::Channel {
5466        self.client.into_channel()
5467    }
5468
5469    /// Waits until an event arrives and returns it. It is safe for other
5470    /// threads to make concurrent requests while waiting for an event.
5471    pub fn wait_for_event(
5472        &self,
5473        deadline: zx::MonotonicInstant,
5474    ) -> Result<ManagerEvent, fidl::Error> {
5475        ManagerEvent::decode(self.client.wait_for_event::<ManagerMarker>(deadline)?)
5476    }
5477
5478    /// Connects to a fuzzer that implements the `fuchsia.fuzzer/Controller`
5479    /// protocol.
5480    ///
5481    /// If the fuzzer is not currently running, the `fuzz_manager` will first
5482    /// start it (via the test_manager) before proceeding. The `fuzz_manager`
5483    /// sends the `controller` on to the fuzz-registry, which contains the
5484    /// `ControllerProviders` that can fulfill the connection request.
5485    ///
5486    /// See `fuchsia.test.manager/LaunchError` for details on ways
5487    /// `test_manager` can fail.
5488    ///
5489    /// + request `fuzzer_url` the package URL for the fuzzer.
5490    /// + request `controller` the connection from the client.
5491    /// * error one of the following:
5492    ///     * `ZX_ERR_NO_RESOURCES` if `test_manager` needs resources that are
5493    ///       unavailable.
5494    ///     * `ZX_ERR_NOT_FOUND` if the fuzzer URL is not recognized by
5495    ///       `test_manager`.
5496    ///     * `ZX_ERR_INVALID_ARGS` if `test_manager` reports invalid arguments.
5497    ///     * `ZX_ERR_NOT_SUPPORTED` if `test_manager` cannot connect to the
5498    ///       test suite.
5499    ///     * `ZX_ERR_INTERNAL` if `test_manager` encountered some other,
5500    ///       unspecified failure.
5501    ///     * `ZX_ERR_TIMED_OUT` if the fuzzer is not present or added to
5502    ///       fuzz-registry after starting.
5503    ///     * `ZX_ERR_SHOULD_WAIT` if another fuzzer is still starting.
5504    pub fn r#connect(
5505        &self,
5506        mut fuzzer_url: &str,
5507        mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
5508        ___deadline: zx::MonotonicInstant,
5509    ) -> Result<ManagerConnectResult, fidl::Error> {
5510        let _response = self.client.send_query::<
5511            ManagerConnectRequest,
5512            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5513            ManagerMarker,
5514        >(
5515            (fuzzer_url, controller,),
5516            0x1620cd742a89f064,
5517            fidl::encoding::DynamicFlags::empty(),
5518            ___deadline,
5519        )?;
5520        Ok(_response.map(|x| x))
5521    }
5522
5523    /// Forwards the fuzzer's output of the given type to the provided socket.
5524    ///
5525    /// If this method is called multiple times for the same output type, the
5526    /// socket from the subsequent call replaces the socket from the earlier
5527    /// call, which is closed.
5528    ///
5529    /// + request `fuzzer_url` the package URL for the fuzzer.
5530    /// + request `output` the type of the output stream to forward.
5531    /// + request `socket` a socket to forward the output stream to.
5532    /// * error one of the following:
5533    ///     * `ZX_ERR_INVALID_ARGS` if the URL cannot be parsed.
5534    ///     * `ZX_ERR_NOT_FOUND` if the fuzzer URL was not recognized by
5535    ///       `test_manager`.
5536    ///     * `ZX_ERR_BAD_STATE` if the fuzzer is not connected.
5537    pub fn r#get_output(
5538        &self,
5539        mut fuzzer_url: &str,
5540        mut output: TestOutput,
5541        mut socket: fidl::Socket,
5542        ___deadline: zx::MonotonicInstant,
5543    ) -> Result<ManagerGetOutputResult, fidl::Error> {
5544        let _response = self.client.send_query::<
5545            ManagerGetOutputRequest,
5546            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5547            ManagerMarker,
5548        >(
5549            (fuzzer_url, output, socket,),
5550            0x755c28eecf20a88d,
5551            fidl::encoding::DynamicFlags::empty(),
5552            ___deadline,
5553        )?;
5554        Ok(_response.map(|x| x))
5555    }
5556
5557    /// Stops the associated fuzzer immediately, ending any workflows in
5558    /// progress.
5559    ///
5560    /// + request `fuzzer_url` the package URL for the fuzzer.
5561    /// * error `ZX_ERR_NOT_FOUND` if no fuzzer was active with the given URL.
5562    pub fn r#stop(
5563        &self,
5564        mut fuzzer_url: &str,
5565        ___deadline: zx::MonotonicInstant,
5566    ) -> Result<ManagerStopResult, fidl::Error> {
5567        let _response = self.client.send_query::<
5568            ManagerStopRequest,
5569            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5570            ManagerMarker,
5571        >(
5572            (fuzzer_url,),
5573            0x27e53d86badd21f3,
5574            fidl::encoding::DynamicFlags::empty(),
5575            ___deadline,
5576        )?;
5577        Ok(_response.map(|x| x))
5578    }
5579}
5580
5581#[cfg(target_os = "fuchsia")]
5582impl From<ManagerSynchronousProxy> for zx::NullableHandle {
5583    fn from(value: ManagerSynchronousProxy) -> Self {
5584        value.into_channel().into()
5585    }
5586}
5587
5588#[cfg(target_os = "fuchsia")]
5589impl From<fidl::Channel> for ManagerSynchronousProxy {
5590    fn from(value: fidl::Channel) -> Self {
5591        Self::new(value)
5592    }
5593}
5594
5595#[cfg(target_os = "fuchsia")]
5596impl fidl::endpoints::FromClient for ManagerSynchronousProxy {
5597    type Protocol = ManagerMarker;
5598
5599    fn from_client(value: fidl::endpoints::ClientEnd<ManagerMarker>) -> Self {
5600        Self::new(value.into_channel())
5601    }
5602}
5603
5604#[derive(Debug, Clone)]
5605pub struct ManagerProxy {
5606    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5607}
5608
5609impl fidl::endpoints::Proxy for ManagerProxy {
5610    type Protocol = ManagerMarker;
5611
5612    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5613        Self::new(inner)
5614    }
5615
5616    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5617        self.client.into_channel().map_err(|client| Self { client })
5618    }
5619
5620    fn as_channel(&self) -> &::fidl::AsyncChannel {
5621        self.client.as_channel()
5622    }
5623}
5624
5625impl ManagerProxy {
5626    /// Create a new Proxy for fuchsia.fuzzer/Manager.
5627    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5628        let protocol_name = <ManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5629        Self { client: fidl::client::Client::new(channel, protocol_name) }
5630    }
5631
5632    /// Get a Stream of events from the remote end of the protocol.
5633    ///
5634    /// # Panics
5635    ///
5636    /// Panics if the event stream was already taken.
5637    pub fn take_event_stream(&self) -> ManagerEventStream {
5638        ManagerEventStream { event_receiver: self.client.take_event_receiver() }
5639    }
5640
5641    /// Connects to a fuzzer that implements the `fuchsia.fuzzer/Controller`
5642    /// protocol.
5643    ///
5644    /// If the fuzzer is not currently running, the `fuzz_manager` will first
5645    /// start it (via the test_manager) before proceeding. The `fuzz_manager`
5646    /// sends the `controller` on to the fuzz-registry, which contains the
5647    /// `ControllerProviders` that can fulfill the connection request.
5648    ///
5649    /// See `fuchsia.test.manager/LaunchError` for details on ways
5650    /// `test_manager` can fail.
5651    ///
5652    /// + request `fuzzer_url` the package URL for the fuzzer.
5653    /// + request `controller` the connection from the client.
5654    /// * error one of the following:
5655    ///     * `ZX_ERR_NO_RESOURCES` if `test_manager` needs resources that are
5656    ///       unavailable.
5657    ///     * `ZX_ERR_NOT_FOUND` if the fuzzer URL is not recognized by
5658    ///       `test_manager`.
5659    ///     * `ZX_ERR_INVALID_ARGS` if `test_manager` reports invalid arguments.
5660    ///     * `ZX_ERR_NOT_SUPPORTED` if `test_manager` cannot connect to the
5661    ///       test suite.
5662    ///     * `ZX_ERR_INTERNAL` if `test_manager` encountered some other,
5663    ///       unspecified failure.
5664    ///     * `ZX_ERR_TIMED_OUT` if the fuzzer is not present or added to
5665    ///       fuzz-registry after starting.
5666    ///     * `ZX_ERR_SHOULD_WAIT` if another fuzzer is still starting.
5667    pub fn r#connect(
5668        &self,
5669        mut fuzzer_url: &str,
5670        mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
5671    ) -> fidl::client::QueryResponseFut<
5672        ManagerConnectResult,
5673        fidl::encoding::DefaultFuchsiaResourceDialect,
5674    > {
5675        ManagerProxyInterface::r#connect(self, fuzzer_url, controller)
5676    }
5677
5678    /// Forwards the fuzzer's output of the given type to the provided socket.
5679    ///
5680    /// If this method is called multiple times for the same output type, the
5681    /// socket from the subsequent call replaces the socket from the earlier
5682    /// call, which is closed.
5683    ///
5684    /// + request `fuzzer_url` the package URL for the fuzzer.
5685    /// + request `output` the type of the output stream to forward.
5686    /// + request `socket` a socket to forward the output stream to.
5687    /// * error one of the following:
5688    ///     * `ZX_ERR_INVALID_ARGS` if the URL cannot be parsed.
5689    ///     * `ZX_ERR_NOT_FOUND` if the fuzzer URL was not recognized by
5690    ///       `test_manager`.
5691    ///     * `ZX_ERR_BAD_STATE` if the fuzzer is not connected.
5692    pub fn r#get_output(
5693        &self,
5694        mut fuzzer_url: &str,
5695        mut output: TestOutput,
5696        mut socket: fidl::Socket,
5697    ) -> fidl::client::QueryResponseFut<
5698        ManagerGetOutputResult,
5699        fidl::encoding::DefaultFuchsiaResourceDialect,
5700    > {
5701        ManagerProxyInterface::r#get_output(self, fuzzer_url, output, socket)
5702    }
5703
5704    /// Stops the associated fuzzer immediately, ending any workflows in
5705    /// progress.
5706    ///
5707    /// + request `fuzzer_url` the package URL for the fuzzer.
5708    /// * error `ZX_ERR_NOT_FOUND` if no fuzzer was active with the given URL.
5709    pub fn r#stop(
5710        &self,
5711        mut fuzzer_url: &str,
5712    ) -> fidl::client::QueryResponseFut<
5713        ManagerStopResult,
5714        fidl::encoding::DefaultFuchsiaResourceDialect,
5715    > {
5716        ManagerProxyInterface::r#stop(self, fuzzer_url)
5717    }
5718}
5719
5720impl ManagerProxyInterface for ManagerProxy {
5721    type ConnectResponseFut = fidl::client::QueryResponseFut<
5722        ManagerConnectResult,
5723        fidl::encoding::DefaultFuchsiaResourceDialect,
5724    >;
5725    fn r#connect(
5726        &self,
5727        mut fuzzer_url: &str,
5728        mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
5729    ) -> Self::ConnectResponseFut {
5730        fn _decode(
5731            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5732        ) -> Result<ManagerConnectResult, fidl::Error> {
5733            let _response = fidl::client::decode_transaction_body::<
5734                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5735                fidl::encoding::DefaultFuchsiaResourceDialect,
5736                0x1620cd742a89f064,
5737            >(_buf?)?;
5738            Ok(_response.map(|x| x))
5739        }
5740        self.client.send_query_and_decode::<ManagerConnectRequest, ManagerConnectResult>(
5741            (fuzzer_url, controller),
5742            0x1620cd742a89f064,
5743            fidl::encoding::DynamicFlags::empty(),
5744            _decode,
5745        )
5746    }
5747
5748    type GetOutputResponseFut = fidl::client::QueryResponseFut<
5749        ManagerGetOutputResult,
5750        fidl::encoding::DefaultFuchsiaResourceDialect,
5751    >;
5752    fn r#get_output(
5753        &self,
5754        mut fuzzer_url: &str,
5755        mut output: TestOutput,
5756        mut socket: fidl::Socket,
5757    ) -> Self::GetOutputResponseFut {
5758        fn _decode(
5759            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5760        ) -> Result<ManagerGetOutputResult, fidl::Error> {
5761            let _response = fidl::client::decode_transaction_body::<
5762                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5763                fidl::encoding::DefaultFuchsiaResourceDialect,
5764                0x755c28eecf20a88d,
5765            >(_buf?)?;
5766            Ok(_response.map(|x| x))
5767        }
5768        self.client.send_query_and_decode::<ManagerGetOutputRequest, ManagerGetOutputResult>(
5769            (fuzzer_url, output, socket),
5770            0x755c28eecf20a88d,
5771            fidl::encoding::DynamicFlags::empty(),
5772            _decode,
5773        )
5774    }
5775
5776    type StopResponseFut = fidl::client::QueryResponseFut<
5777        ManagerStopResult,
5778        fidl::encoding::DefaultFuchsiaResourceDialect,
5779    >;
5780    fn r#stop(&self, mut fuzzer_url: &str) -> Self::StopResponseFut {
5781        fn _decode(
5782            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5783        ) -> Result<ManagerStopResult, fidl::Error> {
5784            let _response = fidl::client::decode_transaction_body::<
5785                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5786                fidl::encoding::DefaultFuchsiaResourceDialect,
5787                0x27e53d86badd21f3,
5788            >(_buf?)?;
5789            Ok(_response.map(|x| x))
5790        }
5791        self.client.send_query_and_decode::<ManagerStopRequest, ManagerStopResult>(
5792            (fuzzer_url,),
5793            0x27e53d86badd21f3,
5794            fidl::encoding::DynamicFlags::empty(),
5795            _decode,
5796        )
5797    }
5798}
5799
5800pub struct ManagerEventStream {
5801    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5802}
5803
5804impl std::marker::Unpin for ManagerEventStream {}
5805
5806impl futures::stream::FusedStream for ManagerEventStream {
5807    fn is_terminated(&self) -> bool {
5808        self.event_receiver.is_terminated()
5809    }
5810}
5811
5812impl futures::Stream for ManagerEventStream {
5813    type Item = Result<ManagerEvent, fidl::Error>;
5814
5815    fn poll_next(
5816        mut self: std::pin::Pin<&mut Self>,
5817        cx: &mut std::task::Context<'_>,
5818    ) -> std::task::Poll<Option<Self::Item>> {
5819        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5820            &mut self.event_receiver,
5821            cx
5822        )?) {
5823            Some(buf) => std::task::Poll::Ready(Some(ManagerEvent::decode(buf))),
5824            None => std::task::Poll::Ready(None),
5825        }
5826    }
5827}
5828
5829#[derive(Debug)]
5830pub enum ManagerEvent {}
5831
5832impl ManagerEvent {
5833    /// Decodes a message buffer as a [`ManagerEvent`].
5834    fn decode(
5835        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5836    ) -> Result<ManagerEvent, fidl::Error> {
5837        let (bytes, _handles) = buf.split_mut();
5838        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5839        debug_assert_eq!(tx_header.tx_id, 0);
5840        match tx_header.ordinal {
5841            _ => Err(fidl::Error::UnknownOrdinal {
5842                ordinal: tx_header.ordinal,
5843                protocol_name: <ManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5844            }),
5845        }
5846    }
5847}
5848
5849/// A Stream of incoming requests for fuchsia.fuzzer/Manager.
5850pub struct ManagerRequestStream {
5851    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5852    is_terminated: bool,
5853}
5854
5855impl std::marker::Unpin for ManagerRequestStream {}
5856
5857impl futures::stream::FusedStream for ManagerRequestStream {
5858    fn is_terminated(&self) -> bool {
5859        self.is_terminated
5860    }
5861}
5862
5863impl fidl::endpoints::RequestStream for ManagerRequestStream {
5864    type Protocol = ManagerMarker;
5865    type ControlHandle = ManagerControlHandle;
5866
5867    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5868        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5869    }
5870
5871    fn control_handle(&self) -> Self::ControlHandle {
5872        ManagerControlHandle { inner: self.inner.clone() }
5873    }
5874
5875    fn into_inner(
5876        self,
5877    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5878    {
5879        (self.inner, self.is_terminated)
5880    }
5881
5882    fn from_inner(
5883        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5884        is_terminated: bool,
5885    ) -> Self {
5886        Self { inner, is_terminated }
5887    }
5888}
5889
5890impl futures::Stream for ManagerRequestStream {
5891    type Item = Result<ManagerRequest, fidl::Error>;
5892
5893    fn poll_next(
5894        mut self: std::pin::Pin<&mut Self>,
5895        cx: &mut std::task::Context<'_>,
5896    ) -> std::task::Poll<Option<Self::Item>> {
5897        let this = &mut *self;
5898        if this.inner.check_shutdown(cx) {
5899            this.is_terminated = true;
5900            return std::task::Poll::Ready(None);
5901        }
5902        if this.is_terminated {
5903            panic!("polled ManagerRequestStream after completion");
5904        }
5905        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5906            |bytes, handles| {
5907                match this.inner.channel().read_etc(cx, bytes, handles) {
5908                    std::task::Poll::Ready(Ok(())) => {}
5909                    std::task::Poll::Pending => return std::task::Poll::Pending,
5910                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5911                        this.is_terminated = true;
5912                        return std::task::Poll::Ready(None);
5913                    }
5914                    std::task::Poll::Ready(Err(e)) => {
5915                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5916                            e.into(),
5917                        ))));
5918                    }
5919                }
5920
5921                // A message has been received from the channel
5922                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5923
5924                std::task::Poll::Ready(Some(match header.ordinal {
5925                    0x1620cd742a89f064 => {
5926                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5927                        let mut req = fidl::new_empty!(
5928                            ManagerConnectRequest,
5929                            fidl::encoding::DefaultFuchsiaResourceDialect
5930                        );
5931                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerConnectRequest>(&header, _body_bytes, handles, &mut req)?;
5932                        let control_handle = ManagerControlHandle { inner: this.inner.clone() };
5933                        Ok(ManagerRequest::Connect {
5934                            fuzzer_url: req.fuzzer_url,
5935                            controller: req.controller,
5936
5937                            responder: ManagerConnectResponder {
5938                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5939                                tx_id: header.tx_id,
5940                            },
5941                        })
5942                    }
5943                    0x755c28eecf20a88d => {
5944                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5945                        let mut req = fidl::new_empty!(
5946                            ManagerGetOutputRequest,
5947                            fidl::encoding::DefaultFuchsiaResourceDialect
5948                        );
5949                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerGetOutputRequest>(&header, _body_bytes, handles, &mut req)?;
5950                        let control_handle = ManagerControlHandle { inner: this.inner.clone() };
5951                        Ok(ManagerRequest::GetOutput {
5952                            fuzzer_url: req.fuzzer_url,
5953                            output: req.output,
5954                            socket: req.socket,
5955
5956                            responder: ManagerGetOutputResponder {
5957                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5958                                tx_id: header.tx_id,
5959                            },
5960                        })
5961                    }
5962                    0x27e53d86badd21f3 => {
5963                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5964                        let mut req = fidl::new_empty!(
5965                            ManagerStopRequest,
5966                            fidl::encoding::DefaultFuchsiaResourceDialect
5967                        );
5968                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerStopRequest>(&header, _body_bytes, handles, &mut req)?;
5969                        let control_handle = ManagerControlHandle { inner: this.inner.clone() };
5970                        Ok(ManagerRequest::Stop {
5971                            fuzzer_url: req.fuzzer_url,
5972
5973                            responder: ManagerStopResponder {
5974                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5975                                tx_id: header.tx_id,
5976                            },
5977                        })
5978                    }
5979                    _ => Err(fidl::Error::UnknownOrdinal {
5980                        ordinal: header.ordinal,
5981                        protocol_name:
5982                            <ManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5983                    }),
5984                }))
5985            },
5986        )
5987    }
5988}
5989
5990/// Entry point for users, e.g. `ffx fuzz`, used to start and stop fuzzers. A
5991/// fuzzer will be started on the first call to `Connect` with a given URL.
5992/// Closing the given `Controller` channel does *not* stop the associated
5993/// fuzzer. Instead, since fuzzing is meant to be long-running, clients
5994/// may drop the connection and re-`Connect` some time later.
5995#[derive(Debug)]
5996pub enum ManagerRequest {
5997    /// Connects to a fuzzer that implements the `fuchsia.fuzzer/Controller`
5998    /// protocol.
5999    ///
6000    /// If the fuzzer is not currently running, the `fuzz_manager` will first
6001    /// start it (via the test_manager) before proceeding. The `fuzz_manager`
6002    /// sends the `controller` on to the fuzz-registry, which contains the
6003    /// `ControllerProviders` that can fulfill the connection request.
6004    ///
6005    /// See `fuchsia.test.manager/LaunchError` for details on ways
6006    /// `test_manager` can fail.
6007    ///
6008    /// + request `fuzzer_url` the package URL for the fuzzer.
6009    /// + request `controller` the connection from the client.
6010    /// * error one of the following:
6011    ///     * `ZX_ERR_NO_RESOURCES` if `test_manager` needs resources that are
6012    ///       unavailable.
6013    ///     * `ZX_ERR_NOT_FOUND` if the fuzzer URL is not recognized by
6014    ///       `test_manager`.
6015    ///     * `ZX_ERR_INVALID_ARGS` if `test_manager` reports invalid arguments.
6016    ///     * `ZX_ERR_NOT_SUPPORTED` if `test_manager` cannot connect to the
6017    ///       test suite.
6018    ///     * `ZX_ERR_INTERNAL` if `test_manager` encountered some other,
6019    ///       unspecified failure.
6020    ///     * `ZX_ERR_TIMED_OUT` if the fuzzer is not present or added to
6021    ///       fuzz-registry after starting.
6022    ///     * `ZX_ERR_SHOULD_WAIT` if another fuzzer is still starting.
6023    Connect {
6024        fuzzer_url: String,
6025        controller: fidl::endpoints::ServerEnd<ControllerMarker>,
6026        responder: ManagerConnectResponder,
6027    },
6028    /// Forwards the fuzzer's output of the given type to the provided socket.
6029    ///
6030    /// If this method is called multiple times for the same output type, the
6031    /// socket from the subsequent call replaces the socket from the earlier
6032    /// call, which is closed.
6033    ///
6034    /// + request `fuzzer_url` the package URL for the fuzzer.
6035    /// + request `output` the type of the output stream to forward.
6036    /// + request `socket` a socket to forward the output stream to.
6037    /// * error one of the following:
6038    ///     * `ZX_ERR_INVALID_ARGS` if the URL cannot be parsed.
6039    ///     * `ZX_ERR_NOT_FOUND` if the fuzzer URL was not recognized by
6040    ///       `test_manager`.
6041    ///     * `ZX_ERR_BAD_STATE` if the fuzzer is not connected.
6042    GetOutput {
6043        fuzzer_url: String,
6044        output: TestOutput,
6045        socket: fidl::Socket,
6046        responder: ManagerGetOutputResponder,
6047    },
6048    /// Stops the associated fuzzer immediately, ending any workflows in
6049    /// progress.
6050    ///
6051    /// + request `fuzzer_url` the package URL for the fuzzer.
6052    /// * error `ZX_ERR_NOT_FOUND` if no fuzzer was active with the given URL.
6053    Stop { fuzzer_url: String, responder: ManagerStopResponder },
6054}
6055
6056impl ManagerRequest {
6057    #[allow(irrefutable_let_patterns)]
6058    pub fn into_connect(
6059        self,
6060    ) -> Option<(String, fidl::endpoints::ServerEnd<ControllerMarker>, ManagerConnectResponder)>
6061    {
6062        if let ManagerRequest::Connect { fuzzer_url, controller, responder } = self {
6063            Some((fuzzer_url, controller, responder))
6064        } else {
6065            None
6066        }
6067    }
6068
6069    #[allow(irrefutable_let_patterns)]
6070    pub fn into_get_output(
6071        self,
6072    ) -> Option<(String, TestOutput, fidl::Socket, ManagerGetOutputResponder)> {
6073        if let ManagerRequest::GetOutput { fuzzer_url, output, socket, responder } = self {
6074            Some((fuzzer_url, output, socket, responder))
6075        } else {
6076            None
6077        }
6078    }
6079
6080    #[allow(irrefutable_let_patterns)]
6081    pub fn into_stop(self) -> Option<(String, ManagerStopResponder)> {
6082        if let ManagerRequest::Stop { fuzzer_url, responder } = self {
6083            Some((fuzzer_url, responder))
6084        } else {
6085            None
6086        }
6087    }
6088
6089    /// Name of the method defined in FIDL
6090    pub fn method_name(&self) -> &'static str {
6091        match *self {
6092            ManagerRequest::Connect { .. } => "connect",
6093            ManagerRequest::GetOutput { .. } => "get_output",
6094            ManagerRequest::Stop { .. } => "stop",
6095        }
6096    }
6097}
6098
6099#[derive(Debug, Clone)]
6100pub struct ManagerControlHandle {
6101    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6102}
6103
6104impl ManagerControlHandle {
6105    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6106        self.inner.shutdown_with_epitaph(status.into())
6107    }
6108}
6109
6110impl fidl::endpoints::ControlHandle for ManagerControlHandle {
6111    fn shutdown(&self) {
6112        self.inner.shutdown()
6113    }
6114
6115    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6116        self.inner.shutdown_with_epitaph(status)
6117    }
6118
6119    fn is_closed(&self) -> bool {
6120        self.inner.channel().is_closed()
6121    }
6122    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6123        self.inner.channel().on_closed()
6124    }
6125
6126    #[cfg(target_os = "fuchsia")]
6127    fn signal_peer(
6128        &self,
6129        clear_mask: zx::Signals,
6130        set_mask: zx::Signals,
6131    ) -> Result<(), zx_status::Status> {
6132        use fidl::Peered;
6133        self.inner.channel().signal_peer(clear_mask, set_mask)
6134    }
6135}
6136
6137impl ManagerControlHandle {}
6138
6139#[must_use = "FIDL methods require a response to be sent"]
6140#[derive(Debug)]
6141pub struct ManagerConnectResponder {
6142    control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
6143    tx_id: u32,
6144}
6145
6146/// Set the the channel to be shutdown (see [`ManagerControlHandle::shutdown`])
6147/// if the responder is dropped without sending a response, so that the client
6148/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6149impl std::ops::Drop for ManagerConnectResponder {
6150    fn drop(&mut self) {
6151        self.control_handle.shutdown();
6152        // Safety: drops once, never accessed again
6153        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6154    }
6155}
6156
6157impl fidl::endpoints::Responder for ManagerConnectResponder {
6158    type ControlHandle = ManagerControlHandle;
6159
6160    fn control_handle(&self) -> &ManagerControlHandle {
6161        &self.control_handle
6162    }
6163
6164    fn drop_without_shutdown(mut self) {
6165        // Safety: drops once, never accessed again due to mem::forget
6166        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6167        // Prevent Drop from running (which would shut down the channel)
6168        std::mem::forget(self);
6169    }
6170}
6171
6172impl ManagerConnectResponder {
6173    /// Sends a response to the FIDL transaction.
6174    ///
6175    /// Sets the channel to shutdown if an error occurs.
6176    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6177        let _result = self.send_raw(result);
6178        if _result.is_err() {
6179            self.control_handle.shutdown();
6180        }
6181        self.drop_without_shutdown();
6182        _result
6183    }
6184
6185    /// Similar to "send" but does not shutdown the channel if an error occurs.
6186    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6187        let _result = self.send_raw(result);
6188        self.drop_without_shutdown();
6189        _result
6190    }
6191
6192    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6193        self.control_handle
6194            .inner
6195            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6196                result,
6197                self.tx_id,
6198                0x1620cd742a89f064,
6199                fidl::encoding::DynamicFlags::empty(),
6200            )
6201    }
6202}
6203
6204#[must_use = "FIDL methods require a response to be sent"]
6205#[derive(Debug)]
6206pub struct ManagerGetOutputResponder {
6207    control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
6208    tx_id: u32,
6209}
6210
6211/// Set the the channel to be shutdown (see [`ManagerControlHandle::shutdown`])
6212/// if the responder is dropped without sending a response, so that the client
6213/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6214impl std::ops::Drop for ManagerGetOutputResponder {
6215    fn drop(&mut self) {
6216        self.control_handle.shutdown();
6217        // Safety: drops once, never accessed again
6218        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6219    }
6220}
6221
6222impl fidl::endpoints::Responder for ManagerGetOutputResponder {
6223    type ControlHandle = ManagerControlHandle;
6224
6225    fn control_handle(&self) -> &ManagerControlHandle {
6226        &self.control_handle
6227    }
6228
6229    fn drop_without_shutdown(mut self) {
6230        // Safety: drops once, never accessed again due to mem::forget
6231        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6232        // Prevent Drop from running (which would shut down the channel)
6233        std::mem::forget(self);
6234    }
6235}
6236
6237impl ManagerGetOutputResponder {
6238    /// Sends a response to the FIDL transaction.
6239    ///
6240    /// Sets the channel to shutdown if an error occurs.
6241    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6242        let _result = self.send_raw(result);
6243        if _result.is_err() {
6244            self.control_handle.shutdown();
6245        }
6246        self.drop_without_shutdown();
6247        _result
6248    }
6249
6250    /// Similar to "send" but does not shutdown the channel if an error occurs.
6251    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6252        let _result = self.send_raw(result);
6253        self.drop_without_shutdown();
6254        _result
6255    }
6256
6257    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6258        self.control_handle
6259            .inner
6260            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6261                result,
6262                self.tx_id,
6263                0x755c28eecf20a88d,
6264                fidl::encoding::DynamicFlags::empty(),
6265            )
6266    }
6267}
6268
6269#[must_use = "FIDL methods require a response to be sent"]
6270#[derive(Debug)]
6271pub struct ManagerStopResponder {
6272    control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
6273    tx_id: u32,
6274}
6275
6276/// Set the the channel to be shutdown (see [`ManagerControlHandle::shutdown`])
6277/// if the responder is dropped without sending a response, so that the client
6278/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6279impl std::ops::Drop for ManagerStopResponder {
6280    fn drop(&mut self) {
6281        self.control_handle.shutdown();
6282        // Safety: drops once, never accessed again
6283        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6284    }
6285}
6286
6287impl fidl::endpoints::Responder for ManagerStopResponder {
6288    type ControlHandle = ManagerControlHandle;
6289
6290    fn control_handle(&self) -> &ManagerControlHandle {
6291        &self.control_handle
6292    }
6293
6294    fn drop_without_shutdown(mut self) {
6295        // Safety: drops once, never accessed again due to mem::forget
6296        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6297        // Prevent Drop from running (which would shut down the channel)
6298        std::mem::forget(self);
6299    }
6300}
6301
6302impl ManagerStopResponder {
6303    /// Sends a response to the FIDL transaction.
6304    ///
6305    /// Sets the channel to shutdown if an error occurs.
6306    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6307        let _result = self.send_raw(result);
6308        if _result.is_err() {
6309            self.control_handle.shutdown();
6310        }
6311        self.drop_without_shutdown();
6312        _result
6313    }
6314
6315    /// Similar to "send" but does not shutdown the channel if an error occurs.
6316    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6317        let _result = self.send_raw(result);
6318        self.drop_without_shutdown();
6319        _result
6320    }
6321
6322    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6323        self.control_handle
6324            .inner
6325            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6326                result,
6327                self.tx_id,
6328                0x27e53d86badd21f3,
6329                fidl::encoding::DynamicFlags::empty(),
6330            )
6331    }
6332}
6333
6334#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6335pub struct MonitorMarker;
6336
6337impl fidl::endpoints::ProtocolMarker for MonitorMarker {
6338    type Proxy = MonitorProxy;
6339    type RequestStream = MonitorRequestStream;
6340    #[cfg(target_os = "fuchsia")]
6341    type SynchronousProxy = MonitorSynchronousProxy;
6342
6343    const DEBUG_NAME: &'static str = "(anonymous) Monitor";
6344}
6345
6346pub trait MonitorProxyInterface: Send + Sync {
6347    type UpdateResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
6348    fn r#update(&self, reason: UpdateReason, status: &Status) -> Self::UpdateResponseFut;
6349}
6350#[derive(Debug)]
6351#[cfg(target_os = "fuchsia")]
6352pub struct MonitorSynchronousProxy {
6353    client: fidl::client::sync::Client,
6354}
6355
6356#[cfg(target_os = "fuchsia")]
6357impl fidl::endpoints::SynchronousProxy for MonitorSynchronousProxy {
6358    type Proxy = MonitorProxy;
6359    type Protocol = MonitorMarker;
6360
6361    fn from_channel(inner: fidl::Channel) -> Self {
6362        Self::new(inner)
6363    }
6364
6365    fn into_channel(self) -> fidl::Channel {
6366        self.client.into_channel()
6367    }
6368
6369    fn as_channel(&self) -> &fidl::Channel {
6370        self.client.as_channel()
6371    }
6372}
6373
6374#[cfg(target_os = "fuchsia")]
6375impl MonitorSynchronousProxy {
6376    pub fn new(channel: fidl::Channel) -> Self {
6377        Self { client: fidl::client::sync::Client::new(channel) }
6378    }
6379
6380    pub fn into_channel(self) -> fidl::Channel {
6381        self.client.into_channel()
6382    }
6383
6384    /// Waits until an event arrives and returns it. It is safe for other
6385    /// threads to make concurrent requests while waiting for an event.
6386    pub fn wait_for_event(
6387        &self,
6388        deadline: zx::MonotonicInstant,
6389    ) -> Result<MonitorEvent, fidl::Error> {
6390        MonitorEvent::decode(self.client.wait_for_event::<MonitorMarker>(deadline)?)
6391    }
6392
6393    /// Sends the current status.
6394    ///
6395    /// + request `reason` the cause of a status change.
6396    /// + status `status` the reported fuzzing metrics.
6397    pub fn r#update(
6398        &self,
6399        mut reason: UpdateReason,
6400        mut status: &Status,
6401        ___deadline: zx::MonotonicInstant,
6402    ) -> Result<(), fidl::Error> {
6403        let _response = self
6404            .client
6405            .send_query::<MonitorUpdateRequest, fidl::encoding::EmptyPayload, MonitorMarker>(
6406                (reason, status),
6407                0x7c773b93c1e6080f,
6408                fidl::encoding::DynamicFlags::empty(),
6409                ___deadline,
6410            )?;
6411        Ok(_response)
6412    }
6413}
6414
6415#[cfg(target_os = "fuchsia")]
6416impl From<MonitorSynchronousProxy> for zx::NullableHandle {
6417    fn from(value: MonitorSynchronousProxy) -> Self {
6418        value.into_channel().into()
6419    }
6420}
6421
6422#[cfg(target_os = "fuchsia")]
6423impl From<fidl::Channel> for MonitorSynchronousProxy {
6424    fn from(value: fidl::Channel) -> Self {
6425        Self::new(value)
6426    }
6427}
6428
6429#[cfg(target_os = "fuchsia")]
6430impl fidl::endpoints::FromClient for MonitorSynchronousProxy {
6431    type Protocol = MonitorMarker;
6432
6433    fn from_client(value: fidl::endpoints::ClientEnd<MonitorMarker>) -> Self {
6434        Self::new(value.into_channel())
6435    }
6436}
6437
6438#[derive(Debug, Clone)]
6439pub struct MonitorProxy {
6440    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6441}
6442
6443impl fidl::endpoints::Proxy for MonitorProxy {
6444    type Protocol = MonitorMarker;
6445
6446    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6447        Self::new(inner)
6448    }
6449
6450    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6451        self.client.into_channel().map_err(|client| Self { client })
6452    }
6453
6454    fn as_channel(&self) -> &::fidl::AsyncChannel {
6455        self.client.as_channel()
6456    }
6457}
6458
6459impl MonitorProxy {
6460    /// Create a new Proxy for fuchsia.fuzzer/Monitor.
6461    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6462        let protocol_name = <MonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6463        Self { client: fidl::client::Client::new(channel, protocol_name) }
6464    }
6465
6466    /// Get a Stream of events from the remote end of the protocol.
6467    ///
6468    /// # Panics
6469    ///
6470    /// Panics if the event stream was already taken.
6471    pub fn take_event_stream(&self) -> MonitorEventStream {
6472        MonitorEventStream { event_receiver: self.client.take_event_receiver() }
6473    }
6474
6475    /// Sends the current status.
6476    ///
6477    /// + request `reason` the cause of a status change.
6478    /// + status `status` the reported fuzzing metrics.
6479    pub fn r#update(
6480        &self,
6481        mut reason: UpdateReason,
6482        mut status: &Status,
6483    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6484        MonitorProxyInterface::r#update(self, reason, status)
6485    }
6486}
6487
6488impl MonitorProxyInterface for MonitorProxy {
6489    type UpdateResponseFut =
6490        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
6491    fn r#update(&self, mut reason: UpdateReason, mut status: &Status) -> Self::UpdateResponseFut {
6492        fn _decode(
6493            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6494        ) -> Result<(), fidl::Error> {
6495            let _response = fidl::client::decode_transaction_body::<
6496                fidl::encoding::EmptyPayload,
6497                fidl::encoding::DefaultFuchsiaResourceDialect,
6498                0x7c773b93c1e6080f,
6499            >(_buf?)?;
6500            Ok(_response)
6501        }
6502        self.client.send_query_and_decode::<MonitorUpdateRequest, ()>(
6503            (reason, status),
6504            0x7c773b93c1e6080f,
6505            fidl::encoding::DynamicFlags::empty(),
6506            _decode,
6507        )
6508    }
6509}
6510
6511pub struct MonitorEventStream {
6512    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6513}
6514
6515impl std::marker::Unpin for MonitorEventStream {}
6516
6517impl futures::stream::FusedStream for MonitorEventStream {
6518    fn is_terminated(&self) -> bool {
6519        self.event_receiver.is_terminated()
6520    }
6521}
6522
6523impl futures::Stream for MonitorEventStream {
6524    type Item = Result<MonitorEvent, fidl::Error>;
6525
6526    fn poll_next(
6527        mut self: std::pin::Pin<&mut Self>,
6528        cx: &mut std::task::Context<'_>,
6529    ) -> std::task::Poll<Option<Self::Item>> {
6530        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6531            &mut self.event_receiver,
6532            cx
6533        )?) {
6534            Some(buf) => std::task::Poll::Ready(Some(MonitorEvent::decode(buf))),
6535            None => std::task::Poll::Ready(None),
6536        }
6537    }
6538}
6539
6540#[derive(Debug)]
6541pub enum MonitorEvent {}
6542
6543impl MonitorEvent {
6544    /// Decodes a message buffer as a [`MonitorEvent`].
6545    fn decode(
6546        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6547    ) -> Result<MonitorEvent, fidl::Error> {
6548        let (bytes, _handles) = buf.split_mut();
6549        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6550        debug_assert_eq!(tx_header.tx_id, 0);
6551        match tx_header.ordinal {
6552            _ => Err(fidl::Error::UnknownOrdinal {
6553                ordinal: tx_header.ordinal,
6554                protocol_name: <MonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6555            }),
6556        }
6557    }
6558}
6559
6560/// A Stream of incoming requests for fuchsia.fuzzer/Monitor.
6561pub struct MonitorRequestStream {
6562    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6563    is_terminated: bool,
6564}
6565
6566impl std::marker::Unpin for MonitorRequestStream {}
6567
6568impl futures::stream::FusedStream for MonitorRequestStream {
6569    fn is_terminated(&self) -> bool {
6570        self.is_terminated
6571    }
6572}
6573
6574impl fidl::endpoints::RequestStream for MonitorRequestStream {
6575    type Protocol = MonitorMarker;
6576    type ControlHandle = MonitorControlHandle;
6577
6578    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6579        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6580    }
6581
6582    fn control_handle(&self) -> Self::ControlHandle {
6583        MonitorControlHandle { inner: self.inner.clone() }
6584    }
6585
6586    fn into_inner(
6587        self,
6588    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6589    {
6590        (self.inner, self.is_terminated)
6591    }
6592
6593    fn from_inner(
6594        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6595        is_terminated: bool,
6596    ) -> Self {
6597        Self { inner, is_terminated }
6598    }
6599}
6600
6601impl futures::Stream for MonitorRequestStream {
6602    type Item = Result<MonitorRequest, fidl::Error>;
6603
6604    fn poll_next(
6605        mut self: std::pin::Pin<&mut Self>,
6606        cx: &mut std::task::Context<'_>,
6607    ) -> std::task::Poll<Option<Self::Item>> {
6608        let this = &mut *self;
6609        if this.inner.check_shutdown(cx) {
6610            this.is_terminated = true;
6611            return std::task::Poll::Ready(None);
6612        }
6613        if this.is_terminated {
6614            panic!("polled MonitorRequestStream after completion");
6615        }
6616        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6617            |bytes, handles| {
6618                match this.inner.channel().read_etc(cx, bytes, handles) {
6619                    std::task::Poll::Ready(Ok(())) => {}
6620                    std::task::Poll::Pending => return std::task::Poll::Pending,
6621                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6622                        this.is_terminated = true;
6623                        return std::task::Poll::Ready(None);
6624                    }
6625                    std::task::Poll::Ready(Err(e)) => {
6626                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6627                            e.into(),
6628                        ))));
6629                    }
6630                }
6631
6632                // A message has been received from the channel
6633                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6634
6635                std::task::Poll::Ready(Some(match header.ordinal {
6636                    0x7c773b93c1e6080f => {
6637                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6638                        let mut req = fidl::new_empty!(
6639                            MonitorUpdateRequest,
6640                            fidl::encoding::DefaultFuchsiaResourceDialect
6641                        );
6642                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MonitorUpdateRequest>(&header, _body_bytes, handles, &mut req)?;
6643                        let control_handle = MonitorControlHandle { inner: this.inner.clone() };
6644                        Ok(MonitorRequest::Update {
6645                            reason: req.reason,
6646                            status: req.status,
6647
6648                            responder: MonitorUpdateResponder {
6649                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6650                                tx_id: header.tx_id,
6651                            },
6652                        })
6653                    }
6654                    _ => Err(fidl::Error::UnknownOrdinal {
6655                        ordinal: header.ordinal,
6656                        protocol_name:
6657                            <MonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6658                    }),
6659                }))
6660            },
6661        )
6662    }
6663}
6664
6665/// See `Status`. This protocol is used to push status from the `Controller` to
6666/// callers.
6667#[derive(Debug)]
6668pub enum MonitorRequest {
6669    /// Sends the current status.
6670    ///
6671    /// + request `reason` the cause of a status change.
6672    /// + status `status` the reported fuzzing metrics.
6673    Update { reason: UpdateReason, status: Status, responder: MonitorUpdateResponder },
6674}
6675
6676impl MonitorRequest {
6677    #[allow(irrefutable_let_patterns)]
6678    pub fn into_update(self) -> Option<(UpdateReason, Status, MonitorUpdateResponder)> {
6679        if let MonitorRequest::Update { reason, status, responder } = self {
6680            Some((reason, status, responder))
6681        } else {
6682            None
6683        }
6684    }
6685
6686    /// Name of the method defined in FIDL
6687    pub fn method_name(&self) -> &'static str {
6688        match *self {
6689            MonitorRequest::Update { .. } => "update",
6690        }
6691    }
6692}
6693
6694#[derive(Debug, Clone)]
6695pub struct MonitorControlHandle {
6696    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6697}
6698
6699impl MonitorControlHandle {
6700    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6701        self.inner.shutdown_with_epitaph(status.into())
6702    }
6703}
6704
6705impl fidl::endpoints::ControlHandle for MonitorControlHandle {
6706    fn shutdown(&self) {
6707        self.inner.shutdown()
6708    }
6709
6710    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6711        self.inner.shutdown_with_epitaph(status)
6712    }
6713
6714    fn is_closed(&self) -> bool {
6715        self.inner.channel().is_closed()
6716    }
6717    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6718        self.inner.channel().on_closed()
6719    }
6720
6721    #[cfg(target_os = "fuchsia")]
6722    fn signal_peer(
6723        &self,
6724        clear_mask: zx::Signals,
6725        set_mask: zx::Signals,
6726    ) -> Result<(), zx_status::Status> {
6727        use fidl::Peered;
6728        self.inner.channel().signal_peer(clear_mask, set_mask)
6729    }
6730}
6731
6732impl MonitorControlHandle {}
6733
6734#[must_use = "FIDL methods require a response to be sent"]
6735#[derive(Debug)]
6736pub struct MonitorUpdateResponder {
6737    control_handle: std::mem::ManuallyDrop<MonitorControlHandle>,
6738    tx_id: u32,
6739}
6740
6741/// Set the the channel to be shutdown (see [`MonitorControlHandle::shutdown`])
6742/// if the responder is dropped without sending a response, so that the client
6743/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6744impl std::ops::Drop for MonitorUpdateResponder {
6745    fn drop(&mut self) {
6746        self.control_handle.shutdown();
6747        // Safety: drops once, never accessed again
6748        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6749    }
6750}
6751
6752impl fidl::endpoints::Responder for MonitorUpdateResponder {
6753    type ControlHandle = MonitorControlHandle;
6754
6755    fn control_handle(&self) -> &MonitorControlHandle {
6756        &self.control_handle
6757    }
6758
6759    fn drop_without_shutdown(mut self) {
6760        // Safety: drops once, never accessed again due to mem::forget
6761        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6762        // Prevent Drop from running (which would shut down the channel)
6763        std::mem::forget(self);
6764    }
6765}
6766
6767impl MonitorUpdateResponder {
6768    /// Sends a response to the FIDL transaction.
6769    ///
6770    /// Sets the channel to shutdown if an error occurs.
6771    pub fn send(self) -> Result<(), fidl::Error> {
6772        let _result = self.send_raw();
6773        if _result.is_err() {
6774            self.control_handle.shutdown();
6775        }
6776        self.drop_without_shutdown();
6777        _result
6778    }
6779
6780    /// Similar to "send" but does not shutdown the channel if an error occurs.
6781    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
6782        let _result = self.send_raw();
6783        self.drop_without_shutdown();
6784        _result
6785    }
6786
6787    fn send_raw(&self) -> Result<(), fidl::Error> {
6788        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
6789            (),
6790            self.tx_id,
6791            0x7c773b93c1e6080f,
6792            fidl::encoding::DynamicFlags::empty(),
6793        )
6794    }
6795}
6796
6797#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6798pub struct RegistrarMarker;
6799
6800impl fidl::endpoints::ProtocolMarker for RegistrarMarker {
6801    type Proxy = RegistrarProxy;
6802    type RequestStream = RegistrarRequestStream;
6803    #[cfg(target_os = "fuchsia")]
6804    type SynchronousProxy = RegistrarSynchronousProxy;
6805
6806    const DEBUG_NAME: &'static str = "fuchsia.fuzzer.Registrar";
6807}
6808impl fidl::endpoints::DiscoverableProtocolMarker for RegistrarMarker {}
6809
6810pub trait RegistrarProxyInterface: Send + Sync {
6811    type RegisterResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
6812    fn r#register(
6813        &self,
6814        fuzzer_url: &str,
6815        provider: fidl::endpoints::ClientEnd<ControllerProviderMarker>,
6816    ) -> Self::RegisterResponseFut;
6817}
6818#[derive(Debug)]
6819#[cfg(target_os = "fuchsia")]
6820pub struct RegistrarSynchronousProxy {
6821    client: fidl::client::sync::Client,
6822}
6823
6824#[cfg(target_os = "fuchsia")]
6825impl fidl::endpoints::SynchronousProxy for RegistrarSynchronousProxy {
6826    type Proxy = RegistrarProxy;
6827    type Protocol = RegistrarMarker;
6828
6829    fn from_channel(inner: fidl::Channel) -> Self {
6830        Self::new(inner)
6831    }
6832
6833    fn into_channel(self) -> fidl::Channel {
6834        self.client.into_channel()
6835    }
6836
6837    fn as_channel(&self) -> &fidl::Channel {
6838        self.client.as_channel()
6839    }
6840}
6841
6842#[cfg(target_os = "fuchsia")]
6843impl RegistrarSynchronousProxy {
6844    pub fn new(channel: fidl::Channel) -> Self {
6845        Self { client: fidl::client::sync::Client::new(channel) }
6846    }
6847
6848    pub fn into_channel(self) -> fidl::Channel {
6849        self.client.into_channel()
6850    }
6851
6852    /// Waits until an event arrives and returns it. It is safe for other
6853    /// threads to make concurrent requests while waiting for an event.
6854    pub fn wait_for_event(
6855        &self,
6856        deadline: zx::MonotonicInstant,
6857    ) -> Result<RegistrarEvent, fidl::Error> {
6858        RegistrarEvent::decode(self.client.wait_for_event::<RegistrarMarker>(deadline)?)
6859    }
6860
6861    /// Adds a `ControllerProvider`. This should be called by the fuzzer itself,
6862    /// using the channel provided by the `fuzz_test_runner`, and in response to
6863    /// being started by the `fuzz_manager`.
6864    ///
6865    /// The registry will close the channel to the fuzzer on error, on a
6866    ///  corresponding call to `Registry.Disconnect`, or on exit. The fuzzer
6867    /// should exit when the channel closes.
6868    ///
6869    /// + request `fuzzer_url` the package URL for the fuzzer.
6870    /// + request `provider` the connection to a `ControllerProvider`.
6871    pub fn r#register(
6872        &self,
6873        mut fuzzer_url: &str,
6874        mut provider: fidl::endpoints::ClientEnd<ControllerProviderMarker>,
6875        ___deadline: zx::MonotonicInstant,
6876    ) -> Result<(), fidl::Error> {
6877        let _response = self
6878            .client
6879            .send_query::<RegistrarRegisterRequest, fidl::encoding::EmptyPayload, RegistrarMarker>(
6880                (fuzzer_url, provider),
6881                0x1716ac38e74b2840,
6882                fidl::encoding::DynamicFlags::empty(),
6883                ___deadline,
6884            )?;
6885        Ok(_response)
6886    }
6887}
6888
6889#[cfg(target_os = "fuchsia")]
6890impl From<RegistrarSynchronousProxy> for zx::NullableHandle {
6891    fn from(value: RegistrarSynchronousProxy) -> Self {
6892        value.into_channel().into()
6893    }
6894}
6895
6896#[cfg(target_os = "fuchsia")]
6897impl From<fidl::Channel> for RegistrarSynchronousProxy {
6898    fn from(value: fidl::Channel) -> Self {
6899        Self::new(value)
6900    }
6901}
6902
6903#[cfg(target_os = "fuchsia")]
6904impl fidl::endpoints::FromClient for RegistrarSynchronousProxy {
6905    type Protocol = RegistrarMarker;
6906
6907    fn from_client(value: fidl::endpoints::ClientEnd<RegistrarMarker>) -> Self {
6908        Self::new(value.into_channel())
6909    }
6910}
6911
6912#[derive(Debug, Clone)]
6913pub struct RegistrarProxy {
6914    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6915}
6916
6917impl fidl::endpoints::Proxy for RegistrarProxy {
6918    type Protocol = RegistrarMarker;
6919
6920    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6921        Self::new(inner)
6922    }
6923
6924    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6925        self.client.into_channel().map_err(|client| Self { client })
6926    }
6927
6928    fn as_channel(&self) -> &::fidl::AsyncChannel {
6929        self.client.as_channel()
6930    }
6931}
6932
6933impl RegistrarProxy {
6934    /// Create a new Proxy for fuchsia.fuzzer/Registrar.
6935    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6936        let protocol_name = <RegistrarMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6937        Self { client: fidl::client::Client::new(channel, protocol_name) }
6938    }
6939
6940    /// Get a Stream of events from the remote end of the protocol.
6941    ///
6942    /// # Panics
6943    ///
6944    /// Panics if the event stream was already taken.
6945    pub fn take_event_stream(&self) -> RegistrarEventStream {
6946        RegistrarEventStream { event_receiver: self.client.take_event_receiver() }
6947    }
6948
6949    /// Adds a `ControllerProvider`. This should be called by the fuzzer itself,
6950    /// using the channel provided by the `fuzz_test_runner`, and in response to
6951    /// being started by the `fuzz_manager`.
6952    ///
6953    /// The registry will close the channel to the fuzzer on error, on a
6954    ///  corresponding call to `Registry.Disconnect`, or on exit. The fuzzer
6955    /// should exit when the channel closes.
6956    ///
6957    /// + request `fuzzer_url` the package URL for the fuzzer.
6958    /// + request `provider` the connection to a `ControllerProvider`.
6959    pub fn r#register(
6960        &self,
6961        mut fuzzer_url: &str,
6962        mut provider: fidl::endpoints::ClientEnd<ControllerProviderMarker>,
6963    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6964        RegistrarProxyInterface::r#register(self, fuzzer_url, provider)
6965    }
6966}
6967
6968impl RegistrarProxyInterface for RegistrarProxy {
6969    type RegisterResponseFut =
6970        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
6971    fn r#register(
6972        &self,
6973        mut fuzzer_url: &str,
6974        mut provider: fidl::endpoints::ClientEnd<ControllerProviderMarker>,
6975    ) -> Self::RegisterResponseFut {
6976        fn _decode(
6977            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6978        ) -> Result<(), fidl::Error> {
6979            let _response = fidl::client::decode_transaction_body::<
6980                fidl::encoding::EmptyPayload,
6981                fidl::encoding::DefaultFuchsiaResourceDialect,
6982                0x1716ac38e74b2840,
6983            >(_buf?)?;
6984            Ok(_response)
6985        }
6986        self.client.send_query_and_decode::<RegistrarRegisterRequest, ()>(
6987            (fuzzer_url, provider),
6988            0x1716ac38e74b2840,
6989            fidl::encoding::DynamicFlags::empty(),
6990            _decode,
6991        )
6992    }
6993}
6994
6995pub struct RegistrarEventStream {
6996    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6997}
6998
6999impl std::marker::Unpin for RegistrarEventStream {}
7000
7001impl futures::stream::FusedStream for RegistrarEventStream {
7002    fn is_terminated(&self) -> bool {
7003        self.event_receiver.is_terminated()
7004    }
7005}
7006
7007impl futures::Stream for RegistrarEventStream {
7008    type Item = Result<RegistrarEvent, fidl::Error>;
7009
7010    fn poll_next(
7011        mut self: std::pin::Pin<&mut Self>,
7012        cx: &mut std::task::Context<'_>,
7013    ) -> std::task::Poll<Option<Self::Item>> {
7014        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7015            &mut self.event_receiver,
7016            cx
7017        )?) {
7018            Some(buf) => std::task::Poll::Ready(Some(RegistrarEvent::decode(buf))),
7019            None => std::task::Poll::Ready(None),
7020        }
7021    }
7022}
7023
7024#[derive(Debug)]
7025pub enum RegistrarEvent {}
7026
7027impl RegistrarEvent {
7028    /// Decodes a message buffer as a [`RegistrarEvent`].
7029    fn decode(
7030        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7031    ) -> Result<RegistrarEvent, fidl::Error> {
7032        let (bytes, _handles) = buf.split_mut();
7033        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7034        debug_assert_eq!(tx_header.tx_id, 0);
7035        match tx_header.ordinal {
7036            _ => Err(fidl::Error::UnknownOrdinal {
7037                ordinal: tx_header.ordinal,
7038                protocol_name: <RegistrarMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7039            }),
7040        }
7041    }
7042}
7043
7044/// A Stream of incoming requests for fuchsia.fuzzer/Registrar.
7045pub struct RegistrarRequestStream {
7046    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7047    is_terminated: bool,
7048}
7049
7050impl std::marker::Unpin for RegistrarRequestStream {}
7051
7052impl futures::stream::FusedStream for RegistrarRequestStream {
7053    fn is_terminated(&self) -> bool {
7054        self.is_terminated
7055    }
7056}
7057
7058impl fidl::endpoints::RequestStream for RegistrarRequestStream {
7059    type Protocol = RegistrarMarker;
7060    type ControlHandle = RegistrarControlHandle;
7061
7062    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7063        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7064    }
7065
7066    fn control_handle(&self) -> Self::ControlHandle {
7067        RegistrarControlHandle { inner: self.inner.clone() }
7068    }
7069
7070    fn into_inner(
7071        self,
7072    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7073    {
7074        (self.inner, self.is_terminated)
7075    }
7076
7077    fn from_inner(
7078        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7079        is_terminated: bool,
7080    ) -> Self {
7081        Self { inner, is_terminated }
7082    }
7083}
7084
7085impl futures::Stream for RegistrarRequestStream {
7086    type Item = Result<RegistrarRequest, fidl::Error>;
7087
7088    fn poll_next(
7089        mut self: std::pin::Pin<&mut Self>,
7090        cx: &mut std::task::Context<'_>,
7091    ) -> std::task::Poll<Option<Self::Item>> {
7092        let this = &mut *self;
7093        if this.inner.check_shutdown(cx) {
7094            this.is_terminated = true;
7095            return std::task::Poll::Ready(None);
7096        }
7097        if this.is_terminated {
7098            panic!("polled RegistrarRequestStream after completion");
7099        }
7100        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7101            |bytes, handles| {
7102                match this.inner.channel().read_etc(cx, bytes, handles) {
7103                    std::task::Poll::Ready(Ok(())) => {}
7104                    std::task::Poll::Pending => return std::task::Poll::Pending,
7105                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7106                        this.is_terminated = true;
7107                        return std::task::Poll::Ready(None);
7108                    }
7109                    std::task::Poll::Ready(Err(e)) => {
7110                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7111                            e.into(),
7112                        ))));
7113                    }
7114                }
7115
7116                // A message has been received from the channel
7117                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7118
7119                std::task::Poll::Ready(Some(match header.ordinal {
7120                    0x1716ac38e74b2840 => {
7121                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7122                        let mut req = fidl::new_empty!(
7123                            RegistrarRegisterRequest,
7124                            fidl::encoding::DefaultFuchsiaResourceDialect
7125                        );
7126                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RegistrarRegisterRequest>(&header, _body_bytes, handles, &mut req)?;
7127                        let control_handle = RegistrarControlHandle { inner: this.inner.clone() };
7128                        Ok(RegistrarRequest::Register {
7129                            fuzzer_url: req.fuzzer_url,
7130                            provider: req.provider,
7131
7132                            responder: RegistrarRegisterResponder {
7133                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7134                                tx_id: header.tx_id,
7135                            },
7136                        })
7137                    }
7138                    _ => Err(fidl::Error::UnknownOrdinal {
7139                        ordinal: header.ordinal,
7140                        protocol_name:
7141                            <RegistrarMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7142                    }),
7143                }))
7144            },
7145        )
7146    }
7147}
7148
7149/// Entry point for the `fuzz_test_runner`. It uses this protocol to transfer
7150/// one end of a channel it creates to the `fuzz_manager`. The other end is
7151/// passed as a startup handle to the fuzzer component itself, which is used to
7152/// provide `Controller`s on request.
7153#[derive(Debug)]
7154pub enum RegistrarRequest {
7155    /// Adds a `ControllerProvider`. This should be called by the fuzzer itself,
7156    /// using the channel provided by the `fuzz_test_runner`, and in response to
7157    /// being started by the `fuzz_manager`.
7158    ///
7159    /// The registry will close the channel to the fuzzer on error, on a
7160    ///  corresponding call to `Registry.Disconnect`, or on exit. The fuzzer
7161    /// should exit when the channel closes.
7162    ///
7163    /// + request `fuzzer_url` the package URL for the fuzzer.
7164    /// + request `provider` the connection to a `ControllerProvider`.
7165    Register {
7166        fuzzer_url: String,
7167        provider: fidl::endpoints::ClientEnd<ControllerProviderMarker>,
7168        responder: RegistrarRegisterResponder,
7169    },
7170}
7171
7172impl RegistrarRequest {
7173    #[allow(irrefutable_let_patterns)]
7174    pub fn into_register(
7175        self,
7176    ) -> Option<(
7177        String,
7178        fidl::endpoints::ClientEnd<ControllerProviderMarker>,
7179        RegistrarRegisterResponder,
7180    )> {
7181        if let RegistrarRequest::Register { fuzzer_url, provider, responder } = self {
7182            Some((fuzzer_url, provider, responder))
7183        } else {
7184            None
7185        }
7186    }
7187
7188    /// Name of the method defined in FIDL
7189    pub fn method_name(&self) -> &'static str {
7190        match *self {
7191            RegistrarRequest::Register { .. } => "register",
7192        }
7193    }
7194}
7195
7196#[derive(Debug, Clone)]
7197pub struct RegistrarControlHandle {
7198    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7199}
7200
7201impl RegistrarControlHandle {
7202    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
7203        self.inner.shutdown_with_epitaph(status.into())
7204    }
7205}
7206
7207impl fidl::endpoints::ControlHandle for RegistrarControlHandle {
7208    fn shutdown(&self) {
7209        self.inner.shutdown()
7210    }
7211
7212    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
7213        self.inner.shutdown_with_epitaph(status)
7214    }
7215
7216    fn is_closed(&self) -> bool {
7217        self.inner.channel().is_closed()
7218    }
7219    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7220        self.inner.channel().on_closed()
7221    }
7222
7223    #[cfg(target_os = "fuchsia")]
7224    fn signal_peer(
7225        &self,
7226        clear_mask: zx::Signals,
7227        set_mask: zx::Signals,
7228    ) -> Result<(), zx_status::Status> {
7229        use fidl::Peered;
7230        self.inner.channel().signal_peer(clear_mask, set_mask)
7231    }
7232}
7233
7234impl RegistrarControlHandle {}
7235
7236#[must_use = "FIDL methods require a response to be sent"]
7237#[derive(Debug)]
7238pub struct RegistrarRegisterResponder {
7239    control_handle: std::mem::ManuallyDrop<RegistrarControlHandle>,
7240    tx_id: u32,
7241}
7242
7243/// Set the the channel to be shutdown (see [`RegistrarControlHandle::shutdown`])
7244/// if the responder is dropped without sending a response, so that the client
7245/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7246impl std::ops::Drop for RegistrarRegisterResponder {
7247    fn drop(&mut self) {
7248        self.control_handle.shutdown();
7249        // Safety: drops once, never accessed again
7250        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7251    }
7252}
7253
7254impl fidl::endpoints::Responder for RegistrarRegisterResponder {
7255    type ControlHandle = RegistrarControlHandle;
7256
7257    fn control_handle(&self) -> &RegistrarControlHandle {
7258        &self.control_handle
7259    }
7260
7261    fn drop_without_shutdown(mut self) {
7262        // Safety: drops once, never accessed again due to mem::forget
7263        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7264        // Prevent Drop from running (which would shut down the channel)
7265        std::mem::forget(self);
7266    }
7267}
7268
7269impl RegistrarRegisterResponder {
7270    /// Sends a response to the FIDL transaction.
7271    ///
7272    /// Sets the channel to shutdown if an error occurs.
7273    pub fn send(self) -> Result<(), fidl::Error> {
7274        let _result = self.send_raw();
7275        if _result.is_err() {
7276            self.control_handle.shutdown();
7277        }
7278        self.drop_without_shutdown();
7279        _result
7280    }
7281
7282    /// Similar to "send" but does not shutdown the channel if an error occurs.
7283    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
7284        let _result = self.send_raw();
7285        self.drop_without_shutdown();
7286        _result
7287    }
7288
7289    fn send_raw(&self) -> Result<(), fidl::Error> {
7290        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
7291            (),
7292            self.tx_id,
7293            0x1716ac38e74b2840,
7294            fidl::encoding::DynamicFlags::empty(),
7295        )
7296    }
7297}
7298
7299#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7300pub struct RegistryMarker;
7301
7302impl fidl::endpoints::ProtocolMarker for RegistryMarker {
7303    type Proxy = RegistryProxy;
7304    type RequestStream = RegistryRequestStream;
7305    #[cfg(target_os = "fuchsia")]
7306    type SynchronousProxy = RegistrySynchronousProxy;
7307
7308    const DEBUG_NAME: &'static str = "fuchsia.fuzzer.Registry";
7309}
7310impl fidl::endpoints::DiscoverableProtocolMarker for RegistryMarker {}
7311pub type RegistryConnectResult = Result<(), i32>;
7312pub type RegistryDisconnectResult = Result<(), i32>;
7313
7314pub trait RegistryProxyInterface: Send + Sync {
7315    type ConnectResponseFut: std::future::Future<Output = Result<RegistryConnectResult, fidl::Error>>
7316        + Send;
7317    fn r#connect(
7318        &self,
7319        fuzzer_url: &str,
7320        controller: fidl::endpoints::ServerEnd<ControllerMarker>,
7321        timeout: i64,
7322    ) -> Self::ConnectResponseFut;
7323    type DisconnectResponseFut: std::future::Future<Output = Result<RegistryDisconnectResult, fidl::Error>>
7324        + Send;
7325    fn r#disconnect(&self, fuzzer_url: &str) -> Self::DisconnectResponseFut;
7326}
7327#[derive(Debug)]
7328#[cfg(target_os = "fuchsia")]
7329pub struct RegistrySynchronousProxy {
7330    client: fidl::client::sync::Client,
7331}
7332
7333#[cfg(target_os = "fuchsia")]
7334impl fidl::endpoints::SynchronousProxy for RegistrySynchronousProxy {
7335    type Proxy = RegistryProxy;
7336    type Protocol = RegistryMarker;
7337
7338    fn from_channel(inner: fidl::Channel) -> Self {
7339        Self::new(inner)
7340    }
7341
7342    fn into_channel(self) -> fidl::Channel {
7343        self.client.into_channel()
7344    }
7345
7346    fn as_channel(&self) -> &fidl::Channel {
7347        self.client.as_channel()
7348    }
7349}
7350
7351#[cfg(target_os = "fuchsia")]
7352impl RegistrySynchronousProxy {
7353    pub fn new(channel: fidl::Channel) -> Self {
7354        Self { client: fidl::client::sync::Client::new(channel) }
7355    }
7356
7357    pub fn into_channel(self) -> fidl::Channel {
7358        self.client.into_channel()
7359    }
7360
7361    /// Waits until an event arrives and returns it. It is safe for other
7362    /// threads to make concurrent requests while waiting for an event.
7363    pub fn wait_for_event(
7364        &self,
7365        deadline: zx::MonotonicInstant,
7366    ) -> Result<RegistryEvent, fidl::Error> {
7367        RegistryEvent::decode(self.client.wait_for_event::<RegistryMarker>(deadline)?)
7368    }
7369
7370    /// Connects the `Controller` to a registered fuzzer.
7371    ///
7372    /// Uses a `ControllerProvider` that has been `Register`ed with the given
7373    /// URL to connect. If the associated provider is not available, it assumes
7374    /// it is starting and blocks until the fuzzer calls `Registrar.Register`,
7375    /// or the given `timeout` elapses. At most one call to `Connect` will block
7376    /// in this manner at a time.
7377    ///
7378    /// + request `fuzzer_url` the package URL for the fuzzer.
7379    /// + request `provider` the connection to a `Controller` client.
7380    /// + request `tiemout` maximum duration to wait for a connection.
7381    /// * error one of the following:
7382    ///     * `ZX_ERR_TIMED_OUT` if the `timeout` elapses without the provider
7383    ///       becoming available.
7384    ///     * `ZX_ERR_SHOULD_WAIT` if already waiting for a fuzzer to start.
7385    pub fn r#connect(
7386        &self,
7387        mut fuzzer_url: &str,
7388        mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
7389        mut timeout: i64,
7390        ___deadline: zx::MonotonicInstant,
7391    ) -> Result<RegistryConnectResult, fidl::Error> {
7392        let _response = self.client.send_query::<
7393            RegistryConnectRequest,
7394            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7395            RegistryMarker,
7396        >(
7397            (fuzzer_url, controller, timeout,),
7398            0x5128cb31967a446f,
7399            fidl::encoding::DynamicFlags::empty(),
7400            ___deadline,
7401        )?;
7402        Ok(_response.map(|x| x))
7403    }
7404
7405    /// Removes the provider associated with the given URL from the registry and
7406    /// closes its channel. The associated fuzzer should exit upon channel
7407    /// closure.
7408    ///
7409    /// + request `fuzzer_url` the package URL for the fuzzer.
7410    /// * error `ZX_ERR_NOT_FOUND` if no such provider exists in the registry.
7411    pub fn r#disconnect(
7412        &self,
7413        mut fuzzer_url: &str,
7414        ___deadline: zx::MonotonicInstant,
7415    ) -> Result<RegistryDisconnectResult, fidl::Error> {
7416        let _response = self.client.send_query::<
7417            RegistryDisconnectRequest,
7418            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7419            RegistryMarker,
7420        >(
7421            (fuzzer_url,),
7422            0x7bb4b7591146d4cb,
7423            fidl::encoding::DynamicFlags::empty(),
7424            ___deadline,
7425        )?;
7426        Ok(_response.map(|x| x))
7427    }
7428}
7429
7430#[cfg(target_os = "fuchsia")]
7431impl From<RegistrySynchronousProxy> for zx::NullableHandle {
7432    fn from(value: RegistrySynchronousProxy) -> Self {
7433        value.into_channel().into()
7434    }
7435}
7436
7437#[cfg(target_os = "fuchsia")]
7438impl From<fidl::Channel> for RegistrySynchronousProxy {
7439    fn from(value: fidl::Channel) -> Self {
7440        Self::new(value)
7441    }
7442}
7443
7444#[cfg(target_os = "fuchsia")]
7445impl fidl::endpoints::FromClient for RegistrySynchronousProxy {
7446    type Protocol = RegistryMarker;
7447
7448    fn from_client(value: fidl::endpoints::ClientEnd<RegistryMarker>) -> Self {
7449        Self::new(value.into_channel())
7450    }
7451}
7452
7453#[derive(Debug, Clone)]
7454pub struct RegistryProxy {
7455    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7456}
7457
7458impl fidl::endpoints::Proxy for RegistryProxy {
7459    type Protocol = RegistryMarker;
7460
7461    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7462        Self::new(inner)
7463    }
7464
7465    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7466        self.client.into_channel().map_err(|client| Self { client })
7467    }
7468
7469    fn as_channel(&self) -> &::fidl::AsyncChannel {
7470        self.client.as_channel()
7471    }
7472}
7473
7474impl RegistryProxy {
7475    /// Create a new Proxy for fuchsia.fuzzer/Registry.
7476    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7477        let protocol_name = <RegistryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7478        Self { client: fidl::client::Client::new(channel, protocol_name) }
7479    }
7480
7481    /// Get a Stream of events from the remote end of the protocol.
7482    ///
7483    /// # Panics
7484    ///
7485    /// Panics if the event stream was already taken.
7486    pub fn take_event_stream(&self) -> RegistryEventStream {
7487        RegistryEventStream { event_receiver: self.client.take_event_receiver() }
7488    }
7489
7490    /// Connects the `Controller` to a registered fuzzer.
7491    ///
7492    /// Uses a `ControllerProvider` that has been `Register`ed with the given
7493    /// URL to connect. If the associated provider is not available, it assumes
7494    /// it is starting and blocks until the fuzzer calls `Registrar.Register`,
7495    /// or the given `timeout` elapses. At most one call to `Connect` will block
7496    /// in this manner at a time.
7497    ///
7498    /// + request `fuzzer_url` the package URL for the fuzzer.
7499    /// + request `provider` the connection to a `Controller` client.
7500    /// + request `tiemout` maximum duration to wait for a connection.
7501    /// * error one of the following:
7502    ///     * `ZX_ERR_TIMED_OUT` if the `timeout` elapses without the provider
7503    ///       becoming available.
7504    ///     * `ZX_ERR_SHOULD_WAIT` if already waiting for a fuzzer to start.
7505    pub fn r#connect(
7506        &self,
7507        mut fuzzer_url: &str,
7508        mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
7509        mut timeout: i64,
7510    ) -> fidl::client::QueryResponseFut<
7511        RegistryConnectResult,
7512        fidl::encoding::DefaultFuchsiaResourceDialect,
7513    > {
7514        RegistryProxyInterface::r#connect(self, fuzzer_url, controller, timeout)
7515    }
7516
7517    /// Removes the provider associated with the given URL from the registry and
7518    /// closes its channel. The associated fuzzer should exit upon channel
7519    /// closure.
7520    ///
7521    /// + request `fuzzer_url` the package URL for the fuzzer.
7522    /// * error `ZX_ERR_NOT_FOUND` if no such provider exists in the registry.
7523    pub fn r#disconnect(
7524        &self,
7525        mut fuzzer_url: &str,
7526    ) -> fidl::client::QueryResponseFut<
7527        RegistryDisconnectResult,
7528        fidl::encoding::DefaultFuchsiaResourceDialect,
7529    > {
7530        RegistryProxyInterface::r#disconnect(self, fuzzer_url)
7531    }
7532}
7533
7534impl RegistryProxyInterface for RegistryProxy {
7535    type ConnectResponseFut = fidl::client::QueryResponseFut<
7536        RegistryConnectResult,
7537        fidl::encoding::DefaultFuchsiaResourceDialect,
7538    >;
7539    fn r#connect(
7540        &self,
7541        mut fuzzer_url: &str,
7542        mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
7543        mut timeout: i64,
7544    ) -> Self::ConnectResponseFut {
7545        fn _decode(
7546            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7547        ) -> Result<RegistryConnectResult, fidl::Error> {
7548            let _response = fidl::client::decode_transaction_body::<
7549                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7550                fidl::encoding::DefaultFuchsiaResourceDialect,
7551                0x5128cb31967a446f,
7552            >(_buf?)?;
7553            Ok(_response.map(|x| x))
7554        }
7555        self.client.send_query_and_decode::<RegistryConnectRequest, RegistryConnectResult>(
7556            (fuzzer_url, controller, timeout),
7557            0x5128cb31967a446f,
7558            fidl::encoding::DynamicFlags::empty(),
7559            _decode,
7560        )
7561    }
7562
7563    type DisconnectResponseFut = fidl::client::QueryResponseFut<
7564        RegistryDisconnectResult,
7565        fidl::encoding::DefaultFuchsiaResourceDialect,
7566    >;
7567    fn r#disconnect(&self, mut fuzzer_url: &str) -> Self::DisconnectResponseFut {
7568        fn _decode(
7569            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7570        ) -> Result<RegistryDisconnectResult, fidl::Error> {
7571            let _response = fidl::client::decode_transaction_body::<
7572                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7573                fidl::encoding::DefaultFuchsiaResourceDialect,
7574                0x7bb4b7591146d4cb,
7575            >(_buf?)?;
7576            Ok(_response.map(|x| x))
7577        }
7578        self.client.send_query_and_decode::<RegistryDisconnectRequest, RegistryDisconnectResult>(
7579            (fuzzer_url,),
7580            0x7bb4b7591146d4cb,
7581            fidl::encoding::DynamicFlags::empty(),
7582            _decode,
7583        )
7584    }
7585}
7586
7587pub struct RegistryEventStream {
7588    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7589}
7590
7591impl std::marker::Unpin for RegistryEventStream {}
7592
7593impl futures::stream::FusedStream for RegistryEventStream {
7594    fn is_terminated(&self) -> bool {
7595        self.event_receiver.is_terminated()
7596    }
7597}
7598
7599impl futures::Stream for RegistryEventStream {
7600    type Item = Result<RegistryEvent, fidl::Error>;
7601
7602    fn poll_next(
7603        mut self: std::pin::Pin<&mut Self>,
7604        cx: &mut std::task::Context<'_>,
7605    ) -> std::task::Poll<Option<Self::Item>> {
7606        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7607            &mut self.event_receiver,
7608            cx
7609        )?) {
7610            Some(buf) => std::task::Poll::Ready(Some(RegistryEvent::decode(buf))),
7611            None => std::task::Poll::Ready(None),
7612        }
7613    }
7614}
7615
7616#[derive(Debug)]
7617pub enum RegistryEvent {}
7618
7619impl RegistryEvent {
7620    /// Decodes a message buffer as a [`RegistryEvent`].
7621    fn decode(
7622        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7623    ) -> Result<RegistryEvent, fidl::Error> {
7624        let (bytes, _handles) = buf.split_mut();
7625        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7626        debug_assert_eq!(tx_header.tx_id, 0);
7627        match tx_header.ordinal {
7628            _ => Err(fidl::Error::UnknownOrdinal {
7629                ordinal: tx_header.ordinal,
7630                protocol_name: <RegistryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7631            }),
7632        }
7633    }
7634}
7635
7636/// A Stream of incoming requests for fuchsia.fuzzer/Registry.
7637pub struct RegistryRequestStream {
7638    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7639    is_terminated: bool,
7640}
7641
7642impl std::marker::Unpin for RegistryRequestStream {}
7643
7644impl futures::stream::FusedStream for RegistryRequestStream {
7645    fn is_terminated(&self) -> bool {
7646        self.is_terminated
7647    }
7648}
7649
7650impl fidl::endpoints::RequestStream for RegistryRequestStream {
7651    type Protocol = RegistryMarker;
7652    type ControlHandle = RegistryControlHandle;
7653
7654    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7655        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7656    }
7657
7658    fn control_handle(&self) -> Self::ControlHandle {
7659        RegistryControlHandle { inner: self.inner.clone() }
7660    }
7661
7662    fn into_inner(
7663        self,
7664    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7665    {
7666        (self.inner, self.is_terminated)
7667    }
7668
7669    fn from_inner(
7670        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7671        is_terminated: bool,
7672    ) -> Self {
7673        Self { inner, is_terminated }
7674    }
7675}
7676
7677impl futures::Stream for RegistryRequestStream {
7678    type Item = Result<RegistryRequest, fidl::Error>;
7679
7680    fn poll_next(
7681        mut self: std::pin::Pin<&mut Self>,
7682        cx: &mut std::task::Context<'_>,
7683    ) -> std::task::Poll<Option<Self::Item>> {
7684        let this = &mut *self;
7685        if this.inner.check_shutdown(cx) {
7686            this.is_terminated = true;
7687            return std::task::Poll::Ready(None);
7688        }
7689        if this.is_terminated {
7690            panic!("polled RegistryRequestStream after completion");
7691        }
7692        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7693            |bytes, handles| {
7694                match this.inner.channel().read_etc(cx, bytes, handles) {
7695                    std::task::Poll::Ready(Ok(())) => {}
7696                    std::task::Poll::Pending => return std::task::Poll::Pending,
7697                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7698                        this.is_terminated = true;
7699                        return std::task::Poll::Ready(None);
7700                    }
7701                    std::task::Poll::Ready(Err(e)) => {
7702                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7703                            e.into(),
7704                        ))));
7705                    }
7706                }
7707
7708                // A message has been received from the channel
7709                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7710
7711                std::task::Poll::Ready(Some(match header.ordinal {
7712                    0x5128cb31967a446f => {
7713                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7714                        let mut req = fidl::new_empty!(
7715                            RegistryConnectRequest,
7716                            fidl::encoding::DefaultFuchsiaResourceDialect
7717                        );
7718                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RegistryConnectRequest>(&header, _body_bytes, handles, &mut req)?;
7719                        let control_handle = RegistryControlHandle { inner: this.inner.clone() };
7720                        Ok(RegistryRequest::Connect {
7721                            fuzzer_url: req.fuzzer_url,
7722                            controller: req.controller,
7723                            timeout: req.timeout,
7724
7725                            responder: RegistryConnectResponder {
7726                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7727                                tx_id: header.tx_id,
7728                            },
7729                        })
7730                    }
7731                    0x7bb4b7591146d4cb => {
7732                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7733                        let mut req = fidl::new_empty!(
7734                            RegistryDisconnectRequest,
7735                            fidl::encoding::DefaultFuchsiaResourceDialect
7736                        );
7737                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RegistryDisconnectRequest>(&header, _body_bytes, handles, &mut req)?;
7738                        let control_handle = RegistryControlHandle { inner: this.inner.clone() };
7739                        Ok(RegistryRequest::Disconnect {
7740                            fuzzer_url: req.fuzzer_url,
7741
7742                            responder: RegistryDisconnectResponder {
7743                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7744                                tx_id: header.tx_id,
7745                            },
7746                        })
7747                    }
7748                    _ => Err(fidl::Error::UnknownOrdinal {
7749                        ordinal: header.ordinal,
7750                        protocol_name:
7751                            <RegistryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7752                    }),
7753                }))
7754            },
7755        )
7756    }
7757}
7758
7759/// Entry point for the `fuzz_manager`. It uses this protocol to wait for fuzz
7760/// tests started within the test runner framework to register a
7761/// `ControllerProvider`, and to stop those fuzzers upon request.
7762#[derive(Debug)]
7763pub enum RegistryRequest {
7764    /// Connects the `Controller` to a registered fuzzer.
7765    ///
7766    /// Uses a `ControllerProvider` that has been `Register`ed with the given
7767    /// URL to connect. If the associated provider is not available, it assumes
7768    /// it is starting and blocks until the fuzzer calls `Registrar.Register`,
7769    /// or the given `timeout` elapses. At most one call to `Connect` will block
7770    /// in this manner at a time.
7771    ///
7772    /// + request `fuzzer_url` the package URL for the fuzzer.
7773    /// + request `provider` the connection to a `Controller` client.
7774    /// + request `tiemout` maximum duration to wait for a connection.
7775    /// * error one of the following:
7776    ///     * `ZX_ERR_TIMED_OUT` if the `timeout` elapses without the provider
7777    ///       becoming available.
7778    ///     * `ZX_ERR_SHOULD_WAIT` if already waiting for a fuzzer to start.
7779    Connect {
7780        fuzzer_url: String,
7781        controller: fidl::endpoints::ServerEnd<ControllerMarker>,
7782        timeout: i64,
7783        responder: RegistryConnectResponder,
7784    },
7785    /// Removes the provider associated with the given URL from the registry and
7786    /// closes its channel. The associated fuzzer should exit upon channel
7787    /// closure.
7788    ///
7789    /// + request `fuzzer_url` the package URL for the fuzzer.
7790    /// * error `ZX_ERR_NOT_FOUND` if no such provider exists in the registry.
7791    Disconnect { fuzzer_url: String, responder: RegistryDisconnectResponder },
7792}
7793
7794impl RegistryRequest {
7795    #[allow(irrefutable_let_patterns)]
7796    pub fn into_connect(
7797        self,
7798    ) -> Option<(String, fidl::endpoints::ServerEnd<ControllerMarker>, i64, RegistryConnectResponder)>
7799    {
7800        if let RegistryRequest::Connect { fuzzer_url, controller, timeout, responder } = self {
7801            Some((fuzzer_url, controller, timeout, responder))
7802        } else {
7803            None
7804        }
7805    }
7806
7807    #[allow(irrefutable_let_patterns)]
7808    pub fn into_disconnect(self) -> Option<(String, RegistryDisconnectResponder)> {
7809        if let RegistryRequest::Disconnect { fuzzer_url, responder } = self {
7810            Some((fuzzer_url, responder))
7811        } else {
7812            None
7813        }
7814    }
7815
7816    /// Name of the method defined in FIDL
7817    pub fn method_name(&self) -> &'static str {
7818        match *self {
7819            RegistryRequest::Connect { .. } => "connect",
7820            RegistryRequest::Disconnect { .. } => "disconnect",
7821        }
7822    }
7823}
7824
7825#[derive(Debug, Clone)]
7826pub struct RegistryControlHandle {
7827    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7828}
7829
7830impl RegistryControlHandle {
7831    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
7832        self.inner.shutdown_with_epitaph(status.into())
7833    }
7834}
7835
7836impl fidl::endpoints::ControlHandle for RegistryControlHandle {
7837    fn shutdown(&self) {
7838        self.inner.shutdown()
7839    }
7840
7841    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
7842        self.inner.shutdown_with_epitaph(status)
7843    }
7844
7845    fn is_closed(&self) -> bool {
7846        self.inner.channel().is_closed()
7847    }
7848    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7849        self.inner.channel().on_closed()
7850    }
7851
7852    #[cfg(target_os = "fuchsia")]
7853    fn signal_peer(
7854        &self,
7855        clear_mask: zx::Signals,
7856        set_mask: zx::Signals,
7857    ) -> Result<(), zx_status::Status> {
7858        use fidl::Peered;
7859        self.inner.channel().signal_peer(clear_mask, set_mask)
7860    }
7861}
7862
7863impl RegistryControlHandle {}
7864
7865#[must_use = "FIDL methods require a response to be sent"]
7866#[derive(Debug)]
7867pub struct RegistryConnectResponder {
7868    control_handle: std::mem::ManuallyDrop<RegistryControlHandle>,
7869    tx_id: u32,
7870}
7871
7872/// Set the the channel to be shutdown (see [`RegistryControlHandle::shutdown`])
7873/// if the responder is dropped without sending a response, so that the client
7874/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7875impl std::ops::Drop for RegistryConnectResponder {
7876    fn drop(&mut self) {
7877        self.control_handle.shutdown();
7878        // Safety: drops once, never accessed again
7879        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7880    }
7881}
7882
7883impl fidl::endpoints::Responder for RegistryConnectResponder {
7884    type ControlHandle = RegistryControlHandle;
7885
7886    fn control_handle(&self) -> &RegistryControlHandle {
7887        &self.control_handle
7888    }
7889
7890    fn drop_without_shutdown(mut self) {
7891        // Safety: drops once, never accessed again due to mem::forget
7892        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7893        // Prevent Drop from running (which would shut down the channel)
7894        std::mem::forget(self);
7895    }
7896}
7897
7898impl RegistryConnectResponder {
7899    /// Sends a response to the FIDL transaction.
7900    ///
7901    /// Sets the channel to shutdown if an error occurs.
7902    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7903        let _result = self.send_raw(result);
7904        if _result.is_err() {
7905            self.control_handle.shutdown();
7906        }
7907        self.drop_without_shutdown();
7908        _result
7909    }
7910
7911    /// Similar to "send" but does not shutdown the channel if an error occurs.
7912    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7913        let _result = self.send_raw(result);
7914        self.drop_without_shutdown();
7915        _result
7916    }
7917
7918    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7919        self.control_handle
7920            .inner
7921            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
7922                result,
7923                self.tx_id,
7924                0x5128cb31967a446f,
7925                fidl::encoding::DynamicFlags::empty(),
7926            )
7927    }
7928}
7929
7930#[must_use = "FIDL methods require a response to be sent"]
7931#[derive(Debug)]
7932pub struct RegistryDisconnectResponder {
7933    control_handle: std::mem::ManuallyDrop<RegistryControlHandle>,
7934    tx_id: u32,
7935}
7936
7937/// Set the the channel to be shutdown (see [`RegistryControlHandle::shutdown`])
7938/// if the responder is dropped without sending a response, so that the client
7939/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7940impl std::ops::Drop for RegistryDisconnectResponder {
7941    fn drop(&mut self) {
7942        self.control_handle.shutdown();
7943        // Safety: drops once, never accessed again
7944        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7945    }
7946}
7947
7948impl fidl::endpoints::Responder for RegistryDisconnectResponder {
7949    type ControlHandle = RegistryControlHandle;
7950
7951    fn control_handle(&self) -> &RegistryControlHandle {
7952        &self.control_handle
7953    }
7954
7955    fn drop_without_shutdown(mut self) {
7956        // Safety: drops once, never accessed again due to mem::forget
7957        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7958        // Prevent Drop from running (which would shut down the channel)
7959        std::mem::forget(self);
7960    }
7961}
7962
7963impl RegistryDisconnectResponder {
7964    /// Sends a response to the FIDL transaction.
7965    ///
7966    /// Sets the channel to shutdown if an error occurs.
7967    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7968        let _result = self.send_raw(result);
7969        if _result.is_err() {
7970            self.control_handle.shutdown();
7971        }
7972        self.drop_without_shutdown();
7973        _result
7974    }
7975
7976    /// Similar to "send" but does not shutdown the channel if an error occurs.
7977    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7978        let _result = self.send_raw(result);
7979        self.drop_without_shutdown();
7980        _result
7981    }
7982
7983    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7984        self.control_handle
7985            .inner
7986            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
7987                result,
7988                self.tx_id,
7989                0x7bb4b7591146d4cb,
7990                fidl::encoding::DynamicFlags::empty(),
7991            )
7992    }
7993}
7994
7995#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7996pub struct TargetAdapterMarker;
7997
7998impl fidl::endpoints::ProtocolMarker for TargetAdapterMarker {
7999    type Proxy = TargetAdapterProxy;
8000    type RequestStream = TargetAdapterRequestStream;
8001    #[cfg(target_os = "fuchsia")]
8002    type SynchronousProxy = TargetAdapterSynchronousProxy;
8003
8004    const DEBUG_NAME: &'static str = "fuchsia.fuzzer.TargetAdapter";
8005}
8006impl fidl::endpoints::DiscoverableProtocolMarker for TargetAdapterMarker {}
8007
8008pub trait TargetAdapterProxyInterface: Send + Sync {
8009    type GetParametersResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>>
8010        + Send;
8011    fn r#get_parameters(&self) -> Self::GetParametersResponseFut;
8012    type ConnectResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
8013    fn r#connect(
8014        &self,
8015        eventpair: fidl::EventPair,
8016        test_input: fidl::Vmo,
8017    ) -> Self::ConnectResponseFut;
8018}
8019#[derive(Debug)]
8020#[cfg(target_os = "fuchsia")]
8021pub struct TargetAdapterSynchronousProxy {
8022    client: fidl::client::sync::Client,
8023}
8024
8025#[cfg(target_os = "fuchsia")]
8026impl fidl::endpoints::SynchronousProxy for TargetAdapterSynchronousProxy {
8027    type Proxy = TargetAdapterProxy;
8028    type Protocol = TargetAdapterMarker;
8029
8030    fn from_channel(inner: fidl::Channel) -> Self {
8031        Self::new(inner)
8032    }
8033
8034    fn into_channel(self) -> fidl::Channel {
8035        self.client.into_channel()
8036    }
8037
8038    fn as_channel(&self) -> &fidl::Channel {
8039        self.client.as_channel()
8040    }
8041}
8042
8043#[cfg(target_os = "fuchsia")]
8044impl TargetAdapterSynchronousProxy {
8045    pub fn new(channel: fidl::Channel) -> Self {
8046        Self { client: fidl::client::sync::Client::new(channel) }
8047    }
8048
8049    pub fn into_channel(self) -> fidl::Channel {
8050        self.client.into_channel()
8051    }
8052
8053    /// Waits until an event arrives and returns it. It is safe for other
8054    /// threads to make concurrent requests while waiting for an event.
8055    pub fn wait_for_event(
8056        &self,
8057        deadline: zx::MonotonicInstant,
8058    ) -> Result<TargetAdapterEvent, fidl::Error> {
8059        TargetAdapterEvent::decode(self.client.wait_for_event::<TargetAdapterMarker>(deadline)?)
8060    }
8061
8062    /// Retrieves the target-specific fuzzer parameters, e.g. the package-
8063    /// relative location of seed corpora. These parameters are specific to
8064    /// individual fuzzers, and are used by both the fuzzing engine and the
8065    /// "test-engine" used to create fuzzer unit tests. For these reasons, it is
8066    /// most convenient for fuzzer authors to specify them as part of the
8067    /// (fuzzer-specific) target adapter's component manifest file, and have the
8068    /// engine and test-engine retrieve them via this method.
8069    ///
8070    /// - response `parameters` the command line parameters from a specific
8071    ///   fuzzer's component manifest.
8072    pub fn r#get_parameters(
8073        &self,
8074        ___deadline: zx::MonotonicInstant,
8075    ) -> Result<Vec<String>, fidl::Error> {
8076        let _response = self.client.send_query::<
8077            fidl::encoding::EmptyPayload,
8078            TargetAdapterGetParametersResponse,
8079            TargetAdapterMarker,
8080        >(
8081            (),
8082            0x5c7e40a47f753e3e,
8083            fidl::encoding::DynamicFlags::empty(),
8084            ___deadline,
8085        )?;
8086        Ok(_response.parameters)
8087    }
8088
8089    /// Provides the eventpair used by driver and adapter to signal each other,
8090    /// and the shared VMO used to provide test inputs to the adapter. The VMO
8091    /// must have the `ZX_PROP_VMO_CONTENT_SIZE` property set.
8092    ///
8093    /// + request `eventpair` the eventpair used to signal when fuzzing runs
8094    ///   start and stop.
8095    /// + request `test_input` the shared VMO used by the engine to provide byte
8096    ///   sequences to test.
8097    pub fn r#connect(
8098        &self,
8099        mut eventpair: fidl::EventPair,
8100        mut test_input: fidl::Vmo,
8101        ___deadline: zx::MonotonicInstant,
8102    ) -> Result<(), fidl::Error> {
8103        let _response = self.client.send_query::<
8104            TargetAdapterConnectRequest,
8105            fidl::encoding::EmptyPayload,
8106            TargetAdapterMarker,
8107        >(
8108            (eventpair, test_input,),
8109            0x7ea603a119866618,
8110            fidl::encoding::DynamicFlags::empty(),
8111            ___deadline,
8112        )?;
8113        Ok(_response)
8114    }
8115}
8116
8117#[cfg(target_os = "fuchsia")]
8118impl From<TargetAdapterSynchronousProxy> for zx::NullableHandle {
8119    fn from(value: TargetAdapterSynchronousProxy) -> Self {
8120        value.into_channel().into()
8121    }
8122}
8123
8124#[cfg(target_os = "fuchsia")]
8125impl From<fidl::Channel> for TargetAdapterSynchronousProxy {
8126    fn from(value: fidl::Channel) -> Self {
8127        Self::new(value)
8128    }
8129}
8130
8131#[cfg(target_os = "fuchsia")]
8132impl fidl::endpoints::FromClient for TargetAdapterSynchronousProxy {
8133    type Protocol = TargetAdapterMarker;
8134
8135    fn from_client(value: fidl::endpoints::ClientEnd<TargetAdapterMarker>) -> Self {
8136        Self::new(value.into_channel())
8137    }
8138}
8139
8140#[derive(Debug, Clone)]
8141pub struct TargetAdapterProxy {
8142    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8143}
8144
8145impl fidl::endpoints::Proxy for TargetAdapterProxy {
8146    type Protocol = TargetAdapterMarker;
8147
8148    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8149        Self::new(inner)
8150    }
8151
8152    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8153        self.client.into_channel().map_err(|client| Self { client })
8154    }
8155
8156    fn as_channel(&self) -> &::fidl::AsyncChannel {
8157        self.client.as_channel()
8158    }
8159}
8160
8161impl TargetAdapterProxy {
8162    /// Create a new Proxy for fuchsia.fuzzer/TargetAdapter.
8163    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8164        let protocol_name = <TargetAdapterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8165        Self { client: fidl::client::Client::new(channel, protocol_name) }
8166    }
8167
8168    /// Get a Stream of events from the remote end of the protocol.
8169    ///
8170    /// # Panics
8171    ///
8172    /// Panics if the event stream was already taken.
8173    pub fn take_event_stream(&self) -> TargetAdapterEventStream {
8174        TargetAdapterEventStream { event_receiver: self.client.take_event_receiver() }
8175    }
8176
8177    /// Retrieves the target-specific fuzzer parameters, e.g. the package-
8178    /// relative location of seed corpora. These parameters are specific to
8179    /// individual fuzzers, and are used by both the fuzzing engine and the
8180    /// "test-engine" used to create fuzzer unit tests. For these reasons, it is
8181    /// most convenient for fuzzer authors to specify them as part of the
8182    /// (fuzzer-specific) target adapter's component manifest file, and have the
8183    /// engine and test-engine retrieve them via this method.
8184    ///
8185    /// - response `parameters` the command line parameters from a specific
8186    ///   fuzzer's component manifest.
8187    pub fn r#get_parameters(
8188        &self,
8189    ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
8190    {
8191        TargetAdapterProxyInterface::r#get_parameters(self)
8192    }
8193
8194    /// Provides the eventpair used by driver and adapter to signal each other,
8195    /// and the shared VMO used to provide test inputs to the adapter. The VMO
8196    /// must have the `ZX_PROP_VMO_CONTENT_SIZE` property set.
8197    ///
8198    /// + request `eventpair` the eventpair used to signal when fuzzing runs
8199    ///   start and stop.
8200    /// + request `test_input` the shared VMO used by the engine to provide byte
8201    ///   sequences to test.
8202    pub fn r#connect(
8203        &self,
8204        mut eventpair: fidl::EventPair,
8205        mut test_input: fidl::Vmo,
8206    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
8207        TargetAdapterProxyInterface::r#connect(self, eventpair, test_input)
8208    }
8209}
8210
8211impl TargetAdapterProxyInterface for TargetAdapterProxy {
8212    type GetParametersResponseFut =
8213        fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
8214    fn r#get_parameters(&self) -> Self::GetParametersResponseFut {
8215        fn _decode(
8216            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8217        ) -> Result<Vec<String>, fidl::Error> {
8218            let _response = fidl::client::decode_transaction_body::<
8219                TargetAdapterGetParametersResponse,
8220                fidl::encoding::DefaultFuchsiaResourceDialect,
8221                0x5c7e40a47f753e3e,
8222            >(_buf?)?;
8223            Ok(_response.parameters)
8224        }
8225        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
8226            (),
8227            0x5c7e40a47f753e3e,
8228            fidl::encoding::DynamicFlags::empty(),
8229            _decode,
8230        )
8231    }
8232
8233    type ConnectResponseFut =
8234        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
8235    fn r#connect(
8236        &self,
8237        mut eventpair: fidl::EventPair,
8238        mut test_input: fidl::Vmo,
8239    ) -> Self::ConnectResponseFut {
8240        fn _decode(
8241            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8242        ) -> Result<(), fidl::Error> {
8243            let _response = fidl::client::decode_transaction_body::<
8244                fidl::encoding::EmptyPayload,
8245                fidl::encoding::DefaultFuchsiaResourceDialect,
8246                0x7ea603a119866618,
8247            >(_buf?)?;
8248            Ok(_response)
8249        }
8250        self.client.send_query_and_decode::<TargetAdapterConnectRequest, ()>(
8251            (eventpair, test_input),
8252            0x7ea603a119866618,
8253            fidl::encoding::DynamicFlags::empty(),
8254            _decode,
8255        )
8256    }
8257}
8258
8259pub struct TargetAdapterEventStream {
8260    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8261}
8262
8263impl std::marker::Unpin for TargetAdapterEventStream {}
8264
8265impl futures::stream::FusedStream for TargetAdapterEventStream {
8266    fn is_terminated(&self) -> bool {
8267        self.event_receiver.is_terminated()
8268    }
8269}
8270
8271impl futures::Stream for TargetAdapterEventStream {
8272    type Item = Result<TargetAdapterEvent, fidl::Error>;
8273
8274    fn poll_next(
8275        mut self: std::pin::Pin<&mut Self>,
8276        cx: &mut std::task::Context<'_>,
8277    ) -> std::task::Poll<Option<Self::Item>> {
8278        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8279            &mut self.event_receiver,
8280            cx
8281        )?) {
8282            Some(buf) => std::task::Poll::Ready(Some(TargetAdapterEvent::decode(buf))),
8283            None => std::task::Poll::Ready(None),
8284        }
8285    }
8286}
8287
8288#[derive(Debug)]
8289pub enum TargetAdapterEvent {}
8290
8291impl TargetAdapterEvent {
8292    /// Decodes a message buffer as a [`TargetAdapterEvent`].
8293    fn decode(
8294        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8295    ) -> Result<TargetAdapterEvent, fidl::Error> {
8296        let (bytes, _handles) = buf.split_mut();
8297        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8298        debug_assert_eq!(tx_header.tx_id, 0);
8299        match tx_header.ordinal {
8300            _ => Err(fidl::Error::UnknownOrdinal {
8301                ordinal: tx_header.ordinal,
8302                protocol_name: <TargetAdapterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8303            }),
8304        }
8305    }
8306}
8307
8308/// A Stream of incoming requests for fuchsia.fuzzer/TargetAdapter.
8309pub struct TargetAdapterRequestStream {
8310    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8311    is_terminated: bool,
8312}
8313
8314impl std::marker::Unpin for TargetAdapterRequestStream {}
8315
8316impl futures::stream::FusedStream for TargetAdapterRequestStream {
8317    fn is_terminated(&self) -> bool {
8318        self.is_terminated
8319    }
8320}
8321
8322impl fidl::endpoints::RequestStream for TargetAdapterRequestStream {
8323    type Protocol = TargetAdapterMarker;
8324    type ControlHandle = TargetAdapterControlHandle;
8325
8326    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8327        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8328    }
8329
8330    fn control_handle(&self) -> Self::ControlHandle {
8331        TargetAdapterControlHandle { inner: self.inner.clone() }
8332    }
8333
8334    fn into_inner(
8335        self,
8336    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8337    {
8338        (self.inner, self.is_terminated)
8339    }
8340
8341    fn from_inner(
8342        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8343        is_terminated: bool,
8344    ) -> Self {
8345        Self { inner, is_terminated }
8346    }
8347}
8348
8349impl futures::Stream for TargetAdapterRequestStream {
8350    type Item = Result<TargetAdapterRequest, fidl::Error>;
8351
8352    fn poll_next(
8353        mut self: std::pin::Pin<&mut Self>,
8354        cx: &mut std::task::Context<'_>,
8355    ) -> std::task::Poll<Option<Self::Item>> {
8356        let this = &mut *self;
8357        if this.inner.check_shutdown(cx) {
8358            this.is_terminated = true;
8359            return std::task::Poll::Ready(None);
8360        }
8361        if this.is_terminated {
8362            panic!("polled TargetAdapterRequestStream after completion");
8363        }
8364        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8365            |bytes, handles| {
8366                match this.inner.channel().read_etc(cx, bytes, handles) {
8367                    std::task::Poll::Ready(Ok(())) => {}
8368                    std::task::Poll::Pending => return std::task::Poll::Pending,
8369                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8370                        this.is_terminated = true;
8371                        return std::task::Poll::Ready(None);
8372                    }
8373                    std::task::Poll::Ready(Err(e)) => {
8374                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8375                            e.into(),
8376                        ))));
8377                    }
8378                }
8379
8380                // A message has been received from the channel
8381                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8382
8383                std::task::Poll::Ready(Some(match header.ordinal {
8384                    0x5c7e40a47f753e3e => {
8385                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8386                        let mut req = fidl::new_empty!(
8387                            fidl::encoding::EmptyPayload,
8388                            fidl::encoding::DefaultFuchsiaResourceDialect
8389                        );
8390                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8391                        let control_handle =
8392                            TargetAdapterControlHandle { inner: this.inner.clone() };
8393                        Ok(TargetAdapterRequest::GetParameters {
8394                            responder: TargetAdapterGetParametersResponder {
8395                                control_handle: std::mem::ManuallyDrop::new(control_handle),
8396                                tx_id: header.tx_id,
8397                            },
8398                        })
8399                    }
8400                    0x7ea603a119866618 => {
8401                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8402                        let mut req = fidl::new_empty!(
8403                            TargetAdapterConnectRequest,
8404                            fidl::encoding::DefaultFuchsiaResourceDialect
8405                        );
8406                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetAdapterConnectRequest>(&header, _body_bytes, handles, &mut req)?;
8407                        let control_handle =
8408                            TargetAdapterControlHandle { inner: this.inner.clone() };
8409                        Ok(TargetAdapterRequest::Connect {
8410                            eventpair: req.eventpair,
8411                            test_input: req.test_input,
8412
8413                            responder: TargetAdapterConnectResponder {
8414                                control_handle: std::mem::ManuallyDrop::new(control_handle),
8415                                tx_id: header.tx_id,
8416                            },
8417                        })
8418                    }
8419                    _ => Err(fidl::Error::UnknownOrdinal {
8420                        ordinal: header.ordinal,
8421                        protocol_name:
8422                            <TargetAdapterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8423                    }),
8424                }))
8425            },
8426        )
8427    }
8428}
8429
8430/// Maps test inputs to specific behaviors in the target code, e.g. by invoking
8431/// APIs, making FIDL calls. etc. The adapter includes the target-specific code
8432/// often referred to as the "fuzz target function".
8433///
8434/// See also:
8435///
8436/// * https://llvm.org/docs/LibFuzzer.html#fuzz-target
8437#[derive(Debug)]
8438pub enum TargetAdapterRequest {
8439    /// Retrieves the target-specific fuzzer parameters, e.g. the package-
8440    /// relative location of seed corpora. These parameters are specific to
8441    /// individual fuzzers, and are used by both the fuzzing engine and the
8442    /// "test-engine" used to create fuzzer unit tests. For these reasons, it is
8443    /// most convenient for fuzzer authors to specify them as part of the
8444    /// (fuzzer-specific) target adapter's component manifest file, and have the
8445    /// engine and test-engine retrieve them via this method.
8446    ///
8447    /// - response `parameters` the command line parameters from a specific
8448    ///   fuzzer's component manifest.
8449    GetParameters { responder: TargetAdapterGetParametersResponder },
8450    /// Provides the eventpair used by driver and adapter to signal each other,
8451    /// and the shared VMO used to provide test inputs to the adapter. The VMO
8452    /// must have the `ZX_PROP_VMO_CONTENT_SIZE` property set.
8453    ///
8454    /// + request `eventpair` the eventpair used to signal when fuzzing runs
8455    ///   start and stop.
8456    /// + request `test_input` the shared VMO used by the engine to provide byte
8457    ///   sequences to test.
8458    Connect {
8459        eventpair: fidl::EventPair,
8460        test_input: fidl::Vmo,
8461        responder: TargetAdapterConnectResponder,
8462    },
8463}
8464
8465impl TargetAdapterRequest {
8466    #[allow(irrefutable_let_patterns)]
8467    pub fn into_get_parameters(self) -> Option<(TargetAdapterGetParametersResponder)> {
8468        if let TargetAdapterRequest::GetParameters { responder } = self {
8469            Some((responder))
8470        } else {
8471            None
8472        }
8473    }
8474
8475    #[allow(irrefutable_let_patterns)]
8476    pub fn into_connect(
8477        self,
8478    ) -> Option<(fidl::EventPair, fidl::Vmo, TargetAdapterConnectResponder)> {
8479        if let TargetAdapterRequest::Connect { eventpair, test_input, responder } = self {
8480            Some((eventpair, test_input, responder))
8481        } else {
8482            None
8483        }
8484    }
8485
8486    /// Name of the method defined in FIDL
8487    pub fn method_name(&self) -> &'static str {
8488        match *self {
8489            TargetAdapterRequest::GetParameters { .. } => "get_parameters",
8490            TargetAdapterRequest::Connect { .. } => "connect",
8491        }
8492    }
8493}
8494
8495#[derive(Debug, Clone)]
8496pub struct TargetAdapterControlHandle {
8497    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8498}
8499
8500impl TargetAdapterControlHandle {
8501    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
8502        self.inner.shutdown_with_epitaph(status.into())
8503    }
8504}
8505
8506impl fidl::endpoints::ControlHandle for TargetAdapterControlHandle {
8507    fn shutdown(&self) {
8508        self.inner.shutdown()
8509    }
8510
8511    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
8512        self.inner.shutdown_with_epitaph(status)
8513    }
8514
8515    fn is_closed(&self) -> bool {
8516        self.inner.channel().is_closed()
8517    }
8518    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8519        self.inner.channel().on_closed()
8520    }
8521
8522    #[cfg(target_os = "fuchsia")]
8523    fn signal_peer(
8524        &self,
8525        clear_mask: zx::Signals,
8526        set_mask: zx::Signals,
8527    ) -> Result<(), zx_status::Status> {
8528        use fidl::Peered;
8529        self.inner.channel().signal_peer(clear_mask, set_mask)
8530    }
8531}
8532
8533impl TargetAdapterControlHandle {}
8534
8535#[must_use = "FIDL methods require a response to be sent"]
8536#[derive(Debug)]
8537pub struct TargetAdapterGetParametersResponder {
8538    control_handle: std::mem::ManuallyDrop<TargetAdapterControlHandle>,
8539    tx_id: u32,
8540}
8541
8542/// Set the the channel to be shutdown (see [`TargetAdapterControlHandle::shutdown`])
8543/// if the responder is dropped without sending a response, so that the client
8544/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8545impl std::ops::Drop for TargetAdapterGetParametersResponder {
8546    fn drop(&mut self) {
8547        self.control_handle.shutdown();
8548        // Safety: drops once, never accessed again
8549        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8550    }
8551}
8552
8553impl fidl::endpoints::Responder for TargetAdapterGetParametersResponder {
8554    type ControlHandle = TargetAdapterControlHandle;
8555
8556    fn control_handle(&self) -> &TargetAdapterControlHandle {
8557        &self.control_handle
8558    }
8559
8560    fn drop_without_shutdown(mut self) {
8561        // Safety: drops once, never accessed again due to mem::forget
8562        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8563        // Prevent Drop from running (which would shut down the channel)
8564        std::mem::forget(self);
8565    }
8566}
8567
8568impl TargetAdapterGetParametersResponder {
8569    /// Sends a response to the FIDL transaction.
8570    ///
8571    /// Sets the channel to shutdown if an error occurs.
8572    pub fn send(self, mut parameters: &[String]) -> Result<(), fidl::Error> {
8573        let _result = self.send_raw(parameters);
8574        if _result.is_err() {
8575            self.control_handle.shutdown();
8576        }
8577        self.drop_without_shutdown();
8578        _result
8579    }
8580
8581    /// Similar to "send" but does not shutdown the channel if an error occurs.
8582    pub fn send_no_shutdown_on_err(self, mut parameters: &[String]) -> Result<(), fidl::Error> {
8583        let _result = self.send_raw(parameters);
8584        self.drop_without_shutdown();
8585        _result
8586    }
8587
8588    fn send_raw(&self, mut parameters: &[String]) -> Result<(), fidl::Error> {
8589        self.control_handle.inner.send::<TargetAdapterGetParametersResponse>(
8590            (parameters,),
8591            self.tx_id,
8592            0x5c7e40a47f753e3e,
8593            fidl::encoding::DynamicFlags::empty(),
8594        )
8595    }
8596}
8597
8598#[must_use = "FIDL methods require a response to be sent"]
8599#[derive(Debug)]
8600pub struct TargetAdapterConnectResponder {
8601    control_handle: std::mem::ManuallyDrop<TargetAdapterControlHandle>,
8602    tx_id: u32,
8603}
8604
8605/// Set the the channel to be shutdown (see [`TargetAdapterControlHandle::shutdown`])
8606/// if the responder is dropped without sending a response, so that the client
8607/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8608impl std::ops::Drop for TargetAdapterConnectResponder {
8609    fn drop(&mut self) {
8610        self.control_handle.shutdown();
8611        // Safety: drops once, never accessed again
8612        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8613    }
8614}
8615
8616impl fidl::endpoints::Responder for TargetAdapterConnectResponder {
8617    type ControlHandle = TargetAdapterControlHandle;
8618
8619    fn control_handle(&self) -> &TargetAdapterControlHandle {
8620        &self.control_handle
8621    }
8622
8623    fn drop_without_shutdown(mut self) {
8624        // Safety: drops once, never accessed again due to mem::forget
8625        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8626        // Prevent Drop from running (which would shut down the channel)
8627        std::mem::forget(self);
8628    }
8629}
8630
8631impl TargetAdapterConnectResponder {
8632    /// Sends a response to the FIDL transaction.
8633    ///
8634    /// Sets the channel to shutdown if an error occurs.
8635    pub fn send(self) -> Result<(), fidl::Error> {
8636        let _result = self.send_raw();
8637        if _result.is_err() {
8638            self.control_handle.shutdown();
8639        }
8640        self.drop_without_shutdown();
8641        _result
8642    }
8643
8644    /// Similar to "send" but does not shutdown the channel if an error occurs.
8645    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8646        let _result = self.send_raw();
8647        self.drop_without_shutdown();
8648        _result
8649    }
8650
8651    fn send_raw(&self) -> Result<(), fidl::Error> {
8652        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
8653            (),
8654            self.tx_id,
8655            0x7ea603a119866618,
8656            fidl::encoding::DynamicFlags::empty(),
8657        )
8658    }
8659}
8660
8661mod internal {
8662    use super::*;
8663
8664    impl fidl::encoding::ResourceTypeMarker for ControllerAddMonitorRequest {
8665        type Borrowed<'a> = &'a mut Self;
8666        fn take_or_borrow<'a>(
8667            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8668        ) -> Self::Borrowed<'a> {
8669            value
8670        }
8671    }
8672
8673    unsafe impl fidl::encoding::TypeMarker for ControllerAddMonitorRequest {
8674        type Owned = Self;
8675
8676        #[inline(always)]
8677        fn inline_align(_context: fidl::encoding::Context) -> usize {
8678            4
8679        }
8680
8681        #[inline(always)]
8682        fn inline_size(_context: fidl::encoding::Context) -> usize {
8683            4
8684        }
8685    }
8686
8687    unsafe impl
8688        fidl::encoding::Encode<
8689            ControllerAddMonitorRequest,
8690            fidl::encoding::DefaultFuchsiaResourceDialect,
8691        > for &mut ControllerAddMonitorRequest
8692    {
8693        #[inline]
8694        unsafe fn encode(
8695            self,
8696            encoder: &mut fidl::encoding::Encoder<
8697                '_,
8698                fidl::encoding::DefaultFuchsiaResourceDialect,
8699            >,
8700            offset: usize,
8701            _depth: fidl::encoding::Depth,
8702        ) -> fidl::Result<()> {
8703            encoder.debug_check_bounds::<ControllerAddMonitorRequest>(offset);
8704            // Delegate to tuple encoding.
8705            fidl::encoding::Encode::<ControllerAddMonitorRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8706                (
8707                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MonitorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.monitor),
8708                ),
8709                encoder, offset, _depth
8710            )
8711        }
8712    }
8713    unsafe impl<
8714        T0: fidl::encoding::Encode<
8715                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MonitorMarker>>,
8716                fidl::encoding::DefaultFuchsiaResourceDialect,
8717            >,
8718    >
8719        fidl::encoding::Encode<
8720            ControllerAddMonitorRequest,
8721            fidl::encoding::DefaultFuchsiaResourceDialect,
8722        > for (T0,)
8723    {
8724        #[inline]
8725        unsafe fn encode(
8726            self,
8727            encoder: &mut fidl::encoding::Encoder<
8728                '_,
8729                fidl::encoding::DefaultFuchsiaResourceDialect,
8730            >,
8731            offset: usize,
8732            depth: fidl::encoding::Depth,
8733        ) -> fidl::Result<()> {
8734            encoder.debug_check_bounds::<ControllerAddMonitorRequest>(offset);
8735            // Zero out padding regions. There's no need to apply masks
8736            // because the unmasked parts will be overwritten by fields.
8737            // Write the fields.
8738            self.0.encode(encoder, offset + 0, depth)?;
8739            Ok(())
8740        }
8741    }
8742
8743    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8744        for ControllerAddMonitorRequest
8745    {
8746        #[inline(always)]
8747        fn new_empty() -> Self {
8748            Self {
8749                monitor: fidl::new_empty!(
8750                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MonitorMarker>>,
8751                    fidl::encoding::DefaultFuchsiaResourceDialect
8752                ),
8753            }
8754        }
8755
8756        #[inline]
8757        unsafe fn decode(
8758            &mut self,
8759            decoder: &mut fidl::encoding::Decoder<
8760                '_,
8761                fidl::encoding::DefaultFuchsiaResourceDialect,
8762            >,
8763            offset: usize,
8764            _depth: fidl::encoding::Depth,
8765        ) -> fidl::Result<()> {
8766            decoder.debug_check_bounds::<Self>(offset);
8767            // Verify that padding bytes are zero.
8768            fidl::decode!(
8769                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MonitorMarker>>,
8770                fidl::encoding::DefaultFuchsiaResourceDialect,
8771                &mut self.monitor,
8772                decoder,
8773                offset + 0,
8774                _depth
8775            )?;
8776            Ok(())
8777        }
8778    }
8779
8780    impl fidl::encoding::ResourceTypeMarker for ControllerAddToCorpusRequest {
8781        type Borrowed<'a> = &'a mut Self;
8782        fn take_or_borrow<'a>(
8783            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8784        ) -> Self::Borrowed<'a> {
8785            value
8786        }
8787    }
8788
8789    unsafe impl fidl::encoding::TypeMarker for ControllerAddToCorpusRequest {
8790        type Owned = Self;
8791
8792        #[inline(always)]
8793        fn inline_align(_context: fidl::encoding::Context) -> usize {
8794            8
8795        }
8796
8797        #[inline(always)]
8798        fn inline_size(_context: fidl::encoding::Context) -> usize {
8799            24
8800        }
8801    }
8802
8803    unsafe impl
8804        fidl::encoding::Encode<
8805            ControllerAddToCorpusRequest,
8806            fidl::encoding::DefaultFuchsiaResourceDialect,
8807        > for &mut ControllerAddToCorpusRequest
8808    {
8809        #[inline]
8810        unsafe fn encode(
8811            self,
8812            encoder: &mut fidl::encoding::Encoder<
8813                '_,
8814                fidl::encoding::DefaultFuchsiaResourceDialect,
8815            >,
8816            offset: usize,
8817            _depth: fidl::encoding::Depth,
8818        ) -> fidl::Result<()> {
8819            encoder.debug_check_bounds::<ControllerAddToCorpusRequest>(offset);
8820            // Delegate to tuple encoding.
8821            fidl::encoding::Encode::<
8822                ControllerAddToCorpusRequest,
8823                fidl::encoding::DefaultFuchsiaResourceDialect,
8824            >::encode(
8825                (
8826                    <Corpus as fidl::encoding::ValueTypeMarker>::borrow(&self.corpus),
8827                    <Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.input),
8828                ),
8829                encoder,
8830                offset,
8831                _depth,
8832            )
8833        }
8834    }
8835    unsafe impl<
8836        T0: fidl::encoding::Encode<Corpus, fidl::encoding::DefaultFuchsiaResourceDialect>,
8837        T1: fidl::encoding::Encode<Input, fidl::encoding::DefaultFuchsiaResourceDialect>,
8838    >
8839        fidl::encoding::Encode<
8840            ControllerAddToCorpusRequest,
8841            fidl::encoding::DefaultFuchsiaResourceDialect,
8842        > for (T0, T1)
8843    {
8844        #[inline]
8845        unsafe fn encode(
8846            self,
8847            encoder: &mut fidl::encoding::Encoder<
8848                '_,
8849                fidl::encoding::DefaultFuchsiaResourceDialect,
8850            >,
8851            offset: usize,
8852            depth: fidl::encoding::Depth,
8853        ) -> fidl::Result<()> {
8854            encoder.debug_check_bounds::<ControllerAddToCorpusRequest>(offset);
8855            // Zero out padding regions. There's no need to apply masks
8856            // because the unmasked parts will be overwritten by fields.
8857            unsafe {
8858                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
8859                (ptr as *mut u64).write_unaligned(0);
8860            }
8861            // Write the fields.
8862            self.0.encode(encoder, offset + 0, depth)?;
8863            self.1.encode(encoder, offset + 8, depth)?;
8864            Ok(())
8865        }
8866    }
8867
8868    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8869        for ControllerAddToCorpusRequest
8870    {
8871        #[inline(always)]
8872        fn new_empty() -> Self {
8873            Self {
8874                corpus: fidl::new_empty!(Corpus, fidl::encoding::DefaultFuchsiaResourceDialect),
8875                input: fidl::new_empty!(Input, fidl::encoding::DefaultFuchsiaResourceDialect),
8876            }
8877        }
8878
8879        #[inline]
8880        unsafe fn decode(
8881            &mut self,
8882            decoder: &mut fidl::encoding::Decoder<
8883                '_,
8884                fidl::encoding::DefaultFuchsiaResourceDialect,
8885            >,
8886            offset: usize,
8887            _depth: fidl::encoding::Depth,
8888        ) -> fidl::Result<()> {
8889            decoder.debug_check_bounds::<Self>(offset);
8890            // Verify that padding bytes are zero.
8891            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
8892            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8893            let mask = 0xffffffffffffff00u64;
8894            let maskedval = padval & mask;
8895            if maskedval != 0 {
8896                return Err(fidl::Error::NonZeroPadding {
8897                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
8898                });
8899            }
8900            fidl::decode!(
8901                Corpus,
8902                fidl::encoding::DefaultFuchsiaResourceDialect,
8903                &mut self.corpus,
8904                decoder,
8905                offset + 0,
8906                _depth
8907            )?;
8908            fidl::decode!(
8909                Input,
8910                fidl::encoding::DefaultFuchsiaResourceDialect,
8911                &mut self.input,
8912                decoder,
8913                offset + 8,
8914                _depth
8915            )?;
8916            Ok(())
8917        }
8918    }
8919
8920    impl fidl::encoding::ResourceTypeMarker for ControllerCleanseRequest {
8921        type Borrowed<'a> = &'a mut Self;
8922        fn take_or_borrow<'a>(
8923            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8924        ) -> Self::Borrowed<'a> {
8925            value
8926        }
8927    }
8928
8929    unsafe impl fidl::encoding::TypeMarker for ControllerCleanseRequest {
8930        type Owned = Self;
8931
8932        #[inline(always)]
8933        fn inline_align(_context: fidl::encoding::Context) -> usize {
8934            8
8935        }
8936
8937        #[inline(always)]
8938        fn inline_size(_context: fidl::encoding::Context) -> usize {
8939            16
8940        }
8941    }
8942
8943    unsafe impl
8944        fidl::encoding::Encode<
8945            ControllerCleanseRequest,
8946            fidl::encoding::DefaultFuchsiaResourceDialect,
8947        > for &mut ControllerCleanseRequest
8948    {
8949        #[inline]
8950        unsafe fn encode(
8951            self,
8952            encoder: &mut fidl::encoding::Encoder<
8953                '_,
8954                fidl::encoding::DefaultFuchsiaResourceDialect,
8955            >,
8956            offset: usize,
8957            _depth: fidl::encoding::Depth,
8958        ) -> fidl::Result<()> {
8959            encoder.debug_check_bounds::<ControllerCleanseRequest>(offset);
8960            // Delegate to tuple encoding.
8961            fidl::encoding::Encode::<
8962                ControllerCleanseRequest,
8963                fidl::encoding::DefaultFuchsiaResourceDialect,
8964            >::encode(
8965                (<Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8966                    &mut self.test_input,
8967                ),),
8968                encoder,
8969                offset,
8970                _depth,
8971            )
8972        }
8973    }
8974    unsafe impl<T0: fidl::encoding::Encode<Input, fidl::encoding::DefaultFuchsiaResourceDialect>>
8975        fidl::encoding::Encode<
8976            ControllerCleanseRequest,
8977            fidl::encoding::DefaultFuchsiaResourceDialect,
8978        > for (T0,)
8979    {
8980        #[inline]
8981        unsafe fn encode(
8982            self,
8983            encoder: &mut fidl::encoding::Encoder<
8984                '_,
8985                fidl::encoding::DefaultFuchsiaResourceDialect,
8986            >,
8987            offset: usize,
8988            depth: fidl::encoding::Depth,
8989        ) -> fidl::Result<()> {
8990            encoder.debug_check_bounds::<ControllerCleanseRequest>(offset);
8991            // Zero out padding regions. There's no need to apply masks
8992            // because the unmasked parts will be overwritten by fields.
8993            // Write the fields.
8994            self.0.encode(encoder, offset + 0, depth)?;
8995            Ok(())
8996        }
8997    }
8998
8999    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9000        for ControllerCleanseRequest
9001    {
9002        #[inline(always)]
9003        fn new_empty() -> Self {
9004            Self {
9005                test_input: fidl::new_empty!(Input, fidl::encoding::DefaultFuchsiaResourceDialect),
9006            }
9007        }
9008
9009        #[inline]
9010        unsafe fn decode(
9011            &mut self,
9012            decoder: &mut fidl::encoding::Decoder<
9013                '_,
9014                fidl::encoding::DefaultFuchsiaResourceDialect,
9015            >,
9016            offset: usize,
9017            _depth: fidl::encoding::Depth,
9018        ) -> fidl::Result<()> {
9019            decoder.debug_check_bounds::<Self>(offset);
9020            // Verify that padding bytes are zero.
9021            fidl::decode!(
9022                Input,
9023                fidl::encoding::DefaultFuchsiaResourceDialect,
9024                &mut self.test_input,
9025                decoder,
9026                offset + 0,
9027                _depth
9028            )?;
9029            Ok(())
9030        }
9031    }
9032
9033    impl fidl::encoding::ResourceTypeMarker for ControllerMinimizeRequest {
9034        type Borrowed<'a> = &'a mut Self;
9035        fn take_or_borrow<'a>(
9036            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9037        ) -> Self::Borrowed<'a> {
9038            value
9039        }
9040    }
9041
9042    unsafe impl fidl::encoding::TypeMarker for ControllerMinimizeRequest {
9043        type Owned = Self;
9044
9045        #[inline(always)]
9046        fn inline_align(_context: fidl::encoding::Context) -> usize {
9047            8
9048        }
9049
9050        #[inline(always)]
9051        fn inline_size(_context: fidl::encoding::Context) -> usize {
9052            16
9053        }
9054    }
9055
9056    unsafe impl
9057        fidl::encoding::Encode<
9058            ControllerMinimizeRequest,
9059            fidl::encoding::DefaultFuchsiaResourceDialect,
9060        > for &mut ControllerMinimizeRequest
9061    {
9062        #[inline]
9063        unsafe fn encode(
9064            self,
9065            encoder: &mut fidl::encoding::Encoder<
9066                '_,
9067                fidl::encoding::DefaultFuchsiaResourceDialect,
9068            >,
9069            offset: usize,
9070            _depth: fidl::encoding::Depth,
9071        ) -> fidl::Result<()> {
9072            encoder.debug_check_bounds::<ControllerMinimizeRequest>(offset);
9073            // Delegate to tuple encoding.
9074            fidl::encoding::Encode::<
9075                ControllerMinimizeRequest,
9076                fidl::encoding::DefaultFuchsiaResourceDialect,
9077            >::encode(
9078                (<Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9079                    &mut self.test_input,
9080                ),),
9081                encoder,
9082                offset,
9083                _depth,
9084            )
9085        }
9086    }
9087    unsafe impl<T0: fidl::encoding::Encode<Input, fidl::encoding::DefaultFuchsiaResourceDialect>>
9088        fidl::encoding::Encode<
9089            ControllerMinimizeRequest,
9090            fidl::encoding::DefaultFuchsiaResourceDialect,
9091        > for (T0,)
9092    {
9093        #[inline]
9094        unsafe fn encode(
9095            self,
9096            encoder: &mut fidl::encoding::Encoder<
9097                '_,
9098                fidl::encoding::DefaultFuchsiaResourceDialect,
9099            >,
9100            offset: usize,
9101            depth: fidl::encoding::Depth,
9102        ) -> fidl::Result<()> {
9103            encoder.debug_check_bounds::<ControllerMinimizeRequest>(offset);
9104            // Zero out padding regions. There's no need to apply masks
9105            // because the unmasked parts will be overwritten by fields.
9106            // Write the fields.
9107            self.0.encode(encoder, offset + 0, depth)?;
9108            Ok(())
9109        }
9110    }
9111
9112    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9113        for ControllerMinimizeRequest
9114    {
9115        #[inline(always)]
9116        fn new_empty() -> Self {
9117            Self {
9118                test_input: fidl::new_empty!(Input, fidl::encoding::DefaultFuchsiaResourceDialect),
9119            }
9120        }
9121
9122        #[inline]
9123        unsafe fn decode(
9124            &mut self,
9125            decoder: &mut fidl::encoding::Decoder<
9126                '_,
9127                fidl::encoding::DefaultFuchsiaResourceDialect,
9128            >,
9129            offset: usize,
9130            _depth: fidl::encoding::Depth,
9131        ) -> fidl::Result<()> {
9132            decoder.debug_check_bounds::<Self>(offset);
9133            // Verify that padding bytes are zero.
9134            fidl::decode!(
9135                Input,
9136                fidl::encoding::DefaultFuchsiaResourceDialect,
9137                &mut self.test_input,
9138                decoder,
9139                offset + 0,
9140                _depth
9141            )?;
9142            Ok(())
9143        }
9144    }
9145
9146    impl fidl::encoding::ResourceTypeMarker for ControllerProviderConnectRequest {
9147        type Borrowed<'a> = &'a mut Self;
9148        fn take_or_borrow<'a>(
9149            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9150        ) -> Self::Borrowed<'a> {
9151            value
9152        }
9153    }
9154
9155    unsafe impl fidl::encoding::TypeMarker for ControllerProviderConnectRequest {
9156        type Owned = Self;
9157
9158        #[inline(always)]
9159        fn inline_align(_context: fidl::encoding::Context) -> usize {
9160            4
9161        }
9162
9163        #[inline(always)]
9164        fn inline_size(_context: fidl::encoding::Context) -> usize {
9165            4
9166        }
9167    }
9168
9169    unsafe impl
9170        fidl::encoding::Encode<
9171            ControllerProviderConnectRequest,
9172            fidl::encoding::DefaultFuchsiaResourceDialect,
9173        > for &mut ControllerProviderConnectRequest
9174    {
9175        #[inline]
9176        unsafe fn encode(
9177            self,
9178            encoder: &mut fidl::encoding::Encoder<
9179                '_,
9180                fidl::encoding::DefaultFuchsiaResourceDialect,
9181            >,
9182            offset: usize,
9183            _depth: fidl::encoding::Depth,
9184        ) -> fidl::Result<()> {
9185            encoder.debug_check_bounds::<ControllerProviderConnectRequest>(offset);
9186            // Delegate to tuple encoding.
9187            fidl::encoding::Encode::<ControllerProviderConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9188                (
9189                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
9190                ),
9191                encoder, offset, _depth
9192            )
9193        }
9194    }
9195    unsafe impl<
9196        T0: fidl::encoding::Encode<
9197                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
9198                fidl::encoding::DefaultFuchsiaResourceDialect,
9199            >,
9200    >
9201        fidl::encoding::Encode<
9202            ControllerProviderConnectRequest,
9203            fidl::encoding::DefaultFuchsiaResourceDialect,
9204        > for (T0,)
9205    {
9206        #[inline]
9207        unsafe fn encode(
9208            self,
9209            encoder: &mut fidl::encoding::Encoder<
9210                '_,
9211                fidl::encoding::DefaultFuchsiaResourceDialect,
9212            >,
9213            offset: usize,
9214            depth: fidl::encoding::Depth,
9215        ) -> fidl::Result<()> {
9216            encoder.debug_check_bounds::<ControllerProviderConnectRequest>(offset);
9217            // Zero out padding regions. There's no need to apply masks
9218            // because the unmasked parts will be overwritten by fields.
9219            // Write the fields.
9220            self.0.encode(encoder, offset + 0, depth)?;
9221            Ok(())
9222        }
9223    }
9224
9225    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9226        for ControllerProviderConnectRequest
9227    {
9228        #[inline(always)]
9229        fn new_empty() -> Self {
9230            Self {
9231                controller: fidl::new_empty!(
9232                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
9233                    fidl::encoding::DefaultFuchsiaResourceDialect
9234                ),
9235            }
9236        }
9237
9238        #[inline]
9239        unsafe fn decode(
9240            &mut self,
9241            decoder: &mut fidl::encoding::Decoder<
9242                '_,
9243                fidl::encoding::DefaultFuchsiaResourceDialect,
9244            >,
9245            offset: usize,
9246            _depth: fidl::encoding::Depth,
9247        ) -> fidl::Result<()> {
9248            decoder.debug_check_bounds::<Self>(offset);
9249            // Verify that padding bytes are zero.
9250            fidl::decode!(
9251                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
9252                fidl::encoding::DefaultFuchsiaResourceDialect,
9253                &mut self.controller,
9254                decoder,
9255                offset + 0,
9256                _depth
9257            )?;
9258            Ok(())
9259        }
9260    }
9261
9262    impl fidl::encoding::ResourceTypeMarker for ControllerReadCorpusRequest {
9263        type Borrowed<'a> = &'a mut Self;
9264        fn take_or_borrow<'a>(
9265            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9266        ) -> Self::Borrowed<'a> {
9267            value
9268        }
9269    }
9270
9271    unsafe impl fidl::encoding::TypeMarker for ControllerReadCorpusRequest {
9272        type Owned = Self;
9273
9274        #[inline(always)]
9275        fn inline_align(_context: fidl::encoding::Context) -> usize {
9276            4
9277        }
9278
9279        #[inline(always)]
9280        fn inline_size(_context: fidl::encoding::Context) -> usize {
9281            8
9282        }
9283    }
9284
9285    unsafe impl
9286        fidl::encoding::Encode<
9287            ControllerReadCorpusRequest,
9288            fidl::encoding::DefaultFuchsiaResourceDialect,
9289        > for &mut ControllerReadCorpusRequest
9290    {
9291        #[inline]
9292        unsafe fn encode(
9293            self,
9294            encoder: &mut fidl::encoding::Encoder<
9295                '_,
9296                fidl::encoding::DefaultFuchsiaResourceDialect,
9297            >,
9298            offset: usize,
9299            _depth: fidl::encoding::Depth,
9300        ) -> fidl::Result<()> {
9301            encoder.debug_check_bounds::<ControllerReadCorpusRequest>(offset);
9302            // Delegate to tuple encoding.
9303            fidl::encoding::Encode::<ControllerReadCorpusRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9304                (
9305                    <Corpus as fidl::encoding::ValueTypeMarker>::borrow(&self.corpus),
9306                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CorpusReaderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.corpus_reader),
9307                ),
9308                encoder, offset, _depth
9309            )
9310        }
9311    }
9312    unsafe impl<
9313        T0: fidl::encoding::Encode<Corpus, fidl::encoding::DefaultFuchsiaResourceDialect>,
9314        T1: fidl::encoding::Encode<
9315                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CorpusReaderMarker>>,
9316                fidl::encoding::DefaultFuchsiaResourceDialect,
9317            >,
9318    >
9319        fidl::encoding::Encode<
9320            ControllerReadCorpusRequest,
9321            fidl::encoding::DefaultFuchsiaResourceDialect,
9322        > for (T0, T1)
9323    {
9324        #[inline]
9325        unsafe fn encode(
9326            self,
9327            encoder: &mut fidl::encoding::Encoder<
9328                '_,
9329                fidl::encoding::DefaultFuchsiaResourceDialect,
9330            >,
9331            offset: usize,
9332            depth: fidl::encoding::Depth,
9333        ) -> fidl::Result<()> {
9334            encoder.debug_check_bounds::<ControllerReadCorpusRequest>(offset);
9335            // Zero out padding regions. There's no need to apply masks
9336            // because the unmasked parts will be overwritten by fields.
9337            unsafe {
9338                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9339                (ptr as *mut u32).write_unaligned(0);
9340            }
9341            // Write the fields.
9342            self.0.encode(encoder, offset + 0, depth)?;
9343            self.1.encode(encoder, offset + 4, depth)?;
9344            Ok(())
9345        }
9346    }
9347
9348    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9349        for ControllerReadCorpusRequest
9350    {
9351        #[inline(always)]
9352        fn new_empty() -> Self {
9353            Self {
9354                corpus: fidl::new_empty!(Corpus, fidl::encoding::DefaultFuchsiaResourceDialect),
9355                corpus_reader: fidl::new_empty!(
9356                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CorpusReaderMarker>>,
9357                    fidl::encoding::DefaultFuchsiaResourceDialect
9358                ),
9359            }
9360        }
9361
9362        #[inline]
9363        unsafe fn decode(
9364            &mut self,
9365            decoder: &mut fidl::encoding::Decoder<
9366                '_,
9367                fidl::encoding::DefaultFuchsiaResourceDialect,
9368            >,
9369            offset: usize,
9370            _depth: fidl::encoding::Depth,
9371        ) -> fidl::Result<()> {
9372            decoder.debug_check_bounds::<Self>(offset);
9373            // Verify that padding bytes are zero.
9374            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9375            let padval = unsafe { (ptr as *const u32).read_unaligned() };
9376            let mask = 0xffffff00u32;
9377            let maskedval = padval & mask;
9378            if maskedval != 0 {
9379                return Err(fidl::Error::NonZeroPadding {
9380                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9381                });
9382            }
9383            fidl::decode!(
9384                Corpus,
9385                fidl::encoding::DefaultFuchsiaResourceDialect,
9386                &mut self.corpus,
9387                decoder,
9388                offset + 0,
9389                _depth
9390            )?;
9391            fidl::decode!(
9392                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CorpusReaderMarker>>,
9393                fidl::encoding::DefaultFuchsiaResourceDialect,
9394                &mut self.corpus_reader,
9395                decoder,
9396                offset + 4,
9397                _depth
9398            )?;
9399            Ok(())
9400        }
9401    }
9402
9403    impl fidl::encoding::ResourceTypeMarker for ControllerReadDictionaryResponse {
9404        type Borrowed<'a> = &'a mut Self;
9405        fn take_or_borrow<'a>(
9406            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9407        ) -> Self::Borrowed<'a> {
9408            value
9409        }
9410    }
9411
9412    unsafe impl fidl::encoding::TypeMarker for ControllerReadDictionaryResponse {
9413        type Owned = Self;
9414
9415        #[inline(always)]
9416        fn inline_align(_context: fidl::encoding::Context) -> usize {
9417            8
9418        }
9419
9420        #[inline(always)]
9421        fn inline_size(_context: fidl::encoding::Context) -> usize {
9422            16
9423        }
9424    }
9425
9426    unsafe impl
9427        fidl::encoding::Encode<
9428            ControllerReadDictionaryResponse,
9429            fidl::encoding::DefaultFuchsiaResourceDialect,
9430        > for &mut ControllerReadDictionaryResponse
9431    {
9432        #[inline]
9433        unsafe fn encode(
9434            self,
9435            encoder: &mut fidl::encoding::Encoder<
9436                '_,
9437                fidl::encoding::DefaultFuchsiaResourceDialect,
9438            >,
9439            offset: usize,
9440            _depth: fidl::encoding::Depth,
9441        ) -> fidl::Result<()> {
9442            encoder.debug_check_bounds::<ControllerReadDictionaryResponse>(offset);
9443            // Delegate to tuple encoding.
9444            fidl::encoding::Encode::<
9445                ControllerReadDictionaryResponse,
9446                fidl::encoding::DefaultFuchsiaResourceDialect,
9447            >::encode(
9448                (<Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9449                    &mut self.dictionary,
9450                ),),
9451                encoder,
9452                offset,
9453                _depth,
9454            )
9455        }
9456    }
9457    unsafe impl<T0: fidl::encoding::Encode<Input, fidl::encoding::DefaultFuchsiaResourceDialect>>
9458        fidl::encoding::Encode<
9459            ControllerReadDictionaryResponse,
9460            fidl::encoding::DefaultFuchsiaResourceDialect,
9461        > for (T0,)
9462    {
9463        #[inline]
9464        unsafe fn encode(
9465            self,
9466            encoder: &mut fidl::encoding::Encoder<
9467                '_,
9468                fidl::encoding::DefaultFuchsiaResourceDialect,
9469            >,
9470            offset: usize,
9471            depth: fidl::encoding::Depth,
9472        ) -> fidl::Result<()> {
9473            encoder.debug_check_bounds::<ControllerReadDictionaryResponse>(offset);
9474            // Zero out padding regions. There's no need to apply masks
9475            // because the unmasked parts will be overwritten by fields.
9476            // Write the fields.
9477            self.0.encode(encoder, offset + 0, depth)?;
9478            Ok(())
9479        }
9480    }
9481
9482    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9483        for ControllerReadDictionaryResponse
9484    {
9485        #[inline(always)]
9486        fn new_empty() -> Self {
9487            Self {
9488                dictionary: fidl::new_empty!(Input, fidl::encoding::DefaultFuchsiaResourceDialect),
9489            }
9490        }
9491
9492        #[inline]
9493        unsafe fn decode(
9494            &mut self,
9495            decoder: &mut fidl::encoding::Decoder<
9496                '_,
9497                fidl::encoding::DefaultFuchsiaResourceDialect,
9498            >,
9499            offset: usize,
9500            _depth: fidl::encoding::Depth,
9501        ) -> fidl::Result<()> {
9502            decoder.debug_check_bounds::<Self>(offset);
9503            // Verify that padding bytes are zero.
9504            fidl::decode!(
9505                Input,
9506                fidl::encoding::DefaultFuchsiaResourceDialect,
9507                &mut self.dictionary,
9508                decoder,
9509                offset + 0,
9510                _depth
9511            )?;
9512            Ok(())
9513        }
9514    }
9515
9516    impl fidl::encoding::ResourceTypeMarker for ControllerTryOneRequest {
9517        type Borrowed<'a> = &'a mut Self;
9518        fn take_or_borrow<'a>(
9519            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9520        ) -> Self::Borrowed<'a> {
9521            value
9522        }
9523    }
9524
9525    unsafe impl fidl::encoding::TypeMarker for ControllerTryOneRequest {
9526        type Owned = Self;
9527
9528        #[inline(always)]
9529        fn inline_align(_context: fidl::encoding::Context) -> usize {
9530            8
9531        }
9532
9533        #[inline(always)]
9534        fn inline_size(_context: fidl::encoding::Context) -> usize {
9535            16
9536        }
9537    }
9538
9539    unsafe impl
9540        fidl::encoding::Encode<
9541            ControllerTryOneRequest,
9542            fidl::encoding::DefaultFuchsiaResourceDialect,
9543        > for &mut ControllerTryOneRequest
9544    {
9545        #[inline]
9546        unsafe fn encode(
9547            self,
9548            encoder: &mut fidl::encoding::Encoder<
9549                '_,
9550                fidl::encoding::DefaultFuchsiaResourceDialect,
9551            >,
9552            offset: usize,
9553            _depth: fidl::encoding::Depth,
9554        ) -> fidl::Result<()> {
9555            encoder.debug_check_bounds::<ControllerTryOneRequest>(offset);
9556            // Delegate to tuple encoding.
9557            fidl::encoding::Encode::<
9558                ControllerTryOneRequest,
9559                fidl::encoding::DefaultFuchsiaResourceDialect,
9560            >::encode(
9561                (<Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9562                    &mut self.test_input,
9563                ),),
9564                encoder,
9565                offset,
9566                _depth,
9567            )
9568        }
9569    }
9570    unsafe impl<T0: fidl::encoding::Encode<Input, fidl::encoding::DefaultFuchsiaResourceDialect>>
9571        fidl::encoding::Encode<
9572            ControllerTryOneRequest,
9573            fidl::encoding::DefaultFuchsiaResourceDialect,
9574        > for (T0,)
9575    {
9576        #[inline]
9577        unsafe fn encode(
9578            self,
9579            encoder: &mut fidl::encoding::Encoder<
9580                '_,
9581                fidl::encoding::DefaultFuchsiaResourceDialect,
9582            >,
9583            offset: usize,
9584            depth: fidl::encoding::Depth,
9585        ) -> fidl::Result<()> {
9586            encoder.debug_check_bounds::<ControllerTryOneRequest>(offset);
9587            // Zero out padding regions. There's no need to apply masks
9588            // because the unmasked parts will be overwritten by fields.
9589            // Write the fields.
9590            self.0.encode(encoder, offset + 0, depth)?;
9591            Ok(())
9592        }
9593    }
9594
9595    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9596        for ControllerTryOneRequest
9597    {
9598        #[inline(always)]
9599        fn new_empty() -> Self {
9600            Self {
9601                test_input: fidl::new_empty!(Input, fidl::encoding::DefaultFuchsiaResourceDialect),
9602            }
9603        }
9604
9605        #[inline]
9606        unsafe fn decode(
9607            &mut self,
9608            decoder: &mut fidl::encoding::Decoder<
9609                '_,
9610                fidl::encoding::DefaultFuchsiaResourceDialect,
9611            >,
9612            offset: usize,
9613            _depth: fidl::encoding::Depth,
9614        ) -> fidl::Result<()> {
9615            decoder.debug_check_bounds::<Self>(offset);
9616            // Verify that padding bytes are zero.
9617            fidl::decode!(
9618                Input,
9619                fidl::encoding::DefaultFuchsiaResourceDialect,
9620                &mut self.test_input,
9621                decoder,
9622                offset + 0,
9623                _depth
9624            )?;
9625            Ok(())
9626        }
9627    }
9628
9629    impl fidl::encoding::ResourceTypeMarker for ControllerWatchArtifactResponse {
9630        type Borrowed<'a> = &'a mut Self;
9631        fn take_or_borrow<'a>(
9632            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9633        ) -> Self::Borrowed<'a> {
9634            value
9635        }
9636    }
9637
9638    unsafe impl fidl::encoding::TypeMarker for ControllerWatchArtifactResponse {
9639        type Owned = Self;
9640
9641        #[inline(always)]
9642        fn inline_align(_context: fidl::encoding::Context) -> usize {
9643            8
9644        }
9645
9646        #[inline(always)]
9647        fn inline_size(_context: fidl::encoding::Context) -> usize {
9648            16
9649        }
9650    }
9651
9652    unsafe impl
9653        fidl::encoding::Encode<
9654            ControllerWatchArtifactResponse,
9655            fidl::encoding::DefaultFuchsiaResourceDialect,
9656        > for &mut ControllerWatchArtifactResponse
9657    {
9658        #[inline]
9659        unsafe fn encode(
9660            self,
9661            encoder: &mut fidl::encoding::Encoder<
9662                '_,
9663                fidl::encoding::DefaultFuchsiaResourceDialect,
9664            >,
9665            offset: usize,
9666            _depth: fidl::encoding::Depth,
9667        ) -> fidl::Result<()> {
9668            encoder.debug_check_bounds::<ControllerWatchArtifactResponse>(offset);
9669            // Delegate to tuple encoding.
9670            fidl::encoding::Encode::<
9671                ControllerWatchArtifactResponse,
9672                fidl::encoding::DefaultFuchsiaResourceDialect,
9673            >::encode(
9674                (<Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9675                    &mut self.artifact,
9676                ),),
9677                encoder,
9678                offset,
9679                _depth,
9680            )
9681        }
9682    }
9683    unsafe impl<T0: fidl::encoding::Encode<Artifact, fidl::encoding::DefaultFuchsiaResourceDialect>>
9684        fidl::encoding::Encode<
9685            ControllerWatchArtifactResponse,
9686            fidl::encoding::DefaultFuchsiaResourceDialect,
9687        > for (T0,)
9688    {
9689        #[inline]
9690        unsafe fn encode(
9691            self,
9692            encoder: &mut fidl::encoding::Encoder<
9693                '_,
9694                fidl::encoding::DefaultFuchsiaResourceDialect,
9695            >,
9696            offset: usize,
9697            depth: fidl::encoding::Depth,
9698        ) -> fidl::Result<()> {
9699            encoder.debug_check_bounds::<ControllerWatchArtifactResponse>(offset);
9700            // Zero out padding regions. There's no need to apply masks
9701            // because the unmasked parts will be overwritten by fields.
9702            // Write the fields.
9703            self.0.encode(encoder, offset + 0, depth)?;
9704            Ok(())
9705        }
9706    }
9707
9708    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9709        for ControllerWatchArtifactResponse
9710    {
9711        #[inline(always)]
9712        fn new_empty() -> Self {
9713            Self {
9714                artifact: fidl::new_empty!(Artifact, fidl::encoding::DefaultFuchsiaResourceDialect),
9715            }
9716        }
9717
9718        #[inline]
9719        unsafe fn decode(
9720            &mut self,
9721            decoder: &mut fidl::encoding::Decoder<
9722                '_,
9723                fidl::encoding::DefaultFuchsiaResourceDialect,
9724            >,
9725            offset: usize,
9726            _depth: fidl::encoding::Depth,
9727        ) -> fidl::Result<()> {
9728            decoder.debug_check_bounds::<Self>(offset);
9729            // Verify that padding bytes are zero.
9730            fidl::decode!(
9731                Artifact,
9732                fidl::encoding::DefaultFuchsiaResourceDialect,
9733                &mut self.artifact,
9734                decoder,
9735                offset + 0,
9736                _depth
9737            )?;
9738            Ok(())
9739        }
9740    }
9741
9742    impl fidl::encoding::ResourceTypeMarker for ControllerWriteDictionaryRequest {
9743        type Borrowed<'a> = &'a mut Self;
9744        fn take_or_borrow<'a>(
9745            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9746        ) -> Self::Borrowed<'a> {
9747            value
9748        }
9749    }
9750
9751    unsafe impl fidl::encoding::TypeMarker for ControllerWriteDictionaryRequest {
9752        type Owned = Self;
9753
9754        #[inline(always)]
9755        fn inline_align(_context: fidl::encoding::Context) -> usize {
9756            8
9757        }
9758
9759        #[inline(always)]
9760        fn inline_size(_context: fidl::encoding::Context) -> usize {
9761            16
9762        }
9763    }
9764
9765    unsafe impl
9766        fidl::encoding::Encode<
9767            ControllerWriteDictionaryRequest,
9768            fidl::encoding::DefaultFuchsiaResourceDialect,
9769        > for &mut ControllerWriteDictionaryRequest
9770    {
9771        #[inline]
9772        unsafe fn encode(
9773            self,
9774            encoder: &mut fidl::encoding::Encoder<
9775                '_,
9776                fidl::encoding::DefaultFuchsiaResourceDialect,
9777            >,
9778            offset: usize,
9779            _depth: fidl::encoding::Depth,
9780        ) -> fidl::Result<()> {
9781            encoder.debug_check_bounds::<ControllerWriteDictionaryRequest>(offset);
9782            // Delegate to tuple encoding.
9783            fidl::encoding::Encode::<
9784                ControllerWriteDictionaryRequest,
9785                fidl::encoding::DefaultFuchsiaResourceDialect,
9786            >::encode(
9787                (<Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9788                    &mut self.dictionary,
9789                ),),
9790                encoder,
9791                offset,
9792                _depth,
9793            )
9794        }
9795    }
9796    unsafe impl<T0: fidl::encoding::Encode<Input, fidl::encoding::DefaultFuchsiaResourceDialect>>
9797        fidl::encoding::Encode<
9798            ControllerWriteDictionaryRequest,
9799            fidl::encoding::DefaultFuchsiaResourceDialect,
9800        > for (T0,)
9801    {
9802        #[inline]
9803        unsafe fn encode(
9804            self,
9805            encoder: &mut fidl::encoding::Encoder<
9806                '_,
9807                fidl::encoding::DefaultFuchsiaResourceDialect,
9808            >,
9809            offset: usize,
9810            depth: fidl::encoding::Depth,
9811        ) -> fidl::Result<()> {
9812            encoder.debug_check_bounds::<ControllerWriteDictionaryRequest>(offset);
9813            // Zero out padding regions. There's no need to apply masks
9814            // because the unmasked parts will be overwritten by fields.
9815            // Write the fields.
9816            self.0.encode(encoder, offset + 0, depth)?;
9817            Ok(())
9818        }
9819    }
9820
9821    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9822        for ControllerWriteDictionaryRequest
9823    {
9824        #[inline(always)]
9825        fn new_empty() -> Self {
9826            Self {
9827                dictionary: fidl::new_empty!(Input, fidl::encoding::DefaultFuchsiaResourceDialect),
9828            }
9829        }
9830
9831        #[inline]
9832        unsafe fn decode(
9833            &mut self,
9834            decoder: &mut fidl::encoding::Decoder<
9835                '_,
9836                fidl::encoding::DefaultFuchsiaResourceDialect,
9837            >,
9838            offset: usize,
9839            _depth: fidl::encoding::Depth,
9840        ) -> fidl::Result<()> {
9841            decoder.debug_check_bounds::<Self>(offset);
9842            // Verify that padding bytes are zero.
9843            fidl::decode!(
9844                Input,
9845                fidl::encoding::DefaultFuchsiaResourceDialect,
9846                &mut self.dictionary,
9847                decoder,
9848                offset + 0,
9849                _depth
9850            )?;
9851            Ok(())
9852        }
9853    }
9854
9855    impl fidl::encoding::ResourceTypeMarker for CorpusReaderNextRequest {
9856        type Borrowed<'a> = &'a mut Self;
9857        fn take_or_borrow<'a>(
9858            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9859        ) -> Self::Borrowed<'a> {
9860            value
9861        }
9862    }
9863
9864    unsafe impl fidl::encoding::TypeMarker for CorpusReaderNextRequest {
9865        type Owned = Self;
9866
9867        #[inline(always)]
9868        fn inline_align(_context: fidl::encoding::Context) -> usize {
9869            8
9870        }
9871
9872        #[inline(always)]
9873        fn inline_size(_context: fidl::encoding::Context) -> usize {
9874            16
9875        }
9876    }
9877
9878    unsafe impl
9879        fidl::encoding::Encode<
9880            CorpusReaderNextRequest,
9881            fidl::encoding::DefaultFuchsiaResourceDialect,
9882        > for &mut CorpusReaderNextRequest
9883    {
9884        #[inline]
9885        unsafe fn encode(
9886            self,
9887            encoder: &mut fidl::encoding::Encoder<
9888                '_,
9889                fidl::encoding::DefaultFuchsiaResourceDialect,
9890            >,
9891            offset: usize,
9892            _depth: fidl::encoding::Depth,
9893        ) -> fidl::Result<()> {
9894            encoder.debug_check_bounds::<CorpusReaderNextRequest>(offset);
9895            // Delegate to tuple encoding.
9896            fidl::encoding::Encode::<
9897                CorpusReaderNextRequest,
9898                fidl::encoding::DefaultFuchsiaResourceDialect,
9899            >::encode(
9900                (<Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9901                    &mut self.test_input,
9902                ),),
9903                encoder,
9904                offset,
9905                _depth,
9906            )
9907        }
9908    }
9909    unsafe impl<T0: fidl::encoding::Encode<Input, fidl::encoding::DefaultFuchsiaResourceDialect>>
9910        fidl::encoding::Encode<
9911            CorpusReaderNextRequest,
9912            fidl::encoding::DefaultFuchsiaResourceDialect,
9913        > for (T0,)
9914    {
9915        #[inline]
9916        unsafe fn encode(
9917            self,
9918            encoder: &mut fidl::encoding::Encoder<
9919                '_,
9920                fidl::encoding::DefaultFuchsiaResourceDialect,
9921            >,
9922            offset: usize,
9923            depth: fidl::encoding::Depth,
9924        ) -> fidl::Result<()> {
9925            encoder.debug_check_bounds::<CorpusReaderNextRequest>(offset);
9926            // Zero out padding regions. There's no need to apply masks
9927            // because the unmasked parts will be overwritten by fields.
9928            // Write the fields.
9929            self.0.encode(encoder, offset + 0, depth)?;
9930            Ok(())
9931        }
9932    }
9933
9934    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9935        for CorpusReaderNextRequest
9936    {
9937        #[inline(always)]
9938        fn new_empty() -> Self {
9939            Self {
9940                test_input: fidl::new_empty!(Input, fidl::encoding::DefaultFuchsiaResourceDialect),
9941            }
9942        }
9943
9944        #[inline]
9945        unsafe fn decode(
9946            &mut self,
9947            decoder: &mut fidl::encoding::Decoder<
9948                '_,
9949                fidl::encoding::DefaultFuchsiaResourceDialect,
9950            >,
9951            offset: usize,
9952            _depth: fidl::encoding::Depth,
9953        ) -> fidl::Result<()> {
9954            decoder.debug_check_bounds::<Self>(offset);
9955            // Verify that padding bytes are zero.
9956            fidl::decode!(
9957                Input,
9958                fidl::encoding::DefaultFuchsiaResourceDialect,
9959                &mut self.test_input,
9960                decoder,
9961                offset + 0,
9962                _depth
9963            )?;
9964            Ok(())
9965        }
9966    }
9967
9968    impl fidl::encoding::ResourceTypeMarker for CoverageData {
9969        type Borrowed<'a> = &'a mut Self;
9970        fn take_or_borrow<'a>(
9971            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9972        ) -> Self::Borrowed<'a> {
9973            value
9974        }
9975    }
9976
9977    unsafe impl fidl::encoding::TypeMarker for CoverageData {
9978        type Owned = Self;
9979
9980        #[inline(always)]
9981        fn inline_align(_context: fidl::encoding::Context) -> usize {
9982            8
9983        }
9984
9985        #[inline(always)]
9986        fn inline_size(_context: fidl::encoding::Context) -> usize {
9987            24
9988        }
9989    }
9990
9991    unsafe impl fidl::encoding::Encode<CoverageData, fidl::encoding::DefaultFuchsiaResourceDialect>
9992        for &mut CoverageData
9993    {
9994        #[inline]
9995        unsafe fn encode(
9996            self,
9997            encoder: &mut fidl::encoding::Encoder<
9998                '_,
9999                fidl::encoding::DefaultFuchsiaResourceDialect,
10000            >,
10001            offset: usize,
10002            _depth: fidl::encoding::Depth,
10003        ) -> fidl::Result<()> {
10004            encoder.debug_check_bounds::<CoverageData>(offset);
10005            // Delegate to tuple encoding.
10006            fidl::encoding::Encode::<CoverageData, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10007                (
10008                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.target_id),
10009                    <Data as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data),
10010                ),
10011                encoder, offset, _depth
10012            )
10013        }
10014    }
10015    unsafe impl<
10016        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10017        T1: fidl::encoding::Encode<Data, fidl::encoding::DefaultFuchsiaResourceDialect>,
10018    > fidl::encoding::Encode<CoverageData, fidl::encoding::DefaultFuchsiaResourceDialect>
10019        for (T0, T1)
10020    {
10021        #[inline]
10022        unsafe fn encode(
10023            self,
10024            encoder: &mut fidl::encoding::Encoder<
10025                '_,
10026                fidl::encoding::DefaultFuchsiaResourceDialect,
10027            >,
10028            offset: usize,
10029            depth: fidl::encoding::Depth,
10030        ) -> fidl::Result<()> {
10031            encoder.debug_check_bounds::<CoverageData>(offset);
10032            // Zero out padding regions. There's no need to apply masks
10033            // because the unmasked parts will be overwritten by fields.
10034            // Write the fields.
10035            self.0.encode(encoder, offset + 0, depth)?;
10036            self.1.encode(encoder, offset + 8, depth)?;
10037            Ok(())
10038        }
10039    }
10040
10041    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for CoverageData {
10042        #[inline(always)]
10043        fn new_empty() -> Self {
10044            Self {
10045                target_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10046                data: fidl::new_empty!(Data, fidl::encoding::DefaultFuchsiaResourceDialect),
10047            }
10048        }
10049
10050        #[inline]
10051        unsafe fn decode(
10052            &mut self,
10053            decoder: &mut fidl::encoding::Decoder<
10054                '_,
10055                fidl::encoding::DefaultFuchsiaResourceDialect,
10056            >,
10057            offset: usize,
10058            _depth: fidl::encoding::Depth,
10059        ) -> fidl::Result<()> {
10060            decoder.debug_check_bounds::<Self>(offset);
10061            // Verify that padding bytes are zero.
10062            fidl::decode!(
10063                u64,
10064                fidl::encoding::DefaultFuchsiaResourceDialect,
10065                &mut self.target_id,
10066                decoder,
10067                offset + 0,
10068                _depth
10069            )?;
10070            fidl::decode!(
10071                Data,
10072                fidl::encoding::DefaultFuchsiaResourceDialect,
10073                &mut self.data,
10074                decoder,
10075                offset + 8,
10076                _depth
10077            )?;
10078            Ok(())
10079        }
10080    }
10081
10082    impl fidl::encoding::ResourceTypeMarker for CoverageDataCollectorAddInline8bitCountersRequest {
10083        type Borrowed<'a> = &'a mut Self;
10084        fn take_or_borrow<'a>(
10085            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10086        ) -> Self::Borrowed<'a> {
10087            value
10088        }
10089    }
10090
10091    unsafe impl fidl::encoding::TypeMarker for CoverageDataCollectorAddInline8bitCountersRequest {
10092        type Owned = Self;
10093
10094        #[inline(always)]
10095        fn inline_align(_context: fidl::encoding::Context) -> usize {
10096            4
10097        }
10098
10099        #[inline(always)]
10100        fn inline_size(_context: fidl::encoding::Context) -> usize {
10101            4
10102        }
10103    }
10104
10105    unsafe impl
10106        fidl::encoding::Encode<
10107            CoverageDataCollectorAddInline8bitCountersRequest,
10108            fidl::encoding::DefaultFuchsiaResourceDialect,
10109        > for &mut CoverageDataCollectorAddInline8bitCountersRequest
10110    {
10111        #[inline]
10112        unsafe fn encode(
10113            self,
10114            encoder: &mut fidl::encoding::Encoder<
10115                '_,
10116                fidl::encoding::DefaultFuchsiaResourceDialect,
10117            >,
10118            offset: usize,
10119            _depth: fidl::encoding::Depth,
10120        ) -> fidl::Result<()> {
10121            encoder.debug_check_bounds::<CoverageDataCollectorAddInline8bitCountersRequest>(offset);
10122            // Delegate to tuple encoding.
10123            fidl::encoding::Encode::<
10124                CoverageDataCollectorAddInline8bitCountersRequest,
10125                fidl::encoding::DefaultFuchsiaResourceDialect,
10126            >::encode(
10127                (<fidl::encoding::HandleType<
10128                    fidl::Vmo,
10129                    { fidl::ObjectType::VMO.into_raw() },
10130                    2147483648,
10131                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10132                    &mut self.inline_8bit_counters,
10133                ),),
10134                encoder,
10135                offset,
10136                _depth,
10137            )
10138        }
10139    }
10140    unsafe impl<
10141        T0: fidl::encoding::Encode<
10142                fidl::encoding::HandleType<
10143                    fidl::Vmo,
10144                    { fidl::ObjectType::VMO.into_raw() },
10145                    2147483648,
10146                >,
10147                fidl::encoding::DefaultFuchsiaResourceDialect,
10148            >,
10149    >
10150        fidl::encoding::Encode<
10151            CoverageDataCollectorAddInline8bitCountersRequest,
10152            fidl::encoding::DefaultFuchsiaResourceDialect,
10153        > for (T0,)
10154    {
10155        #[inline]
10156        unsafe fn encode(
10157            self,
10158            encoder: &mut fidl::encoding::Encoder<
10159                '_,
10160                fidl::encoding::DefaultFuchsiaResourceDialect,
10161            >,
10162            offset: usize,
10163            depth: fidl::encoding::Depth,
10164        ) -> fidl::Result<()> {
10165            encoder.debug_check_bounds::<CoverageDataCollectorAddInline8bitCountersRequest>(offset);
10166            // Zero out padding regions. There's no need to apply masks
10167            // because the unmasked parts will be overwritten by fields.
10168            // Write the fields.
10169            self.0.encode(encoder, offset + 0, depth)?;
10170            Ok(())
10171        }
10172    }
10173
10174    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10175        for CoverageDataCollectorAddInline8bitCountersRequest
10176    {
10177        #[inline(always)]
10178        fn new_empty() -> Self {
10179            Self {
10180                inline_8bit_counters: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10181            }
10182        }
10183
10184        #[inline]
10185        unsafe fn decode(
10186            &mut self,
10187            decoder: &mut fidl::encoding::Decoder<
10188                '_,
10189                fidl::encoding::DefaultFuchsiaResourceDialect,
10190            >,
10191            offset: usize,
10192            _depth: fidl::encoding::Depth,
10193        ) -> fidl::Result<()> {
10194            decoder.debug_check_bounds::<Self>(offset);
10195            // Verify that padding bytes are zero.
10196            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.inline_8bit_counters, decoder, offset + 0, _depth)?;
10197            Ok(())
10198        }
10199    }
10200
10201    impl fidl::encoding::ResourceTypeMarker for CoverageDataCollectorInitializeRequest {
10202        type Borrowed<'a> = &'a mut Self;
10203        fn take_or_borrow<'a>(
10204            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10205        ) -> Self::Borrowed<'a> {
10206            value
10207        }
10208    }
10209
10210    unsafe impl fidl::encoding::TypeMarker for CoverageDataCollectorInitializeRequest {
10211        type Owned = Self;
10212
10213        #[inline(always)]
10214        fn inline_align(_context: fidl::encoding::Context) -> usize {
10215            4
10216        }
10217
10218        #[inline(always)]
10219        fn inline_size(_context: fidl::encoding::Context) -> usize {
10220            8
10221        }
10222    }
10223
10224    unsafe impl
10225        fidl::encoding::Encode<
10226            CoverageDataCollectorInitializeRequest,
10227            fidl::encoding::DefaultFuchsiaResourceDialect,
10228        > for &mut CoverageDataCollectorInitializeRequest
10229    {
10230        #[inline]
10231        unsafe fn encode(
10232            self,
10233            encoder: &mut fidl::encoding::Encoder<
10234                '_,
10235                fidl::encoding::DefaultFuchsiaResourceDialect,
10236            >,
10237            offset: usize,
10238            _depth: fidl::encoding::Depth,
10239        ) -> fidl::Result<()> {
10240            encoder.debug_check_bounds::<CoverageDataCollectorInitializeRequest>(offset);
10241            // Delegate to tuple encoding.
10242            fidl::encoding::Encode::<
10243                CoverageDataCollectorInitializeRequest,
10244                fidl::encoding::DefaultFuchsiaResourceDialect,
10245            >::encode(
10246                (
10247                    <fidl::encoding::HandleType<
10248                        fidl::EventPair,
10249                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10250                        2147483648,
10251                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10252                        &mut self.eventpair
10253                    ),
10254                    <fidl::encoding::HandleType<
10255                        fidl::Process,
10256                        { fidl::ObjectType::PROCESS.into_raw() },
10257                        2147483648,
10258                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10259                        &mut self.process
10260                    ),
10261                ),
10262                encoder,
10263                offset,
10264                _depth,
10265            )
10266        }
10267    }
10268    unsafe impl<
10269        T0: fidl::encoding::Encode<
10270                fidl::encoding::HandleType<
10271                    fidl::EventPair,
10272                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10273                    2147483648,
10274                >,
10275                fidl::encoding::DefaultFuchsiaResourceDialect,
10276            >,
10277        T1: fidl::encoding::Encode<
10278                fidl::encoding::HandleType<
10279                    fidl::Process,
10280                    { fidl::ObjectType::PROCESS.into_raw() },
10281                    2147483648,
10282                >,
10283                fidl::encoding::DefaultFuchsiaResourceDialect,
10284            >,
10285    >
10286        fidl::encoding::Encode<
10287            CoverageDataCollectorInitializeRequest,
10288            fidl::encoding::DefaultFuchsiaResourceDialect,
10289        > for (T0, T1)
10290    {
10291        #[inline]
10292        unsafe fn encode(
10293            self,
10294            encoder: &mut fidl::encoding::Encoder<
10295                '_,
10296                fidl::encoding::DefaultFuchsiaResourceDialect,
10297            >,
10298            offset: usize,
10299            depth: fidl::encoding::Depth,
10300        ) -> fidl::Result<()> {
10301            encoder.debug_check_bounds::<CoverageDataCollectorInitializeRequest>(offset);
10302            // Zero out padding regions. There's no need to apply masks
10303            // because the unmasked parts will be overwritten by fields.
10304            // Write the fields.
10305            self.0.encode(encoder, offset + 0, depth)?;
10306            self.1.encode(encoder, offset + 4, depth)?;
10307            Ok(())
10308        }
10309    }
10310
10311    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10312        for CoverageDataCollectorInitializeRequest
10313    {
10314        #[inline(always)]
10315        fn new_empty() -> Self {
10316            Self {
10317                eventpair: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10318                process: fidl::new_empty!(fidl::encoding::HandleType<fidl::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10319            }
10320        }
10321
10322        #[inline]
10323        unsafe fn decode(
10324            &mut self,
10325            decoder: &mut fidl::encoding::Decoder<
10326                '_,
10327                fidl::encoding::DefaultFuchsiaResourceDialect,
10328            >,
10329            offset: usize,
10330            _depth: fidl::encoding::Depth,
10331        ) -> fidl::Result<()> {
10332            decoder.debug_check_bounds::<Self>(offset);
10333            // Verify that padding bytes are zero.
10334            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.eventpair, decoder, offset + 0, _depth)?;
10335            fidl::decode!(fidl::encoding::HandleType<fidl::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.process, decoder, offset + 4, _depth)?;
10336            Ok(())
10337        }
10338    }
10339
10340    impl fidl::encoding::ResourceTypeMarker for CoverageDataProviderWatchCoverageDataResponse {
10341        type Borrowed<'a> = &'a mut Self;
10342        fn take_or_borrow<'a>(
10343            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10344        ) -> Self::Borrowed<'a> {
10345            value
10346        }
10347    }
10348
10349    unsafe impl fidl::encoding::TypeMarker for CoverageDataProviderWatchCoverageDataResponse {
10350        type Owned = Self;
10351
10352        #[inline(always)]
10353        fn inline_align(_context: fidl::encoding::Context) -> usize {
10354            8
10355        }
10356
10357        #[inline(always)]
10358        fn inline_size(_context: fidl::encoding::Context) -> usize {
10359            16
10360        }
10361    }
10362
10363    unsafe impl
10364        fidl::encoding::Encode<
10365            CoverageDataProviderWatchCoverageDataResponse,
10366            fidl::encoding::DefaultFuchsiaResourceDialect,
10367        > for &mut CoverageDataProviderWatchCoverageDataResponse
10368    {
10369        #[inline]
10370        unsafe fn encode(
10371            self,
10372            encoder: &mut fidl::encoding::Encoder<
10373                '_,
10374                fidl::encoding::DefaultFuchsiaResourceDialect,
10375            >,
10376            offset: usize,
10377            _depth: fidl::encoding::Depth,
10378        ) -> fidl::Result<()> {
10379            encoder.debug_check_bounds::<CoverageDataProviderWatchCoverageDataResponse>(offset);
10380            // Delegate to tuple encoding.
10381            fidl::encoding::Encode::<CoverageDataProviderWatchCoverageDataResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10382                (
10383                    <fidl::encoding::Vector<CoverageData, 4096> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.coverage_data),
10384                ),
10385                encoder, offset, _depth
10386            )
10387        }
10388    }
10389    unsafe impl<
10390        T0: fidl::encoding::Encode<
10391                fidl::encoding::Vector<CoverageData, 4096>,
10392                fidl::encoding::DefaultFuchsiaResourceDialect,
10393            >,
10394    >
10395        fidl::encoding::Encode<
10396            CoverageDataProviderWatchCoverageDataResponse,
10397            fidl::encoding::DefaultFuchsiaResourceDialect,
10398        > for (T0,)
10399    {
10400        #[inline]
10401        unsafe fn encode(
10402            self,
10403            encoder: &mut fidl::encoding::Encoder<
10404                '_,
10405                fidl::encoding::DefaultFuchsiaResourceDialect,
10406            >,
10407            offset: usize,
10408            depth: fidl::encoding::Depth,
10409        ) -> fidl::Result<()> {
10410            encoder.debug_check_bounds::<CoverageDataProviderWatchCoverageDataResponse>(offset);
10411            // Zero out padding regions. There's no need to apply masks
10412            // because the unmasked parts will be overwritten by fields.
10413            // Write the fields.
10414            self.0.encode(encoder, offset + 0, depth)?;
10415            Ok(())
10416        }
10417    }
10418
10419    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10420        for CoverageDataProviderWatchCoverageDataResponse
10421    {
10422        #[inline(always)]
10423        fn new_empty() -> Self {
10424            Self {
10425                coverage_data: fidl::new_empty!(fidl::encoding::Vector<CoverageData, 4096>, fidl::encoding::DefaultFuchsiaResourceDialect),
10426            }
10427        }
10428
10429        #[inline]
10430        unsafe fn decode(
10431            &mut self,
10432            decoder: &mut fidl::encoding::Decoder<
10433                '_,
10434                fidl::encoding::DefaultFuchsiaResourceDialect,
10435            >,
10436            offset: usize,
10437            _depth: fidl::encoding::Depth,
10438        ) -> fidl::Result<()> {
10439            decoder.debug_check_bounds::<Self>(offset);
10440            // Verify that padding bytes are zero.
10441            fidl::decode!(fidl::encoding::Vector<CoverageData, 4096>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.coverage_data, decoder, offset + 0, _depth)?;
10442            Ok(())
10443        }
10444    }
10445
10446    impl fidl::encoding::ResourceTypeMarker for Input {
10447        type Borrowed<'a> = &'a mut Self;
10448        fn take_or_borrow<'a>(
10449            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10450        ) -> Self::Borrowed<'a> {
10451            value
10452        }
10453    }
10454
10455    unsafe impl fidl::encoding::TypeMarker for Input {
10456        type Owned = Self;
10457
10458        #[inline(always)]
10459        fn inline_align(_context: fidl::encoding::Context) -> usize {
10460            8
10461        }
10462
10463        #[inline(always)]
10464        fn inline_size(_context: fidl::encoding::Context) -> usize {
10465            16
10466        }
10467    }
10468
10469    unsafe impl fidl::encoding::Encode<Input, fidl::encoding::DefaultFuchsiaResourceDialect>
10470        for &mut Input
10471    {
10472        #[inline]
10473        unsafe fn encode(
10474            self,
10475            encoder: &mut fidl::encoding::Encoder<
10476                '_,
10477                fidl::encoding::DefaultFuchsiaResourceDialect,
10478            >,
10479            offset: usize,
10480            _depth: fidl::encoding::Depth,
10481        ) -> fidl::Result<()> {
10482            encoder.debug_check_bounds::<Input>(offset);
10483            // Delegate to tuple encoding.
10484            fidl::encoding::Encode::<Input, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10485                (
10486                    <fidl::encoding::HandleType<
10487                        fidl::Socket,
10488                        { fidl::ObjectType::SOCKET.into_raw() },
10489                        2147483648,
10490                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10491                        &mut self.socket
10492                    ),
10493                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.size),
10494                ),
10495                encoder,
10496                offset,
10497                _depth,
10498            )
10499        }
10500    }
10501    unsafe impl<
10502        T0: fidl::encoding::Encode<
10503                fidl::encoding::HandleType<
10504                    fidl::Socket,
10505                    { fidl::ObjectType::SOCKET.into_raw() },
10506                    2147483648,
10507                >,
10508                fidl::encoding::DefaultFuchsiaResourceDialect,
10509            >,
10510        T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10511    > fidl::encoding::Encode<Input, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0, T1)
10512    {
10513        #[inline]
10514        unsafe fn encode(
10515            self,
10516            encoder: &mut fidl::encoding::Encoder<
10517                '_,
10518                fidl::encoding::DefaultFuchsiaResourceDialect,
10519            >,
10520            offset: usize,
10521            depth: fidl::encoding::Depth,
10522        ) -> fidl::Result<()> {
10523            encoder.debug_check_bounds::<Input>(offset);
10524            // Zero out padding regions. There's no need to apply masks
10525            // because the unmasked parts will be overwritten by fields.
10526            unsafe {
10527                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10528                (ptr as *mut u64).write_unaligned(0);
10529            }
10530            // Write the fields.
10531            self.0.encode(encoder, offset + 0, depth)?;
10532            self.1.encode(encoder, offset + 8, depth)?;
10533            Ok(())
10534        }
10535    }
10536
10537    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Input {
10538        #[inline(always)]
10539        fn new_empty() -> Self {
10540            Self {
10541                socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10542                size: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10543            }
10544        }
10545
10546        #[inline]
10547        unsafe fn decode(
10548            &mut self,
10549            decoder: &mut fidl::encoding::Decoder<
10550                '_,
10551                fidl::encoding::DefaultFuchsiaResourceDialect,
10552            >,
10553            offset: usize,
10554            _depth: fidl::encoding::Depth,
10555        ) -> fidl::Result<()> {
10556            decoder.debug_check_bounds::<Self>(offset);
10557            // Verify that padding bytes are zero.
10558            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10559            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10560            let mask = 0xffffffff00000000u64;
10561            let maskedval = padval & mask;
10562            if maskedval != 0 {
10563                return Err(fidl::Error::NonZeroPadding {
10564                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10565                });
10566            }
10567            fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
10568            fidl::decode!(
10569                u64,
10570                fidl::encoding::DefaultFuchsiaResourceDialect,
10571                &mut self.size,
10572                decoder,
10573                offset + 8,
10574                _depth
10575            )?;
10576            Ok(())
10577        }
10578    }
10579
10580    impl fidl::encoding::ResourceTypeMarker for InstrumentedProcess {
10581        type Borrowed<'a> = &'a mut Self;
10582        fn take_or_borrow<'a>(
10583            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10584        ) -> Self::Borrowed<'a> {
10585            value
10586        }
10587    }
10588
10589    unsafe impl fidl::encoding::TypeMarker for InstrumentedProcess {
10590        type Owned = Self;
10591
10592        #[inline(always)]
10593        fn inline_align(_context: fidl::encoding::Context) -> usize {
10594            4
10595        }
10596
10597        #[inline(always)]
10598        fn inline_size(_context: fidl::encoding::Context) -> usize {
10599            8
10600        }
10601    }
10602
10603    unsafe impl
10604        fidl::encoding::Encode<InstrumentedProcess, fidl::encoding::DefaultFuchsiaResourceDialect>
10605        for &mut InstrumentedProcess
10606    {
10607        #[inline]
10608        unsafe fn encode(
10609            self,
10610            encoder: &mut fidl::encoding::Encoder<
10611                '_,
10612                fidl::encoding::DefaultFuchsiaResourceDialect,
10613            >,
10614            offset: usize,
10615            _depth: fidl::encoding::Depth,
10616        ) -> fidl::Result<()> {
10617            encoder.debug_check_bounds::<InstrumentedProcess>(offset);
10618            // Delegate to tuple encoding.
10619            fidl::encoding::Encode::<
10620                InstrumentedProcess,
10621                fidl::encoding::DefaultFuchsiaResourceDialect,
10622            >::encode(
10623                (
10624                    <fidl::encoding::HandleType<
10625                        fidl::EventPair,
10626                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10627                        2147483648,
10628                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10629                        &mut self.eventpair
10630                    ),
10631                    <fidl::encoding::HandleType<
10632                        fidl::Process,
10633                        { fidl::ObjectType::PROCESS.into_raw() },
10634                        2147483648,
10635                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10636                        &mut self.process
10637                    ),
10638                ),
10639                encoder,
10640                offset,
10641                _depth,
10642            )
10643        }
10644    }
10645    unsafe impl<
10646        T0: fidl::encoding::Encode<
10647                fidl::encoding::HandleType<
10648                    fidl::EventPair,
10649                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10650                    2147483648,
10651                >,
10652                fidl::encoding::DefaultFuchsiaResourceDialect,
10653            >,
10654        T1: fidl::encoding::Encode<
10655                fidl::encoding::HandleType<
10656                    fidl::Process,
10657                    { fidl::ObjectType::PROCESS.into_raw() },
10658                    2147483648,
10659                >,
10660                fidl::encoding::DefaultFuchsiaResourceDialect,
10661            >,
10662    > fidl::encoding::Encode<InstrumentedProcess, fidl::encoding::DefaultFuchsiaResourceDialect>
10663        for (T0, T1)
10664    {
10665        #[inline]
10666        unsafe fn encode(
10667            self,
10668            encoder: &mut fidl::encoding::Encoder<
10669                '_,
10670                fidl::encoding::DefaultFuchsiaResourceDialect,
10671            >,
10672            offset: usize,
10673            depth: fidl::encoding::Depth,
10674        ) -> fidl::Result<()> {
10675            encoder.debug_check_bounds::<InstrumentedProcess>(offset);
10676            // Zero out padding regions. There's no need to apply masks
10677            // because the unmasked parts will be overwritten by fields.
10678            // Write the fields.
10679            self.0.encode(encoder, offset + 0, depth)?;
10680            self.1.encode(encoder, offset + 4, depth)?;
10681            Ok(())
10682        }
10683    }
10684
10685    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10686        for InstrumentedProcess
10687    {
10688        #[inline(always)]
10689        fn new_empty() -> Self {
10690            Self {
10691                eventpair: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10692                process: fidl::new_empty!(fidl::encoding::HandleType<fidl::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10693            }
10694        }
10695
10696        #[inline]
10697        unsafe fn decode(
10698            &mut self,
10699            decoder: &mut fidl::encoding::Decoder<
10700                '_,
10701                fidl::encoding::DefaultFuchsiaResourceDialect,
10702            >,
10703            offset: usize,
10704            _depth: fidl::encoding::Depth,
10705        ) -> fidl::Result<()> {
10706            decoder.debug_check_bounds::<Self>(offset);
10707            // Verify that padding bytes are zero.
10708            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.eventpair, decoder, offset + 0, _depth)?;
10709            fidl::decode!(fidl::encoding::HandleType<fidl::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.process, decoder, offset + 4, _depth)?;
10710            Ok(())
10711        }
10712    }
10713
10714    impl fidl::encoding::ResourceTypeMarker for ManagerConnectRequest {
10715        type Borrowed<'a> = &'a mut Self;
10716        fn take_or_borrow<'a>(
10717            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10718        ) -> Self::Borrowed<'a> {
10719            value
10720        }
10721    }
10722
10723    unsafe impl fidl::encoding::TypeMarker for ManagerConnectRequest {
10724        type Owned = Self;
10725
10726        #[inline(always)]
10727        fn inline_align(_context: fidl::encoding::Context) -> usize {
10728            8
10729        }
10730
10731        #[inline(always)]
10732        fn inline_size(_context: fidl::encoding::Context) -> usize {
10733            24
10734        }
10735    }
10736
10737    unsafe impl
10738        fidl::encoding::Encode<ManagerConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
10739        for &mut ManagerConnectRequest
10740    {
10741        #[inline]
10742        unsafe fn encode(
10743            self,
10744            encoder: &mut fidl::encoding::Encoder<
10745                '_,
10746                fidl::encoding::DefaultFuchsiaResourceDialect,
10747            >,
10748            offset: usize,
10749            _depth: fidl::encoding::Depth,
10750        ) -> fidl::Result<()> {
10751            encoder.debug_check_bounds::<ManagerConnectRequest>(offset);
10752            // Delegate to tuple encoding.
10753            fidl::encoding::Encode::<ManagerConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10754                (
10755                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.fuzzer_url),
10756                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
10757                ),
10758                encoder, offset, _depth
10759            )
10760        }
10761    }
10762    unsafe impl<
10763        T0: fidl::encoding::Encode<
10764                fidl::encoding::BoundedString<4096>,
10765                fidl::encoding::DefaultFuchsiaResourceDialect,
10766            >,
10767        T1: fidl::encoding::Encode<
10768                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
10769                fidl::encoding::DefaultFuchsiaResourceDialect,
10770            >,
10771    >
10772        fidl::encoding::Encode<ManagerConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
10773        for (T0, T1)
10774    {
10775        #[inline]
10776        unsafe fn encode(
10777            self,
10778            encoder: &mut fidl::encoding::Encoder<
10779                '_,
10780                fidl::encoding::DefaultFuchsiaResourceDialect,
10781            >,
10782            offset: usize,
10783            depth: fidl::encoding::Depth,
10784        ) -> fidl::Result<()> {
10785            encoder.debug_check_bounds::<ManagerConnectRequest>(offset);
10786            // Zero out padding regions. There's no need to apply masks
10787            // because the unmasked parts will be overwritten by fields.
10788            unsafe {
10789                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
10790                (ptr as *mut u64).write_unaligned(0);
10791            }
10792            // Write the fields.
10793            self.0.encode(encoder, offset + 0, depth)?;
10794            self.1.encode(encoder, offset + 16, depth)?;
10795            Ok(())
10796        }
10797    }
10798
10799    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10800        for ManagerConnectRequest
10801    {
10802        #[inline(always)]
10803        fn new_empty() -> Self {
10804            Self {
10805                fuzzer_url: fidl::new_empty!(
10806                    fidl::encoding::BoundedString<4096>,
10807                    fidl::encoding::DefaultFuchsiaResourceDialect
10808                ),
10809                controller: fidl::new_empty!(
10810                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
10811                    fidl::encoding::DefaultFuchsiaResourceDialect
10812                ),
10813            }
10814        }
10815
10816        #[inline]
10817        unsafe fn decode(
10818            &mut self,
10819            decoder: &mut fidl::encoding::Decoder<
10820                '_,
10821                fidl::encoding::DefaultFuchsiaResourceDialect,
10822            >,
10823            offset: usize,
10824            _depth: fidl::encoding::Depth,
10825        ) -> fidl::Result<()> {
10826            decoder.debug_check_bounds::<Self>(offset);
10827            // Verify that padding bytes are zero.
10828            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
10829            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10830            let mask = 0xffffffff00000000u64;
10831            let maskedval = padval & mask;
10832            if maskedval != 0 {
10833                return Err(fidl::Error::NonZeroPadding {
10834                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
10835                });
10836            }
10837            fidl::decode!(
10838                fidl::encoding::BoundedString<4096>,
10839                fidl::encoding::DefaultFuchsiaResourceDialect,
10840                &mut self.fuzzer_url,
10841                decoder,
10842                offset + 0,
10843                _depth
10844            )?;
10845            fidl::decode!(
10846                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
10847                fidl::encoding::DefaultFuchsiaResourceDialect,
10848                &mut self.controller,
10849                decoder,
10850                offset + 16,
10851                _depth
10852            )?;
10853            Ok(())
10854        }
10855    }
10856
10857    impl fidl::encoding::ResourceTypeMarker for ManagerGetOutputRequest {
10858        type Borrowed<'a> = &'a mut Self;
10859        fn take_or_borrow<'a>(
10860            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10861        ) -> Self::Borrowed<'a> {
10862            value
10863        }
10864    }
10865
10866    unsafe impl fidl::encoding::TypeMarker for ManagerGetOutputRequest {
10867        type Owned = Self;
10868
10869        #[inline(always)]
10870        fn inline_align(_context: fidl::encoding::Context) -> usize {
10871            8
10872        }
10873
10874        #[inline(always)]
10875        fn inline_size(_context: fidl::encoding::Context) -> usize {
10876            24
10877        }
10878    }
10879
10880    unsafe impl
10881        fidl::encoding::Encode<
10882            ManagerGetOutputRequest,
10883            fidl::encoding::DefaultFuchsiaResourceDialect,
10884        > for &mut ManagerGetOutputRequest
10885    {
10886        #[inline]
10887        unsafe fn encode(
10888            self,
10889            encoder: &mut fidl::encoding::Encoder<
10890                '_,
10891                fidl::encoding::DefaultFuchsiaResourceDialect,
10892            >,
10893            offset: usize,
10894            _depth: fidl::encoding::Depth,
10895        ) -> fidl::Result<()> {
10896            encoder.debug_check_bounds::<ManagerGetOutputRequest>(offset);
10897            // Delegate to tuple encoding.
10898            fidl::encoding::Encode::<ManagerGetOutputRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10899                (
10900                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.fuzzer_url),
10901                    <TestOutput as fidl::encoding::ValueTypeMarker>::borrow(&self.output),
10902                    <fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.socket),
10903                ),
10904                encoder, offset, _depth
10905            )
10906        }
10907    }
10908    unsafe impl<
10909        T0: fidl::encoding::Encode<
10910                fidl::encoding::BoundedString<4096>,
10911                fidl::encoding::DefaultFuchsiaResourceDialect,
10912            >,
10913        T1: fidl::encoding::Encode<TestOutput, fidl::encoding::DefaultFuchsiaResourceDialect>,
10914        T2: fidl::encoding::Encode<
10915                fidl::encoding::HandleType<
10916                    fidl::Socket,
10917                    { fidl::ObjectType::SOCKET.into_raw() },
10918                    2147483648,
10919                >,
10920                fidl::encoding::DefaultFuchsiaResourceDialect,
10921            >,
10922    >
10923        fidl::encoding::Encode<
10924            ManagerGetOutputRequest,
10925            fidl::encoding::DefaultFuchsiaResourceDialect,
10926        > for (T0, T1, T2)
10927    {
10928        #[inline]
10929        unsafe fn encode(
10930            self,
10931            encoder: &mut fidl::encoding::Encoder<
10932                '_,
10933                fidl::encoding::DefaultFuchsiaResourceDialect,
10934            >,
10935            offset: usize,
10936            depth: fidl::encoding::Depth,
10937        ) -> fidl::Result<()> {
10938            encoder.debug_check_bounds::<ManagerGetOutputRequest>(offset);
10939            // Zero out padding regions. There's no need to apply masks
10940            // because the unmasked parts will be overwritten by fields.
10941            // Write the fields.
10942            self.0.encode(encoder, offset + 0, depth)?;
10943            self.1.encode(encoder, offset + 16, depth)?;
10944            self.2.encode(encoder, offset + 20, depth)?;
10945            Ok(())
10946        }
10947    }
10948
10949    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10950        for ManagerGetOutputRequest
10951    {
10952        #[inline(always)]
10953        fn new_empty() -> Self {
10954            Self {
10955                fuzzer_url: fidl::new_empty!(
10956                    fidl::encoding::BoundedString<4096>,
10957                    fidl::encoding::DefaultFuchsiaResourceDialect
10958                ),
10959                output: fidl::new_empty!(TestOutput, fidl::encoding::DefaultFuchsiaResourceDialect),
10960                socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10961            }
10962        }
10963
10964        #[inline]
10965        unsafe fn decode(
10966            &mut self,
10967            decoder: &mut fidl::encoding::Decoder<
10968                '_,
10969                fidl::encoding::DefaultFuchsiaResourceDialect,
10970            >,
10971            offset: usize,
10972            _depth: fidl::encoding::Depth,
10973        ) -> fidl::Result<()> {
10974            decoder.debug_check_bounds::<Self>(offset);
10975            // Verify that padding bytes are zero.
10976            fidl::decode!(
10977                fidl::encoding::BoundedString<4096>,
10978                fidl::encoding::DefaultFuchsiaResourceDialect,
10979                &mut self.fuzzer_url,
10980                decoder,
10981                offset + 0,
10982                _depth
10983            )?;
10984            fidl::decode!(
10985                TestOutput,
10986                fidl::encoding::DefaultFuchsiaResourceDialect,
10987                &mut self.output,
10988                decoder,
10989                offset + 16,
10990                _depth
10991            )?;
10992            fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 20, _depth)?;
10993            Ok(())
10994        }
10995    }
10996
10997    impl fidl::encoding::ResourceTypeMarker for RegistrarRegisterRequest {
10998        type Borrowed<'a> = &'a mut Self;
10999        fn take_or_borrow<'a>(
11000            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11001        ) -> Self::Borrowed<'a> {
11002            value
11003        }
11004    }
11005
11006    unsafe impl fidl::encoding::TypeMarker for RegistrarRegisterRequest {
11007        type Owned = Self;
11008
11009        #[inline(always)]
11010        fn inline_align(_context: fidl::encoding::Context) -> usize {
11011            8
11012        }
11013
11014        #[inline(always)]
11015        fn inline_size(_context: fidl::encoding::Context) -> usize {
11016            24
11017        }
11018    }
11019
11020    unsafe impl
11021        fidl::encoding::Encode<
11022            RegistrarRegisterRequest,
11023            fidl::encoding::DefaultFuchsiaResourceDialect,
11024        > for &mut RegistrarRegisterRequest
11025    {
11026        #[inline]
11027        unsafe fn encode(
11028            self,
11029            encoder: &mut fidl::encoding::Encoder<
11030                '_,
11031                fidl::encoding::DefaultFuchsiaResourceDialect,
11032            >,
11033            offset: usize,
11034            _depth: fidl::encoding::Depth,
11035        ) -> fidl::Result<()> {
11036            encoder.debug_check_bounds::<RegistrarRegisterRequest>(offset);
11037            // Delegate to tuple encoding.
11038            fidl::encoding::Encode::<RegistrarRegisterRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11039                (
11040                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.fuzzer_url),
11041                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ControllerProviderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.provider),
11042                ),
11043                encoder, offset, _depth
11044            )
11045        }
11046    }
11047    unsafe impl<
11048        T0: fidl::encoding::Encode<
11049                fidl::encoding::BoundedString<4096>,
11050                fidl::encoding::DefaultFuchsiaResourceDialect,
11051            >,
11052        T1: fidl::encoding::Encode<
11053                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ControllerProviderMarker>>,
11054                fidl::encoding::DefaultFuchsiaResourceDialect,
11055            >,
11056    >
11057        fidl::encoding::Encode<
11058            RegistrarRegisterRequest,
11059            fidl::encoding::DefaultFuchsiaResourceDialect,
11060        > for (T0, T1)
11061    {
11062        #[inline]
11063        unsafe fn encode(
11064            self,
11065            encoder: &mut fidl::encoding::Encoder<
11066                '_,
11067                fidl::encoding::DefaultFuchsiaResourceDialect,
11068            >,
11069            offset: usize,
11070            depth: fidl::encoding::Depth,
11071        ) -> fidl::Result<()> {
11072            encoder.debug_check_bounds::<RegistrarRegisterRequest>(offset);
11073            // Zero out padding regions. There's no need to apply masks
11074            // because the unmasked parts will be overwritten by fields.
11075            unsafe {
11076                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
11077                (ptr as *mut u64).write_unaligned(0);
11078            }
11079            // Write the fields.
11080            self.0.encode(encoder, offset + 0, depth)?;
11081            self.1.encode(encoder, offset + 16, depth)?;
11082            Ok(())
11083        }
11084    }
11085
11086    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11087        for RegistrarRegisterRequest
11088    {
11089        #[inline(always)]
11090        fn new_empty() -> Self {
11091            Self {
11092                fuzzer_url: fidl::new_empty!(
11093                    fidl::encoding::BoundedString<4096>,
11094                    fidl::encoding::DefaultFuchsiaResourceDialect
11095                ),
11096                provider: fidl::new_empty!(
11097                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ControllerProviderMarker>>,
11098                    fidl::encoding::DefaultFuchsiaResourceDialect
11099                ),
11100            }
11101        }
11102
11103        #[inline]
11104        unsafe fn decode(
11105            &mut self,
11106            decoder: &mut fidl::encoding::Decoder<
11107                '_,
11108                fidl::encoding::DefaultFuchsiaResourceDialect,
11109            >,
11110            offset: usize,
11111            _depth: fidl::encoding::Depth,
11112        ) -> fidl::Result<()> {
11113            decoder.debug_check_bounds::<Self>(offset);
11114            // Verify that padding bytes are zero.
11115            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
11116            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11117            let mask = 0xffffffff00000000u64;
11118            let maskedval = padval & mask;
11119            if maskedval != 0 {
11120                return Err(fidl::Error::NonZeroPadding {
11121                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
11122                });
11123            }
11124            fidl::decode!(
11125                fidl::encoding::BoundedString<4096>,
11126                fidl::encoding::DefaultFuchsiaResourceDialect,
11127                &mut self.fuzzer_url,
11128                decoder,
11129                offset + 0,
11130                _depth
11131            )?;
11132            fidl::decode!(
11133                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ControllerProviderMarker>>,
11134                fidl::encoding::DefaultFuchsiaResourceDialect,
11135                &mut self.provider,
11136                decoder,
11137                offset + 16,
11138                _depth
11139            )?;
11140            Ok(())
11141        }
11142    }
11143
11144    impl fidl::encoding::ResourceTypeMarker for RegistryConnectRequest {
11145        type Borrowed<'a> = &'a mut Self;
11146        fn take_or_borrow<'a>(
11147            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11148        ) -> Self::Borrowed<'a> {
11149            value
11150        }
11151    }
11152
11153    unsafe impl fidl::encoding::TypeMarker for RegistryConnectRequest {
11154        type Owned = Self;
11155
11156        #[inline(always)]
11157        fn inline_align(_context: fidl::encoding::Context) -> usize {
11158            8
11159        }
11160
11161        #[inline(always)]
11162        fn inline_size(_context: fidl::encoding::Context) -> usize {
11163            32
11164        }
11165    }
11166
11167    unsafe impl
11168        fidl::encoding::Encode<
11169            RegistryConnectRequest,
11170            fidl::encoding::DefaultFuchsiaResourceDialect,
11171        > for &mut RegistryConnectRequest
11172    {
11173        #[inline]
11174        unsafe fn encode(
11175            self,
11176            encoder: &mut fidl::encoding::Encoder<
11177                '_,
11178                fidl::encoding::DefaultFuchsiaResourceDialect,
11179            >,
11180            offset: usize,
11181            _depth: fidl::encoding::Depth,
11182        ) -> fidl::Result<()> {
11183            encoder.debug_check_bounds::<RegistryConnectRequest>(offset);
11184            // Delegate to tuple encoding.
11185            fidl::encoding::Encode::<RegistryConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11186                (
11187                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.fuzzer_url),
11188                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
11189                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timeout),
11190                ),
11191                encoder, offset, _depth
11192            )
11193        }
11194    }
11195    unsafe impl<
11196        T0: fidl::encoding::Encode<
11197                fidl::encoding::BoundedString<4096>,
11198                fidl::encoding::DefaultFuchsiaResourceDialect,
11199            >,
11200        T1: fidl::encoding::Encode<
11201                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
11202                fidl::encoding::DefaultFuchsiaResourceDialect,
11203            >,
11204        T2: fidl::encoding::Encode<i64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11205    >
11206        fidl::encoding::Encode<
11207            RegistryConnectRequest,
11208            fidl::encoding::DefaultFuchsiaResourceDialect,
11209        > for (T0, T1, T2)
11210    {
11211        #[inline]
11212        unsafe fn encode(
11213            self,
11214            encoder: &mut fidl::encoding::Encoder<
11215                '_,
11216                fidl::encoding::DefaultFuchsiaResourceDialect,
11217            >,
11218            offset: usize,
11219            depth: fidl::encoding::Depth,
11220        ) -> fidl::Result<()> {
11221            encoder.debug_check_bounds::<RegistryConnectRequest>(offset);
11222            // Zero out padding regions. There's no need to apply masks
11223            // because the unmasked parts will be overwritten by fields.
11224            unsafe {
11225                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
11226                (ptr as *mut u64).write_unaligned(0);
11227            }
11228            // Write the fields.
11229            self.0.encode(encoder, offset + 0, depth)?;
11230            self.1.encode(encoder, offset + 16, depth)?;
11231            self.2.encode(encoder, offset + 24, depth)?;
11232            Ok(())
11233        }
11234    }
11235
11236    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11237        for RegistryConnectRequest
11238    {
11239        #[inline(always)]
11240        fn new_empty() -> Self {
11241            Self {
11242                fuzzer_url: fidl::new_empty!(
11243                    fidl::encoding::BoundedString<4096>,
11244                    fidl::encoding::DefaultFuchsiaResourceDialect
11245                ),
11246                controller: fidl::new_empty!(
11247                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
11248                    fidl::encoding::DefaultFuchsiaResourceDialect
11249                ),
11250                timeout: fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect),
11251            }
11252        }
11253
11254        #[inline]
11255        unsafe fn decode(
11256            &mut self,
11257            decoder: &mut fidl::encoding::Decoder<
11258                '_,
11259                fidl::encoding::DefaultFuchsiaResourceDialect,
11260            >,
11261            offset: usize,
11262            _depth: fidl::encoding::Depth,
11263        ) -> fidl::Result<()> {
11264            decoder.debug_check_bounds::<Self>(offset);
11265            // Verify that padding bytes are zero.
11266            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
11267            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11268            let mask = 0xffffffff00000000u64;
11269            let maskedval = padval & mask;
11270            if maskedval != 0 {
11271                return Err(fidl::Error::NonZeroPadding {
11272                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
11273                });
11274            }
11275            fidl::decode!(
11276                fidl::encoding::BoundedString<4096>,
11277                fidl::encoding::DefaultFuchsiaResourceDialect,
11278                &mut self.fuzzer_url,
11279                decoder,
11280                offset + 0,
11281                _depth
11282            )?;
11283            fidl::decode!(
11284                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
11285                fidl::encoding::DefaultFuchsiaResourceDialect,
11286                &mut self.controller,
11287                decoder,
11288                offset + 16,
11289                _depth
11290            )?;
11291            fidl::decode!(
11292                i64,
11293                fidl::encoding::DefaultFuchsiaResourceDialect,
11294                &mut self.timeout,
11295                decoder,
11296                offset + 24,
11297                _depth
11298            )?;
11299            Ok(())
11300        }
11301    }
11302
11303    impl fidl::encoding::ResourceTypeMarker for TargetAdapterConnectRequest {
11304        type Borrowed<'a> = &'a mut Self;
11305        fn take_or_borrow<'a>(
11306            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11307        ) -> Self::Borrowed<'a> {
11308            value
11309        }
11310    }
11311
11312    unsafe impl fidl::encoding::TypeMarker for TargetAdapterConnectRequest {
11313        type Owned = Self;
11314
11315        #[inline(always)]
11316        fn inline_align(_context: fidl::encoding::Context) -> usize {
11317            4
11318        }
11319
11320        #[inline(always)]
11321        fn inline_size(_context: fidl::encoding::Context) -> usize {
11322            8
11323        }
11324    }
11325
11326    unsafe impl
11327        fidl::encoding::Encode<
11328            TargetAdapterConnectRequest,
11329            fidl::encoding::DefaultFuchsiaResourceDialect,
11330        > for &mut TargetAdapterConnectRequest
11331    {
11332        #[inline]
11333        unsafe fn encode(
11334            self,
11335            encoder: &mut fidl::encoding::Encoder<
11336                '_,
11337                fidl::encoding::DefaultFuchsiaResourceDialect,
11338            >,
11339            offset: usize,
11340            _depth: fidl::encoding::Depth,
11341        ) -> fidl::Result<()> {
11342            encoder.debug_check_bounds::<TargetAdapterConnectRequest>(offset);
11343            // Delegate to tuple encoding.
11344            fidl::encoding::Encode::<
11345                TargetAdapterConnectRequest,
11346                fidl::encoding::DefaultFuchsiaResourceDialect,
11347            >::encode(
11348                (
11349                    <fidl::encoding::HandleType<
11350                        fidl::EventPair,
11351                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11352                        2147483648,
11353                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11354                        &mut self.eventpair
11355                    ),
11356                    <fidl::encoding::HandleType<
11357                        fidl::Vmo,
11358                        { fidl::ObjectType::VMO.into_raw() },
11359                        2147483648,
11360                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11361                        &mut self.test_input
11362                    ),
11363                ),
11364                encoder,
11365                offset,
11366                _depth,
11367            )
11368        }
11369    }
11370    unsafe impl<
11371        T0: fidl::encoding::Encode<
11372                fidl::encoding::HandleType<
11373                    fidl::EventPair,
11374                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11375                    2147483648,
11376                >,
11377                fidl::encoding::DefaultFuchsiaResourceDialect,
11378            >,
11379        T1: fidl::encoding::Encode<
11380                fidl::encoding::HandleType<
11381                    fidl::Vmo,
11382                    { fidl::ObjectType::VMO.into_raw() },
11383                    2147483648,
11384                >,
11385                fidl::encoding::DefaultFuchsiaResourceDialect,
11386            >,
11387    >
11388        fidl::encoding::Encode<
11389            TargetAdapterConnectRequest,
11390            fidl::encoding::DefaultFuchsiaResourceDialect,
11391        > for (T0, T1)
11392    {
11393        #[inline]
11394        unsafe fn encode(
11395            self,
11396            encoder: &mut fidl::encoding::Encoder<
11397                '_,
11398                fidl::encoding::DefaultFuchsiaResourceDialect,
11399            >,
11400            offset: usize,
11401            depth: fidl::encoding::Depth,
11402        ) -> fidl::Result<()> {
11403            encoder.debug_check_bounds::<TargetAdapterConnectRequest>(offset);
11404            // Zero out padding regions. There's no need to apply masks
11405            // because the unmasked parts will be overwritten by fields.
11406            // Write the fields.
11407            self.0.encode(encoder, offset + 0, depth)?;
11408            self.1.encode(encoder, offset + 4, depth)?;
11409            Ok(())
11410        }
11411    }
11412
11413    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11414        for TargetAdapterConnectRequest
11415    {
11416        #[inline(always)]
11417        fn new_empty() -> Self {
11418            Self {
11419                eventpair: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11420                test_input: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11421            }
11422        }
11423
11424        #[inline]
11425        unsafe fn decode(
11426            &mut self,
11427            decoder: &mut fidl::encoding::Decoder<
11428                '_,
11429                fidl::encoding::DefaultFuchsiaResourceDialect,
11430            >,
11431            offset: usize,
11432            _depth: fidl::encoding::Depth,
11433        ) -> fidl::Result<()> {
11434            decoder.debug_check_bounds::<Self>(offset);
11435            // Verify that padding bytes are zero.
11436            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.eventpair, decoder, offset + 0, _depth)?;
11437            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.test_input, decoder, offset + 4, _depth)?;
11438            Ok(())
11439        }
11440    }
11441
11442    impl Artifact {
11443        #[inline(always)]
11444        fn max_ordinal_present(&self) -> u64 {
11445            if let Some(_) = self.error {
11446                return 3;
11447            }
11448            if let Some(_) = self.input {
11449                return 2;
11450            }
11451            if let Some(_) = self.result {
11452                return 1;
11453            }
11454            0
11455        }
11456    }
11457
11458    impl fidl::encoding::ResourceTypeMarker for Artifact {
11459        type Borrowed<'a> = &'a mut Self;
11460        fn take_or_borrow<'a>(
11461            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11462        ) -> Self::Borrowed<'a> {
11463            value
11464        }
11465    }
11466
11467    unsafe impl fidl::encoding::TypeMarker for Artifact {
11468        type Owned = Self;
11469
11470        #[inline(always)]
11471        fn inline_align(_context: fidl::encoding::Context) -> usize {
11472            8
11473        }
11474
11475        #[inline(always)]
11476        fn inline_size(_context: fidl::encoding::Context) -> usize {
11477            16
11478        }
11479    }
11480
11481    unsafe impl fidl::encoding::Encode<Artifact, fidl::encoding::DefaultFuchsiaResourceDialect>
11482        for &mut Artifact
11483    {
11484        unsafe fn encode(
11485            self,
11486            encoder: &mut fidl::encoding::Encoder<
11487                '_,
11488                fidl::encoding::DefaultFuchsiaResourceDialect,
11489            >,
11490            offset: usize,
11491            mut depth: fidl::encoding::Depth,
11492        ) -> fidl::Result<()> {
11493            encoder.debug_check_bounds::<Artifact>(offset);
11494            // Vector header
11495            let max_ordinal: u64 = self.max_ordinal_present();
11496            encoder.write_num(max_ordinal, offset);
11497            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11498            // Calling encoder.out_of_line_offset(0) is not allowed.
11499            if max_ordinal == 0 {
11500                return Ok(());
11501            }
11502            depth.increment()?;
11503            let envelope_size = 8;
11504            let bytes_len = max_ordinal as usize * envelope_size;
11505            #[allow(unused_variables)]
11506            let offset = encoder.out_of_line_offset(bytes_len);
11507            let mut _prev_end_offset: usize = 0;
11508            if 1 > max_ordinal {
11509                return Ok(());
11510            }
11511
11512            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11513            // are envelope_size bytes.
11514            let cur_offset: usize = (1 - 1) * envelope_size;
11515
11516            // Zero reserved fields.
11517            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11518
11519            // Safety:
11520            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11521            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11522            //   envelope_size bytes, there is always sufficient room.
11523            fidl::encoding::encode_in_envelope_optional::<
11524                Result_,
11525                fidl::encoding::DefaultFuchsiaResourceDialect,
11526            >(
11527                self.result.as_ref().map(<Result_ as fidl::encoding::ValueTypeMarker>::borrow),
11528                encoder,
11529                offset + cur_offset,
11530                depth,
11531            )?;
11532
11533            _prev_end_offset = cur_offset + envelope_size;
11534            if 2 > max_ordinal {
11535                return Ok(());
11536            }
11537
11538            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11539            // are envelope_size bytes.
11540            let cur_offset: usize = (2 - 1) * envelope_size;
11541
11542            // Zero reserved fields.
11543            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11544
11545            // Safety:
11546            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11547            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11548            //   envelope_size bytes, there is always sufficient room.
11549            fidl::encoding::encode_in_envelope_optional::<
11550                Input,
11551                fidl::encoding::DefaultFuchsiaResourceDialect,
11552            >(
11553                self.input
11554                    .as_mut()
11555                    .map(<Input as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11556                encoder,
11557                offset + cur_offset,
11558                depth,
11559            )?;
11560
11561            _prev_end_offset = cur_offset + envelope_size;
11562            if 3 > max_ordinal {
11563                return Ok(());
11564            }
11565
11566            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11567            // are envelope_size bytes.
11568            let cur_offset: usize = (3 - 1) * envelope_size;
11569
11570            // Zero reserved fields.
11571            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11572
11573            // Safety:
11574            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11575            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11576            //   envelope_size bytes, there is always sufficient room.
11577            fidl::encoding::encode_in_envelope_optional::<
11578                i32,
11579                fidl::encoding::DefaultFuchsiaResourceDialect,
11580            >(
11581                self.error.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
11582                encoder,
11583                offset + cur_offset,
11584                depth,
11585            )?;
11586
11587            _prev_end_offset = cur_offset + envelope_size;
11588
11589            Ok(())
11590        }
11591    }
11592
11593    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Artifact {
11594        #[inline(always)]
11595        fn new_empty() -> Self {
11596            Self::default()
11597        }
11598
11599        unsafe fn decode(
11600            &mut self,
11601            decoder: &mut fidl::encoding::Decoder<
11602                '_,
11603                fidl::encoding::DefaultFuchsiaResourceDialect,
11604            >,
11605            offset: usize,
11606            mut depth: fidl::encoding::Depth,
11607        ) -> fidl::Result<()> {
11608            decoder.debug_check_bounds::<Self>(offset);
11609            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11610                None => return Err(fidl::Error::NotNullable),
11611                Some(len) => len,
11612            };
11613            // Calling decoder.out_of_line_offset(0) is not allowed.
11614            if len == 0 {
11615                return Ok(());
11616            };
11617            depth.increment()?;
11618            let envelope_size = 8;
11619            let bytes_len = len * envelope_size;
11620            let offset = decoder.out_of_line_offset(bytes_len)?;
11621            // Decode the envelope for each type.
11622            let mut _next_ordinal_to_read = 0;
11623            let mut next_offset = offset;
11624            let end_offset = offset + bytes_len;
11625            _next_ordinal_to_read += 1;
11626            if next_offset >= end_offset {
11627                return Ok(());
11628            }
11629
11630            // Decode unknown envelopes for gaps in ordinals.
11631            while _next_ordinal_to_read < 1 {
11632                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11633                _next_ordinal_to_read += 1;
11634                next_offset += envelope_size;
11635            }
11636
11637            let next_out_of_line = decoder.next_out_of_line();
11638            let handles_before = decoder.remaining_handles();
11639            if let Some((inlined, num_bytes, num_handles)) =
11640                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11641            {
11642                let member_inline_size =
11643                    <Result_ as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11644                if inlined != (member_inline_size <= 4) {
11645                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11646                }
11647                let inner_offset;
11648                let mut inner_depth = depth.clone();
11649                if inlined {
11650                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11651                    inner_offset = next_offset;
11652                } else {
11653                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11654                    inner_depth.increment()?;
11655                }
11656                let val_ref = self.result.get_or_insert_with(|| {
11657                    fidl::new_empty!(Result_, fidl::encoding::DefaultFuchsiaResourceDialect)
11658                });
11659                fidl::decode!(
11660                    Result_,
11661                    fidl::encoding::DefaultFuchsiaResourceDialect,
11662                    val_ref,
11663                    decoder,
11664                    inner_offset,
11665                    inner_depth
11666                )?;
11667                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11668                {
11669                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11670                }
11671                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11672                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11673                }
11674            }
11675
11676            next_offset += envelope_size;
11677            _next_ordinal_to_read += 1;
11678            if next_offset >= end_offset {
11679                return Ok(());
11680            }
11681
11682            // Decode unknown envelopes for gaps in ordinals.
11683            while _next_ordinal_to_read < 2 {
11684                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11685                _next_ordinal_to_read += 1;
11686                next_offset += envelope_size;
11687            }
11688
11689            let next_out_of_line = decoder.next_out_of_line();
11690            let handles_before = decoder.remaining_handles();
11691            if let Some((inlined, num_bytes, num_handles)) =
11692                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11693            {
11694                let member_inline_size =
11695                    <Input as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11696                if inlined != (member_inline_size <= 4) {
11697                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11698                }
11699                let inner_offset;
11700                let mut inner_depth = depth.clone();
11701                if inlined {
11702                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11703                    inner_offset = next_offset;
11704                } else {
11705                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11706                    inner_depth.increment()?;
11707                }
11708                let val_ref = self.input.get_or_insert_with(|| {
11709                    fidl::new_empty!(Input, fidl::encoding::DefaultFuchsiaResourceDialect)
11710                });
11711                fidl::decode!(
11712                    Input,
11713                    fidl::encoding::DefaultFuchsiaResourceDialect,
11714                    val_ref,
11715                    decoder,
11716                    inner_offset,
11717                    inner_depth
11718                )?;
11719                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11720                {
11721                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11722                }
11723                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11724                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11725                }
11726            }
11727
11728            next_offset += envelope_size;
11729            _next_ordinal_to_read += 1;
11730            if next_offset >= end_offset {
11731                return Ok(());
11732            }
11733
11734            // Decode unknown envelopes for gaps in ordinals.
11735            while _next_ordinal_to_read < 3 {
11736                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11737                _next_ordinal_to_read += 1;
11738                next_offset += envelope_size;
11739            }
11740
11741            let next_out_of_line = decoder.next_out_of_line();
11742            let handles_before = decoder.remaining_handles();
11743            if let Some((inlined, num_bytes, num_handles)) =
11744                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11745            {
11746                let member_inline_size =
11747                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11748                if inlined != (member_inline_size <= 4) {
11749                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11750                }
11751                let inner_offset;
11752                let mut inner_depth = depth.clone();
11753                if inlined {
11754                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11755                    inner_offset = next_offset;
11756                } else {
11757                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11758                    inner_depth.increment()?;
11759                }
11760                let val_ref = self.error.get_or_insert_with(|| {
11761                    fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect)
11762                });
11763                fidl::decode!(
11764                    i32,
11765                    fidl::encoding::DefaultFuchsiaResourceDialect,
11766                    val_ref,
11767                    decoder,
11768                    inner_offset,
11769                    inner_depth
11770                )?;
11771                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11772                {
11773                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11774                }
11775                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11776                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11777                }
11778            }
11779
11780            next_offset += envelope_size;
11781
11782            // Decode the remaining unknown envelopes.
11783            while next_offset < end_offset {
11784                _next_ordinal_to_read += 1;
11785                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11786                next_offset += envelope_size;
11787            }
11788
11789            Ok(())
11790        }
11791    }
11792
11793    impl fidl::encoding::ResourceTypeMarker for Data {
11794        type Borrowed<'a> = &'a mut Self;
11795        fn take_or_borrow<'a>(
11796            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11797        ) -> Self::Borrowed<'a> {
11798            value
11799        }
11800    }
11801
11802    unsafe impl fidl::encoding::TypeMarker for Data {
11803        type Owned = Self;
11804
11805        #[inline(always)]
11806        fn inline_align(_context: fidl::encoding::Context) -> usize {
11807            8
11808        }
11809
11810        #[inline(always)]
11811        fn inline_size(_context: fidl::encoding::Context) -> usize {
11812            16
11813        }
11814    }
11815
11816    unsafe impl fidl::encoding::Encode<Data, fidl::encoding::DefaultFuchsiaResourceDialect>
11817        for &mut Data
11818    {
11819        #[inline]
11820        unsafe fn encode(
11821            self,
11822            encoder: &mut fidl::encoding::Encoder<
11823                '_,
11824                fidl::encoding::DefaultFuchsiaResourceDialect,
11825            >,
11826            offset: usize,
11827            _depth: fidl::encoding::Depth,
11828        ) -> fidl::Result<()> {
11829            encoder.debug_check_bounds::<Data>(offset);
11830            encoder.write_num::<u64>(self.ordinal(), offset);
11831            match self {
11832                Data::Instrumented(ref mut val) => fidl::encoding::encode_in_envelope::<
11833                    InstrumentedProcess,
11834                    fidl::encoding::DefaultFuchsiaResourceDialect,
11835                >(
11836                    <InstrumentedProcess as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11837                        val,
11838                    ),
11839                    encoder,
11840                    offset + 8,
11841                    _depth,
11842                ),
11843                Data::Inline8bitCounters(ref mut val) => fidl::encoding::encode_in_envelope::<
11844                    fidl::encoding::HandleType<
11845                        fidl::Vmo,
11846                        { fidl::ObjectType::VMO.into_raw() },
11847                        2147483648,
11848                    >,
11849                    fidl::encoding::DefaultFuchsiaResourceDialect,
11850                >(
11851                    <fidl::encoding::HandleType<
11852                        fidl::Vmo,
11853                        { fidl::ObjectType::VMO.into_raw() },
11854                        2147483648,
11855                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11856                        val
11857                    ),
11858                    encoder,
11859                    offset + 8,
11860                    _depth,
11861                ),
11862                Data::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
11863            }
11864        }
11865    }
11866
11867    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Data {
11868        #[inline(always)]
11869        fn new_empty() -> Self {
11870            Self::__SourceBreaking { unknown_ordinal: 0 }
11871        }
11872
11873        #[inline]
11874        unsafe fn decode(
11875            &mut self,
11876            decoder: &mut fidl::encoding::Decoder<
11877                '_,
11878                fidl::encoding::DefaultFuchsiaResourceDialect,
11879            >,
11880            offset: usize,
11881            mut depth: fidl::encoding::Depth,
11882        ) -> fidl::Result<()> {
11883            decoder.debug_check_bounds::<Self>(offset);
11884            #[allow(unused_variables)]
11885            let next_out_of_line = decoder.next_out_of_line();
11886            let handles_before = decoder.remaining_handles();
11887            let (ordinal, inlined, num_bytes, num_handles) =
11888                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
11889
11890            let member_inline_size = match ordinal {
11891                1 => <InstrumentedProcess as fidl::encoding::TypeMarker>::inline_size(
11892                    decoder.context,
11893                ),
11894                2 => <fidl::encoding::HandleType<
11895                    fidl::Vmo,
11896                    { fidl::ObjectType::VMO.into_raw() },
11897                    2147483648,
11898                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11899                0 => return Err(fidl::Error::UnknownUnionTag),
11900                _ => num_bytes as usize,
11901            };
11902
11903            if inlined != (member_inline_size <= 4) {
11904                return Err(fidl::Error::InvalidInlineBitInEnvelope);
11905            }
11906            let _inner_offset;
11907            if inlined {
11908                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
11909                _inner_offset = offset + 8;
11910            } else {
11911                depth.increment()?;
11912                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11913            }
11914            match ordinal {
11915                1 => {
11916                    #[allow(irrefutable_let_patterns)]
11917                    if let Data::Instrumented(_) = self {
11918                        // Do nothing, read the value into the object
11919                    } else {
11920                        // Initialize `self` to the right variant
11921                        *self = Data::Instrumented(fidl::new_empty!(
11922                            InstrumentedProcess,
11923                            fidl::encoding::DefaultFuchsiaResourceDialect
11924                        ));
11925                    }
11926                    #[allow(irrefutable_let_patterns)]
11927                    if let Data::Instrumented(ref mut val) = self {
11928                        fidl::decode!(
11929                            InstrumentedProcess,
11930                            fidl::encoding::DefaultFuchsiaResourceDialect,
11931                            val,
11932                            decoder,
11933                            _inner_offset,
11934                            depth
11935                        )?;
11936                    } else {
11937                        unreachable!()
11938                    }
11939                }
11940                2 => {
11941                    #[allow(irrefutable_let_patterns)]
11942                    if let Data::Inline8bitCounters(_) = self {
11943                        // Do nothing, read the value into the object
11944                    } else {
11945                        // Initialize `self` to the right variant
11946                        *self = Data::Inline8bitCounters(
11947                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11948                        );
11949                    }
11950                    #[allow(irrefutable_let_patterns)]
11951                    if let Data::Inline8bitCounters(ref mut val) = self {
11952                        fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
11953                    } else {
11954                        unreachable!()
11955                    }
11956                }
11957                #[allow(deprecated)]
11958                ordinal => {
11959                    for _ in 0..num_handles {
11960                        decoder.drop_next_handle()?;
11961                    }
11962                    *self = Data::__SourceBreaking { unknown_ordinal: ordinal };
11963                }
11964            }
11965            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
11966                return Err(fidl::Error::InvalidNumBytesInEnvelope);
11967            }
11968            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11969                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11970            }
11971            Ok(())
11972        }
11973    }
11974}