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